Tina,

> I have two operations that I want to perform, and am not aware of a
simple
> way
> (if possible) of doing them. So here it goes:
> 
> 1. how (if possible) to retrieve the color for a residue as identified
in
> an
> expression, e.g. "resi 9"? Note that it's not a range so no multiple
> answers
> is possible. I guess the question could extend to other attributes
like
> representation, etc. The reason I need that is to be able to switch
back
> to a
> residue's original color after highlighting it in another.

The iterate command can do this...

iterate all, print color

import pymol
pymol.color_list = []
iterate all, color_list.append(color)
print pymol.color_list

> 2. how to select all non-natural residues (anything that's not in the
list
> of
> 20 standard AAs)?
> 
> I'm going the brute-force way, i.e.
> 
> naturals1='asp+glu+lys+arg+phe+tyr+cys+met+ser+thr'
> naturals2='asn+gln+leu+val+ile+gly+ala+his+trp+pro'
> select naturals1, resn naturals1
> select naturals2, resn naturals2
> select nonnaturals, !naturals1 & !naturals2

Does the above work?  I wouldn't expect variables to function in PyMOL
statements, but perhaps you're actually using cmd.select(...), which can
access variables.  

However, you don't need to brake it up quite so much:

select naturals, resn asp+glu+lys+arg+phe+tyr+cys+met+ser+thr \
or resn asn+gln+leu+val+ile+gly+ala+his+trp+pro 

select nonnaturals, !naturals

Cheers,
Warren




Reply via email to