Hi Roberto,

It's nice to see people learning how to script and putting PyMOL
through its paces.

> trying to use a pseudoatom as label I met several problems:
>
> 1) How to move the label (pseudoatom) to a target residue?
>        Is there a simple command to do?

The easiest way would be to get the coordinates of the target residue,
I'd choose the alpha carbon (replace "X" with your residue number):

# query residue X's alpha carbon, store the position in targetResPosition

targetResPosition = cmd.get_atom_coords("resi X and n. CA")

# next, just assign that position to the pseudoatom:

cmd.alter_state(1, "myPseudoAtom", "(x,y,z) = targetResPosition")


> 2) How to change the label without messaging the user?
>        The 'label' command appears not have a 'quiet' option.

This is interesting, and not what I'd expect from PyMOL, however it works:

# make a new text label as a Python string

newLabel = "New Pseudoatom label"

# assign that label

cmd.label("myPseudoAtom", "newLabel")

Interestingly, PyMOL picks up the 2nd parameter as a variable name.
Also, label does have a quiet option:

# assign that label, quietly

cmd.label("myPseudoAtom", "newLabel", quiet=1)



> 3)  (less important) How to hide the pseudoatom?
>        I wish not have the pseudoatom listed among models in the GUI panel.

To hide a pseudoatom (just the + symbol):

hide nonbonded, myPseudoAtom

# or, just hide the labels

hide labels, myPseudoAtom

# or, hide all

hide everything, myPseudoAtom


> 4)  (less important)  I need to execute all these operations by script (mdo
> commands during a movie)
>        To simplify the movie I wish use only one mdo command
>
> def doAll()
>    .. all my script here ..
>
>        extending the cmd just before the movie start
>
> cmd.extend('doAll',  doAll)
>
>        and clearing the cmd just at the end of the movie but I don't know
> how.
>        Is there a way to clear a command?

The mdo command takes a frame number and a string.  For that frame it
stores the string, and then applies it prior to setting the scene.
PyMOL overwrites the string each time, so you need to cache all your
commands for one frame and use the mdo command once per fram.  Create
a small class that stores all the mdo commands as one string.  Then,
when you want those command executed ask the class to call mdo on the
given frame, using that long string.  That might look something like:


mcache 50, "show sticks"

mcache 50, "as spheres, het"

mcache 50, "show surface, poly within 10 or org"

...

store scenes, plan movie, etc.

...

mCacheApply 50

I made something similar for making movie fades, just cache the string
an apply it when necessary.

Cheers,

-- Jason

-- 
Jason Vertrees, PhD
PyMOL Product Manager
Schrodinger, LLC

(e) jason.vertr...@schrodinger.com
(o) +1 (603) 374-7120

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to