-
Notifications
You must be signed in to change notification settings - Fork 8
/
plot.r
33 lines (26 loc) · 862 Bytes
/
plot.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
# get pathway scores and mutations, and correlate them with each other
library(dplyr)
b = import('base')
io = import('io')
plt = import('plot')
INFILE = commandArgs(TRUE)[1] %or% "assocs_driver_mapped/speed_matrix.RData"
OUTFILE = commandArgs(TRUE)[2] %or% "plot_driver_mapped/speed_matrix.pdf"
assocs = io$load(INFILE)
subsets = c("pan_cov", "pan", setdiff(sort(unique(assocs$subset)), c("pan_cov", "pan")))
pdf(OUTFILE, paper="a4r", width=26, height=20)
for (subs in subsets) {
if (grepl("pan", subs)) {
pt_size = 0.3
label_top = 40
} else {
pt_size = 0.5
label_top = 20
}
p1 = assocs %>%
filter(subset == subs) %>%
plt$color$p_effect(pvalue="adj.p", thresh=0.1) %>%
plt$volcano(base.size=pt_size, p=0.1, label_top=label_top) +
ggtitle(subs)
print (p1)
}
dev.off()