Skip to contents

fig_manhattan creates a Manhattan plot for genomic markers from across the genome, e.g. results from genome-wide association studies.

Usage

fig_manhattan(
  data,
  colours = c("#7395D3", "#1D345D"),
  rank_pos = FALSE,
  thin_thresh = NULL,
  block_thresh = NULL,
  interactive = FALSE,
  interactive_n = NULL,
  thresh = c(1e-05, 5e-08),
  thresh_size = 0.5,
  thresh_colours = c("grey50", "red"),
  trunc = 1e-30,
  highlight_colours = NULL,
  point_size = 2,
  chr_dist = 1e+07,
  x_labels = TRUE,
  label_top = TRUE,
  label_thresh = 1e-05,
  label_size = 3,
  label_ylim = -log10(1e-05),
  label_nudge_y = 0,
  label_box = FALSE,
  title = NULL,
  title_size = NULL,
  title_center = FALSE,
  axis_text_size = NULL,
  axis_title_size = NULL,
  plot_width = 16,
  plot_height = 8,
  girafe = TRUE
)

Arguments

data

a data.frame containing the chromosome-position information and association statistics for each genomic marker (e.g., genetic variants) with the following columns:

  • chr the chromosome for each genomic marker

  • pos the genomic position for each genomic marker

  • pvalue the association p-value for each genomic marker

  • highlight the optional highlight points variable, where 0 = point not highlighted, 1 = first highlight colour, 2 = second highlight colour, etc.

  • highlight_shape the optional highlight point shape variable, where 0 = standard circle, 1 = standard circle with border, 2 = standard rectangle, 3 = standard rectangle with border, 4 = standard diamond, 5 = standard diamond with border

  • label the optional point labelling variable (e.g. gene name), if label = "" for a point then no label is presented for that point

  • text the optional hover text variable for interactive plots to display further information, if text = "" for a point then no hover text is presented for that point

colours

a vector of colours used to differentiate chromosomes, these can either be a separate colour for each chromosome or a pair of colours (default: c("#7395D3", "#1D345D"))

rank_pos

a logical value whether genomic markers should be plotted by their rank position (default: FALSE)

thin_thresh

a numeric value representing the minimum p-value threshold for genomic markers to be displayed (default: NULL)

block_thresh

a numeric value for representing a p-value threshold, above which genomic markers are represented using blocks of colour (default: NULL)

interactive

a logical value indicating whether the plot should be interactive (default: FALSE)

interactive_n

a numeric value indicating the number of top associated points (max = 100,000) to present before using blocks of colour to minimise file size (default: NULL)

thresh

a numeric vector providing p-value thresholds to be plotted (default: c(1e-5, 5e-8))

thresh_size

a numeric value indicating the width of the lines indicating the p-value thresholds (default: 0.5)

thresh_colours

a character vector indicating the colours of the lines indicating the p-value thresholds (default: c("grey50", "red"))

trunc

a numeric value representing the maximum p-value for which results are displayed (default: 1e-30)

highlight_colours

a vector indicating the colours for the highlighted genomic markers (default: NULL)

point_size

a numeric value indicating the size of each point (default: 2)

chr_dist

a numeric value indicating the gap between different chromosomes (default: 10000000)

x_labels

a logical value whether the x-axis should be labelled (default: TRUE)

label_top

a logical value whether the top associated points should be labelled (default: TRUE)

label_thresh

a numeric value providing a p-value threshold for labelling points (default: 1e-5)

label_size

a numeric value indicating the size of each label (default: 3)

label_ylim

a numeric value indicating maximum y-axis value at which labels can be displayed (default: -log10(1e-5))

label_nudge_y

a numeric value indicating the degree to which label placement on the y-axis should be adjusted (default: 0)`

label_box

a logical value indicating whether labels should be surrounded by a box (default: FALSE)

title

a character`` string providing a title for the plot (default: NULL`)

title_size

a numeric value indicating the size of the title text for the plot (default: NULL)

title_center

a numeric value indicating whether the plot title should be centered (default: FALSE)

axis_text_size

a numeric value indicating the size of the axis text for the plot (default: NULL)

axis_title_size

a numeric value indicating the size of the axis title text for the plot (default: NULL)

plot_width

a numeric value indicating the width of the plot (default: 16)

plot_height

a numeric value indicating the height of the plot (default: 8)

girafe

a logical value indicating whether an interactive plot should be turned into an interactive graphic using girafe() (default = TRUE)

Value

fig_manhattan returns a Manhattan plot for genomic markers from across the genome, e.g. results from genome-wide association studies.

Details

This plotting function plots a Manhattan plot for genomic markers from across the genome. The default is to truncate these results to p-value cut-off of 1e-30.

Author

James Staley jrstaley95@gmail.com

Examples

fig_manhattan(
  data = geni.plots::geni_test_manhattan,
  block_thresh = 1e-4,
  label_box = TRUE
)