estimateTagwiseDisp {edgeR}R Documentation

Estimate Empirical Bayes Tagwise Dispersion Values

Description

Estimates tagwise dispersion values by an empirical Bayes method based on weighted conditional maximum likelihood.

Usage

estimateTagwiseDisp(object, prior.n=getPriorN(object), trend="movingave", prop.used=0.3, method="grid", grid.length=200, tol=1e-06, verbose=FALSE)

Arguments

object

object of class DGEList containing (at least) the elements counts (table of raw counts), group (factor indicating group), lib.size (numeric vector of library sizes) and pseudo.alt (numeric matrix of quantile-adjusted pseudocounts calculated under the alternative hypothesis of a true difference between groups; recommended to use the DGEList object provided as the output of estimateCommonDisp

prior.n

numeric scalar, smoothing parameter that indicates the weight to give to the common likelihood compared to the individual tag's likelihood; default getPriorN(object) gives a value for prior.n that is equivalent to giving the common likelihood 20 prior degrees of freedom in the estimation of the tag/genewise dispersion.

trend

method for allowing the prior distribution for the dispersion to be abundance-dependent. Possible values are "none", "movingave" and "tricube". "none" means no trend. "movingave" applies a moving average smoother to the local likelihood values. "tricube" applies tricube weighting to locally smooth the common likelihood.

prop.used

optional scalar giving the proportion of all tags/genes to be used for the locally weighted estimation of the tagwise dispersion, allowing the dispersion estimates to vary with abundance (expression level). For each tag/gene the estimate of its dispersion is based on the closest prop.used of all of the genes to that gene, where 'closeness' is based on similarity in expression level.

method

method for maximizing the posterior likelihood. Possible values are "grid" for grid search or "optimize" to call the function of the same name.

grid.length

for method="grid", the number of points at which the likelihood is evaluated for each tag. Larger values improve the accuracy of the dispersion estimates.

tol

for method="optimize", the tolerance for Newton-Rhapson iterations.

verbose

logical, if TRUE then diagnostic ouput is produced during the estimation process.

Details

Maximizes the negative binomial weighted likelihood (a weighted version using the common likelihood given weight according the the smoothing parameter prior.n and the individual tag/gene likelihood) for each tag from the pseudocounts provided (i.e. assuming library sizes are equal), to give an estimate of the dispersion parameter for each tag (i.e. tagwise dispersion estimation).

"tricube" local weighting is similar to that used by lowess. "movingave" is much faster than "tricube" and gives similar results.

"optimize" is very slow if there is a large number of tags/genes to be analysed (i.e., more than 5000).

Value

An object of class DGEList with the same components as for estimateCommonDisp plus the following:

prior.n

estimate of the prior weight, i.e. the smoothing parameter that indicates the weight to put on the common likelihood compared to the individual tag's likelihood; prior.n of 10 means that the common likelihood is given 10 times the weight of the individual tag/gene's likelihood in the estimation of the tag/genewise dispersion

tagwise.dispersion

tag- or gene-wise estimates of the dispersion parameter

Author(s)

Mark Robinson, Davis McCarthy and Gordon Smyth

References

Robinson MD and Smyth GK (2007). Moderated statistical tests for assessing differences in tag abundance. Bioinformatics 23, 2881-2887

See Also

estimateCommonDisp estimates a common value for the dispersion parameter for all tags/genes - should generally be run before estimateTagwiseDisp.

Examples

y<-matrix(rnbinom(1000,mu=10,size=2),ncol=4)
d<-DGEList(counts=y,group=c(1,1,2,2),lib.size=c(1000:1003))
d<-estimateCommonDisp(d)
tgwdisp<-estimateTagwiseDisp(d, prior.n=10)

[Package edgeR version 2.4.3 Index]