Create a Manhattan plot with ggplot2 geom_point.

manhattan(
  gwas,
  highlight_snps = NULL,
  highlight_win = 100,
  annotate_snps = NULL,
  colours = c("#d9d9d9", "#bfbfbf"),
  highlight_colour = "#e15758",
  highlight_shape = 16,
  highlight_alpha = 1,
  sig_line_1 = 5e-08,
  sig_line_2 = NULL,
  y_limits = c(NULL, NULL),
  title = NULL,
  subtitle = NULL,
  base_text_size = 14,
  hit_table = FALSE,
  max_table_hits = 10,
  downsample = 0.9,
  downsample_pval = 0.7
)

Arguments

gwas

a data.table with a minimum of columns SNP, CHR, BP, and P

highlight_snps

(optional) a character vector of SNPs to highlight

highlight_win

(optional) a numeric, the number of kb either side of the highlight_snps to also highlight (i.e create peaks)

annotate_snps

(optional) a character vector of SNPs to annotate

colours

(optional) a character vector colour codes to be replicated along the chromosomes

highlight_colour

(optional) a character colour code; the colour to highlight points in

highlight_shape

(optional) a numeric shape code; the shape of the highlight points (see ggplot2 shape codes)

highlight_alpha

(optional) a numeric value between 0 and 1; the alpha of the highlighted points colour

sig_line_1

(optional) a numeric value (-log10(P)) for where to draw a horizontal line

sig_line_2

(optional) a numeric value (-log10(P)) for where to draw a second horizontal line

y_limits

(optional) a numeric length 2 vector c(min-Y, max-Y)

title

(optional) a string title

subtitle

(optional) a string subtitle

base_text_size

an integer, base_size for the ggplot2 theme

hit_table

(optional) a logical, whether to display a table of top hits (lowest P values)

max_table_hits

(optional) an integer, how many top hits to show in the table

downsample

(optional) a numeric between 0 and 1, the proportion by which to downsample by, e.g. 0.6 will remove 60% of points above the downsample_pval threshold (can help increase plotting speed with minimal impact on plot appearance)

downsample_pval

(optional) a numeric between 0 and 1, the p-values affected by downsampling, default >0.1

Value

a ggplot