BLAST Setup: Procedures for Windows PC

Tao Tao, Ph.D.
User Service, NCBI, NLM

TOC

  1. Downloading
  2. Installation
  3. Configuration
  4. Execution
  5. Technical Assistance
1. Downloading

Command line or standalone BLAST programs are provided as a compressed package. The package, available as blast initialed archives for a variety of computer platforms (hardware/operating system combinations), is available on the BLAST ftp site:

ftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/

The archive for Window PC is provided as a self extracting archive. It is named in the following convention:

blast-#.#.#-ia32-win32.exe
For PC with 64 bit chip and running Windows 2003 or better, use the following binary instead:
blast-#.#.#-x64-win64.exe
Here the string #.#.# represents the current version number. If a patched version is made in between official releases, the #.#.# will be the date of the patch.

To download using a browser, type "ftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/" without the quote to log on to NCBI BLAST ftp site. Right clicking on the correct archive and select "Save link as ..." from the popup menu. Follow the prompt to select the desired location to save the archive.

2. Installation

To facilitate the file management by keeping all the relevant files/directories from the archive in one central location, we need to create a new subdirectory under E:\ directory [1], named as blast-#.#.#, with #.#.# indicating the version number. For version 2.2.15, we will name this subdirectory blast-2.2.15. Move the donwloaded blast archive to this subdirectory and double click to extract the content. We should see a DOS terminal window open briefly with file names flashing by.

This installs the blast package and creates three subdirectories under blast-2.2.15: bin, data, and doc. The bin subdiretories contains the following programs:

bl2seq.exe     blastall.exe    blastclust.exe   blastpgp.exe
copymat.exe    fastacmd.exe    formatdb.exe     formatrpsdb.exe
impala.exe     makemat.exe     megablast.exe    rpsblast.exe
seedtop.exe
The documents on individual programs are under the doc subdirectory. The data subdirectory contains score matrices needed for scoring protein alignments. Additional files needed by other NCBI programs, such as sequin and Cn3D, are also included. For better management of database files, we also need to create a subidrectory named db under blast-2.2.15 [2].

[1] E:\ is only suggested destination, used as an example.
[2] To use databases kept elsewhere, see Configuration section.

3. Configuration

To ensure the smooth execution of blast programs, we need to configure the BLAST installation. We can configure through the configuration file named ncbi.ini to instruct blast the path to the data and db directories. In this file, the path to data db directories should be specified in the following convention:

[NCBI]
DATA=E:\blast-2.2.15\data

[BLAST]
BLASTDB=E:\blast-2.2.15\db
Steps needed to created this file on PC are the following:
  • launch notepad
  • copy paste the above section
  • relace the path (E:\blast-2.2.15\) with the actual one for your setup
  • name the file as ncbi.ini using "save as". Double quote the name to prevent Windows from adding the .txt extension
  • move this resulted ncbi.ini file to your Windows folder
We need to place the resulting ncbi.ini (text) file under the C:\Windows directory. BLAST will read this file upon start to get the path information it needs during BLAST searches. If we place those two directories somewhere else, we will need to change the path specification here.

An alternative, end user friendly way to specify the two pathes for the BLAST setup is to use the Windows' "Environment Variable". Here are the steps needed. The last few steps annotated in Figure 3.

  • Click on "Start" ⇨ "Settings" ⇨ "Control Panel"
  • In the "Control panel" window, double click "System" icon
  • In the popup, click on the "Advanced" tab
  • Click "Environment Variable" button
  • In the popup's "User variable for ..." panel, click on the "New" button (B in Figure 3)
  • To add DATA variable, type "DATA" in the variable name box and "e:\blast-2.2.15\data" in the path box (C in Figure 3)
Figure 3. Configure standalone BLAST using WINDOWS environment variable.

Top-left is initial system popup. Top-right is the Advanced tab of system popup. Clicking on "Environment variable" button will bring out lower-left popup. You can see the variables already specified: BLASTDB (e:\blast-2.2.15\db) and PATH (e:\blast-2.2.15\bin). The later adds e:\blast-2.2.15\bin to the executable search path, so we can call BLAST programs from any directories. Clicking on "new" button (B) will bring out new popup in lower-right. The example in lower-right (C) specifies the DATA directory and points it to "e:\blast-2.2.15\data".

One may still need the ncbi.ini file if netblast is also installed since it stores the firewall configuration settings needed by blastcl3. See netblast.html for more information.

4. Execution

To run the program, we need first launch a DOS command prompt by clicking on "Start ⇨ Program ⇨ Accessories ⇨ Command Prompt" as shown in the screenshot (Figure 4.1).

Figure 4.1 Openning a DOS command prompt under window (XP)

In the DOS prompt window, change the working directory to "E:\blast-2.2.15" by typing "E:" and enter key stroke, followed by "cd blast-2.2.15" and enter key stroke. To create the db directory, use "mkdir db" command. Sample commad lines are listed in Table 4.1 for your reference.

Table 4.1 Sample command lines

Command Prompt Explanation
C:\Documents and Settings\tao>e: Change directory to E:\
E:\>cd blast-2.2.15 Change directory to blast-2.2.15 under E:\
E:\blast-2.2.15>mkdir db Create subdirectory db under E:\blast-2.2.15
E:\blast-2.2.15>dir List the content under blast-2.2.15
Screen display from last command:
 Volume in drive E has no label.
 Volume Serial Number is EC96-7870

 Directory of E:\blast-2.2.15
01/14/2006  10:28 PM    <DIR>          .      System file
01/14/2006  10:28 PM    <DIR>          ..     System file
12/15/2005  12:05 AM    <DIR>          bin    bin directory
12/15/2005  03:51 PM    <DIR>          data   data directory
01/14/2006  10:28 PM    <DIR>          db     db directory
12/15/2005  03:52 PM    <DIR>          doc    doc directory

               6 Dir(s)  13,327,708,160 bytes free

To make windows aware of the location of blast programs, we need to add the path "E:\blast-2.2.15\bin" to the PATH environment variable. See Figure 3.

After this, we will be able to call the programs using their name from any directory in the computer. For example, to do the following tasks:

  • call blastall
  • use its blastn subprogram
  • search against refseq_rna database
  • use fasta_query.txt file as query
  • save the result in output.txt
  • We will use this command line:
    blastall -p blastn -d refseq_rna -i fasta_query.txt -o ouput.txt

    To further customize the search, we can manipulate the relevant search parameters. For more details, see the Section 3 of Program Parameters for blastall.

    Note, refseq_rna is a NCBI provided database, available from the db subdirectory (ftp.ncbi.nih.gov/blast/db) in preformatted form. For more information, please see: blastdb.html.

    5. Technical Assistance

    For questions, feedbacks, and technical assistance, please contact blast-help at:

    blast-help@ncbi.nlm.nih.gov
    For questions on other NCBI resources, please write to:
    info@ncbi.nlm.nih.gov