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).
I see two possibilities: 1) write a PyMol function to read the residue list and make the appropriate selections. I do not have enough experience to do this yet. 2) use an editor or script to transform the residue list into a PyMol select command that can be sourced. If the residue list looks like this: 5 10 50 51 52 100 in a file "list" then a command like sed -e "s/^/(protein and resi /" -e "s/$/) or \\\/" list > list.pml will create a file "list.pml" like this: (protein and resi 5) or \ (protein and resi 10) or \ (protein and resi 50) or \ (protein and resi 51) or \ (protein and resi 52) or \ (protein and resi 100) or \ The "^" in the sed command means "beginning of the line", the "$" means "end of the line". The backslash at the end of each line indicates that the command continues on the next line. There should be no characters after the backslash (other than the newline). Two manual edits transform this into select group,((protein and resi 5) or \ (protein and resi 10) or \ (protein and resi 50) or \ (protein and resi 51) or \ (protein and resi 52) or \ (protein and resi 100) ) Note the additional parentheses around the complete expression. This can be executed in PyMol by typing "@list.pml" and should select the indicated residues in the molecule "protein". Hope this helps, -- Lieven Buts Department of Ultrastructure Vrije Universiteit Brussel