-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathrun_all_analyses_and_plots.sh
292 lines (230 loc) · 11.5 KB
/
run_all_analyses_and_plots.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
#!/bin/sh
set -euo pipefail
# This script runs analysis code and plotting scripts for the publication,
# including both cancer types (both) or just one cancer type (BRCA or GBM).
# The script calls:
# 1. run_machine_learning_experiments.sh
# 2. run_differential_expression_experiments.sh (subtype only)
# 3. plots/scripts/visualize_expression.R (subtype only)
# 4. plotting scripts, as appropriate
# cancer type (must be both, BRCA, or GBM)
cancer_type=$1
if [ $cancer_type != "both" ] && [ $cancer_type != "BRCA" ] && [ $cancer_type != "GBM" ]; then
echo Cancer type must be both, BRCA or GBM in run_all_analyses_and_plots.sh [cancer_type]
exit
fi
################################################################################
# BRCA
################################################################################
if [ $cancer_type == "both" ] || [ $cancer_type == "BRCA" ]; then
# BRCA subtype ---------------------------------------------------------------
# run machine learning and DEG analysis scripts
bash run_machine_learning_experiments.sh BRCA subtype 7
bash run_differential_expression_experiments.sh BRCA Basal Her2,LumA Her2,LumA 7
# plot array vs. RNA-seq expression levels after normalization
Rscript plots/scripts/visualize_expression.R --cancer_type BRCA --predictor subtype
# plot difference in subtype prediction kappa between non-reconstructed and reconstructed data
Rscript plots/scripts/recon_kappa_difference.R --cancer_type BRCA --output_directory plots/supplementary
# stacked bar plot showing distribution of subtypes in train/test sets (one representative example)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type BRCA \
--predictor subtype \
--output_directory plots/supplementary
# stacked bar plots showing distribution of subtypes in train/test sets (all seeds)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type BRCA \
--predictor subtype \
--plot_all_seeds \
--output_directory plots/supplementary
# violin + line plots showing kappa values from predictions on test data
Rscript plots/scripts/3-plot_category_kappa.R \
--cancer_type BRCA \
--predictor subtype \
--output_directory plots/main
# violin + line plots showing kappa values from predictions on reconstructed test data
Rscript plots/scripts/6-plot_recon_kappa.R \
--cancer_type BRCA \
--predictor subtype \
--output_directory plots/supplementary
# violin + line plots showing gene-level MASE values from reconstructed test data
Rscript plots/scripts/6-plot_recon_error.R \
--cancer_type BRCA \
--predictor subtype \
--output_directory plots/supplementary
# violin plots showing proportion of pathways significant in PLIER analyses
Rscript plots/scripts/7-plot_plier_pathways.R \
--cancer_type BRCA \
--predictor subtype \
--output_directory plots/main
# bar plot showing proportion of genes differentially expressed (Basal vs. Others)
# line plot showing overlap with silver standard DEGs (Basal vs. Others)
Rscript plots/scripts/1A-plot_DEGs.R \
--cancer_type BRCA \
--subtype_vs_others Basal \
--proportion_output_directory plots/supplementary \
--overlap_output_directory plots/supplementary \
--overlap_measure Jaccard,Spearman
# bar plot showing proportion of genes differentially expressed (Her2 vs. LumA)
# line plot showing overlap with silver standard DEGs (Her2 vs. LumA)
Rscript plots/scripts/1A-plot_DEGs.R \
--cancer_type BRCA \
--subtype_vs_subtype Her2,LumA \
--proportion_output_directory plots/supplementary \
--overlap_output_directory plots/main \
--overlap_measure Jaccard,Spearman
# line plot showing overlap with silver standard DEGs (Her2 vs. LumA) across small n values
Rscript plots/scripts/2A-plot_small_n_differential_expression.R \
--cancer_type BRCA \
--subtype_vs_subtype Her2,LumA \
--output_directory plots/main \
--overlap_measure Jaccard,Spearman
# ----------------------------------------------------------------------------
# BRCA TP53 ------------------------------------------------------------------
# run machine learning analysis scripts
bash run_machine_learning_experiments.sh BRCA TP53 7
# stacked bar plot showing distribution of subtypes in train/test sets (one representative example)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type BRCA \
--predictor TP53 \
--output_directory plots/supplementary
# stacked bar plots showing distribution of subtypes in train/test sets (all seeds)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type BRCA \
--predictor TP53 \
--plot_all_seeds \
--output_directory plots/supplementary
# violin + line plots showing kappa values from predictions on test data
Rscript plots/scripts/3-plot_category_kappa.R \
--cancer_type BRCA \
--predictor TP53 \
--null_model \
--output_directory plots/supplementary
# ----------------------------------------------------------------------------
# BRCA PIK3CA ----------------------------------------------------------------
# run machine learning analysis scripts
bash run_machine_learning_experiments.sh BRCA PIK3CA 7
# stacked bar plot showing distribution of subtypes in train/test sets (one representative example)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type BRCA \
--predictor PIK3CA \
--output_directory plots/supplementary
# stacked bar plots showing distribution of subtypes in train/test sets (all seeds)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type BRCA \
--predictor PIK3CA \
--plot_all_seeds \
--output_directory plots/supplementary
# violin + line plots showing kappa values from predictions on test data
Rscript plots/scripts/3-plot_category_kappa.R \
--cancer_type BRCA \
--predictor PIK3CA \
--null_model \
--output_directory plots/supplementary
# ----------------------------------------------------------------------------
fi
################################################################################
# GBM
################################################################################
if [ $cancer_type == "both" ] || [ $cancer_type == "GBM" ]; then
# GBM subtype ----------------------------------------------------------------
# run machine learning and DEG analysis scripts
bash run_machine_learning_experiments.sh GBM subtype 7
bash run_differential_expression_experiments.sh GBM Proneural Classical,Mesenchymal Classical,Mesenchymal 7
# plot array vs. RNA-seq expression levels after normalization
Rscript plots/scripts/visualize_expression.R --cancer_type GBM --predictor subtype
# plot difference in subtype prediction kappa between non-reconstructed and reconstructed data
Rscript plots/scripts/recon_kappa_difference.R --cancer_type GBM --output_directory plots/supplementary
# stacked bar plot showing distribution of subtypes in train/test sets (one representative example)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type GBM \
--predictor subtype \
--output_directory plots/supplementary
# stacked bar plots showing distribution of subtypes in train/test sets (all seeds)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type GBM \
--predictor subtype \
--plot_all_seeds \
--output_directory plots/supplementary
# violin + line plots showing kappa values from predictions on test data
Rscript plots/scripts/3-plot_category_kappa.R \
--cancer_type GBM \
--predictor subtype \
--output_directory plots/supplementary
# violin + line plots showing kappa values from predictions on reconstructed test data
Rscript plots/scripts/6-plot_recon_kappa.R \
--cancer_type GBM \
--predictor subtype \
--output_directory plots/supplementary
# violin + line plots showing gene-level MASE values from reconstructed test data
Rscript plots/scripts/6-plot_recon_error.R \
--cancer_type GBM \
--predictor subtype \
--output_directory plots/supplementary
# violin plots showing proportion of pathways significant in PLIER analyses
Rscript plots/scripts/7-plot_plier_pathways.R \
--cancer_type GBM \
--predictor subtype \
--output_directory plots/main
# bar plot showing proportion of genes differentially expressed (Proneural vs. Others, Classical vs. Mesenchymal)
# line plot showing overlap with silver standard DEGs (Proneural vs. Others, Classical vs. Mesenchymal)
Rscript plots/scripts/1A-plot_DEGs.R \
--cancer_type GBM \
--subtype_vs_others Proneural \
--subtype_vs_subtype Classical,Mesenchymal \
--proportion_output_directory plots/supplementary \
--overlap_output_directory plots/supplementary \
--overlap_measure Jaccard,Spearman
# line plot showing overlap with silver standard DEGs (Classical vs. Mesenchymal) across small n values
Rscript plots/scripts/2A-plot_small_n_differential_expression.R \
--cancer_type GBM \
--subtype_vs_subtype Classical,Mesenchymal \
--output_directory plots/supplementary \
--overlap_measure Jaccard,Spearman
# ----------------------------------------------------------------------------
# GBM TP53 -------------------------------------------------------------------
# run machine learning analysis scripts
bash run_machine_learning_experiments.sh GBM TP53 7
# stacked bar plot showing distribution of subtypes in train/test sets (one representative example)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type GBM \
--predictor TP53 \
--output_directory plots/supplementary
# stacked bar plots showing distribution of subtypes in train/test sets (all seeds)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type GBM \
--predictor TP53 \
--plot_all_seeds \
--output_directory plots/supplementary
# violin + line plots showing kappa values from predictions on test data
Rscript plots/scripts/3-plot_category_kappa.R \
--cancer_type GBM \
--predictor TP53 \
--null_model \
--output_directory plots/main
# ----------------------------------------------------------------------------
# GBM PIK3CA -----------------------------------------------------------------
# run machine learning analysis scripts
bash run_machine_learning_experiments.sh GBM PIK3CA 7
# stacked bar plot showing distribution of subtypes in train/test sets (one representative example)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type GBM \
--predictor PIK3CA \
--output_directory plots/supplementary
# stacked bar plots showing distribution of subtypes in train/test sets (all seeds)
Rscript plots/scripts/0-plot_predictor_category_distributions.R \
--cancer_type GBM \
--predictor PIK3CA \
--plot_all_seeds \
--output_directory plots/supplementary
# violin + line plots showing kappa values from predictions on test data
Rscript plots/scripts/3-plot_category_kappa.R \
--cancer_type GBM \
--predictor PIK3CA \
--null_model \
--output_directory plots/supplementary
# ----------------------------------------------------------------------------
fi
################################################################################
# PLIER pathway analysis of BRCA and/or GBM
################################################################################
Rscript -e "rmarkdown::render('8-PLIER_pathways_analysis.Rmd', clean = TRUE)"