Skip to contents

Calculate quality control metrics

Usage

calculateMetrics(object, ...)

# S4 method for Matrix
calculateMetrics(object, rowData = NULL, prefilter = FALSE)

# S4 method for SummarizedExperiment
calculateMetrics(object, assay = 1L, prefilter = FALSE)

# S4 method for matrix
calculateMetrics(object, rowData = NULL, prefilter = FALSE)

Arguments

object

Object.

rowData

DataFrame. Metadata describing the assay rows, if genomic ranges are not available. Use rowRanges (GenomicRanges) instead, if possible.

prefilter

logical(1). Drop very low quality samples/cells from the object. This can resize the number of columns but the rows (i.e. features) do not change with this operation.

assay

vector(1). Assay name or index position.

...

Additional arguments.

Value

  • matrix / Matrix: DFrame containing metrics.

  • SummarizedExperiment: Modified object, with metrics in colData().

Details

Input a raw count matrix. Do not use size factor adjusted or log normalized counts here.

Note

Updated 2021-09-11.

Author

Michael Steinbaugh, Rory Kirchner

Examples

data(RangedSummarizedExperiment, package = "AcidTest")

## SummarizedExperiment ====
object <- RangedSummarizedExperiment
names(SummarizedExperiment::colData(object))
#> [1] "condition"
object <- calculateMetrics(object)
#> → Calculating 12 sample metrics.
#>  497 coding features detected.
#>  0 mitochondrial features detected.
names(SummarizedExperiment::colData(object))
#> [1] "condition"             "nCount"                "nFeature"             
#> [4] "nCoding"               "nMito"                 "log10FeaturesPerCount"
#> [7] "mitoRatio"