-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsurvival_pancan.Rnw
61 lines (57 loc) · 1.99 KB
/
survival_pancan.Rnw
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
<<setup5, include=FALSE>>=
library(dplyr)
b = import('base')
df = import('data_frame')
plt = import('plot')
util = import('../analyses/tcga_survival/util')
config = import('../config')
assocs = b$lnapply(config$methods$analysis_set, util$load_assocs)
@
\begin{figure}[H]
<<surv_volcano_pancan, echo=FALSE, fig.width=8, fig.height=12>>=
p = assocs %>%
b$lnapply(function(x) x$pan_cov) %>%
df$bind_rows(name_col="method") %>%
mutate(label = scores,
method = config$id2short(method),
adj.p = adj.p + .Machine$double.eps) %>%
plt$color$p_effect(pvalue="adj.p", effect="estimate", thresh=0.05, dir=-1) %>%
plt$volcano(base.size=5e-3, text.size=2, p=0.05, label_top=Inf, repel=TRUE) +
facet_wrap(~method, ncol=2, scales="free_x") +
config$facet_theme
plt$symmetrise_scale(p)
@
\caption{}
\label{fig::urv-volcano-pancan}
\end{figure}
\begin{figure}[H]
<<surv_mat_pancan, echo=FALSE, fig.width=5.5, fig.height=3.5, warning=FALSE>>=
assocs %>%
b$lnapply(function(x) x$pan_cov) %>%
df$bind_rows(name_col="method") %>%
mutate(pathway = scores,
method = config$id2short(method, rev=TRUE),
adj.p = adj.p + .Machine$double.eps,
label = ifelse(adj.p < 1e-2, ".", ""),
label = ifelse(adj.p < 1e-8, "*", label),
statistic = ifelse(adj.p < 0.2, statistic, NA)) %>%
plt$matrix(statistic ~ method + pathway, symmetric=TRUE, reverse_colors=TRUE) +
coord_fixed() +
xlab("") +
ylab("")
@
\caption{}
\label{fig::surv-mat-pancan}
\end{figure}
\begin{figure}[H]
<<surv_volcano_tissue, echo=FALSE, fig.width=8, fig.height=6, message=FALSE>>=
assocs$speed_matrix$tissue %>%
mutate(label = paste(subset, scores, sep=": "),
adj.p = adj.p + .Machine$double.eps) %>%
plt$color$p_effect(pvalue="adj.p", effect="estimate", thresh=0.05, dir=-1) %>%
plt$volcano(base.size=0.2, text.size=2, p=0.05, label_top=70) +
xlim(c(-3,3))
@
\caption{}
\label{fig::surv-volcano-subs}
\end{figure}