Skip to content

Latest commit

 

History

History
151 lines (128 loc) · 5.23 KB

Fig_S5_integration_with_adult_data.md

File metadata and controls

151 lines (128 loc) · 5.23 KB
title author date output
Fig S5
Laura Wolbeck
2024-07-01
html_document

setup

#Load helper functions
source("scRNA_helper_functions_preterm.R")
library(Seurat)
library(conos)
library(ggplot2)
library(magrittr)
library(ggrastr)
library(cowplot)

combine our data (full-term P2) with P29/35 from Cebrian-Silla et al.

https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE165554 tar file of their seurat object: GSE165554_RAW.tar untared: GSM5039270_scSeq.rds.gz 4 samples were labelled with Ab and sequenced together

Bar1 and Bar2 are males/p35 Bar3 and 4, females/p29

seurat <- readRDS("GSM5039270_scSeq.rds")

get their raw count matrix from seurat object

cms_raw <- GetAssayData(seurat, slot= "counts", assay = "RNA")

read in our list of all count matrices

cms <- readRDS("cms_all.rds")
# select only fullterm P2 count matrices
cmsx <- append(cms[5],cms[6])

cmsx <- append(cmsx, cms_raw)
names(cmsx)[3] <- "P29_P35"

combined conos

names = c("full_P2_1_",
          "full_P2_2_",
          "P29_P35")
con02 <- quickConos(cmsx,
                  names,
                  n.cores.p2=40,
                  n.cores.con=40, get.tsne = T, alignment.strength = 0.2)
con02 <- con02$con
#con02$findCommunities(method = leiden.community, resolution = 5, min.group.size = 50)
#leiden34 <- con02$clusters$leiden$groups %>% factor
#table(leiden27)
qsave(con02, "con_P29_P35_fullP2.qs")

get annotation of adult dataset

anno_P29_P35 <- [email protected]$Cell_Type
names(anno_P29_P35) <- rownames([email protected])
anno_P29_P35 <- renameAnnotation(anno_P29_P35, "Microglia", "Microg")

read in annotation of our dataset

anno_rough <- readRDS("anno_all7_rough.rds")

combine adult und fullterm P2 annotation

anno_combined<- c(anno_rough, anno_P29_P35)
qsave(anno_combined, "anno_combined.qs")

Fig S5D

colours <- c("#FFAF32","#3232FF","#32FF32", "#FFFF32","#FF3232","#AF0F0F","#AF0F0F","#AF0F0F","#AF32FF","#E632E6","#FFC8FF","#DBFF00", "#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2") %>% setNames(c("Immature_ependymal_cells", "RG","Intermediate_progenitors", "Dividing_cells", "Neuroblasts", "Neurons_1","Neurons_2","Neurons_3","OPC","Microglia","Endothelial/Pericytes/VSMC","Erythrocytes", "Ependymal cells" , "Astrocytes","B cells", "C cells" , "Mitosis", "A cells","GABAergic neurons", "Neuron" , "OPC/Oligo","Microg","Endothelial cells" ,"Pericytes/VSMC","VLMC1"))
plot <- con02$plotGraph(groups = anno_combined, size=0.2, label="") + scale_colour_manual(values=colours)+  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())
plot
rasterize(plot, layers='Point', dpi=1000)
ggsave("UMAP_combined_our3.pdf", width=7, height=4.3 )

Fig S5E

colours <- c("#FFAF32","#3232FF","#32FF32", "#FFFF32", "#FF3232","#AF0F0F","#AF0F0F","#AF32FF","#E632E6","#FFC8FF","#FFC8FF","#FFC8FF","#3232FF", "#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2","#d2d2d2") %>% setNames(c("Ependymal cells", "B cells", "C cells", "Mitosis",  "A cells","GABAergic neurons", "Neuron", "OPC/Oligo","Microg","Endothelial cells" ,"Pericytes/VSMC","VLMC1","Astrocytes", "Immature_ependymal_cells",  "RG","Intermediate_progenitors", "Dividing_cells", "Neuroblasts","Neurons_1","Neurons_2","Neurons_3","OPC","Microglia","Endothelial/Pericytes/VSMC","Erythrocytes"))
plot <- con02$plotGraph(groups = anno_combined, size=0.2, label ="")+ scale_colour_manual(values=colours)+  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())
plot
rasterize(plot, layers='Point', dpi=1000)
ggsave("UMAP_combined_adult3.pdf", width=7, height=4.3 )

Fig S5F

#prepare condition factor
sample <- con02$getDatasetPerCell()
conditions <- gsub("full_P2_1_", "full_P2", sample)
conditions <- gsub("full_P2_2_", "full_P2", conditions)

conditions %<>% as.factor()

names(conditions) <- names(sample)
head(conditions)

rename some cell types in annotation for the barplot

anno_combined_barplot <- anno_combined
anno_combined_barplot <- renameAnnotation(anno_combined_barplot, "A cells", "Neuroblasts")
anno_combined_barplot <- renameAnnotation(anno_combined_barplot, "B cells", "Radial glia/B cells")
anno_combined_barplot <- renameAnnotation(anno_combined_barplot, "RG", "Radial glia/b cells")
anno_combined_barplot <- renameAnnotation(anno_combined_barplot, "C cells", "Intermediate_progenitors")
anno_combined_barplot <- renameAnnotation(anno_combined_barplot, "Mitosis", "Dividing_cells")

annotation with only neurogenic lineage cell types

anno_neurog <-anno_combined_barplot[anno_combined_barplot %in% c("Neuroblasts","Dividing_cells","Intermediate_progenitors","Radial glia/B cells")]
anno_neurog <- droplevels(anno_neurog)
plotClusterBarplots(con02, groups = conditions , show.entropy = F, show.size = F, sample.factor = anno_neurog) + theme(axis.text.x = element_text(angle = 45, hjust = 1)) + scale_fill_discrete(name = "cell type") + 
  theme(plot.margin = margin(0.5,0,0,2, "cm"))
ggsave("barplots_full_adult_neurogenesis_2.pdf")