Hi,

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 chain A and chain B to get the plane.

import chimera
import os
from cStringIO import StringIO
from StructMeasure import centroid
from StructMeasure import plane
from chimera import numpyArrayFromAtoms

for filename in os.listdir("test_python1"):
print filename
model1 = chimera.openModels.open('test_python1/'+filename)
mol1 = model1[0]
p = plane(numpyArrayFromAtoms(mol1.atoms))
print p.normal
axis = chimera.Vector(p.normal)
angle = 120
xf = chimera.Xform.rotation(axis,angle)
#matrix = chimera.Xform.getOpenGLMatrix(xf)
mol1.openState.localXform(xf)
mem =StringIO()
chimera.pdbWrite(model1,chimera.Xform.identity(),mem)
words=filename.split('_')
with open('test_python1/'+words[0]+'_2.pdb','w') as f:
f.write(mem.getvalue())

Can you tell me where I am going wrong? For some proteins, it gives me the right plane and for others its different.

Ex:
1l9q_1.pdb
Opening 1l9q_1.pdb...
#3, chain A: Cu-NIR

#3, chain B: Cu-NIR

#3, chain C: Cu-NIR

0.98101 0.0805021 0.176463

and

Model #0 is 1l9q.pdb

Distance information

Angles/Torsions

Axes
axis name, length, center, direction

Planes
plane name, center, normal, radius
plane: ( 19.690,  39.732,  48.459) (-0.981, -0.081, -0.176) 46.305

Centroids
centroid name, center
centroid: ( 19.690,  39.732,  48.459)

Thanks.

Regards,
Kavya Shankar