volcanoly: Creates a plotly volcano plot

Description Usage Arguments Value Note See Also Examples

View source: R/volcanoly.R

Description

Creates an interactive volcano plot with multiple annotation options

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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.

Note

This package provides additional annotation options and builds on the plotly d3.js engine. These plots can be included in Shiny apps, Dash apps, Rmarkdown documents or embeded in websites using simple HTML code.

See Also

volcanor, HapMap, significantSNP

Examples

1
2
3
4
5
6
7
8
volcanorObj <- volcanor(HapMap,
  p = "P",
  effect_size = "EFFECTSIZE",
  snp = "SNP",
  gene = "GENE"
)
class(volcanorObj)
head(volcanorObj$data)

Example output

See example usage at http://sahirbhatnagar.com/manhattanly/
[1] "volcanor"
  EFFECTSIZE         P        SNP    GENE     LOG10P
1    -0.0946 0.3353438  rs9697358   ISG15 0.47450973
2    -0.0947 0.2458571 rs34945898 TNFRSF4 0.60931719
3    -0.0741 0.8232859 rs12034613  FP7162 0.08444933
4     0.0146 0.4932038  rs4648633   MORN1 0.30697357
5     0.1234 0.6053916  rs4430271   MMEL1 0.21796358
6     0.1979 0.1944431  rs6685625  ACTRT2 0.71120743

manhattanly documentation built on April 26, 2021, 9:05 a.m.