areSizeFactorsCentred: Check if the size factors are centred at unity

Description Usage Arguments Value Examples

View source: R/normalisation.R

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

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

Arguments

object

an SCESet 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 SCESet object with centred size factors

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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,]

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

dynverse/scaterlegacy documentation built on Feb. 17, 2020, 5:07 a.m.