On Wednesday 03 December 2003 22:25, Gwendowlyn S. Knapp wrote:
> Maybe I didn't word my question right. I have several proteins (like
> 15-20) that i need to do this for and i also have these lists. i was
> wanting to see if there was anyway to have pymol read in that list
> automatically so i didn't have to type in all the residues (ie, about 60
> on each protein).

OK , here's a third possiblity. This little Python script
----------
from sys import stdin,stdout

stdout.write("select group,(protein and chain A and resi ")

first = 1

for line in stdin.readlines():
        if not first: stdout.write(",")
        stdout.write( line[:-1] )
        first = 0

stdout.write(")\n")
----------

when used as "python make_select.py < list > list.pml" will transform a list 
of residues like
5
10
50
51
52
100

into a single-line PyMol command

select group,(protein and chain A and resi 5,10,50,51,52,100)

which can be copied/pasted into PyMol, or read from the file with "@list.pml".


-- 
Lieven Buts
Department of Ultrastructure
Vrije Universiteit Brussel


Reply via email to