[Biopython] Fwd: BlastParsing gives Value Error: Invalid header?

Brad Chapman chapmanb at 50mail.com
Wed Jan 25 16:57:34 UTC 2012


Sar;

> I am new to both python and biopython.

Welcome. Thanks for including your code along with the problem report.

> What I'm trying to do is to parse a blast result xml file (myblast.xml),
> attached here.
> 
> The code looks like this:
[...]
> blast_parser = NCBIStandalone.BlastParser()
[...]
> ValueError: Invalid header?

You are using NCBIStandalone, which parses plain text blast output. To
parse the XML output, you should use the NCBIXML parser:

from Bio.Blast import NCBIXML
blast_records = NCBIXML.parse(result_handle)

The tutorial has more details and examples:

http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc87

Hope this helps,
Brad



More information about the Biopython mailing list