I am trying to follow a tutorial from Sanger institute (from May 2019) on analysis of single cell RNA Seq data. They use calculateQCMetric function to calculate the quality metrics, but I am getting an error message that calculateQCMetric is a deprecated (isSpike function is also deprecated). I want to calculate the quality metrics. Can anyone provide code for getting QCMetric step? I attached the previous defunct code below:
umi <- calculateQCMetrics( umi, feature_controls = list( ERCC = isSpike(umi, "ERCC"), MT = isSpike(umi, "MT") )
And I use StupidWolf's code from this question isSpike function in SingleCellExperiment package is deprecated? to instead isSpike function. I also attached below:
Spikein_names = grep("^ERCC-",rownames(molecules),value=TRUE) SpikeIn = molecules[Spikein_names,] g = genes(EnsDb.Hsapiens.v86) MTgene_names = g[seqnames(g)=="MT"]$gene_id MTgenes = molecules[rownames(molecules) %in% MTgene_names,] Have a vector of genes to keep: keep = setdiff(rownames(molecules),c(SpikeIn,MTgenes)) Then make the single cell object: sce <- SingleCellExperiment( assays=list(counts=as.matrix(molecules[keep,])),colData=annotation) Use altExp to slot in the stuff: altExp(sce, "spike-in") <- SummarizedExperiment(SpikeIn) altExp(sce, "MTgenes") <- SummarizedExperiment(MTgenes)
I try the below code, which did not work.
> perCellQCMetrics(sce, subsets = list(Spikein_names,MTgene_names), flatten = TRUE, exprs_values = "counts"， use_altexps = TRUE)
Thanks in advance.