Discussion:
[Biopython] PBD SuperImpose
Carlos Ríos Vera
2009-08-28 19:45:46 UTC
Permalink
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 attached the code that I'm using.
--
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/c6766fa2/attachment.py>
Carlos Ríos Vera
2009-08-28 19:48:18 UTC
Permalink
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>
Rodrigo faccioli
2009-08-29 13:17:25 UTC
Permalink
Please,

Could you inform the PDBIDs or PDB files that you are using?

Cheers,

--
Rodrigo Antonio Faccioli
Ph.D Student in Electrical Engineering
University of Sao Paulo - USP
Engineering School of Sao Carlos - EESC
Department of Electrical Engineering - SEL
Intelligent System in Structure Bioinformatics
http://laips.sel.eesc.usp.br
Phone: 55 (16) 3373-9366 Ext 229
Curriculum Lattes - http://lattes.cnpq.br/1025157978990218


2009/8/28 Carlos R?os Vera <crosvera at gmail.com>
Post by Carlos Ríos Vera
Hello people,
I'm trying to use the superimpose() method from the Bio.PBD module, but when
"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 = []
latoms1.append( a )
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
_______________________________________________
Biopython mailing list - Biopython at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython
Carlos Ríos Vera
2009-08-29 17:03:55 UTC
Permalink
2009/8/29 Rodrigo faccioli <rodrigo_faccioli at uol.com.br>
Post by Rodrigo faccioli
Please,
Could you inform the PDBIDs or PDB files that you are using?
trimero_r308A_600_ps2.pdb
wt_600ps_trim.pdb

These are the PDBs that I'm using.
Post by Rodrigo faccioli
Cheers,
--
Rodrigo Antonio Faccioli
Ph.D Student in Electrical Engineering
University of Sao Paulo - USP
Engineering School of Sao Carlos - EESC
Department of Electrical Engineering - SEL
Intelligent System in Structure Bioinformatics
http://laips.sel.eesc.usp.br
Phone: 55 (16) 3373-9366 Ext 229
Curriculum Lattes - http://lattes.cnpq.br/1025157978990218
2009/8/28 Carlos R?os Vera <crosvera at gmail.com>
Post by Carlos Ríos Vera
Hello people,
I'm trying to use the superimpose() method from the Bio.PBD module, but when
"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 = []
latoms1.append( a )
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
_______________________________________________
Biopython mailing list - Biopython at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython
--
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
Carlos Ríos Vera
2009-08-29 17:03:55 UTC
Permalink
2009/8/29 Rodrigo faccioli <rodrigo_faccioli at uol.com.br>
Post by Rodrigo faccioli
Please,
Could you inform the PDBIDs or PDB files that you are using?
trimero_r308A_600_ps2.pdb
wt_600ps_trim.pdb

These are the PDBs that I'm using.
Post by Rodrigo faccioli
Cheers,
--
Rodrigo Antonio Faccioli
Ph.D Student in Electrical Engineering
University of Sao Paulo - USP
Engineering School of Sao Carlos - EESC
Department of Electrical Engineering - SEL
Intelligent System in Structure Bioinformatics
http://laips.sel.eesc.usp.br
Phone: 55 (16) 3373-9366 Ext 229
Curriculum Lattes - http://lattes.cnpq.br/1025157978990218
2009/8/28 Carlos R?os Vera <crosvera at gmail.com>
Post by Carlos Ríos Vera
Hello people,
I'm trying to use the superimpose() method from the Bio.PBD module, but when
"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 = []
latoms1.append( a )
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
_______________________________________________
Biopython mailing list - Biopython at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython
--
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
Rodrigo faccioli
2009-08-29 13:17:25 UTC
Permalink
Please,

Could you inform the PDBIDs or PDB files that you are using?

Cheers,

--
Rodrigo Antonio Faccioli
Ph.D Student in Electrical Engineering
University of Sao Paulo - USP
Engineering School of Sao Carlos - EESC
Department of Electrical Engineering - SEL
Intelligent System in Structure Bioinformatics
http://laips.sel.eesc.usp.br
Phone: 55 (16) 3373-9366 Ext 229
Curriculum Lattes - http://lattes.cnpq.br/1025157978990218


2009/8/28 Carlos R?os Vera <crosvera at gmail.com>
Post by Carlos Ríos Vera
Hello people,
I'm trying to use the superimpose() method from the Bio.PBD module, but when
"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 = []
latoms1.append( a )
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
_______________________________________________
Biopython mailing list - Biopython at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython
Peter
2009-08-29 13:48:52 UTC
Permalink
Post by Carlos Ríos Vera
Hello people,
I'm trying to use the superimpose() method from the Bio.PBD module, but when
"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
??
This sounds more like a methodology question than a Python
question.

You must decide how to map between the atoms of one chain and
the atoms of the other. If they are different lengths, you will need
to exclude some residues (e.g. peptide GHIL versus EGHILD, you
would probably ignore the extra trailing/leading residues on the
longer sequence).

If in addition the residues are (at least in some cases) different
amino acids, then you will probably only want to calculate the
superposition using the backbone (or even just the C alpha
atoms).

One approach to this is to base the atomic mapping on a
pairwise protein sequence alignment.

Peter
Eric Talevich
2009-08-29 17:12:50 UTC
Permalink
Post by Peter
Post by Carlos Ríos Vera
Hello people,
I'm trying to use the superimpose() method from the Bio.PBD module, but
when
Post by Carlos Ríos Vera
"Bio.PDB.PDBExceptions.PDBException: Fixed and moving atom lists differ
in
Post by Carlos Ríos Vera
size"
So, my question is: How can I superimpose to structures with different
size
Post by Carlos Ríos Vera
??
This sounds more like a methodology question than a Python
question.
You must decide how to map between the atoms of one chain and
the atoms of the other. If they are different lengths, you will need
to exclude some residues (e.g. peptide GHIL versus EGHILD, you
would probably ignore the extra trailing/leading residues on the
longer sequence).
If in addition the residues are (at least in some cases) different
amino acids, then you will probably only want to calculate the
superposition using the backbone (or even just the C alpha
atoms).
One approach to this is to base the atomic mapping on a
pairwise protein sequence alignment.
Peter
If you're trying to align the structures of two different proteins, or two
different structures of the same protein, you might want to try MultiProt:

http://bioinfo3d.cs.tau.ac.il/MultiProt/

It can handle more than two proteins at a time, too. (If that's overkill,
then +1 for Peter's approach.)

Eric
Carlos Ríos Vera
2009-08-28 19:45:46 UTC
Permalink
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 attached the code that I'm using.
--
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/c6766fa2/attachment-0002.py>
Carlos Ríos Vera
2009-08-28 19:48:18 UTC
Permalink
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-0002.py>
Peter
2009-08-29 13:48:52 UTC
Permalink
Post by Carlos Ríos Vera
Hello people,
I'm trying to use the superimpose() method from the Bio.PBD module, but when
"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
??
This sounds more like a methodology question than a Python
question.

You must decide how to map between the atoms of one chain and
the atoms of the other. If they are different lengths, you will need
to exclude some residues (e.g. peptide GHIL versus EGHILD, you
would probably ignore the extra trailing/leading residues on the
longer sequence).

If in addition the residues are (at least in some cases) different
amino acids, then you will probably only want to calculate the
superposition using the backbone (or even just the C alpha
atoms).

One approach to this is to base the atomic mapping on a
pairwise protein sequence alignment.

Peter
Eric Talevich
2009-08-29 17:12:50 UTC
Permalink
Post by Peter
Post by Carlos Ríos Vera
Hello people,
I'm trying to use the superimpose() method from the Bio.PBD module, but
when
Post by Carlos Ríos Vera
"Bio.PDB.PDBExceptions.PDBException: Fixed and moving atom lists differ
in
Post by Carlos Ríos Vera
size"
So, my question is: How can I superimpose to structures with different
size
Post by Carlos Ríos Vera
??
This sounds more like a methodology question than a Python
question.
You must decide how to map between the atoms of one chain and
the atoms of the other. If they are different lengths, you will need
to exclude some residues (e.g. peptide GHIL versus EGHILD, you
would probably ignore the extra trailing/leading residues on the
longer sequence).
If in addition the residues are (at least in some cases) different
amino acids, then you will probably only want to calculate the
superposition using the backbone (or even just the C alpha
atoms).
One approach to this is to base the atomic mapping on a
pairwise protein sequence alignment.
Peter
If you're trying to align the structures of two different proteins, or two
different structures of the same protein, you might want to try MultiProt:

http://bioinfo3d.cs.tau.ac.il/MultiProt/

It can handle more than two proteins at a time, too. (If that's overkill,
then +1 for Peter's approach.)

Eric

Loading...