Commit 67631d03 authored by Gervaise Henry's avatar Gervaise Henry 🤠
Browse files

Update species difference for mito gene detection

parent 730114a6
......@@ -21,16 +21,16 @@ setwd("../")
source("./r.scripts/sc-TissueMapper_functions.R")
source("./r.scripts/sc-TissueMapper_process.R")
project.name="PdPbPc"
project.name="musAdPrF"
scFolders()
sc10x <- scLoad(p=project.name,cellranger=2,ref="GRCh38")
sc10x <- scLoad(p=project.name,cellranger=3,ref="mm10")
lg=500
hg=3000
hm=0.05
results <- scQC(sc10x,lg=lg,hg=hg,hm=hm,sub=FALSE)
results <- scQC(sc10x,lg=lg,hg=hg,hm=hm,sub=FALSE,sp="mus")
sc10x <- results[[1]]
counts.cell.raw <- results[[2]]
counts.gene.raw <- results[[3]]
......
......@@ -110,7 +110,7 @@ scSubset <- function(sc10x,i="ALL",g="ALL"){
}
scQC <- function(sc10x,lg=500,hg=2500,hm=0.1,sub=FALSE){
scQC <- function(sc10x,lg=500,hg=2500,hm=0.1,sub=FALSE,sp="hu"){
#QC and filter Seurat object
#Inputs:
......@@ -137,7 +137,11 @@ scQC <- function(sc10x,lg=500,hg=2500,hm=0.1,sub=FALSE){
}}
#Calculate stats
mito.genes <- grep(pattern="^MT-",x=rownames(x=GetAssayData(object=sc10x)),value=TRUE)
if (sp=="hu"){
mito.genes <- grep(pattern="^MT-",x=rownames(x=GetAssayData(object=sc10x)),value=TRUE)
} else {
mito.genes <- grep(pattern="^mt-",x=rownames(x=GetAssayData(object=sc10x)),value=TRUE)
}
percent.mito <- Matrix::colSums(GetAssayData(object=sc10x,slot="counts")[mito.genes,])/Matrix::colSums(GetAssayData(object=sc10x,slot="counts"))
sc10x$percent.mito <- percent.mito
......
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