nexprs: Count the number of non-zero counts per cell or feature

nexprsR Documentation

Count the number of non-zero counts per cell or feature

Description

Counting the number of non-zero counts in each row (per feature) or column (per cell).

Usage

nexprs(x, ...)

## S4 method for signature 'ANY'
nexprs(
  x,
  byrow = FALSE,
  detection_limit = 0,
  subset_row = NULL,
  subset_col = NULL,
  BPPARAM = SerialParam()
)

## S4 method for signature 'SummarizedExperiment'
nexprs(x, ..., exprs_values = "counts", assay.type = exprs_values)

Arguments

x

A numeric matrix of counts where features are rows and cells are columns.

Alternatively, a SummarizedExperiment containing such counts.

...

For the generic, further arguments to pass to specific methods.

For the SummarizedExperiment method, further arguments to pass to the ANY method.

byrow

Logical scalar indicating whether to count the number of detected cells per feature. If FALSE, the function will count the number of detected features per cell.

detection_limit

Numeric scalar providing the value above which observations are deemed to be expressed.

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. Only relevant when x is a DelayedMatrix.

exprs_values

Alias for assay.type.

assay.type

String or integer specifying the assay of x to obtain the count matrix from (also the alias exprs_values is accepted for this argument).

Value

An integer vector containing counts per gene or cell, depending on the provided arguments.

Author(s)

Aaron Lun

See Also

numDetectedAcrossFeatures and numDetectedAcrossCells, to do this calculation for each group of features or cells, respectively.

Examples

example_sce <- mockSCE()

nexprs(example_sce)[1:10]
nexprs(example_sce, byrow = TRUE)[1:10]


Alanocallaghan/scater documentation built on July 18, 2024, 10:58 p.m.