Learn R Programming

limma (version 3.22.7)

plot.MArrayLM: plotWithHighlights

Description

Plot data or model fit objects. These represent the object by creating an MA-plot, with optional color coding for control spots.

Usage

plotWithHighlights(x, y, status = NULL, values = NULL, pch = 16, col = NULL, cex = 1, legend = "topleft", pch.bg = 16, col.bg = "black", cex.bg = 0.3, ...) "plot"(x, y, array = 1, xlab = "Average log-expression", ylab = "Expression log-ratio (this sample vs others)", main = colnames(x)[array], status=x$genes$Status, zero.weights = FALSE, ...) "plot"(x, y, array = 1, xlab = "A", ylab = "M", main = colnames(x)[array], status=x$genes$Status, zero.weights = FALSE, ...) "plot"(x, y, array = 1, xlab = "A", ylab = "M", main = colnames(x)[array], status=x$genes$Status, zero.weights = FALSE, ...) "plot"(x, y, coef = ncol(x), xlab = "Average log-expression", ylab = "log-fold-change", main = colnames(x)[coef], status = x$genes$Status, zero.weights = FALSE, ...)

Arguments

x
an RGList, MAList, EList or MArrayLM object.
y
not used.
array
integer giving the array to be plotted (if x is an RGList, MAList or EList object).
coef
integer giving the linear model coefficient to be plotted.
xlab
character string giving label for x-axis
ylab
character string giving label for y-axis
main
character string giving title for plot
status
character vector giving the control status of each spot on the array, of same length as the number of rows of MA$M. If NULL, then all points are plotted in the default color, symbol and size.
values
character vector giving values of status to be highlighted on the plot. Defaults to unique values of status in decreasing order of frequency, with the most frequent value set as the background value. Ignored if there is no status vector.
pch
vector or list of plotting characters. Ignored is there is no status vector.
col
numeric or character vector of colors, of the same length as values. Defaults to 1+1:length(values). Ignored if there is no status vector.
cex
numeric vector of plot symbol expansions. If a vector, then of the same length as values. Ignored if there is no status vector.
legend
character string giving position to place legend. See legend for possible values. Can also be logical, with FALSE meaning no legend. Ignored if there is no status vector.
zero.weights
logical, should spots with zero or negative weights be plotted?
pch.bg
plotting character for background (non-highlighted) points.
col.bg
color for background (non-highlighted) points.
cex.bg
plot symbol expansion for background (non-highlighted) points.
...
The plot methods pass other arguments to plotWithHighlights, and plotWithHighlights passes other arguments to plot.default.

Value

Details

An MA-plot is a plot of log-intensity ratios (M-values) versus log-intensity averages (A-values). If x is an RGList or MAList then this function produces an ordinary within-array MA-plot. If x is an MArrayLM object, then the plot is an fitted model MA-plot in which the estimated coefficient is on the y-axis and the average A-value is on the x-axis.

If x is a EList object, then this function produces a between-array MA-plot. An articifial array is produced by averaging all the arrays other than the array specified. A mean-difference plot is then producing from the specified array and the artificial array. Note that this procedure reduces to an ordinary mean-difference plot when there are just two arrays total.

The status vector is intended to specify the control status of each spot, for example "gene", "ratio control", "house keeping gene", "buffer" and so on. The vector is often computed using the function controlStatus and a spot-types file. However the function may be used to highlight any subset of spots.

The status can be included as the component x$genes$Status instead of being passed as an argument to plot. The arguments values, pch, col and cex can be included as attributes to status instead of being passed as arguments to plotMA.

See points for possible values for pch, col and cex.

References

Ritchie, ME, Phipson, B, Wu, D, Hu, Y, Law, CW, Shi, W, and Smyth, GK (2015). limma powers differential expression analyses for RNA-sequencing and microarray studies. Nucleic Acids Research 43, doi: 10.1093/nar/gkv007.

See Also

plotMA, plotFB, plotMDS, plotSA

An overview of diagnostic plots available in LIMMA is given in 09.Diagnostics.

Examples

Run this code
A <- runif(1000,4,16)
y <- A + matrix(rnorm(1000*3,sd=0.2),1000,3)
status <- rep(c(0,-1,1),c(950,40,10))
y[,1] <- y[,1] + status
E <- new("EList",list(E=y))
plot(E,array=1,status=status,values=c(-1,1),col=c("blue","red"))

Run the code above in your browser using DataLab