-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfigure_2.Rmd
executable file
·88 lines (67 loc) · 2.32 KB
/
figure_2.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
---
title: 'Figure 3'
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir='/local1/USERS/jfleck/data/PUBLIC_ORGANOIDS')
```
This notebook reproduces the main analyses from figure 2 of the manuscript. First we import the necessary packages.
```{r message=FALSE, warning=FALSE, results='hide'}
library(tidyverse)
library(patchwork)
library(Seurat)
library(voxhunt)
```
Now we load the data. The loaded seurat object contains the neuronal popultions of the datasets shown in the manuscript. We further subset the ones shown in figure 2.
```{r}
load_aba_data('voxhunt_data/')
```
We can plot annotations of the mouse brain at different timepoints with the `plot_annotation()` function:
```{r, fig.height=3, fig.width=5}
e11 <- voxhunt::plot_annotation('E11')
e13 <- voxhunt::plot_annotation('E13')
e15 <- voxhunt::plot_annotation('E15')
e18 <- voxhunt::plot_annotation('E18')
p4 <- voxhunt::plot_annotation('P4')
p14 <- voxhunt::plot_annotation('P14')
p28 <- voxhunt::plot_annotation('P28')
p56 <- voxhunt::plot_annotation('P56')
e11 + e13 + e15 + e18 + p4 + p14 + p28 + p56
```
Since for each voxel, the expression of almost 2000 genes is registered, we can plot some common markers:
```{r, fig.height=4, fig.width=6}
marker_genes <- c('NEUROD6', 'EOMES', 'DCN', 'DLX1', 'DLX2',
'GBX2', 'OTX2', 'GATA3', 'PAX8')
voxhunt::plot_expression('E15', marker_genes, slices=8:12) & no_legend()
```
We can also look for markers of specific brain structures:
```{r, fig.height=4, fig.width=6}
c4_markers <- structure_markers('E15', 'custom_4')
hipp_markers <- c4_markers %>%
filter(group=='hippocampus') %>%
top_n(8, auc) %>% pull(gene)
cb_markers <- c4_markers %>%
filter(group=='cerebellar hemisphere') %>%
top_n(8, auc) %>% pull(gene)
p1 <- voxhunt::plot_expression(
'E15',
hipp_markers,
nrow=2
) & no_legend()
p2 <- voxhunt::plot_expression(
'E15',
cb_markers,
nrow=2
) & no_legend()
p1 / p2
```
As shown in figure 2e), we can do this DE analysis on different levels of annotation at all available developmental stages:
```{r}
c2_markers <- structure_markers('P4', 'custom_2')
top_markers <- c2_markers %>%
group_by(group) %>%
top_n(1, auc) %>%
pull(gene)
voxhunt::plot_expression('P4', top_markers) & no_legend()
```