Commit 950b88d0 authored by Gervaise H. Henry's avatar Gervaise H. Henry 🤠

Handle removed Tz cells from cust corr heatmap

parent 069373dc
......@@ -160,16 +160,16 @@ DotPlot(sc10x.fmst,features=rev(c("DCN","MYL9")),dot.scale=10,cols=rev(heat.colo
dev.off()
singler.epi@listData$scores <- singler.epi@listData$scores[,c(1,2,4,3,5)]
cor.epi <- as.matrix(singler.epi@listData$scores)
cor.epi <- cor.epi[order(sc10x.epi$`Cell Type`[match(singler.epi@rownames,names(sc10x.epi$`Cell Type`))]),]
cor.epi.ann <- columnAnnotation(Cell.Type=factor(sc10x.epi$`Cell Type`[match(singler.epi@rownames,names(sc10x.epi$`Cell Type`))][order(sc10x.epi$`Cell Type`[match(singler.epi@rownames,names(sc10x.epi$`Cell Type`))])],levels=c("BE","LE","Hillock","Club","NE")),col=list(Cell.Type=c("BE"=brewer.pal(n=5,name="Dark2")[1],"LE"=brewer.pal(n=5,name="Dark2")[2],"Hillock"=brewer.pal(n=5,name="Dark2")[3],"Club"=brewer.pal(n=5,name="Dark2")[4],"NE"=brewer.pal(n=5,name="Dark2")[5])))
cor.epi <- as.matrix(singler.epi@listData$scores)[singler.epi@rownames %in% colnames(sc10x.epi),]
cor.epi <- cor.epi[order(sc10x.epi$`Cell Type`[match(singler.epi@rownames[singler.epi@rownames %in% colnames(sc10x.epi)],names(sc10x.epi$`Cell Type`))]),]
cor.epi.ann <- columnAnnotation(Cell.Type=factor(sc10x.epi$`Cell Type`[match(singler.epi@rownames[singler.epi@rownames %in% colnames(sc10x.epi)],names(sc10x.epi$`Cell Type`))][order(sc10x.epi$`Cell Type`[match(singler.epi@rownames[singler.epi@rownames %in% colnames(sc10x.epi)],names(sc10x.epi$`Cell Type`))])],levels=c("BE","LE","Hillock","Club","NE")),col=list(Cell.Type=c("BE"=brewer.pal(n=5,name="Dark2")[1],"LE"=brewer.pal(n=5,name="Dark2")[2],"Hillock"=brewer.pal(n=5,name="Dark2")[3],"Club"=brewer.pal(n=5,name="Dark2")[4],"NE"=brewer.pal(n=5,name="Dark2")[5])))
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 Epi Cell Types",column_title_side="bottom",column_title="Human Epi Cells")
dev.off()
cor.fmst <- as.matrix(singler.fmst@listData$scores)
cor.fmst <- cor.fmst[order(sc10x.fmst$`Cell Type`[match(singler.fmst@rownames,names(sc10x.fmst$`Cell Type`))]),]
cor.fmst.ann <- columnAnnotation(Cell.Type=factor(sc10x.fmst$`Cell Type`[match(singler.fmst@rownames,names(sc10x.fmst$`Cell Type`))][order(sc10x.fmst$`Cell Type`[match(singler.fmst@rownames,names(sc10x.fmst$`Cell Type`))])],levels=c("Fib","SM")),col=list(Cell.Type=c("Fib"=brewer.pal(n=3,name="Dark2")[1],"SM"=brewer.pal(n=3,name="Dark2")[2])))
cor.fmst <- as.matrix(singler.fmst@listData$scores)[singler.fmst@rownames %in% colnames(sc10x.fmst),]
cor.fmst <- cor.fmst[order(sc10x.fmst$`Cell Type`[match(singler.fmst@rownames[singler.fmst@rownames %in% colnames(sc10x.fmst)],names(sc10x.fmst$`Cell Type`))]),]
cor.fmst.ann <- columnAnnotation(Cell.Type=factor(sc10x.fmst$`Cell Type`[match(singler.fmst@rownames[singler.fmst@rownames %in% colnames(sc10x.fmst)],names(sc10x.fmst$`Cell Type`))][order(sc10x.fmst$`Cell Type`[match(singler.fmst@rownames[singler.fmst@rownames %in% colnames(sc10x.fmst)],names(sc10x.fmst$`Cell Type`))])],levels=c("Fib","SM")),col=list(Cell.Type=c("Fib"=brewer.pal(n=3,name="Dark2")[1],"SM"=brewer.pal(n=3,name="Dark2")[2])))
postscript(paste0("./analysis/vis/diy/CorrCustom_fmst.eps"))
Heatmap(scale(t(cor.fmst)),name="Correlation Z-Score",cluster_rows=FALSE,cluster_columns=FALSE,col=rev(heat.colors(2)),top_annotation=cor.fmst.ann,row_title="Human FMSt Cell Types",column_title_side="bottom",column_title="Human FMSt Cells")
dev.off()
......@@ -183,4 +183,4 @@ for (i in c("BE","LE","Hillock","Club","NE","Fib","SM")){
Idents(data) <- "Phenotype"
deg <- FindAllMarkers(data,assay="SCT",slot="data",logfc.threshold=0,test.use="MAST")
write.table(deg,file=paste0("./analysis/vis/diy/DEG_pheno.",i,".csv"),sep=",",quote=FALSE,row.names=FALSE,col.names=TRUE)
}
}
\ No newline at end of file
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