forked from haddocking/arctic3d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_blast_deps.sh
executable file
·45 lines (39 loc) · 1.55 KB
/
install_blast_deps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
CWD="$(pwd)"
echo "Current working directory: ${CWD}"
DB_DIR=${CWD}/db
# if DB_DIR does not exist, create it
if [ ! -d "$DB_DIR" ]; then
mkdir -p "$DB_DIR"
fi
SRC_DIR=${CWD}/src
OS=$(uname -s)
echo "Operating System: ${OS}"
echo "Downloading BLAST+ executables and swissprot database..."
#======================================================================#
echo "Downloading BLAST+..."
cd "${SRC_DIR}" || exit
# if the OS is Darwin or Mac OS X, download the Mac OS X version of BLAST+
# if the OS is Linux, download the Linux version of BLAST+
if [ "${OS}" == "Darwin" ] || [ "${OS}" == "Mac OS X" ]; then
# Do something under Mac OS X platform
echo "Downloading BLAST+ for Mac OS X..."
BLAST_URL="https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.15.0/ncbi-blast-2.15.0+-x64-macosx.tar.gz"
elif [ "${OS}" == "Linux" ]; then
# Do something under GNU/Linux platform
echo "Downloading BLAST+ for Linux..."
BLAST_URL="https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.15.0/ncbi-blast-2.15.0+-x64-linux.tar.gz"
fi
echo "Downloading BLAST+ from ${BLAST_URL}..."
wget "$BLAST_URL" >/dev/null 2>&1
echo "BLAST downloaded in ${SRC_DIR}"
tar -xzf ncbi-blast-2.15.0+-x64-*.tar.gz
rm ncbi-blast-2.15.0+-x64-*.tar.gz
#======================================================================#
echo "Downloading SwissProt DB..."
cd "$DB_DIR" || exit
wget https://ftp.ncbi.nlm.nih.gov/blast/db/swissprot.tar.gz >/dev/null 2>&1
tar -zxf swissprot.tar.gz
rm swissprot.tar.gz
#======================================================================#
cd "$CWD" || exit