| estimateSizeFactors {DESeq2} | R Documentation |
Estimate the size factors for a DESeqDataSet
## S4 method for signature 'DESeqDataSet' estimateSizeFactors(object,locfunc=median,geoMeans) ## S4 method for signature 'DESeqDataSet' estimateSizeFactors(object, locfunc = median, geoMeans)
object |
a DESeqDataSet |
locfunc |
a function to compute a location for a
sample. By default, the median is used. However,
especially for low counts, the
|
geoMeans |
by default this is not provided and the geometric means of the counts are calculated within the function. A vector of geometric means from another count matrix can be provided for a "frozen" size factor calculation |
This function estimates the size factors using the "median
ratio method" described by Equation 5 in Ander and Huber
(2010). The estimated size factors can be accessed using
sizeFactors. Alternative library size
estimators can also be supplied using
sizeFactors.
Typically, the function is called with the idiom:
dds <- estimateSizeFactors(dds)
See DESeq for a description of the use of
size factors in the GLM. You need to call this function
after DESeqDataSet unless you have manually
specified sizeFactors. Alternatively,
gene-specific normalization factors for each sample can be
provided using normalizationFactors which
will always preempt sizeFactors in
calculations.
Internally, the function calls
estimateSizeFactorsForMatrix, which provides
more details on the calculation.
The DESeqDataSet passed as parameters, with the size factors filled in.
Simon Anders
Simon Anders, Wolfgang Huber: Differential expression analysis for sequence count data. Genome Biology 11 (2010) R106, http://dx.doi.org/10.1186/gb-2010-11-10-r106
dds <- makeExampleDESeqDataSet() dds <- estimateSizeFactors(dds) sizeFactors(dds) geoMeans <- exp(rowMeans(log(counts(dds)))) dds <- estimateSizeFactors(dds,geoMeans=geoMeans) sizeFactors(dds)