forked from DRL/kinfin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·84 lines (77 loc) · 2.38 KB
/
install
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "[+] Checking dependencies..."
wget=$(which wget)
if [ -x "$wget" ] ; then
echo " [+] [wget] $wget"; else
echo " [X] [wget] ... please install wget";
fi
gunzip=$(which gunzip)
if [ -x "$gunzip" ] ; then
echo " [+] [gunzip] $gunzip"; else
echo " [X] [gunzip] ... please install gunzip";
fi
# Download files
echo "[+] Checking data files..."
pfam_dest=$DIR/data/Pfam-A.clans.tsv.gz
ipr_dest=$DIR/data/entry.list
go_dest=$DIR/data/interpro2go
nodesdbgz=$DIR/data/nodesdb.gz
nodesdb=$DIR/data/nodesdb.txt
if [ -f "$nodesdb" ]; then
echo " [+] $nodesdb"
else
if [ -f "$nodesdbgz" ]; then
echo -n " [+] Extracting $nodesdbgz ..."
$gunzip -c $nodesdbgz > $nodesdb
if [ $? -eq 0 ]; then
echo "done."
else
echo "FAIL... Please download kinfin again."
exit 1
fi
else
echo "[-] $nodesdbgz not found... Please download kinfin again."
exit 1
fi
fi
if [ -f "$pfam_dest" ]; then
echo " [+] $pfam_dest"
else
echo -n " [-] $pfam_dest. Downloading ftp://ftp.ebi.ac.uk/pub/databases/Pfam/current_release/Pfam-A.clans.tsv.gz ..."
$wget -qN ftp://ftp.ebi.ac.uk/pub/databases/Pfam/current_release/Pfam-A.clans.tsv.gz -P $DIR/data/
if [ $? -eq 0 ]; then
echo "done."
else
echo "FAIL."
fi
fi
if [ -f "$ipr_dest" ]; then
echo " [+] $ipr_dest"
else
echo -n " [-] $ipr_dest. Downloading ftp://ftp.ebi.ac.uk/pub/databases/interpro/current_release/entry.list ..."
$wget -qN ftp://ftp.ebi.ac.uk/pub/databases/interpro/current_release/entry.list -P $DIR/data/
if [ $? -eq 0 ]; then
echo "done."
else
echo "FAIL."
fi
fi
if [ -f "$go_dest" ]; then
echo " [+] $go_dest"
else
echo -n " [-] $go_dest. Downloading ftp://ftp.ebi.ac.uk/pub/databases/interpro/current_release/interpro2go ... "
$wget -qN ftp://ftp.ebi.ac.uk/pub/databases/interpro/current_release/interpro2go -P $DIR/data/
if [ $? -eq 0 ]; then
echo "done."
else
echo "FAIL."
fi
fi
# Create executable
echo "[+] Creating executable..."
echo '#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
$DIR/src/kinfin.py "$@"' > $DIR/kinfin && chmod +x $DIR/kinfin
# Done
echo "[+] Kinfin was installed. Please run ./kinfin"