Set Up a Significance Plot Configuration
Source:R/config_significance.R
setup_SignificanceConfig.RdBuild a validated configuration with provenance for authored settings.
Usage
setup_SignificanceConfig(
view = "volcano",
estimate = "estimate",
p_value = "p_value",
label = NULL,
p_adjust_method = "holm",
n_tests = NULL,
p_transform = "neg_log10",
p_thresh = 0.05,
x_thresh = 0,
zero_cap = NULL,
annotate_n = 7L,
reference = TRUE,
legend = TRUE,
negative_color = NULL,
neutral_color = NULL,
positive_color = NULL,
alpha = 0.8,
point_size = 8,
xlab = NULL,
ylab = NULL,
xlim = NULL,
ylim = NULL,
margin_top = NULL,
margin_right = NULL,
margin_bottom = NULL,
margin_left = NULL,
title = NULL,
dat_path = NULL,
origin = NULL,
writer = NULL,
legend_position = "top",
legend_placement = "outside",
legend_title = NULL,
group = NULL,
palette = NULL,
zoom = FALSE
)Arguments
- view
Character {"volcano", "manhattan"}: Scatter or categorical bar view.
- estimate
Character: Column containing coefficients or other signed effects.
- p_value
Character: Column containing unadjusted p-values.
- label
Optional Character: Outcome-label column. Unset generates row labels.
- p_adjust_method
Character: Method from stats::p.adjust.methods. Adjustment precedes transformation.
- n_tests
Optional Integer [1, Inf): Hypothesis-family size, at least the number of supplied rows. Unset counts all rows, including missing p-values.
- p_transform
Character {"neg_log10", "identity", "one_minus"}: Named display transform of adjusted p-values.
- p_thresh
Numeric (0, 1]: Significance threshold on adjusted p-values; the comparison is strict.
- x_thresh
Numeric: Effect threshold separating low and high significant results.
- zero_cap
Optional Numeric (0, Inf): Finite display height for zero p-values under neg_log10; must exceed all finite heights and the significance reference. Unset computes a cap one unit above their rounded-up maximum.
- annotate_n
Integer [0, Inf): Maximum significant feature labels per side in the volcano view, ranked by raw p-value with input-order ties.
- reference
Logical: Show the transformed significance threshold and, for volcanoes, the effect threshold.
- legend
Logical: Show the nonempty significance groups.
- negative_color
Optional Character: Color for significant effects below x_thresh.
NULLuses the theme's negative color.- neutral_color
Optional Character: Color for other results, including effects equal to x_thresh.
NULLuses the theme's neutral color.- positive_color
Optional Character: Color for significant effects above x_thresh.
NULLuses the theme's positive color.- alpha
Numeric
[0, 1]: Mark opacity.- point_size
Numeric (0, Inf): Scatter symbol size in pixels.
- xlab
Optional Character: X-axis label.
- ylab
Optional Character: Y-axis label.
- xlim
Optional Numeric: Exactly two increasing finite volcano x-axis limits. Not used by the categorical view.
- ylim
Optional Numeric: Exactly two increasing finite y-axis limits.
- margin_top
Optional Integer [0, Inf): Top plot margin in pixels.
- margin_right
Optional Integer [0, Inf): Right plot margin in pixels.
- margin_bottom
Optional Integer [0, Inf): Bottom plot margin in pixels.
- margin_left
Optional Integer [0, Inf): Left plot margin in pixels.
- title
Optional Character: Chart title. Declared here because it is the one property every chart type has;
paletteis not (four take acolormapinstead), and axis labels and margins are cartesian-only.- dat_path
Optional Character: Path to the data, read at draw time. The serializable alternative to passing
datatodraw().- origin
Optional Named character: Per-property provenance.
- writer
Optional Named character: Interface name and version.
- legend_position
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row.
- legend_placement
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend.
- legend_title
Optional Character: Title drawn with the legend or colorbar: above left/right legends and vertical colorbars, before the first row of top/bottom legends and horizontal colorbars.
NULLdraws no title. A title does not add a missing legend.- group
Optional Character: Display-group column. Unset colors by significance and effect direction. Missing groups omit marks after full-family adjustment. Groups never change significance thresholds or annotation ranking.
- palette
Optional Character vector: Display-group colors in first-appearance order; unset uses the theme. Requires a group binding.
- zoom
Logical: Enable Shift+wheel zoom and drag panning: on both axes with box-zoom, undo, and reset controls for volcano plots, and with a slider on the outcome axis for Manhattan plots.
Value
A SignificanceConfig object.
Examples
setup_SignificanceConfig(view = "manhattan", p_adjust_method = "BH")#> <SignificanceConfig>
#>
#> type: <chr> significance
#> dat_path: <NUL> NULL
#> title: <NUL> NULL
#> origin: <chr> default, default, default, default, ...
#> writer: <NUL> NULL
#> legend_position: <chr> top
#> legend_placement: <chr> outside
#> legend_title: <NUL> NULL
#> view: <chr> manhattan
#> estimate: <chr> estimate
#> p_value: <chr> p_value
#> label: <NUL> NULL
#> group: <NUL> NULL
#> palette: <NUL> NULL
#> p_adjust_method: <chr> BH
#> n_tests: <NUL> NULL
#> p_transform: <chr> neg_log10
#> p_thresh: <nmr> 0.05
#> x_thresh: <nmr> 0.00
#> zero_cap: <NUL> NULL
#> annotate_n: <int> 7
#> reference: <lgc> TRUE
#> legend: <lgc> TRUE
#> zoom: <lgc> FALSE
#> negative_color: <NUL> NULL
#> neutral_color: <NUL> NULL
#> positive_color: <NUL> NULL
#> alpha: <nmr> 0.80
#> point_size: <nmr> 8.00
#> xlab: <NUL> NULL
#> ylab: <NUL> NULL
#> xlim: <NUL> NULL
#> ylim: <NUL> NULL
#> margin_top: <NUL> NULL
#> margin_right: <NUL> NULL
#> margin_bottom: <NUL> NULL
#> margin_left: <NUL> NULL
#>