<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Oct 21, 2012, at 2:21 AM, Strotz von Moos Dean wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Eric,<br><br>Thank you for your kind response, I did indeed not realize the necessity to look up the residue and that it is not sufficient to just supply the sequence number.<br><br>I have a follow up question, if I may: <br>I have not been able to figure out how to color the bonds individually, according to the list of colors supplied in the pseudobondsToAdd list.<br><br>Rather the color is always set according to the last color supplied in the list, since the command in the code obviously colors the group as a whole:<br><br> for line in data:<br> r1, A1, r2, A2, c = line<br> r1 = int(r1)<br> r2 = int(r2)<br> A1 = unicode(A1)<br> A2 = unicode(A2)<br> rId1 = resLookup[r1]<br> rId2 = resLookup[r2]<br> grp = getPseudoBondGroup("mybonds", associateWith=model)<br> grp.newPseudoBond(rId1.atomsMap[A1][0],rId2.atomsMap[A2][0])<br> grp.color = getColorByName(c)<br><br>After consulting the commands index, it is not clear to me how to write the code to color the pseudobonds individually with the input of the color from the variable c.</div></blockquote><br></div><div>Hi Dean,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Yes, you need to color the individual pseudobonds. The first thing to know is that newPseudoBond returns the created pseudobond instance. Second, that pseudobond has a 'color' attribute you can set. Third, bonds and pseudobonds are, by default, colored in "halfbond" mode, i.e. each side of bond/pseudobond having the same color as the atom it's attached to. So, the pseudobond's 'halfbond' attribute has to be set to False in order for the color you assign to show.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>With all that then, change:</div><div><br></div><div><span class="Apple-style-span" style="font-family: monospace; "> grp.newPseudoBond(rId1.atomsMap[A1][0],rId2.atomsMap[A2][0])</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; "> grp.color = getColorByName(c)</span><span class="Apple-style-span" style="font-family: monospace; "><br></span></div><div><span class="Apple-style-span" style="font-family: monospace; "><br></span></div><div><span class="Apple-style-span" style="font-family: monospace; "><span class="Apple-style-span" style="font-family: Helvetica; ">to:</span></span></div><div><span class="Apple-style-span" style="font-family: monospace; "><span class="Apple-style-span" style="font-family: Helvetica; "><br></span></span></div><div><span class="Apple-style-span" style="font-family: monospace; "> pb = grp.newPseudoBond(rId1.atomsMap[A1][0],rId2.atomsMap[A2][0])</span><span class="Apple-style-span" style="font-family: monospace; "><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: monospace; "> pb.color = getColorByName(c)</span></div></span><div><span class="Apple-style-span" style="font-family: monospace; "> pb.halfbond = False</span></div><div><font class="Apple-style-span" face="monospace"><br></font></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; ">--Eric</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "> Eric Pettersen</div><div>
<span class="Apple-style-span" style="font-size: 16px; "> UCSF Computer Graphics Lab</span><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><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>