about summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-10 21:34:36 +0000
committerPjotr <wrk@bosa.lan>2026-11-10 21:34:36 +0000
commit92a7d0282897dd056b5694a20b2aee7cdc1ce6e3 (patch)
tree72819710f2032da3301c6f3f3f24e7753cf074d2 /docs
parent1ee249766366f3d88c1486065f38a0fc58b8171b (diff)
downloadgenenetwork4-92a7d0282897dd056b5694a20b2aee7cdc1ce6e3.tar.gz
uploads: a genotype matrix that updates an existing population
Tab-delimited, header names the individuals from column 4, then marker,
chr, pos (Mb). Named $USER-GENONAME, stored as text in the owner's own
SQLite file -- nothing goes near MariaDB -- and written out on demand as
a GN .geno carrying the base's @-metadata, so the R scripts read exactly
what was uploaded.

An upload updates a population, it does not invent one, and the checks
say so:

  * the base version must exist (resolved through the same
    genotypes::resolve_named the rest of the API uses);
  * at most 50 individuals the base does not have, and at least one that
    it does -- no overlap is a different population, not an update;
  * at most 200 000 markers, and the refusal says the sysadmin has to
    organize a file that size, because this is a request path, not an
    ingest;
  * the values must be the same kind as the base's: letters, whole
    numbers or probabilities. A letters panel holding 0/1 would be read
    as the wrong thing silently, so it is refused naming both kinds.

GET /uploads/genotypes lists them, /{name} its metadata (overlap, new
individuals, kind, digest), /{name}/markers pages the marker table, and
/{name}/geno writes the file and returns the path for `genotype_file` on
the compute endpoints. DELETE removes one.

scripts/example-genotype-upload.py turns any .geno into a valid update --
a subset of markers, a few individuals dropped and added -- and
tests/genoupload.rs builds its own from the deployment's BXD.4 for the
same reason: upload, page the markers, write the .geno and check the
layout, delete, then break each rule (no overlap, numbers in a letters
panel, commas) and check the refusal says which.

Unit tests cover the three value kinds, missing cells, ragged rows, a
non-numeric position, the 50-new-individual limit, and the .geno layout
(Chr first, then the marker -- GN's order, not the upload's).
Diffstat (limited to 'docs')
-rw-r--r--docs/www/SKILL.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/www/SKILL.md b/docs/www/SKILL.md
index 28b0e4b..0a4af6b 100644
--- a/docs/www/SKILL.md
+++ b/docs/www/SKILL.md
@@ -210,6 +210,15 @@ header (peak and, for GEMMA, the Bonferroni line).
   `{"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.
+* **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
+  `GET /uploads/genotypes/{name}/geno` writes a `.geno` and gives the path for
+  `genotype_file` on the compute endpoints. `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