| nexprs {scater} | R Documentation |
An efficient internal function that counts the number of non-zero counts in each row (per feature) or column (per cell). This avoids the need to construct an intermediate logical matrix.
nexprs(object, detection_limit = 0, exprs_values = "counts", byrow = FALSE, subset_row = NULL, subset_col = NULL, BPPARAM = SerialParam())
object |
A SingleCellExperiment object or a numeric matrix of expression values. |
detection_limit |
Numeric scalar providing the value above which observations are deemed to be expressed. |
exprs_values |
String or integer specifying the assay of |
byrow |
Logical scalar indicating whether to count the number of detected cells per feature.
If |
subset_row |
Logical, integer or character vector indicating which rows (i.e. features) to use. |
subset_col |
Logical, integer or character vector indicating which columns (i.e., cells) to use. |
BPPARAM |
A BiocParallelParam object specifying whether the calculations should be parallelized. |
Setting subset_row or subset_col is equivalent to subsetting object before calling nexprs,
but more efficient as a new copy of the matrix is not constructed.
An integer vector containing counts per gene or cell, depending on the provided arguments.
data("sc_example_counts")
data("sc_example_cell_info")
example_sce <- SingleCellExperiment(
assays = list(counts = sc_example_counts),
colData = sc_example_cell_info)
nexprs(example_sce)[1:10]
nexprs(example_sce, byrow = TRUE)[1:10]