calculateQCMetrics defunct, how to calculate the quality metrics by perCellQCMetrics

Bioinformatics Asked by Yach on May 4, 2021

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(
   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(
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.

2 Answers

It would be helpful if you can provide the error message. Guessing from your codes, it's possible that the alternative experiments weren't set correctly. My suggestion:

altExp(sce, "spike-in") <- SummarizedExperiment(assays=list(counts=as.matrix(SpikeIn)))
altExp(sce, "MTgenes") <- SummarizedExperiment(assays=list(counts=as.matrix(MTgenes)))

If you're using altExp, the subsets argument in perCellQCMetrics is unnecessary in this case.


Answered by mattcwh on May 4, 2021

Ok I have figured it out and I am sharing this in case anyone can get help. I used

sce <-addPerCellQC(sce)

which calculated the QC for all the altexps also and adds them to the colData.

Answered by Abhay on May 4, 2021

Add your own answers!

Related Questions

Block wise protein imputation

2  Asked on March 23, 2021 by whateversclever


RAD Seq Data Analysis without barcode

2  Asked on March 20, 2021 by biobash


FASTA and PDB: How to specify chain?

2  Asked on March 19, 2021 by lazer-guided-lazerbeam


How can I use my Myheritage DNA results file for further analysis?

1  Asked on March 19, 2021 by user3390486


Within and between sample count normalization

1  Asked on March 16, 2021 by maxno3


Too slow issue of BioMart

1  Asked on March 12, 2021 by user224050


Obtaining Whole Genetic Sequence

2  Asked on March 11, 2021


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir