[BioPython] Parsing BLAST results

Atkinson, GC gca500 at york.ac.uk
Thu Nov 4 07:04:06 EST 2004


Hi Everyone,

You've probably had this same query hundreds of times before and are 
sick of answering it, but I'm stuck and need your help!

I'm new to Biopython, and I'm trying to run BLAST from a script like the 
example in the Cookbook:

from Bio import Fasta
from Bio.Blast import NCBIWWW
fasta= open('m_cold.fasta','r')
f_iterator=Fasta.Iterator(fasta)
record=f_iterator.next()
b_results=NCBIWWW.blast('blastn','nr',record)
save_file=open('cold.out','w')
results=b_results.read()
save_file.write(results)
save_file.close()

All I get in the results file is the HTML page that comes up when 
waiting for results ("....<p><hr>This page will be automatically updated 
in <b>14</b> seconds until search is done<BR>")

I realise Blast output keeps changing, so the code needs to be updated 
but I just don't know how!

Gemma


More information about the BioPython mailing list