-
Notifications
You must be signed in to change notification settings - Fork 3
/
make_speciesDB
137 lines (118 loc) · 4.18 KB
/
make_speciesDB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
usage()
{
echo -e "
\e[1;33mThis script is used to build AllEnricher database for specified species.
PS: Only support human for Disease Ontology analysis.
Usage: `basename $0` [options] [arg...]
-vg|versiongo AllEnricher GO database version to use, like\"GO20181026\";
default version is the most recent version you had build.
-vr|versionre AllEnricher GO database version to use, like\"GO20181026\";
default version is the most recent version you had build.
-s|species Organism kegg abbreviation, like \"hsa\" for human;
-i|taxid Organism taxnomy id], like \"9606\" for human;
-R|Rscript Rscript program, like \"\$WHEREYOUR/Rscript\";
-h|help Print this help information."
exit 1
}
if [ $# == 0 ]; then
usage
fi
while getopts 'vg:vr:s:i:R:h' opt;
do
case ${opt} in
vg|versiongo)
GOdb="${OPTARG}";;
vr|versionre)
reacdb="${OPTARG}";;
s|species)
organism="${OPTARG}";;
i|taxid)
taxid="${OPTARG}";;
R|Rscript)
Rscript="${OPTARG}";;
h|help)
usage
exit 1;;
?)
usage
exit 1
esac
done
if [ ! $organism ]
then
echo "[error] Please specify the organism kegg abbreviation."
exit 1
fi
if [ ! $taxid ]
then
echo "[error] Please specify the organism taxnomy id."
exit 1
fi
if [ ! $Rscript ]
then
echo "[error] Please specify the Rscript program to use."
exit 1
fi
bin=`cd $(dirname $0);pwd`
date="`date +%Y%m%d`"
allversion=`ls $bin/database/basic/go/`
echo -e "[Attention] Avaliable AllEnricher GO database version: \n$allversion"
if [ ! $GOdb ]
then
OLD_IFS="$IFS"
IFS="\n"
arr=($allversion)
IFS="$OLD_IFS"
for s in ${arr[@]}
do
GOdb=$s
done
fi
echo -e "[Attention] You are using AllEnricher GO database version: \n$GOdb"
allversion2=`ls $bin/database/basic/reactome/`
if [ ! $reacdb ]
then
OLD_IFS="$IFS"
IFS="\n"
arr=($allversion2)
IFS="$OLD_IFS"
for s in ${arr[@]}
do
reacdb=$s
done
fi
echo -e "[Attention] You are using AllEnricher Reactome database version: \n$reacdb"
echo -e "\e[1:33m[`date`]|---Make AllEnricher go database for $organism begin..."$(tput sgr0)
mkdir -p $bin/database/organism/v$date/$organism/
sh $bin/src/makeDB.go.v1.0.sh -v $GOdb -i $taxid -s $organism -o $bin/database/organism/v$date/$organism/
echo -e "\e[1:33m[`date`]---|Make GO DB finished!"$(tput sgr0)
echo -e "\e[1:33m[`date`]|---Make AllEnricher kegg database for $organism begin..."$(tput sgr0)
sh $bin/src/makeDB.kegg.v1.1.sh -s $organism -i $taxid -g $bin/database/basic/go/$GOdb/gene_info.gz -o $bin/database/organism/v$date/$organism/ -R $Rscript
echo -e "\e[1:33m[`date`]---|Make KEGG DB finished!"$(tput sgr0)
echo -e "\e[1:33m[`date`]|---Make AllEnricher Reactome database for $organism begin..."$(tput sgr0)
nn=0
for s in bta cel cfa dre ddi dme gga hsa mmu mtu pfa rno sce spo ssc xtr
do
if [ $s != $organism ]
then
continue
else
sh $bin/src/makeDB.reactome.v1.0.sh -v $reacdb -s $organism -i $taxid -o $bin/database/organism/v$date/$organism/ && nn=1
fi
done
if [ $nn == 0 ]
then
echo -e "\e[1:33m[`date`]---|Reactome database do not support this species currently: $organism "$(tput sgr0)
fi
echo -e "\e[1:33m[`date`]---|Make Reactome DB finished!"$(tput sgr0)
if [ $organism == "hsa" ]
then
echo -e "\e[1:33m[`date`]|---Make AllEnricher DO database for $organism begin..."$(tput sgr0)
sh $bin/src/makeDB.do.v1.0.sh -s $organism -i $taxid -g $bin/database/basic/go/$GOdb/gene_info.gz -o $bin/database/organism/v$date/$organism/
echo -e "\e[1:33m[`date`]---|Make DO database finished!" $(tput sgr0)
echo -e "\e[1:33m[`date`]|---Make AllEnricher DisGeNET disease database for $organism begin..."$(tput sgr0)
sh $bin/src/makeDB.DisGeNET.v1.0.sh -s $organism -i $taxid -g $bin/database/basic/go/$GOdb/gene_info.gz -o $bin/database/organism/v$date/$organism/
echo -e "\e[1:33m[`date`]---|Make DisGeNET disease finished!" $(tput sgr0)
fi
echo -e "\e[1:33m[`date`]---|All finished!" $(tput sgr0)