View source: R/aggregateAcrossFeatures.R
aggregateAcrossFeatures | R Documentation |
Sum together expression values (by default, counts) for each feature set in each cell of a SummarizedExperiment object.
aggregateAcrossFeatures(
x,
ids,
...,
use.assay.type = "counts",
use_exprs_values = NULL
)
x |
A SummarizedExperiment containing an expression matrix. |
ids |
A factor of length Alternatively, a list of integer or character vectors, where each vector specifies the indices or names of features in a set. Logical vectors are also supported. |
... |
Further arguments to be passed to |
use.assay.type |
A character or integer vector specifying the assay(s) of |
use_exprs_values |
Soft-deprecated equivalent of |
A SummarizedExperiment of the same class as x
is returned,
containing summed matrices generated by sumCountsAcrossFeatures
on all assays in use.assay.type
.
If ids
is a factor, row metadata is retained for the first instance of a feature from each set in ids
.
This behavior assumes that ids
specifies duplicates of the same gene, such that the first instance is a reasonable choice.
If ids
is a list, row metadata is simply discarded.
This behavior assumes that ids
specifies gene sets such that any existing gene-level metadata is meaningless.
Aaron Lun
sumCountsAcrossFeatures
, which does the heavy lifting.
example_sce <- mockSCE()
ids <- sample(LETTERS, nrow(example_sce), replace=TRUE)
aggr <- aggregateAcrossFeatures(example_sce, ids)
aggr
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.