I am trying to run BLASTN searches of multiple sequences from a single FASTA file. I can easily query a single sequence from a file but am struggling to query all the sequences in one file. As these are relatively short reads, I would rather not split the file into individual sequences and query each one separately.
This is what I have tried so far:
from Bio import SeqIO
from Bio.Blast import NCBIWWW
f_iterator = SeqIO.parse("file.fasta", "fasta")
f_record = f_iterator.next()
result_handle = NCBIWWW.qblast("blastn", "nt", f_record)
save_result = open("blast_result.xml", "w")
save_result.write(result_handle.read())
save_result.close()
result_handle.close()
Does anybody have any ideas?
Can't you give simply the whole content of a multiple sequence fasta file (read straight form the file) instead of single records?