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.

estimateSizeFactors(object, ...)

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

Arguments

object

Object.

type

character(1). Method for estimation:

libSize <- colSums(counts(object))
  • mean-ratio:

    libSize / mean(libSize)
    
  • geometric-mean-ratio:

    libSize / geometricMean(libSize)
    
  • mean-geometric-mean-log-total:

    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.

Value

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

Details

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).

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<-().

Note

Updated 2021-09-02.

See also

DESeq2:

  • DESeq2::estimateSizeFactors().

  • DESeq2::estimateSizeFactorsForMatrix().

scater:

monocle3:

Examples

data(RangedSummarizedExperiment, package = "AcidTest") ## SummarizedExperiment ==== object <- RangedSummarizedExperiment object <- estimateSizeFactors(object)
#> → Calculating library size factors using "mean-ratio" method defined in `type`.
#> → Centering size factors at 1.
sizeFactors(object)
#> sample01 sample02 sample03 sample04 sample05 sample06 sample07 sample08 #> 0.8884556 0.8875975 0.8836681 0.9034507 0.9048508 0.9085092 1.1208786 1.0951793 #> sample09 sample10 sample11 sample12 #> 1.0824877 1.1253500 1.0873205 1.1122520