nexprs: Count the number of expressed genes per cell

Description Usage Arguments Value Examples

View source: R/calculate-expression.R

Description

An efficient internal function that avoids the need to construct 'is_exprs_mat' by counting the number of expressed genes per cell on the fly.

Usage

1
2
nexprs(object, lowerDetectionLimit = NULL, exprs_values = NULL,
  byrow = FALSE, subset_row = NULL, subset_col = NULL)

Arguments

object

an SCESet object

lowerDetectionLimit

numeric scalar providing the value above which observations are deemed to be expressed. Defaults to object@lowerDetectionLimit.

exprs_values

character scalar indicating whether the count data ("counts"), the transformed expression data ("exprs"), transcript-per-million ("tpm"), counts-per-million ("cpm") or FPKM ("fpkm") should be used to define if an observation is expressed or not. Defaults to the first available value of those options in the order shown. However, if is_exprs(object) is present, it will be used directly; exprs_values and lowerDetectionLimit are ignored.

byrow

logical scalar indicating if TRUE to count expressing cells per feature (i.e. gene) and if FALSE to count expressing features (i.e. genes) per cell.

subset_row

logical, integeror character vector indicating which rows (i.e. features/genes) to use when calculating the number of expressed features in each cell, when byrow=FALSE.

subset_col

logical, integer or character vector indicating which columns (i.e., cells) to use to calculate the number of cells expressing each gene when byrow=TRUE.

Value

a numeric vector of the same length as the number of features if byrow argument is TRUE and the same length as the number of cells if byrow is FALSE

Examples

1
2
3
4
5
6
7
data("sc_example_counts")
data("sc_example_cell_info")
pd <- new("AnnotatedDataFrame", data=sc_example_cell_info)
rownames(pd) <- pd$Cell
example_sceset <- newSCESet(countData=sc_example_counts, phenoData=pd)
nexprs(example_sceset)[1:10]
nexprs(example_sceset, byrow = TRUE)[1:10]

scater documentation built on May 31, 2017, 3:08 p.m.