Question: Does Biopython parse blast -m8 or -m9 (aka blasttable)?
 
1
 
 

I am getting the following error when I try -m9

  File "parseBlast.biopython.py", line 5, in ?
    blast_record = blast_parser.parse(result_handle)
  File "/src/biopython-1.52/build/lib.linux-x86_64-2.4/Bio/Blast/NCBIStandalone.py", line 763, in parse
    self._scanner.feed(handle, self._consumer)
  File "/src/biopython-1.52/build/lib.linux-x86_64-2.4/Bio/Blast/NCBIStandalone.py", line 96, in feed
    self._scan_header(uhandle, consumer)
  File "/src/biopython-1.52/build/lib.linux-x86_64-2.4/Bio/Blast/NCBIStandalone.py", line 213, in _scan_header
    raise ValueError("Invalid header?")
ValueError: Invalid header?
 
 

3 answers

 
2
 
 

Try with blast's XML output instead. As explained in biopython's FAQs (#17), the XML format is the only one that will be always supported.

 
 
 

uhhh no thanks xml is way too verbose. I have over 20M alignments.

log in to reply • written 2.1 years ago by Jeremy Leipzig  820823
 

then either try the latest biopython's release or use another tool. Or write to the biopython's mailing list and explain your use case, maybe they will update the parser for you.

log in to reply • written 2.1 years ago by Giovanni M Dall'Olio  105011535
 
 
2
 
 

ParseBlastTable may do what you want, but it was designed for the output of blastpgp, not blastall. I can't get it to work with the BLASTN blasttable I have to hand.

 
 
 
 
2
 
 

Take a look at Biostar question: "How to convert BLAST results to GFF"

There is fairly easy Python solution for parsing blast column output.

 
 
 
Log in to add a post