Installing BLAST in OS X

These instructions apply to installing BLAST 2.2.22 in OS X, because this is the version that is supported and checked-for by QIIME. 

Option 1: Installing BLAST within your user account

Follow these instructions to install BLAST in your home directory. Only do this if you are the only user on your computer.  If the computer has multiple users, follow the instructions below for Option 2: Installing BLAST in a central location.

1. Download (but do not unzip) this file, and save in your Downloads folder:

ftp://ftp.ncbi.nlm.nih.gov/blast/executables/release/2.2.22/blast-2.2.22-universal-macosx.tar.gz

2. Unzip it in the Terminal using tar:

cd ~/Downloads

tar -xvf blast-2.2.22-universal-macosx.tar.gz

This should create a new folder called blast-2.2.22

3. Move it somewhere permanent - in this example, we'll just put it in your home directory.

mv blast-2.2.22 ~/

4. Add the ~/blast-2.2.22/bin folder to your PATH using the nano text editor:

nano ~/.profile

This will open the nano text editor, editing a file called .profile in your home directory.  Here you can add this line, referencing the directory that contains the BLAST executables:

export PATH=/Users/YourName/blast-2.2.22/bin:${PATH}

where "YourName" should be your username (or, "/Users/Yourname/" should be your home directory name).  If you aren't sure what your home directory is, you can open a new terminal session and type "cd ~" followed by "pwd". You can then save your .profile file in nano by pressing Control-o followed by return to accept the file name.  To exit nano, press Control-x.

Close your current Terminal session(s) and open a new one.  Now, when you type this command:

which blastall

it should state the location of the blastall executable file:

/Users/YourName/blast-2.2.22/bin/blastall

5. Make a ~/.ncbirc file that points to the BLAST data directory:

nano ~/.ncbirc

And put this text into the file:

[NCBI]

Data=/Users/YourName/blast-2.2.22/data/

where you should put in your username/home directory instead of "YourName." Save the .ncbirc file by pressing Control-o followed by return to accept the file name.  To exit nano, press Control-x.

You should now have a functioning copy of BLAST, ready to be called from QIIME or anything else.

Option 2: Installing BLAST in a central location

These instructions will put BLAST in a central location so any user can run BLAST searches.  You need to have administrative privileges to do this (i.e., you need to be an sudoer).  If you are the only user on your computer, Option 1 may be better.

1. Download (but do not unzip) this file, and save in your Downloads folder:

ftp://ftp.ncbi.nlm.nih.gov/blast/executables/release/2.2.22/blast-2.2.22-universal-macosx.tar.gz

2. Unzip it in the Terminal using tar:

cd ~/Downloads

tar -xvf blast-2.2.22-universal-macosx.tar.gz

This should create a new folder called blast-2.2.22

3. Copy it somewhere permanent - in this example, we'll put it in the /opt directory at the root of the filesystem, so anyone can access the files.

sudo mkdir /opt

sudo cp -R blast-2.2.22 /opt/

(If the "mkdir" command says that /opt already exists, this is okay.)

4. Add the /opt/blast-2.2.22/bin folder to your PATH using the nano text editor:

sudo nano /etc/bashrc

This will open the nano text editor, editing a file called /etc/bashrc.  Here you can add this line, referencing the directory that contains the BLAST executables:

export PATH=/opt/blast-2.2.22/bin:${PATH}

You can then save the /etc/bashrc file by pressing Control-o followed by return to accept the file name.  To exit nano, press Control-x.

Close your current Terminal session and open a new one.  Now, when you type this command:

which blastall

it should state the location of the blastall executable file:

/opt/blast-2.2.22/bin/blastall

5. Make a ~/.ncbirc file that points to the BLAST data directory:

nano ~/.ncbirc

And put this text into the file:

[NCBI]

Data=/opt/blast-2.2.22/data/

Save the .ncbirc file by pressing Control-o followed by return to accept the file name.  To exit nano, press Control-xEVERY USER needs to do this step in their own home directory.  Any user running BLAST needs to have a ~/.ncbirc file.

You should now have a functioning copy of BLAST, ready to be called from QIIME or anything else.