summarizedCounts {aggregateBioVar} | R Documentation |
Given an input sparse count matrix and corresponding column metadata, aggregate gene counts by subject level. Metadata variables with only inter-subject variation are retained; any variables with cell-level variation within a subject are dropped (e.g. feature / RNA count by cell).
summarizedCounts(scExp, subjectVar)
scExp |
SingleCellExperiment object containing (at minimum) gene counts and column metadata describing sample identifiers and cell types. |
subjectVar |
Metadata column name assigning biological sample identity to aggregate within-subject feature counts. |
SummarizedExperiment object with feature counts aggregated by subject and summarized inter-subject metadata.
## Construct SummarizedExperiment object with gene-by-subject count matrix ## and column metadata summarized to exclude intrasubject variation. ## See `SummarizedExperiment` accessor functions `assay()` and `colData()` ## to access the count matrix and column metadata for downstream analyses. summarizedCounts(scExp=small_airway, subjectVar="orig.ident")