about summary refs log tree commit diff
path: root/test/python
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-07 18:23:36 +0000
committerPjotr <wrk@bosa.lan>2026-11-07 18:23:36 +0000
commitc087e4186874921f48caefa2d8630f5bf05b3c0d (patch)
treedf827dd62afdb72476f89f31fa69cac5b5d4c92a /test/python
parentf9ba0f12e3bf52919fc363c037fbf0a0deda8c17 (diff)
downloadgenenetwork4-c087e4186874921f48caefa2d8630f5bf05b3c0d.tar.gz
plot: take a posted result, and never re-run the mapping
The plot endpoints ran the mapping themselves, which meant the picture
could come from a different run than the one the caller was looking at,
and cost a scan to draw. They now take the mapping's own response -- the
JSON /compute/{rqtl,gemma} returned, posted back -- and hand it straight
to the plotter, which is what the scripts were written for
(`python3 plot-rqtl.py result.json -o out.svg --trait …`).

Validation replaces the run: `/plot/rqtl` needs `data.markers` with
positional 4+ column rows, `/plot/gemma` needs `data` rows *and*
`meta.columns` (its plotter reads the column names to find `p_lrt`), and
anything else is a 422 saying "post that response back". `/plot/rqtl`
also accepts just the `data` member; GEMMA cannot, and says why.

The mapping's `actions` suggestion now describes posting its own response
and carries no body -- duplicating a 21 000-row response into a
suggestion would double the envelope for nothing, and the caller already
holds it.

* src/routes/plot.rs: posted result, shape validation, `?trait`/`?title`
and `?bonferroni=false` passthrough to the scripts; no compute imports.
* src/routes/{rqtl,gemma}.rs: the plot suggestion loses its body.
* tests/plot.rs: canned results instead of real mappings -- the tests now
  need only the plotter, no Rscript or gemma; covers both engines, the
  bare-`data` form, and the 422 for a body that is a request.
* README.md, docs/www/ai-instruction.md (4a), docs/www/operator-checklist.md:
  "post the response back", and why GEMMA needs `meta.columns`.
Diffstat (limited to 'test/python')
0 files changed, 0 insertions, 0 deletions