Quality control metrics

metrics(object, ...)

# S4 method for SummarizedExperiment
metrics(object, return = c("tbl_df", "DataFrame"))

Arguments

object

Object.

return

character(1). Return type. Uses match.arg() internally and defaults to the first argument in the character vector.

...

Additional arguments.

Value

Object of class determined by return argument.

Details

metrics() takes data stored in colData() and consistently returns a tbl_df or DataFrame with sampleName and interestingGroups columns, even when these columns are not defined in colData(). This is designed to integrate with plotting functions that use ggplot2 internally.

Column names are always returned formatted in strict lower camel case.

This function will error intentionally if no numeric columns are defined in colData().

Functions

  • metrics,SummarizedExperiment-method: Sample-level metrics.

Note

Updated 2021-02-05.

Author

Michael Steinbaugh, Rory Kirchner

Examples

data(RangedSummarizedExperiment, package = "AcidTest") ## SummarizedExperiment ==== object <- RangedSummarizedExperiment object <- calculateMetrics(object)
#> → Calculating 12 sample metrics.
#> 497 coding features detected.
#> 0 mitochondrial features detected.
x <- metrics(object) print(x)
#> # A tibble: 12 × 10 #> sampleId condition nCount nFeature nCoding nMito log10FeaturesPerC… mitoRatio #> <chr> <fct> <int> <int> <int> <int> <dbl> <dbl> #> 1 sample01 A 19671 457 19617 NA 0.619 NA #> 2 sample02 A 19652 457 19519 NA 0.620 NA #> 3 sample03 A 19565 453 19505 NA 0.619 NA #> 4 sample04 A 20003 449 19919 NA 0.617 NA #> 5 sample05 A 20034 452 19936 NA 0.617 NA #> 6 sample06 A 20115 456 19992 NA 0.618 NA #> 7 sample07 B 24817 453 24728 NA 0.604 NA #> 8 sample08 B 24248 451 24089 NA 0.605 NA #> 9 sample09 B 23967 437 23817 NA 0.603 NA #> 10 sample10 B 24916 457 24814 NA 0.605 NA #> 11 sample11 B 24074 454 23854 NA 0.606 NA #> 12 sample12 B 24626 447 24467 NA 0.604 NA #> # … with 2 more variables: sampleName <fct>, interestingGroups <fct>