diff --git a/r.scripts/sc-TissueMapper_RUN.PdPbPc.cca.R b/r.scripts/sc-TissueMapper_RUN.PdPbPc.cca.R index 4fee8b58f857cee3ab61e5ab36ce02bca486e9da..f6714309d94cc1f8b4148d2070acafbb8e59cc9e 100755 --- a/r.scripts/sc-TissueMapper_RUN.PdPbPc.cca.R +++ b/r.scripts/sc-TissueMapper_RUN.PdPbPc.cca.R @@ -237,14 +237,31 @@ genes.leu.l[nrow(genes.leu.l)+1,] <- list("FCN1","Neutrophils",0) rm(results) rm(gene.set) - res.leu <- 1 + res.pop <- 1 sc10x <- SetAllIdent(object=sc10x,id="Pop") + + try({ + sc10x.Epi <- scSubset(sc10x,i="Pop",g="Epi") + sc10x.Epi <- SetAllIdent(object=sc10x.Epi,id=paste0("res",opt$res.poststress)) + sc10x.Epi <- StashIdent(object=sc10x.Epi,save.name=paste0("old.res",opt$res.poststress)) + sc10x.Epi <- scCluster(sc10x.Epi,pc.use=opt$acca,res.use=res.pop,folder=paste0("epi/",i),red="cca.aligned") + assign(paste0("sc10x.Epi.",i,".analized"),sc10x.Epi) + }) + + try({ + sc10x.FMSt <- scSubset(sc10x,i="Pop",g="FMSt") + sc10x.FMSt <- SetAllIdent(object=sc10x.FMSt,id=paste0("res",opt$res.poststress)) + sc10x.FMSt <- StashIdent(object=sc10x.FMSt,save.name=paste0("old.res",opt$res.poststress)) + sc10x.FMSt <- scCluster(sc10x.FMSt,pc.use=opt$acca,res.use=res.pop,folder=paste0("st/",i),red="cca.aligned") + assign(paste0("sc10x.FMSt.",i,".analized"),sc10x.FMSt) + }) + try({ sc10x.Lymphoid <- scSubset(sc10x,i="Pop",g="Lymphoid") sc10x.Lymphoid <- SetAllIdent(object=sc10x.Lymphoid,id=paste0("res",opt$res.poststress)) sc10x.Lymphoid <- StashIdent(object=sc10x.Lymphoid,save.name=paste0("old.res",opt$res.poststress)) - sc10x.Lymphoid <- scCluster(sc10x.Lymphoid,pc.use=opt$acca,res.use=res.leu,folder=paste0("lymphoid/",i),red="cca.aligned") + sc10x.Lymphoid <- scCluster(sc10x.Lymphoid,pc.use=opt$acca,res.use=res.pop,folder=paste0("lymphoid/",i),red="cca.aligned") assign(paste0("sc10x.Lymphoid.",i,".analized"),sc10x.Lymphoid) }) @@ -252,7 +269,7 @@ genes.leu.l[nrow(genes.leu.l)+1,] <- list("FCN1","Neutrophils",0) sc10x.Myeloid <- scSubset(sc10x,i="Pop",g="Myeloid") sc10x.Myeloid <- SetAllIdent(object=sc10x.Myeloid,id=paste0("res",opt$res.poststress)) sc10x.Myeloid <- StashIdent(object=sc10x.Myeloid,save.name=paste0("old.res",opt$res.poststress)) - sc10x.Myeloid <- scCluster(sc10x.Myeloid,pc.use=opt$acca,res.use=res.leu,folder=paste0("myeloid/",i),red="cca.aligned") + sc10x.Myeloid <- scCluster(sc10x.Myeloid,pc.use=opt$acca,res.use=res.pop,folder=paste0("myeloid/",i),red="cca.aligned") assign(paste0("sc10x.Myeloid.",i,".analized"),sc10x.Myeloid) }) @@ -261,6 +278,8 @@ genes.leu.l[nrow(genes.leu.l)+1,] <- list("FCN1","Neutrophils",0) assign(paste0("results.clust.Lin.id.",i),results.clust.Lin.id) rm(sc10x) + rm(sc10x.Epi) + rm(sc10x.FMSt) rm(sc10x.Lymphoid) rm(sc10x.Myeloid) rm(sc10x.Leu)