[BioPython] NCBIStandalone Parser problem
edeveaud at pasteur.fr
edeveaud at pasteur.fr
Thu Apr 21 05:11:19 EDT 2005
Hi,
I just wanted to mention a problem with the NCBIStandalone Parser
when I try to parse a blast nucleic report file with No hits found
using the following code (reduced to the minimum)
saint-moret:~ > cat blast_pb.py
#! /local/cours/bin/python
from Bio.Blast import NCBIStandalone
import sys
blast_bin='/local/cours/bin/blastall'
blast_prog = 'blastn'
blastDB='/local/cours/bank/test_db'
query = sys.argv[1]
# blast exec
OUT, ERR = NCBIStandalone.blastall(blast_bin, blast_prog, blastDB, query)
# parser instanciation
parser=NCBIStandalone.BlastParser()
# parsing
record = parser.parse(OUT)
execution fails with the following traceback
saint-moret:~ > ./blast_pb.py query2
Traceback (most recent call last):
File "./blast_pb.py", line 17, in ?
record = parser.parse(OUT)
File "/local/cours/lib/python2.3/site-packages/Bio/Blast/NCBIStandalone.py",
line 567, in parse
self._scanner.feed(handle, self._consumer)
File "/local/cours/lib/python2.3/site-packages/Bio/Blast/NCBIStandalone.py",
line 95, in feed
self._scan_header(uhandle, consumer)
File "/local/cours/lib/python2.3/site-packages/Bio/Blast/NCBIStandalone.py",
line 129, in _scan_header
read_and_call_while(uhandle, consumer.noevent, blank=1)
File "/local/cours/lib/python2.3/site-packages/Bio/ParserSupport.py", line
314, in read_and_call_while
line = safe_readline(uhandle)
File "/local/cours/lib/python2.3/site-packages/Bio/ParserSupport.py", line
411, in safe_readline
raise SyntaxError, "Unexpected end of stream."
SyntaxError: Unexpected end of stream.
blast manualy run give me the following results
saint-moret:~ > blastall -p blastn -d /local/bank/hpylori/blast2/hp26695_genome
-i query2
BLASTN 2.2.10 [Oct-19-2004]
Reference: Altschul, Stephen F., Thomas L. Madden, Alejandro A. Schaffer,
Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997),
"Gapped BLAST and PSI-BLAST: a new generation of protein database search
programs", Nucleic Acids Res. 25:3389-3402.
Query= no_hits
(120 letters)
Database: Hpylori
1 sequences; 1,667,867 total letters
Searching[NULL_Caption] WARNING: [000.000] no_hits: SetUpBlastSearch failed.
[NULL_Caption] ERROR: [000.000] no_hits: BLASTSetUpSearch: Unable to
calculate Karlin-Altschul params, check query sequence
[NULL_Caption] ERROR: [000.000] no_hits: BLASTSetUpSearch: Unable to
calculate Karlin-Altschul params, check query sequence
done
***** No hits found ******
Database: Hpylori
Posted date: May 3, 2004 3:55 AM
Number of letters in database: 1,667,867
Number of sequences in database: 1
Lambda K H
-1.00 -1.00 -1.00
the parser works perfectly with blastn reports with hits.
we discover the problem, trying to work on a blast report of multiple sequences
versus one bank using the NCBIStandalone.iterator.
some details
running Python 2.3.4, Biopython 1.30 and blastall 2.2.10 Release on MacOSX
thank's for any information
Eric
More information about the BioPython
mailing list