scater (version 1.0.4)

normalize: Normalise an SCESet object using pre-computed size factors

Description

Compute normalised expression values from an SCESet object using the size factors stored in the object. Return the object with the normalised expression values added.

Usage

normalize.SCESet(object, exprs_values = "counts", logExprsOffset = NULL, recompute_cpm = TRUE, return_norm_as_exprs = TRUE)
"normalize"(object, exprs_values = "counts", logExprsOffset = NULL, recompute_cpm = TRUE, return_norm_as_exprs = TRUE)
normalise(...)

Arguments

object
an SCESet object.
exprs_values
character string indicating which slot of the assayData from the SCESet object should be used as expression values. Valid options are 'counts', the count values, 'exprs' the expression slot, 'tpm' the transcripts-per-million slot or 'fpkm' the FPKM slot.
logExprsOffset
scalar numeric value giving the offset to add when taking log2 of normalised values to return as expression values. If NULL (default), then the value from object@logExprsOffset is used.
recompute_cpm
logical, should the counts-per-million values be recomputed after normalising with the stored size factors in the object and stored in cpm(object) in the returned object?
return_norm_as_exprs
logical, should the normalised expression values be returned to the exprs slot of the object? Default is TRUE. If FALSE, values in the exprs slot will be left untouched. Regardless, normalised expression values will be returned in the norm_exprs(object) slot.
...
arguments passed to normalize when calling normalise.

Value

an SCESet object

Details

normalize is exactly the same as normalise, the option provided for those who have a preference for North American or British/Australian spelling.

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)
keep_gene <- rowSums(counts(example_sceset)) > 0
example_sceset <- example_sceset[keep_gene,]

## Apply TMM normalisation taking into account all genes
example_sceset <- normaliseExprs(example_sceset, method = "TMM")
## Scale counts relative to a set of control features (here the first 100 features)
example_sceset <- normaliseExprs(example_sceset, method = "none", 
feature_set = 1:100)

## normalize the object using the saved size factors
example_sceset <- normalize(example_sceset)

Run the code above in your browser using DataLab