Commit 33b034b3 authored by Gervaise Henry's avatar Gervaise Henry 🤠
Browse files

Use Pd deep for ID

parent 087770ca
......@@ -9,6 +9,7 @@
#SBATCH --mail-user gervaise.henry@utsouthwestern.edu
rm ../analysis/*.rda
rm ../analysis/*.rds
rm ../analysis/*.RData
rm -r ../analysis/cor/
rm -r ../analysis/qc/
......@@ -18,26 +19,7 @@ rm -r ../analysis/vis/
module load python/3.6.4-anaconda
source activate umap
module load R/3.5.1-gccmkl
module load R/3.6.1-gccmkl
module load hdf5_18/1.8.17
Rscript ../r.scripts/sc-TissueMapper_RUN.R --p "$1" --s "$2"
module unload R/3.5.1-gccmkl
module load R/3.6.1-gccmkl
if [[ "$1" == "huPr_PdPgb" ]] || [[ "$1" == "huPr_PdPb" ]] || [[ "$1" == "huBl" ]]
then
Rscript ../r.scripts/SingleR.R --p "$1" --s "$2" --o "$3"
elif [[ "$1" == "muPrUr" ]]
then
Rscript ../r.scripts/huPr_muPr.R --p "$1" --r "$3"
fi
module unload R/3.5.1-gccmkl
module load R/3.6.1-gccmkl
if [[ "$1" == "huPr_PdPgb" ]]
then
Rscript ../r.scripts/diy_PdPgb.R
elif [[ "$1" == "muPrUr" ]]
then
Rscript ../r.scripts/diy_muPrUr_Epi.R
fi
Rscript ../r.scripts/SingleR.R --p "$1" --s "$2" --o "$3"
......@@ -19,7 +19,7 @@ library(ggplot2)
options(bitmapType="cairo")
option_list=list(
make_option("--p",action="store",default="Biopsy",type='character',help="Project Name"),
make_option("--p",action="store",default="huPr_Pd",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")
)
......@@ -46,21 +46,21 @@ if (opt$s == "hu"){
}
if (opt$o == "pr" && opt$s == "hu"){
load("./genesets/Pd.shallow.Rda")
ref <- readRDS("/work/urology/ghenry/RNA-Seq/SingleCell/ANALYSIS/REF/huPr_Pd_all.rds")
try(
if (as.numeric(substring(sc10x@version,1,1))<3){
sc10x <- UpdateSeuratObject(sc10x)
if (as.numeric(substring(ref@version,1,1))<3){
ref <- UpdateSeuratObject(ref)
}
)
scDWSpr.se <- as.SingleCellExperiment(sc10x,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(sc10x)
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)
}
load("./analysis/sc10x.raw.rda")
sc10x <- readRDS("./analysis/sc10x.raw.rds")
sc10x.se <- as.SingleCellExperiment(sc10x)
common <- intersect(rownames(sc10x.se),rownames(lin.se))
......@@ -98,14 +98,14 @@ 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$Lin=="Epi",]
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$Merge_Epi.dws_St.go %in% c("Fib","SM"),]
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,]
......
......@@ -186,7 +186,9 @@ DefaultAssay(object=sc10x) <- "SCT"
#scShinyOutput(sc10x,anal="raw")
saveRDS(sc10x,paste0("/project/urology/Strand_lab/shared/cellxgene/seurat/",project.name,"_raw.rds"))
sc10x@meta.data <- sc10x@meta.data[,c("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/",project.name,"_raw.rds"))
#save(sc10x,file=paste0("./analysis/sc10x.raw.rda"))
save.image(file="./analysis/sc10x.raw.RData")
......@@ -194,3 +196,4 @@ library(sceasy)
library(reticulate)
use_condaenv('sceasy')
convertFormat(sc10x,from="seurat",to="anndata",outFile=paste0("/project/urology/Strand_lab/shared/cellxgene/anndata/",project.name,"_raw.h5ad"),assay="SCT",main_layer="scale.data")
saveRDS(sc10x,paste0("/project/urology/Strand_lab/shared/cellxgene/seurat/",project.name,"_raw.rds"))
\ 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