[BioPython] SyntaxError raised by BlastParser.

ISHIKAWA, Masahiro biopython@biopython.org
19 Jul 2001 11:36:58 +0900


  Hello everyone,

  I found infrequently
Bio.BlastNCBIStandalone.BlastParser couldn't parse a
BLAST output record successfully, and a SyntaxError was
raised in _HSPConsumer.query method.

The reason was a possible syntax error in BLAST output.
For example, the parser raised an error at

Query: 100tt 101

since it lacks a white space between '100' and 'tt'.
The regular expression the parser uses is 

    _query_re = re.compile(r"Query: (\d+)\s+(.+) \d")

(extracted from NCBIStandalone.py:935).
It might be a bug in BLAST, however I could avoid the
SyntaxError by modifying the rex as follows:

    _query_re = re.compile(r"Query: (\d+)\s*(.+) \d")
                                           ^
                                          here
I uses biopython-1.00a2.

  Thanks.