This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Biopython Local Blast Giving Mega Blast Results

Hello Everyone, I am trying to use the stand alone local blast in python to return back to make the blast results of particular sequences. It works but when I tally my results with the online version of blast it seems like the standalone blast is returning to me the "megablast- highly similar sequences" instead of blastn - somewhat similar sequences which is what I want.

This is my code:

 result_handlel= NcbiblastnCommandline(query="l70.fasta", db = "MG1655", out = 'resultl.xml', outfmt= 5, evalue = 0.0001)
    os.system(str(result_handlel))

Do you have any idea why it is doing this? It is the blastn command line so it makes most sense for it to return blastn results.

Thank you!

biopython blast

Note NcbiblastnCommandline(...) does not give you a handle so storing it in a variable called result_handlel is a bit odd. Also you can invoke it directly with:

stdout, stderr = result_handlel()

1 answer

In BLAST+ the default program for blastn is megablast. To switch to regular blastn just add keyword argument task="blastn" to your command:

 result_handlel= NcbiblastnCommandline(query="l70.fasta", db = "MG1655", out = 'resultl.xml', outfmt= 5, evalue = 0.0001, task="blastn")

Log in to answer this question.