I asked a similar question a while ago, and Kristan Rother archived the
answer at <http://www.rubor.de/bioinf/tips_python.html#insel>. Here it
is:
Using PyMOL commands:
list=[]
iterate (name ca),list.append((resi,resn))
print list
[('ASP', '1'), ('CYS', '2'), ('ALA', '3'), ('TRP', '4'), ('HIS', '5'), ('LEU',
'6'), ('GLY', '7'), ('GLU', '8'), ('LEU', '9'), ('VAL', '10'), ('TRP', '11'),
('CYS', '12'), ('THR', '13')]
or using a Python script (in PyMOL):
from pymol import cmd,stored
stored.list=[]
cmd.iterate("(name ca)","stored.list.append((resi,resn))")
print stored.list
[('1', 'ASP'), ('2', 'CYS'), ('3', 'ALA'), ('4', 'TRP'), ('5', 'HIS'), ('6', '
LEU'), ('7', 'GLY'), ('8', 'GLU'), ('9', 'LEU'), ('10', 'VAL'), ('11', 'TRP'),
('12', 'CYS'), ('13', 'THR')]
--
www.umich.edu/~mlerner | _ |Michael Lerner
This isn't a democracy;| ASCII ribbon campaign ( ) | Michigan
it's a cheer-ocracy. | - against HTML email X | Biophysics
-Torrence, Bring It On| / \ | mler...@umich
On Wed, 6 Jul 2005, Sebastien Gerega wrote:
Is there a way to list the residues that are in a selection? For example if I
use the command "select near, sel01 around 6" how can I obtain a list of the
residues in the "near" selection?
thanks,
Sebastien
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users