Satya,

Hmm...for maximum performance, I'd recommend creating a fake PDB file
with a single HETATM entry for each protein/sphere.  

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.                     
Principal Scientist

. DeLano Scientific LLC  
. 400 Oyster Point Blvd., Suite 213           
. South San Francisco, CA 94080 USA   
. Biz:(650)-872-0942  Tech:(650)-872-0834     
. Fax:(650)-872-0273  Cell:(650)-346-1154
. mailto:war...@delsci.com      
 

> -----Original Message-----
> From: pymol-users-ad...@lists.sourceforge.net 
> [mailto:pymol-users-ad...@lists.sourceforge.net] On Behalf Of 
> Satya Arjunan
> Sent: Thursday, February 16, 2006 6:11 PM
> To: EPF (Esben Peter Friis); pymol-users@lists.sourceforge.net
> Subject: Re: [PyMOL] movie of diffusion of atoms/molecules
> 
> Hi Esben and List,
> 
> Thank you for your answering my questions. I realize now that 
> it would be better to just represent a molecule as a sphere 
> with diameter corresponding to the protein's diameter because 
> like you said, with 4000 molecules, I don't need atomistic detail.
> 
> Here is my situation: I now have a file with 100 frames, each 
> frame has the 3D coordinates of 4000 spheres obtained from my 
> simulator. Right now I have found a way to load the 
> coordinates as cgo objects for each frame as shown in the 
> script below. The problem is that Pymol needs to load all the 
> frames before it can start playing the movie, which requires 
> a lot of memory when considering 4000 spheres * 100 frames. 
> Is there any callback function that is called when Pymol 
> wants to move to the next frame? With such a function, I can 
> clear the previous frames in the memory using cmd.delete and 
> load a new frame from the file.
> 
> I appreciate if there is any other solution for the above 
> problem. Thanks!
> 
> satya
> 
> 
> 
> 
> import string
> import random
> from pymol.cgo import *
> from pymol import cmd
> 
> axes = [
>         LINEWIDTH, 3.0,
>         BEGIN, LINES,
>         COLOR, 0.2, 1.0, 0.2,
> 
>         VERTEX, 0.0, 0.0, 0.0,
>         VERTEX, 100.0, 0.0, 0.0,
> 
>         COLOR, 1.0, 0.2, 0.2,
>         VERTEX, 0.0, 0.0, 0.0,
>         VERTEX, 0.0, 100.0, 0.0,
>        
>         COLOR, 0.2, 0.2, 1.0,  
>         VERTEX, 0.0, 0.0, 0.0,
>         VERTEX, 00, 0.0, 100.0,
>         END
>         ]
> 
> 
> 
> c=0
> for a in xrange(0,100):
>     balls = []
>     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 = axes + balls
>     cmd.load_cgo(obj,'cgo01',c)
>     c = c + 1
> 
> pdb_list = [
>             "HETATM    1  X   UNK     1    %8.3f%8.3f%8.3f  1.00 
> 10.00\n"%(3.2,0,0),
>             "HETATM    2  Y   UNK     2    %8.3f%8.3f%8.3f  1.00 
> 10.00\n"%(0,3.2,0),
>             "HETATM    3  Z   UNK     3    %8.3f%8.3f%8.3f  1.00 
> 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)
> 
> >
> > Hi Satya
> >
> > You can use the command "translate" to move the individual 
> objects in 
> > pymol. Is takes a list of 3 floating points numbers as the 
> > translational vector.
> >
> > I don't know how Pymol would handle 4000 objects, but an 
> alternative 
> > might be to load them as states within one object, and then use the 
> > "show all states" command from the "Movie" menu. The "translate"
> > command can also move the individual states independently. (If you 
> > also need to rotate the molecules, it gets more difficult :-)
> >
> > Another suggestion: If you have 4000 proteins, you may not 
> need a very 
> > high level of detail for each molecule. You could save a lot by 
> > loading only the alpha carbon atoms and then increase their 
> vdw-size 
> > to make them "stick" together:
> >
> > pymol> alter my_object, vdw=3.0
> > pymol> show spheres, my_object
> > pymol> sort
> >
> >
> > Cheers,
> >
> > Esben
> >
> >
> > -----Original Message-----
> > From: pymol-users-ad...@lists.sourceforge.net on behalf of Satya 
> > Arjunan
> > Sent: Sat 2006-02-11 03:56
> > To: pymol-users@lists.sourceforge.net
> > Subject: [PyMOL] movie of diffusion of atoms/molecules
> >
> > Hi all,
> >
> > I would like to use Pymol to visualize 3D simulation of 
> lattice-based 
> > diffusion of molecules. The simulator provides the 3D 
> coordinates (or 
> > the translational direction since they have fixed diffusion 
> distance) 
> > of the molecules at everytime step. At the end of the simulation, I 
> > would like to feed the coordinates (or the translational 
> direction) to 
> > Pymol using a python script and make a movie of this.
> >
> > What is a good way of implementing this with Pymol with lowest 
> > computational cost because there are about 4000 protein molecules 
> > altogether? I have come across a sample script at 
> > http://www.rubor.de/bioinf/tips_python.html#chempy which I 
> think I can 
> > use to place the atoms/molecules in pymol. I am wondering 
> if there is 
> > any other cost effective way of implementing this? Is it 
> possible just 
> > to provide the translational angle and distance for certain 
> molecules 
> > already in the model?
> >
> > Thanks in advance.
> > satya
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep 
> through log 
> > files for problems?  Stop!  Download the new AJAX search 
> engine that 
> > makes searching your log files as easy as surfing the  web. 
>  DOWNLOAD 
> > SPLUNK!
> > 
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=1216
> > 42 
> > 
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121
> > 642> _______________________________________________
> > PyMOL-users mailing list
> > PyMOL-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/pymol-users
> >
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep 
> through log files for problems?  Stop!  Download the new AJAX 
> search engine that makes searching your log files as easy as 
> surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&;
> dat=121642
> _______________________________________________
> PyMOL-users mailing list
> PyMOL-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pymol-users
> 
> 
> 
> 

Reply via email to