fix(multiplex-quant): auto-download chemistry registry on first use#196
Merged
rob-p merged 1 commit intoMay 20, 2026
Merged
Conversation
Previously, the first invocation of `simpleaf multiplex-quant --chemistry <preset>` would bail with "Chemistry registry not found at <path>. Run `simpleaf chemistry refresh` first." when `chemistries.json` did not already exist under `$ALEVIN_FRY_HOME`. `simpleaf quant` does not have this requirement — it resolves chemistry via `get_single_custom_chem_from_file` → `parse_resource_json_file`, which transparently downloads the registry from `CHEMISTRIES_URL` on first miss. Replace the explicit bail in `multiplex_map_and_quant` with the same `prog_utils::download_to_file(CHEMISTRIES_URL, &chem_path)` call that `parse_resource_json_file` itself uses, so multiplex-quant's first-use UX matches `quant`'s.
rob-p
pushed a commit
that referenced
this pull request
May 20, 2026
download_to_file previously handled a non-success HTTP response (404, 403, rate-limit, 5xx) by emitting only a warning and returning Ok(()) without creating the destination file. Callers that open the file immediately afterward then fail with a cryptic "No such file or directory" instead of a clear download failure. This was newly exposed by #196: multiplex-quant now downloads the chemistry registry on first use, so a transient GitHub failure would surface as a confusing missing-file error rather than the actionable message that path used to print. Turning a non-success status into a hard error fixes that and benefits all eight download_to_file callers (chemistry registry, probe-set CSVs, plist files, protocol-estuary). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
an-altosian
added a commit
to an-altosian/modules
that referenced
this pull request
May 20, 2026
simpleaf 0.25.0 (Wave: community.wave.seqera.io/library/simpleaf:0.25.0--b9f96d8b71a01864) bundles alevin-fry 0.15.0 with two upstream fixes that surfaced during the multiplex-quant work: - alevin-fry: per-record sample index now maps correctly to manifest ordinal in multi-barcode collation (fixes COMBINE-lab/simpleaf#195 — sample_name column omission and resulting polars i64 inference crash). - simpleaf: multiplex-quant auto-downloads chemistries.json on first use (fixes COMBINE-lab/simpleaf#196 — no more "Run `simpleaf chemistry refresh` first" error). Neither fix changes behavior for the index/quant code paths these modules exercise, but bumping keeps all simpleaf modules on a single, current container generation.
delfiterradas
pushed a commit
to grst/modules
that referenced
this pull request
May 20, 2026
…hannel versions (nf-core#11696) * Update simpleaf to 0.24.1 with Seqera Wave container and topic-channel versions - Bump simpleaf 0.19.5 -> 0.24.1 (Wave container community.wave.seqera.io/library/simpleaf:0.24.1--41e05fd46d838d92). - Align environment.yml pins with the container: alevin-fry 0.14.0, piscem 0.20.0, simpleaf 0.24.1. Removed salmon (no longer a simpleaf dependency in 0.24.x). - Migrate versions output from versions.yml emit to topic-channel emits per the new nf-core convention (matches t1k/build pattern). Each tool emits (process, tool, version) into the shared `versions` topic. - Update piscem index file assertions in tests: piscem 0.20 replaced .sshash/.json with .ssi/.ssi.mphf/_ver.json. Stub blocks updated to match. - Inline `ALEVIN_FRY_HOME=.` in the simpleaf eval expression because the eval runs in a separate shell context from the script block. - meta.yml regenerated by `nf-core modules lint --fix`, removed leftover versions.yml stanza. All nf-tests pass (5/5 simpleaf/index, 2/2 simpleaf/quant). nf-core modules lint shows 0 failures. * Bump simpleaf to 0.25.0 in index + quant modules simpleaf 0.25.0 (Wave: community.wave.seqera.io/library/simpleaf:0.25.0--b9f96d8b71a01864) bundles alevin-fry 0.15.0 with two upstream fixes that surfaced during the multiplex-quant work: - alevin-fry: per-record sample index now maps correctly to manifest ordinal in multi-barcode collation (fixes COMBINE-lab/simpleaf#195 — sample_name column omission and resulting polars i64 inference crash). - simpleaf: multiplex-quant auto-downloads chemistries.json on first use (fixes COMBINE-lab/simpleaf#196 — no more "Run `simpleaf chemistry refresh` first" error). Neither fix changes behavior for the index/quant code paths these modules exercise, but bumping keeps all simpleaf modules on a single, current container generation.
manascripts
pushed a commit
to manascripts/modules
that referenced
this pull request
May 21, 2026
…hannel versions (nf-core#11696) * Update simpleaf to 0.24.1 with Seqera Wave container and topic-channel versions - Bump simpleaf 0.19.5 -> 0.24.1 (Wave container community.wave.seqera.io/library/simpleaf:0.24.1--41e05fd46d838d92). - Align environment.yml pins with the container: alevin-fry 0.14.0, piscem 0.20.0, simpleaf 0.24.1. Removed salmon (no longer a simpleaf dependency in 0.24.x). - Migrate versions output from versions.yml emit to topic-channel emits per the new nf-core convention (matches t1k/build pattern). Each tool emits (process, tool, version) into the shared `versions` topic. - Update piscem index file assertions in tests: piscem 0.20 replaced .sshash/.json with .ssi/.ssi.mphf/_ver.json. Stub blocks updated to match. - Inline `ALEVIN_FRY_HOME=.` in the simpleaf eval expression because the eval runs in a separate shell context from the script block. - meta.yml regenerated by `nf-core modules lint --fix`, removed leftover versions.yml stanza. All nf-tests pass (5/5 simpleaf/index, 2/2 simpleaf/quant). nf-core modules lint shows 0 failures. * Bump simpleaf to 0.25.0 in index + quant modules simpleaf 0.25.0 (Wave: community.wave.seqera.io/library/simpleaf:0.25.0--b9f96d8b71a01864) bundles alevin-fry 0.15.0 with two upstream fixes that surfaced during the multiplex-quant work: - alevin-fry: per-record sample index now maps correctly to manifest ordinal in multi-barcode collation (fixes COMBINE-lab/simpleaf#195 — sample_name column omission and resulting polars i64 inference crash). - simpleaf: multiplex-quant auto-downloads chemistries.json on first use (fixes COMBINE-lab/simpleaf#196 — no more "Run `simpleaf chemistry refresh` first" error). Neither fix changes behavior for the index/quant code paths these modules exercise, but bumping keeps all simpleaf modules on a single, current container generation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
simpleaf multiplex-quant --chemistry <preset>currently fails with:on the first run after a fresh install (or any time
$ALEVIN_FRY_HOME/chemistries.jsondoesn't exist yet).simpleaf quantdoesn't have this requirement — its chemistry-resolution path (Chemistry::from_str→get_single_custom_chem_from_file→parse_resource_json_file) auto-downloadschemistries.jsonfromCHEMISTRIES_URLon first miss.This PR replaces the explicit bail in
multiplex_map_and_quantwith the sameprog_utils::download_to_filecall thatparse_resource_json_fileitself uses, so the first-use UX ofmultiplex-quantmatchesquant.Diff
5 lines changed, 1 file. No new abstractions, no behavior change beyond the first-use auto-download.
Test plan
cargo build --release$ALEVIN_FRY_HOME(nochemistries.json),simpleaf multiplex-quant --chemistry 10x-flexv2-gex-3p ...now resolves the chemistry preset and proceeds (stops at the next downstream error,--organism is required, as expected). The registry file is downloaded into$ALEVIN_FRY_HOME/chemistries.json(7,463 bytes) during the call.chem_path.exists()short-circuits).bail!for the file-missing case is removed but is replaced bydownload_to_file's own error path, which surfaces clear network errors if the URL is unreachable.Related
Surfaced while debugging #195. Independent of that issue's collate-side fix.