From b3811de4f2fb0e1d65ade757ad3ea992eb3f9f67 Mon Sep 17 00:00:00 2001 From: Pjotr Date: Tue, 10 Nov 2026 22:35:45 +0000 Subject: traits: genotypes at a confirmed peak, and the plot of them Returning genotypes is the one thing this API otherwise never does, so it is fenced and the fence is the feature: GET /groups/{group}/traits/{trait_id}/peak-genotypes?marker= * the server re-runs the R/qtl scan for the trait -- the same machinery and gate as /compute/rqtl -- and takes the peak from that run, rather than trusting a client that names a marker; * the marker must lie within ?window= Mb of that peak (default 10), or the answer is 422 not_the_peak quoting the peak's marker, chromosome, Mb and LOD; * the peak must reach ?min_lod= (default 3), or 422 not_a_hit; * only animals that have a value for the trait are listed, and only this marker's calls. Nothing else of the matrix leaves. On DOL 10003 that is UNCHS026345 (chr9 75.76 Mb, LOD 5.86) with 192 animals across A 110 / B 8 / H 74 -- the two a class of eight being exactly the thing worth seeing. POST /plot/genotypes draws R/qtl's Fig 4.1 from it: post the reply's `animals` (or its `genotypes` map) with the trait's values and get an SVG with one point per animal, genotype class across, value up, class means marked. Nothing is recomputed -- the plot is of the numbers the client sends, like the other plots. New script scripts/plot-genotypes.py (stdlib-only SVG, like its siblings) and the GENOTYPE_PLOTTER key. tests/peakgenotypes.rs: the peak's calls for animals with values (with the counts agreeing with the rows), the SVG, and a marker on another chromosome refused with the peak quoted. Also keeps /compute/rqtl's error order: naming both a group and a file is "ambiguous" even when the request also forgot its values. --- docs/www/SKILL.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs') diff --git a/docs/www/SKILL.md b/docs/www/SKILL.md index 73c50bb..c1e4dd6 100644 --- a/docs/www/SKILL.md +++ b/docs/www/SKILL.md @@ -171,6 +171,13 @@ header (peak and, for GEMMA, the Bonferroni line). depend on relatedness, or when the panel is multiparent; it is slower than `/compute/rqtl` (a DO cross costs minutes of genotype probabilities, cached per panel). Autosomes only, and `notes` says what was left out. +* **Genotypes at a peak** (the only genotypes the API returns): + `GET /groups/{g}/traits/{id}/peak-genotypes?marker=` re-runs the + scan, confirms the marker is at the peak (within `?window=` Mb, LOD ≥ + `?min_lod=`) and returns one call per animal **that has a value** — + `422 not_the_peak` / `not_a_hit` otherwise. Plot it by posting that reply's + `genotypes` with the trait's values to `POST /plot/genotypes` (R/qtl book + Fig 4.1: genotype class across, value up). * `.../markers/{marker}/classes?trait=` summarises a trait's values per genotype class (`n`, `mean`, `sd`, `min`, `max`) at one marker — how you see that a peak rests on two animals, or that a marker is nearly -- cgit 1.4.1