dglmStdResid(y, design, dispersion=0, offset=0, nbins=100, make.plot=TRUE,
xlab="Mean", ylab="Ave. binned standardized residual", ...)
getDispersions(binned.object)
y
.100
binsTRUE
.plot
dglmStdResid
.dglmStdResid
produces a mean-variance plot based on standardized residuals from a Poisson model fit for each gene for the DGE data. dglmStdResid
returns a list with the following elements:getDispersions
computes the dispersion from the standardized residuals and returns a list with the following components:plotMeanVar
) to visualize the mean-variance relationship in the data. The function will plot the average standardized residual for observations split into nbins
bins by overall expression level. This provides a useful summary of how the variance of the counts change with respect to average expression level (abundance). A line showing the Poisson mean-variance relationship (mean equals variance) is always shown to illustrate how the genewise variances may differ from a Poisson mean-variance relationship. A log-log scale is used for the plot.The function mglmLS
is used to fit the Poisson models to the data. This code is fast for fitting models, but does not compute the value for the leverage, technically required to compute the standardized residuals. Here, we approximate the standardized residuals by replacing the usual denominator of ( 1 - leverage )
by ( 1 - p/n )
, where n is the number of observations per gene (i.e. number of libraries) and p is the number of parameters in the model (i.e. number of columns in the full-rank design matrix.
plotMeanVar
, plotMDS.DGEList
, plotSmear
and maPlot
provide more ways of visualizing DGE data.y <- matrix(rnbinom(1000,mu=10,size=2),ncol=4)
design <- model.matrix(~c(0,0,1,1)+c(0,1,0,1))
binned <- dglmStdResid(y, design, dispersion=0.5)
getDispersions(binned)$bin.dispersion.used # Look at the estimated dispersions for the bins
Run the code above in your browser using DataLab