Commit 3cd662a9 authored by Gervaise Henry's avatar Gervaise Henry 🤠
Browse files

Clean up SingleR

parent 14ae840e
gc()
library(methods)
library(optparse)
library(Seurat)
library(readr)
library(readxl)
library(fBasics)
library(pastecs)
library(qusage)
library(RColorBrewer)
library(dplyr)
library(viridis)
library(gridExtra)
library(SingleR)
library(sctransform)
library(autothresholdr)
library(ggplot2)
options(bitmapType="cairo")
option_list=list(
make_option("--p",action="store",default="huPr_Pd",type='character',help="Project Name"),
make_option("--p",action="store",default="huPr_PdPb",type='character',help="Project Name"),
make_option("--s",action="store",default="hu",type='character',help="Species"),
make_option("--o",action="store",default="pr",type='character',help="Organ")
)
......@@ -33,210 +22,166 @@ source("./r.scripts/sc-TissueMapper_functions.R")
source("./r.scripts/sc-TissueMapper_process.R")
if (opt$s == "hu"){
hpca.se <- HumanPrimaryCellAtlasData()
lin.se <- hpca.se
leu.se <- hpca.se
imm <- MonacoImmuneData()
} else if (opt$s == "mu"){
igd.se <- ImmGenData()
#lin.se <- igd.se
#leu.se <- igd.se
lin.se <- subset(igd.se,select=(as.numeric(gsub("_","",substr(colnames(igd.se),4,10))) >= 920648 & as.numeric(gsub("_","",substr(colnames(igd.se),4,10))) <= 2112477))
lin.se <- subset(lin.se,select=!(as.numeric(gsub("_","",substr(colnames(lin.se),4,10))) %in% 1398469:1398471))
leu.se <- lin.se
}
if (opt$o == "pr" && opt$s == "hu"){
ref <- readRDS("/work/urology/ghenry/RNA-Seq/SingleCell/ANALYSIS/REF/huPr_Pd_all.rds")
pop <- readRDS("/work/urology/ghenry/RNA-Seq/SingleCell/ANALYSIS/REF/huPr_Pd_all.rds")
try(
if (as.numeric(substring(ref@version,1,1))<3){
ref <- UpdateSeuratObject(ref)
if (as.numeric(substring(pop@version,1,1))<3){
pop <- UpdateSeuratObject(pop)
}
)
scDWSpr.se <- as.SingleCellExperiment(ref,assay="RNA")
#scDWSpr.se$Lin[scDWSpr.se$Lin == "Unknown"] <- "Leu"
#levels(scDWSpr.se$ident)[levels(scDWSpr.se$ident)=="OE2"] <- "Hillock"
#levels(scDWSpr.se$ident)[levels(scDWSpr.se$ident)=="OE1"] <- "Club"
rm(ref)
Idents(pop) <- "Lineage"
pop.epi <- subset(pop,idents="Epi")
Idents(pop.epi) <- "Population"
pop.epi <- subset(pop.epi,idents=c("BE","LE","Hillock","Club"))
pop.st <- subset(pop,idents=c("FMSt","Endo"))
pop.epi$label.main <- pop.epi$Lineage
pop.st$label.main <- pop.st$Lineage
pop.epi$label.fine <- pop.epi$Population
pop.st$label.fine <- pop.st$Population
pop.epi@meta.data <- pop.epi@meta.data[,c("label.main","label.fine")]
pop.st@meta.data <- pop.st@meta.data[,c("label.main","label.fine")]
pop.epi <- as.SingleCellExperiment(pop.epi,assay="RNA")
pop.st <- as.SingleCellExperiment(pop.st,assay="RNA")
rm(pop)
}
sc10x <- readRDS(paste0("./analysis/",opt$p,"_raw.rds"))
sc10x.se <- as.SingleCellExperiment(sc10x)
common <- intersect(rownames(sc10x.se),rownames(lin.se))
lin.se <- lin.se[common,]
common <- Reduce(intersect, list(rownames(sc10x.se),rownames(imm),rownames(pop.epi),rownames(pop.st)))
sc10x.se <- sc10x.se[common,]
imm <- imm[common,]
pop.epi <- pop.epi[common,]
pop.st <- pop.st[common,]
rm(common)
singler.lin <- SingleR(sc10x.se,ref=lin.se,method="cluster",clusters=sc10x.se$integrated_snn_res.0.1,labels=lin.se$label.fine,BPPARAM=MulticoreParam(workers=10))
sc10x$lin <- singler.lin$labels[match(sc10x.se$integrated_snn_res.0.1,singler.lin@rownames)]
#singler.lin <- SingleR(sc10x.se,ref=lin.se,method="single",labels=lin.se$label.main,BPPARAM=MulticoreParam(workers=10))
#sc10x$lin <- singler.lin$labels
sc10x$lin[sc10x$lin %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] <- "Leu"
sc10x$lin[sc10x$lin %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] <- "Endo"
sc10x$lin[sc10x$lin %in% unique(lin.se@colData[lin.se@colData[,"label.main"] %in% c(
c("Smooth_muscle_cells","Fibroblasts","Chondrocytes","Osteoblasts","MSC","Tissue_stem_cells","iPS_cells"),
c("Stromal cells","Fibroblasts")
),c("label.main","label.fine")])$label.fine] <- "FMSt"
sc10x$lin[sc10x$lin %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] <- "Epi"
singler.lin <- SingleR(sc10x.se,ref=list(imm=imm,pop.epi=pop.epi,pop.st=pop.st),method="cluster",clusters=sc10x.se$integrated_snn_res.0.5,labels=list(imm=imm$label.main,pop.epi=pop.epi$label.fine,pop.st=pop.st$label.fine),de.method="wilcox",BPPARAM=BiocParallel::MulticoreParam(workers=20))
labs <- singler.lin$labels
labs[labs %in% c("BE","LE","Hillock","Club")] <- "Epi"
labs[labs %in% c("T cells","CD4+ T cells","CD8+ T cells","NK cells","B cells","Monocytes","Dendritic cells","Neutrophils","Basophils","Progenitors")] <- "Leu"
sc10x$lin <- labs[match(sc10x.se$integrated_snn_res.0.5,singler.lin@rownames)]
rm(labs)
#DimPlot(sc10x,group.by="lin",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
Idents(sc10x) <- "lin"
sc10x.epi <- subset(sc10x,idents="Epi")
sc10x.fmst <- subset(sc10x,idents="FMSt")
sc10x.st <- subset(sc10x,idents=setdiff(levels(sc10x),"Epi"))
sc10x.leu <- subset(sc10x,idents="Leu")
sc10x.epi <- subset(sc10x, idents="Epi")
sc10x.fmst <- subset(sc10x, idents=c("Fib","SM"))
sc10x.fib <- subset(sc10x, idents="Fib")
sc10x.sm <- subset(sc10x, idents="SM")
sc10x.leu <- subset(sc10x, idents="Leu")
if (opt$o == "pr" && opt$s == "hu"){
sc10x.se.epi <- as.SingleCellExperiment(sc10x.epi,assay="RNA")
scDWSpr.se.epi <- scDWSpr.se[,scDWSpr.se$Lineage=="Epi",]
common <- intersect(rownames(sc10x.se.epi),rownames(scDWSpr.se.epi))
scDWSpr.se.epi <- scDWSpr.se.epi[common,]
sc10x.se.epi <- sc10x.se.epi[common,]
rm(common)
sc10x.se.fmst <- as.SingleCellExperiment(sc10x.fmst,assay="RNA")
scDWSpr.se.fmst <- scDWSpr.se[,scDWSpr.se$ident %in% c("Fib","SM"),]
common <- intersect(rownames(sc10x.se.fmst),rownames(scDWSpr.se.fmst))
scDWSpr.se.fmst <- scDWSpr.se.fmst[common,]
sc10x.se.fmst <- sc10x.se.fmst[common,]
rm(common)
singler.epi <- SingleR(sc10x.se.epi,ref=scDWSpr.se.epi,labels=scDWSpr.se.epi$ident,BPPARAM=MulticoreParam(workers=10))
sc10x.epi$scDWSpr <- singler.epi$labels
Idents(sc10x.epi) <- "scDWSpr"
singler.fmst <- SingleR(sc10x.se.fmst,ref=scDWSpr.se.fmst,labels=scDWSpr.se.fmst$ident,BPPARAM=MulticoreParam(workers=10))
sc10x.fmst$scDWSpr <- singler.fmst$labels
Idents(sc10x.fmst) <- "scDWSpr"
}
res <- c(seq(0.1,0.5,0.1),0.75,seq(1,5,1))
results <- scPC(sc10x.epi,pc=1000,hpc=0.9,file="epi",print="2")
sc10x.epi <- results[[1]]
pc.use.epi <- results[[2]]
rm(results)
sc10x.epi <- scCluster(sc10x.epi,res=res,red="pca",dim=pc.use.epi,print="2",folder="epi")
#DimPlot(sc10x.epi,group.by="integrated_snn_res.0.1",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
results <- scPC(sc10x.fmst,pc=1000,hpc=0.9,file="fmst",print="2")
sc10x.fmst <- results[[1]]
pc.use.fmst <- results[[2]]
rm(results)
sc10x.fmst <- scCluster(sc10x.fmst,res=res,red="pca",dim=pc.use.fmst,print="2",folder="fmst")
#DimPlot(sc10x.fmst,group.by="integrated_snn_res.0.1",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
results <- scPC(sc10x.fib,pc=1000,hpc=0.9,file="all",print="2")
sc10x.fib <- results[[1]]
pc.use.fib <- results[[2]]
rm(results)
sc10x.fib <- scCluster(sc10x.fib,res=res,red="pca",dim=pc.use.fib,print="2",folder="fib")
#DimPlot(sc10x.fib,group.by="integrated_snn_res.0.1",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
results <- scPC(sc10x.sm,pc=1000,hpc=0.9,file="sm",print="2")
sc10x.sm <- results[[1]]
pc.use.sm <- results[[2]]
rm(results)
sc10x.sm <- scCluster(sc10x.sm,res=res,red="pca",dim=pc.use.sm,print="2",folder="sm")
#DimPlot(sc10x.sm,group.by="integrated_snn_res.0.1",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
results <- scPC(sc10x.leu,pc=1000,hpc=0.9,file="leu",print="2")
sc10x.leu <- results[[1]]
pc.use.leu <- results[[2]]
rm(results)
sc10x.leu <- scCluster(sc10x.leu,res=res,red="pca",dim=pc.use.leu,print="2",folder="leu")
#DimPlot(sc10x.leu,group.by="integrated_snn_res.0.1",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
sc10x.se.epi <- as.SingleCellExperiment(sc10x.epi,assay="RNA")
common <- intersect(rownames(sc10x.se.epi),rownames(pop.epi))
sc10x.se.epi <- sc10x.se.epi[common,]
pop.epi <- pop.epi[common,]
rm(common)
singler.epi <- SingleR(sc10x.se.epi,ref=pop.epi,method="single",labels=pop.epi$label.fine,de.method="wilcox",BPPARAM=BiocParallel::MulticoreParam(workers=20))
sc10x.epi$pop <- singler.epi$labels
Idents(sc10x.epi) <- "pop"
#DimPlot(sc10x.epi,group.by="pop",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
sc10x.se.leu <- as.SingleCellExperiment(sc10x.leu,assay="RNA")
leu.se <- leu.se[,leu.se$label.main %in% 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","Macrophages","Monocytes","B cells","Eosinophils","T cells","ILC","NK cells","Basophils","Mast cells","Tgd","NKT","B cells, pro","Microglia")]
common <- intersect(rownames(sc10x.se.leu),rownames(leu.se))
leu.se <- leu.se[common,]
common <- intersect(rownames(sc10x.se.leu),rownames(imm))
sc10x.se.leu <- sc10x.se.leu[common,]
imm <- imm[common,]
rm(common)
singler.leu <- SingleR(sc10x.se.leu,ref=imm,method="single",labels=imm$label.main,BPPARAM=BiocParallel::MulticoreParam(workers=20))
sc10x.leu$pop <- singler.leu$labels
Idents(sc10x.leu) <- "pop"
#DimPlot(sc10x.leu,group.by="pop",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
singler.leu <- SingleR(sc10x.se.leu,ref=leu.se,labels=leu.se$label.main,BPPARAM=MulticoreParam(workers=10))
sc10x.leu$leu <- singler.leu$labels
Idents(sc10x.leu) <- "leu"
#DimPlot(sc10x.leu,group.by="leu",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
sc10x$pops <- sc10x$lin
sc10x$pops[names(sc10x.leu$leu)] <- sc10x.leu$leu
sc10x.epi$pops <- sc10x.epi$lin
sc10x.fmst$pops <- sc10x.fmst$lin
sc10x.st$pops <- sc10x.st$lin
sc10x.leu$pops <- sc10x.leu$leu
if (opt$o == "pr" && opt$s == "hu"){
sc10x$pops[names(sc10x.epi$scDWSpr)] <- sc10x.epi$scDWSpr
sc10x.epi$pops <- sc10x.epi$scDWSpr
sc10x$pops[names(sc10x.fmst$scDWSpr)] <- sc10x.fmst$scDWSpr
sc10x.fmst$pops <- sc10x.fmst$scDWSpr
sc10x.st$pops[names(sc10x.fmst$scDWSpr)] <- sc10x.fmst$scDWSpr
sc10x$pops[names(sc10x.leu$leu)] <- sc10x.leu$leu
sc10x.st$pops[names(sc10x.fmst$scDWSpr)] <- sc10x.fmst$scDWSpr
}
#DimPlot(sc10x,group.by="pops",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
sc10x$leu <- "non-Leu"
sc10x$leu[names(sc10x.leu$leu)] <- sc10x.leu$leu
#DimPlot(sc10x,group.by="leu",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
res <- c(seq(0.1,0.5,0.1),0.75,seq(1,5,1))
try({
results <- scPC(sc10x.epi,pc=100,hpc=0.9,file="epi",print="2")
sc10x.epi <- results[[1]]
pc.use.epi <- results[[2]]
rm(results)
sc10x.epi <- scCluster(sc10x.epi,res=res,red="pca",dim=pc.use.epi,print="2",folder="epi")
})
try({
results <- scPC(sc10x.fmst,pc=100,hpc=0.9,file="fmst",print="2")
sc10x.fmst <- results[[1]]
pc.use.fmst <- results[[2]]
rm(results)
sc10x.fmst <- scCluster(sc10x.fmst,res=res,red="pca",dim=pc.use.fmst,print="2",folder="fmst")
})
try({
results <- scPC(sc10x.st,pc=100,hpc=0.9,file="st",print="2")
sc10x.st <- results[[1]]
pc.use.st <- results[[2]]
rm(results)
sc10x.st <- scCluster(sc10x.st,res=res,red="pca",dim=pc.use.st,print="2",folder="st")
})
try({
results <- scPC(sc10x.leu,pc=100,hpc=0.9,file="leu",print="2")
sc10x.leu <- results[[1]]
pc.use.leu <- results[[2]]
rm(results)
sc10x.leu <- scCluster(sc10x.leu,res=res,red="pca",dim=pc.use.leu,print="2",folder="leu")
})
if (!dir.exists(paste0("./analysis/vis/singler"))){
dir.create(paste0("./analysis/vis/singler"))
}
plot <- DimPlot(sc10x,reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
postscript(paste0("./analysis/vis/singler/UMAP_all.lin.eps"))
print(plot)
dev.off()
Idents(sc10x) <- "pops"
Idents(sc10x.epi) <- "pops"
Idents(sc10x.fmst) <- "pops"
Idents(sc10x.st) <- "pops"
Idents(sc10x.leu) <- "leu"
sc10x$pop <- sc10x$lin
sc10x$pop[names(sc10x.epi$pop)] <- sc10x.epi$pop
sc10x$pop[names(sc10x.leu$pop)] <- sc10x.leu$pop
#DimPlot(sc10x,group.by="pop",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
plot <- DimPlot(sc10x,reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
postscript(paste0("./analysis/vis/singler/UMAP_all.eps"))
print(plot)
dev.off()
for (i in c("epi","fmst","st","leu")){
for (i in c("epi","fmst","fib","sm","leu")){
plot <- DimPlot(get(paste0("sc10x.",i)),reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
postscript(paste0("./analysis/vis/singler/UMAP_",i,".eps"))
print(plot)
dev.off()
}
rm(list=ls(pattern="^sc10x.se"))
#scShinyOutput(sc10x,anal="id")
#scShinyOutput(sc10x.epi,anal="id.epi")
#scShinyOutput(sc10x.fmst,anal="id.fmst")
#scShinyOutput(sc10x.st,anal="id.st")
#scShinyOutput(sc10x.leu,anal="id.leu")
save(list=ls(pattern="^singler"),file='./analysis/singler_objects.RData')
save(list=ls(pattern="^sc10x"),file='./analysis/sc10x.id.rda')
save(list=ls(pattern="^sc10x.epi"),file='./analysis/sc10x.epi.id.rda')
save(list=ls(pattern="^sc10x.st"),file='./analysis/sc10x.st.id.rda')
#save.image(file="./analysis/sc10x.id.RData")
DefaultAssay(object=sc10x) <- "SCT"
DefaultAssay(object=sc10x.epi) <- "SCT"
DefaultAssay(object=sc10x.fmst) <- "SCT"
DefaultAssay(object=sc10x.fib) <- "SCT"
DefaultAssay(object=sc10x.sm) <- "SCT"
DefaultAssay(object=sc10x.leu) <- "SCT"
sc10x@meta.data <- sc10x@meta.data[,c("lin","pop","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.epi@meta.data <- sc10x.epi@meta.data[,c("lin","pop","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.fmst@meta.data <- sc10x.fmst@meta.data[,c("lin","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.fib@meta.data <- sc10x.fib@meta.data[,c("lin","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.sm@meta.data <- sc10x.sm@meta.data[,c("lin","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.leu@meta.data <- sc10x.leu@meta.data[,c("lin","pop","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
saveRDS(sc10x,paste0("./analysis/",opt$p,"_id_all.rds"))
saveRDS(sc10x.epi,paste0("./analysis/",opt$p,"_id_epi.rds"))
saveRDS(sc10x.fmst,paste0("./analysis/",opt$p,"_id_fmst.rds"))
saveRDS(sc10x.fib,paste0("./analysis/",opt$p,"_id_fib.rds"))
saveRDS(sc10x.sm,paste0("./analysis/",opt$p,"_id_sm.rds"))
saveRDS(sc10x.leu,paste0("./analysis/",opt$p,"_id_leu.rds"))
library(sceasy)
library(reticulate)
use_condaenv('sceasy')
convertFormat(sc10x,from="seurat",to="anndata",outFile=paste0("/project/urology/Strand_lab/shared/cellxgene/anndata/",opt$p,"_id_all.h5ad"),assay="SCT",main_layer="scale.data")
convertFormat(sc10x.epi,from="seurat",to="anndata",outFile=paste0("/project/urology/Strand_lab/shared/cellxgene/anndata/",opt$p,"_id_epi.h5ad"),assay="SCT",main_layer="scale.data")
convertFormat(sc10x.fmst,from="seurat",to="anndata",outFile=paste0("/project/urology/Strand_lab/shared/cellxgene/anndata/",opt$p,"_id_fmst.h5ad"),assay="SCT",main_layer="scale.data")
convertFormat(sc10x.fib,from="seurat",to="anndata",outFile=paste0("/project/urology/Strand_lab/shared/cellxgene/anndata/",opt$p,"_id_fib.h5ad"),assay="SCT",main_layer="scale.data")
convertFormat(sc10x.sm,from="seurat",to="anndata",outFile=paste0("/project/urology/Strand_lab/shared/cellxgene/anndata/",opt$p,"_id_sm.h5ad"),assay="SCT",main_layer="scale.data")
convertFormat(sc10x.leu,from="seurat",to="anndata",outFile=paste0("/project/urology/Strand_lab/shared/cellxgene/anndata/",opt$p,"_id_leu.h5ad"),assay="SCT",main_layer="scale.data")
saveRDS(sc10x,paste0("/project/urology/Strand_lab/shared/cellxgene/seurat/",opt$p,"_id_all.rds"))
saveRDS(sc10x.epi,paste0("/project/urology/Strand_lab/shared/cellxgene/seurat/",opt$p,"_id_epi.rds"))
saveRDS(sc10x.fmst,paste0("/project/urology/Strand_lab/shared/cellxgene/seurat/",opt$p,"_id_fmst.rds"))
saveRDS(sc10x.fib,paste0("/project/urology/Strand_lab/shared/cellxgene/seurat/",opt$p,"_id_fib.rds"))
saveRDS(sc10x.sm,paste0("/project/urology/Strand_lab/shared/cellxgene/seurat/",opt$p,"_id_sm.rds"))
saveRDS(sc10x.leu,paste0("/project/urology/Strand_lab/shared/cellxgene/seurat/",opt$p,"_id_leu.rds"))
rm(list=ls(pattern="^sc10x"))
save(list=ls(pattern="^singler"),file='./analysis/singler_objects.RData')
rm(list=ls(pattern="^singler"))
save.image(file="./analysis/sc10x.id.RData")
\ 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