manhattanly: Creates a plotly manhattan plot

Description Usage Arguments Value Note See Also Examples

View source: R/manhattanly.R

Description

Creates an interactive manhattan 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
20
manhattanly(
  x,
  ...,
  col = c("#969696", "#252525"),
  point_size = 5,
  labelChr = NULL,
  suggestiveline = -log10(1e-05),
  suggestiveline_color = "blue",
  suggestiveline_width = 1,
  genomewideline = -log10(5e-08),
  genomewideline_color = "red",
  genomewideline_width = 1,
  highlight = NULL,
  highlight_color = "#00FF00",
  showlegend = FALSE,
  showgrid = FALSE,
  xlab = NULL,
  ylab = "-log10(p)",
  title = "Manhattan Plot"
)

Arguments

x

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

  • the chromosome number

  • genomic base-pair position

  • a numeric quantity to plot such as a p-value or zscore

...

other parameters passed to manhattanr

col

A character vector indicating the colors of each chromosome. If the number of colors specified is less than the number of unique chromosomes, then the elements will be recycled. Can be Hex Codes as well.

point_size

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

labelChr

A character vector equal to the number of chromosomes specifying the chromosome labels (e.g., c(1:22, "X", "Y", "MT")). Default is NULL, meaning that the actual chromosome numbers will be used.

suggestiveline

Where to draw a "suggestive" line. Default is -log10(1e-5). Set to FALSE to disable.

suggestiveline_color

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

suggestiveline_width

Width of suggestiveline. Default is 1.

genomewideline

Where to draw a "genome-wide sigificant" line. Default -log10(5e-8). Set to FALSE to disable.

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.

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 nothing is highlighted.

highlight_color

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

showlegend

Should a legend be shown. Default is FALSE.

showgrid

Should gridlines be shown. Default is FALSE.

xlab

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

ylab

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

title

Title of the plot. Default is "Manhattan Plot"

Value

An interactive manhattan plot.

Note

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

See Also

manhattanr, HapMap, significantSNP

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
library(manhattanly)
manhattanly(HapMap)

# highlight SNPs of interest
# 'signigicantSNP' is a character vector of SNPs included in this package
manhattanly(HapMap, snp = "SNP", highlight = significantSNP)

## End(Not run)

Example output

See example usage at http://sahirbhatnagar.com/manhattanly/

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