diff options
| author | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-11-20 17:08:54 +0000 |
|---|---|---|
| committer | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-11-20 17:08:54 +0000 |
| commit | 64f1268be9a06462fe9685107c949dbbad84212d (patch) | |
| tree | 52f1fef50b8e85b4730c878cf343e756384152b5 /src/json_errors.rs | |
| parent | 87314c6dbde26343d577423942d967b5acc37db5 (diff) | |
| download | genenetwork4-64f1268be9a06462fe9685107c949dbbad84212d.tar.gz | |
gemma: the genotype treatment and the lmdb store become workflow jobs
Both used to run on the API host before ravanan was invoked, cached by two
hand-rolled file keys -- one of which (the treatment) carried a version
constant that had to be bumped whenever the script changed what it wrote, and
the other (the store) keyed on a genotype file's path, size and mtime. As
workflow jobs they are scheduled on the cluster and cached by ravanan on
(script, inputs) like every other step, and both caches go away.
They are *separate* workflows, not steps inside the mapping one, because
ccwl's `pipe` is strictly linear: a step sees only the immediately preceding
step's unconsumed outputs, and GWA needs the prepared genotypes *and* the
kinship matrix -- a diamond ccwl cannot express (verified with a three-step
probe; ravanan implements no CWL `when` either, so an optional step is not an
option). So:
cwl/gemma/prepare.scm mode + BIMBAM pair (+ cross, individuals) -> pair
cwl/gemma/store.scm BIMBAM pair -> pangemma's lmdb store
cwl/gemma/manifest-artifacts.scm bash, coreutils, gawk, r-minimal,
r-qtl2, python, python-numpy, python-lmdb
and the server chains them: prepare when `impute` is not `none`, store when
the engine is pangemma, then the mapping workflow with the resulting paths.
Ravanan sets the manifest profile's search paths inside the job, so python3
there finds numpy and lmdb without the PYTHONPATH the API host needs.
Measured warm on BXD.8 trait 10001 (gemma / pangemma, rows):
none 21055 3.9 s / 10.3 s mean 21056 10.5 s / 16.5 s
hmm 20453 10.2 s / 16.5 s
Against 26.8 s for hmm through the host-side path before this.
Three things had to be right that were not:
- A step input cannot be optional here, so `cross` and `individuals_file` are
always passed -- an empty directory and an empty file for the modes that
ignore them.
- `cross` is a *path*, not a CWL Directory: ravanan's slurm-api backend does
not stage a Directory input (the staged path reached the job and R's setwd
failed; the same workflow under single-machine succeeded), so the server
copies the cross under its cache directory, which the nodes can see.
- `scripts/prepare-genotypes.sh --out` is now absolutized before use, because
qtl2-impute-bimbam.R does setwd(cross_dir) and writes <prefix>.* from there:
a relative prefix put the outputs inside the cross directory and the job's
output globs matched nothing. It also grew --impute-script (a staged script
is not beside its companion) and always writes <out>.individuals.txt, since
the caller needs the HMM's individual order to align trait values.
Also: a request that asked for a treatment no longer falls back to the
in-process wrapper when the Slurm route fails. The wrapper reads genotypes as
they stand, so falling back on `impute: hmm` answered 21,055 rows where the
request meant 20,453 -- a wrong answer under a "degraded" note. Treated
requests (and pangemma ones) now fail instead.
And ravanan's output may be one File or an array of them: a scattered step
reports an array, a single-step workflow one File, which is what "no store
array in ravanan's output" was.
Deployed and verified on the production instance: all six engine x mode
combinations answer 200 with the expected row counts, and
bin/monitor-gn4 --tier all is 50 ok / 0 failed.
Diffstat (limited to 'src/json_errors.rs')
0 files changed, 0 insertions, 0 deletions
