-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate_GOdb
88 lines (70 loc) · 2.2 KB
/
update_GOdb
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
#!/bin/bash
bin=`cd $(dirname $0);pwd`
date="`date +%Y%m%d`"
current_version=`ls $bin/database/basic/go/`
usage()
{
echo -e "\e[1;33m
This is a program for GO database update for AllEnricher.
It will download the up to date gene2go, obo and goa files.
The new build database will be named in \"GO+current date\".
\e[1;31m[Exsits DB version]:
$current_version
[To update new DB version]:
GO$date
[To update new DB path]:
$bin/database/basic/go/GO$date
\e[1;33m[Usage]: `basename $0`
-h|help Print this help information."
exit 1
}
while getopts 'h' opt;
do
case ${opt} in
h|help)
usage
exit 1;;
?)
usage
exit 1
esac
done
versionfile="$bin/database/basic/go/GO$date";
# tips
echo -e "\e[1;33m
This is a program for GO database update for AllEnricher.
It will download the up to date gene2go, obo and goa files.
The new build database will be named in \"GO+current date\".
\e[1;31m[Exsits DB version]:
$current_version
[To update new DB version]:
GO$date
[To update new DB path]:
$bin/database/basic/go/GO$date\n"
#mkdir -p $versionfile
cd $bin/database/basic/go/
if [ "$current_version" != "GO$date" ]
then
mv $current_version GO$date
fi
cd $versionfile
echo -e "\e[1;33m|----Downloading gene2go from NCBI..."$(tput sgr0)
wget -c ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/gene2go.gz
echo -e "\e[1;33m|----Downloading gene_info from NCBI..."$(tput sgr0)
wget -c ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/gene_info.gz
echo -e "\e[1;33m|----Downloading GO OBO file from geneontology..."$(tput sgr0)
wget -c http://snapshot.geneontology.org/ontology/go-basic.obo
echo -e "\e[1;33m|----Downloading gaf file from GOA..."$(tput sgr0)
wget -c ftp://ftp.ebi.ac.uk/pub/databases/GO/goa/UNIPROT/goa_uniprot_all.gaf.gz
echo -e "\e[1;33m----|AllEnricher GO database update done!!!\n\nNew version path:\n$versionfile" $(tput sgr0)
#if [ "$current_version" != GO$date ];then
# read -n1 -p "Delete the old version to save storage? [Y|N]" answer
# echo
# case $answer in
# y|Y)
# rm -rf $bin/database/basic/go/$current_version && echo Done.;;
# N|n)
# echo ok
# exit 1;;
# esac
#fi