A generic function which produces an MA-plot for an object containing microarray, RNA-Seq or other data.

plotMA(object, ...)

# S4 method for DESeqResults
plotMA(object, genes = NULL,
  gene2symbol = NULL, ntop = 0L, direction = c("both", "up", "down"),
  pointColor = c(downregulated = "darkorchid3", upregulated =
  "darkorange2", nonsignificant = "gray50"), pointSize = 2L,
  pointAlpha = 0.7, return = c("ggplot", "DataFrame"))

# S4 method for DESeqAnalysis
plotMA(object, results, lfcShrink = TRUE,
  genes = NULL, ntop = 0L, direction = c("both", "up", "down"),
  pointColor = c(downregulated = "darkorchid3", upregulated =
  "darkorange2", nonsignificant = "gray50"), pointSize = 2L,
  pointAlpha = 0.7, return = c("ggplot", "DataFrame"))

Arguments

object

A data object, typically containing count values from an RNA-Seq experiment or microarray intensity values.

genes

character. Gene identifiers. It is considered better practice to input the stable gene identifiers from Ensembl (e.g. "ENSG00000000003") and not the (HGNC) gene symbols (e.g. "TSPN6"), if possible.

gene2symbol

Gene2Symbol. Gene-to-symbol mappings. Must contain geneID and geneName columns. See Gene2Symbol for more information.

ntop

integer(1). Number of top genes to label.

direction

character(1). Plot "both", "up", or "down" directions.

pointColor

character(1). Default point color for the plot.

pointSize

numeric(1). Point size. In the range of 1-3 is generally recommended.

pointAlpha

numeric(1). Alpha transparency level. Must be a proportion (0-1).

return

character(1). Return type. Uses match.arg() internally and defaults to the first argument in the character vector.

results

character(1) or integer(1). Name or position of DESeqResults.

lfcShrink

logical(1). Use shrunken log2 fold change (LFC) values.

...

Additional arguments.

Value

ggplot.

Details

An MA plot is an application of a Bland–Altman plot for visual representation of genomic data. The plot visualizes the differences between measurements taken in two samples, by transforming the data onto M (log ratio) and A (mean average) scales, then plotting these values.

Note

We are not allowing post hoc alpha or lfcThreshold cutoffs here.

plotMA2 aliases

Aliased methods for original DESeq2::plotMA() S4 methods, which us geneplotter instead of ggplot2. I prefer using ggplot2 instead, so the primary methods defined here in the package mask DESeq2.

See also

Examples

data(deseq) ## Get genes from DESeqDataSet. dds <- as(deseq, "DESeqDataSet") genes <- head(rownames(dds)) print(genes)
#> [1] "gene001" "gene002" "gene003" "gene004" "gene005" "gene006"
## DESeqAnalysis ==== plotMA(deseq, results = 1L)
#> condition_B_vs_A (shrunken LFC)
## Customize the colors. plotMA( object = deseq, results = 1L, pointColor = c( downregulated = "red", nonsignificant = "black", upregulated = "green" ) )
#> condition_B_vs_A (shrunken LFC)
## Directional support (up or down). plotMA(deseq, results = 1L, direction = "up", ntop = 5L)
#> condition_B_vs_A (shrunken LFC)
plotMA(deseq, results = 1L, direction = "down", ntop = 5L)
#> condition_B_vs_A (shrunken LFC)
## Label genes manually. ## Note that either gene IDs or names (symbols) are supported. plotMA(deseq, results = 1L, genes = genes)
#> condition_B_vs_A (shrunken LFC)