-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbreast_tissue_exploratory.R
More file actions
46 lines (31 loc) · 1.05 KB
/
breast_tissue_exploratory.R
File metadata and controls
46 lines (31 loc) · 1.05 KB
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
#library loading
library(tidyverse)
library(ggplot2)
#comparing FPKM expression between breast and normal tissue for BRCA1
data.long %>%
filter(gene =='BRCA1') %>%
ggplot(., aes(x = samples, y = FPKM, fill = tissue)) +
geom_col()
#density plot
data.long%>%
filter(gene == 'BRCA1') %>%
ggplot(., aes(x = FPKM, fill = tissue)) +
geom_density(alpha=0.4)
#boxplots to compare different metastatic statuses
data.long%>%
filter(gene == 'BRCA1')%>%
ggplot(., aes(x = metastasis, y = FPKM)) +
#geom_boxplot()
geom_violin()
data.long%>%
filter(gene == 'BRCA1' | gene == 'BRCA2')%>%
spread(key = gene, value = FPKM) %>%
ggplot(., aes(x = BRCA1, y = BRCA2, color = tissue)) +
geom_point() +
geom_smooth(method = 'lm', se = FALSE)
genes.of.interest <- c('BRCA1', 'BRCA2', 'TP53', 'ALK', 'MYCN')
p <- data.long%>%
filter(gene %in% genes.of.interest)%>%
ggplot(., aes(x = samples, y = gene, fill = FPKM)) +
geom_tile() + scale_fill_gradient(low = 'white', high = 'blue')
ggsave(p, filename = 'heatmap_save1.pdf', width = 10, height= 8)