estimateSizeFactors {DESeq2}R Documentation

Estimate the size factors for a DESeqDataSet

Description

Estimate the size factors for a DESeqDataSet

Usage

## S4 method for signature 'DESeqDataSet'
estimateSizeFactors(object,locfunc=median,geoMeans)

## S4 method for signature 'DESeqDataSet'
estimateSizeFactors(object, locfunc = median,
  geoMeans)

Arguments

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 shorth function from the genefilter package may give better results.

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

Details

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.

Value

The DESeqDataSet passed as parameters, with the size factors filled in.

Author(s)

Simon Anders

References

See Also

estimateSizeFactorsForMatrix

Examples

dds <- makeExampleDESeqDataSet()
dds <- estimateSizeFactors(dds)
sizeFactors(dds)
geoMeans <- exp(rowMeans(log(counts(dds))))
dds <- estimateSizeFactors(dds,geoMeans=geoMeans)
sizeFactors(dds)

[Package DESeq2 version 1.4.5 Index]