[Chimera-users] printing "zone" search

Eric Pettersen pett at cgl.ucsf.edu
Fri Dec 14 11:26:53 PST 2007


On Dec 14, 2007, at 8:23 AM, Ryan wrote:

> I am actually currently interested in doing something similar to  
> Francesco's previous question about writing out a list of residue  
> names within a certain zone of a ligand -- however i would like to  
> do this from a Python script.
>
> I tried to find the zone selection command to use in a script, but  
> could not.  Would it be easiest to just use the runCommand('z<')  
> function to select a zone?

Using runCommand() would be by far the easiest and is what I would  
recommend.  Nonetheless, there are alternatives.  I've appended a  
script that finds all NZ atoms of lysines that are within 8 angstroms  
of an NZ of a different lysine.  It calls into the underlying  
chimera.specifier.zone() function since it needs to do additional  
processing to exclude each lysine's own NZ atom when examining the  
zones for NZs within 8 angstroms.

If efficiency is important (and it doesn't sound like it really is  
from your description) you would want to consider using the  
_closepoints module to quickly eliminate most atoms that aren't in  
the zone, but then you have to process the remainder to ensure that  
they meet the zone criteria (some remaining ones won't).  Look at the  
start of the detectClash() function in DetectClash/__init__.py for an  
example.

> Also, when the zone is selected, are the selected residue names  
> stored in a list?  If so, how can i access this list to print out  
> the residue names into an output file of my own?

chimera.selection.currentResidues() returns such a list.

--Eric



More information about the Chimera-users mailing list