<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Sep 2, 2010, at 12:16 PM, Michael Day wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">How do you flip the handedness of a molecule?<div><br></div><div>I need to overlap two molecules that are numbered the same but have different handedness.</div></span></blockquote><br></div><div>Hi Mike,</div><span class="Apple-tab-span" style="white-space:pre"> </span>I don't think there's a way to do this without resorting to Python code. Nonetheless, it can be done with pretty simple Python code. The code below will invert the handedness of currently selected models by inverting the X coordinate. Put the code in a .py file and open it with File...Open or with the "open" command, or type the code into the IDLE interpreter (under Tools...General Controls).<div><br></div><div>import chimera</div><div>for m in chimera.selection.currentMolecules():</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>for a in m.atoms:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>crd = a.coord()</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>crd.x = -crd.x</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>a.setCoord(crd)</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; "><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><br class="Apple-interchange-newline"></div></span> </div><br></body></html>