Learn R Programming

scater (version 1.0.4)

getExprs: Retrieve a representation of gene expression

Description

Gene expression can be summarised in a variety of ways, e.g. as TPM, FPKM or as raw counts. Many internal methods and external packages rely on accessing a generic representation of expression without worrying about the particulars. Scater allows the user to set object@useForExprs to the preferred type (either "exprs", "TPM", "fpkm" or "counts") and that particular representation will be returned by calls to getExprs. Note if such representation is not defined, this method returns NULL.

Usage

getExprs(object)

Arguments

object
An object of type SCESet

Value

A matrix representation of expression corresponding to object@useForExprs.

Examples

Run this code
data("sc_example_counts")
data("sc_example_cell_info")
pd <- new("AnnotatedDataFrame", data = sc_example_cell_info)
example_sceset <- newSCESet(countData = sc_example_counts, phenoData = pd, useForExprs = "exprs")
all(exprs(example_sceset) == getExprs(example_sceset)) # TRUE
example_sceset <- newSCESet(countData = sc_example_counts, phenoData = pd, useForExprs = "counts")
all(exprs(example_sceset) == getExprs(example_sceset)) # FALSE
all(counts(example_sceset) == getExprs(example_sceset)) # TRUE

Run the code above in your browser using DataLab