Hi Ioannis,

You could make a mapping of rank to residue selection and then sort that by 
rank. Something like this:

from pymol import cmd, stored
stored.mydict = {}
cmd.iterate("guide", "stored.mydict[rank] = f'///{chain}/{resi}'")
for rank, sele in sorted(stored.mydict.items()):
    cmd.iterate(sele, "print(chain, resi, resn, name)")


Cheers,
  Thomas


> On Jan 13, 2021, at 10:38 AM, Ioannis G. Riziotis <rizio...@ebi.ac.uk> wrote:
> 
> Hello,
> 
> Is there any way to iterate over residues by index in the PDB file (not resi, 
> but the absolute order of the residues in the pdb). Something like the 
> equivalent of ‘rank’ for atoms, but in residue level.
> 
> Best,
> Ioannis
> 
> 
> _______________________________________________
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe: 
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.



_______________________________________________
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Reply via email to