-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gensor-Units
executable file
·159 lines (142 loc) · 3.56 KB
/
Gensor-Units
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#!/bin/bash
###### Functions ######
function usage()
{
# Display Help
echo
echo "Syntax: Gensor-Units command [options]"
echo "Commands:"
echo " Update Updates gu-library files"
echo " Gensor Builds Gensor Units of the TFs in the regulatory network"
echo " Feedback Searches for feedback within each GENSOR unit"
echo
echo "Options:"
echo "-h | --help Print usage."
echo
}
function GU-help()
{
# Display Help
echo
echo "Syntax: Gensor-Units Gensor -n <path to Network> -o <name of output directory>"
echo "Commands:"
echo " Gensor Builds Gensor Units of the TFs in the regulatory network"
echo
echo "Options:"
echo "-h Print this help message."
echo "-n Path to Network."
echo "-o Name of output directory."
echo
}
function Feedback-help()
{
# Display Help
echo
echo "Syntax: Gensor-Units Feedback -g <path to GU directory>"
echo "Commands:"
echo " Feedback Searches for feedback in the Gensor Units provided"
echo
echo "Options:"
echo "-h Print this help message."
echo "-g Path to GU directory."
echo "-o Path to output directory."
echo
}
function update
{
echo "Updating GU library files"
./bin/update_library.sh
}
function Gensor-units
{
Ntw=$1
outdir=$2
./bin/pipeline_permissive_connectivity.sh $Ntw $outdir
}
function feedback
{
echo "Calculating feedback"
GUdir=${1%/}
outdir=${2%/}
./bin/search_feedback.py $GUdir $outdir
}
############################################################
# Main program #
############################################################
# Process options
#
if (( $# < 1 ))
then
echo "No commands or arguments provided"
usage
exit 0
fi;
while (( $# ))
do
case "$1" in
--help | -h)
usage
exit 0
;;
Gensor)
shift
while getopts ":n:o:h" option; do
case $option in
h) # display Help
GU-help
exit;;
n) # Enter a name
Ntw=$OPTARG;;
o) #output name
out=$OPTARG;;
\?) # Invalid option
echo "Error: Invalid option"
GU-help
exit;;
esac
done
if [ "$*" == "" ]; then
echo "No arguments provided"
GU-help
exit 1
fi
Gensor-units $Ntw $out
exit 0
;;
Update)
shift
update
exit 0
;;
Feedback)
shift
while getopts ":g:o:h" option; do
case $option in
h) # display Help
Feedback-help
exit;;
g) # Enter a name
gu=$OPTARG;;
o) # Output dir
out=$OPTARG;;
\?) # Invalid option
echo "Error: Invalid option"
Feedback-help
exit;;
esac
done
if [ "$*" == "" ]; then
echo "No arguments provided"
Feedback-help
exit 1
fi
feedback $gu $out
exit 0
;;
*)
echo "Command not recognized."
usage
exit 1
;;
esac
done