Creates a plotly Q-Q plot

Share:

Description

Creates an interactive Q-Q plot with multiple annotation options

Usage

1
2
3
4
qqly(x, col = "#252525", size = 1, type = 20, abline_col = "red",
  abline_size = 0.5, abline_type = 1, highlight = NULL,
  highlight_color = "#00FF00", xlab = "Expected -log10(p)",
  ylab = "Observed -log10(p)", title = "Q-Q Plot", ...)

Arguments

x

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

  • a p-value, must be numeric

col

A character indicating the color of the points. Can be Hex Codes as well.

size

A numeric specifying the size of the points. Default is 1

type

An integer between 0 and 25 specifying the point shape. Default is 20 (filled circle). See R Cookbook for complete list

abline_col

A character indicating the color of the 45 degree diagonal line. Can be Hex Codes as well. Default is "red".

abline_size

A numeric indicating the size of the 45 degree diagonal line. Default is 0.5.

abline_type

An integer between 0 and 6 specifying the line type of the diagonal 45 degree line. Default is 1 (solid line). See R Cookbook for complete list

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

xlab

X-axis label. Default is "Expected -log10(p)"

ylab

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

title

Title of the plot. Default is "Q-Q Plot"

...

other parameters passed to qqr

Value

An interactive Q-Q plot.

Note

This function first creates a ggplot2 object and then converts it to a plotly object using ggplotly

See Also

qqr, HapMap, significantSNP, qq, https://github.com/stephenturner/qqman

Examples

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

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

## End(Not run)