From: Warren D. <wa...@de...> - 2006-02-17 02:58:53
|
Satya, Hmm...for maximum performance, I'd recommend creating a fake PDB file with a single HETATM entry for each protein/sphere. =20 You'll get much better load performance than with CGOs, you can stick a radius value in the B or Q column if you need it, you can defer builds (set defer_builds_mode,1) or if you have a nice graphics card you can use "sphere_mode,5" for pixel-perfect spheres. Cheers, Warren PS. No there isn't a CGO callback...just for PyOpenGL. -- Warren L. DeLano, Ph.D. =20 Principal Scientist . DeLano Scientific LLC =20 . 400 Oyster Point Blvd., Suite 213 =20 . South San Francisco, CA 94080 USA =20 . Biz:(650)-872-0942 Tech:(650)-872-0834 =20 . Fax:(650)-872-0273 Cell:(650)-346-1154 . mailto:wa...@de... =20 =20 > -----Original Message----- > From: pym...@li...=20 > [mailto:pym...@li...] On Behalf Of=20 > Satya Arjunan > Sent: Thursday, February 16, 2006 6:11 PM > To: EPF (Esben Peter Friis); pym...@li... > Subject: Re: [PyMOL] movie of diffusion of atoms/molecules >=20 > Hi Esben and List, >=20 > Thank you for your answering my questions. I realize now that=20 > it would be better to just represent a molecule as a sphere=20 > with diameter corresponding to the protein's diameter because=20 > like you said, with 4000 molecules, I don't need atomistic detail. >=20 > Here is my situation: I now have a file with 100 frames, each=20 > frame has the 3D coordinates of 4000 spheres obtained from my=20 > simulator. Right now I have found a way to load the=20 > coordinates as cgo objects for each frame as shown in the=20 > script below. The problem is that Pymol needs to load all the=20 > frames before it can start playing the movie, which requires=20 > a lot of memory when considering 4000 spheres * 100 frames.=20 > Is there any callback function that is called when Pymol=20 > wants to move to the next frame? With such a function, I can=20 > clear the previous frames in the memory using cmd.delete and=20 > load a new frame from the file. >=20 > I appreciate if there is any other solution for the above=20 > problem. Thanks! >=20 > satya >=20 >=20 >=20 >=20 > import string > import random > from pymol.cgo import * > from pymol import cmd >=20 > axes =3D [ > LINEWIDTH, 3.0, > BEGIN, LINES, > COLOR, 0.2, 1.0, 0.2, >=20 > VERTEX, 0.0, 0.0, 0.0, > VERTEX, 100.0, 0.0, 0.0, >=20 > COLOR, 1.0, 0.2, 0.2, > VERTEX, 0.0, 0.0, 0.0, > VERTEX, 0.0, 100.0, 0.0, > =20 > COLOR, 0.2, 0.2, 1.0, =20 > VERTEX, 0.0, 0.0, 0.0, > VERTEX, 00, 0.0, 100.0, > END > ] >=20 >=20 >=20 > c=3D0 > for a in xrange(0,100): > balls =3D [] > for i in xrange(0,40): > balls.extend([COLOR, > random.randrange(0,10,1)/10.0, > random.randrange(0,10,1)/10.0, > random.randrange(0,10,1)/10.0, > SPHERE, > random.randint(0,100), > random.randint(0,100), > random.randint(0,100), > 1,]) > obj =3D axes + balls > cmd.load_cgo(obj,'cgo01',c) > c =3D c + 1 >=20 > pdb_list =3D [ > "HETATM 1 X UNK 1 %8.3f%8.3f%8.3f 1.00=20 > 10.00\n"%(3.2,0,0), > "HETATM 2 Y UNK 2 %8.3f%8.3f%8.3f 1.00=20 > 10.00\n"%(0,3.2,0), > "HETATM 3 Z UNK 3 %8.3f%8.3f%8.3f 1.00=20 > 10.00\n"%(0,0,3.2), > ] > cmd.read_pdbstr(string.join(pdb_list,''),'lab2') > cmd.hide('(lab2)') > cmd.label('lab2','name') > cmd.color('white','lab2') > cmd.zoom('cgo01') > cmd.clip('far',-5) >=20 > > > > Hi Satya > > > > You can use the command "translate" to move the individual=20 > objects in=20 > > pymol. Is takes a list of 3 floating points numbers as the=20 > > translational vector. > > > > I don't know how Pymol would handle 4000 objects, but an=20 > alternative=20 > > might be to load them as states within one object, and then use the=20 > > "show all states" command from the "Movie" menu. The "translate" > > command can also move the individual states independently. (If you=20 > > also need to rotate the molecules, it gets more difficult :-) > > > > Another suggestion: If you have 4000 proteins, you may not=20 > need a very=20 > > high level of detail for each molecule. You could save a lot by=20 > > loading only the alpha carbon atoms and then increase their=20 > vdw-size=20 > > to make them "stick" together: > > > > pymol> alter my_object, vdw=3D3.0 > > pymol> show spheres, my_object > > pymol> sort > > > > > > Cheers, > > > > Esben > > > > > > -----Original Message----- > > From: pym...@li... on behalf of Satya=20 > > Arjunan > > Sent: Sat 2006-02-11 03:56 > > To: pym...@li... > > Subject: [PyMOL] movie of diffusion of atoms/molecules > > > > Hi all, > > > > I would like to use Pymol to visualize 3D simulation of=20 > lattice-based=20 > > diffusion of molecules. The simulator provides the 3D=20 > coordinates (or=20 > > the translational direction since they have fixed diffusion=20 > distance)=20 > > of the molecules at everytime step. At the end of the simulation, I=20 > > would like to feed the coordinates (or the translational=20 > direction) to=20 > > Pymol using a python script and make a movie of this. > > > > What is a good way of implementing this with Pymol with lowest=20 > > computational cost because there are about 4000 protein molecules=20 > > altogether? I have come across a sample script at=20 > > http://www.rubor.de/bioinf/tips_python.html#chempy which I=20 > think I can=20 > > use to place the atoms/molecules in pymol. I am wondering=20 > if there is=20 > > any other cost effective way of implementing this? Is it=20 > possible just=20 > > to provide the translational angle and distance for certain=20 > molecules=20 > > already in the model? > > > > Thanks in advance. > > satya > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep=20 > through log=20 > > files for problems? Stop! Download the new AJAX search=20 > engine that=20 > > makes searching your log files as easy as surfing the web.=20 > DOWNLOAD=20 > > SPLUNK! > >=20 > = http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat=3D= 1216 > > 42=20 > >=20 > = <http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat=3D= 121 > > 642> _______________________________________________ > > PyMOL-users mailing list > > PyM...@li... > > https://lists.sourceforge.net/lists/listinfo/pymol-users > > >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep=20 > through log files for problems? Stop! Download the new AJAX=20 > search engine that makes searching your log files as easy as=20 > surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486& > dat=3D121642 > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users >=20 >=20 >=20 >=20 |