From 8bb9c54d2eb7b4ae2d330a588eff32feceb4324f Mon Sep 17 00:00:00 2001 From: Pjotr Date: Wed, 11 Nov 2026 14:49:16 +0000 Subject: plot/bulklmm: the 0.05 and 0.01 lines, never 0.10 unless asked Checked what the plot actually draws: it has never drawn the alpha 0.10 line -- the plotter matches 0.05 and 0.01 only. What lists all three is the reply's notes ("alpha 0.01: LOD 4.58, alpha 0.05: 3.65, alpha 0.1: 3.50"), which is where the 0.10 came from. Still, the point stands on its own: 0.10 is the loosest bar in the set and drawing it invites reading it as the line to clear. So the defaults are stated and pinned -- 0.05 and 0.01 on the plot, 0.10 only on request (?all_thresholds=true, or an explicit ?thresholds=) -- alongside GEMMA's Bonferroni, which is opt-in for the same reason: a reference line is an annotation, not a result. tests/bulklmm.rs counts the lines: exactly two by default, and no alpha 0.10 label. --- src/routes/plot.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/routes/plot.rs b/src/routes/plot.rs index cf73637..8bcbd5b 100644 --- a/src/routes/plot.rs +++ b/src/routes/plot.rs @@ -48,6 +48,9 @@ pub struct PlotParams { /// Labels for those lines, comma separated and in the same order, e.g. /// "bulklmm alpha 0.05". Anything missing defaults to "bulklmm threshold". pub threshold_labels: Option, + /// BulkLMM only: also draw the loosest line the reply reports + /// (alpha 0.10). The default is the genome-wide 0.05 and the stricter 0.01. + pub all_thresholds: Option, } /// The reference lines a caller passed, validated: `(value, label)`. @@ -254,7 +257,7 @@ pub async fn plot_rqtl( member) and get the plot scripts/plot-gemma.py draws from it: -log10(p_lrt) per marker. \ **No reference line is drawn unless one is asked for** -- a line is an annotation, not part of \ the result, and each is labelled with where it came from: `?bonferroni=true` for GEMMA's own \ --Bonferroni (0.05 over the analysed markers, computed by the plotter, conservative under \ +Bonferroni (0.05 over the analysed markers, computed by the plotter, conservative under \ linkage and unrelated to relatedness), and `?thresholds=` for a threshold another engine \ computed on the same values (e.g. /compute/bulklmm's rotation thresholds). Nothing is \ recomputed. image/svg+xml, not the JSON envelope; `x-plot-summary` carries the plotter's \ @@ -574,6 +577,20 @@ pub async fn plot_bulklmm( extra.push("--title".to_string()); extra.push(title.to_string()); } + if matches!( + plot_params.all_thresholds.as_deref(), + Some("true") | Some("1") | Some("yes") | Some("all") + ) { + extra.push("--all-thresholds".to_string()); + } + for (value, label) in external_thresholds( + plot_params.thresholds.as_deref(), + plot_params.threshold_labels.as_deref(), + &rid, + )? { + extra.push("--threshold".to_string()); + extra.push(format!("{value}:{label}")); + } let borrowed: Vec<&str> = extra.iter().map(String::as_str).collect(); let rendered = plot::render( &config.plot_python, -- cgit 1.4.1