about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPjotr Prins <pjotr.public01@thebird.nl>2026-11-22 18:45:52 +0000
committerPjotr Prins <pjotr.public01@thebird.nl>2026-11-22 18:45:52 +0000
commit7281ee24bc479831fbfd5679896202685dffc49a (patch)
treeec78cc30b9f4c67ee418363ececd197a8d72a876
parentb223757bb5c04d03be5ccccf32488594134bb542 (diff)
downloadgenenetwork4-7281ee24bc479831fbfd5679896202685dffc49a.tar.gz
docs: the six things a real test drive found wrong
A beta user's notes (Rob Williams, 2026-11-21) reported six things that were
wrong or misleading from the outside.  Each is fixed where it lives:

* the sparse clone in section 8 does not work against this server ("dumb http
  transport does not support shallow capabilities"); a shallow clone is 19 MB and
  under two minutes, so the instruction is `--depth 1` and an explicit warning
  against `--sparse`.
* "There are no write endpoints" contradicted section 3, which documents
  baskets, matrices and genotype uploads.  The data is read-only; the caller's
  own material is not.
* the basket note said to map with /compute/qtl2 -- all four mapping routes take
  `"basket"`, and the note (code and doc) now says so.
* "100 permutations take about 14 s" is not a constant: the cost is strains x
  permutations, measured at 22 s for 1,000 on 21 strains, 221 s on 93 and 463 s
  on 87.
* /compute/gemma is described as gemma-wrapper.  It has run the Slurm route by
  default since the engine switch, so "send the same body to both and compare"
  compares ravanan with itself; the doc now says what the default is, how to read
  which engine answered from meta.timing, and that the wrapper is the fallback.
* /compute/rqtl's rows moved into `data` (previous commit); the doc says so, and
  that the permutation null is `meta.permutation`.
-rw-r--r--docs/www/SKILL.md52
-rw-r--r--src/routes/baskets.rs9
2 files changed, 44 insertions, 17 deletions
diff --git a/docs/www/SKILL.md b/docs/www/SKILL.md
index 2fa2385..6c8338e 100644
--- a/docs/www/SKILL.md
+++ b/docs/www/SKILL.md
@@ -194,10 +194,19 @@ Two endpoints run the same computation, and the reply shape is identical:
 | endpoint | runs |
 |---|---|
 | `/compute/gemma/ravanan` | `gemma` itself, one invocation per chromosome, scattered by ravanan (Slurm) |
-| `/compute/gemma` | `gemma-wrapper` (kinship, then GWA, both `--loco`) as a server subprocess, no cluster |
+| `/compute/gemma` | the **same Slurm route by default** (`GEMMA_ENGINE=slurm`): ravanan, one `gemma` job per chromosome, falling back to the in-process `gemma-wrapper` only when the cluster route answers 5xx |
 
-**Use `/compute/gemma/ravanan` by default.** Reach for `/compute/gemma` only
-when:
+**Sending the same body to `/compute/gemma` and `/compute/gemma/ravanan` no
+longer compares two runners**: by default both are the Slurm route, so they
+answer the same numbers through the same process. They still differ in *scope*
+(covariates, normalization, permutations are refused on the ravanan endpoint),
+and a reply says which engine ran in `meta.timing.engine` and whether the
+cluster was used at all in `meta.timing.cluster.jobs_submitted` (`0` = every step
+came from ravanan's store). The in-process `gemma-wrapper` run is reachable only
+as the fallback (its reply carries an "Engine: the Slurm route was unavailable"
+note).
+
+Reach for `/compute/gemma` when:
 
 - **Slurm is down or job submission fails** (`502`/`ravanan_failed`, or a job
   that never leaves `PENDING`) -- the in-process runner needs no cluster;
@@ -218,7 +227,11 @@ verify costs almost nothing.
 **Mapping and plots (POST, verified working)**
 
 * `/compute/rqtl`: R/qtl `scanone` (Haley-Knott) over the group's genotypes.
-  Columns `name, chr, pos, lod`. `nperm=0` by default, so no permutation lines.
+  `data` is the marker rows, positional, columns `name, chr, pos, lod` (named in
+  `meta.columns`); the permutation null, when asked for, is **`meta.permutation`**
+  (`significant`, `suggestive`, `values`), not a second member of `data`.
+  `nperm=0` by default, so no permutation lines. Every compute endpoint keeps its
+  rows in `data` — one loop reads them all.
 * `/compute/gemma`: GEMMA LMM with leave-one-chromosome-out kinship. Columns
   `chr, rs, ps, n_miss, allele1, allele0, af, beta, se, l_mle, additive, p_lrt`.
   Pass `?id=` and poll `/compute/gemma/status/{id}` for long runs. Per-marker
@@ -377,8 +390,9 @@ verify costs almost nothing.
   will be — but a user's own column can be stored and mapped. `POST /baskets`
   with `{"name", "values":[{name,value}…]}` (values may be numbers, strings
   like `"NA"`, or null), `PATCH /baskets/{name}` to edit (a new revision, a new
-  digest), then `POST /compute/qtl2` with `"basket": "<name>"` instead of
-  `samples`. Baskets are private to the token's user, live in their own SQLite
+  digest), then map it with **`"basket": "<name>"`** in place of `samples` on any
+  of `/compute/rqtl`, `/compute/qtl2`, `/compute/gemma` or
+  `/compute/gemma/ravanan`. Baskets are private to the token's user, live in their own SQLite
   file, and a mapping reply records the revision and digest it used — quote
   them when reporting a result. Each edit is a new revision with its own
   timestamp (`GET /baskets/{name}/revisions`), old revisions stay readable
@@ -396,8 +410,11 @@ verify costs almost nothing.
   `image/svg+xml` plot. Do not draw your own.
 * Options (all optional, add to the posted body; full list in
   `components.schemas.RqtlRequest` / `GemmaRequest`):
-  * R/qtl: `nperm` (permutations; **100 takes about 14 s** and adds
-    `significant`/`suggestive` thresholds that `/plot/rqtl` then draws),
+  * R/qtl: `nperm` (permutations; the cost is **strains x permutations**, not
+    markers: measured, 1,000 permutations took 22 s on 21 strains, 221 s on 93
+    and 463 s on 87 — so 100 permutations is roughly 2 s at 21 strains and 20-45 s
+    at ~90. Adds `meta.permutation` `significant`/`suggestive`, which
+    `/plot/rqtl` then draws),
     `method` (`hk` default, `ehk`, `mr`, `em`, `imp`), `model` (`normal`
     default, `np`), `control` (a marker to condition on), `genotype_version`,
     `include_parents_f1`, `covariates`.
@@ -622,7 +639,12 @@ from an older cache entry (retry and it refreshes).
   finds 19. The reply's `next` offers a ten-times wider window.
 * Public-data rule: `public > 0` and `confidentiality < 1`, or older than five
   years; otherwise 403, do not retry. Metadata is visible even when values are not.
-* There are no write endpoints, and the search index holds public documents only.
+* The published data is read-only, but there **are** write endpoints for the
+  caller's own material: `POST|PATCH|DELETE /baskets` (columns of values),
+  `POST /matrices` (correlation matrices) and `POST /uploads/genotypes`
+  (population genotypes). A basket name that is taken is a `409`, not a `422`;
+  PATCH it or pick another name. Nothing here can change a published trait.
+* The search index holds public documents only.
 * Older docs said `POST /compute/*` is refused with 403. On this build it works.
   If you do get a 403 there, that is the answer: do not work around it. If the
   task needs private data or computation you are not granted, stop and ask a
@@ -691,8 +713,9 @@ you saw at the start of the session** and compare against it later.
    piece of work.
 3. If the revision is no longer the baseline, GeneNetwork was updated while you
    worked. **Suggest to the user that you reload SKILL.md from the repo**
-   (`docs/www/SKILL.md` in `https://git.genenetwork.org/genenetwork4`; a sparse
-   clone of `docs` is enough), and use that copy from then on. One line is
+   (`docs/www/SKILL.md` in `https://git.genenetwork.org/genenetwork4`; a shallow
+   clone — not `--sparse`, which this server rejects — is enough), and use that
+   copy from then on. One line is
    enough, for example: "GeneNetwork was updated since we started (<old> ->
    <new>); I'd reload SKILL.md from docs/www/ to pick up any changes. Shall I?"
    Then set the new revision as your baseline.
@@ -738,11 +761,12 @@ conclusion is also in a commit message and in these docs.
 The docs live in the public repo and are the authoritative version:
 
 ```sh
-git clone --depth 1 --sparse https://git.genenetwork.org/genenetwork4
-cd genenetwork4 && git sparse-checkout set docs
+git clone --depth 1 https://git.genenetwork.org/genenetwork4
 ```
 
-About 2.5 MB; drop `--sparse` for the whole tree. Then read:
+A whole shallow clone is about 19 MB and takes under two minutes; `--sparse`
+does **not** work against this server ("dumb http transport does not support
+shallow capabilities"), so do not add it. Then read:
 
 | file | what it is |
 |---|---|
diff --git a/src/routes/baskets.rs b/src/routes/baskets.rs
index 371502a..533a155 100644
--- a/src/routes/baskets.rs
+++ b/src/routes/baskets.rs
@@ -169,7 +169,7 @@ pub async fn list_baskets(
         .envelope(baskets)
         .with_note("Baskets are yours: they live in your own SQLite file, not in GeneNetwork's \
                     database.")
-        .with_note("A mapping can name one instead of posting values: POST /compute/qtl2 with \
+        .with_note("A mapping can name one instead of posting values: POST /compute/rqtl, \
                     \"basket\": \"<name>\".");
     envelope = envelope.with_links(crate::suggest::root_links());
     Ok(Json(envelope))
@@ -222,7 +222,7 @@ pub async fn create_basket(
     .map_err(|error| map_error(error, rid.clone()))?;
     let mut envelope = ctx.envelope(stored).with_note(
         "Stored. Edit it with PATCH (a new revision, a new digest) and map it with \
-         POST /compute/qtl2 {\"basket\": \"<name>\"}.",
+         POST /compute/rqtl, /compute/qtl2, /compute/gemma or /compute/gemma/ravanan \n         {\"basket\": \"<name>\"}.",
     );
     envelope = envelope.with_links(crate::suggest::root_links());
     Ok((StatusCode::CREATED, Json(envelope)))
@@ -263,7 +263,10 @@ pub async fn get_basket(
         .envelope(stored)
         .with_note("`revision` and `digest` identify these exact values: a mapping reply records \
                     them, so an edit cannot make two runs look alike.")
-        .with_note("Map it: POST /compute/qtl2 with \"basket\": \"<name>\" in place of `samples`.");
+        .with_note(
+            "Map it: POST /compute/rqtl, /compute/qtl2, /compute/gemma or \
+             /compute/gemma/ravanan with \"basket\": \"<name>\" in place of `samples`.",
+        );
     envelope = envelope.with_links(links);
     Ok(Json(envelope))
 }