-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneurons_sharing_atac_KS1_KS2.R
376 lines (308 loc) · 22.5 KB
/
neurons_sharing_atac_KS1_KS2.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
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
#####observed pi0 quantifying sharing
#KS1
KS1_B_vs_neurons <- getOverlapPi0(res_granges, atac_B_KS1_granges[which(atac_B_KS1_granges$qvalue <=
0.1)])
KS1_B_vs_T <- getOverlapPi0(atac_T_KS1_granges, atac_B_KS1_granges[which(atac_B_KS1_granges$qvalue <=
0.1)])
KS1_B_vs_neurons_proms <- getOverlapPi0(res_proms, atac_B_KS1_granges_proms[which(atac_B_KS1_granges_proms$qvalue <=
0.1)])
KS1_B_vs_T_proms <- getOverlapPi0(atac_T_KS1_granges_proms, atac_B_KS1_granges_proms[which(atac_B_KS1_granges_proms$qvalue <=
0.1)])
#KS2
KS2_B_vs_neurons <- getOverlapPi02(res2_granges, atac_B_KS2_granges[which(atac_B_KS2_granges$qvalue <=
0.1)], lambda_value = 0.5)
KS2_B_vs_T <- getOverlapPi02(atac_T_KS2_granges, atac_B_KS2_granges[which(atac_B_KS2_granges$qvalue <=
0.1)], lambda_value = 0.5)
KS2_B_vs_neurons_proms <- getOverlapPi02(res2_proms,
atac_B_KS2_granges_proms[which(atac_B_KS2_granges_proms$qvalue <=
0.1)], lambda_value = 0.5)
KS2_B_vs_T_proms <- getOverlapPi02(atac_T_KS2_granges_proms,
atac_B_KS2_granges_proms[which(atac_B_KS2_granges_proms$qvalue <=
0.1)], lambda_value = 0.5)
#####null distributions based on sampling location sets of same size
#KS1
permutation_dist_KS1_B_vs_neurons <- getOverlapNullDistribution2(res_granges, atac_B_KS1_granges,
atac_B_KS1_granges$qvalue,
0.1)
permutation_dist_KS1_B_vs_T <- getOverlapNullDistribution2(atac_T_KS1_granges, atac_B_KS1_granges,
atac_B_KS1_granges$qvalue,
0.1)
permutation_dist_KS1_B_vs_neurons_proms <- getOverlapNullDistribution2(res_proms, atac_B_KS1_granges_proms,
atac_B_KS1_granges_proms$qvalue,
0.1)
permutation_dist_KS1_B_vs_T_proms <- getOverlapNullDistribution2(atac_T_KS1_granges_proms, atac_B_KS1_granges_proms,
atac_B_KS1_granges_proms$qvalue,
0.1)
#KS2
permutation_dist_KS2_B_vs_neurons <- getOverlapNullDistribution3(res2_granges, atac_B_KS2_granges,
atac_B_KS2_granges$qvalue,
0.1,
lambda_value = 0.5)
permutation_dist_KS2_B_vs_T <- getOverlapNullDistribution3(atac_T_KS2_granges, atac_B_KS2_granges,
atac_B_KS2_granges$qvalue,
0.1,
lambda_value = 0.5)
permutation_dist_KS2_B_vs_neurons_proms <- getOverlapNullDistribution3(res2_proms, atac_B_KS2_granges_proms,
atac_B_KS2_granges_proms$qvalue,
0.1,
lambda_value = 0.5)
permutation_dist_KS2_B_vs_T_proms <- getOverlapNullDistribution3(atac_T_KS2_granges_proms, atac_B_KS2_granges_proms,
atac_B_KS2_granges_proms$qvalue,
0.1,
lambda_value = 0.5)
save(permutation_dist_KS1_B_vs_neurons_proms, permutation_dist_KS1_B_vs_T_proms,
permutation_dist_KS2_B_vs_neurons_proms, permutation_dist_KS2_B_vs_T_proms,
permutation_dist_KS1_B_vs_neurons, permutation_dist_KS1_B_vs_T,
permutation_dist_KS2_B_vs_neurons, permutation_dist_KS2_B_vs_T, file = "neuron_permutation_distributions_pi0_july2023.rda")
###figures
#KS1
quartz(file = "KS1_genome_wide.pdf", height = 2.2, width = 4.4, pointsize = 8, type = "pdf")
par(mfrow = c(1,2))
plot(density(res_granges$pvalue[unique(queryHits(findOverlaps(res_granges,
atac_B_KS1_granges[which(atac_B_KS1_granges$qvalue <=
0.1)])))], from = 0, to = 1,
bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS1 (genome-wide)", bty = 'l', xlab = "p-value (neurons)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 3.5))
lines(density(res_granges$pvalue[unique(queryHits(findOverlaps(res_granges,
atac_B_KS1_granges[-which(atac_B_KS1_granges$qvalue <=
0.1)])))], from = 0,
to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 3.5))
plot(density(atac_T_KS1_granges$pvalue[unique(queryHits(findOverlaps(atac_T_KS1_granges,
atac_B_KS1_granges[which(atac_B_KS1_granges$qvalue <=
0.1)])))], from = 0, to = 1,
bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS1 (genome-wide)", bty = 'l', xlab = "p-value (T cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 3.25))
lines(density(atac_T_KS1_granges$pvalue[unique(queryHits(findOverlaps(atac_T_KS1_granges,
atac_B_KS1_granges[-which(atac_B_KS1_granges$qvalue <=
0.1)])))], from = 0,
to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 3))
legend <- legend("topright", legend = c("B cells top significant hits",
"B cells other"), col = c(alpha("red", 0.57),
"cornflowerblue"), lwd = 2.5, bty = 'n', cex = 0.75)
dev.off()
quartz(file = "KS1_proms.pdf", height = 2.2, width = 4.4, pointsize = 8, type = "pdf")
par(mfrow = c(1,2))
plot(density(res_proms$pvalue[unique(queryHits(findOverlaps(res_proms,
atac_B_KS1_granges_proms[which(atac_B_KS1_granges_proms$qvalue <=
0.1)])))], from = 0, to = 1,
bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS1 (promoters)", bty = 'l', xlab = "p-value (neurons)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 6.5))
lines(density(res_proms$pvalue[unique(queryHits(findOverlaps(res_proms,
atac_B_KS1_granges_proms[-which(atac_B_KS1_granges_proms$qvalue <=
0.1)])))], from = 0,
to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 6))
plot(density(atac_T_KS1_granges_proms$pvalue[unique(queryHits(findOverlaps(atac_T_KS1_granges_proms,
atac_B_KS1_granges_proms[which(atac_B_KS1_granges_proms$qvalue <=
0.1)])))], from = 0, to = 1,
bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS1 (promoters)", bty = 'l', xlab = "p-value (T cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 4.25))
lines(density(atac_T_KS1_granges_proms$pvalue[unique(queryHits(findOverlaps(atac_T_KS1_granges_proms,
atac_B_KS1_granges_proms[-which(atac_B_KS1_granges_proms$qvalue <=
0.1)])))], from = 0,
to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 4))
dev.off()
#KS2
quartz(file = "KS2_genome_wide.pdf", height = 2.2, width = 4.4, pointsize = 8, type = "pdf")
par(mfrow = c(1,2))
plot(density(res2_granges$pvalue[unique(queryHits(findOverlaps(res2_granges,
atac_B_KS2_granges[which(atac_B_KS2_granges$qvalue < 0.1)])))], from = 0, to = 1,
bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS2 (genome-wide)", bty = 'l', xlab = "p-value (neurons)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 4.5))
lines(density(res2_granges$pvalue[unique(queryHits(findOverlaps(res2_granges,
atac_B_KS2_granges[-which(atac_B_KS2_granges$qvalue < 0.1)])))], from = 0,
to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 4))
plot(density(atac_T_KS2_granges$pvalue[unique(queryHits(findOverlaps(atac_T_KS2_granges,
atac_B_KS2_granges[which(atac_B_KS2_granges$qvalue < 0.1)])))], from = 0, to = 1,
bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS2 (genome-wide)", bty = 'l', xlab = "p-value (T cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 4.4))
lines(density(atac_T_KS2_granges$pvalue[unique(queryHits(findOverlaps(atac_T_KS2_granges,
atac_B_KS2_granges[-which(atac_B_KS2_granges$qvalue < 0.5)])))], from = 0,
to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 4))
dev.off()
quartz(file = "KS2_proms.pdf", height = 2.2, width = 4.4, pointsize = 8, type = "pdf")
par(mfrow = c(1,2))
plot(density(res2_proms$pvalue[unique(queryHits(findOverlaps(res2_proms,
atac_B_KS2_granges_proms[which(atac_B_KS2_granges_proms$qvalue < 0.1)])))], from = 0, to = 1,
bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS2 (promoters)", bty = 'l', xlab = "p-value (neurons)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 6.5))
lines(density(res2_proms$pvalue[unique(queryHits(findOverlaps(res2_proms,
atac_B_KS2_granges_proms[-which(atac_B_KS2_granges_proms$qvalue < 0.1)])))], from = 0,
to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 6.5))
plot(density(atac_T_KS2_granges_proms$pvalue[unique(queryHits(findOverlaps(atac_T_KS2_granges_proms,
atac_B_KS2_granges_proms[which(atac_B_KS2_granges_proms$qvalue < 0.1)])))], from = 0, to = 1,
bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS2 (promoters)", bty = 'l', xlab = "p-value (T cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 5.5))
lines(density(atac_T_KS2_granges_proms$pvalue[unique(queryHits(findOverlaps(atac_T_KS2_granges_proms,
atac_B_KS2_granges_proms[-which(atac_B_KS2_granges_proms$qvalue < 0.1)])))], from = 0,
to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 5.5))
dev.off()
quartz(file = "neuron_B_T_overlaps.pdf", height = 2.6, width = 3.2, pointsize = 8, type = "pdf")
par(mar = c(4, 5, 1, 1) + 0.1)
plot(1, KS1_B_vs_neurons_proms/mean(permutation_dist_KS1_B_vs_neurons_proms), cex = 1.25, col = "orange", pch = 19,
bty = 'l', main = "", xlab = "", ylab = "accessibility disruption\noverlap w/ B cells", xlim = c(0.8, 8.2),
ylim = c(0.7, 12.5), xaxt = 'n', yaxt = 'n', cex.axis = 0.8)
points(2, KS1_B_vs_T_proms/mean(permutation_dist_KS1_B_vs_T_proms), cex = 1.25, col = alpha("black", 0.62), pch = 19)
points(3, KS2_B_vs_neurons_proms/mean(permutation_dist_KS2_B_vs_neurons_proms), cex = 1.25, col = "orange", pch = 19)
points(4, KS2_B_vs_T_proms/mean(permutation_dist_KS2_B_vs_T_proms), cex = 1.25, col = alpha("black", 0.62), pch = 19)
points(5, KS1_B_vs_neurons/mean(permutation_dist_KS1_B_vs_neurons), cex = 1.25, col = "orange", pch = 19)
points(6, KS1_B_vs_T/mean(permutation_dist_KS1_B_vs_T), cex = 1.25, col = alpha("black", 0.62), pch = 19)
points(7, KS2_B_vs_neurons/mean(permutation_dist_KS2_B_vs_neurons), cex = 1.25, col = "orange", pch = 19)
points(8, KS2_B_vs_T/mean(permutation_dist_KS2_B_vs_T), cex = 1.25, col = alpha("black", 0.62), pch = 19)
abline(v = 4.5, lty = "longdash", col = rgb(0,0,0,0.7))
abline(h = 1, lty = "longdash", col = rgb(0,0,0,0.7))
legend <- legend("topright", legend = c("neurons", "T cells"), col = c("orange", alpha("black", 0.62)), pch = 19,
cex = 0.93)
axis(2, at = c(1, 6, 11))
axis(1, at = seq(1.5, 7.5, by = 2), labels = c("KS1", "KS2", "KS1", "KS2"))
axis(1, at = c(2.5, 6.5), labels = c("promoters", "genome-wide"), col = NA, line = 1.5)
dev.off()
#############supplemental figure, conditioning on neurons to show that the result is symmetric
###figures
#KS1
quartz(file = "KS1_genome_wide_alt.pdf", height = 2.2, width = 4.4, pointsize = 8, type = "pdf")
par(mfrow = c(1,2))
plot(density(atac_B_KS1_granges$pvalue[unique(queryHits(
findOverlaps(atac_B_KS1_granges, res_granges[which(res_granges$qvalue < 0.1)])))],
from = 0, to = 1, bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS1 (genome-wide)", bty = 'l', xlab = "p-value (B cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 2))
lines(density(atac_B_KS1_granges$pvalue[unique(queryHits(
findOverlaps(atac_B_KS1_granges, res_granges[-which(res_granges$qvalue < 0.1)])))],
from = 0, to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 2))
legend <- legend("topright", legend = c("neurons top significant hits",
"neurons other"), col = c(alpha("red", 0.57),
"cornflowerblue"), lwd = 2.5, bty = 'n', cex = 0.75)
plot(density(atac_B_KS1_granges$pvalue[unique(queryHits(findOverlaps(atac_B_KS1_granges,
atac_T_KS1_granges[which(atac_T_KS1_granges$qvalue < 0.1)])))], from = 0, to = 1,
bw = 0.035),
col = "forest green", lwd = 2.5, main = "KS1 (genome-wide)", bty = 'l', xlab = "p-value (B cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 5))
lines(density(atac_B_KS1_granges$pvalue[unique(queryHits(findOverlaps(atac_B_KS1_granges,
atac_T_KS1_granges[-which(atac_T_KS1_granges$qvalue < 0.1)])))], from = 0,
to = 1, bw = 0.035), col = alpha("black", 0.5), lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 5))
legend <- legend("topright", legend = c("T cells top significant hits",
"T cells other"), col = c("forest green",
alpha("black", 0.5)), lwd = 2.5, bty = 'n', cex = 0.75)
dev.off()
quartz(file = "KS1_proms_alt.pdf", height = 2.2, width = 4.4, pointsize = 8, type = "pdf")
par(mfrow = c(1,2))
plot(density(atac_B_KS1_granges_proms$pvalue[
unique(queryHits(findOverlaps(atac_B_KS1_granges_proms,
res_proms[which(res_proms$qvalue <= 0.1)])))],
from = 0, to = 1, bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS1 (promoters)", bty = 'l', xlab = "p-value (B cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 2))
lines(density(atac_B_KS1_granges_proms$pvalue[
unique(queryHits(findOverlaps(atac_B_KS1_granges_proms,
res_proms[-which(res_proms$qvalue <= 0.1)])))],
from = 0, to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 2))
plot(density(atac_B_KS1_granges_proms$pvalue[unique(queryHits(findOverlaps(atac_B_KS1_granges_proms,
atac_T_KS1_granges_proms[which(atac_T_KS1_granges_proms$qvalue < 0.1)])))], from = 0, to = 1,
bw = 0.035),
col = "forest green", lwd = 2.5, main = "KS1 (promoters)", bty = 'l', xlab = "p-value (B cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 7))
lines(density(atac_B_KS1_granges_proms$pvalue[unique(queryHits(findOverlaps(atac_B_KS1_granges_proms,
atac_T_KS1_granges_proms[-which(atac_T_KS1_granges_proms$qvalue < 0.1)])))], from = 0,
to = 1, bw = 0.035), col = alpha("black", 0.5), lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 7))
dev.off()
#KS2
quartz(file = "KS2_genome_wide_alt.pdf", height = 2.2, width = 4.4, pointsize = 8, type = "pdf")
par(mfrow = c(1,2))
plot(density(atac_B_KS2_granges$pvalue[unique(queryHits(findOverlaps(atac_B_KS2_granges,
res2_granges[which(res2_granges$qvalue <= 0.1)])))], from = 0, to = 1,
bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS2 (genome-wide)", bty = 'l', xlab = "p-value (B cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 1.5))
lines(density(atac_B_KS2_granges$pvalue[unique(queryHits(findOverlaps(atac_B_KS2_granges,
res2_granges[-which(res2_granges$qvalue <= 0.1)])))], from = 0,
to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 1.5))
plot(density(atac_B_KS2_granges$pvalue[unique(queryHits(findOverlaps(atac_B_KS2_granges,
atac_T_KS2_granges[which(atac_T_KS2_granges$qvalue <= 0.1)])))], from = 0, to = 1,
bw = 0.035),
col = "forest green", lwd = 2.5, main = "KS2 (genome-wide)", bty = 'l', xlab = "p-value (B cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 4))
lines(density(atac_B_KS2_granges$pvalue[unique(queryHits(findOverlaps(atac_B_KS2_granges,
atac_T_KS2_granges[-which(atac_T_KS2_granges$qvalue <= 0.1)])))], from = 0,
to = 1, bw = 0.035), col = alpha("black", 0.5), lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 4))
dev.off()
quartz(file = "KS2_proms_alt.pdf", height = 2.2, width = 4.4, pointsize = 8, type = "pdf")
par(mfrow = c(1,2))
plot(density(atac_B_KS2_granges_proms$pvalue[unique(queryHits(findOverlaps(atac_B_KS2_granges_proms,
res2_proms[which(res2_proms$qvalue <= 0.1)])))], from = 0, to = 1,
bw = 0.035),
col = alpha("red", 0.57), lwd = 2.5, main = "KS2 (promoters)", bty = 'l', xlab = "p-value (B cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 1.5))
lines(density(atac_B_KS2_granges_proms$pvalue[unique(queryHits(findOverlaps(atac_B_KS2_granges_proms,
res2_proms[-which(res2_proms$qvalue <= 0.1)])))], from = 0,
to = 1, bw = 0.035), col = "cornflowerblue", lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 1.5))
plot(density(atac_B_KS2_granges_proms$pvalue[unique(queryHits(findOverlaps(atac_B_KS2_granges_proms,
atac_T_KS2_granges_proms[which(atac_T_KS2_granges_proms$qvalue <= 0.1)])))], from = 0, to = 1,
bw = 0.035),
col = "forest green", lwd = 2.5, main = "KS2 (promoters)", bty = 'l', xlab = "p-value (B cells)",
font.main = 1, yaxt = 'n', xaxt = 'n', ylim = c(0, 7))
lines(density(atac_B_KS2_granges_proms$pvalue[unique(queryHits(findOverlaps(atac_B_KS2_granges_proms,
atac_T_KS2_granges_proms[-which(atac_T_KS2_granges_proms$qvalue <= 0.1)])))], from = 0,
to = 1, bw = 0.035), col = alpha("black", 0.5), lwd = 2.5)
axis(1, at = c(0, 0.5, 1))
axis(2, at = c(0, 7))
dev.off()
####neurons vs T
KS1_T_vs_neurons <- getOverlapPi0(atac_T_KS1_granges, res_granges[which(res_granges$qvalue <=
0.1)])
KS1_T_vs_neurons_proms <- getOverlapPi0(atac_T_KS1_granges_proms, res_proms[which(res_proms$qvalue <=
0.1)])
KS2_T_vs_neurons <- getOverlapPi0(atac_T_KS2_granges, res2_granges[which(res2_granges$qvalue <=
0.1)])
KS2_T_vs_neurons_proms <- getOverlapPi0(atac_T_KS2_granges_proms,
res2_proms[which(res2_proms$qvalue <= 0.1)])
#
permutation_dist_KS1_T_vs_neurons <- getOverlapNullDistribution2(atac_T_KS1_granges, res_granges,
res_granges$qvalue,
0.1)
permutation_dist_KS1_T_vs_neurons_proms <- getOverlapNullDistribution2(atac_T_KS1_granges_proms, res_proms,
res_proms$qvalue,
0.1)
permutation_dist_KS2_T_vs_neurons <- getOverlapNullDistribution2(atac_T_KS2_granges, res2_granges,
res2_granges$qvalue,
0.1)
permutation_dist_KS2_T_vs_neurons_proms <- getOverlapNullDistribution2(atac_T_KS2_granges_proms, res2_proms,
res2_proms$qvalue,
0.1)