[Biopython-dev] Error parsing a genBank file

Brad Chapman chapmanb at uga.edu
Fri Dec 12 14:53:45 EST 2003


Hi Iddo;

> I am getting an error on parsing a GenBank file. It's the E. coli K12 
> Genome, downloaded from:
> 
> http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?val=NC_000913

It parses for me with the current CVS. Peter added the /selenocysteine 
tag just a week ago, and yup it looks like your fine has this tag.
So yeah, just update to CVS and all should be good. Ah, GenBank and
their continuously expanding tag list.

> Egads! How do I turn Martel's debug feature on? Setting it to level 2 in 
> FeatureParser didn't seem to do much...

Huh? Now you are really confusing me. The following code:

from Bio import GenBank

fp = GenBank.FeatureParser(debug_level = 2)
gb_iter = GenBank.Iterator(open('ecoli_k12.gb'), fp)

gb_iter.next()

spits out tons to debug messages ala:

Match '        /EC_numb' (x=8978): '                     '
Match '       /EC_numbe' (x=8979): '\\/'
Match '      /EC_number' (x=8980): '[^"]'
Match '     /EC_number=' (x=8981): '[^"]'

It does take a few moments before the debug info gets printed
though. Just wait and you'll see all the magic. Hope this helps.

Why-can't-anyone-parse-small-little-files-anymore-ly yr's,
Brad

> >>> gb_iter = GenBank.Iterator(open('ecoli_k12.gb'),fp)
> >>> fp = GenBank.FeatureParser()
> >>> cur_rec = gb_iter.next()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/home/iddo/biopy_cvs/biopython/Bio/GenBank/__init__.py", line 
> 142, in next
>     return self._parser.parse(File.StringHandle(data))
>   File "/usr/home/iddo/biopy_cvs/biopython/Bio/GenBank/__init__.py", 
> line 229, in parse
>     self._scanner.feed(handle, self._consumer)
>   File "/usr/home/iddo/biopy_cvs/biopython/Bio/GenBank/__init__.py", 
> line 1251, in feed
> 
>   File "/usr/home/iddo/biopy_cvs/biopython/Martel/Parser.py", line 328, 
> in parseFile
>     self.parseString(fileobj.read())
>   File "/usr/home/iddo/biopy_cvs/biopython/Martel/Parser.py", line 356, 
> in parseString
>     self._err_handler.fatalError(result)
>   File "/usr/lib/python2.2/site-packages/_xmlplus/sax/handler.py", line 
> 38, in fatalError
>     raise exception
> Martel.Parser.ParserPositionException: error parsing at or beyond 
> character 1414769
> 
> 
> 
> 
> 
> 
> 
> -- 
> Iddo Friedberg, Ph.D.
> The Burnham Institute
> 10901 N. Torrey Pines Rd.
> La Jolla, CA 92037
> USA
> Tel: +1 (858) 646 3100 x3516
> Fax: +1 (858) 646 3171
> http://ffas.ljcrf.edu/~iddo
> 
> _______________________________________________
> Biopython-dev mailing list
> Biopython-dev at biopython.org
> http://biopython.org/mailman/listinfo/biopython-dev



More information about the Biopython-dev mailing list