[Biopython] To do Blast alignment of two proteins by biopython

Peter Cock p.j.a.cock at googlemail.com
Tue Dec 20 10:10:06 UTC 2011


On Tue, Dec 20, 2011 at 8:25 AM, Benjamin Li <benjamin.ys.li at gmail.com> wrote:
> Hi all,
>
> I have posted the same question on BioStar, but I think some of the
> Biopython users may not check Biostar so I also post it to the mail list.
>
> I am new to biopython and I am not sure if it is a stupid question.
>
> I would like to perform the same task as the one can be done on the web
> based blast.
>
> I am trying to align two protein by providing their GIs and receive the
> e-value. But I can only find examples to blast one protein in the biopython
> tutorial.
>
> How can I align two protein using the qblast function?

I don't think you can. The main BLAST webpage is actually very
advanced, doing things like trying to guide you with parameter
choices and so on. The QBLAST URL API is much simpler.
http://www.ncbi.nlm.nih.gov/BLAST/Doc/urlapi.html

> I have tried the command
>
> result_handle = NCBIWWW.qblast("blastp", "pat", "330186","118881")
>
> But it returns me a lot of alignments and a lot of e-values.
>
> I also found that it takes a few minutes for my computer to complete the
> query, where if I use the web based blast only takes a few seconds.
>
> Is my query anything wrong?

Probably not. The Biopython qblast function uses a 3 second
delay between checking for results, which may partly explain
this. Also the NCBI may give priority to the website.

Have you considered downloading the sequences and running
standalone BLAST on your computer?

Peter



More information about the Biopython mailing list