-
Notifications
You must be signed in to change notification settings - Fork 0
/
figure_6.Rmd
executable file
·90 lines (70 loc) · 3.03 KB
/
figure_6.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
---
title: "Figure 6"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir='/links/groups/treutlein/USERS/jfleck/data/PUBLIC_ORGANOIDS')
```
This notebook reproduces the main analyses from figure 6 of the manuscript. First we import the necessary packages.
```{r, message=FALSE, warning=FALSE, results='hide'}
library(Seurat)
library(tidyverse)
library(patchwork)
library(voxhunt)
```
## Ganglionic eminence
Now we set up some colors and load the data. The loaded seurat object contains mitotic progenitors from Mayer et al. 2018.
```{r}
data("voxel_meta")
load_aba_data('voxhunt_data/')
# Subset E13.5 from meta
e13_meta <- voxel_meta %>%
filter(stage=='E13')
# Seurat with mitotic precursors
mayer_srt <- read_rds('2018_mayer_srt.rds')
kanton_srt <- read_rds('m2org_srt.rds')
ge_colors <- c('#9fa8da','#8e24aa', '#4a148c', 'lightgray')
names(ge_colors) <- c('CGE', 'MGE', 'LGE', 'other')
```
The meta data already contains a column with the GE annotations we added for the manuscript by louvain clustering and assigning labels based on marker genes. We can plot that with the `voxel_meta`
```{r, fig.height=2, fig.width=4}
ggplot(e13_meta,
aes(x, y, fill=ge_annot, alpha=!is.na(ge_annot) & ge_annot!='other')) +
geom_tile() +
scale_fill_manual(values=ge_colors, na.value='gray') +
theme_void() +
no_legend()
```
We can now map the primary data to these structures. To resolve the contrast between the GEs as well as possible, we use the GE markers reported in Mayer et al., which we already stored in the Seurat object.
```{r, fig.height=4, fig.width=5}
ge_markers <- mayer_srt@misc$markers
mayer_voxmap <- voxel_map(mayer_srt, group_name='region', genes_use=ge_markers)
# Tweek annotation
mayer_voxmap$voxel_meta <- mayer_voxmap$voxel_meta %>%
mutate(ge_annot=ifelse(is.na(ge_annot), 'other', ge_annot))
plot_map(mayer_voxmap, view='slice', annotation_level = 'ge_annot',
annotation_colors = ge_colors, slices=c(13,18))
```
In the same way, we can also map the organoid data. Here we found that we need some more genes to properly map the data, so we additionally use genes obtained from DE between newly annotated structures.
```{r}
# Create new annotation column
e13_meta <- e13_meta %>%
mutate(fine_annot=ifelse(is.na(ge_annot), custom_3, ge_annot))
# DE between annotated structures
struct_de <- structure_markers('E13', structure_groups = e13_meta$fine_annot)
struct_markers <- struct_de %>%
group_by(group) %>%
top_n(10, auc) %>%
{unique(.$gene)}
# Subset GE neurons
kanton_ge_srt <- subset(kanton_srt,
line=='H9' & celltype%in%c('mge_in', 'lge_in')
)
kanton_voxmap <- voxel_map(kanton_ge_srt, group_name='ge_substruct', genes_use=union(struct_markers, ge_markers))
# Tweek annotation again
kanton_voxmap$voxel_meta <- kanton_voxmap$voxel_meta %>%
mutate(ge_annot=ifelse(is.na(ge_annot), 'other', ge_annot))
plot_map(kanton_voxmap, view='slice', annotation_level = 'ge_annot',
annotation_colors = ge_colors, slices=c(13,18))
```