[Biopython-dev] [Bug 1627] New: "Unexpected end of stream" when parsing Blast results

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue Apr 27 19:31:34 EDT 2004


http://bugzilla.bioperl.org/show_bug.cgi?id=1627

           Summary: "Unexpected end of stream" when parsing Blast results
           Product: Biopython
           Version: 1.24
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: rayka at mit.edu


The parsing of Blast results seems to have difficulty in recognizing the end 
of a Blast file.  I've gotten an "Unexpected end of stream" error with several 
different genes.

The code:
blast_results = NCBIWWW.blast('blastn', 'nr', Seq.tostring(), 
entrez_query=org, filter='off', expect='1000', word_size='7')
blast_parser = NCBIWWW.BlastParser()
blast_record = blast_parser.parse(blast_results)

Results in error:
  blast_record = blast_parser.parse(blast_results)
  File "C:\Python23\lib\site-packages\Bio\Blast\NCBIWWW.py", line 48, in parse
    self._scanner.feed(handle, self._consumer)
  File "C:\Python23\lib\site-packages\Bio\Blast\NCBIWWW.py", line 97, in feed
    has_re=re.compile(r'<b>.?BLAST'))
  File "C:\Python23\lib\site-packages\Bio\ParserSupport.py", line 335, in 
read_and_call_until
    line = safe_readline(uhandle)
  File "C:\Python23\lib\site-packages\Bio\ParserSupport.py", line 411, in 
safe_readline
    raise SyntaxError, "Unexpected end of stream."
SyntaxError: Unexpected end of stream.

When the line in safe_readline is printed out before the error is thrown the 
output looks like:
effective search space used: 26390847234
T: 0
A: 0
X1: 6 (11.9 bits)
X2: 15 (29.7 bits)
S1: 12 (24.3 bits)
S2: 13 (26.3 bits)
I suspect this is actually the end of the Blast file but the program does not 
recognize as such.



------- 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