summarizedCounts: Aggregate feature counts and metadata by subject

Description Usage Arguments Value Examples

View source: R/summarize_counts.R

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

1
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

1
2
3
4
5
## 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")

aggregateBioVar documentation built on Nov. 8, 2020, 7:46 p.m.