Skip to content

Fix Clair3 model download staging when explicit override bypasses aut… - #191

Open
YannVRB wants to merge 1 commit into
IntGenomicsLab:devfrom
YannVRB:fix-clair3-model-staging-fallback
Open

Fix Clair3 model download staging when explicit override bypasses aut…#191
YannVRB wants to merge 1 commit into
IntGenomicsLab:devfrom
YannVRB:fix-clair3-model-staging-fallback

Conversation

@YannVRB

@YannVRB YannVRB commented Sep 4, 2026

Copy link
Copy Markdown

…o-detection

PREPARE_REFERENCE_FILES computed the WGET/UNTAR staging directory name (meta_new.id) independently from the actual download URL (model): the URL correctly fell back to the samplesheet's explicit clair3_model override when basecall_model_meta didn't match clair3_modelMap, but the staging id did not -- it was only ever clair3_modelMap.get(basecall_model_meta), which resolves to null on any unmapped model. UNTAR then failed with "mkdir: missing operand" because its output directory name came out empty, even though the model itself downloaded successfully under the correct override.

This isn't specific to any one basecall model -- it triggers for any sample whose auto-detected basecall_model_meta isn't in clair3_modelMap (currently only dna_r10.4.1_e8.2_*_sup@v4.x/v5.x and hifi_revio are mapped), whether that's because the model genuinely isn't supported yet, or because BAM header metadata is missing/malformed. H

Fix: derive meta_new.id from the same resolved model value used for the download URL, so an explicit clair3_model override always works regardless of whether the auto-detected model has a modelMap entry.

Claude-Session: https://claude.ai/code/session_01DhE7yZ2qRjaG86P7JgZbA4

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

…o-detection

PREPARE_REFERENCE_FILES computed the WGET/UNTAR staging directory name
(meta_new.id) independently from the actual download URL (model): the URL
correctly fell back to the samplesheet's explicit clair3_model override when
basecall_model_meta didn't match clair3_modelMap, but the staging id did not
-- it was only ever clair3_modelMap.get(basecall_model_meta), which resolves
to null on any unmapped model. UNTAR then failed with "mkdir: missing
operand" because its output directory name came out empty, even though the
model itself downloaded successfully under the correct override.

This isn't specific to any one basecall model -- it triggers for any sample
whose auto-detected basecall_model_meta isn't in clair3_modelMap (currently
only dna_r10.4.1_e8.2_*_sup@v4.x/v5.x and hifi_revio are mapped), whether
that's because the model genuinely isn't supported yet, or because BAM
header metadata is missing/malformed. Hit this validating the SAVANA PR
against both public and internal real-world ONT data.

Fix: derive meta_new.id from the same resolved `model` value used for the
download URL, so an explicit clair3_model override always works regardless
of whether the auto-detected model has a modelMap entry.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DhE7yZ2qRjaG86P7JgZbA4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant