Volcano plot

plotVolcano(object, ...)

# S4 method for DESeqAnalysis
plotVolcano(
  object,
  i,
  alphaThreshold = NULL,
  baseMeanThreshold = NULL,
  lfcThreshold = NULL,
  genes = NULL,
  ntop = 0L,
  ...
)

# S4 method for DESeqResults
plotVolcano(
  object,
  direction = c("both", "up", "down"),
  alphaThreshold = NULL,
  baseMeanThreshold = NULL,
  lfcThreshold = NULL,
  genes = NULL,
  ntop = 0L,
  pointColor = c(downregulated = AcidPlots::lightPalette[["purple"]], upregulated =
    AcidPlots::lightPalette[["orange"]], nonsignificant =
    AcidPlots::lightPalette[["gray"]]),
  pointSize = 2L,
  pointAlpha = 0.8,
  limits = list(x = NULL, y = c(1e-10, 1L)),
  labels = list(title = NULL, subtitle = NULL, x = "log2 fold change", y =
    "-log10 adj p value"),
  histograms = FALSE
)

Arguments

object

Object.

i

Indices specifying elements to extract or replace. Indices are numeric or character vectors, empty (missing), or NULL.

For more information:

help(topic = "Extract", package = "base")
alphaThreshold

numeric(1) or NULL. Adjusted P value ("alpha") cutoff. If left NULL, will use the cutoff defined in the object.

baseMeanThreshold

numeric(1) or NULL. Base mean (i.e. average expression across all samples) threshold. If left NULL, will use the cutoff defined in the object. Applies in general to DESeq2 RNA-seq differential expression output.

lfcThreshold

numeric(1) or NULL. Log (base 2) fold change ratio cutoff threshold. If left NULL, will use the cutoff defined in the object.

genes

character. Gene identifiers.

ntop

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

...

Additional arguments.

direction

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

pointColor

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

pointSize

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

pointAlpha

numeric(1) (0-1). Alpha transparency level.

limits

list(2). Named list containing "x" and "y" that define the lower and upper limits for each axis. Set automatically by default when left NULL.

labels

list. ggplot2 labels. See ggplot2::labs() for details.

histograms

logical(1). Show LFC and P value histograms.

Value

ggplot.

Functions

  • plotVolcano,DESeqAnalysis-method: Passes to DESeqResults method, with gene2symbol argument automatically defined.

Note

Updated 2021-07-27.

See also

CHBUtils::volcano_density_plot().

Author

Michael Steinbaugh, John Hutchinson, Lorena Pantano

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 ==== plotVolcano(deseq, i = 1L)
#> → condition_B_vs_A (shrunken LFC)
## Customize the colors. plotVolcano( object = deseq, i = 1L, pointColor = c( downregulated = "red", nonsignificant = "black", upregulated = "green" ) )
#> → condition_B_vs_A (shrunken LFC)
## Directional support (up or down). plotVolcano( object = deseq, i = 1L, direction = "up", ntop = 5L )
#> → condition_B_vs_A (shrunken LFC)
#> Labeling 5 genes in plot.
plotVolcano( object = deseq, i = 1L, direction = "down", ntop = 5L )
#> → condition_B_vs_A (shrunken LFC)
#> Labeling 5 genes in plot.
## Label genes manually. ## Note that either gene IDs or names (symbols) are supported. plotVolcano(deseq, i = 1L, genes = genes)
#> → condition_B_vs_A (shrunken LFC)
#> Labeling 6 genes in plot.