[Biopython-dev] [Bug 2229] New: GenBank Scanner fails to scan over headers

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Mon Mar 12 15:36:33 UTC 2007


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

           Summary: GenBank Scanner fails to scan over headers
           Product: Biopython
           Version: Not Applicable
          Platform: Macintosh
        OS/Version: Mac OS
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: mcolosimo at mitre.org


The new GenBank code fails to read in NCBI-GenBank flat file releases, such as
gbvrl1.seq (release 158.0)

from Bio import GenBank
import sys

fh = open(sys.argv[1], 'r')
gb_iter = GenBank.Iterator(fh, GenBank.FeatureParser())
for rec in gb_iter:
    print rec.id

This fails because the first item is not 'LOCUS'. The following works.


Index: Scanner.py
===================================================================
RCS file: /home/repository/biopython/biopython/Bio/GenBank/Scanner.py,v
retrieving revision 1.7
diff -r1.7 Scanner.py
62c62,63
<                 break
---
>                 self.line = line
>                 return line
69,72c70,72
<                 raise SyntaxError("Expected line starting '%s', found '%s'" \
<                                   % (self.RECORD_START, line.rstrip()))
<         self.line = line
<         return line
---
>                 if self.debug > 1: print "Skipping line"
> 
>         return None


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- 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