<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Juan,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>There are two varieties of Plane objects in Chimera. There is chimera.Plane, which is basically just the abstract mathematical representation of a plane, and supports the kind of math operations you would want to do with a plane. Then there is StructMeasure.Planes.Plane, which supports depicting a plane in the graphics window, and is basically a very fancy wrapper around a chimera.Plane.</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>You don’t really say what you plan to do with your “plane reference”, so I’m not sure whether just chimera.Plane is sufficient for your needs or if you need the more elaborate graphics Plane. I’m going to assume the former, and if it’s the latter then let me know.</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>So here’s an example of creating a chimera.Plane from a set of selected atoms. The origin of the plane will be the centroid of the atoms…</div><div class=""><br class=""></div><div class=""># assumes atoms are selected somehow</div><div class="">from chimera import selection, numpyArrayFromAtoms</div><div class="">atoms = selection.currentAtoms()</div><div class="">numpyCoords = numpyArrayFromAtoms(atoms)</div><div class="">import StructMeasure</div><div class="">plane = StructMeasure.plane(numpyCoords)</div><div class=""><br class=""></div><div class="">Some notes:</div><div class=""><br class=""></div><div class="">(1) Useful properties of a plane include ‘origin’ and ‘normal’. You can compute the distance from a plane to a point with distance() and find the nearest point in the plane with nearest(). Both those methods take a point (a.k.a. coord) as an argument. You get an atom’s coordinate with atom.coord(). You can also get the point+vector defining the intersection of two planes with the intersection() method.</div><div class=""><br class=""></div><div class="">(2) All the above assumes you are making plane measurements within a single model, or between two models that haven’t been moved relative to each other after being opened. If you are measuring things involving models that have been moved relative to each other, then you have to use “transformed” coordinates. To do that, add ‘xformed=True’ to the numyArrayFromAtoms call, and use the atom’s xformCoord() method rather than coord().</div><div class=""><br class=""></div><div class="">I hope this helps.</div><div class=""><br class=""></div><div class="">—Eric</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Eric Pettersen</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>UCSF Computer Graphics Lab</div><div class=""><br class=""></div><div class=""><div class=""><div><blockquote type="cite" class=""><div class="">On Aug 14, 2015, at 3:12 PM, JUAN PABLO REYES VALVERDE <<a href="mailto:reyes_jp@comunidad.unam.mx" class="">reyes_jp@comunidad.unam.mx</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" class="">
<style type="text/css" style="display:none;" class=""><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div dir="ltr" class="">
<div id="divtagdefaultwrapper" style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><p class="MsoNormal">Dear UCSF Chimera Team:<o:p class=""></o:p></p><p class="MsoNormal"><o:p class=""> </o:p></p><p class="MsoNormal">Please, I would much appreciate your advice on the following:<o:p class=""></o:p></p><p class="MsoNormal"><o:p class=""> </o:p></p><p class="MsoNormal">First issue:<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify">Given a number of planes - calculated/created through the ‘define’ command - I would like to select one of them, with some command entered at the command line …. How can I do it?<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify"><o:p class=""> </o:p></p><p class="MsoNormal" style="text-align:justify">The reason why I want to select it through the command line, and not by directly by clicking at it at the axes/planes/centroids table, is because later I would like to use the command inside a runCommand statement,
in a Python/IDLE script (with *.py extension) …<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify"><o:p class=""> </o:p></p><p class="MsoNormal" style="text-align:justify">Second issue:<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify">By the way, do you think this piece of code could work?<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify">Assume that the desired plane is already selected …. I want to internally handle the plane as ‘p1’ in my Python code:<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify"><o:p class=""> </o:p></p><p class="MsoNormal" style="text-align:justify">p1= chimera.Plane()<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify">from chimera import selection<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify">p1= selection<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify"><o:p class=""> </o:p></p><p class="MsoNormal" style="text-align:justify">or perhaps this single instruction …..
<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify">p1= chimera.selection<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify"><o:p class=""> </o:p></p><p class="MsoNormal" style="text-align:justify">Let me try to explain: Within my Python code, I want to have a way to make reference to a plane created by the ‘define’ command ( should I call it a ‘ handle’? … not sure whether it is the correct term …).<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify"><o:p class=""> </o:p></p><p class="MsoNormal" style="text-align:justify">Well, I hope that I managed to make it sufficiently clear … Thanks in advance for your kind attention.<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify">Cheers,<o:p class=""></o:p></p><p class="MsoNormal" style="text-align:justify"><o:p class=""> </o:p></p><div class=""><br class="webkit-block-placeholder"></div><p class="MsoNormal" style="text-align:justify">Juan<o:p class=""></o:p></p><p class=""><br class="">
</p>
<div id="Signature" class="">
<div name="divtagdefaultwrapper" style="margin:0px; font-family:Calibri,Arial,Helvetica,sans-serif" class="">
<font face="Times New Roman" class=""></font><div style="margin: 0in 0in 0pt;" class=""><span lang="ES" class=""><font face="Times New Roman" class=""><br class="">
</font></span></div><div style="margin: 0in 0in 0pt;" class=""><span lang="ES" class=""><font face="Times New Roman" class="">Dr. Juan Pablo Reyes Valverde</font></span></div>
<font face="Times New Roman" class=""></font><p class="MsoNormal" style="margin:0in 0in 0pt"><span lang="ES" class=""><font face="Times New Roman" class=""> </font></span></p>
<font face="Times New Roman" class=""></font><div style="margin: 0in 0in 0pt;" class=""><span lang="ES" class=""><font face="Times New Roman" class="">Laboratorio de Neurobiología Molecular y Celular (D15)<br class="">
Instituto de Neurobiología UNAM<br class="">
Campus UNAM Juriquilla</font></span></div>
<font face="Times New Roman" class=""></font><div style="margin: 0in 0in 0pt;" class=""><span lang="ES" class=""><font face="Times New Roman" class="">Boulevard Juriquilla 3001<br class="">
Querétaro, QRO CP 76230<br class="">
MÉXICO </font></span></div>
<font face="Times New Roman" class=""></font><p class="MsoNormal" style="margin:0in 0in 0pt"><span lang="ES" class=""><font face="Times New Roman" class=""> </font></span></p>
<font face="Times New Roman" class=""></font><div style="margin: 0in 0in 0pt;" class=""><span lang="ES" class=""><font face="Times New Roman" class="">Tel
<span class="skypepnhprintcontainer1340201850">+52 (442) 2381064</span></font></span></div>
<font face="Times New Roman" class=""></font></div>
</div>
</div>
</div>
_______________________________________________<br class="">Chimera-users mailing list<br class=""><a href="mailto:Chimera-users@cgl.ucsf.edu" class="">Chimera-users@cgl.ucsf.edu</a><br class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users<br class=""></div></blockquote></div><br class=""></div></div></body></html>