diff options
| author | Pjotr <wrk@bosa.lan> | 2026-11-08 15:45:48 +0000 |
|---|---|---|
| committer | Pjotr <wrk@bosa.lan> | 2026-11-08 15:45:48 +0000 |
| commit | fc0e8fff3c1bed8d40e982a0a5e808180e772590 (patch) | |
| tree | be76e5db9c0566adc50f9d193a786601010f554d /docs | |
| parent | 386aed031612abc118e3390638cb5aff144be971 (diff) | |
| download | genenetwork4-fc0e8fff3c1bed8d40e982a0a5e808180e772590.tar.gz | |
compute: refuse GEMMA permutations instead of ignoring them
`gemma-wrapper --permutate n` repeats the *whole* LOCO association scan per permutation -- it shuffles the phenotype file and starts over -- so a thousand permutations is thousands of full scans: hours to days on a real panel, against the single slot `/compute/gemma` has. That is not a test this deployment carries, and an assistant asked for significance thresholds will ask for it, so the answer has to be an explicit one. Until now the request type simply had no such field and serde ignores unknown keys, which is the worst of the three outcomes: the caller gets a 200, no thresholds, and no indication that what it asked for was dropped. `nperm`, `permutations` and `permutate` are now named fields and refused with `422 permutations_not_supported`, naming the cost, pointing at `POST /compute/rqtl` with `nperm` (the endpoint that does have the test, over the same panel and values) and at the `actions` member every successful GEMMA response already carries, pre-filled with exactly that call. Zero keeps its usual meaning -- off -- so a client sharing one body shape across the two endpoints still works. * src/routes/gemma.rs: the three fields, the refusal before anything expensive runs, and the response note now saying permutations are refused rather than merely absent. * tests/gemma.rs: `compute_gemma_refuses_permutations` pins all three spellings, the code, and that `nperm: 0` is not a request for any. It takes the compute lock: the gate answers before the handler does, so a concurrent job in the same test binary came back 409 instead. * README.md, docs/www/ai-instruction.md: what to do instead -- judge a peak against the smallest `p_lrt`, and get thresholds from R/qtl. 273 tests pass; the same four as before do not.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/www/ai-instruction.md | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/docs/www/ai-instruction.md b/docs/www/ai-instruction.md index fe033d4..8c76cee 100644 --- a/docs/www/ai-instruction.md +++ b/docs/www/ai-instruction.md @@ -474,12 +474,23 @@ all-zero column is singular, and GEMMA stops rather than dropping the term). Either way, covariates reach only the association step and not the kinship, so adding one does not recompute the relatedness matrix. -**GEMMA has no permutation test.** Its `actions` therefore suggests the -*R/qtl* permutation run on the same group and the same values, and says -so; judge a GEMMA peak against the smallest `p_lrt` it reached, not -against a genome-wide threshold. (gemma-wrapper itself can shuffle -phenotypes with `--permutate n`; this API does not pass it — see -docs/genotypes.md.) +**GEMMA has no permutation test, and do not ask for one.** A permutation +run repeats the entire LOCO association scan for every permutation +(`gemma-wrapper --permutate` shuffles the phenotype file and starts over), +so a thousand permutations is thousands of full scans — hours to days on +a real panel, on the one slot GEMMA has here. `/compute/gemma` therefore +**refuses** `nperm`, `permutations` and `permutate` with `422 +permutations_not_supported` rather than ignoring them: an ignored flag is +how you end up believing you have thresholds you never computed. Zero is +accepted and means off, as elsewhere. + +For thresholds, use the endpoint that has the test: send the *same* panel +and the *same* values to `POST /compute/rqtl` with `"nperm": 100`, which +returns `suggestive` and `significant` LOD thresholds. Every successful +GEMMA response already carries that call, pre-filled, in `actions` — take +that rather than assembling your own. Until then, judge a GEMMA peak +against the smallest `p_lrt` it reached, not against a genome-wide +threshold of its own. **A few jobs at a time, one per caller.** Each compute endpoint has a fixed number of slots — **1** for `/compute/gemma`, **1** for |
