plotMA {limma} | R Documentation

## MA-Plot

### Description

Creates an MA-plot with color coding for control spots.

### Usage

    plotMA(MA, array=1, xlab="A", ylab="M", main=colnames(MA)[array], xlim=NULL, ylim=NULL, status, values, pch, col, cex, legend=TRUE, zero.weights=FALSE, ...)

### Arguments

`MA` | an `RGList`, `MAList` or `MArrayLM` object, or any list with components `M` containing log-ratios and `A` containing average intensities. Alternatively a `matrix` or `exprSet` object.
`array` | integer giving the array to be plotted. Corresponds to columns of `M` and `A`.
`xlab` | character string giving label for x-axis
`ylab` | character string giving label for y-axis
`main` | character string giving title for plot
`xlim` | numeric vector of length 2 giving limits for x-axis, defaults to min and max of the data
`ylim` | numeric vector of length 2 giving limits for y-axis, defaults to min and max of the data
`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 omitted, 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`. Ignored if there is no `status` vector.
`pch` | vector or list of plotting characters. Default to integer code 16. Ignored is there is no `status` vector.
`col` | numeric or character vector of colors, of the same length as `values`. Defaults to `1:length(values)`. Ignored if there is no `status` vector.
`cex` | numeric vector of plot symbol expansions, of the the same length as `values`. Defaults to 0.2 for the most common status value and 1 for the others. Ignored if there is no `status` vector.
`legend` | logical, should a legend of plotting symbols and colors be included. Ignored if there is no `status` vector.
`zero.weights` | logical, should spots with zero or negative weights be plotted?
`...` | any other arguments are passed to `plot`

### Details

An MA-plot is a plot of log-intensity ratios (M-values) versus log-intensity averages (A-values). If `MA` is an `RGList` or `MAList` then this function produces an ordinary within-array MA-plot. If `MA` 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 `MA` is a `matrix` or `exprSet` object, then this function produces a between-array MA-plot. In this case the A-values in the plot are the average log-intensities across the arrays and the M-values are the deviations of the log-intensities for the specified array from the average. If there are more than five arays, then the average is computed robustly using medians. With five or fewer arrays, it is computed by means.

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 usually 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 `MA$genes$Status` instead of being passed as an argument to `plotMA`. 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`.

### Value

A plot is created on the current graphics device.

### Author(s)

Gordon Smyth

### References

See http://www.statsci.org/micrarra/refs/maplots.html

### See Also

An overview of diagnostic functions available in LIMMA is given in 7.Diagnostics.

### Examples

    MA <- new("MAList")
    MA$A <- runif(300,4,16)
    MA$M <- rt(300,df=3)
    status <- rep("Gene",300)
    status[1:3] <- "M=0"
    MA$M[1:3] <- 0
    status[4:6] <- "M=3"
    MA$M[4:6] <- 3
    status[7:9] <- "M=-3"
    MA$M[7:9] <- -3
    plotMA(MA,main="MA-Plot with Simulated Data",status=status,values=c("M=0","M=3","M=-3"),col=c("blue","red","green"))

    #  Same as above
    attr(status,"values") <- c("M=0","M=3","M=-3")
    attr(status,"col") <- c("blue","red","green")
    plotMA(MA,main="MA-Plot with Simulated Data",status=status)

    #  Same as above
    MA$genes$Status <- status
    plotMA(MA,main="MA-Plot with Simulated Data")

[Package limma version 1.9.6 Index]