plot_voom: Voom Plot

View source: R/plot_voom.R

plot_voomR Documentation

Voom Plot

Description

This function visualizes the mean-variance relationship of count data after applying the voom transformation.

Usage

plot_voom(
  dat,
  design = NULL,
  lib.size = NULL,
  normalize.method = "none",
  span = 0.5,
  size = NULL,
  alpha = NULL,
  title = "Voom Plot",
  legend = "right",
  hover = FALSE,
  ...
)

Arguments

dat

Raw count matrix, or an ExpressionSet object containing raw counts, or a DGEList. Data should be filtered prior to applying the voom transformation.

design

Optional design matrix with rows corresponding to samples and columns to coefficients to be estimated.

lib.size

Numeric vector containing total library sizes for each sample. If NULL and dat is a DGEList, then normalized library sizes are taken from counts. Otherwise library sizes are calculated from the columnwise count totals.

normalize.method

Normalization method to be applied to the transformed counts. Choices are the same as for the method argument of normalizeBetweenArrays when the data is single-channel.

span

Width of the LOWESS smoothing window as a proportion.

size

Point size.

alpha

Point transparency.

title

Optional plot title.

legend

Legend position. Must be one of "bottom", "left", "top", "right", "bottomright", "bottomleft", "topleft", or "topright".

hover

Show probe name by hovering mouse over data point? If TRUE, the plot is rendered in HTML and will either open in your browser's graphic display or appear in the RStudio viewer. Probe names are extracted from dat.

...

Additional arguments to be passed to lmFit.

Details

The voom function from the limma package offers a unique approach to modeling count data. Rather than fitting negative binomial regressions directly to genewise counts, voom applies a log2-CPM transformation that renders the distribution approximately normal. A (preliminary) linear model is fit to the transformed counts, from which a mean-variance trend is estimated using LOWESS. Observation weights are then computed as inverse predicted residual variance. These can be applied during a final linear model fitting stage to counteract the heteroskedasticity inherent to count data.

The voom function optionally plots mean log2-CPM counts against quarter-root residual variance. This plot is similar in principle to the output of plot_mv, although the y-axis in that case represents raw, not residual variance.

References

Law, C.W., Chen, Y., Shi, W., & Smyth, G.K. (2014). voom: precision weights unlock linear model analysis tools for RNA-seq read counts. Genome Biology, 15: R29.

See Also

voom

Examples

library(limma)
mat <- matrix(rnbinom(1000 * 10, mu = 5, size = 5))
grp <- rep(c("ctl", "trt"), each = 5)
des <- model.matrix(~ grp)
plot_voom(mat, design = des)


dswatson/bioplotr documentation built on March 3, 2023, 9:43 p.m.