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.
Source:R/AllGenerics.R
, R/estimateSizeFactors-methods.R
estimateSizeFactors.Rd
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 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."mean-ratio"
:"geometric-mean-ratio"
:"log-geometric-mean-ratio"
:- 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 to0
to disable centering.- ...
Additional arguments.
Value
Modified object.
Use sizeFactors()
to access the computed size factor numeric.
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<-()
.
See also
DESeq2:
DESeq2::estimateSizeFactors()
.DESeq2::estimateSizeFactorsForMatrix().
scuttle (now inherited in scater):
monocle3:
monocle3::estimate_size_factors()
.monocle3:::estimate_sf_sparse()
.
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