countsBySubject {aggregateBioVar} | R Documentation |
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.
countsBySubject(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. |
S4 DataFrame of gene-by-subject count sums.
scSubjects
for subjects
values.
## Return cell count matrix aggregated by subject. countsBySubject(scExp=small_airway, subjectVar="orig.ident")