countsBySubject {aggregateBioVar} | R Documentation

## Gene-by-subject count matrix

### Description

Convert gene-by-cell count matrix to gene-by-subject count matrix. Row sums are calculated for each feature (i.e. gene) across cells by subject.

### Usage

    countsBySubject(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

S4 DataFrame of gene-by-subject count sums.

### See Also

`scSubjects` for `subjects` values.

### Examples

    ## Return cell count matrix aggregated by subject.
    countsBySubject(scExp=small_airway, subjectVar="orig.ident")

[Package aggregateBioVar version 1.0.0 Index]