estimateSizeFactors: Define size factors from the library sizes, and then apply...

estimateSizeFactorsR Documentation

Define size factors from the library sizes, and then apply centering at unity. This ensures that the library size adjustment yields values comparable to those generated after normalization with other sets of size factors.

Description

Centering of size factors at unity ensures that division by size factors yields values on the same scale as the raw counts. This is important for the interpretation of the normalized values, as well as comaprisons between features normalized with different size factors (e.g., spike-ins).

Usage

estimateSizeFactors(object, ...)

## S4 method for signature 'SummarizedExperiment'
estimateSizeFactors(
  object,
  assay = 1L,
  type = c("mean-ratio", "geometric-mean-ratio", "log-geometric-mean-ratio"),
  center = 1L
)

Arguments

object

Object.

assay

vector(1). Assay name or index position.

type

character(1). Type of method for estimation.

libSize <- colSums(counts(object))

"mean-ratio":

libSize / mean(libSize)

"geometric-mean-ratio":

libSize / geometricMean(libSize)

"log-geometric-mean-ratio":

log(libSize) / geometricMean(log(libSize))
center

numeric(1). If non-zero, scales all size factors so that the average size factor across cells is equal to the value defined. Set to 0 to disable centering.

...

Additional arguments.

Details

The estimated size factors computed by this function can be accessed using the accessor function sizeFactors(). Alternative library size estimators can also be supplied using the assignment function ⁠sizeFactors<-()⁠.

Value

Modified object. Use sizeFactors() to access the computed size factor numeric.

Note

Updated 2023-10-04.

See Also

DESeq2:

  • DESeq2::estimateSizeFactors().

  • ⁠DESeq2::estimateSizeFactorsForMatrix().⁠

scuttle (now inherited in scater):

  • scuttle::librarySizeFactors().

  • scuttle::logNormCounts().

monocle3:

  • monocle3::estimate_size_factors().

  • monocle3:::estimate_sf_sparse().

Examples

data(RangedSummarizedExperiment, package = "AcidTest")

## SummarizedExperiment ====
object <- RangedSummarizedExperiment
object <- estimateSizeFactors(object)
sizeFactors(object)

acidgenomics/r-acidexperiment documentation built on Jan. 17, 2024, 7:56 p.m.