Package 'geni.plots'

Title: GENI plots
Description: GENI plots is designed to visualise results from genome-wide association studies.
Authors: James Staley [aut, cre] , Wes Spiller [aut] , Tom Palmer [ctb]
Maintainer: James Staley <[email protected]>
License: GPL-3
Version: 0.1.1
Built: 2024-10-02 04:43:36 UTC
Source: https://github.com/jrs95/geni.plots

Help Index


Manhattan plot

Description

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)

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.

Value

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

Author(s)

James Staley [email protected]

Examples

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

PheWAS plot

Description

fig_phewas creates a plot visualising results from phenome-wide association studies (PheWAS).

Usage

fig_phewas(
  data,
  groups = NULL,
  colours = NULL,
  interactive = FALSE,
  thresh = 1e-05,
  thresh_size = 0.5,
  trunc = 1e-30,
  point_size = 2,
  group_dist = 0.05,
  x_labels = TRUE,
  label_top = TRUE,
  label_thresh = 1e-05,
  label_n = NULL,
  label_size = 3,
  label_ymax = 1e-05,
  label_box = FALSE,
  label_nudge_x = 0,
  label_nudge_y = 0,
  title = NULL,
  title_size = NULL,
  title_center = FALSE,
  axis_text_size = NULL,
  axis_text_angle = -60,
  axis_title_size = NULL,
  legend = FALSE,
  legend_title = "Group",
  legend_text_size = NULL,
  legend_title_size = NULL,
  legend_point_size = NULL,
  legend_spacing_size = NULL,
  limit_padding = 20,
  plot_width = 9,
  plot_height = 6,
  girafe = TRUE
)

Arguments

data

a data.frame containing the association statistics for each phenotype with the following columns:

  • pvalue the association p-value for each phenotype

  • sign the direction of the association with the phenotype, where 0 = missing, 1 positive association, -1 negative association

  • group the phenotype group for each phenotype

  • label the optional point labelling variable (e.g. phenotype 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

groups

a character vector of groups describing the grouping variable in data (default: NULL)

colours

a character vector of colours corresponding to defined groups (default: NULL)

interactive

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

thresh

a numeric value providing the p-value threshold to be plotted (default: NULL)

thresh_size

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

trunc

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

point_size

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

group_dist

a numeric value indicating the gap between different groups (default: 0.05)

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_n

an integer value providing a limit on the number of top associations to label (default: NULL)

label_size

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

label_ymax

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

label_box

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

label_nudge_x

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

label_nudge_y

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

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 logical 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_text_angle

a numeric value indicating the angle of the text on the x-axis of the plot (default: -60)'

axis_title_size

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

legend

a logical value indicating whether a legend corresponding to the displayed groups should be included (default: FALSE)

legend_title

a character string providing a title for the legend (default: "Group")

legend_text_size

a numeric value indicating the size of the legend text (default: NULL)

legend_title_size

a numeric value indicating the size of the legend title (default: NULL)

legend_point_size

a numeric value indicating the size of each point within the legend (default: NULL)

legend_spacing_size

a numeric value indicating spacing of points present in the legend (default: NULL)

limit_padding

a numeric value indicating the relative distance of plotted points from x-axis extremes (default: 20)

plot_width

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

plot_height

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

girafe

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

Details

This plotting function visualises results from phenome-wide association studies (PheWAS) in the form of a Manhattan style plot. Associations are grouped into phenotype categories. By default the results are truncated using a p-value cut-off of 1e-30.

Value

fig_phewas returns a PheWAS plot for phenome-wide association studies.

Author(s)

James Staley [email protected]

Examples

fig_phewas(
  data = geni.plots::geni_test_phewas,
  axis_text_angle = -85,
  axis_text_size = 8
)

QQ plot

Description

fig_qq creates a quantile-quantile (QQ) plot.

Usage

fig_qq(
  pvalues = NULL,
  group = NULL,
  data = NULL,
  groups = NULL,
  colours = NULL,
  interactive = FALSE,
  thresh = NULL,
  sample = FALSE,
  sample_thresh = 0.1,
  sample_prop = 0.1,
  ci = TRUE,
  ci_alpha = 0.05,
  ci_print = FALSE,
  inf_factor = FALSE,
  point_size = 3,
  label_top = FALSE,
  label_thresh = 1e-05,
  label_n = 10,
  label_size = 3.25,
  label_xlim = NULL,
  label_box = FALSE,
  title = NULL,
  title_size = NULL,
  title_center = FALSE,
  axis_text_size = NULL,
  axis_title_size = NULL,
  legend = TRUE,
  legend_title = "Group",
  legend_text_size = NULL,
  legend_title_size = NULL,
  legend_point_size = NULL,
  legend_spacing_size = NULL,
  ymax = NULL,
  plot_width = 6,
  plot_height = 6,
  girafe = TRUE
)

Arguments

pvalues

the association p-value for each marker (default: NULL)

group

a character vector determining the observation group for each marker (default: NULL)

data

a data.frame containing the association statistics for each marker with the following columns:

  • pvalue the association p-value for each marker

  • group the optional grouping variable for each marker

  • label the optional point labelling variable (e.g. genomic marker), 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

groups

a character vector of groups describing the grouping variable in data (default: NULL)

colours

a character vector of colours corresponding to defined groups (default: NULL)

interactive

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

thresh

a numeric value providing the p-value threshold to be plotted (default: NULL)

sample

a logical value indicating whether a random subset of p-values above the plotting threshold should be plotted, the number of which is controlled by sample_prop (default = FALSE)

sample_thresh

a numeric value indicating the p-value threshold defining the sample from which additional observations are selected (default: 0.1)

sample_prop

a numeric value indicating the proportion of sampled observations to be plotted (default: 0.1)

ci

a logical value indicating whether confidence intervals should be displayed (default: TRUE)

ci_alpha

a numeric value providing the threshold defining the plotted confidence interval (default: 0.05)

ci_print

a logical value indicating whether the proportion of points contained within the confidence interval band should be printed (default: FALSE)

inf_factor

a logical value indicating whether the inflation factor should be added to the plot (default: FALSE)

point_size

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

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_n

an integer value providing a limit on the number of top associations to label (default: NULL)

label_size

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

label_xlim

a numeric value indicating maximum x-axis value at which labels can be displayed (default: NULL)

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 logical 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)

legend

a logical value indicating whether a legend corresponding to the displayed groups should be included (default: FALSE)

legend_title

a character string providing a title for the legend (default: "Group")

legend_text_size

a numeric value indicating the size of the legend text (default: NULL)

legend_title_size

a numeric value indicating the size of the legend title (default: NULL)

legend_point_size

a numeric value indicating the size of each point within the legend (default: NULL)

legend_spacing_size

a numeric value indicating spacing of points present in the legend (default: NULL)

ymax

a numeric value defining the maximum value of the y-axis (default: NULL)

plot_width

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

plot_height

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

girafe

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

Details

This plotting function plots a quantile-quantile plot of -log10(p-values). Observations can be divided into groups and can include corresponding confidence intervals. This plot is based on the QQ plot by Matthew Flickinger.

Value

fig_qq returns a quantile-quantile plot.

Author(s)

James Staley [email protected]

Examples

fig_qq(
  pvalues = geni.plots::geni_test_phewas$pvalue
)

fig_qq(
  data = geni.plots::geni_test_phewas[, c("pvalue", "group", "label", "text")],
  legend_title = "Category",
  legend_title_size = 10,
  legend_text_size = 8
)

Regional plot

Description

fig_region creates a regional plot, i.e. a scatter graph of genomic markers associations (e.g. log10(p-values)) with a gene bar underneath.

Usage

fig_region(
  data,
  corr = NULL,
  corr_top = NULL,
  top_marker = NULL,
  r2 = FALSE,
  build = 38,
  prob = FALSE,
  interactive = FALSE,
  thresh = NULL,
  thresh_colour = "grey50",
  x_min = NULL,
  x_max = NULL,
  y_title = NULL,
  point_size = 3,
  alpha = 1,
  genebar = TRUE,
  genebar_ntracks = NULL,
  genebar_label_pos = 3.6,
  genebar_label_size = 4,
  genebar_line_size = 0.8,
  label_size = 3.5,
  highlights = NULL,
  highlights_cat = NULL,
  highlights_label = TRUE,
  highlights_shape = 22,
  highlights_nolabel_shape = 21,
  highlights_sort = TRUE,
  highlights_colours = NULL,
  highlights_title = "Group",
  title = NULL,
  title_size = 16,
  title_center = FALSE,
  axis_text_size = 14,
  axis_title_size = 16,
  legend = TRUE,
  legend_text_size = 12,
  legend_title_size = 12,
  point_padding = 0,
  nudge_x = 0,
  nudge_y = 0,
  nudge_y_top = 0.06,
  ylim_prob = 1,
  assoc_plot_size = NULL,
  genebar_plot_size = NULL,
  legend_plot_dist = NULL,
  plot_width = 9,
  plot_height = 7,
  girafe = TRUE
)

Arguments

data

a data.frame containing the association statistics for each marker within a genomic region with the following columns:

  • marker the genomic marker identifier (e.g. rsID)

  • chr the chromosome for each genomic marker

  • pos the genomic position for each genomic marker and one of the following:

  • pvalue the association p-value for each genomic marker

  • z the association z-statistic for each genomic marker

  • prob the association probability for each genomic marker

corr

a numeric matrix of correlation statistics between the markers (default: NULL)

corr_top

a numeric vector of correlation statistics between the top marker and the rest of the markers (default: NULL)

top_marker

a character value depicting the marker to plot the correlation statistics of the rest of the markers against (default: NULL)

r2

a logical value indicating whether the set of correlation statistics entered in corr or corr_top are squared (default: FALSE)

build

a numeric value indicating the genome build used to determine genomic position (default: 38 representing human assembly GRCh38)

prob

a logical value indicating whether probability statistics should be plotted instead of -log10(p-values) (default: FALSE)

interactive

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

thresh

a numeric vector providing the p-value thresholds to be plotted (default: NULL)

thresh_colour

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

x_min

a numeric value depicting the minimum plotted x-axis value representing the start of the genomic region (default: NULL)

x_max

a numeric value depicting the maximum plotted x-axis value representing the end of the genomic region (default: NULL)

y_title

a character string defining the title of the y-axis (default: NULL)

point_size

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

alpha

a numeric value adjusting the opacity of colours representing the correlation statistics (default: 1)

genebar

a logical value indicating whether bars representing the genes should be included in the plot (default: TRUE)

genebar_ntracks

an integer value indicating the number of tracks to be included in the gene bar (default: NULL)

genebar_label_pos

a numeric value indicating the relative position of gene labels with respect to each gene bar (default: 3.6)

genebar_label_size

a numeric value defining the size of each gene label (default: 4.25)

genebar_line_size

a numeric value defining the line size of each gene bar (default: 0.8)

label_size

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

highlights

a character vector defining a set of markers to highlight in the plot (default: NULL)

highlights_cat

a character vector defining the category for each highlighted marker (default: NULL)

highlights_label

a logical value indicating whether highlighted points should be labelled (default: TRUE)

highlights_shape

a value defining the shape for highlighted points (default: 22)

highlights_nolabel_shape

a value defining the shape for points which are not highlighted (default: 21)

highlights_sort

a logical value indicating whether to sort highlight group label levels (default: TRUE)

highlights_colours

a character vector specifying colours for highlighted points (default: NULL)

highlights_title

a character string providing a title for the legend corresponding to the highlighted points (default: "Group")

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 logical 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: 14)

axis_title_size

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

legend

a logical value indicating whether a legend corresponding to the displayed groups should be included (default: TRUE)

legend_text_size

a numeric value indicating the size of the legend text (default: 12)

legend_title_size

a numeric value indicating the size of the legend title (default: 12)

point_padding

a numeric value indicating the relative distance of labels from plotted points (default: 0

nudge_x

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

nudge_y

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

nudge_y_top

a numeric value indicating the degree to which the top marker should be adjusted on the y-axis by a proportion of the y-axis limit (default: 0.06)

ylim_prob

a numeric value defining the upper y-axis limit for probability plots (default: 1)

assoc_plot_size

a numeric value determining the size of the association plot (default: NULL)

genebar_plot_size

a numeric value determining the size of the gene bar plot (default: NULL)

legend_plot_dist

a numeric value defining the distance and size of the legend from the bottom of the regional plot (default = NULL)

plot_width

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

plot_height

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

girafe

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

Value

fig_region returns a regional plot visualising associations of markers within a genomic region.

Author(s)

James Staley [email protected]

Examples

fig_region(
  data = geni.plots::geni_test_region$assoc,
  corr = geni.plots::geni_test_region$corr,
  build = 37,
  axis_text_size = 11,
  axis_title_size = 12,
  genebar_label_size = 3.5,
  legend_text_size = 10,
  legend_title_size = 10
)

# Notes:
#   (i) corr has to have the same markers as assoc in the same order
#   (ii) by default fig_region assumes corr contains correlation
#        statistics that have not been squared

Regional plot save

Description

fig_region_save saves the regional plots to file.

Usage

fig_region_save(
  fig,
  file,
  ntraits = 1,
  interactive = FALSE,
  width = NULL,
  height = NULL,
  dpi = 500
)

Arguments

fig

a regional plot object

file

a character string of the file path to save the plot

ntraits

an integer value of the number of traits plotted (default: 1)

interactive

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

width

a numeric value indicating the width of the plot in inches (default: NULL)

height

a numeric value indicating the height of the plot in inches (default: NULL)

dpi

the resolution of the plot (default: 500)

Author(s)

James Staley [email protected]

Examples

## Not run: 
fig <- fig_region(
  data = geni.plots::geni_test_region$assoc,
  corr = geni.plots::geni_test_region$corr,
  build = 37
)
fig_region_save(fig, "test.png")

## End(Not run)

Stacked regional plot

Description

fig_region_stack creates a stacked regional association plot.

Usage

fig_region_stack(
  data,
  traits,
  corr = NULL,
  corr_top = NULL,
  top_marker = NULL,
  r2 = FALSE,
  build = 38,
  prob = FALSE,
  interactive = FALSE,
  thresh = NULL,
  thresh_colour = "grey50",
  x_min = NULL,
  x_max = NULL,
  y_title = NULL,
  point_size = 3,
  alpha = 1,
  genebar = TRUE,
  genebar_ntracks = NULL,
  genebar_label_pos = 3.6,
  genebar_label_size = 4,
  genebar_line_size = 0.8,
  label_size = 3.5,
  highlights = NULL,
  highlights_cat = NULL,
  highlights_label = TRUE,
  highlights_shape = 22,
  highlights_nolabel_shape = 21,
  highlights_sort = TRUE,
  highlights_colours = NULL,
  highlights_title = "Group",
  title_size = 16,
  title_center = FALSE,
  axis_text_size = 14,
  axis_title_size = 16,
  legend = TRUE,
  legend_text_size = 12,
  legend_title_size = 12,
  point_padding = 0,
  nudge_x = 0,
  nudge_y = 0,
  nudge_y_top = 0.06,
  ylim_prob = 1,
  assoc_plot_size = NULL,
  genebar_plot_size = NULL,
  legend_plot_dist = NULL,
  plot_width = NULL,
  plot_height = NULL,
  girafe = TRUE
)

Arguments

data

a data.frame containing the association statistics for each marker within a genomic region with the following columns:

  • marker the genomic marker identifier (e.g. rsID)

  • chr the chromosome for each genomic marker

  • pos the genomic position for each genomic marker and one of the following:

  • pvalue_1, pvalue_2, pvalue_3, etc. the association p-values for each genomic marker and trait

  • z_1, z_2, z_3, etc. the association z-statistics for each genomic marker and trait

  • prob_1, prob_2, prob_3, etc. the association probabilities for each genomic marker and trait

traits

a character vector of trait names

corr

a numeric matrix of correlation statistics between the markers (default: NULL)

corr_top

a numeric vector of correlation statistics between the top marker and the rest of the markers (default: NULL)

top_marker

a character value depicting the marker to plot the correlation statistics of the rest of the markers against (default: NULL)

r2

a logical value indicating whether the set of correlation statistics entered in corr or corr_top are squared (default: FALSE)

build

a numeric value indicating the genome build used to determine genomic position (default: 38 representing human assembly GRCh38)

prob

a logical value indicating whether probability statistics should be plotted instead of -log10(p-values) (default: FALSE)

interactive

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

thresh

a numeric vector providing the p-value thresholds to be plotted (default: NULL)

thresh_colour

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

x_min

a numeric value depicting the minimum plotted x-axis value representing the start of the genomic region (default: NULL)

x_max

a numeric value depicting the maximum plotted x-axis value representing the end of the genomic region (default: NULL)

y_title

a character string defining the title of the y-axis (default: NULL)

point_size

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

alpha

a numeric value adjusting the opacity of colours representing the correlation statistics (default: 1)

genebar

a logical value indicating whether bars representing the genes should be included in the plot (default: TRUE)

genebar_ntracks

an integer value indicating the number of tracks to be included in the gene bar (default: NULL)

genebar_label_pos

a numeric value indicating the relative position of gene labels with respect to each gene bar (default: 3.6)

genebar_label_size

a numeric value defining the size of each gene label (default: 4.25)

genebar_line_size

a numeric value defining the line size of each gene bar (default: 0.8)

label_size

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

highlights

a character vector defining a set of markers to highlight in the plot (default: NULL)

highlights_cat

a character vector defining the category for each highlighted marker (default: NULL)

highlights_label

a logical value indicating whether highlighted points should be labelled (default: TRUE)

highlights_shape

a value defining the shape for highlighted points (default: 22)

highlights_nolabel_shape

a value defining the shape for points which are not highlighted (default: 21)

highlights_sort

a logical value indicating whether to sort highlight group label levels (default: TRUE)

highlights_colours

a character vector specifying colours for highlighted points (default: NULL)

highlights_title

a character string providing a title for the legend corresponding to the highlighted points (default: "Group")

title_size

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

title_center

a logical 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: 14)

axis_title_size

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

legend

a logical value indicating whether a legend corresponding to the displayed groups should be included (default: TRUE)

legend_text_size

a numeric value indicating the size of the legend text (default: NULL)

legend_title_size

a numeric value indicating the size of the legend title (default: NULL)

point_padding

a numeric value indicating the relative distance of labels from plotted points (default: 0

nudge_x

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

nudge_y

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

nudge_y_top

a numeric value indicating the degree to which the top marker should be adjusted on the y-axis by a proportion of the y-axis limit (default: 0.06)

ylim_prob

a numeric value defining the upper y-axis limit for probability plots (default: 1)

assoc_plot_size

a numeric value determining the size of the association plot (default: NULL)

genebar_plot_size

a numeric value determining the size of the gene bar plot (default: NULL)

legend_plot_dist

a numeric value defining the distance and size of the legend from the bottom of the regional plot (default = NULL)

plot_width

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

plot_height

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

girafe

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

Value

fig_region_stack returns a stacked regional plot.

Author(s)

James Staley [email protected]

Examples

fig <- fig_region_stack(
  data = geni.plots::geni_test_stack_region$assoc,
  traits = c("Interleukin-6 levels", "Interleukin-6 receptor levels"),
  corr = geni.plots::geni_test_stack_region$corr,
  build = 37,
  highlights = "rs11265611",
  title_center = TRUE
)

# Notes:
#   (i) corr has to have the same markers as assoc in the same order
#   (ii) by default fig_region_stack assumes corr contains correlation
#        statistics that have not been squared

GENI plots test data for the Manhattan plot

Description

An R object containing formatted results from a genome-wide association study (GWAS) of interleukin-6 levels with p-values < 1e-3 (GCST90274815).

Usage

geni_test_manhattan

Format

A data.frame containing the variables necessary for constructing a static Manhattan plot. Specifically, this includes the following information:

  • chr the chromosome for each genomic marker

  • pos the genomic position (GRCh37) for each genomic marker

  • pvalue the association p-value for each genomic marker

  • highlight an indicator variable whether the genomic marker should be highlighted: 0 = point not highlighted, 1 = first highlight colour

  • highlight_shape an indicator variable of the illustrated shape for the genomic markers: 0 = standard circle, 5 = standard diamond with border

  • label the name of the nearest gene for each sentinel genome-wide associated genetic variant, the labels for non-sentinel genetic variants are omitted

Author(s)

James Staley [email protected]

Wes Spiller

Examples

head(geni_test_manhattan)

GENI plots test data for the PheWAS plot

Description

An R object containing formatted data from a phenome-wide association study (PheWAS) of rs2228145 (1:154426970-A-C) from FinnGen r9.

Usage

geni_test_phewas

Format

A data.frame containing the variables necessary for constructing an interactive PheWAS plot. Specifically, this includes the following information:

  • pvalue the association p-value for each phenotype

  • sign the direction of the association with the phenotype, where 0 = missing, 1 positive association, -1 negative association

  • group the phenotype group for each phenotype

  • label the phenotype name

  • text the hover text containing further information on the association including: phenotype, phenotypic category, genetic variant ID, direction of association, association p-value, number of cases and number of controls

Author(s)

James Staley [email protected]

Wes Spiller

Examples

head(geni_test_phewas)

GENI plots test data for the regional plot

Description

An R object containing formatted results from a genome-wide association study (GWAS) of interleukin-6 levels (GCST90274815) and linkage disequilibrium statistics from 1000 Genomes Phase 3 for the region 1:154301970-154551970.

Usage

geni_test_region

Format

A list containing 2 objects with the information necessary for constructing an interactive regional plot. Specifically, this includes the following information:

  • assoc a data.frame with genetic association results for interleukin-6 levels from GCST90274815 for the region 1:154301970-154551970

  • corr a matrix of Pearson correlation statistics (not squared) from the European samples of 1000 Genomes Phase 3 for the region 1:154301970-154551970, this matrix has the same markers in the same order as assoc

Details

assoc is a data.frame with the following columns:

  • marker the genomic marker identifier (i.e. rsID or chromosome-position)

  • chr the chromosome for each genomic marker

  • pos the genomic position (GRCh37) for each genomic marker

  • pvalue the association p-value for each genomic marker

Author(s)

James Staley [email protected]

Wes Spiller

Examples

head(geni_test_region$assoc)
head(geni_test_region$corr)

GENI plots test data for the stacked regional plot

Description

An R object containing formatted results from genome-wide association studies (GWAS) of interleukin-6 levels (GCST90274815) and interleukin-6 receptor levels (GCST90088597) and linkage disequilibrium statistics from 1000 Genomes Phase 3 for the region 1:154301970-154551970.

Usage

geni_test_stack_region

Format

A list containing 2 objects with the information necessary for constructing an interactive stacked regional plot. Specifically, this includes the following information:

  • assoc a data.frame with genetic association results for interleukin-6 levels from GCST90274815 and for interleukin-6 receptor levels GCST90088597 for the region 1:154301970-154551970

  • corr a matrix of Pearson correlation statistics (not squared) from the European samples of 1000 Genomes Phase 3 for the region 1:154301970-154551970, this matrix has the same markers in the same order as assoc

Details

assoc is a data.frame with the following columns:

  • marker the genomic marker identifier (i.e. rsID or chromosome-position)

  • chr the chromosome for each genomic marker

  • pos the genomic position (GRCh37) for each genomic marker

  • pvalue_1 the association p-value for interleukin-6 levels for each genomic marker

  • pvalue_2 the association p-value for interleukin-6 receptor levels for each genomic marker

Author(s)

James Staley [email protected]

Wes Spiller

Examples

head(geni_test_stack_region$assoc)
head(geni_test_stack_region$corr)