====== Install Blast+ and Blast legacy ======
* DB
Make directory /db and mount it as separated partition.
\\
Copy update script from Blast+ bin directory.
root@rachaelx:~# cp /usr/share/ncbi-blast-2.2.27+/bin/update_blastdb.pl /db/
Script help
root@rachaelx:~# cd /db
root@rachaelx:/db# ./update_blastdb.pl -help
List database names
root@rachaelx:~# cd /db
root@rachaelx:/db# ./update_blastdb.pl --showall
Download/update database
root@rachaelx:~# cd /db
root@rachaelx:/db# ./update_blastdb.pl --decompress --verbose swissprot
* Blast+
Download and install
root@rachaelx:~# wget /forsomeserver/ncbi-blast-2.2.27+-x64-linux.tar.gz
root@rachaelx:~# tar xzf ncbi-blast-2.2.27+-x64-linux.tar.gz
root@rachaelx:~# mv ncbi-blast-2.2.27+ /usr/share/
root@rachaelx:~# chown -R root:root /usr/share/ncbi-blast-2.2.27+
root@rachaelx:~# chmod -R 755 /usr/share/ncbi-blast-2.2.27+
User script to activate Blast+
export PATH=/usr/share/ncbi-blast-2.2.27+/bin:$PATH
export BLASTDB=/db
Test installation
user@rachaelx:~$ blastp -db swissprot -query testseq.fasta
* Blast legacy
Download and install
root@rachaelx:~# wget /forsomeserver/blast-2.2.26-x64-linux.tar.gz
root@rachaelx:~# tar xzf blast-2.2.26-x64-linux.tar.gz
root@rachaelx:~# mv /root/blast-2.2.26 /usr/share/
root@rachaelx:~# chown -R root:root /usr/share/blast-2.2.26
root@rachaelx:~# chmod -R 755 /usr/share/blast-2.2.26
User script to activate Blast legacy
export PATH=/usr/share/blast-2.2.26/bin:$PATH
export BLASTMAT=/usr/share/blast-2.2.26/data
export BLASTDB=/db
Test installation
user@rachaelx:~$ blastall -p blastp -i testseq.fasta -d swissprot
* Schedule DB update
Copy update script in directory /db.
\\
#!/bin/bash
cd /db
date > "update.log"
#verify lock db
echo "verifica lock" >> "update.log"
DIRS=$(find "/home/" -mindepth 1 -maxdepth 1 -type d)
for user in $DIRS
do
filelock=$user"/dblock"
if [ -e $filelock ] && [ -f $filelock ]
then
echo $filelock" -> NO update" >> "update.log"
exit
fi
done
echo "SI Update" >> "update.log"
./update_blastdb.pl --decompress swissprot 16SMicrobial refseq_protein >> "update.log"
echo "DONE" >> "update.log"
exit
Schedule cron job
crontab -e
50 12 * * * /db/condupdatedb.sh > /dev/null 2>&1
**NB
\\
Before blast execution, user must create a file named "dblock" in his home directory to avoid update while blast is running.
At the end of the process the file must be removed.**