[BioPython] Parsing genbank problem

Brad Chapman chapmanb at uga.edu
Fri Mar 19 12:18:57 EST 2004


Hi Sebastian;

> I've been trying to parse a gb file to no avail.
> Here is my code (extracted from biopython cookbook)

Your code looks just fine, so the traceback...

> Traceback (most recent call last):
[...]
> ParserPositionException: error parsing at or beyond character 1496

...indicates that there is a problem with the Martel grammar reading
one of the records in your file. I've done a number of fixes to the
GenBank parser since the last release, so if you could check things
out with the latest CVS that should hopefully fix things.

Alternatively (or if you still have problems). You can find out more
information about where the parser is failing by initializing your
parser with debug_level = 2:

feature_parser=GenBank.FeatureParser(debug_level = 2)

This will cause Martel to spit out lots of information and likely
tell you exactly where things are failing. But the best bet is to
get the latest CVS and use that. I'm hoping to push out a new
release semi-soon to get the code out there, but CVS is the way to
go until then.

Hope this helps!
Brad


More information about the BioPython mailing list