Blast multiple sequences with Biopython qblast
Is there a way to blast multiple sequences with biopython qblast at same time instead of just using for loop?
Thanks,
• 5,014 views
•
link
1 answer
I know it is an old question, but for the people looking for an answer and finding this question here is the answer.
So, the answer is really simple, but it just not clear from the documentation: qblast will accept fasta or a single sequence. And as you might know fasta can have more than one sequence. So just don't parse your fasta file and put the string right into qblast.
from Bio.Blast import NCBIWWW
fastafile = open('sequence.fna')
result_handle = NCBIWWW.qblast('blastn', 'nt', fastafile.read())
fastafile.close()
• 1 views
•
link
Log in to answer this question.
You can probably look into the
multiprocessingmodule to parallelize some things.