<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Apr 5, 2013, at 7:43 AM, Ignacio Faustino wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Chimera users,<div><br></div><div>I would like to know if there is a easy way to compute the difference between a couple of dihedrals a color a residue depending on the result.</div><div><br></div><div>I guess I have to do some python scripting but just in case I want to ask.</div></div></blockquote><br></div><div>Hi Ignacio,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>In very narrow cases you can without resorting to Python. Namely when the dihedrals you want to compare are in the same residue and are either the phi, psi, or chi angles. In that case you can use the Attribute Calculator tool to make a new residue attribute that is the difference (<i>e.g.</i> formula: residue.phi - residue.psi) and then use Render By Attribute to color the residues based on this new attribute.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Otherwise, you will have to resort to Python. Look at the "Atomic Measurements" programmer's example -- specifically the documentation for chimera.dihedral in the Basic Measurements Functions -- for details. Feel free to ask questions on chimera-dev. You can have your script just compute a residue attribute and then afterward you would use Render By Attribute to set the actual coloring (and see the histogram of values). Since a difference of angles can range from -360 to 360 you should probably normalize the values back into a -180 to 180 range.</div><div><br></div><div>--Eric</div><br><div>
<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>