estimateSizeFactorsForMatrix {DESeq2} | R Documentation |
Given a matrix or data frame of count data, this function
estimates the size factors as follows: Each column is
divided by the geometric means of the rows. The median (or,
if requested, another location estimator) of these ratios
(skipping the genes with a geometric mean of zero) is used
as the size factor for this column. Typically, you will not
call this function directly, but use
estimateSizeFactors
.
estimateSizeFactorsForMatrix(counts, locfunc = median, geoMeans)
counts |
a matrix or data frame of counts, i.e., non-negative integer values |
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 |
a vector with the estimates size factors, one element per column
Simon Anders
dds <- makeExampleDESeqDataSet() estimateSizeFactorsForMatrix(counts(dds)) geoMeans <- exp(rowMeans(log(counts(dds)))) estimateSizeFactorsForMatrix(counts(dds),geoMeans=geoMeans)