[Biopython] Fwd: PBD SuperImpose

Carlos Ríos Vera crosvera at gmail.com
Fri Aug 28 15:48:18 EDT 2009


Hello people,

I'm trying to use the superimpose() method from the Bio.PBD module, but when
I use the set_atoms() method with two atoms list, I got this:

"Bio.PDB.PDBExceptions.PDBException: Fixed and moving atom lists differ in
size"

So, my question is: How can I superimpose to structures with different size
??

Cheers and Thanks.

PS: I paste the code that I'm using.

-------code.py------
#!/usr/bin/env python

import sys
from Bio.PDB import *

#get the PDB's path from user command line
struct_path1 = sys.argv[1]
name_struct1 = struct_path1.split('/')[-1].split('.')[0]

struct_path2 = sys.argv[2]
name_struct2 = struct_path2.split('/')[-1].split('.')[0]

#parsing the PDBs
parser = PDBParser()

struct1 = parser.get_structure(name_struct1, struct_path1)
struct2 = parser.get_structure(name_struct2, struct_path2)

#get atoms list
atoms1 = struct1.get_atoms()
atoms2 = struct2.get_atoms()

latoms1 = []
latoms2 = []

for a in atoms1:
    latoms1.append( a )
for a in atoms2:
    latoms2.append( a )

print latoms1
print latoms2

#SuperImpose
sup = Superimposer()
# Specify the atom lists
# ""fixed"" and ""moving"" are lists of Atom objects
# The moving atoms will be put on the fixed atoms
sup.set_atoms(latoms1, latoms2)
# Print rotation/translation/rmsd
print "ROTRAN: "+ sup.rotran
print "RMS: " + sup.rms
# Apply rotation/translation to the moving atoms
sup.apply(moving)



-- 
http://crosvera.blogspot.com

Carlos Ríos V.
Estudiante de Ing. (E) en Computación e Informática.
Universidad del Bío-Bío
VIII Región, Chile

Linux user number 425502
-------------- next part --------------
A non-text attachment was scrubbed...
Name: superimpose.py
Type: text/x-python
Size: 992 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/biopython/attachments/20090828/3e36cfc0/attachment.py>


More information about the Biopython mailing list