From e552bb6407718c986123e574a59494ca6184f2e2 Mon Sep 17 00:00:00 2001 From: Pjotr Date: Fri, 13 Nov 2026 13:27:06 +0000 Subject: plot/bnw: two SVG figures, drawn the way /plot/gemma draws one Post the reply from /compute/bnw back and get an SVG: the same plumbing as /plot/gemma and /plot/bulklmm (plot::render, PLOT_PYTHON + BNW_PLOTTER, image/ svg+xml, the plotter's line in x-plot-summary), nothing recomputed. Two figures, because one cannot say what the other can: * the network (default): nodes on a circle, one arrow per edge that survived the threshold, arrow width and label = the edge's posterior, and the below-threshold edges as faint dotted lines -- so a reader sees what was *considered* as well as what survived, which is half of why the posterior table exists; * ?kind=posterior: every candidate edge as a cell in a matrix, dark = high posterior, outlined cells are the ones above the threshold. The diagram cannot show that an edge came within 0.02 of the threshold; this can. Pure-Python SVG, standard library only: no graphviz in the deployment. A circular layout is less pretty than a force-directed one and is deterministic, which matters more for a figure that accompanies a JSON result. Node labels keep the distinguishing tail of a long id, with the full name beside the node. Verified live on the dev instance: POST /plot/bnw with a saved /compute/bnw reply returns 200, image/svg+xml, 5 256 bytes, and x-plot-summary naming the strongest edge (Trait2 -> Trait1, posterior 1.000); ?kind=posterior returns the second figure. tests/plot.rs covers both figures plus the 422s (not a BNW result, unknown kind). --- docs/www/SKILL.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/www/SKILL.md b/docs/www/SKILL.md index bb8bd3e..b14d08e 100644 --- a/docs/www/SKILL.md +++ b/docs/www/SKILL.md @@ -160,7 +160,10 @@ header (peak, and the reference lines drawn when you asked for them). this sample, so quote it as a structural claim and never as a threshold on a QTL. Parameters default to BNW's own (maxparents 4, k 1, tiers 3, threshold 0.5) and the reply names the ones used. At most 40 variables, at least 3 - samples complete across every variable. + samples complete across every variable. `POST /plot/bnw` draws it from the + posted reply — the network by default, `?kind=posterior` for the matrix of + every candidate edge (arrow width and label are the posterior; dotted lines + are edges that did not clear the threshold). * `/compute/fitqtl`: **how big** an effect is, not just where. Give it the marker names a scan found (its peaks) and it fits R/qtl's `fitqtl` at each: columns `marker, chr, pos, lod, pct_var, additive, se, t, p`. Use it -- cgit 1.4.1