<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 27, 2010, at 7:05 AM, Mauro Truglio wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<br>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, <u>I'd like to include also che C atom in the selection</u> - not only N,H,H.<br> 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.<br> Can you help me?</blockquote><br></div><div>Hi Mauro,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>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:</div><div><br></div><div><div> if bonded.element.number == ChemGroup.C:</div><div> boundCarbons = boundCarbons + 1</div><div> if bonded.idatmType == 'Car':</div><div> boundAro = True</div><div> continue</div><div> if bonded.idatmType == 'C3':</div><div> continue</div><div><br></div><div>becomes:</div><div><br></div><div><div> if bonded.element.number == ChemGroup.C:</div><div> boundCarbons = boundCarbons + 1</div><div> if bonded.idatmType == 'Car':</div><div> boundAro = True</div><div><span class="Apple-tab-span" style="white-space:pre"><b> </b></span><b>amine.append(bonded)</b></div><div> continue</div><div> if bonded.idatmType == 'C3':</div><div> continue</div><div><br></div><div>If you want <i>all</i> the bonded carbons, not just the aromatic one, put a similar line in the "if bonded.idatmType == 'C3':" conditional.</div><div><br></div></div></div>--Eric<br><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>Eric Pettersen</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>UCSF Computer Graphics Lab</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> </span><a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px">P.S. Directed followups to chimera-dev, since this discussion is pretty "programmery"</p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><br></p><br class="Apple-interchange-newline"></div></span> </div><br></body></html>