plotMeanVar(object, meanvar=NULL, show.raw.vars=FALSE, show.tagwise.vars=FALSE,
show.binned.common.disp.vars=FALSE, show.ave.raw.vars=TRUE,
scalar=NULL, NBline=FALSE, nbins=100, log.axes="xy", xlab=NULL,
ylab=NULL, ...)
binMeanVar(x, group, nbins=100, common.dispersion=FALSE, object=NULL)
DGEList
object containing the raw data and dispersion value. According the method desired for computing the dispersion, either estimateCommonDisp
and (possibly) estimateTagwiseDisp
should be run on the DGEList
object before using plotMeanVar
. The argument object
must be supplied in the function binMeanVar
if common dispersion values are to be computed for each bin.binMeanVar
or the returned value of plotMeanVar
. Providing this object as an argument will save time in computing the gene means and variances when producing a mean-variance plot.FALSE
.FALSE
.FALSE
.TRUE
.100
bins"xy"
, which makes both y and x axes on the log scale. Other valid options are "x"
(log scale on x-axis only), "y"
(log scale on y-axis only) and ""
(linear scale on x- and y-axis).NULL
, then the x-axis label will be set to "logConc".NULL
, then the x-axis label will be set to "logConc".plot
x
or element of {y}) belongsplotMeanVar
produces a mean-variance plot for the DGE data using the options described above. plotMeanVar
and binMeanVar
both return a list with the following components:nbins
bins by overall expression level. The averages are taken on the square-root scale as for count data the arithmetic mean is upwardly biased. Taking averages on the square-root scale provides a useful summary of how the variance of the gene counts change with respect to 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. Optionally, the raw variances and estimated genewise variances can also be plotted. Estimated genewise variances can be calculated using either qCML estimates of the genewise dispersions (estimateTagwiseDisp
) or Cox-Reid conditional inference estimates (CRDisp
). A log-log scale is used for the plot.plotMDS.DGEList
, plotSmear
and
maPlot
provide more ways of visualizing DGE data.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))
plotMeanVar(d) # Produce a straight-forward mean-variance plot
# Produce a mean-variance plot with the raw variances shown and save the means
# and variances for later use
meanvar <- plotMeanVar(d, show.raw.vars=TRUE)
## If we want to show estimated genewise variances on the plot, we must first estimate them!
d <- estimateCommonDisp(d) # Obtain an estimate of the dispersion parameter
d <- estimateTagwiseDisp(d) # Obtain genewise dispersion estimates
# Use previously saved object to speed up plotting
plotMeanVar(d, meanvar=meanvar, show.tagwise.vars=TRUE, NBline=TRUE)
## We could also estimate common/genewise dispersions using the Cox-Reid methods with an
## appropriate design matrix
Run the code above in your browser using DataLab