<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jan 20, 2015, at 3:34 PM, Alejandro Virrueta <<a href="mailto:alejandro.virrueta@yale.edu">alejandro.virrueta@yale.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hello all,<div><br></div><div>Is there a way to get the all the information for an alternate conformation from a residue object? I have res.altLocs resulting in set([a,b]), but how can I get chi1-4 for conformation b for example?</div></div></blockquote><br></div><div>Hi Alex,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>It's a little ugly but very possible. The treatment of alt locs in Chimera 2 will be less arcane, but Chimera 1 is all there is right now. Anyway, You can get the atoms involved in a particular chi angle by using the "chiAtoms" function:</div><div><br></div><div><i>from chimera.phipsi import chiAtoms</i></div><div><i>chiExemplar = chiAtoms(res, 2) # for chi2</i></div><div><br></div><div>Now, these are just the first atoms in the residue, usually alt loc A (or blank, for residues with no alt locs). To find the corresponding B alt loc atoms, you will have to rummage through the residue:</div><div><br></div><div><i>bAtoms = []</i></div><div><i>for ce in chiExemplar:</i></div><div><i><span class="Apple-tab-span" style="white-space:pre"> </span>for a in res.atomsMap[ce.name]:</i></div><div><i><span class="Apple-tab-span" style="white-space:pre"> </span>if a.altLoc == 'B':</i></div><div><i><span class="Apple-tab-span" style="white-space:pre"> </span>bAtoms.append(a)</i></div><div><i><span class="Apple-tab-span" style="white-space:pre"> </span>break</i></div><div><i><span class="Apple-tab-span" style="white-space:pre"> </span>else:</i></div><div><i><span class="Apple-tab-span" style="white-space:pre"> </span>raise AssertionError("No B alt loc for atom %s" % ce.name)</i></div><div><br></div><div>Then finally you can compute the chi angle:</div><br><div><i>from chimera import dihedral</i></div><div><i>chi = dihedral(*[a.coord() for a in bAtoms])</i></div><div><br></div><div>Like I said, a little ugly, but doable.</div><div><br></div><div>--Eric</div><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; "><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><br class="Apple-interchange-newline"></span>
</div>
<br></body></html>