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

Description Usage Arguments Value Author(s) See Also Examples

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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")

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

String or integer specifying the assay of x to obtain the count matrix from.

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

1
2
3
4
example_sce <- mockSCE()

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

scater documentation built on Feb. 28, 2021, 2:01 a.m.