diff options
| -rw-r--r-- | docs/www/SKILL.md | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/docs/www/SKILL.md b/docs/www/SKILL.md index 6c8338e..0b97fec 100644 --- a/docs/www/SKILL.md +++ b/docs/www/SKILL.md @@ -78,7 +78,10 @@ Every JSON reply is `{"data","meta","notes","next"}` and sometimes `"actions"`. * `notes`: read them. They say how many strains were matched, what was run, and caveats. * `next`: GET links to related things. Each `href` already includes `/gn4`: - resolve against the origin (`https://vesuvio.pu.ac.ke$href`). + resolve against the origin (`https://vesuvio.pu.ac.ke$href`). A link that is a + *shape* rather than an address — one still holding a `{placeholder}` the scan + cannot fill, such as `{trait_id}` or a genotype file name — carries + **`"template": true`**; following the rest returns 200 as it stands. * **`actions`: ready-to-send POSTs.** On a trait's `/values` they are the R/qtl and GEMMA calls with the body already filled in; on a **compute reply** they are the matching plot call (href with `?trait=` already set; post the reply @@ -206,6 +209,24 @@ 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). +**A run can outlast your client, so there is an async form.** A cold fit on a +large panel is tens of minutes (measured: 21 min for 20 concurrent GWA jobs on a +133 217-marker rat panel), and a closed connection used to take the answer with +it: + +```sh +POST /compute/gemma/async?id=<name> # same body; 202 at once +{ "id": "<name>", "state": "running", "status": "/compute/gemma/result/<name>" } +GET /compute/gemma/result/<name> # progress, then the finished reply +``` + +The status route reports `state`, `elapsed_ms` and what the cluster is doing +(`meta.timing.cluster.jobs_submitted` — `0` means everything came from cache), +and returns exactly the body the blocking call would have. `?id=` on the +blocking endpoints still works with `/compute/gemma/status/{id}` for the run +log, but that one tails text; use `result` to collect the answer. Give a long +run an id *before* starting it, or a timeout leaves you nothing to poll. + Reach for `/compute/gemma` when: - **Slurm is down or job submission fails** (`502`/`ravanan_failed`, or a job @@ -373,19 +394,27 @@ verify costs almost nothing. `{"basket": "<matrix>.<column>"}` on any compute endpoint. `GET /matrices` lists yours, `GET /matrices/{name}/values` reads the table back. `scripts/example-matrix.py` writes a valid example from a genotype file. +* **A file request can still be named.** `genotype_file` + `snps_file` takes + `samples` (or a `basket`) and aligns them by name onto the genotype file's + individuals — but a **BIMBAM has no names**, so for GEMMA the names come from + the `.geno` kept beside it (`genotype/<stem>.geno` next to + `genotype/bimbam/<stem>_geno.txt`), and the values are placed in the BIMBAM's + column order. With neither a `.geno` sibling nor a group, send positional + `trait_values`. The reply's `Genotype:` note says which happened. * **Uploading genotypes**: `POST /uploads/genotypes` with `{"name":"<user>-GENONAME","base_version":"BXD.4","contents":"<tsv>"}` — tab-delimited, header = individuals from column 4, then marker/chr/pos. It **updates** a population: ≤50 new individuals, at least one overlapping, ≤200 000 markers, and the values must be the same kind as the base's - (letters, whole numbers, probabilities). The reply's - Every compute endpoint takes it by name — `{"genotype_upload": "<name>"}` on - `/compute/{rqtl,gemma,qtl2,fitqtl}` — with `samples` (or a `basket`) matched - **by name**; the server writes the form each engine reads. Uploading the same - name again **replaces** it, and the digest in the reply says which version - ran. A one-chromosome upload scans flat or empty under LOCO - kinship — use `"kinship": "overall"` if that is all you have. `scripts/example-genotype-upload.py` - makes a valid one from any `.geno`. + (letters, whole numbers, probabilities); the reply reports the individuals, + markers and digest it stored. Every compute endpoint then takes it by name — + `{"genotype_upload": "<name>"}` on `/compute/{rqtl,gemma,qtl2,fitqtl}` — with + `samples` (or a `basket`) matched **by name**; the server writes the form each + engine reads. Uploading the same name again is a **`409`**, not a replacement: + `DELETE /uploads/genotypes/{name}` and post it again, and `updated_at` in the + listing is the version that ran. A one-chromosome upload scans flat or empty + under LOCO kinship — use `"kinship": "overall"` if that is all you have. + `scripts/example-genotype-upload.py` makes a valid one from any `.geno`. * **Changing values**: there is no write endpoint for traits, and there never 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 |
