numDetectedAcrossCells {scater} | R Documentation |
Computes the number of detected expression values (default defined as non-zero counts) for each feature in each group of cells.
numDetectedAcrossCells(x, ...) ## S4 method for signature 'ANY' numDetectedAcrossCells( x, ids, subset_row = NULL, subset_col = NULL, average = FALSE, store_number = "ncells", detection_limit = 0, BPPARAM = SerialParam() ) ## S4 method for signature 'SummarizedExperiment' numDetectedAcrossCells(x, ..., exprs_values = "counts")
x |
A numeric matrix of counts containing features in rows and cells in columns. Alternatively, a SummarizedExperiment object containing such a count matrix. |
... |
For the generic, further arguments to pass to specific methods. For the SummarizedExperiment method, further arguments to pass to the ANY method. For the ANY method, further arguments to pass to the |
ids |
A factor specifying the group to which each cell in Alternatively, a DataFrame of such vectors or factors, in which case each unique combination of levels defines a group. |
subset_row |
An integer, logical or character vector specifying the features to use. Defaults to all features. For the SingleCellExperiment method, this argument will not affect alternative Experiments,
where aggregation is always performed for all features (or not at all, depending on |
subset_col |
An integer, logical or character vector specifying the cells to use.
Defaults to all cells with non- |
average |
Logical scalar indicating whether the proportion of non-zero counts in each group should be computed instead. |
store_number |
String specifying the field of the output |
detection_limit |
Numeric scalar providing the value above which observations are deemed to be expressed. |
BPPARAM |
A BiocParallelParam object specifying whether summation should be parallelized. |
exprs_values |
A string or integer scalar specifying the assay of |
A SummarizedExperiment is returned containing a count matrix in the first assay.
Each column corresponds to group as defined by a unique level or combination of levels in ids
.
Each entry of the matrix contains the number or proportion of cells with detected expression for a feature and group.
The identities of the levels for each column are reported in the colData
.
Aaron Lun
nexprs
, on which this function is based.
sumCountsAcrossCells
, which computes the sum of counts within a group.
example_sce <- mockSCE() ids <- sample(LETTERS[1:5], ncol(example_sce), replace=TRUE) bycol <- numDetectedAcrossCells(example_sce, ids) head(bycol)