Commit 638318de authored by Gervaise H. Henry's avatar Gervaise H. Henry 🤠

Add custom corr plot for singler

parent 820f2d9c
......@@ -6,6 +6,7 @@ library(gridExtra)
library(RColorBrewer)
library(viridis)
library(scales)
library(ComplexHeatmap)
options(bitmapType="cairo")
......@@ -59,6 +60,13 @@ postscript(paste0("./analysis/vis/diy/Corr_lin.eps"))
print(plot)
dev.off()
cor.lin <- as.matrix(singler.lin@listData$scores)
cor.lin <- cor.lin[c(1:5,8:10,13:18,20:21,19,12,7,11,6,22),]
cor.lin.ann <- columnAnnotation(Cell.Lineage=factor(c(rep("Epi",16),rep("FMSt",2),"Endo",rep("Leu",3)),levels=c("Epi","FMSt","Endo","Leu")),col=list(Cell.Lineage=c("Epi"=magma(4)[1],"FMSt"=magma(4)[2],"Endo"=magma(4)[3],"Leu"=magma(4)[4])))
postscript(paste0("./analysis/vis/diy/CorrCustom_lin.eps"))
Heatmap(scale(t(cor.lin)),name="Correlation Z-Score",cluster_rows=FALSE,cluster_columns=FALSE,col=rev(heat.colors(2)),top_annotation=cor.lin.ann,row_title="ImmGen Cell Types",column_title_side="bottom",column_title="Mouse Clusters")
dev.off()
postscript(paste0("./analysis/vis/diy/Dot_lin.anchor.eps"))
DotPlot(sc10x,features=rev(c("Epcam","Cdh1","Dcn","Myl9","Pecam1","Vwf","Ptprc")),dot.scale=10,cols=rev(heat.colors(2)))
dev.off()
......@@ -105,7 +113,7 @@ Idents(sc10x.epi) <- "Cell Type"
Idents(sc10x.epi.pr) <- "Cell Type"
Idents(sc10x.epi.ur) <- "Cell Type"
postscript(paste0("./analysis/vis/diy/UMAP_epi.split.pr.eps"))
DimPlot(sc10x.epi.pr)+scale_color_viridis(discrete=TRUE)+theme_cowplot()
DimPlot(sc10x.epi.pr)+scale_color_brewer(palette="Dark2")+theme_cowplot()
dev.off()
postscript(paste0("./analysis/vis/diy/UMAP_epi.split.ur.eps"))
DimPlot(sc10x.epi.ur)+scale_color_viridis(discrete=TRUE)+theme_cowplot()
......@@ -124,16 +132,23 @@ postscript(paste0("./analysis/vis/diy/Corr_epi.eps"))
print(plot)
dev.off()
cor.epi <- as.matrix(singler.epi@listData$scores)
cor.epi <- cor.epi[c(2,3,4,6,1,5),]
cor.epi.ann <- columnAnnotation(Cell.Type=factor(c("BE","Ur","VP LE","DLP LE","AP LE","ED"),levels=c("BE","Ur","VP LE","DLP LE","AP LE","ED")),col=list(ID=c("BE"="brown3","Ur"="brown2","LE"="brown1"),Cell.Type=c("BE"=brewer.pal(n=6,name="Dark2")[1],"Ur"=brewer.pal(n=6,name="Dark2")[2],"VP LE"=brewer.pal(n=6,name="Dark2")[3],"DLP LE"=brewer.pal(n=6,name="Dark2")[4],"AP LE"=brewer.pal(n=6,name="Dark2")[5],"ED"=brewer.pal(n=6,name="Dark2")[6])))
postscript(paste0("./analysis/vis/diy/CorrCustom_epi.eps"))
Heatmap(scale(t(cor.epi)),name="Correlation Z-Score",cluster_rows=FALSE,cluster_columns=FALSE,col=rev(heat.colors(2)),top_annotation=cor.epi.ann,row_title="Human Cell Types",column_title_side="bottom",column_title="Mouse Epi Clusters")
dev.off()
postscript(paste0("./analysis/vis/diy/Dot_epi.anchor.eps"))
DotPlot(sc10x.epi,features=rev(c("Krt5","Krt4","Sbp","Msmb","Tgm4","Svs2")),dot.scale=10,cols=rev(heat.colors(2)))
dev.off()
postscript(paste0("./analysis/vis/diy/Vln_epi.anchor.eps"))
VlnPlot(sc10x.epi,features=c("Krt5","Krt4","Sbp","Msmb","Tgm4","Svs2"),pt.size=0.1,cols=viridis(6))+theme_cowplot()
VlnPlot(sc10x.epi,features=c("Krt5","Krt4","Sbp","Msmb","Tgm4","Svs2"),pt.size=0.1,cols=brewer.pal(n=6,name="Dark2"))+theme_cowplot()
dev.off()
postscript(paste0("./analysis/vis/diy/Dot_epi.sc.eps"))
DotPlot(sc10x.epi,features=rev(c("Svs2","Krt8","Pbsn","Msmb","Sbp","Tgm4","Trp63","Krt5","Krt4","Ly6d","Psca","Tacstd2","Ly6e","Ly6a","Prom1")),dot.scale=10,cols=rev(heat.colors(2)))
DotPlot(sc10x.epi,features=rev(c("Svs2","Krt8","Cd24a","Dpp4","Pbsn","Msmb","Sbp","Tgm4","Trp63","Krt5","Krt4","Ly6d","Psca","Tacstd2","Ly6e","Ly6a","Prom1")),dot.scale=10,cols=rev(heat.colors(2)))
dev.off()
deg.lin <- FindAllMarkers(sc10x,assay="SCT",slot="data",logfc.threshold=0,test.use="MAST",only.pos=TRUE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment