-
Notifications
You must be signed in to change notification settings - Fork 5
/
geneSCF
executable file
·143 lines (93 loc) · 4.46 KB
/
geneSCF
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
138
139
140
141
#!/bin/bash
for i in "$@"
do
case $i in
-t=*|--gtype=*)
GTYPE="${i#*=}"
;;
-i=*|--infile=*)
INFILE="${i#*=}"
;;
-o=*|--outpath=*)
OUTPATH="${i#*=}"
;;
-db=*|--database=*)
database="${i#*=}"
;;
-m=*|--mode=*)
mode="${i#*=}"
;;
-org=*|--organism=*)
organism="${i#*=}"
;;
-bg=*|--background=*)
background="${i#*=}"
;;
-p=*|--plot=*)
plot="${i#*=}"
;;
-h*|--help)
echo -e "\n\nGeneSCF USAGE: \n\n./geneSCF -m=[update|normal] -i=[INPUT_PATH/INPUT_FILE] -t=[gid|sym] -o=[OUTPUT_PATH/FOLDER/] -db=[GO_all|GO_BP|GO_MF|GO_CC|KEGG|REACTOME|NCG] -p=[yes|no] -bg=[#TotalGenes] -org=[see,org_codes_help]\n\n==========\nOptions: ALL PARAMETERS MUST BE SPECIFIED\n==========\n\n[-m= | --mode=]\t\tFor normal mode use 'normal' and for update mode use 'update' without quotes.\n\n[-i= | --infile=]\tInput file contains list of Entrez GeneIDs or OFFICIAL GENE SYMBOLS.\n\t\t\tThe genes must be new lines seperated (One gene per line).\n\n[-t= | --gtype=]\tType of input in the provided list either Entrez GeneIDs 'gid'\n\t\t\tor OFFICIAL GENE SYMBOLS 'sym' (Without quotes, Example for \n\t\t\thuman 'sym' => HUGO gene symbols).\n\n[-db= | --database=]\tDatabase you want to find gene enrichment which is either \n\t\t\tgeneontology 'GO_all' or geneontology-biological_process \n\t\t\t'GO_BP' or geneontology-molecular_function 'GO_MF' or \n\t\t\tgeneontology-cellular_components 'GO_CC' or kegg 'KEGG' or \n\t\t\treactome 'REACTOME' or Network of Cancer Genes 'NCG' (Without quotes).\n\n[-o= | --outpath=]\tExisting directory to save output file. The output will be with saved in the \n\t\t\tprovided location as {INPUT_FILE_NAME}_{database}_functional_classification.tsv \n\t\t\t(tab-seperated file).\n\n[-bg= | --background=]\tTotal background genes to consider (Example : ~20,000 for human).\n\n[-org= | --organism=]\tPlease see organism codes(For human in KEGG ->'hsa' in Geneontology -> 'goa_human').\n\t\t\tFor REACTOME and NCG use 'Hs' (human).\n\n[-p= | --plot=]\t\tFor additional graphical output use 'yes' or 'no'.This requires R version > 3.0 and \n\t\t\t'ggplot2' R package to be pre-installed on the system.\n\n[-h | --help]\t\tFor displaying this help page.\n\n\nprepare_database USAGE: \n\n./prepare_database -db=[GO_all|GO_BP|GO_MF|GO_CC|KEGG|REACTOME|NCG] -org=[see,org_codes_help]\n\n==========\nOptions: ALL PARAMETERS MUST BE SPECIFIED\n==========\n\n[-db= | --database=]\tOptions:[GO_all|GO_BP|GO_MF|GO_CC|KEGG|REACTOME] \n\n[-org= | --organism=]\tOptions:[see,org_codes_help]\n\n";
exit 1;
;;
*)
# unknown option
;;
esac
done
if [ $# -eq 0 ]; then
echo -e "\n\nPlease use:\n\ngeneSCF -h \n\n(or)\n\ngeneSCF --help \n\n for help\n";
exit 1;
fi
if [ -z $database ]; then
echo "Error:Please specify one of these databses GO_all,GO_BP,GO_MF,GO_CC,KEGG,NCG,REACTOME";
exit 1;
fi
if [ -z $mode ]; then
echo "Error:Please specify the --mode parameter";
exit 1;
fi
if [ -z $GTYPE ]; then
GTYPE="gid";
fi
if [ -z $background ]; then
echo "Error:background gene set information missing --background";
fi
if [ -z $INFILE ]; then
echo "Error:Input file missing";
exit 1;
fi
if [ -z $OUTPATH ]; then
echo "Error:Please specify output path";
exit 1;
fi
if [ -z $plot ]; then
echo "Error:Please specify graphical parameter --plot";
exit 1;
fi
if [ -z $organism ]; then
echo "Error:Please specify organism --organism. For KEGG and Geneontology use 'org_codes_help' folder comes with GeneSCF; For REACTOME and NCG use 'Hs'.";
exit 1;
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ "$mode" == "update" ]]; then
echo "Since you have selected '$mode' mode. It will take a while to prepare new updated database";
echo "Connecting remote RUD..";
${DIR}/prepare_database -db=${database} -org=${organism};
DT=`/bin/date`
echo "=>processing in $mode started....$DT";
echo "=> Finished retriving database...";
echo "=> Calculating statistics...";
perl ${DIR}/class/functional_class3.pl ${GTYPE} ${INFILE} ${OUTPATH} ${database} ${background} ${DIR} ${organism} ${plot};
DT=`/bin/date`
echo "$DT finished processing"
fi
if [[ "$mode" == "normal" ]]; then
DT=`/bin/date`
echo "processing in '$mode' mode started....$DT";
echo "=> Finished retriving database...";
echo "=> Calculating statistics...";
perl ${DIR}/class/functional_class3.pl ${GTYPE} ${INFILE} ${OUTPATH} ${database} ${background} ${DIR} ${organism} ${plot};
DT=`/bin/date`
echo "$DT finished processing"
fi