How to install and run Local BLAST from NCBI
PHP icalendar Google Calendar and PHP icalendar MRBS Room booking Calendar  Feed2JS (RSS Feed to JavaScript)

How to install and run Standalone or Local BLAST from NCBI

Download the latest Executable from the link provided from NCBI (connect as guest if asked) (new window or tab)

These directions are mainly for macs, they should be helpful for PC's. If you have any questions or find this useful please contact me at

In your users folder create an Application folder (if there is not one already), and in that folder create a NCBI folder or whatever
(just don't give it any spaces in the name).

Open a Terminal or DOS window   
Type cd space
Drag the folder to the terminal window
macintosh-hd:~ carmean$ cd /Users/carmean/Applications/NCBI/
That is a convenient way to bring your terminal to that folder.

Once you have installed the program, download and uncompress a sample Database

ls -l
total 2058200
-r--------  1 carmean  staff  1053795123 15 Apr 22:00 refseq_rna.00.tar.gz

carmean-mini:db carmean$ tar zxvpf refseq_rna.00.tar.gz
x refseq_rna.nal
x refseq_rna.00.nhr
x refseq_rna.00.nin
x refseq_rna.00.nnd
x refseq_rna.00.nni
x refseq_rna.00.nog
x refseq_rna.00.nsd
x refseq_rna.00.nsi
x refseq_rna.00.nsq

carmean-mini:db carmean$ tar zxvpf refseq_rna.01.tar.gz
x refseq_rna.01.nhr
x refseq_rna.01.nin
x refseq_rna.01.nnd
x refseq_rna.01.nni
x refseq_rna.01.nog
x refseq_rna.01.nsd
x refseq_rna.01.nsi
x refseq_rna.01.nsq
carmean-mini:db carmean$ cd ..

For UNIX/Macs if you have not added the program to the built-in path you need to
preface the program location with "./" (dot forward slash, no quotes).
Thus if your terminal location is in the 'bin' folder, you would run
However, in this example we are in the NCBI folder:

./bin/blastdbcmd -db ./db/refseq_rna -entry nm_000249 -out test_query.fa

./bin/blastn -query ./test_query.fa -db ./db/refseq_rna -task blastn -dust no -outfmt 7 -num_alignments 2 -num_descriptions 2

Warning: The parameter -num_descriptions is ignored for output formats > 4 . Use -max_target_seqs to control output
# BLASTN 2.2.28+
# Query: gi|263191547|ref|NM_000249.3| Homo sapiens mutL homolog 1, colon cancer, nonpolyposis type 2 (E. coli) (MLH1), transcript variant 1, mRNA
# Database: ./db/refseq_rna
# Fields: query id, subject id, % identity, alignment length, mismatches, gap opens, q. start, q. end, s. start, s. end, evalue, bit score
# 2 hits found
gi|263191547|ref|NM_000249.3|	gi|263191547|ref|NM_000249.3|	100.00	2662	0	0	1	2662	1	2662	0.4801
gi|263191547|ref|NM_000249.3|	gi|332816398|ref|XM_001170433.2|	99.59	2666	7	1	1	2662	19	2684	0.0	4758
# BLAST processed 1 queries
carmean-mini:ncbi-blast-2.2.28+ carmean$ 

How to convert an SRA file to a fastq file.

 ./fastq-dump /Users/carmean/Applications/NCBI/public/sra/SRR388322.sra 
Written 14650737 spots for /Users/carmean/Applications/NCBI/public/sra/SRR388322.sra
Written 14650737 spots total
carmean-mini:bin carmean$ 

You might VIEW SOURCE to check the actual commands...
awk 'NR % 4 == 1 || NR % 4 == 2' myfile.fastq | sed -e 's/@/>/' > myfile.fasta

awk 'NR % 4 == 1 || NR % 4 == 2' /Users/carmean/Applications/NCBI/sratoolkit.2.3.2-4-mac64/bin/SRR388322.fastq  | sed -e 's/@/>/' > myfile.fasta

How to convert FASTA into blast database

COMMAND FOR makeblastdb: 
./bin/makeblastdb -in /Users/carmean/Applications/NCBI/sratoolkit.2.3.2-4-mac64/format/SRR388322.fasta -dbtype nucl -out SRR388322newdb
      Adding sequences from FASTA; added 14650737 sequences in 710.049 seconds.

./bin/makeblastdb -in ./format/SRR388322.fasta  -dbtype nucl -out SRR388322newdb 

./bin/blastn -query ./test_query.fa -db ./db/SRR388322newdb -task blastn -dust no -outfmt 7 -num_alignments 2 -num_descriptions 2
 nucl, prot