<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Feb 23, 2010, at 4:16 AM, Mauro Truglio wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<br>I'm a newbie, and I'd like to use Chimera to recognize functional groups on a structure or a ligand, and I need it to write a file with the atoms involved. Now, if I do Select>Chemistry>functional group , search for one, and export the results through "write list", it exports a raw list of atoms without any specification of which atom is involved in which f.g..<br> It could be useful to add some sort of identifier, like:<br><br>FG1:<br>atom<br>atom<br>atom<br><br>FG2:<br>atom<br>atom<br>atom<br><br>How can I do that? Already tried to modify __init__.py in ChemGroups, but all I obtain is a list of physical addresses of atoms, e.g.:<br> <br>Group number 1 :<br>[<_chimera.Atom object at 0xa455db8>, <_chimera.Atom object at 0xa455dd0>, <_chimera.Atom object at 0xa455de8>, <_chimera.Atom object at 0xa455e00>, <_chimera.Atom object at 0xa455e18>]<br> <br>Group number 2 :<br>[<_chimera.Atom object at 0xa455e30>, <_chimera.Atom object at 0xa455e48>, <_chimera.Atom object at 0xa455e60>, <_chimera.Atom object at 0xa455e78>, <_chimera.Atom object at 0xa455e90>]</blockquote><br></div><div>Oooh, you were so close! It's seems you're Python savvy, so here's what you need to know: printing a list of Atoms prints their repr()s -- you need to print their str()s. Assuming that your list of Atoms was in a variable called 'grp', then either:</div><div><br></div><div>for a in grp:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>print a,</div><div>print</div><div><br></div><div>or:</div><div><br></div><div>print [str(a) for a in grp]</div><div><br></div><div>The latter will have surrounding brackets whereas the former won't. Let me know if you need more info than this.</div><div><br></div><div>--Eric</div><div><br></div><div><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> Eric Pettersen</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> UCSF Computer Graphics Lab</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> <a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></div><br class="Apple-interchange-newline"></div></span></div><br><div></div><br></body></html>