> From: Eckhart Guthöhrlein 

> I'm trying to use pymol for the display of pdb files 
> containing multiple 
> models using the MODEL card. Indeed, pymol reads in all 
> models in the file.
> Currently, I'm able to switch between them using the frame 
> command. Is 
> there a different way to do this? Something like next_model or 
> prev_model or show_model ...?
> Furthermore, I tried to use the selection command to access models.
 
The model operation in the selection command allows you to select objects by 
number -- not models in the sense of multi-model PDB files.  The first PDB file 
you load is model 1, the second is model 2, etc.  Sorry for the confusion.  
Model was a bad choice in terminology and should be replaced with an "object" 
operator instead.  However, the chemical python package uses "model" instead of 
object, so it's probably a hopeless case.

PyMOL treats multi-model PDB files like trajectories, in that each model is one 
state of the trajectory.  You can display them as a series of frames as you 
were doing.  You can use the left and right arrow keys to iterate through, or 
the forward and back commands, or press the play button.  You can use "mset" to 
display states in a different order, etc. 

> color red,(model 10)
> 
> leads to
> 
> SelectorSelect1-Error: Invalid Model
>   PyMOL: abrupt program termination

That's a flat-out bug.  Thanks for finding it.  

> although model 10 exists and has been read in, as shown before by the 
> message

As I indicated above, model/object 10 doesn't actually exist, but PyMOL 
certainly shouldn't crash...I'll fix that.

> How to access models in an atom selection?

You can't address atoms individually in one model or another without breaking 
them into separate objects.  You can do this using a Python loop and use the 
create command after loading the model file.

When you create an atom selection, you are essentially selecting all states of 
those atoms.  However, many commands take a "state" argument, which is the 
1-based index for which state you wish to operate on for the atom selection.  
This is what allows you to change the conformations of atoms in a particular 
state, for instance.  NOTE the PyMOL's atom selections can span any number of 
objects...

> Another question: Is there a way to list details about the currently 
> available objects? Like sequence, secondary structure, how many 
> models/chains/ etc.? And the current properties like colour, 
> charge etc. 
> of an atom selection? I just browsed the manual very quickly, 
> so sorry 
> if I overlooked the information.

The manual stinks.  Some volunteer with more time than myself needs to team up 
with me to create a decent manual -- but one can't complain too much about free 
software.  I can think of more than one company that will sell you an expensive 
closed-source license similar packages, and still not provide you with a decent 
manual.  If you prefer DeLano Scientific's open-source approach, then be sure 
to support it with effort or funding.

The key commands are "alter", "alter_state", "iterate", and "label" -- and they 
represent the heart of PyMOL's built-in atom property manipulation capability.  
However, there are a bunch of other commands for manipulating coordinates and 
geometries.

iterate (all),print name
iterate (all),print color
iterate (all),print partial_charge
iterate (name ca),print resn,resi,s

alter (all),vdw=vdw*0.5
alter (all),resi=int(resi)+10
alter (chain E),chain='C'

alter_state 1,(all),x=x+2.0

label (name ca),resi

label (all),name
label (all),"%1.2f"%vdw

In all cases, a Python expression is evaluated for each atom in the selection.

See "help iterate", etc., but note that the docs are incomplete.  To see all 
the properties which can be printed or altered, load a model and then try:

iterate (index 1),print locals().keys()

Note that you can also obtain and manipulate a complete copy of any model (erg, 
object) at the Python level, using Python code like:

from pymol import cmd

m = cmd.get_model('old')
m.atom[0].name='C1'
cmd.load_model(m,'new')

Cheers,
Warren








Reply via email to