diff --git a/r.scripts/Pd_convert_to_UMAP.R b/r.scripts/Pd_convert_to_UMAP.R index a5f96189072b576cc3e605cf1b2c5e1b85fc9d8d..ab72a15294c08232af1760e396e5cc18b31da49d 100644 --- a/r.scripts/Pd_convert_to_UMAP.R +++ b/r.scripts/Pd_convert_to_UMAP.R @@ -13,20 +13,38 @@ source("./r.scripts/sc-TissueMapper_functions.R") source("./r.scripts/sc-TissueMapper_process.R") load("./analysis/sc10x.Rda") +load("./analysis/sc10x.Epi.Rda") +load("./analysis/sc10x.St.Rda") try( if (as.numeric(substring(sc10x@version,1,1))<3){ sc10x <- UpdateSeuratObject(sc10x) + sc10x.Epi <- UpdateSeuratObject(sc10x.Epi) + sc10x.St <- UpdateSeuratObject(sc10x.St) } ) sc10x <- RunUMAP(sc10x,dims=1:30,reduction="cca.aligned") +sc10x.Epi <- RunUMAP(sc10x.Epi,dims=1:30,reduction="cca.aligned") +sc10x.St <- RunUMAP(sc10x.St,dims=1:30,reduction="cca.aligned") Idents(object=sc10x) <- "Merge_Epi.dws_St.go_NE" +Idents(object=sc10x.Epi) <- "Epi.dws.sub_NE" +Idents(object=sc10x.St) <- "St.go" sc10x <- RenameIdents(object=sc10x, "OE1" = "Club") sc10x <- RenameIdents(object=sc10x, "OE2" = "Hillock") +sc10x.Epi <- RenameIdents(object=sc10x.Epi, "OE1" = "Club") +sc10x.Epi <- RenameIdents(object=sc10x.Epi, "OE2" = "Hillock") postscript(paste0("./analysis/UMAP.aggr.eps")) DimPlot(sc10x,reduction="umap",label=FALSE,order=rev(c("BE","LE","Hillock","Club","NE","Fib","SM","Endo","Leu")),cols=rev(c(brewer.pal(5,"Reds")[2:5],"grey50",brewer.pal(5,"Blues")[2:5]))) dev.off() +postscript(paste0("./analysis/UMAP.epi.eps")) +DimPlot(sc10x.Epi,reduction="umap",label=FALSE,order=rev(c("BE","LE","Hillock","Club","NE")),cols=rev(c("grey50",brewer.pal(5,"Blues")[2:5]))) +dev.off() +postscript(paste0("./analysis/UMAP.st.eps")) +DimPlot(sc10x.St,reduction="umap",label=FALSE,order=rev(c("Fib","SM","Endo","Leu")),cols=rev(c(brewer.pal(5,"Reds")[2:5]))) +dev.off() write.table(Embeddings(object = sc10x, reduction = "umap"),file=paste0("./analysis/UMAP.aggr.csv"),row.names=TRUE,col.names=NA,append=FALSE,sep=",") +write.table(Embeddings(object = sc10x.Epi, reduction = "umap"),file=paste0("./analysis/UMAP.epi.csv"),row.names=TRUE,col.names=NA,append=FALSE,sep=",") +write.table(Embeddings(object = sc10x.St, reduction = "umap"),file=paste0("./analysis/UMAP.st.csv"),row.names=TRUE,col.names=NA,append=FALSE,sep=",")