library(rtemis.draw)
Attaching package: 'rtemis.draw'
The following object is masked from 'package:graphics':
Axis
Attaching package: 'rtemis.draw'
The following object is masked from 'package:graphics':
Axis
Use draw_volcano() to compare effect sizes with statistical evidence, and draw_manhattan() to compare that evidence in a fixed outcome order. Both accept signed estimates and raw p-values, then apply the requested multiple-testing adjustment.
Consider a simulated assay study measuring 16 markers in two independent groups of 40 samples. A few markers have higher or lower means in the second group; the remaining markers have no simulated mean difference. All measurements use the same arbitrary units:
set.seed(24)
mean_difference <- c(-1.8, -1.2, -0.6, -0.3, rep(0, 8), 0.3, 0.6, 1.2, 1.8)
reference <- matrix(rnorm(40 * 16), ncol = 16)
comparison <- sweep(matrix(rnorm(40 * 16), ncol = 16),
2, mean_difference, "+")
estimates <- colMeans(comparison) - colMeans(reference)
p_values <- vapply(seq_len(16), function(j) {
t.test(comparison[, j], reference[, j])[["p.value"]]
}, numeric(1))
marker_names <- LETTERS[seq_len(16)]Each estimate is the observed difference in means, comparison minus reference. Each p-value comes from a two-sided Welch t-test. These are simulated measurements, not findings about named biological markers.
A volcano plot places the estimated difference on the horizontal axis and -log10 of the adjusted p-value on the vertical axis:
Higher points have smaller adjusted p-values. The horizontal reference marks an adjusted p-value of 0.05. Teal and magenta distinguish significant positive and negative estimates; gray marks the remaining results. annotate_n = 3L labels up to three significant markers on each side. Hover a point to see its estimate and both its raw and adjusted p-values.
The default Holm adjustment applies to all 16 tests. Supply the complete family of raw p-values; pre-adjusting them would apply the correction twice. Use a different p_adjust_method, such as "BH", when it matches the error criterion chosen for your analysis. Statistical significance does not by itself establish that an effect is large or practically useful.
The categorical Manhattan view retains input order. Bar height represents the same adjusted p-value transformation, and color retains the direction of the estimated effect:
This is an outcome-by-outcome view; the horizontal positions are categories, not genomic coordinates. Click a legend entry to hide or restore its group.
Use group when color should identify an assay panel or another outcome category. The testing family still includes every supplied p-value, and the threshold guides and selected annotations retain their statistical meaning. Here the simulated markers are divided into two assay panels:
Groups follow their first appearance among displayed observations. palette can override the theme colors in that order. Missing group labels omit their marks after adjustment; they do not reduce the testing family. The same group argument works with draw_manhattan() and draw_pvals().
Save either view as an SVG:
For a fitted mass-univariate model, plot(model) and rtemis::plot_manhattan(model) extract estimates and raw p-values for you. See Plotting model objects.
For the bounded one-minus-p-value view, use draw_pvals() with the same raw p-values and an explicit adjustment method:
The reference is one minus the significance threshold. This view approaches one as evidence increases; it does not use a logarithmic scale.