[Biopython] Xpdb error

Markus Markus.Piotrowski at ruhr-uni-bochum.de
Mon May 23 21:08:52 UTC 2016


Dries Van Rompaey <dries.vanrompaey <at> gmail.com> writes:

> 
> Hi everyone,
> 
> I'm using biopython to parse some MD files for further processing. I'm
> using the SloppyStructureBuilder from xpdb.py (as described in
> http://biopython.org/wiki/Reading_large_PDB_files), as I have quite a lot
> of residues and the standard class doesn't support that very well.
> Unfortunately, I get the following error:
> 
> File "/Users/dvr/Dropbox/Work/xpdb.py", line 76, in init_residue
>     residue = Residue(res_id, resname, self.segid)
> NameError: global name 'Residue' is not defined
> 
> Does anyone know what's going on here?
> 
> Thanks,
> Kind regards,
> 
> Dries
> 

As Peter has written, add this import in the xpdb file:

from Bio.PDB import Residue

Then in the class 

    SloppyStructureBuilder(...) 

in 

    def init_residue(...)

replace

    residue = Residue(...)

with:
    
   residue = Residue.Residue(...)

Hope this helps.

-Markus





More information about the Biopython mailing list