Skip to content
Snippets Groups Projects
Commit 8482bc0d authored by Gervaise Henry's avatar Gervaise Henry :cowboy:
Browse files

Fix DPrF analysis to use correct CCA code and make separate r.scripts for 2...

Fix DPrF analysis to use correct CCA code and make separate r.scripts for 2 and 3 patient aggregation
parent bf696392
No related merge requests found
...@@ -100,12 +100,12 @@ option_list=list( ...@@ -100,12 +100,12 @@ option_list=list(
make_option("--st",action="store",default="TRUE",type='logical',help="Remove stressed cells?"), make_option("--st",action="store",default="TRUE",type='logical',help="Remove stressed cells?"),
make_option("--stg",action="store",default="dws",type='character',help="Geneset to use for stress ID"), make_option("--stg",action="store",default="dws",type='character',help="Geneset to use for stress ID"),
#make_option("--hpc.poststress",action="store",default=0.85,type='numeric',help="Max variance cutoff for PCs to use, post-stress"), #make_option("--hpc.poststress",action="store",default=0.85,type='numeric',help="Max variance cutoff for PCs to use, post-stress"),
make_option("--res.poststress",action="store",default=0.2,type='numeric',help="Resolution to cluster, post-stress"), make_option("--res.poststress",action="store",default=0.1,type='numeric',help="Resolution to cluster, post-stress"),
make_option("--ds",action="store",default=0,type='integer',help="Number of cells to downsample"), make_option("--ds",action="store",default=50000,type='integer',help="Number of cells to downsample"),
#make_option("--hpc.epi",action="store",default=0.85,type='numeric',help="Max variance cutoff for PCs to use, Epi"), #make_option("--hpc.epi",action="store",default=0.85,type='numeric',help="Max variance cutoff for PCs to use, Epi"),
make_option("--res.epi",action="store",default=0.2,type='numeric',help="Resolution to cluster, Epi"), make_option("--res.epi",action="store",default=0.1,type='numeric',help="Resolution to cluster, Epi"),
#make_option("--hpc.st",action="store",default=0.85,type='numeric',help="Max variance cutoff for PCs to use, St"), #make_option("--hpc.st",action="store",default=0.85,type='numeric',help="Max variance cutoff for PCs to use, St"),
make_option("--res.st",action="store",default=0.2,type='numeric',help="Resolution to cluster, St") make_option("--res.st",action="store",default=0.1,type='numeric',help="Resolution to cluster, St")
) )
opt=parse_args(OptionParser(option_list=option_list)) opt=parse_args(OptionParser(option_list=option_list))
rm(option_list) rm(option_list)
...@@ -154,13 +154,14 @@ rm(results) ...@@ -154,13 +154,14 @@ rm(results)
rm(sc10x.D17) rm(sc10x.D17)
rm(sc10x.D27) rm(sc10x.D27)
results <- scPC(sc10x,lx=opt$lx,hx=opt$hx,ly=opt$ly,cc=opt$cc,pc=opt$pc,hpc=opt$hpc,file="pre.stress",cca=TRUE) #results <- scPC(sc10x,lx=opt$lx,hx=opt$hx,ly=opt$ly,cc=opt$cc,pc=opt$pc,hpc=opt$hpc,file="pre.stress",cca=TRUE)
sc10x <- results[[1]] #sc10x <- results[[1]]
genes.hvg <- results[[2]] #genes.hvg <- results[[2]]
pc.use <- results[[3]] #pc.use <- results[[3]]
rm(results) #rm(results)
sc10x <- scCluster(sc10x,pc.use=pc.use,res.use=opt$res.prestress,folder="pre.stress") pc.use <- 25
sc10x <- scCluster(sc10x,pc.use=pc.use,res.use=opt$res.prestress,folder="pre.stress",red="cca.aligned")
if (opt$st==TRUE){ if (opt$st==TRUE){
results <- scStress(sc10x,stg=opt$stg,res.use=opt$res.prestress,pc.use=pc.use) results <- scStress(sc10x,stg=opt$stg,res.use=opt$res.prestress,pc.use=pc.use)
...@@ -169,13 +170,13 @@ if (opt$st==TRUE){ ...@@ -169,13 +170,13 @@ if (opt$st==TRUE){
sc10x.Stress <- results[[3]] sc10x.Stress <- results[[3]]
rm(results) rm(results)
results <- scPC(sc10x,lx=opt$lx,hx=opt$hx,ly=opt$ly,cc=opt$cc,pc=opt$pc,hpc=opt$hpc,file="post.stress") #results <- scPC(sc10x,lx=opt$lx,hx=opt$hx,ly=opt$ly,cc=opt$cc,pc=opt$pc,hpc=opt$hpc,file="post.stress")
sc10x <- results[[1]] #sc10x <- results[[1]]
genes.hvg.poststress <- results[[2]] #genes.hvg.poststress <- results[[2]]
pc.use.poststress <- results[[3]] #pc.use.poststress <- results[[3]]
rm(results) #rm(results)
sc10x <- scCluster(sc10x,pc.use=pc.use.poststress,res.use=opt$res.poststress,folder="post.stress") sc10x <- scCluster(sc10x,pc.use=pc.use,res.use=opt$res.poststress,folder="post.stress",red="cca.aligned")
} }
gene.set1 <- read_delim("./genesets/genes.deg.St.csv",",",escape_double=FALSE,trim_ws=TRUE,col_names=TRUE) gene.set1 <- read_delim("./genesets/genes.deg.St.csv",",",escape_double=FALSE,trim_ws=TRUE,col_names=TRUE)
...@@ -203,7 +204,7 @@ if (any(levels(sc10x@ident)=="Unknown")){ ...@@ -203,7 +204,7 @@ if (any(levels(sc10x@ident)=="Unknown")){
sc10x.St <- scSubset(sc10x,i="Lin",g="St") sc10x.St <- scSubset(sc10x,i="Lin",g="St")
} }
sc10x.Epi <- scCluster(sc10x.Epi,pc.use=pc.use.poststress,res.use=opt$res.epi,folder="epi") sc10x.Epi <- scCluster(sc10x.Epi,pc.use=pc.use,res.use=opt$res.epi,folder="epi",red="cca.aligned")
gene.set1 <- read_delim("./genesets/genes.deg.BE.csv",",",escape_double=FALSE,trim_ws=TRUE,col_names=TRUE) gene.set1 <- read_delim("./genesets/genes.deg.BE.csv",",",escape_double=FALSE,trim_ws=TRUE,col_names=TRUE)
gene.set1 <- gene.set1[1] gene.set1 <- gene.set1[1]
...@@ -252,7 +253,7 @@ rm(gene.set1) ...@@ -252,7 +253,7 @@ rm(gene.set1)
results.cor.Epi.lgea <- scQuSAGEsm(sc10x.Epi,gs=gene.set,ds=opt$ds,nm="Epi.dws.sc",folder="lgea") results.cor.Epi.lgea <- scQuSAGEsm(sc10x.Epi,gs=gene.set,ds=opt$ds,nm="Epi.dws.sc",folder="lgea")
rm(gene.set) rm(gene.set)
sc10x.St <- scCluster(sc10x.St,pc.use=pc.use.poststress,res.use=opt$res.epi,folder="st") sc10x.St <- scCluster(sc10x.St,pc.use=pc.use,res.use=opt$res.epi,folder="st",red="cca.aligned")
gene.set1 <- read_delim("./genesets/genes.deg.Fib.csv",",",escape_double=FALSE,trim_ws=TRUE,col_names=TRUE) gene.set1 <- read_delim("./genesets/genes.deg.Fib.csv",",",escape_double=FALSE,trim_ws=TRUE,col_names=TRUE)
gene.set1 <- gene.set1[1] gene.set1 <- gene.set1[1]
......
This diff is collapsed.
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