Commit d5bfc948 authored by Gervaise Henry's avatar Gervaise Henry 🤠
Browse files

Fix %mito calculation to use the data as sparse matrix so it will not cause memory error

parent 393ed35d
......@@ -122,7 +122,7 @@ 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)
percent.mito <- colSums(as.matrix(GetAssayData(object=sc10x,slot="counts")[mito.genes,]))/colSums(as.matrix(GetAssayData(object=sc10x,slot="counts")))
percent.mito <- Matrix::colSums(GetAssayData(object=sc10x,slot="counts")[mito.genes,])/Matrix::colSums(GetAssayData(object=sc10x,slot="counts"))
sc10x$percent.mito <- percent.mito
#Plot raw stats
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