about summary refs log tree commit diff
path: root/test/python
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-13 13:27:06 +0000
committerPjotr <wrk@bosa.lan>2026-11-13 13:27:06 +0000
commite552bb6407718c986123e574a59494ca6184f2e2 (patch)
tree8543d8f5fd3277525cc9685e65913dae30012201 /test/python
parentd9e1bf7fd9da4e0bae6579b95fd0028296b997ac (diff)
downloadgenenetwork4-e552bb6407718c986123e574a59494ca6184f2e2.tar.gz
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).
Diffstat (limited to 'test/python')
0 files changed, 0 insertions, 0 deletions