Install a Blast and download a database in Ubuntu!

First install Blast
sudo apt-get install blast2
Make a blast Directory
mkdir /home/username/blast/db
cd /home/username/blast/db
connect to blast FTP
ftp ftp.ncbi.nlm.nih.gov

Connected to ftp.wip.ncbi.nlm.nih.gov.
220-
Warning Notice!
[ ... Extra warning message removed for brevity ... ]
Name (ftp.ncbi.nlm.nih.gov:tao): anonymous
331 Anonymous login ok, send your complete email address as your password.
Password: [note: enter your email address at this prompt]
230-Anonymous access granted, restrictions apply.
Please read the file README.ftp
230    it was last modified on Fri Mar 28 14:05:45 2008 - 716 days ago
Remote system type is UNIX.
Using binary mode to transfer files.
Enter Blast database directory
ftp> cd blast/db
Get a database. Below is an example and exit ftp
ftp> get 16SMicrobial.tar.gz
ftp> bye
221 Goodbye. 
Extract the database
tar zxvpf 16SMicrobial.tar.gz
Enter your query sequence in a file (q16s.txt) and execute the command below.
blastall -p blastn -i q16s.txt -d 16SMicrobial -T -o output.html
If you want to perform a specific organism you need to know the taxonomy id. $2 is taxonomy in below command. DB enlist the gi of of specific taxonomy to a file and the blastn is performed on specific gi list.
blastdbcmd -db 16SMicrobial -entry all -outfmt "%g %T" | \
   awk ' { if ($2 == 521007) { print $1 } } ' > gilist.gi

blastn -db 16SMicrobial  -query q16sF.txt -gilist gilist.gi -html -out output.html

Comments

Popular posts from this blog

Switching from Notepad++ FTP to Visual Studio Code FTP

jTable to edit and process MySQL table using CodeIgnitor : Part 2

Simple PHP Script to read Tab Delimited File