From: DeLano, W. <wa...@su...> - 2002-03-25 17:37:48
|
> From: Eckhart Guth=F6hrlein=20 > I'm trying to use pymol for the display of pdb files=20 > containing multiple=20 > models using the MODEL card. Indeed, pymol reads in all=20 > models in the file. > Currently, I'm able to switch between them using the frame=20 > command. Is=20 > there a different way to do this? Something like next_model or=20 > prev_model or show_model ...? > Furthermore, I tried to use the selection command to access models. =20 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) >=20 > leads to >=20 > SelectorSelect1-Error: Invalid Model > PyMOL: abrupt program termination That's a flat-out bug. Thanks for finding it. =20 > although model 10 exists and has been read in, as shown before by the=20 > 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=20 > available objects? Like sequence, secondary structure, how many=20 > models/chains/ etc.? And the current properties like colour,=20 > charge etc.=20 > of an atom selection? I just browsed the manual very quickly,=20 > so sorry=20 > 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=3Dvdw*0.5 alter (all),resi=3Dint(resi)+10 alter (chain E),chain=3D'C' alter_state 1,(all),x=3Dx+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 =3D cmd.get_model('old') m.atom[0].name=3D'C1' cmd.load_model(m,'new') Cheers, Warren |