about summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-10 22:35:45 +0000
committerPjotr <wrk@bosa.lan>2026-11-10 22:35:45 +0000
commitb3811de4f2fb0e1d65ade757ad3ea992eb3f9f67 (patch)
treeaad2b1cb2b97f08e202f1931bcd590ecba408e56 /docs
parent62cc5f73cb94fe85c31a2f177d1d150e643e84b1 (diff)
downloadgenenetwork4-b3811de4f2fb0e1d65ade757ad3ea992eb3f9f67.tar.gz
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=<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.
Diffstat (limited to 'docs')
-rw-r--r--docs/www/SKILL.md7
1 files changed, 7 insertions, 0 deletions
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=<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=<id>` 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