[BioPython] Parsing error when parsing a blast report

Pieter Laeremans pieter at laeremans.org
Tue Apr 13 09:59:59 EDT 2004


Hello,

I've tried to parse some output I got through NCBIWWW.Blast.  But I
receive the following error:


>>> ## working on region in file /tmp/python-8118EHE...
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/tmp/python-8118EHE", line 14, in ?
    record = parser.parse(b_results)
  File "/usr/lib/python2.3/site-packages/Bio/Blast/NCBIWWW.py", line 48, in parse
    self._scanner.feed(handle, self._consumer)
  File "/usr/lib/python2.3/site-packages/Bio/Blast/NCBIWWW.py", line 97, in feed
    has_re=re.compile(r'<b>.?BLAST'))
  File "/usr/lib/python2.3/site-packages/Bio/ParserSupport.py", line 335, in read_and_call_until
    line = safe_readline(uhandle)
  File "/usr/lib/python2.3/site-packages/Bio/ParserSupport.py", line 411, in safe_readline
    raise SyntaxError, "Unexpected end of stream."
SyntaxError: Unexpected end of stream.
>>> 

---------------------------------------

This is the script I used to get this result.  I have no idea what 's
wrong. Has anyone a clue ? thanks in advance,

Pieter


---------------------------------------

from Bio.Blast import *
from Bio.Blast.NCBIWWW import *

# here used to be a longer sequence
sequence="MKIPNIGNVMNKFEILGVVGEGAYGVVLKCRHKETHEIV"

b_results = NCBIWWW.blast(program='tblastn',  database='nr', query=sequence, expect=0.001, entrez_query='Canis familiaris[ORGN]')
parser = NCBIWWW.BlastParser()
record = parser.parse(b_results)



More information about the BioPython mailing list