[Biopython-dev] [Biopython - Bug #3197] SeqIO parse error with some genbank files

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Thu Apr 7 09:59:54 UTC 2011


Issue #3197 has been updated by Peter Cock.

File __init__.py added

Hi Cedar,

I do think these are invalid GenBank files, but as a short term hack you could try this modified version of the code - install Biopython 1.57 and replace the Bio/GenBank/__init__.py file. You could comment out the warning if you like ;)

This basically automates the removal of the join from the illegal locations, which seems to me to be the best way to salvage the location. I can then parse plastid1.genomic.gbff fine.

I don't want to commit a fix unless the NCBI tell us these are valid location, and/or a more elegant fix can be implemented. This current hack will probably slow down general GenBank parsing.

Peter

----------------------------------------
Bug #3197: SeqIO parse error with some genbank files
https://redmine.open-bio.org/issues/3197

Author: Cedar McKay
Status: New
Priority: Normal
Assignee: Biopython Dev Mailing List
Category: Main Distribution
Target version: 1.56
URL: 


I've found a file that seems to choke SeqIO genbank parsing.  I downloaded this file straight from NCBI, so it should be a good file. I've found a couple of other files that do the same thing. I reproduced this bug on another machine, also with biopython 1.56. I am able to successfully parse other genbank files. Maybe it has something to do with that very long location?  Please let me know if I can provide any other information!
Thanks!

Cedar


>>> from Bio import SeqIO
>>> record = SeqIO.read('./Acorus_americanus_NC_010093.gb', 'genbank')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Bio/SeqIO/__init__.py", line 597, in read
    first = iterator.next()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Bio/SeqIO/__init__.py", line 525, in parse
    for r in i:
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Bio/GenBank/Scanner.py", line 437, in parse_records
    record = self.parse(handle, do_features)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Bio/GenBank/Scanner.py", line 420, in parse
    if self.feed(handle, consumer, do_features):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Bio/GenBank/Scanner.py", line 392, in feed
    self._feed_feature_table(consumer, self.parse_features(skip=False))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Bio/GenBank/Scanner.py", line 344, in _feed_feature_table
    consumer.location(location_string)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Bio/GenBank/__init__.py", line 975, in location
    raise LocationParserError(location_line)
Bio.GenBank.LocationParserError: order(join(42724..42726,43455..43457),43464..43469,43476..43481,43557..43562,43569..43574,43578..43583,43677..43682,44434..44439)



-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org




More information about the Biopython-dev mailing list