[chimera-dev] [Chimera-users] ChemGroups

Eric Pettersen pett at cgl.ucsf.edu
Tue Apr 27 10:45:02 PDT 2010


On Apr 27, 2010, at 7:05 AM, Mauro Truglio wrote:

> Hi,
> I got to understand the syntax to edit and even create "new"  
> chemical groups for chimera to select (I successfully edited the  
> file __init__.py in ChemGroups). Now I'm facing this problem with  
> aromatic amines: when selecting, for example, primary aromatic  
> amine, I'd like to include also che C atom in the selection - not  
> only N,H,H.
> With other chemical groups this was easy, thanks to the [1,1,1,0,1]- 
> like notation. But these aromatic amines are described in a  
> different way, through the function findAroAmines in miscFind.py,  
> and I'm finding it difficult to edit it.
> Can you help me?

Hi Mauro,
	Yes, it wasn't easy (or maybe even possible) to describe aromatic  
amines (and a few other groups) using the notation used for most  
groups -- they required a custom function.  Nonetheless the change you  
desire is pretty simple.  In the part of the code that finds the  
aromatic carbon attached to the nitrogen, also add the carbon to the  
list of atoms included in the amine.  So this code:

                                 if bonded.element.number ==  
ChemGroup.C:
                                         boundCarbons = boundCarbons + 1
                                         if bonded.idatmType == 'Car':
                                                 boundAro = True
                                                 continue
                                         if bonded.idatmType == 'C3':
                                                 continue

becomes:

                                 if bonded.element.number ==  
ChemGroup.C:
                                         boundCarbons = boundCarbons + 1
                                         if bonded.idatmType == 'Car':
                                                 boundAro = True
						amine.append(bonded)
                                                 continue
                                         if bonded.idatmType == 'C3':
                                                 continue

If you want all the bonded carbons, not just the aromatic one, put a  
similar line in the "if bonded.idatmType == 'C3':" conditional.

--Eric

                         Eric Pettersen
                         UCSF Computer Graphics Lab
                         http://www.cgl.ucsf.edu

P.S. Directed followups to chimera-dev, since this discussion is  
pretty "programmery"



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20100427/58ba8a11/attachment.html>


More information about the Chimera-dev mailing list