summarizedCounts {aggregateBioVar} | R Documentation

## Aggregate feature counts and metadata by subject

### Description

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

### Usage

    summarizedCounts(scExp, subjectVar)

### Arguments

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

### Value

SummarizedExperiment object with feature counts aggregated by subject and summarized inter-subject metadata.

### Examples

    ## 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")

[Package aggregateBioVar version 1.0.0 Index]