-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmut_cna_table.Rnw
55 lines (49 loc) · 1.4 KB
/
mut_cna_table.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
<<setup_mut_cna_table, include=FALSE>>=
library(dplyr)
library(magrittr)
library(tidyr)
ar = import('array')
df = import('data_frame')
util = import('./util_2')
config = import('../config')
mut = util$mut_cov %>%
group_by(m) %>%
filter(any(adj.p < 1e-7)) %>%
ungroup()
use_amp = c("EGFR_amp", "KRAS_amp", "ERBB2_amp", "BRAF_amp",
"TP53_del",
"PIK3CA_amp", "PTEN_del")
cna = util$cna_cov %>%
group_by(m) %>%
filter(m %in% use_amp) %>%
ungroup()
# at least one pathway per method must have FDR<0.01
tab = bind_rows(mut, cna) %>%
transmute(Method = config$id2short(method),
Pathway = scores,
Subset = m,
FDR = ifelse(adj.p < 0.001, adj.p, NA)) %>%
group_by(Method, Subset) %>%
filter(!all(is.na(FDR))) %>%
ungroup() %>%
tidyr::spread(Pathway, FDR) %>%
arrange(Subset, Method)
na_mask = is.na(tab)
tab = tab %>%
lapply(format, digits=2) %>%
as.data.frame()
tab[na_mask] = "n.s."
@
\begin{table}[H]
\centering
\caption{FDR-adjusted p-values for mutation/copy number associations with
pathway scores obtained by PROGENy. Associations using TCGA data corrected for
cancer type. Mutated genes included in table if any method has FDR $<10^{-7}$, copy
number alterations for related genes (e.g. ERBB2\_amp for EGFR).
}
{\tiny
<<mut_cna_table, echo=FALSE>>=
kable(tab, booktabs=TRUE)
@
}
\end{table}