Dear Tomoko,

On Tue, 18 Sep 2007 21:40:34 +0900 (JST), Tomoko Niwa
<outp...@yahoo.co.jp> wrote:

>   Dear all
>    
>   I am a beginner in Python programming.
>   I would like to get lists of resn (residue names), resi (residue
> identifiers) and atom ID of a selection. 
>   For example, in case of 1IEP_organic;
>   [STI, STI], [201, 202], and [4639, 4640, 4641, …..] for resn, resi, and
> atom ID, respectively. 

You can use the iterate command to get this.  If you have a particular
selection called "1IEP_organic" then you can type this at the PyMOL prompt:

iterate 1IEP_organic, print resn, resi, name

If you want to print it in a more nicely formatted manner you could do:

iterate 1IEP_organic, print "%4s %4s %4s" % (resn,resi,name)

Cheers,
Rob
-- 
Robert L. Campbell, Ph.D.
Senior Research Associate/Adjunct Assistant Professor 
Botterell Hall Rm 644
Department of Biochemistry, Queen's University, 
Kingston, ON K7L 3N6  Canada
Tel: 613-533-6821            Fax: 613-533-2497
<robert.campb...@queensu.ca>    http://pldserver1.biochem.queensu.ca/~rlc

Reply via email to