-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpfocr_upsetR.R
58 lines (46 loc) · 1.46 KB
/
pfocr_upsetR.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
# Interrogate PFOCR for module genes in RAS-RAF-MEK-ERK cascade
library(magrittr)
library(tidyr)
library(dplyr)
## LOCAL INFO PER USER
setwd("~/Dropbox (Gladstone)/PFOCR_25Years") #AP
pfocr.genes <- readRDS("pfocr_genes.rds")
geneset <- c(
"KRAS",
"HRAS",
"NRAS",
"ARAF",
"BRAF",
"RAF1",
"MAP2K1",
"MAP2K2",
"MAPK1",
"MAPK3")
pfocr.genes.sub <- pfocr.genes %>%
dplyr::filter(hgnc_symbol %in% geneset) %>%
dplyr::select(c(figid, hgnc_symbol))%>%
dplyr::mutate(value=TRUE) %>%
dplyr::distinct(figid,hgnc_symbol, value)
upset.df <- pfocr.genes.sub %>%
tidyr::spread(hgnc_symbol, value, convert=T, fill=F)
#### UpSetR on PFOCR
library(UpSetR)
pfocr <- upset.df %>%
mutate(KRAS = if_else(KRAS == TRUE, 1, 0))%>%
mutate(HRAS = if_else(HRAS == TRUE, 1, 0))%>%
mutate(NRAS = if_else(NRAS == TRUE, 1, 0))%>%
mutate(ARAF = if_else(ARAF == TRUE, 1, 0))%>%
mutate(BRAF = if_else(BRAF == TRUE, 1, 0)) %>%
mutate(RAF1 = if_else(RAF1 == TRUE, 1, 0)) %>%
mutate(MAP2K1 = if_else(MAP2K1 == TRUE, 1, 0)) %>%
mutate(MAP2K2 = if_else(MAP2K2 == TRUE, 1, 0)) %>%
mutate(MAPK1 = if_else(MAPK1 == TRUE, 1, 0)) %>%
mutate(MAPK3 = if_else(MAPK3 == TRUE, 1, 0)) %>%
mutate(source = "pfocr")
upset(pfocr,
nsets = 10, number.angles = 0, point.size = 3.5, line.size = 2,
order.by = "degree",
mainbar.y.label = "Pathway Figures with Module Genes",
sets.x.label = "Total Gene Mentions",
text.scale = c(2, 2, 2, 2, 2, 2)
)