areSizeFactorsCentred {scater}R Documentation

Check if the size factors are centred at unity

Description

Checks if each set of size factors is centred at unity, such that abundances can be reasonably compared between features normalized with different sets of size factors.

Usage

areSizeFactorsCentred(object, centre = 1, tol = 1e-06)

Arguments

object

A SingleCellExperiment object containing any number of (or zero) sets of size factors.

centre

a numeric scalar, the value around which all sets of size factors should be centred.

tol

a numeric scalar, the tolerance for testing equality of the mean of each size factor set to centre.

Value

A logical scalar indicating whether all sets of size factors are centered. If no size factors are available, TRUE is returned.

Author(s)

Aaron Lun

See Also

centreSizeFactors

Examples

data("sc_example_counts")
data("sc_example_cell_info")
example_sce <- SingleCellExperiment(
    assays = list(counts = sc_example_counts), 
    colData = sc_example_cell_info
)

sizeFactors(example_sce) <- runif(ncol(example_sce))
areSizeFactorsCentred(example_sce)
example_sce <- normalize(example_sce, centre = TRUE)
areSizeFactorsCentred(example_sce)


[Package scater version 1.8.4 Index]