Title: | GENI plots |
---|---|
Description: | GENI plots is designed to visualise results from genome-wide association studies. |
Authors: | James Staley [aut, cre] |
Maintainer: | James Staley <[email protected]> |
License: | GPL-3 |
Version: | 0.1.2 |
Built: | 2025-03-13 05:47:59 UTC |
Source: | https://github.com/jrs95/geni.plots |
fig_manhattan
creates a Manhattan plot for genomic markers
from across the genome, e.g. results from genome-wide association studies.
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 )
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 )
data |
a
|
colours |
a |
rank_pos |
a |
thin_thresh |
a |
block_thresh |
a |
interactive |
a |
interactive_n |
a |
thresh |
a |
thresh_size |
a |
thresh_colours |
a |
trunc |
a |
highlight_colours |
a |
point_size |
a |
chr_dist |
a |
x_labels |
a |
label_top |
a |
label_thresh |
a |
label_size |
a |
label_ylim |
a |
label_nudge_y |
a |
label_box |
a |
title |
a |
title_size |
a |
title_center |
a |
axis_text_size |
a |
axis_title_size |
a |
plot_width |
a |
plot_height |
a |
girafe |
a |
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
.
fig_manhattan
returns a Manhattan plot for genomic markers
from across the genome, e.g. results from genome-wide association studies.
James Staley [email protected]
fig_manhattan( data = geni.plots::geni_test_manhattan, block_thresh = 1e-4, label_box = TRUE )
fig_manhattan( data = geni.plots::geni_test_manhattan, block_thresh = 1e-4, label_box = TRUE )
fig_phewas
creates a plot visualising results from
phenome-wide association studies (PheWAS).
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 )
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 )
data |
a
|
groups |
a |
colours |
a |
interactive |
a |
thresh |
a |
thresh_size |
a |
trunc |
a |
point_size |
a |
group_dist |
a |
x_labels |
a |
label_top |
a |
label_thresh |
a |
label_n |
an |
label_size |
a |
label_ymax |
a |
label_box |
a |
label_nudge_x |
a |
label_nudge_y |
a |
title |
a |
title_size |
a |
title_center |
a |
axis_text_size |
a |
axis_text_angle |
a |
axis_title_size |
a |
legend |
a |
legend_title |
a |
legend_text_size |
a |
legend_title_size |
a |
legend_point_size |
a |
legend_spacing_size |
a |
limit_padding |
a |
plot_width |
a |
plot_height |
a |
girafe |
a |
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
.
fig_phewas
returns a PheWAS plot for phenome-wide association
studies.
James Staley [email protected]
fig_phewas( data = geni.plots::geni_test_phewas, axis_text_angle = -85, axis_text_size = 8 )
fig_phewas( data = geni.plots::geni_test_phewas, axis_text_angle = -85, axis_text_size = 8 )
fig_qq
creates a quantile-quantile (QQ) plot.
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 )
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 )
pvalues |
the association p-value for each marker
(default: |
group |
a |
data |
a
|
groups |
a |
colours |
a |
interactive |
a |
thresh |
a |
sample |
a |
sample_thresh |
a |
sample_prop |
a |
ci |
a |
ci_alpha |
a |
ci_print |
a |
inf_factor |
a |
point_size |
a |
label_top |
a |
label_thresh |
a |
label_n |
an |
label_size |
a |
label_xlim |
a |
label_box |
a |
title |
a |
title_size |
a |
title_center |
a |
axis_text_size |
a |
axis_title_size |
a |
legend |
a |
legend_title |
a |
legend_text_size |
a |
legend_title_size |
a |
legend_point_size |
a |
legend_spacing_size |
a |
ymax |
a |
plot_width |
a |
plot_height |
a |
girafe |
a |
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.
fig_qq
returns a quantile-quantile plot.
James Staley [email protected]
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 )
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 )
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.
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 )
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 )
data |
a
|
corr |
a |
corr_top |
a |
top_marker |
a |
r2 |
a |
build |
a |
prob |
a |
interactive |
a |
thresh |
a |
thresh_colour |
a |
x_min |
a |
x_max |
a |
y_title |
a |
point_size |
a |
alpha |
a |
genebar |
a |
genebar_ntracks |
an |
genebar_label_pos |
a |
genebar_label_size |
a |
genebar_line_size |
a |
label_size |
a |
highlights |
a |
highlights_cat |
a |
highlights_label |
a |
highlights_shape |
a value defining the shape for highlighted points
(default: |
highlights_nolabel_shape |
a value defining the shape for points
which are not highlighted (default: |
highlights_sort |
a |
highlights_colours |
a |
highlights_title |
a |
title |
a |
title_size |
a |
title_center |
a |
axis_text_size |
a |
axis_title_size |
a |
legend |
a |
legend_text_size |
a |
legend_title_size |
a |
point_padding |
a |
nudge_x |
a |
nudge_y |
a |
nudge_y_top |
a |
ylim_prob |
a |
assoc_plot_size |
a |
genebar_plot_size |
a |
legend_plot_dist |
a |
plot_width |
a |
plot_height |
a |
girafe |
a |
fig_region
returns a regional plot visualising associations
of markers within a genomic region.
James Staley [email protected]
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
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
fig_region_save
saves the regional plots to file.
fig_region_save( fig, file, ntraits = 1, interactive = FALSE, width = NULL, height = NULL, dpi = 500 )
fig_region_save( fig, file, ntraits = 1, interactive = FALSE, width = NULL, height = NULL, dpi = 500 )
fig |
a regional plot object |
file |
a |
ntraits |
an |
interactive |
a |
width |
a |
height |
a |
dpi |
the resolution of the plot (default: |
James Staley [email protected]
## 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)
## 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)
fig_region_stack
creates a stacked regional association plot.
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 )
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 )
data |
a
|
traits |
a |
corr |
a |
corr_top |
a |
top_marker |
a |
r2 |
a |
build |
a |
prob |
a |
interactive |
a |
thresh |
a |
thresh_colour |
a |
x_min |
a |
x_max |
a |
y_title |
a |
point_size |
a |
alpha |
a |
genebar |
a |
genebar_ntracks |
an |
genebar_label_pos |
a |
genebar_label_size |
a |
genebar_line_size |
a |
label_size |
a |
highlights |
a |
highlights_cat |
a |
highlights_label |
a |
highlights_shape |
a value defining the shape for highlighted points
(default: |
highlights_nolabel_shape |
a value defining the shape for points
which are not highlighted (default: |
highlights_sort |
a |
highlights_colours |
a |
highlights_title |
a |
title_size |
a |
title_center |
a |
axis_text_size |
a |
axis_title_size |
a |
legend |
a |
legend_text_size |
a |
legend_title_size |
a |
point_padding |
a |
nudge_x |
a |
nudge_y |
a |
nudge_y_top |
a |
ylim_prob |
a |
assoc_plot_size |
a |
genebar_plot_size |
a |
legend_plot_dist |
a |
plot_width |
a |
plot_height |
a |
girafe |
a |
fig_region_stack
returns a stacked regional plot.
James Staley [email protected]
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
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
An R object containing formatted results from a genome-wide
association study (GWAS) of interleukin-6 levels with p-values < 1e-3
(GCST90274815).
geni_test_manhattan
geni_test_manhattan
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
James Staley [email protected]
Wes Spiller
head(geni_test_manhattan)
head(geni_test_manhattan)
An R object containing formatted data from a phenome-wide association study (PheWAS) of rs2228145 (1:154426970-A-C) from FinnGen r9.
geni_test_phewas
geni_test_phewas
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
James Staley [email protected]
Wes Spiller
head(geni_test_phewas)
head(geni_test_phewas)
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.
geni_test_region
geni_test_region
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
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
James Staley [email protected]
Wes Spiller
head(geni_test_region$assoc) head(geni_test_region$corr)
head(geni_test_region$assoc) head(geni_test_region$corr)
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.
geni_test_stack_region
geni_test_stack_region
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
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
James Staley [email protected]
Wes Spiller
head(geni_test_stack_region$assoc) head(geni_test_stack_region$corr)
head(geni_test_stack_region$assoc) head(geni_test_stack_region$corr)