<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hi Dave,<div><span class="Apple-tab-span" style="white-space:pre"> </span>We want to make measurements of axes, centroids, and planes possible, and as the first step of that we have been working on axes. So planes/centroids will be coming, but I can't really guarantee when (there's still plenty of work left for axes!). So as Greg says, measuring planes/centroids has to be done using Python for now.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Now, the fact that the Chimera Plane constructor requires the points in "ring order" (for now) is kind of a major PITA, so my suggestion is to do a singular value decomposition and take as the plane normal the cross product of the two largest eigenvectors. This is actually really easy. If you look at the axis() function of StructureMeasure/__init__.py, it finds the centroid and does an SVD on a set of coordinates. The single largest eigenvector is the "axis" of those coordinates. You would use numpy.argsort to find the two eigenvectors with the largest eigenvalues, and numpy.cross to get the cross product. Some useful numpy docs are here: <a href="http://www.scipy.org/Numpy_Example_List_With_Doc">http://www.scipy.org/Numpy_Example_List_With_Doc</a> . The other thing to know is that to get a bunch of atoms (say from chimera.selection.currentAtoms()) into an Nx3 numpy array, you use the function chimera.numpyArrayFromAtoms.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>With the centroid and the normal, you would construct a chimera.Point and chimera.Vector. Then there is a chimera.Plane constructor that takes a Point and a Vector. There are a bunch of methods of Point, Vector, and Plane for measuring distances and angles, etc. You can see documentation for them by typing e.g. help(chimera.Vector) in the IDLE tool. So for instance, the distance from an atom to the centroid is atom.coord().distance(centroid). Some measurements, such as angle(), are only available as functions in the chimera module (so help(chimera) to see them). So the angle atom-centroid-normal is: chimera.angle(atom.coord() - centroid, normal) [the subtraction of two Points produced a Vector].</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>To show planes, you might want to construct BILD files/strings and open those: <a href="http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/bild.html">http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/bild.html</a></div><div><br></div><div>--Eric</div><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><div><div>On Jun 2, 2008, at 9:02 PM, David Chenoweth wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Dear Chimera team,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I would like to make a plane through the atoms of an aromatic ring and <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">then measure a distance from an atom to the ring centroid. I would <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">also like to measure the angle between the normal to the ring plane <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">and the line joining the centroid and the atom I am measuring from. It <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">would also be nice if I could specify the dimensions, color, and <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">transparency of the plane. In addition it would be great to be able to <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">make multiple planes through atoms, select and color them separately, <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">and measure the angles at the intersection of the planes. Just <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">wondering if there is a way to do this with Chimera.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Thanks in advance,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Dave</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">**********************************************</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">David M. Chenoweth</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">California Institute of Technology</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Division of Chemistry and Chemical Engineering</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Mail Code: 164-30</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">1200 California Boulevard, 91125 Pasadena</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">California, USA</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Phone: 626-395-6074</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Email: <a href="mailto:dchen@caltech.edu">dchen@caltech.edu</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">**********************************************</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Chimera-users mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users">http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users</a></div> </blockquote></div><br></div></body></html>