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

an SingleCellExperiment object containing multiple 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 SingleCellExperiment object with centred size factors

Examples

data("sc_example_counts")
data("sc_example_cell_info")
example_sce <- SingleCellExperiment(
assays = list(counts = sc_example_counts), colData = sc_example_cell_info)
keep_gene <- rowSums(counts(example_sce)) > 0
example_sce <- example_sce[keep_gene,]

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


[Package scater version 1.6.3 Index]