[Biopython-dev] [Bug 1942] GenBank RecordParser fails on blank lines in features

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Feb 10 06:45:54 EST 2006


http://bugzilla.open-bio.org/show_bug.cgi?id=1942


biopython-bugzilla at maubp.freeserve.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |ASSIGNED
         OS/Version|Linux                       |All
           Platform|PC                          |All
            Summary|GenBank RecordParser fails  |GenBank RecordParser fails
                   |on particular qualifier     |on blank lines in features
                   |structure                   |




------- Comment #5 from biopython-bugzilla at maubp.freeserve.co.uk  2006-02-10 06:45 -------
Tried on Linux with file download by HTTP from here, using the send to file
option:

http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi??db=nucleotide&val=NC_007633

..and it works perfectly.  The "blank line" has the expected 21 spaces.

Then I tried (again on Linux) with the file downloaded by FTP from here:

ftp://ftp.ncbi.nlm.nih.gov/genomes/Bacteria/Mycoplasma_capricolum_ATCC_27343/NC_007633.gbk

And it failed.  Looking at the file in an editor, the blank line is empty - it
doesn't have the 21 spaces.  As a result, the parser failure is understandable:

Traceback (most recent call last):
  File "/home/maubp/GenBank/bug1942.py", line 3, in -toplevel-
    record = parser.parse(file('NC_007633.gbk'))
  File "/usr/lib/python2.4/site-packages/Bio/GenBank/__init__.py", line 212, in
parse
    self._scanner.feed(handle, self._consumer)
  File "/usr/lib/python2.4/site-packages/Bio/GenBank/__init__.py", line 1630,
in feed
    assert line[0:FEATURE_QUALIFIER_INDENT]==FEATURE_QUALIFIER_SPACER, \
AssertionError: Expected qualifier description continuation, not:

Is this the same error you saw Leighton?

I would say the file with a blank line is actually a malformed GenBank file,
but as this is an offical NCBI supplied file I'll try and get the parser to
support this too.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Biopython-dev mailing list