RE: [PyMOL] Reconstructing selections

2004-09-23 Thread Warren DeLano
> i) Is there any guarantee that atoms are stored internally in 
> the same order that they appear in the PDB file?

set retain_order
sort

However, that's not really necessary:

> ii) If so, is there any way to directly construct a selection 
> containing e.g. atoms 1,3,8,10,11... of a given object?

select my_sel, my_object and id 1+3+8+10+11

> ... and of course any other comments or advice are most welcome!

In addition to "id" there is a new operator "rank" (0.98beta+) which gives
the literal order in the input source.  "id" actually uses the PDB atom
ids...which can be a problem with PDB files that don't have IDs.

Cheers,
Warren





[PyMOL] Reconstructing selections

2004-09-08 Thread Gareth Stockwell
I'm using PyMOL as my main visualisation tool, and have a question
relating to the transfer of data from my application to the viewer.

Inside my programs, I typically have a number of molecule objects, and
on each molecule, have made a number of selections (of atoms, of
residues or of chains).  Now what I want to do is to visualise this
information using PyMOL.  

Loading the coordinates themselves is simple - I just write out a PDB
file from my program for each molecule, and load that into PyMOL. 
However, reproducing the selections is more tricky.  At the moment, I am
writing out a PyMOL script which selects each atom/residue/chain by
name, something like

cmd.select("first_selection", "(my_protein & c;A & i;123) or (my_protein
& c;A & i;136) or ... ")

Clearly, however, this is inefficient.  What I'd like to know is:

i) Is there any guarantee that atoms are stored internally in the same
order that they appear in the PDB file?
ii) If so, is there any way to directly construct a selection containing
e.g. atoms 1,3,8,10,11... of a given object?

... and of course any other comments or advice are most welcome!

Gareth

-- 
Gareth Stockwell 
European Bioinformatics Institute