Skip to contents

This function takes a dataframe of bootstrap contributions for signatures and visualizes them using boxplots. It highlights significant contributions based on a p-value threshold and a minimum contribution threshold.

Usage

sig_visualise_bootstraps(
  bootstraps,
  min_contribution_threshold = 0.05,
  pvalue = 0.05,
  horizontal = FALSE,
  width = 0.6,
  staplewidth = 0.8,
  title = TRUE,
  ...
)

Arguments

bootstraps

A dataframe in sigverse style describing bootstraps. See sigshared::example_bootstraps().

min_contribution_threshold

Numeric value representing the minimum contribution threshold to consider (default is 0.05). See threshold argument of sigstats::sig_compute_experimental_p_value().

pvalue

The p-value threshold for significance (default is 0.05). P values are computed using sigstats::sig_compute_experimental_p_value()

horizontal

flip the coordinates so that signatures are on the X axis and contributions are on the Y axis.

width

Width of the boxplots (value between 0 and 1).

staplewidth

The relative width of staples to the width of the box. Staples mark the ends of the whiskers with a line.

title

should a plot title be shown? (flag)

...

Arguments passed on to boxplotstats::plot_boxplot_stats

stats

A dataframe containing boxplot statistics with required columns: 'outlier_low_threshold', 'outlier_high_threshold', 'median', 'q1', 'q3', and 'outliers'.

xlab

A character string specifying the x-axis label. Default is "Value".

ylab

A character string specifying the y-axis label. Default is "ID".

delim

The delimiter used in the 'outliers' column for splitting string-based outliers into numeric values. Default is "|".

sort

Logical, whether to sort boxplots by the 'median' column. Default is TRUE.

descending

Logical, if sorting, whether to sort in descending order. Default is TRUE.

col_fill

Optional column name for determining the fill color of the boxplot.

col_colour

Optional column name for determining the outline color of the boxplot.

col_tooltip

Optional column name for custom tooltips in the interactive plot. Default is a generated tooltip.

col_data_id

Optional column name for the data_id used in interactivity.

col_onclick

Optional column name for specifying the onclick actions in the interactive plot.

show_legend

Logical, whether to show the legend for color and fill. Default is TRUE.

dotsize

Size of outlier points. Default is 1.

dotstroke

Stroke width of outlier points. Default is 1.

dotshape

Shape of outlier points. Default is 1.

linewidth

Width of the boxplot outlines. Default is 0.5.

Value

A ggplot object representing the boxplot visualization of bootstrap contributions.

Examples

library(sigshared)
sig_visualise_bootstraps(example_bootstraps())