NCBI BLAST

You can install BLAST on a local Macintosh or Ubuntu computer if you want to BLAST against your own database.

Relevant Usage at Saierlab
Running BLAST on a limited database rather than on the entire NCBI database, such as when you want to compare only to the proteins of a single species rather than all species, or one TCDB superfamily with another.

Installing BLAST on a Mac
There's two main ways to install NCBI's blast ino your mac. the easy way, and the hard way. Now, let's leave the hard way for the time when you become an obsessive expert. For now, we will talk about one of two easy ways (did I say two before? Do we have three now? A question of focus. It's just that there's two main ways, then the easy way has two subways).

The two easy ways are about installing pre-compiled, ready-to-go, versions of NCBI blast. Both are available from here. You will notice a full list of blasts: rpms, md5s, etc, etc, etc. The file names normally start with "ncbi-blast-" followed by the version number, then some keys as to the operative system under which those programs were compiled. There's two for mac! (thereby the two easy ways-now you get it, right?)

OK now, at the time of this writing, file number 1 for mac is: ncbi-blast-2.2.31+-universal-macosx.tar.gz (the 2.2.31 number will change when there's a new release of the programs). The second file is ncbi-blast-2.2.31+.dmg. The difference is that the first is a tar file (no kidding!), the second is a ".dmg" file. What this means is that the first is a package of files, and you have to know what to do with it, while the second is a mac installer. From the above, it follows that the easiest way to install NCBI's blast in your mac is to download the ".dmg" file, double-click it, and follow the instructions. You're done! This will install the blast suite under /usr/local/ncbi. The installer also makes sure that you have the programs in your path by adding an ncbi_blast file to "/etc/paths.d". So that's it. Now you have the whole blast suite in your mac. Have fun!

Well, you need blast databases too. But this is about installing. Databases will come later. You can see some examples about how to make these databases in the next section (just below).

Using BLAST on (the Mac?)
makeblastdb -in -out testdb -dbtype nucl for DNA or: makeblastdb -in -out testdb -dbtype prot for protein and type return to get the database named testdb. You can change "testdb" to whatever you want.
 * Copy your FASTA file for the database into ~/blast/db. "~" means the home folder.
 * Navigate to home folder by typing into terminal: "cd ~/blast/db"
 * In the same terminal, type:
 * If you get an error message: Error: (803.7) Bad char in VisibleString: 9 it means there are tabs in your fasta file. You need to remove them. You can probably remove the tabs using any text editor, or if you're feeling dangerous you can read the Sed page to find out how to gamble with your life.

blastn -query test_dna.fasta -db testdb -out test.html -html where testdb is the name of the database files you created, without the file extensions. If you just put "testdb" when you made the database, just put "testdb" now. If you're doing protein, use blastp instead of blastn.
 * Have your query sequence in a fasta file, and move that fasta file to the ~/blast/db folder. Navigate to the ~/blast/db folder if you're not there already, and enter:

Installing BLAST on Ubuntu
(This section is about an old version of blast. The so called "legacy" version. NCBI has the new version available for Linux--Ubuntu is a Linux distribution--just as it has it for Mac OSX.)

First, enter the terminal, and type "blast2" to make sure it's not already installed. Most of the ubuntu computers in Saierlab should already have blast2 installed. If the "blast2" command is not found, then you need to install it. If not, you're good to just use it. It works right out of the box.

All you have to do is use the Ubuntu Software Center. BLAST is already in the default repositories. If you can't find the Ubuntu Software Center, then you can search for it. If you still can't find it on your computer, just ask somebody.

In the Ubuntu Software Center, search for "blast2". You'll get a result for "blast2", with an install button on the side. Click the install button. Then turn to the nearest person and tell them that was easy like his or her mom.

If you get "blast" instead of "blast2", all it does is poke holes in your windows. This is not relevant to bioinformatics, despite how fun that might possibly be. Shun the people who took the "blast" name for such a stupid program so everyone has to type "blast2".

Using BLAST on Ubuntu
Type "blast2" into the terminal and it should give you relevant options. If not, ask somebody.

The most important options are -p, -i, and -j. -p is the blast program you want to use, -i is your query file, and -j is your database (subject) file. Fasta files are accepted for both. Your terminal command should look something like this: blast2 -p tblastn -i query.fasta -j db.fasta Also very easy, no? Go to the nearest person using an OSX or Windows machine and tell them to suck it.

The only problem here is that the results are output to the terminal, not saved to a file. You can fix this by redirecting standard output to a file, which is quite simple. blast2 -p tblastn -i query.fasta -j db.fasta > newoutputfile.txt Or if you're the type that likes watching washing machines run: blast2 -p tblastn -i query.fasta -j db.fasta | tee newoutputfile.txt

Ubuntu Blast Options
To see the blast options in ubuntu, simply type: blast2 and it will output all of the options available. The most important ones that have not been mentioned already is -e and -m. -e takes in the maximum e-value of a hit that will be output. If you say -e 1e-4 or -e 0.0001 it will filter out hits with e-values above 1e-4. blast2 -p tblastn -i query.fasta -j db.fasta -e 1e-4 > newoutputfile.txt -m takes in a number, representing the format that you want the file output as. the most important one is -m 8, which outputs in a tabular format. This is difficult to explain, just take a look. blast2 -p tblastn -i query.fasta -j db.fasta -m 8 > newoutputfile.txt And with any options you can generally use them together. blast2 -p tblastn -i query.fasta -j db.fasta -m 8 -e 1e-4 > newoutputfile.txt
 * -e
 * -m

Person to Ask

 * Ujj