Entering edit mode
7.6 years ago
bxia
▴
180
Is there a way to blast multiple sequences with biopython qblast at same time instead of just using for loop?
Thanks,
Is there a way to blast multiple sequences with biopython qblast at same time instead of just using for loop?
Thanks,
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()
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
You can probably look into the
multiprocessing
module to parallelize some things.