[Biopython] Xpdb error

Peter Cock p.j.a.cock at googlemail.com
Mon May 23 21:53:03 UTC 2016


Well spotted Markus,

Sorry, I forgot about the confusing import - something
PEP8 guidelines would prevent with new modules.
You can probably do this as a one line change:

from Bio.PDB.Residue import Residue

Peter


On Mon, May 23, 2016 at 10:08 PM, Markus <
Markus.Piotrowski at ruhr-uni-bochum.de> wrote:

> 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
>
>
>
> _______________________________________________
> Biopython mailing list  -  Biopython at mailman.open-bio.org
> http://mailman.open-bio.org/mailman/listinfo/biopython
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20160523/c08251cf/attachment.html>


More information about the Biopython mailing list