-
Notifications
You must be signed in to change notification settings - Fork 0
/
Example for paper figures.R
270 lines (187 loc) · 27 KB
/
Example for paper figures.R
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
#install required packages
install.packages('devtools')
library(devtools)
BiocManager::install(c('baySeq','Biobase','compcodeR','DESeq','DESeq2','edgeR,','impute','limma','ROTS'))
install.packages('gplots','gtools','ggplot2','PoissonSeq','reshape','RColorBrewer','ROCR','samr','SimSeq','statmod','XML')
#install compareDEtools and load package
install_github('unistbig/compareDEtools')
library(compareDEtools)
#Fig1
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','BaySeq.qn','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/Fig1/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/Fig1/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/Fig1/Figure/' #Set result figure save directory
#A
GenerateRealSimulation(working.dir=dataset.dir, data.types='SEQC', rep=1, nsample=5) #Generate SEQC real dataset
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=TRUE, data.types='SEQC', rep.end=1, nsample=c(5), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
performance_realdata_plot(working.dir=analysis.dir,figure.dir=figure.dir,simul.data='SEQC', rep.end=1, nsample=c(5), AnalysisMethods=AnalysisMethods, rowType = 'AUC') #Draw real data performance plot for AUC
#B
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', rep.end=50, nsample=c(3,5), nvar=10000, nDE=27, fraction.upregulated = 0.67, disp.Types = 'same', modes='D') #Generate KIRC synthetic data with high proportion of DE genes
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', rep.end=50, nsample=c(3,5), nDE=27, fraction.upregulated=0.67, disp.Types='same', modes='D', AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='KIRC', rep.end=50, nsample=c(3,5), nvar=10000, nDE=27, fraction.upregulated = 0.67, disp.Type = 'same', mode='D', AnalysisMethods=AnalysisMethods, rowType = c('AUC')) #Draw syntehtic data performance plot for AUC
#C
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', fixedfold = T, rep.end=50, nsample=c(3,5), nvar=10000, nDE=27, disp.Types = 'same', modes='DL') #Generate KIRC synthetic data with fixed foldchange and lowered dispersion to compare with SEQC dataset
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', fixedfold = T, rep.end=50, nsample=c(3,5), nDE=27, disp.Types='same', modes='DL', AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=T,simul.data='KIRC', rep.end=50, nsample=c(3,5), nvar=10000, nDE=27, fraction.upregulated = 0.67, disp.Type = 'same', mode='DL', AnalysisMethods=AnalysisMethods, rowType = c('AUC')) #Draw synthetic data performance plot for AUC
#Fig2
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/Fig2/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/Fig2/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/Fig2/Figure/' #Set result figure save directory
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = 0.5, disp.Types = 'same', modes=c('D','R','OS')) #Generate KIRC synthetic dataset
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', rep.end=50, nsample=c(3,10), nDE=c(500,1000,3000,6000), fraction.upregulated=0.5, disp.Types='same', modes=c('D','R','OS'), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
for(mode in c('D','R','OS')){
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = 0.5, disp.Type = 'same', mode=mode, AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot
}
#Fig3
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/Fig3/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/Fig3/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/Fig3/Figure/' #Set result figure save directory
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=0, fraction.upregulated = 0.5, disp.Types = 'same', modes=c('D','R','OS')) #Generate KIRC synthetic dataset without DE genes to calculate false positive counts
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', rep.end=50, nsample=c(3,10), fpc=T, nDE=c(0), disp.Types='same', modes=c('D','R','OS'), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
fpc_performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,simul.data='KIRC', rep.end=50, nsample=c(3,10), disp.Type = 'same', modes=c('D','R','OS'), AnalysisMethods=AnalysisMethods) #Draw synthetic data false positive counts performance plot
#Fig4
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/Fig4/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/Fig4/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/Fig4/Figure/' #Set result figure save directory
#A-B
GenerateRealSimulation(working.dir=dataset.dir, data.types='KIRC', rep.end=50, nsample=c(3,5,10,20)) #Generate KIRC real dataset
GenerateRealSimulation(working.dir=dataset.dir, data.types='KIRC', fpc=TRUE, rep.end=50, nsample=c(3,5,10,20)) #Generate KIRC real dataset with counts from single sample condition to calculate false positive counts
GenerateRealSimulation(working.dir=dataset.dir, data.types='Bottomly', rep.end=50, nsample=c(3,5,10)) #Generate Bottomly real dataset without DE genes
GenerateRealSimulation(working.dir=dataset.dir, data.types='Bottomly', fpc=TRUE, rep.end=50, nsample=c(3,5)) #Generate Bottomly real dataset with counts from single sample condition to calculate false positive counts
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=TRUE, data.types='KIRC', rep.end=50, nsample=c(3,5,10,20), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=TRUE, fpc=TRUE, data.types='KIRC', rep.end=50, nsample=c(3,5,10,20), AnalysisMethods = AnalysisMethods, para=list())
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=TRUE, data.types='Bottomly', rep.end=50, nsample=c(3,5,10), AnalysisMethods = AnalysisMethods, para=list())
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=TRUE, fpc=TRUE, data.types='Bottomly', rep.end=50, nsample=c(3,5), AnalysisMethods = AnalysisMethods, para=list())
performance_realdata_plot(working.dir=analysis.dir,figure.dir=figure.dir,simul.data='KIRC', rep.end=50, nsample=c(3,5,10,20), AnalysisMethods=AnalysisMethods, rowType = c("DetectedDE","FP.count")) #Draw KIRC real data performance plot
performance_realdata_plot(working.dir=analysis.dir,figure.dir=figure.dir,simul.data='Bottomly', rep.end=50, nsample=c(3,5,10), AnalysisMethods=AnalysisMethods, rowType = c("DetectedDE","FP.count")) #Draw Bottomly real data performance plot
#C-D
correlation_heatmap(working.dir=analysis.dir, figure.dir=figure.dir,simul.data='KIRC', nsample=5, topgenes=5000, AnalysisMethods=AnalysisMethods, rep.end=50) #Draw correlation heatmap for DE methods run with KIRC real data analysis
correlation_heatmap(working.dir=analysis.dir, figure.dir=figure.dir,simul.data='Bottomly', nsample=5, topgenes=500, AnalysisMethods=AnalysisMethods, rep.end=50) #Draw correlation heatmap for DE methods run with Bottomly real data analysis
#FigS1
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','BaySeq.qn','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/FigS1/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/FigS1/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS1/Figure/' #Set result figure save directory
#A
GenerateRealSimulation(working.dir=dataset.dir, data.types='SEQC', rep=1, nsample=5) #Generate SEQC real dataset
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=TRUE, data.types='SEQC', rep.end=1, nsample=c(5), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
performance_realdata_plot(working.dir=analysis.dir,figure.dir=figure.dir,simul.data='SEQC', rep.end=1, nsample=c(5), AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw real data performance plot for AUC
#B
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', rep.end=50, nsample=c(3,5), nvar=10000, nDE=27, fraction.upregulated = 0.67, disp.Types = 'same', modes='D') #Generate KIRC synthetic data with high proportion of DE genes
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', rep.end=50, nsample=c(3,5), nDE=27, fraction.upregulated=0.67, disp.Types='same', modes='D', AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='KIRC', rep.end=50, nsample=c(3,5), nvar=10000, nDE=27, fraction.upregulated = 0.67, disp.Type = 'same', mode='D', AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw syntehtic data performance plot for AUC
#C
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', fixedfold = T, rep.end=50, nsample=c(3,5), nvar=10000, nDE=27, disp.Types = 'same', modes='DL') #Generate KIRC synthetic data with fixed foldchange and lowered dispersion to compare with SEQC dataset
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', fixedfold = T, rep.end=50, nsample=c(3,5), nDE=27, disp.Types='same', modes='DL', AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=T,simul.data='KIRC', rep.end=50, nsample=c(3,5), nvar=10000, nDE=27, fraction.upregulated = 0.67, disp.Type = 'same', mode='DL', AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot for AUC
#D
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', rep.end=50, nsample=c(3,5), nvar=10000, nDE=100, fraction.upregulated = 0.67, disp.Types = 'same', modes='D') #Generate KIRC synthetic data with high proportion of DE genes
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', rep.end=50, nsample=c(3,5), nDE=100, fraction.upregulated=0.67, disp.Types='same', modes='D', AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='KIRC', rep.end=50, nsample=c(3,5), nvar=10000, nDE=100, fraction.upregulated = 0.67, disp.Type = 'same', mode='D', AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw syntehtic data performance plot for AUC
#FigS2
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/FigS2/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/FigS2/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS2/Figure/' #Set result figure save directory
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = 0.5, disp.Types = 'different', modes=c('D','R')) #Generate KIRC synthetic dataset, different dispersions to each sample condition are assumed to generate dataset.
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', rep.end=50, nsample=c(3,10), nDE=c(500,1000,3000,6000), fraction.upregulated=0.5, disp.Types='different', modes=c('D','R'), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
for(mode in c('D','R')){
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = 0.5, disp.Type = 'different', mode=mode, AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot
}
#FigS3
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/FigS3/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/FigS3/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS3/Figure/' #Set result figure save directory
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = c(0.7, 0.9), disp.Types = 'same', modes=c('D')) #Generate KIRC synthetic dataset with high proportion of upregulated DE genes.
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', rep.end=50, nsample=c(3,10), nDE=c(500,1000,3000,6000), fraction.upregulated=c(0.7, 0.9), disp.Types='same', modes=c('D'), AnalysisMethods = AnalysisMethods, para=list(ROTS=list(transformation=FALSE, normalize=FALSE))) #Run DE analysis for preset methods. ROTS parameter is set to unnormalized, without voom transformation.
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = c(0.7, 0.9), disp.Type = 'same', mode='D', AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot
#FigS4
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2') #Set DE methods to analyze with
dataset.dir='~/test/example/FigS4/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/FigS4/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS4/Figure/' #Set result figure save directory
#A-B
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = 0.5, disp.Types = 'same', modes=c('R'), RO.prop = 1) #Generate KIRC synthetic dataset
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', rep.end=50, nsample=c(3,10), nDE=c(500,1000,3000,6000), fraction.upregulated=0.5, disp.Types='same', modes=c('R'), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = 0.5, disp.Type = 'same', mode='R', AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot
#C-D
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = 0.5, disp.Types = 'same', modes=c('R'), RO.prop = 3) #Generate KIRC synthetic dataset
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', rep.end=50, nsample=c(3,10), nDE=c(500,1000,3000,6000), fraction.upregulated=0.5, disp.Types='same', modes=c('R'), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = 0.5, disp.Type = 'same', mode='R', AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot
#FigS5
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/FigS5/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/FigS5/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS5/Figure/' #Set result figure save directory
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='KIRC', Large_sample = TRUE, rep.end=50, nsample=c(10,30), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = c(0.5), disp.Types = 'same', modes=c('D')) #Generate KIRC synthetic dataset with high proportion of upregulated DE genes.
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='KIRC', rep.end=50, nsample=c(10,30), nDE=c(500,1000,3000,6000), fraction.upregulated=c(0.5), disp.Types='same', modes=c('D'), AnalysisMethods = AnalysisMethods, para=list(ROTS=list(transformation=FALSE, normalize=FALSE))) #Run DE analysis for preset methods. ROTS parameter is set to unnormalized, without voom transformation.
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='KIRC', rep.end=50, nsample=c(10,30), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = c(0.5), disp.Type = 'same', mode='D', AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot
#FigS6
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/FigS6/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/FigS6/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS6/Figure/' #Set result figure save directory
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='Bottomly', rep.end=50, nsample=c(3,10), nvar=5000, nDE=c(250,500,1500,3000), fraction.upregulated = 0.5, disp.Types = 'same', modes=c('D','R','OS')) #Generate Bottomly synthetic dataset
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='Bottomly', rep.end=50, nsample=c(3,10), nDE=c(250,500,1500,3000), fraction.upregulated=0.5, disp.Types='same', modes=c('D','R','OS'), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
for(mode in c('D','R','OS')){
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='KIRC', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = 0.5, disp.Type = 'same', mode=mode, AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot
}
#FigS7
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/FigS7/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/FigS7/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS7/Figure/' #Set result figure save directory
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='Bottomly', rep.end=50, nsample=c(3,10), nvar=5000, nDE=c(250,500,1500,3000), fraction.upregulated = 0.5, disp.Types = 'different', modes=c('D','R')) #Generate Bottomly synthetic dataset, different dispersions to each sample condition are assumed to generate dataset.
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='Bottomly', rep.end=50, nsample=c(3,10), nDE=c(250,500,1500,3000), fraction.upregulated=0.5, disp.Types='different', modes=c('D','R'), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
for(mode in c('D','R')){
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='Bottomly', rep.end=50, nsample=c(3,10), nvar=5000, nDE=c(250,500,1500,3000), fraction.upregulated = 0.5, disp.Type = 'different', mode=mode, AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot
}
#FigS8
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/FigS8/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/FigS8/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS8/Figure/' #Set result figure save directory
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='Bottomly', rep.end=50, nsample=c(3,10), nvar=5000, nDE=c(250,500,1500,3000), fraction.upregulated = c(0.7, 0.9), disp.Types = 'same', modes=c('D')) #Generate Bottomly synthetic dataset with high proportion of upregulated DE genes.
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='Bottomly', rep.end=50, nsample=c(3,10), nDE=c(250,500,1500,3000), fraction.upregulated=c(0.7, 0.9), disp.Types='same', modes=c('D'), AnalysisMethods = AnalysisMethods, para=list(ROTS=list(transformation=FALSE, normalize=FALSE))) #Run DE analysis for preset methods. ROTS parameter is set to unnormalized, without voom transformation.
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='Bottomly', rep.end=50, nsample=c(3,10), nvar=5000, nDE=c(250,500,1500,3000), fraction.upregulated = c(0.7, 0.9), disp.Type = 'same', mode='D', AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot
#FigS9
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/FigS9/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/FigS9/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS9/Figure/' #Set result figure save directory
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='Bottomly', rep.end=50, nsample=c(3,10), nvar=5000, nDE=0, fraction.upregulated = 0.5, disp.Types = 'same', modes=c('D','R','OS')) #Generate Bottomly synthetic dataset without DE genes to calculate false positive counts
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='Bottomly', rep.end=50, nsample=c(3,10), fpc=T, nDE=0, disp.Types='same', modes=c('D','R','OS'), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
fpc_performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,simul.data='Bottomly', rep.end=50, nsample=c(3,10), disp.Type = 'same', modes=c('D','R','OS'), AnalysisMethods=AnalysisMethods) #Draw synthetic data false positive counts performance plot
#FigS10
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/FigS10/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/FigS10/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS10/Figure/' #Set result figure save directory
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='mBdK', rep.end=50, nsample=c(3,10), nvar=5000, nDE=c(250,500,1500,3000), fraction.upregulated = 0.5, disp.Types = 'same', modes=c('D','R')) #Generate hybrid dataset with mean counts from Bottomly dataset and dispersion from KIRC dataset
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='mBdK', rep.end=50, nsample=c(3,10), nDE=c(250,500,1500,3000), fraction.upregulated=0.5, disp.Types='same', modes=c('D','R'), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
for(mode in c('D','R')){
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='mBdK', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = 0.5, disp.Type = 'same', mode=mode, AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot
}
#FigS11
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
dataset.dir='~/test/example/FigS11/Dataset/' #Set dataset save directory
analysis.dir='~/test/example/FigS11/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS11/Figure/' #Set result figure save directory
GenerateSyntheticSimulation(working.dir=dataset.dir, data.types='mKdB', rep.end=50, nsample=c(3,10), nvar=5000, nDE=c(250,500,1500,3000), fraction.upregulated = 0.5, disp.Types = 'same', modes=c('D','R')) #Generate hybrid dataset with mean counts from KIRC dataset and dispersion from Bottomly dataset
runSimulationAnalysis(working.dir=dataset.dir, output.dir=analysis.dir, real=FALSE, data.types='mKdB', rep.end=50, nsample=c(3,10), nDE=c(250,500,1500,3000), fraction.upregulated=0.5, disp.Types='same', modes=c('D','R'), AnalysisMethods = AnalysisMethods, para=list()) #Run DE analysis for preset methods
for(mode in c('D','R')){
performance_plot(working.dir=analysis.dir,figure.dir=figure.dir,fixedfold=F,simul.data='mKdB', rep.end=50, nsample=c(3,10), nvar=10000, nDE=c(500,1000,3000,6000), fraction.upregulated = 0.5, disp.Type = 'same', mode=mode, AnalysisMethods=AnalysisMethods, rowType = c('AUC','TPR','trueFDR')) #Draw synthetic data performance plot
}
#FigS12
run_PCA(datatypes = 'KIRC') #run PCA for KIRC reference dataset
run_PCA(datatypes = 'Bottomly') #run PCA for Bottomly reference dataset
#FigS13
AnalysisMethods=c('edgeR','edgeR.ql','edgeR.rb','DESeq.pc','DESeq2','voom.tmm','voom.qn','voom.sw','ROTS','BaySeq','PoissonSeq','SAMseq') #Set DE methods to analyze with
analysis.dir='~/test/example/Fig4/Analysis/' #Set DE analysis results save directory
figure.dir='~/test/example/FigS13/Figure/' #Set result figure save directory
correlation_heatmap(working.dir=analysis.dir, figure.dir=figure.dir,simul.data='KIRC', nsample=5, topgenes=3000, AnalysisMethods=AnalysisMethods, rep.end=50) #Draw correlation heatmap for DE methods run with KIRC real data analysis
correlation_heatmap(working.dir=analysis.dir, figure.dir=figure.dir,simul.data='Bottomly', nsample=5, topgenes=300, AnalysisMethods=AnalysisMethods, rep.enSd=50) #Draw correlation heatmap for DE methods run with Bottomly real data analysis