Learn R Programming

manhattanly (version 0.3.0)

volcanoly: Creates a plotly volcano plot

Description

Creates an interactive volcano plot with multiple annotation options

Usage

volcanoly(
  x,
  ...,
  col = c("#252525"),
  point_size = 5,
  effect_size_line = c(-1, 1),
  effect_size_line_color = "grey",
  effect_size_line_width = 0.5,
  effect_size_line_type = "dash",
  genomewideline = -log10(1e-05),
  genomewideline_color = "grey",
  genomewideline_width = 0.5,
  genomewideline_type = "dash",
  highlight = NULL,
  highlight_color = "red",
  xlab = NULL,
  ylab = "-log10(p)",
  title = "Volcano Plot"
)

Arguments

x

Can be an object of class volcanor produced by the volcanor function or a data.frame which must contain at least the following two columns:

  • a p-value, must be numeric

  • a measure of the strength of association, typically an odds ratio, regression coefficient or log fold change. Must be numeric

...

other parameters passed to volcanor

col

A character of length 1 indicating the color of the points. Only the first argument will be used if more than one color is supplied. Can be Hex Codes as well.

point_size

A numeric indicating the size of the points on the plot. Default is 5

effect_size_line

Where to draw a "suggestive" line on the x-axis. Default is -1 and +1. Must be a vector of length 2. If a longer vector is supplied, only the first two elements will be used. First element must be smaller than second element. Set to FALSE to disable.

effect_size_line_color

color of "suggestive" line. Only used if effect_size_line is not set to FALSE. Default is "blue".

effect_size_line_width

Width of effect_size_line. Default is 1.

effect_size_line_type

Sets the line type of the effect_size_line. Set to a dash type character among "solid", "dot", "dash", "longdash", "dashdot", or "longdashdot", or a dash length list in px (eg "5px","10px","2px"). Can also be a positive numeric value (e.g 5, 10, 2). Default is "dash". See plotly help page on layouts for complete list and more details

genomewideline

Where to draw a "genome-wide sigificant" line. Default -log10(1e-5). Set to FALSE to disable. If more than one element is provided, only the first will be used

genomewideline_color

color of "genome-wide sigificant" line. Only used if genomewideline is not set to FALSE. Default is "red".

genomewideline_width

Width of genomewideline. Default is 1.

genomewideline_type

Sets the line type of the genomewideline. Set to a dash type character among "solid", "dot", "dash", "longdash", "dashdot", or "longdashdot", or a dash length list in px (eg "5px","10px","2px"). Can also be a positive numeric value (e.g 5, 10, 2). Default is "dash". See plotly help page on layouts for complete list and more details

highlight

A character vector of SNPs in your dataset to highlight. These SNPs should all be in your dataset. Default is NULL which means that all points that are both beyond genomewideline and effect_size_line are highlighted. Set to FALSE if you don't want any points highlighted.

highlight_color

Color used to highlight points. Only used if highlight argument has been specified

xlab

X-axis label. Default is NULL which means that the label is automatically determined by the volcanor function. Specify here to overwrite the default.

ylab

Y-axis label. Default is "-log10(p)".

title

Title of the plot. Default is "Volcano Plot"

Value

An interactive volcano plot.

See Also

volcanor, HapMap, significantSNP

Examples

Run this code
# NOT RUN {
volcanorObj <- volcanor(HapMap,
  p = "P",
  effect_size = "EFFECTSIZE",
  snp = "SNP",
  gene = "GENE"
)
class(volcanorObj)
head(volcanorObj$data)
# }

Run the code above in your browser using DataLab