<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 Apr 24, 2015, at 5:37 AM, Mathilde LE BOUDIC-JAMIN <<a href="mailto:m.leboudic@gmail.com">m.leboudic@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Dear all, <div><br></div><div>We're creating a chimera entension and we want (among other things) to ask Chimera to draw a line between pairs of selected atoms.</div><div>Would you by chance have an idea about how to program it? </div><div>I'm sorry but I'm not comfortable with the chimera modules yet. </div></div></blockquote><br></div><div>Hi Mathilde,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>One would draw lines between atoms (where the lines aren't actual covalent bonds) using pseudobonds. First, you have to get a pseudobond "group" to hold your pseudobonds. The group also has to given a category/name that describes what the pseudobonds represent (the name will be displayed in the PseudoBond Panel (Tools->General Controls->PseudoBond Panel)). Say your pseudobonds represented NMR constraints, then the call to get/make the group would be:</div><div><br></div><div>from chimera.misc import getPseudoBondGroup</div><div>pbg = getPseudoBondGroup("NMR constraints")</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Then you need to actually add the pseudobonds to the group. Assuming the atoms were in variables 'a1' and 'a2', the call would be:</div><div><br></div><div>pbg.newPseudoBond(a1, a2)</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>If you literally mean that the atoms are selected in the graphics window (and exactly two are selected), then you can assign them to 'a1' and 'a2' with:</div><div><br></div><div>from chimera.selection import currentAtoms</div><div>a1, a2 = currentAtoms()</div><div><br></div><div>--Eric</div><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>