Stand-alone Blast Search
Nils Muthreich; February 5th 2009
Manual for using the stand-alone Blast Search on the server of Lab Hochholdinger:
- Stand-Alone-Blast
- DOS command prompt
- Database preparation
-
- Nucleotide
- Protein
- Blast search
1. Stand-Alone-Blast
The Stand-Alone-Blast program is a command-line program that runs under any version of Windows or DOS. The most important files are:
- formatdb.exe, which is located in the database subfolder and converts your fasta-file to a database
- blastall.exe, which is located in the bin subfolder and is used for all blast searches
This program is very useful to perform blast searches against a “private” database, which is not available on the public blast servers of NCBI or PlantGDB. It can also be used to check if a gene or protein of interest was differentially expressed or accumulated in a previous experiment. In that case a database with differential genes/proteins is generated and the gene/protein of interest is blasted against this database.
Important hint: In the DOS-command-line go to the specific subfolder containing your program of interest and type the name of your program followed by a blank and a question mark to get a list of all possible options, like:
formatdb ?
or
blastall ?
2. DOS command prompt
Since formatdb.exe and blastall.exe can only be used in a DOS-like environment (like DOS-command-line in Windows), it is essential to know some important commands.
First of all, to start the DOS-command-line in Windows, go to Startà run and type “cmd” to open the command-line. A window running the cmd.exe will open. This window looks like an old MS-DOS screen with white characters on black background. By default you will be located in C:\Documents and Settings\your_username.
The most important DOS commands are:
- dir (directory) will show the content of the current folder with subfolders on top
This command can be used to show a specific file-type only like:
dir .exeto show *.exe-files only
dir .txt to show *.txt-files only
This is possible for all file types located in that folder
cd (change directory) will allow you to go to a subfolder (lower folder) or a higher folder
cd desktop will change to the subfolder named “desktop”
cd.. will change to the higher folder (“C:\Documents and Settings” in this case)
cd\ will change to root-directory of the drive (“C:\”)
To start a program in DOS it is sufficient to type the name of the program located in that folder without adding the filetype-extension, like:
“formatdb” to run the formatdb.exe or “blastall” to run the blastall.exe.
Important: There are different file-types in DOS that can be executed directly by typing the name of the file. These file types are *.exe (Executable), *.com (Command) and *.bat (Batch). In the very unlikely case that different file-types with the same name are located in a directory (e.g. abc.exe, abc.com and abc.bat) it is necessary to type the full name including the file-type (e.g. “abc.exe”) to run the specific program otherwise DOS will pick the program located on top (probably the abc.bat).
To get a full list of DOS commands, type “help”.
3. Database preparation
For database preparation the program formatdb.exe and a fasta-file containing all sequences including the accession numbers for your database is necessary and sufficient. Both files have to be located in X:\Lab_Hochholdinger\SA-Blast\databases\. Make sure that both files are present.
Run the Create_Database.lnk in the database-folder (X:\Lab_Hochholdinger\SA-Blast\databases). A window running cmd.exe will open. The bottom line of that window should look like "X:\Lab_Hochholdinger\SA_Blast\Databases>"
a.: For nucleotide databases:
- Create a fasta-file containing all your accessions and sequence data. A nice example for such a fasta-file is the example.txt. These files can be set up using the windows editor, by using the perl script or can be downloaded from the internet.
- Give that fasta-file a name that doesn’t exist so far (e.g. xy.txt) and save it in
"X:\Lab_Hochholdinger\SA_Blast\databases". xy should be the name of the final database.
- To get a full list of all possible options used with the formatdb.exe type “formatdb ?”
- In the cmd-window type (or copy):
"formatdb -i xy.txt -p F -o T -n xy" [enter]
This will create up to seven database-files named "xy.*". The name of your database will be "xy".
The used parameters are:
-i tells the program the name of the input-file. Should be *.txt or *.fasta
-p specifies the kind of database (F=nucleotide)
-o specifies parse options (don’t ask); (T=create index True)
-n specifies the name of the database that will be created
- Create a new subfolder named "xy" and move all of your database files in there including the fasta-file (*.txt or *.fasta) to fix the database if a file gets lost by accident. Don’t leave the files in the database folder.
- You are done creating your database. Please enter the name and description of your database in database.xls located in "X:\Lab_Hochholdinger\SA_Blast\databases". Please mark whether your database is protein or nucleotide!
b.: For protein databases:
- Create a fasta-file containing all your accessions and sequence data. A nice example for such a fasta-file is the example.txt. These files can be set up using the windows editor, by using the perl script or can be downloaded from the internet.
- Give that fasta-file a name that doesn’t exist so far (e.g. xy.txt) and save it in
"X:\Lab_Hochholdinger\SA_Blast\databases". xy should be the name of the final database.
- To get a full list of all possible options used with the formatdb.exe type “formatdb ?”
- In the cmd-window type (or copy):
"formatdb -i xy.txt -p T -o T -n xy" [enter]
If you get a message that the database is too big, try the following:
"formatdb -i xy.txt -p T -o T -v 20000 -n xy" [enter]
This will create up to seven database-files named "xy.*". The name of your database will be "xy".
The used parameters are:
-i tells the program the name of the input-file. Should be *.txt or *.fasta
-p specifies the kind of database (T=protein)
-o specifies parse options (don’t ask); (T=create index True)
-n specifies the name of the database that will be created
-v volume size. Necessary for large databases. Number can be increased.
- Create a new subfolder named "xy" and move all of your database files in there including the fasta-file (*.txt or *.fasta) to fix the database if a file gets lost by accident. Please do not leave the files in the database folder.
- You are done creating your database. Please enter the name and description of your database in database.xls located in "X:\Lab_Hochholdinger\SA_Blast\databases". Please mark whether your database is protein or nucleotide!
4. Blast Search
Before you start the blast search you need to know which database to use. Have a look in databases.xls in the databases subfolder to check whether your database has already been created by someone else. If not, you have to create to create your own new database. To do so, have a look in part 3. Database preparation within this document. If the database I already present:
- In Windows copy all your database-files into "X:\Lab_Hochholdinger\SA_Blast\bin"
- Create a file containing one or more "querys" (sequences you want to blast against your database). That file has to be in fasta-format starting with an ">" and the name or accession of your sequence. The second line should contain the sequence for that name/accession. You can run single or multiple blast-searches at once by entering these sequences into your fasta-file. Multiple sequences should be seperated by blank lines. Have a look in ex1in.txt for single sequences or ex2in.txt for multiple sequences. Ex1out.txt and Ex2out.txt will give you an example for the output of your search.
- Save your query-file (e.g. "abc_in.txt") and copy it to X:\Lab_Hochholdinger\SA_Blast\bin".
Hint 1: You can choose whatever name you like for query-file like “This_is_my_nice_and _shiny_query_file_that_I_would_like_to_blast.txt” OK, do so. But keep in mind that you have to enter the FULL NAME of that file in the DOS-command-line when performing the search. Shorter is better.
Hint 2: Get a list of all options used with the blastall.exe by typing “blastall ?”
Performing the blast search:
- Start the “Blast_Search.lnk” in SA-Blast-folder to go to the DOS-command-line. You should now be located in "X:\Lab_Hochholdinger\SA_Blast\bin>"
- Type:
“blastall -p blastn -d xy -i abc_in.txt -o abc_out.txt” [enter]
IMPORTANT: Replace xy by the name of your database! abc_in.txt is your query-file! abc_out.txt will be the Blast-Output-file created by the search! Replace blastn by blastp if you would like to perform a protein search.
- If you get too many hits with low e-values, try the following command-line:
“blastall -p blastn -e 0.0000000001 -d xy -i abc_in.txt -o abc_out.txt” [enter]
This will exclude all hits with an e-value higher than e-10!
- If you want the alignment details at the end of your file in short form you can add "-m 4" or "-m 5" to the command line, like:
“blastall -p blastn -m 4 -d xy -i abc_in.txt -o abc_out.txt” [enter]
This will make the output-file more "user-friendly" :-)
The used parameters are:
-p specifies the program (blastn, blastp, etc.)
-d Database name. Will use the files database_name.* for search
-i tells the program the name of the input-file. Should be *.txt
-e Expectation value (“cut-off value”)
-o name of the output-file. Can be *.txt or *.xml. (à -m !!!)
-m alignment view options. Adds different alignment views to the output-file. When “-m 7” is chosen the output-file must be *.xml. Otherwise the ouput-file must be *.txt. The *.xml-output might be very useful if you want to continue with the sequences in the output. *.xml-spreadsheets can easily be imported to Microsoft Excel.
See “blastall ?” for further information regarding alignment view options.
Example for command-line when *.xml output-file is preferred:
“blastall -p blastn -m 7 -d xy -i abc_in.txt -o abc_out.xml” [enter]
- Whatever command line you have chosen, an output-file (e.g. abc_out.txt) has been created containing the results of your search. Copy it to some other folder. Congratulations, you are almost done!
- IMPORTANT: Please delete ALL your database- query- and result-files in
"X:\Lab_Hochholdinger\SA_Blast\bin>"! Otherwise the bin-folder will get messed up soon! Make sure that you saved your database in the databases-folder previously.
Infos and Downloads
Blast-Downloads NCBI:
http://www.ncbi.nlm.nih.gov/BLAST/download.shtml
ZMBP Download Version 2.2.18
Have fun using the blast tool.
Nils
[Letzte Änderung: 05.02.2009]