View source: R/estimateGLMTrendedDisp.R
estimateGLMTrendedDisp | R Documentation |
Estimates the abundance-dispersion trend by Cox-Reid approximate profile likelihood.
## S3 method for class 'DGEList' estimateGLMTrendedDisp(y, design=NULL, method="auto", ...) ## Default S3 method: estimateGLMTrendedDisp(y, design=NULL, offset=NULL, AveLogCPM=NULL, method="auto", weights=NULL, ...)
y |
a matrix of counts or a |
design |
numeric design matrix, as for |
method |
method (low-level function) used to estimated the trended dispersions.
Possible values are |
offset |
numeric scalar, vector or matrix giving the linear model offsets, as for |
AveLogCPM |
numeric vector giving average log2 counts per million for each gene. |
weights |
optional numeric matrix giving observation weights |
... |
other arguments are passed to lower-level functions |
Estimates the dispersion parameter for each gene with a trend that depends on the overall level of expression for that gene. This is done for a DGE dataset for general experimental designs by using Cox-Reid approximate conditional inference for a negative binomial generalized linear model for each gene with the unadjusted counts and design matrix provided.
The function provides an object-orientated interface to lower-level functions.
When the input object is a DGEList
, estimateGLMTrendedDisp
produces a DGEList
object, which contains the estimates of the trended dispersion parameter for the negative binomial model according to the method applied.
When the input object is a numeric matrix, it returns a vector of trended dispersion estimates calculated by one of the lower-level functions dispBinTrend
, dispCoxReidPowerTrend
and dispCoxReidSplineTrend
.
Gordon Smyth, Davis McCarthy, Yunshun Chen
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. doi: 10.1093/nar/gks042
dispBinTrend
, dispCoxReidPowerTrend
and dispCoxReidSplineTrend
for details on how the calculations are done.
ngenes <- 250 nlibs <- 4 y <- matrix(rnbinom(ngenes*nlibs,mu=10,size=10),ngenes,nlibs) d <- DGEList(counts=y,group=c(1,1,2,2),lib.size=c(1000:1003)) design <- model.matrix(~group, data=d$samples) disp <- estimateGLMTrendedDisp(d, design, min.n=25, df=3) plotBCV(disp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.