Quality control metrics
Details
metrics()
takes data stored in colData()
and consistently returns a
DFrame
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()
.
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)
#> DataFrame with 12 rows and 9 columns
#> condition nCount nFeature nCoding nMito
#> <factor> <integer> <integer> <integer> <integer>
#> sample01 A 19671 457 19617 NA
#> sample02 A 19652 457 19519 NA
#> sample03 A 19565 453 19505 NA
#> sample04 A 20003 449 19919 NA
#> sample05 A 20034 452 19936 NA
#> ... ... ... ... ... ...
#> sample08 B 24248 451 24089 NA
#> sample09 B 23967 437 23817 NA
#> sample10 B 24916 457 24814 NA
#> sample11 B 24074 454 23854 NA
#> sample12 B 24626 447 24467 NA
#> log10FeaturesPerCount mitoRatio sampleName interestingGroups
#> <numeric> <numeric> <factor> <factor>
#> sample01 0.619475 NA sample01 A
#> sample02 0.619535 NA sample02 A
#> sample03 0.618924 NA sample03 A
#> sample04 0.616644 NA sample04 A
#> sample05 0.617220 NA sample05 A
#> ... ... ... ... ...
#> sample08 0.605330 NA sample08 B
#> sample09 0.602903 NA sample09 B
#> sample10 0.605011 NA sample10 B
#> sample11 0.606419 NA sample11 B
#> sample12 0.603523 NA sample12 B