# script for figures 2C,D,E,F ## loading libraries library(Seurat) library(ggplot2) library(ggplotify) library(ggraph) library(ggrepel) library(ggpubr) library(ComplexHeatmap) library(gridExtra) library(RColorBrewer) library(dittoSeq) library(openxlsx) library(reshape2) library(ggalluvial) library(dplyr) # load seurat object obj <- readRDS("Fig2C_Dataset.rds") # setting color palette: colpalette <- c("#A6CEE3","#B2DF8A","#FDBF6F","#E78AC3","#FFFF99","#E31A1C","darkgrey") ## Figure 2C pdf(file = "Fig2C.pdf", width = 4, height = 4) dittoSeq::dittoDimPlot(object = obj, reduction.use = "umap.harmony.orig.ident", var = "Population", opacity = 0.6, do.label = T,labels.size = 5, labels.highlight = F, labels.repel = T, size = 0.6) + scale_color_manual(values = colpalette) + theme(legend.position = "none", plot.title = element_blank(), axis.text = element_text(size = 16, color = "black")) dev.off() ## Figure 2D pdf(file = "Fig2D.pdf", width = 4, height = 4) ggplot(data = g, aes(x = Sample, y = Frequency, alluvium = Population)) + geom_alluvium(aes(fill = Population), alpha = .5, decreasing = FALSE, width = 1/4) + geom_stratum(aes(stratum = Population, fill = Population), alpha = .50, decreasing = FALSE, width = 1/4) + scale_fill_manual(values = alpha(colour = colpalette, alpha = 0.50)) + theme_void() + theme(legend.position = "none", plot.title = element_blank(), axis.title = element_blank(), panel.background = element_rect(fill = "white"), axis.text = element_text(size = 16, color = "black")) dev.off() ## Figure 2E obj_sorted <- subset(obj, cells = WhichCells(object = obj, expression = orig.ident %in% c("S10","S11","S12"))) obj_sorted$Sorting <- obj_sorted$orig.ident obj_sorted$Sorting <- gsub(x = obj_sorted$Sorting, pattern = "S10", replacement = "CD38-") obj_sorted$Sorting <- gsub(x = obj_sorted$Sorting, pattern = "S11", replacement = "GMP") obj_sorted$Sorting <- gsub(x = obj_sorted$Sorting, pattern = "S12", replacement = "MEP") obj_sorted$Sorting <- factor(obj_sorted$Sorting, levels = c("CD38-","GMP","MEP")) cols_sorted <- list("CD38-" = "#008744", "GMP" = "#0057e7", "MEP" = "#d62d20" ) obj_sorted <- SetIdent(obj_sorted, value = "Sorting") obj_sorted$sortcol <- cols_sorted$`CD38-` obj_sorted$sortcol[which(obj_sorted$Sorting == "GMP")] <- cols_sorted$GMP obj_sorted$sortcol[which(obj_sorted$Sorting == "MEP")] <- cols_sorted$MEP p <- dittoDimPlot(object = obj_sorted, var = "Sorting", color.panel = cols_sorted, show.others = T,split.nrow = 1, split.by = "Sorting", labels.highlight = F,labels.repel = T, contour.color = "darkgrey", labels.size = 3.5,do.contour = T,contour.linetype = 2, reduction.use = "umap.harmony.orig.ident", size = 0.5, do.label = F) + theme(legend.position = "none", legend.key.size = unit(x = 0.1, units = "in"), strip.background.x = element_rect(fill = "white"), strip.text.x.bottom = element_text(size = 12), plot.title = element_blank(), axis.title = element_blank(), axis.text = element_text(size = 12), panel.border = element_rect()) pdf("Fig2E.pdf", width = 6, height = 2.5) p dev.off() ## Figure 2F pdf(file = "Fig2F.pdf", width = 4, height = 4) ggplot(data = g, aes(x = Sample, y = Frequency, fill = Population)) + geom_bar(stat = "identity", width = 0.5, color = "black") + scale_fill_manual(values = alpha(colour = colpalette, alpha = 0.50)) + theme_void() + theme(legend.position = "none", plot.title = element_blank(), axis.title = element_blank(), panel.background = element_rect(fill = "white"), axis.text = element_text(size = 16, color = "black")) dev.off()