-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline.sh
192 lines (139 loc) · 4.52 KB
/
pipeline.sh
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#!/bin/bash
set -e
#this is just the list of commands needed to run the whole experiment.
#first we initialize the graphlets directory if it doesn't exist
if [ ! -d graphlets ]
then
mkdir graphlets
fi
if [ ! -d graphlets/dbs ]
then
mkdir graphlets/dbs
fi
if [ ! -d graphlets/null-models ]
then
mkdir graphlets/null-models
fi
#and even if it does, we populate it with any new dbs that aren't in it yet
for x in $(find networks/dbs -type d | cut -d "/" -f 3);
do
if [ ! -d graphlets/dbs/$x ]
then
mkdir graphlets/dbs/"$x"
fi
if [ ! -d graphlets/null-models/$x ]
then
mkdir graphlets/null-models/"$x"
fi
done
#now we populate the dbs directories with graphlets and ghust coefficients, unless told not to
if [ ! "$1" = "False" ]
then
cd src/graphlets;
for x in $(find ../../networks/dbs -type d | cut -d "/" -f 5);
do
python3 graphlet_count.py ../../networks/dbs/"$x"/ ../../graphlets/dbs/"$x"/
python3 rho_coeff.py ../../graphlets/dbs/"$x"/ ../../graphlets/dbs/"$x"/
done
cd ../../
fi
#we also want to initialize an output directory to put our plots if it doesn't exist
if [ ! -d out ]
then
mkdir out
fi
#now we can cluster dbs against one another in a pairwise fashion for instance.
#for x in $(ls graphlets)
#do
# for y in $(ls graphlets)
# do
# if [ ! "$x" = "$y" ]
# then
# cd src/clustering
# python3 plot_dendrogram_colors.py ../../graphlets/"$x"/*.gcount ../../graphlets/"$y"/*.gcount ../../out/"$x"-vs-"$y"-dendrogram.pdf
# cd ../../
# fi
# done
#done
#lets make one big dendrogram with every database
cd src/clustering
python3 plot_dendrogram_colors.py ../../graphlets/dbs/*/*.gcount ../../out/all-dbs-dendrogram.pdf
python3 plot_dendrogram_colors.py ../../graphlets/dbs/*/*.rho ../../out/all-dbs-dendrogram-rho.pdf
cd ../../
#next lets handle making random networks.
#we have two random network models. (1) random-empirical, (2) random-rewiring.
if [ ! -d networks/null-models/ ]
then
mkdir networks/null-models/
fi
if [ ! -d networks/null-models/random-empirical ]
then
mkdir networks/null-models/random-empirical
fi
if [ ! -d networks/null-models/random-rewiring ]
then
mkdir networks/null-models/random-rewiring
fi
#populate both directories
for x in $(find networks/dbs -type d | cut -d "/" -f 3);
do
if [ ! -d networks/null-models/random-empirical/$x ]
then
mkdir networks/null-models/random-empirical/"$x"
fi
if [ ! -d networks/null-models/random-rewiring/$x ]
then
mkdir networks/null-models/random-rewiring/"$x"
fi
done
#if we want to generate null models, then we will do so.
if [ ! "$2" = "False" ]
then
cd src/null-models
for x in $(find ../../networks/dbs -type d | cut -d "/" -f 5);
do
echo $x
python3 random-empirical.py ../../networks/interactomes/All_Pathway_Commons.txt ../../graphlets/dbs/"$x" 10 ../../networks/null-models/random-empirical/"$x";
done
python3 random-rewiring.py ../../graphlets/dbs/ 10 ../../networks/null-models/random-rewiring/
cd ../../
fi
#make graphlet directories for null models
if [ ! -d graphlets/null-models/random-empirical ]
then
mkdir graphlets/null-models/random-empirical
fi
if [ ! -d graphlets/null-models/random-rewiring ]
then
mkdir graphlets/null-models/random-rewiring
fi
for x in $(find networks/dbs -type d | cut -d "/" -f 3);
do
if [ ! -d graphlets/null-models/random-empirical/$x ]
then
mkdir graphlets/null-models/random-empirical/"$x"
fi
if [ ! -d graphlets/null-models/random-rewiring/$x ]
then
mkdir graphlets/null-models/random-rewiring/"$x"
fi
done
#make graphlets for null models
if [ ! "$1" = "False" ]
then
cd src/graphlets;
for x in $(find ../../networks/dbs -type d | cut -d "/" -f 5);
do
echo $x
python3 graphlet_count.py ../../networks/null-models/random-empirical/"$x"/ ../../graphlets/null-models/random-empirical/"$x"/
python3 rho_coeff.py ../../graphlets/null-models/random-empirical/"$x"/ ../../graphlets/null-models/random-empirical/"$x"/
python3 graphlet_count.py ../../networks/null-models/random-rewiring/"$x"/ ../../graphlets/null-models/random-rewiring/"$x"/
python3 rho_coeff.py ../../graphlets/null-models/random-rewiring/"$x"/ ../../graphlets/null-models/random-rewiring/"$x"/
done
cd ../../
fi
#plot null dendrogram
cd src/clustering/
python3 plot_dendrogram_null.py ../../graphlets/dbs/netpath/*.gcount ../../graphlets/null-models/random-empirical/netpath/*-1-*.gcount ../../out/netpath-vs-random-empirical.pdf
python3 plot_dendrogram_null.py ../../graphlets/dbs/netpath/*.rho ../../graphlets/null-models/random-empirical/netpath/*-1-*.rho ../../out/netpath-vs-random-empirical-rho.pdf
cd ../../