estimateGLMTagwiseDisp {edgeR} | R Documentation

## Empirical Bayes Tagwise Dispersions for Negative Binomial GLMs

### Description

Compute an empirical Bayes estimate of the negative binomial dispersion parameter for each tag, with expression levels specified by a log-linear model.

### Usage

    ## S3 method for class 'DGEList'
    estimateGLMTagwiseDisp(y, design=NULL, prior.df=10,
                trend=!is.null(y$trended.dispersion), span=NULL, ...)
    ## Default S3 method:
    estimateGLMTagwiseDisp(y, design=NULL, offset=NULL, dispersion,
                prior.df=10, trend=TRUE, span=NULL, AveLogCPM=NULL,
                weights=NULL, ...)

### Arguments

`y` | matrix of counts or a `DGEList` object.
`design` | numeric design matrix, as for `glmFit`.
`trend` | logical. Should the prior be the trended dispersion (`TRUE`) or the common dispersion (`FALSE`)?
`offset` | offset matrix for the log-linear model, as for `glmFit`. Defaults to the log-effective library sizes.
`dispersion` | common or trended dispersion estimates, used as an initial estimate for the tagwise estimates.
`prior.df` | prior degrees of freedom.
`span` | width of the smoothing window, in terms of proportion of the data set. Default value decreases with the number of tags.
`AveLogCPM` | numeric vector giving average log2 counts per million for each tag
`weights` | optional numeric matrix giving observation weights
`...` | other arguments are passed to `dispCoxReidInterpolateTagwise`.

### Details

This function implements the empirical Bayes strategy proposed by McCarthy et al (2012) for estimating the tagwise negative binomial dispersions. The experimental conditions are specified by design matrix allowing for multiple explanatory factors. The empirical Bayes posterior is implemented as a conditional likelihood with tag-specific weights, and the conditional likelihood is computed using Cox-Reid approximate conditional likelihood (Cox and Reid, 1987).

The prior degrees of freedom determines the weight given to the global dispersion trend. The larger the prior degrees of freedom, the more the tagwise dispersions are squeezed towards the global trend.

Note that the terms ‘tag’ and ‘gene’ are synonymous here. The function is only named ‘Tagwise’ for historical reasons.

This function calls the lower-level function `dispCoxReidInterpolateTagwise`.

### Value

`estimateGLMTagwiseDisp.DGEList` produces a `DGEList` object, which contains the tagwise dispersion parameter estimate for each tag for the negative binomial model that maximizes the Cox-Reid adjusted profile likelihood. The tagwise dispersions are simply added to the `DGEList` object provided as the argument to the function.

`estimateGLMTagwiseDisp.default` returns a vector of the tagwise dispersion estimates.

### Author(s)

Gordon Smyth, Davis McCarthy

### References

Cox, DR, and Reid, N (1987). Parameter orthogonality and approximate conditional inference. Journal of the Royal Statistical Society Series B 49, 1-39.

McCarthy, DJ, Chen, Y, Smyth, GK (2012). Differential expression analysis of multifactor RNA-Seq experiments with respect to biological variation. Nucleic Acids Research 40, 4288-4297. https://doi.org/10.1093/nar/gks042

### See Also

`estimateGLMCommonDisp` for common dispersion or `estimateGLMTrendedDisp` for trended dispersion in the context of a generalized linear model.

`estimateCommonDisp` for common dispersion or `estimateTagwiseDisp` for tagwise dispersions in the context of a multiple group experiment (one-way layout).

### Examples

    y <- matrix(rnbinom(1000,mu=10,size=10),ncol=4)
    d <- DGEList(counts=y,group=c(1,1,2,2),lib.size=c(1000:1003))
    design <- model.matrix(~group, data=d$samples) # Define the design matrix for the full model
    d <- estimateGLMTrendedDisp(d, design, min.n=10)
    d <- estimateGLMTagwiseDisp(d, design)
    summary(d$tagwise.dispersion)

[Package edgeR version 3.32.1 Index]