Commit 34fcd4b2 authored by Gervaise H. Henry's avatar Gervaise H. Henry 🤠

Update PdPgb diy

parent 5917f086
......@@ -53,20 +53,11 @@ 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()
Idents(sc10x) <- "lin"
leu <- WhichCells(sc10x,idents=c("Epi","FMSt","Endo"),invert=TRUE)
sc10x$`Cell Type` <- sc10x$pops
Idents(sc10x) <- "Cell Type"
sc10x <- RenameIdents(sc10x,"Monocyte"="Leu")
sc10x <- RenameIdents(sc10x,"DC"="Leu")
sc10x <- RenameIdents(sc10x,"T_cells"="Leu")
sc10x <- RenameIdents(sc10x,"Macrophage"="Leu")
sc10x <- RenameIdents(sc10x,"NK_cell"="Leu")
sc10x <- RenameIdents(sc10x,"Pro-Myelocyte"="Leu")
sc10x <- RenameIdents(sc10x,"Neutrophils"="Leu")
sc10x <- RenameIdents(sc10x,"B_cell"="Leu")
sc10x <- RenameIdents(sc10x,"Pre-B_cell_CD34-"="Leu")
sc10x <- RenameIdents(sc10x,"CMP"="Leu")
sc10x <- RenameIdents(sc10x,"GMP"="Leu")
sc10x <- RenameIdents(sc10x,"Pro-B_cell_CD34+"="Leu")
sc10x <- SetIdent(sc10x,cells=leu,value="Leu")
sc10x$`Cell Type` <- Idents(sc10x)
sc10x$`Cell Type` <- factor(sc10x$`Cell Type`,levels=c("BE","LE","Hillock","Club","NE","Fib","SM","Endo","Leu"))
Idents(sc10x) <- "Cell Type"
......@@ -82,17 +73,53 @@ postscript(paste0("./analysis/vis/diy/Dot_pops.anchor.eps"))
DotPlot(sc10x,features=rev(c("KRT5","KLK3","KRT13","SCGB3A1","CHGA","DCN","MYL9","PECAM1","PTPRC")),dot.scale=10,cols=rev(heat.colors(2)))
dev.off()
Idents(sc10x) <- "integrated_snn_res.0.5"
postscript(paste0("./analysis/vis/diy/UMAP_lin.res0.5.eps"))
Idents(sc10x) <- "integrated_snn_res.5"
postscript(paste0("./analysis/vis/diy/UMAP_lin.res5.eps"))
DimPlot(sc10x)+theme_cowplot()
dev.off()
singler.lin@listData$scores <- singler.lin@listData$scores[,c(3,13,27,23,2,19,20,26,25,11,12,28,18,24,17,10,21,9,14,29,30,31,32,6,16,34,35,4,36,33,7,15,1,5,8,22)]
##NEED TO REORDER SINGLER COLS AND SAMPLE ROWS
lin.se <- HumanPrimaryCellAtlasData()
singler.lin@listData$scores <- singler.lin@listData$scores[,c(
unique(lin.se@colData[lin.se@colData[,"label.main"] %in% c(
c("Epithelial_cells","Keratinocytes","Neuroepithelial_cell"),
c("Epithelial cells")
),c("label.main","label.fine")])$label.fine,
unique(lin.se@colData[lin.se@colData[,"label.main"] %in% c(
c("Smooth_muscle_cells","Fibroblasts","Chondrocytes","Osteoblasts","MSC","Tissue_stem_cells"),
c("Stromal cells","Fibroblasts")
),c("label.main","label.fine")])$label.fine,
unique(lin.se@colData[lin.se@colData[,"label.main"] %in% c(
c("Endothelial_cells","Erythroblast","Platelets"),
c("Endothelial cells")
),c("label.main","label.fine")])$label.fine,
unique(lin.se@colData[lin.se@colData[,"label.main"] %in% c(
c("DC","B_cell","Neutrophil","T_cells","Monocyte","Macrophage","NK_cell","Neutrophils","CMP","GMP","MEP","Myelocyte","Pre-B_cell_CD34-","Pro-B_cell_CD34+","Pro-Myelocyte","HSC_-G-CSF","HSC_CD34+"),
c("Macrophages","Monocytes","B cells","DC","Eosinophils","Neutrophils","T cells","ILC","NK cells","Basophils","Mast cells","Tgd","NKT","B cells, pro","Microglia")
),c("label.main","label.fine")])$label.fine
)]
cor.lin <- as.matrix(singler.lin@listData$scores)
cor.lin <- cor.lin[c(1:2,7:12,14,4,6,13,3,5),]
cor.lin.ann <- columnAnnotation(Cell.Lineage=factor(sc10x$`Cell Lineage`[match(singler.lin@rownames,sc10x$integrated_snn_res.0.5)][c(1:2,7:12,14,4,6,13,3,5)],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])))
order.lin <- c(
which(singler.lin$labels %in% unique(lin.se@colData[lin.se@colData[,"label.main"] %in% c(
c("Epithelial_cells","Keratinocytes","Neuroepithelial_cell"),
c("Epithelial cells")
),c("label.main","label.fine")])$label.fine),
which(singler.lin$labels %in% unique(lin.se@colData[lin.se@colData[,"label.main"] %in% c(
c("Smooth_muscle_cells","Fibroblasts","Chondrocytes","Osteoblasts","MSC","Tissue_stem_cells"),
c("Stromal cells","Fibroblasts")
),c("label.main","label.fine")])$label.fine),
which(singler.lin$labels %in% unique(lin.se@colData[lin.se@colData[,"label.main"] %in% c(
c("Endothelial_cells","Erythroblast","Platelets"),
c("Endothelial cells")
),c("label.main","label.fine")])$label.fine),
which(singler.lin$labels %in% unique(lin.se@colData[lin.se@colData[,"label.main"] %in% c(
c("DC","B_cell","Neutrophil","T_cells","Monocyte","Macrophage","NK_cell","Neutrophils","CMP","GMP","MEP","Myelocyte","Pre-B_cell_CD34-","Pro-B_cell_CD34+","Pro-Myelocyte","HSC_-G-CSF","HSC_CD34+"),
c("Macrophages","Monocytes","B cells","DC","Eosinophils","Neutrophils","T cells","ILC","NK cells","Basophils","Mast cells","Tgd","NKT","B cells, pro","Microglia")
),c("label.main","label.fine")])$label.fine)
)
cor.lin <- cor.lin[order.lin,]
cor.lin.ann <- columnAnnotation(Cell.Lineage=factor(sc10x$`Cell Lineage`[match(singler.lin@rownames,sc10x$integrated_snn_res.5)][order.lin],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="HPCA Cell Types",column_title_side="bottom",column_title="Human Prostate Clusters")
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="HPCA Cell Types",column_title_side="bottom",column_title="Human Prostate Clusters",show_row_names=FALSE)
dev.off()
Idents(sc10x.epi) <- "samples"
......@@ -183,4 +210,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