[BioPython] Problem superimposing structures

Thomas Hamelryck thamelry at binf.ku.dk
Tue Aug 3 09:22:44 EDT 2004


Hi Sergio,

Sorry about the delay in replying.

>    I am trying to superimpose two crystal structures using the
> Bio.PDB.Superimposer, following the example in the biopython FAQ
> document where it explains how to do this.  For the purposes of testing, I
> am only using 5 atoms in the atoms lists.  Below I show the two atom lists
> and the error I get when I try to use the set_atoms method.
>
> >>> ebg_res1
>
> [<Atom N>, <Atom CA>, <Atom C>, <Atom O>, <Atom CB>]
>
> >>> ebh_res1
>
> [<Atom N>, <Atom CA>, <Atom C>, <Atom O>, <Atom CB>]
>
> >>> sup.set_atoms( ebg_res1, ebh_res1)
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: unbound method set_atoms() must be called with Superimposer
> instance as first argument (got list instance instead)

You haven't sent in all the code. What is the sup variable? I suspect 
you erroneously assigned sup to the Superimposer class itself, and not to an 
instance of this class - hence the complaint about an unbound method.

The correct code should be something like:

from Bio.PDB import *
sup=Superimposer()
sup.set_atoms( ebg_res1, ebh_res1)

Let me know if your problem is solved.

Best regards,

-- 
Dr. Thomas Hamelryck
Bioinformatics center
University of Copenhagen      
Universitetsparken 15 Bygning 10                 
2100 Copenhagen, Denmark
---
http://www.binf.ku.dk/users/thamelry/



More information about the BioPython mailing list