dplot3_volcano: Volcano Plot

View source: R/dplot3_volcano.R

dplot3_volcanoR Documentation

Volcano Plot

Description

Volcano Plot

Usage

dplot3_volcano(
  x,
  pvals,
  xnames = NULL,
  group = NULL,
  x.thresh = 0,
  p.thresh = 0.05,
  p.transform = function(x) -log10(x),
  p.adjust.method = c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr",
    "none"),
  legend = NULL,
  legend.lo = NULL,
  legend.hi = NULL,
  label.lo = "Low",
  label.hi = "High",
  main = NULL,
  xlab = NULL,
  ylab = NULL,
  margin = list(b = 65, l = 65, t = 50, r = 10, pad = 0),
  xlim = NULL,
  ylim = NULL,
  alpha = NULL,
  hline = NULL,
  hline.col = NULL,
  hline.width = 1,
  hline.dash = "solid",
  hline.annotate = NULL,
  hline.annotation.x = 1,
  annotate = TRUE,
  annotate.col = theme$labs.col,
  theme = rtTheme,
  font.size = 16,
  palette = NULL,
  legend.x.lo = NULL,
  legend.x.hi = NULL,
  legend.y = 0.97,
  annotate.n = 7,
  ax.lo = NULL,
  ay.lo = NULL,
  ax.hi = NULL,
  ay.hi = NULL,
  annotate.alpha = 0.7,
  hovertext = NULL,
  displayModeBar = FALSE,
  filename = NULL,
  file.width = 500,
  file.height = 500,
  file.scale = 1,
  verbose = TRUE,
  ...
)

Arguments

x

Numeric vector: Input values, e.g. log2 fold change, coefficients, etc.

pvals

Numeric vector: p-values

xnames

Character vector: x names

group

Factor: Used to color code points. If NULL, significant points below x.thresh, non-significant points, and significant points above x.thresh will be plotted with the first, second and third color fo palette

x.thresh

Numeric x-axis threshold separating low from high

p.thresh

Numeric: p-value threshold of significance. Default = .05

p.transform

function. Default = ⁠\(x) -log10(x)⁠

p.adjust.method

Character: p-value adjustment method. "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none" Default = "holm". Use "none" for raw p-values.

legend

Logical: If TRUE, show legend. Will default to FALSE, if group = NULL, otherwise to TRUE

legend.lo

Character: Legend to annotate significant points below the x.thresh

legend.hi

Character: Legend to annotate significant points above the x.thresh

label.lo

Character: label for low values

label.hi

Character: label for high values

main

Character: Main plot title.

xlab

Character: x-axis label

ylab

Character: y-axis label

margin

Named list of plot margins. Default = list(b = 65, l = 65, t = 50, r = 10, pad = 0)

xlim

Numeric vector, length 2: x-axis limits

ylim

Numeric vector, length 2: y-axis limits

alpha

Numeric: point transparency

hline

Numeric: If defined, draw a horizontal line at this y value.

hline.col

Color for hline. Default = "#ff0000" (red)

hline.width

Numeric: Width for hline. Default = 1

hline.dash

Character: Type of line to draw: "solid", "dot", "dash", "longdash", "dashdot", or "longdashdot"

hline.annotate

Character: Text of horizontal line annotation if hline is set

hline.annotation.x

Numeric: x position to place annotation with paper as reference. 0: to the left of the plot area; 1: to the right of the plot area

annotate

Logical: If TRUE, annotate significant points

annotate.col

Color for annotations

theme

List or Character: Either the output of a ⁠theme_*()⁠ function or the name of a theme. Use themes() to get available theme names. Theme functions are of the form ⁠theme_<name>⁠.

font.size

Float: Font size for all labels. Default = 16

palette

Character: Name of rtemis palette to use. Default = "rtCol1". Only used if col = NULL

legend.x.lo

Numeric: x position of legend.lo

legend.x.hi

Numeric: x position of legend.hi

legend.y

Numeric: y position for legend.lo and legend.hi

annotate.n

Integer: Number of significant points to annotate

ax.lo

Numeric: Sets the x component of the arrow tail about the arrow head for significant points below x.thresh

ay.lo

Numeric: Sets the y component of the arrow tail about the arrow head for significant points below x.thresh

ax.hi

Numeric: Sets the x component of the arrow tail about the arrow head for significant points above x.thresh

ay.hi

Numeric: Sets the y component of the arrow tail about the arrow head for significant points above x.thresh

annotate.alpha

Numeric: Transparency for annotations

hovertext

List of character vectors with hovertext to include for each group of markers

displayModeBar

Logical: If TRUE, show plotly's modebar

filename

Character: Path to file to save static plot. Default = NULL

file.width

Integer: File width in pixels for when filename is set.

file.height

Integer: File height in pixels for when filename is set.

file.scale

Numeric: If saving to file, scale plot by this number

verbose

Logical: If TRUE, print messages to console

...

Additional parameters passed to dplot3_xy

Author(s)

E.D. Gennatas

Examples

## Not run: 
set.seed(2019)
x <- rnormmat(500, 500)
y <- x[, 3] + x[, 5] - x[, 9] + x[, 15] + rnorm(500)
mod <- massGLM(y, x)
dplot3_volcano(mod$summary$`Coefficient y`, mod$summary$`p_value y`)

## End(Not run)


egenn/rtemis documentation built on Dec. 17, 2024, 6:16 p.m.