[BioPython] Superimposer
mitlox
mitlox at op.pl
Tue Mar 24 11:12:36 UTC 2009
Hello,
I read that the Superimposer works only with the two lists of atoms
which contain the same amount of atoms.
So I decided to use "Combinatorial Extension (CE)". This program returns
a rotation matrix and a translation vector.
After the execution of CE I took the matrix and vector and tried to use
it with Superimposer:
------------------------------------------------------------------------------
import sys
import numpy
from Bio.PDB import *
pdb_fix = "../files/1z9g.pdb"
pdb_mov = "../files/1z9g90.pdb"
p=PDBParser()
s1=p.get_structure("FIXED", pdb_fix)
fixed=Selection.unfold_entities(s1, "A")
s2=p.get_structure("MOVING", pdb_mov)
moving=Selection.unfold_entities(s2, "A")
rot=numpy.identity(3).astype('f')
tran=numpy.array((1.0, 2.0, 3.0), 'f')
tran[0] = -0.99996603; tran[1] = -2.00002559; tran[2] = -2.99998285
rot[0][0] = 0.19411441; rot[0][1] = -0.85385353; rot[0][2] = 0.48296351
rot[1][0] = 0.94858827; rot[1][1] = 0.28884874; rot[1][2] = 0.12940907
rot[2][0] = -0.24999979; rot[2][1] = 0.43301335; rot[2][2] = 0.86602514
for atom in moving:
atom.transform(rot, tran)
sup=Superimposer()
sup.set_atoms(fixed, moving)
print sup.rotran
print sup.rms
sup.apply(moving)
print "Saving aligned structure as PDB file %s" % pdb_mov
io=PDBIO()
io.set_structure(s2)
io.save(pdb_mov)
print "Done"
------------------------------------------------------------------------------
Unfortunalaty "print sup.rotran" returns this:
(array([[ 0.19411383, 0.94858824, -0.25000035],
[-0.85385389, 0.28884841, 0.43301285],
[ 0.4829631 , 0.12940999, 0.86602523]]), array([-0.06470776,
1.91446435, 3.21412203]))
but this matrix and vector are no the same like above.
What do I wrong?
Thank you in advance.
Best regards,
More information about the Biopython
mailing list