Blast multiple sequences with Biopython qblast
1
1
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,

blast • 4.5k views
ADD COMMENT
0
Entering edit mode

You can probably look into the multiprocessing module to parallelize some things.

ADD REPLY
1
Entering edit mode
6.4 years ago

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()
ADD COMMENT

Login before adding your answer.

Traffic: 2516 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6