estimateGLMCommonDisp: Estimate Common Dispersion for Negative Binomial GLMs

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/estimateGLMCommonDisp.R

Description

Estimates a common negative binomial dispersion parameter for a DGE dataset with a general experimental design.

Usage

1
2
3
4
5
6
7
## S3 method for class 'DGEList'
estimateGLMCommonDisp(y, design=NULL, method="CoxReid",
                      subset=10000, verbose=FALSE, ...)
## Default S3 method:
estimateGLMCommonDisp(y, design=NULL, offset=NULL,
                      method="CoxReid", subset=10000, AveLogCPM=NULL,
                      verbose=FALSE, weights=NULL,...)

Arguments

y

object containing read counts, as for glmFit.

design

numeric design matrix, as for glmFit.

offset

numeric vector or matrix of offsets for the log-linear models, as for glmFit.

method

method for estimating the dispersion. Possible values are "CoxReid", "Pearson" or "deviance".

subset

maximum number of rows of y to use in the calculation. Rows used are chosen evenly spaced by AveLogCPM using systematicSubset.

AveLogCPM

numeric vector giving average log2 counts per million for each gene.

verbose

logical, if TRUE estimated dispersion and BCV will be printed to standard output.

weights

optional numeric matrix giving observation weights

...

other arguments are passed to lower-level functions. See dispCoxReid, dispPearson and dispDeviance for details.

Details

This function calls dispCoxReid, dispPearson or dispDeviance depending on the method specified. See dispCoxReid for details of the three methods and a discussion of their relative performance.

Value

The default method returns a numeric vector of length 1 containing the estimated common dispersion.

The DGEList method returns the same DGEList y as input but with common.dispersion as an added component. The output object will also contain a component AveLogCPM if it was not already present in y.

Author(s)

Gordon Smyth, Davis McCarthy, Yunshun Chen

References

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

dispCoxReid, dispPearson, dispDeviance

estimateGLMTrendedDisp for trended dispersions or estimateGLMTagwiseDisp for genewise dispersions in the context of a generalized linear model.

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#  True dispersion is 1/size=0.1
y <- matrix(rnbinom(1000,mu=10,size=10),ncol=4)
d <- DGEList(counts=y,group=c(1,1,2,2))
design <- model.matrix(~group, data=d$samples)
d1 <- estimateGLMCommonDisp(d, design, verbose=TRUE)

#  Compare with classic CML estimator:
d2 <- estimateCommonDisp(d, verbose=TRUE)

#  See example(glmFit) for a different example

Example output

Loading required package: limma
Disp = 0.08332 , BCV = 0.2886 
Disp = 0.08559 , BCV = 0.2926 

edgeR documentation built on Jan. 16, 2021, 2:03 a.m.