[BioPython] Parsing error when parsing a blast report
Bertrand FROTTIER
bertrand.frottier at free.fr
Tue Apr 13 14:46:24 EDT 2004
I had the same problem last week.
I suppose it's because the NCBI is using BLAST 2.2.8 now, and the parser
is not up-to-date yet. So I started working on a parser for the XML
output. It's not completely over yet (missing multiple_alignment,
support of PSI-BLAST, and a lot of testing) but I can send you the file
if you want.
Pieter Laeremans a écrit :
> 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)
>
> _______________________________________________
> BioPython mailing list - BioPython at biopython.org
> http://biopython.org/mailman/listinfo/biopython
>
>
--
()
(o_
//\
<-V_/_ Demonic penguin
Win98 is called Win98 because 98 is the number of bugs occurring right after
inserting the CD.
More information about the BioPython
mailing list