-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcortecon.Rmd
executable file
·167 lines (151 loc) · 4.4 KB
/
cortecon.Rmd
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
---
title: "--"
author: "rbarreiro"
date: "--"
output:
html_document:
theme: journal
css: rmark.css
---
```{r setup, include=FALSE}
suppressMessages({
library(tidyverse)
library(scales)
library(cowplot)
library(ggbeeswarm)
library(ggsci)
library(viridis)
library(knitr)
library(ggpubr)
library(ggrepel)
library(eulerr)
library(hrbrthemes)
library(ggtext)
})
theme_set(
theme_ipsum_rc(grid = 'Y') +
theme(
plot.title.position = "plot",
plot.margin = margin(25,25,25,25),
axis.title.x = element_markdown(hjust = .5, size = 12, margin = margin(10,0,0,0)),
axis.title.y = element_markdown(hjust = .5, size = 12, margin = margin(0,10,0,0)),
plot.subtitle = element_markdown(family = 'Roboto Condensed', color = 'grey60')
)
)
options(scipen=15000000)
my_color_pal <- c(
UP=ggsci::pal_jco()(4)[1],
DOWN=ggsci::pal_jco()(4)[4]
)
```
```{r}
load('Cortecon_Base.RData')
my_data <-
DEseq.genes %>%
as.data.frame() %>%
select(-baseMean, -log2FoldChange,-lfcSE, -pvalue ,-padj) %>%
rownames_to_column('geneid') %>%
left_join(
tibble(geneid = names(SYMBOLS), genesymbol = SYMBOLS), by = "geneid") %>%
filter(genesymbol %in% c('MAGOH','MAGOHB')) %>%
pivot_longer(
names_to = "sample", values_to = "counts", -c(geneid, genesymbol)) %>%
separate(sample, into = c('day','sample'), sep = '\\.') %>%
mutate(day = as.integer(str_replace(day,"D",''))) %>%
group_by(day, genesymbol) %>%
summarise(norm_counts = mean(counts), sd = sd(counts))
my_data %>%
ggplot(aes(x = day, y = norm_counts, color = genesymbol)) +
geom_point() +
geom_errorbar(
aes(ymin = norm_counts-sd, ymax = norm_counts + sd), width = .8) +
geom_line() +
labs(
x = '**Time** (days)',
y = '**Normalized counts** (DESeq)',
color = NULL
) +
ggsci::scale_color_jco()
```
```{r}
my_data <-
edgeR.genes %>%
as.data.frame() %>%
select(-c("FoldDiff","logFC","logCPM","LR","PValue","fdr")) %>%
rownames_to_column('geneid') %>%
left_join(
tibble(geneid = names(SYMBOLS), genesymbol = SYMBOLS), by = "geneid") %>%
filter(genesymbol %in% c('MAGOH','MAGOHB')) %>%
pivot_longer(
names_to = "sample", values_to = "counts", -c(geneid, genesymbol)) %>%
separate(sample, into = c('day','sample'), sep = '\\.') %>%
mutate(day = as.integer(str_replace(day,"D",''))) %>%
group_by(day, genesymbol) %>%
summarise(norm_counts = mean(counts), sd = sd(counts))
my_data %>%
ggplot(aes(x = day, y = norm_counts, color = genesymbol)) +
geom_point() +
geom_errorbar(
aes(ymin = norm_counts-sd, ymax = norm_counts + sd), width = .8) +
geom_line() +
labs(
x = '**Time** (days)',
y = '**Normalized counts** (edgeR)',
color = NULL
) +
ggsci::scale_color_jco()
```
```{r}
my_data <-
norm.RNA.cts %>%
as.data.frame() %>%
rownames_to_column('geneid') %>%
left_join(
tibble(geneid = names(SYMBOLS), genesymbol = SYMBOLS), by = "geneid") %>%
filter(genesymbol %in% c('MAGOH','MAGOHB')) %>%
pivot_longer(
names_to = "sample", values_to = "counts", -c(geneid, genesymbol)) %>%
separate(sample, into = c('day','sample'), sep = '\\.') %>%
mutate(day = as.integer(str_replace(day,"D",''))) %>%
group_by(day, genesymbol) %>%
summarise(norm_counts = mean(counts), sd = sd(counts))
my_data %>%
ggplot(aes(x = day, y = norm_counts, color = genesymbol)) +
geom_point() +
geom_errorbar(
aes(ymin = norm_counts-sd, ymax = norm_counts + sd), width = .8) +
geom_line() +
labs(
x = '**Time** (days)',
y = '**Normalized counts** (?)',
color = NULL
) +
ggsci::scale_color_jco()
```
```{r}
my_data <-
RNA.raw %>%
as.data.frame() %>%
rownames_to_column('geneid') %>%
left_join(
tibble(geneid = names(SYMBOLS), genesymbol = SYMBOLS), by = "geneid") %>%
filter(genesymbol %in% c('MAGOH','MAGOHB')) %>%
pivot_longer(
names_to = "sample", values_to = "counts", -c(geneid, genesymbol)) %>%
separate(sample, into = c('day','sample'), sep = '\\.') %>%
mutate(day = as.integer(str_replace(day,"D",''))) %>%
group_by(day, genesymbol) %>%
summarise(norm_counts = mean(counts), sd = sd(counts))
my_data %>%
ggplot(aes(x = day, y = norm_counts, color = genesymbol)) +
geom_point() +
geom_errorbar(
aes(ymin = norm_counts-sd, ymax = norm_counts + sd), width = .8) +
geom_line() +
labs(
x = '**Time** (days)',
y = '**Raw counts**',
color = NULL
) +
ggsci::scale_color_jco()
```