From: DeLano, W. <wa...@su...> - 2002-10-17 22:53:18
|
Atom selections aren't directly exposed to Python, but you can have = PyMOL build a Python list containing whatever information you need: Using PyMOL commands: list=3D[] 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'),=20 ('CYS', '12'), ('THR', '13')] or using a Python script (in PyMOL): from pymol import cmd,stored stored.list=3D[] 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'),=20 ('12', 'CYS'), ('13', 'THR')] Cheers, Warren > -----Original Message----- > From: ml...@um... [mailto:ml...@um...] > Sent: Thursday, October 17, 2002 12:03 PM > To: pym...@li... > Subject: [PyMOL] What's in a selection >=20 >=20 >=20 >=20 > Hi, >=20 > How can I tell which atoms are in a selection? For example,=20 > I've opened up a > pdb file and selected all non-backbone atoms within five=20 > angstroms of the active > site. Now I want to get a list of the atoms in that=20 > selection. My selection > was called "nearby" and I tried "print nearby" but got a NameError. >=20 > Sorry if the answer's obvious and I've just missed it. >=20 > thanks, >=20 > -michael >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by: viaVerio will pay you up to > $1,000 for every account that you consolidate with us. > http://ad.doubleclick.net/clk;4749864;7604308;v? > http://www.viaverio.com/consolidator/osdn.cfm > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users >=20 |