<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Kayva,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>You need to realize that the negative of a plane normal is also normal to the same plane — it just points in the opposite direction.</div><div class=""><br class=""></div><div class="">—Eric</div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><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>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Nov 7, 2016, at 12:28 PM, Kavya Shankar <<a href="mailto:kavshank@umail.iu.edu" class="">kavshank@umail.iu.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi,<div class=""><br class=""></div><div class="">I have to find the normal of the protein and I am writing a python script that can do this. But when I run it, the normal is different. On chimera, I select <b class="">chain A</b> and <b class="">chain B</b> to get the plane.</div><div class=""><br class=""></div><div class=""><div class="">import chimera</div><div class="">import os</div><div class="">from cStringIO import StringIO</div><div class="">from StructMeasure import centroid</div><div class="">from StructMeasure import plane</div><div class="">from chimera import numpyArrayFromAtoms</div><div class=""><br class=""></div><div class="">for filename in os.listdir("test_python1"):</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>print filename<span class="gmail-Apple-tab-span" style="white-space:pre"> </span></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>model1 = chimera.openModels.open('test_python1/'+filename)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>mol1 = model1[0]</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>p = plane(numpyArrayFromAtoms(mol1.atoms))</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>print p.normal</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>axis = chimera.Vector(p.normal)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>angle = 120</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>xf = chimera.Xform.rotation(axis,angle)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>#matrix = chimera.Xform.getOpenGLMatrix(xf)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>mol1.openState.localXform(xf)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>mem =StringIO()</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>chimera.pdbWrite(model1,chimera.Xform.identity(),mem)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>words=filename.split('_')</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>with open('test_python1/'+words[0]+'_2.pdb','w') as f:</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>f.write(mem.getvalue())</div></div><div class=""><br class=""></div><div class="">Can you tell me where I am going wrong? For some proteins, it gives me the right plane and for others its different.</div><div class=""><br class=""></div><div class="">Ex:</div><div class=""><div class="">1l9q_1.pdb</div><div class="">Opening 1l9q_1.pdb...</div><div class="">#3, chain A: Cu-NIR</div><div class=""><br class=""></div><div class="">#3, chain B: Cu-NIR</div><div class=""><br class=""></div><div class="">#3, chain C: Cu-NIR</div><div class=""><br class=""></div><div class="">0.98101 0.0805021 0.176463</div><div class=""><br class=""></div></div><div class="">and</div><div class=""><br class=""></div><div class=""><div class="">Model #0 is 1l9q.pdb</div><div class=""><br class=""></div><div class="">Distance information</div><div class=""><br class=""></div><div class="">Angles/Torsions</div><div class=""><br class=""></div><div class="">Axes</div><div class="">axis name, length, center, direction</div><div class=""><br class=""></div><div class="">Planes</div><div class="">plane name, center, normal, radius</div><div class="">plane: ( 19.690, 39.732, 48.459) (-0.981, -0.081, -0.176) 46.305</div><div class=""><br class=""></div><div class="">Centroids</div><div class="">centroid name, center</div><div class="">centroid: ( 19.690, 39.732, 48.459)</div></div><div class=""><br class=""></div><div style="" class="">Thanks.</div><div style="" class=""><br class=""></div><div style="" class="">Regards,</div><div style="" class="">Kavya Shankar</div><div class=""><br class=""></div></div>
_______________________________________________<br class="">Chimera-dev mailing list<br class=""><a href="mailto:Chimera-dev@cgl.ucsf.edu" class="">Chimera-dev@cgl.ucsf.edu</a><br class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev<br class=""></div></blockquote></div><br class=""></div></body></html>