| Title: | Create HIDECAN Plots for Visualising Genome-Wide Association Studies and Differential Expression Results |
|---|---|
| Description: | Generates HIDECAN plots that summarise and combine the results of QTL mapping, genome-wide association studies (GWAS) and transcriptomics differential expression analyses (DE), along with manually curated candidate genes of interest. The HIDECAN plot is presented in Angelin-Bonnet, O., Vignes, M., Biggs, P. J., Baldwin, S., & Thomson, S. (2024). Visual Integration of Genome-Wide Association Studies and Differential Expression Results with the Hidecan R Package. Genes, 15(10), 1244. |
| Authors: | Olivia Angelin-Bonnet [aut, cre] (ORCID: <https://orcid.org/0000-0002-7708-2919>) |
| Maintainer: | Olivia Angelin-Bonnet <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.2.0.0 |
| Built: | 2026-05-21 06:25:01 UTC |
| Source: | https://github.com/plantandfoodresearch/hidecan |
Add data type to HIDECAN plot
.add_data_type( p, toplot, i, paes, add_new_legend, point_size, label_size, label_padding ).add_data_type( p, toplot, i, paes, add_new_legend, point_size, label_size, label_padding )
p |
Current ggplot. |
toplot |
Tibble of data to plot. |
i |
Character, data type to add in the plot. |
paes |
Named list, aesthetics to use for this data type (see
|
add_new_legend |
Logical, whether the current data type requires a new legend for fill. |
point_size |
Numeric, size of the points in the plot. |
label_size |
Numeric, size of the gene labels in the plot. |
label_padding |
Numeric, amount of padding around gene labels in the plot, as unit or number. |
ggplot p to which the new data type has been added.
Check chromosome limits
.check_chrom_limits(chrom_limits, chrom_length, chroms).check_chrom_limits(chrom_limits, chrom_length, chroms)
chrom_limits |
Integer vector of length 2, or named list where the
elements are integer vectors of length 2. If vector, gives the lower and
upper limit of the chromosomes (in bp) to use in the plot. If a named list,
names should correspond to chromosome names. Gives for each chromosome the
lower and upper limits (in bp) to use in the plot. Doesn't have to be
specified for all chromosomes. Default value is |
chrom_length |
Tibble of chromosome length. |
chroms |
Character vector, name of chromosomes to include in the plot. |
Tibble of chromosome limits to use in the plot.
Check chromosomes to plot
.check_chroms(toplot, chrom_length, chroms, remove_empty_chrom).check_chroms(toplot, chrom_length, chroms, remove_empty_chrom)
toplot |
Tibble, main data-frame for plot. |
chrom_length |
Tibble of chromosome length. |
chroms |
Character vector, name of chromosomes to include in the plot.
If |
remove_empty_chrom |
Logical, should chromosomes with no significant
markers/genes nor candidate genes be removed from the plot? Default value
if |
Character vector of chromosomes to plot.
Checks whether some columns are present in a tibble
.check_cols(x, col_names, param_name = "Input data-frame").check_cols(x, col_names, param_name = "Input data-frame")
x |
Tibble |
col_names |
character vector of column names |
param_name |
Character, name of the dataframe to use in the error message. |
invisible NULL
Computes the length (in bp) of each chromosome as the maximum position of genes on the chromosome.
.compute_chrom_length_genes(x).compute_chrom_length_genes(x)
x |
Either a |
A tibble with two columns: chromosome (chromosome name) and
length (chromosome length in base pair).
Computes the length (in bp) of each chromosome as the maximum position of chromosomes on the chromosome.
.compute_chrom_length_markers(x).compute_chrom_length_markers(x)
x |
Either a |
A tibble with two columns: chromosome (chromosome name) and
length (chromosome length in base pair).
Returns either "aes_type" attribute or object class
.get_aes_type(x).get_aes_type(x)
x |
A |
Either "aes_type" attribute or object class.
Get the list of aesthetics for each data types in the plot.
.get_plot_aes(aes_types, colour_genes_by_score, custom_aes).get_plot_aes(aes_types, colour_genes_by_score, custom_aes)
aes_types |
Character vector of data types (one per dataset to plot),
should be computed with |
colour_genes_by_score |
Logical, whether to colour the genes by score
( |
custom_aes |
Named list of plot aesthetics for custom data types. See
|
Named list of plot aesthetics.
Filters markers, genes/transcripts or QTL regions based on a threshold applied to their GWAS, DE or QTL score, and log2(fold-change) (if applicable). For a set of candidate genes, simply returns the list. Note that markers, genes and QTL regions with a missing score or log2(fold-change) will be removed from the dataset.
apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## S3 method for class 'GWAS_data' apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## S3 method for class 'DE_data' apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## S3 method for class 'CAN_data' apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## S3 method for class 'QTL_data' apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## S3 method for class 'CUSTOM_data' apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## Default S3 method: apply_threshold(x, score_thr = 0, log2fc_thr = 0)apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## S3 method for class 'GWAS_data' apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## S3 method for class 'DE_data' apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## S3 method for class 'CAN_data' apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## S3 method for class 'QTL_data' apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## S3 method for class 'CUSTOM_data' apply_threshold(x, score_thr = 0, log2fc_thr = 0) ## Default S3 method: apply_threshold(x, score_thr = 0, log2fc_thr = 0)
x |
Either a |
score_thr |
Numeric, threshold to use on markers', genes/transcripts' or
QTL regions' score. Only markers/genes/regions with a score equal to or
higher than this threshold will be retained. Default value is 0. Ignored
for |
log2fc_thr |
Numeric, threshold to use on the absolute value of genes/
transcripts' log2(fold-change). Only genes/transcripts with an absolute
log2(fold-change) equal to or higher than this threshold will be retained.
Ignored for |
A filtered tibble (of class GWAS_data_thr, DE_data_thr,
CAN_data_thr, QTL_data_thr or CUSTOM_data_thr).
x <- get_example_data() ## For GWAS results apply_threshold(GWAS_data(x[["GWAS"]]), score_thr = 4) ## For DE results - in second line, no threshold is applied ## on the log2(fold-change) apply_threshold(DE_data(x[["DE"]]), score_thr = -log10(0.05), log2fc_thr = 1) apply_threshold(DE_data(x[["DE"]]), score_thr = -log10(0.05), log2fc_thr = 0) ## No effect on the Candidate genes apply_threshold(CAN_data(x[["CAN"]])) ## For QTL mapping results apply_threshold(QTL_data(x[["QTL"]]), score_thr = 4)x <- get_example_data() ## For GWAS results apply_threshold(GWAS_data(x[["GWAS"]]), score_thr = 4) ## For DE results - in second line, no threshold is applied ## on the log2(fold-change) apply_threshold(DE_data(x[["DE"]]), score_thr = -log10(0.05), log2fc_thr = 1) apply_threshold(DE_data(x[["DE"]]), score_thr = -log10(0.05), log2fc_thr = 0) ## No effect on the Candidate genes apply_threshold(CAN_data(x[["CAN"]])) ## For QTL mapping results apply_threshold(QTL_data(x[["QTL"]]), score_thr = 4)
CAN_data objectCreates a CAN_data object from a tibble or data-frame of candidate genes.
CAN_data(dat, keep_rownames_as = NULL)CAN_data(dat, keep_rownames_as = NULL)
dat |
Tibble, set of candidate genes of interest. See Details. |
keep_rownames_as |
Character, the name of the column in which to save the
rownames of the input data-frame. Default value is |
The input data should have one row per gene, and at least the following columns:
chromosome: character column, chromosome on which the gene is located.
start and end: numeric, starting and end position of the gene (in bp).
A column position will be constructed as the middle value (mean) between
start and end.
name: character, the name of the candidate genes to be displayed.
A CAN_data object, i.e. a tibble.
x <- get_example_data() CAN_data(x[["CAN"]])x <- get_example_data() CAN_data(x[["CAN"]])
Computes the length (in bp) of each chromosome from a list of GWAS and DE results as well as candidate gene lists.
combine_chrom_length(x)combine_chrom_length(x)
x |
A list of |
A tibble with two columns: chromosome (chromosome name) and
length (chromosome length in base pair).
x <- get_example_data() y <- list( "GWAS" = GWAS_data(x[["GWAS"]]), "DE" = DE_data(x[["DE"]]), "CAN" = CAN_data(x[["CAN"]]), "QTL" = QTL_data(x[["QTL"]]) ) combine_chrom_length(y)x <- get_example_data() y <- list( "GWAS" = GWAS_data(x[["GWAS"]]), "DE" = DE_data(x[["DE"]]), "CAN" = CAN_data(x[["CAN"]]), "QTL" = QTL_data(x[["QTL"]]) ) combine_chrom_length(y)
Computes the length (in bp) of each chromosome as the maximum position of markers or genes on the chromosome.
compute_chrom_length(x) ## S3 method for class 'GWAS_data' compute_chrom_length(x) ## S3 method for class 'DE_data' compute_chrom_length(x) ## S3 method for class 'CAN_data' compute_chrom_length(x) ## S3 method for class 'QTL_data' compute_chrom_length(x) ## S3 method for class 'CUSTOM_data' compute_chrom_length(x)compute_chrom_length(x) ## S3 method for class 'GWAS_data' compute_chrom_length(x) ## S3 method for class 'DE_data' compute_chrom_length(x) ## S3 method for class 'CAN_data' compute_chrom_length(x) ## S3 method for class 'QTL_data' compute_chrom_length(x) ## S3 method for class 'CUSTOM_data' compute_chrom_length(x)
x |
Either a |
A tibble with two columns: chromosome (chromosome name) and
length (chromosome length in base pair).
x <- get_example_data() compute_chrom_length(GWAS_data(x[["GWAS"]])) compute_chrom_length(DE_data(x[["DE"]])) compute_chrom_length(CAN_data(x[["CAN"]])) compute_chrom_length(CAN_data(x[["QTL"]]))x <- get_example_data() compute_chrom_length(GWAS_data(x[["GWAS"]])) compute_chrom_length(DE_data(x[["DE"]])) compute_chrom_length(CAN_data(x[["CAN"]])) compute_chrom_length(CAN_data(x[["QTL"]]))
Creates a HIDECAN plot from a list of filtered GWAS or DE results and/or candidate genes.
create_hidecan_plot( x, chrom_length, colour_genes_by_score = TRUE, remove_empty_chrom = FALSE, chroms = NULL, chrom_limits = NULL, title = NULL, subtitle = NULL, n_rows = NULL, n_cols = 2, legend_position = "bottom", point_size = 3, label_size = 3.5, label_padding = 0.15, line_alpha = 0.7, rect_alpha = 0.3, custom_aes = NULL )create_hidecan_plot( x, chrom_length, colour_genes_by_score = TRUE, remove_empty_chrom = FALSE, chroms = NULL, chrom_limits = NULL, title = NULL, subtitle = NULL, n_rows = NULL, n_cols = 2, legend_position = "bottom", point_size = 3, label_size = 3.5, label_padding = 0.15, line_alpha = 0.7, rect_alpha = 0.3, custom_aes = NULL )
x |
A list of |
chrom_length |
Tibble with columns |
colour_genes_by_score |
Logical, whether to colour the genes by score
( |
remove_empty_chrom |
Logical, should chromosomes with no significant
markers/genes nor candidate genes be removed from the plot? Default value
if |
chroms |
Character vector, name of chromosomes to include in the plot.
If |
chrom_limits |
Integer vector of length 2, or named list where the
elements are integer vectors of length 2. If vector, gives the lower and upper
limit of the chromosomes (in bp) to use in the plot. If a named list, names
should correspond to chromosome names. Gives for each chromosome the lower
and upper limits (in bp) to use in the plot. Doesn't have to be specified
for all chromosomes. Default value is |
title |
Character, title of the plot. Default value is |
subtitle |
Character, subtitle of the plot. Default value is |
n_rows |
Integer, number of rows of chromosomes to create in the plot.
Default value is |
n_cols |
Integer, number of columns of chromosomes to create in the plot.
Default value is 2. Will be set to |
legend_position |
Character, position of the legend in the plot. Can be
|
point_size |
Numeric, size of the points in the plot. Default value is 3. |
label_size |
Numeric, size of the gene labels in the plot. Default value is
3.5 (for |
label_padding |
Numeric, amount of padding around gene labels in the plot, as unit or number. Default value is 0.15 (for geom_label_repel). |
line_alpha |
Numeric between 0 and 1, transparency of the vertical lines for genomic locations (points) across tracks. Default is 0.7. |
rect_alpha |
Numeric between 0 and 1, transparency of the shadows of genomic regions (rectangles) across tracks. Default is 0.3. |
custom_aes |
Named list of plot aesthetics for custom data types. See
|
A ggplot.
if (interactive()) { x <- get_example_data() y <- list("QTL" = QTL_data(x[["QTL"]]), "GWAS" = GWAS_data(x[["GWAS"]]), "DE" = DE_data(x[["DE"]]), "CAN" = CAN_data(x[["CAN"]])) chrom_length <- combine_chrom_length(y) z <- list( apply_threshold(y[["QTL"]], score_thr = 4), apply_threshold(y[["GWAS"]], score_thr = 4), apply_threshold(y[["DE"]], score_thr = 1.3, log2fc_thr = 0.5), apply_threshold(y[["CAN"]]) ) create_hidecan_plot(z, chrom_length, label_size = 2) ## Colour genes according to their fold-change create_hidecan_plot(z, chrom_length, colour_genes_by_score = FALSE, label_size = 2) ## Add names to the datasets create_hidecan_plot(setNames(z, c("Genomics", "RNAseq", "My list")), chrom_length, colour_genes_by_score = FALSE, label_size = 2) ## Add names to some of the datasets only (e.g. not for GWAS results) create_hidecan_plot(setNames(z, c(" ", "RNAseq", "My list")), chrom_length, colour_genes_by_score = FALSE, label_size = 2) ## Set limits on all chromosomes (to "zoom in" to the 10-20Mb region) create_hidecan_plot(z, chrom_length, label_size = 2, chrom_limits = c(10e6, 20e6)) ## Set limits on some chromosomes only create_hidecan_plot(z, chrom_length, label_size = 2, chrom_limits = list("ST4.03ch00" = c(10e6, 20e6), "ST4.03ch02" = c(15e6, 25e6))) }if (interactive()) { x <- get_example_data() y <- list("QTL" = QTL_data(x[["QTL"]]), "GWAS" = GWAS_data(x[["GWAS"]]), "DE" = DE_data(x[["DE"]]), "CAN" = CAN_data(x[["CAN"]])) chrom_length <- combine_chrom_length(y) z <- list( apply_threshold(y[["QTL"]], score_thr = 4), apply_threshold(y[["GWAS"]], score_thr = 4), apply_threshold(y[["DE"]], score_thr = 1.3, log2fc_thr = 0.5), apply_threshold(y[["CAN"]]) ) create_hidecan_plot(z, chrom_length, label_size = 2) ## Colour genes according to their fold-change create_hidecan_plot(z, chrom_length, colour_genes_by_score = FALSE, label_size = 2) ## Add names to the datasets create_hidecan_plot(setNames(z, c("Genomics", "RNAseq", "My list")), chrom_length, colour_genes_by_score = FALSE, label_size = 2) ## Add names to some of the datasets only (e.g. not for GWAS results) create_hidecan_plot(setNames(z, c(" ", "RNAseq", "My list")), chrom_length, colour_genes_by_score = FALSE, label_size = 2) ## Set limits on all chromosomes (to "zoom in" to the 10-20Mb region) create_hidecan_plot(z, chrom_length, label_size = 2, chrom_limits = c(10e6, 20e6)) ## Set limits on some chromosomes only create_hidecan_plot(z, chrom_length, label_size = 2, chrom_limits = list("ST4.03ch00" = c(10e6, 20e6), "ST4.03ch02" = c(15e6, 25e6))) }
CUSTOM_data objectCreates a CUSTOM_data object from a tibble or data-frame of custom genomic features.
CUSTOM_data(dat, keep_rownames_as = NULL)CUSTOM_data(dat, keep_rownames_as = NULL)
dat |
Tibble of custom genomic features. See Details. |
keep_rownames_as |
Character, the name of the column in which to save the
rownames of the input data-frame. Default value is |
The input data should have one row per marker, and at least the following columns:
chromosome: character column, chromosome on which the feature is located.
position: numeric, the physical position of the feature along the chromosome (in bp) OR
start and end: numeric, starting and end position of the feature
(in bp). If there is no position column, it will be constructed as the
middle value (mean) between start and end. If there is a position
column but no start and/or end columns, these will be set to the values
in the position column.
score: numeric, score to be used for the genomic feature.
A CUSTOM_data object, i.e. a tibble.
x <- get_example_data() CUSTOM_data(x[["GWAS"]])x <- get_example_data() CUSTOM_data(x[["GWAS"]])
DE_data objectCreates a DE_data object from a tibble or data-frame of differential expression
results.
DE_data(dat, keep_rownames_as = NULL)DE_data(dat, keep_rownames_as = NULL)
dat |
Tibble, results from a differential expression analysis. See Details. |
keep_rownames_as |
Character, the name of the column in which to save the
rownames of the input data-frame. Default value is |
The input data should have one row per gene or transcript, and at least the following columns:
chromosome: character column, chromosome on which the gene/transcript is located.
start and end: numeric, starting and end position of the gene/transcript
(in bp). A column position will be constructed as the middle value (mean) between
start and end.
score or padj: numeric, the DE score or adjusted p-value of the
gene/transcript. If column score column is missing, will be constructed
as -log10(padj).
foldChange or log2FoldChange: numeric, the fold-change or log2(fold-change)
of the gene/transcript. If column log2FoldChange is missing, will be constructed
as log2(foldChange).
A DE_data object, i.e. a tibble.
x <- get_example_data() DE_data(x[["DE"]])x <- get_example_data() DE_data(x[["DE"]])
Returns a list of example datasets.
get_example_data()get_example_data()
The dataset used in this example is presented in: Angelin-Bonnet et al., BMC Plant Biology (2023). In this
study, tetraploid potato plants from a half-sibling breeding population were
used to assess the genetic components of tuber bruising. Capture sequencing
was used to obtain genomic information about the individuals, and a
genome-wide association study (GWAS) was performed on 72,847 genomic
biallelic variants obtained from 158 plants for which a bruising score was
measured. The GWAS analysis was carried with the GWASpoly package. In
addition, expression data was obtained for 25,163 transcribed genes, and a
differential expression (DE) analysis was carried out between 41 low- and 33
high-bruising samples. Finally, a literature search yielded a list of 42
candidate genes identified in previous studies as involved in potato tuber
bruising mechanisms. A subset of the GWAS and DE results, as well as the list
of candidate genes from the literature, are made available in this function.
From the complete GWAS results table, half of the genomic variants with a
GWAS score < 3.5 were randomly selected and consequently discarded, yielding
a dataset with GWAS scores for 35,481 variants. Similarly, half of the
transcribed genes in the DE results table with an adjusted p-value > 0.05
were randomly selected and discarded, yielding a dataset with DE results for
10,671 transcribed genes. This filtering was performed to reduce the size of
the datasets (in accordance with CRAN policies), but ensures that all
significant markers and genes are retained in the datasets. Finally, some of
the candidate genes located on chromosome 3 were removed from the example
dataset for better clarity in the resulting HIDECAN plot, leaving 32
candidate genes. The QTL mapping data was randomly generated for illustration
purposes, as no QTL mapping was performed in the original study.
A list with the following elements:
QTL: a tibble of QTL regions, with columns id, chromosome, start,
end, score and name.
GWAS: a tibble of GWAS results, with columns id, chromosome,
position and score.
DE: a tibble of differential expression results, with columns gene,
chromosome, padj, log2FoldChange, start, end and label.
CAN: a tibble of candidate genes, with columns id, chromosome,
start, end, name and gene_name.
GWAS_data objectCreates a GWAS_data object from a tibble or data-frame of GWAS results.
GWAS_data(dat, keep_rownames_as = NULL)GWAS_data(dat, keep_rownames_as = NULL)
dat |
Tibble, results from a GWAS analysis. See Details. |
keep_rownames_as |
Character, the name of the column in which to save the
rownames of the input data-frame. Default value is |
The input data should have one row per marker, and at least the following columns:
chromosome: character column, chromosome on which the marker is located.
position: numeric, the physical position of the marker along the chromosome (in bp).
score or padj: numeric, the GWAS score or adjusted p-value of the marker.
If column score column is missing, will be constructed as -log10(padj).
A GWAS_data object, i.e. a tibble.
x <- get_example_data() GWAS_data(x[["GWAS"]])x <- get_example_data() GWAS_data(x[["GWAS"]])
Extracts GWAS results and chromosome length from GWASpoly output.
GWAS_data_from_gwaspoly(gwaspoly_output, traits = NULL, models = NULL)GWAS_data_from_gwaspoly(gwaspoly_output, traits = NULL, models = NULL)
gwaspoly_output |
A |
traits |
Character vector, traits for which GWAS results should be
extracted. If |
models |
Character vector, genetic models for which GWAS results should be
extracted. If |
A list with the following elements:
gwas_data_list: A named list of GWAS_data objects, giving the markers score for
each possible trait/genetic model combination. The names of the list are in
the form trait (genetic model).
gwas_data_thr_list: if the input data is a GWASpoly.thresh object
(from the GWASpoly::set.threshold() function), a named list of GwAS_data_thr,
with the significant markers score for each possible trait/genetic model
combination. The names of the list are in the form trait (genetic model).
chrom_length: A tibble with one row per chromosome, giving the length
(in bp) of each chromosome.
Generates a list of the default aesthetics used for HIDECAN plots.
hidecan_aes(colour_genes_by_score = TRUE)hidecan_aes(colour_genes_by_score = TRUE)
colour_genes_by_score |
Logical, whether to colour the genes by score
( |
A named list, with one element per type of data (e.g. GWAS, DE, etc). Each element is itself a list with the following elements:
y_label: prefix added to the name of a track on the y-axis of the plot.
show_as_rect: logical, whether the interval should be represented by a point
showing its mid-position (FALSE), or by a rectangle spanning its length
(TRUE).
line_colour: colour of the vertical line used to show the position of
elements of this type.
point_shape: shape used for the points of this type. Non-applicable if
show_as_rect is TRUE.
show_name: whether a label with name value should be added to points of
this type.
fill_scale: fill scale to use for the points of this type.
rect_width: if show_as_rect is TRUE, relative half-width of the rectangles
(in terms of space between two tracks).
Wrapper function to create a HIDECAN plot from GWAS results, DE results or candidate genes.
hidecan_plot( qtl_list = NULL, gwas_list = NULL, de_list = NULL, can_list = NULL, score_thr_qtl = 4, score_thr_gwas = 4, score_thr_de = 2, log2fc_thr = 1, chrom_length = NULL, colour_genes_by_score = TRUE, remove_empty_chrom = FALSE, chroms = NULL, chrom_limits = NULL, title = NULL, subtitle = NULL, n_rows = NULL, n_cols = 2, legend_position = "bottom", point_size = 3, label_size = 3.5, label_padding = 0.15, line_alpha = 0.7, rect_alpha = 0.3, custom_aes = NULL, custom_list = NULL, score_thr_custom = 0 )hidecan_plot( qtl_list = NULL, gwas_list = NULL, de_list = NULL, can_list = NULL, score_thr_qtl = 4, score_thr_gwas = 4, score_thr_de = 2, log2fc_thr = 1, chrom_length = NULL, colour_genes_by_score = TRUE, remove_empty_chrom = FALSE, chroms = NULL, chrom_limits = NULL, title = NULL, subtitle = NULL, n_rows = NULL, n_cols = 2, legend_position = "bottom", point_size = 3, label_size = 3.5, label_padding = 0.15, line_alpha = 0.7, rect_alpha = 0.3, custom_aes = NULL, custom_list = NULL, score_thr_custom = 0 )
qtl_list |
Data-frame or list of data-frames containing QTL mapping
results, each with at least a |
gwas_list |
Data-frame or list of data-frames containing GWAS results,
each with at least a |
de_list |
Data-frame or list of data-frames containing DE results, each
with at least a |
can_list |
Data-frame or list of data-frames containing candidate genes,
each with at least a |
score_thr_qtl |
Numeric, the score threshold for QTL mapping results that will be used to select which markers will be plotted. Default value is 4. |
score_thr_gwas |
Numeric, the score threshold for GWAS results that will be used to select which markers will be plotted. Default value is 4. |
score_thr_de |
Numeric, the score threshold for DE results that will be used to select which markers will be plotted. Default value is 2. |
log2fc_thr |
Numeric, the log2(fold-change) threshold that will be used to select which genes will be plotted. Default value is 1. |
chrom_length |
Optional, tibble with columns |
colour_genes_by_score |
Logical, whether to colour the genes by score
( |
remove_empty_chrom |
Logical, should chromosomes with no significant
markers/genes nor candidate genes be removed from the plot? Default value
if |
chroms |
Character vector, name of chromosomes to include in the plot.
If |
chrom_limits |
Integer vector of length 2, or named list where the
elements are integer vectors of length 2. If vector, gives the lower and upper
limit of the chromosomes (in bp) to use in the plot. If a named list, names
should correspond to chromosome names. Gives for each chromosome the lower
and upper limits (in bp) to use in the plot. Doesn't have to be specified
for all chromosomes. Default value is |
title |
Character, title of the plot. Default value is |
subtitle |
Character, subtitle of the plot. Default value is |
n_rows |
Integer, number of rows of chromosomes to create in the plot.
Default value is |
n_cols |
Integer, number of columns of chromosomes to create in the plot.
Default value is 2. Will be set to |
legend_position |
Character, position of the legend in the plot. Can be
|
point_size |
Numeric, size of the points in the plot. Default value is 3. |
label_size |
Numeric, size of the gene labels in the plot. Default value is
3.5 (for |
label_padding |
Numeric, amount of padding around gene labels in the plot, as unit or number. Default value is 0.15 (for geom_label_repel). |
line_alpha |
Numeric between 0 and 1, transparency of the vertical lines for genomic locations (points) across tracks. Default is 0.7. |
rect_alpha |
Numeric between 0 and 1, transparency of the shadows of genomic regions (rectangles) across tracks. Default is 0.3. |
custom_aes |
Named list of plot aesthetics for custom data types. See
|
custom_list |
Data-frame or list of data-frames containing custom
genomic features, each with at least a |
score_thr_custom |
Numeric, the score threshold for custom genomic features that will be used to select which markers will be plotted. Default value is 0. |
a ggplot.
if (interactive()) { x <- get_example_data() ## Typical example with one GWAs result table, one DE result table and ## one table of candidate genes hidecan_plot(qtl_list = x[["QTL"]], gwas_list = x[["GWAS"]], de_list = x[["DE"]], can_list = x[["CAN"]], score_thr_qtl = -log10(0.0001), score_thr_gwas = -log10(0.0001), score_thr_de = -log10(0.005), log2fc_thr = 0, label_size = 2) ## Example with two sets of GWAS results hidecan_plot(gwas_list = list(x[["GWAS"]], x[["GWAS"]]), score_thr_gwas = 4) ## Example with two sets of DE results, with names hidecan_plot(de_list = list("X vs Y" = x[["DE"]], "X vs Z" = x[["DE"]]), score_thr_de = -log10(0.05), log2fc_thr = 0) ## Set limits on all chromosomes (to "zoom in" to the 10-20Mb region) hidecan_plot(qtl_list = x[["QTL"]], gwas_list = x[["GWAS"]], de_list = x[["DE"]], can_list = x[["CAN"]], score_thr_qtl = -log10(0.0001), score_thr_gwas = -log10(0.0001), score_thr_de = -log10(0.005), log2fc_thr = 0, label_size = 2, chrom_limits = c(10e6, 20e6)) ## Set limits on some chromosomes only hidecan_plot(qtl_list = x[["QTL"]], gwas_list = x[["GWAS"]], de_list = x[["DE"]], can_list = x[["CAN"]], score_thr_qtl = -log10(0.0001), score_thr_gwas = -log10(0.0001), score_thr_de = -log10(0.005), log2fc_thr = 0, label_size = 2, chrom_limits = list("ST4.03ch00" = c(10e6, 20e6), "ST4.03ch02" = c(15e6, 25e6))) }if (interactive()) { x <- get_example_data() ## Typical example with one GWAs result table, one DE result table and ## one table of candidate genes hidecan_plot(qtl_list = x[["QTL"]], gwas_list = x[["GWAS"]], de_list = x[["DE"]], can_list = x[["CAN"]], score_thr_qtl = -log10(0.0001), score_thr_gwas = -log10(0.0001), score_thr_de = -log10(0.005), log2fc_thr = 0, label_size = 2) ## Example with two sets of GWAS results hidecan_plot(gwas_list = list(x[["GWAS"]], x[["GWAS"]]), score_thr_gwas = 4) ## Example with two sets of DE results, with names hidecan_plot(de_list = list("X vs Y" = x[["DE"]], "X vs Z" = x[["DE"]]), score_thr_de = -log10(0.05), log2fc_thr = 0) ## Set limits on all chromosomes (to "zoom in" to the 10-20Mb region) hidecan_plot(qtl_list = x[["QTL"]], gwas_list = x[["GWAS"]], de_list = x[["DE"]], can_list = x[["CAN"]], score_thr_qtl = -log10(0.0001), score_thr_gwas = -log10(0.0001), score_thr_de = -log10(0.005), log2fc_thr = 0, label_size = 2, chrom_limits = c(10e6, 20e6)) ## Set limits on some chromosomes only hidecan_plot(qtl_list = x[["QTL"]], gwas_list = x[["GWAS"]], de_list = x[["DE"]], can_list = x[["CAN"]], score_thr_qtl = -log10(0.0001), score_thr_gwas = -log10(0.0001), score_thr_de = -log10(0.005), log2fc_thr = 0, label_size = 2, chrom_limits = list("ST4.03ch00" = c(10e6, 20e6), "ST4.03ch02" = c(15e6, 25e6))) }
Creates a HIDECAN plot from the GWAS results from GWASpoly.
hidecan_plot_from_gwaspoly(gwaspoly_output, traits = NULL, models = NULL, ...)hidecan_plot_from_gwaspoly(gwaspoly_output, traits = NULL, models = NULL, ...)
gwaspoly_output |
A |
traits |
Character vector, traits for which GWAS results should be
extracted. If |
models |
Character vector, genetic models for which GWAS results should be
extracted. If |
... |
Further arguments passed to the |
A ggplot.
Creates a Manhattan plot from a data-frame of GWAS results.
manhattan_plot( gwas_list, score_thr = NULL, chroms = NULL, title = NULL, subtitle = NULL, size_range = c(1, 3), chrom_col = NULL, ncol = NULL )manhattan_plot( gwas_list, score_thr = NULL, chroms = NULL, title = NULL, subtitle = NULL, size_range = c(1, 3), chrom_col = NULL, ncol = NULL )
gwas_list |
Data-frame or list of data-frames containing GWAS results,
each with at least a |
score_thr |
Numeric, the significance threshold on GWAS score. If a value
is provided, will be represented in the Manhattan plot as a red dashed line. If
|
chroms |
Character vector, name of chromosomes to include in the plot.
If |
title |
Character, title of the plot. Default value is |
subtitle |
Character, subtitle of the plot. Default value is |
size_range |
Numeric vector of length 2, the minimum and maximum point
size in the plot. Points size is proportional to their GWAS score. Default
value is |
chrom_col |
Character vector of colour names or code, colours to use to draw
the points for each chromosome. Names will be ignored. If vector provided
contains less colours than the number of chromosomes to plot, the values will
be recycled. If |
ncol |
Integer, number of Manhattan plots per row when several GWAS results are provided. |
A ggplot.
if (interactive()){ x <- get_example_data()[["GWAS"]] manhattan_plot(x) ## Adding a significance threshold line in the plot manhattan_plot(x, score_thr = 4) ## Use only two colours for the chromosomes manhattan_plot(x, score_thr = 4, chrom_col = c("dodgerblue1", "dodgerblue4")) }if (interactive()){ x <- get_example_data()[["GWAS"]] manhattan_plot(x) ## Adding a significance threshold line in the plot manhattan_plot(x, score_thr = 4) ## Use only two colours for the chromosomes manhattan_plot(x, score_thr = 4, chrom_col = c("dodgerblue1", "dodgerblue4")) }
CAN_data constructorCAN_data constructor
new_CAN_data(dat)new_CAN_data(dat)
dat |
Tibble, containing information about genes of interest, with at least columns
|
A CAN_data object, i.e. a tibble.
CUSTOM_data constructorCUSTOM_data constructor
new_CUSTOM_data(dat)new_CUSTOM_data(dat)
dat |
Tibble, custom genomic features, with at least columns
|
A GWAS_data object, i.e. a tibble.
DE_data constructorDE_data constructor
new_DE_data(dat)new_DE_data(dat)
dat |
Tibble, results from a differential expression analysis, with at least columns
|
A DE_data object, i.e. a tibble.
GWAS_data constructorGWAS_data constructor
new_GWAS_data(dat)new_GWAS_data(dat)
dat |
Tibble, results from a GWAS analysis, with at least columns
|
A GWAS_data object, i.e. a tibble.
QTL_data constructorQTL_data constructor
new_QTL_data(dat)new_QTL_data(dat)
dat |
Tibble, results from a QTL mapping, with at least columns
|
A QTL_data object, i.e. a tibble.
QTL_data objectCreates a QTL_data object from a tibble or data-frame of QTL mapping
results.
QTL_data(dat, keep_rownames_as = NULL)QTL_data(dat, keep_rownames_as = NULL)
dat |
Tibble, results from a QTL mapping analysis. See Details. |
keep_rownames_as |
Character, the name of the column in which to save
the rownames of the input data-frame. Default value is |
The input data should have one row per QTL region, and at least the following columns:
chromosome: character column, chromosome on which the QTL region is located.
start and end: numeric, starting and end position of the QTL region
(in bp). A column position will be constructed as the middle value (mean)
between start and end.
score or padj: numeric, the QTL score or adjusted p-value of the
QTL region. If column score column is missing, will be constructed as
-log10(padj).
A QTL_data object, i.e. a tibble.
x <- get_example_data() QTL_data(x[["QTL"]])x <- get_example_data() QTL_data(x[["QTL"]])
Starts the HIDECAN shiny app. The app reads in csv data to produce a HIDECAN plot.
run_hidecan_shiny()run_hidecan_shiny()
No return value, called for side effects (launching the shiny app).
CAN_data constructorChecks validity of input for CAN_data constructor
validate_CAN_data(x)validate_CAN_data(x)
x |
a |
A CAN_data object, i.e. a tibble.
CUSTOM_data constructorChecks validity of input for CUSTOM_data constructor
validate_CUSTOM_data(x)validate_CUSTOM_data(x)
x |
a |
A CUSTOM_data object, i.e. a tibble.
DE_data constructorChecks validity of input for DE_data constructor
validate_DE_data(x)validate_DE_data(x)
x |
a |
A DE_data object, i.e. a tibble.
GWAS_data constructorChecks validity of input for GWAS_data constructor
validate_GWAS_data(x)validate_GWAS_data(x)
x |
a |
A GWAS_data object, i.e. a tibble.
QTL_data constructorChecks validity of input for QTL_data constructor
validate_QTL_data(x)validate_QTL_data(x)
x |
a |
A QTL_data object, i.e. a tibble.