[BioPython] problem in NCBI Blast Parser ?

Brad Chapman chapmanb at uga.edu
Mon Mar 8 14:36:35 EST 2004


Hi Catherine;

> It seems that the Blast.NCBIWWW parser has a problem?
[...]
> The file handler that was passed to the parse() method was on a file
> just saved with the NCBIWWW.blast.read() method
> 
> (as explained in tutorials, either ours our the official one:
> http://www.pasteur.fr/recherche/unites/sis/formation/python/ch11s06.html
> 	exercises 11.16 and 11.17.

The problem really isn't in the parser, but rather in the
NCBIWWW.blast call. Calling blast in the way you do in the tutorial
gives back Text output (<pre> tags and the raw text) rather than the
expected HTML. Thus, the NCBIWWW parser chokes on the file, since it
is not really the HTML it expects.

It turns out that the problem was that the format_type parameter of
blast defaulted to 'html'. NCBI no longer accepts this and only
takes 'HTML'. I updated the blast function so that it now has 'HTML'
as the default, so you can either update from CVS or pass
format_type = "HTML" as an argument to the blast call.

After these changes, the parser seems to work fine. Thanks for the
report and hope this helps.
Brad


More information about the BioPython mailing list