How To Blast Against A Local Database
2
1
Entering edit mode
9.1 years ago
mealbahrani ▴ 10

I want to BLAST an mRNA reference sequence against a local database in my directory (a collection of RNA reference sequences) using a BioPython program. I know how to perform BLAST against online database such as NCBI database using the following code:

from Bio.Blast import NCBIWWW

sequence = """GGAGGATATATTCAAC"""

blast_handle = NCBIWWW.qblast('blastn', 'nr', sequence)

blast_handle.seek(0)
blast_file = open('blast-output.xml', 'w')
blast_file.close()


But my question is how to do BLAST against a local database in my directory?

blast biopython local database • 13k views
7
Entering edit mode
9.1 years ago
David W 4.9k

This is covered in the Biopython tutorial under the heading "Running BLAST Locally". You'll need to install the BLAST executables, then follow the examples. If you'd prefer, you can run the create your databases and run your BLASTs via the command line, then use Biopython to parse the resulting xml.

2
Entering edit mode
9.1 years ago
Bioch'Ti ★ 1.0k

You can also use PrfectBlast, a GUI that perform this task whatever your platform is: http://code.google.com/p/prfectblast/ Easier to handle for people that do not use python/perl.