Commit 7e42e192 authored by Gervaise Henry's avatar Gervaise Henry 🤠
Browse files

BIG update: import samples independent, not aggr; change assays for different...

BIG update: import samples independent, not aggr; change assays for different functions; partial cleanup of functions
parent ede95d6f
......@@ -27,16 +27,18 @@ project.name="PdPbPc_deep"
scFolders()
sc10x <- scLoad(p=project.name,cellranger=3,ref="GRCh38")
results <- scLoad(p=project.name,cellranger=3,aggr=FALSE)
sc10x <- results[[1]]
sc10x.groups <- results[[2]]
rm(results)
results <- scQC(sc10x,sub=FALSE,sp="hu")
results <- scQC(sc10x,sp="hu")
sc10x <- results[[1]]
counts.cell.raw <- results[[2]]
counts.gene.raw <- results[[3]]
counts.cell.filtered <- results[[4]]
counts.gene.filtered <- results[[5]]
rm(results)
rm(lu)
# results <- scCellCycle(sc10x,sub=FALSE,sp="hu")
# sc10x <- results[[1]]
......@@ -44,21 +46,9 @@ rm(lu)
# genes.g2m <- results[[3]]
# rm(results)
sc10x.l <- list()
sc10x.l[["Donor"]] <- subset(sc10x,subset= Donor=="Donor")
sc10x.l[["BPH"]] <- subset(sc10x,subset= BPH=="BPH")
sc10x.l[["Cancer"]] <- subset(sc10x,subset= Cancer=="Cancer")
sc10x <- scCCA(sc10x.l)
rm(sc10x.l)
sc10x <- scCCA(sc10x)
sc10x@project.name <- project.name
# sc10x <- FindVariableFeatures(sc10x,verbose=FALSE)
gc()
sc10x <- ScaleData(object=sc10x,do.par=TRUE,num.cores=45,verbose=FALSE)
# sc10x <- ScaleData(object=sc10x,vars.to.regress=c("nFeature_RNA","percent.mito"),do.par=TRUE,num.cores=45,verbose=FALSE)
gc()
sc10x$ALL <- "ALL"
results <- scPC(sc10x,pc=100,hpc=0.9,file="pre.stress",print="2")
sc10x <- results[[1]]
......@@ -71,17 +61,11 @@ genes.stress <- read_delim("./genesets/genes.deg.Stress.csv",",",escape_double=F
genes.stress <- genes.stress[1]
colnames(genes.stress) <- "scDWS.Stress"
results <- scScore(sc10x,score="Stress",geneset=as.list(genes.stress),cut.pt=0.9,anchor=c("EGR1","FOS","JUN"))
results <- scScore(sc10x,score="Stress",geneset=as.list(genes.stress),cut.pt="tri",anchor=c("EGR1","FOS","JUN"))
sc10x.preStress <- results[[1]]
sc10x <- results[[2]]
rm(results)
# sc10x <- FindVariableFeatures(sc10x,verbose=FALSE)
#
# gc()
# sc10x <- ScaleData(object=sc10x,vars.to.regress=c("nFeature_RNA","percent.mito","S.Score","G2M.Score"),do.par=TRUE,num.cores=45,verbose=FALSE)
# # sc10x <- ScaleData(object=sc10x,vars.to.regress=c("nFeature_RNA","percent.mito"),do.par=TRUE,num.cores=45,verbose=FALSE)
# gc()
counts.cell.destress <- as.list(table(sc10x$samples))
results <- scPC(sc10x,pc=100,hpc=0.9,file="post.stress",print="2")
sc10x <- results[[1]]
......@@ -91,5 +75,7 @@ rm(results)
res <- c(seq(0.1,0.5,0.1),0.75,seq(1,5,1))
sc10x <- scCluster(sc10x,res=res,red="pca",dim=pc.use.poststress,print="2",folder="ALL")
DefaultAssay(object=sc10x) <- "SCT"
save(sc10x,file=paste0("./analysis/sc10x.raw.rda"))
save.image(file="./analysis/sc10x.raw.RData")
This diff is collapsed.
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