Skip to content

fix(mito): stop claiming haplogrep reads heteroplasmies, and run it from the work directory - #445

Open
geiresx wants to merge 3 commits into
GeiserX:mainfrom
geiresx:pgp/i411-haplogrep-wording
Open

geiresx wants to merge 3 commits into
GeiserX:mainfrom
geiresx:pgp/i411-haplogrep-wording

Conversation

@geiresx

@geiresx geiresx commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Step 12 said that haplogrep3 uses heteroplasmies, but its VCF profile excludes heterozygous FORMAT/AF calls below 0.9. The Nextflow task also changed into the binary directory, based on an old reason about downloading config.

Both callers now pass --hetLevel 0.9 explicitly. The docs explain the AF threshold, the FASTA's separate 0.5 rule and DeepVariant's unread FORMAT/VAF. The Nextflow task stays in its work directory and uses the pinned image's bundled config and trees offline. No output name, format or classification threshold changes.

Decision: keep the approved 0.9 threshold. Changing it to 0.5 could change haplogroup assignments and is outside this fix.

How it was checked

  • Image smoke test: passed locally on heads e309d01 and 4993e74 in the pinned 3.2.2 image with --network none --read-only, an empty writable task directory and a read-only binary directory. Synthetic markers at AF 0.90 and 0.95 were retained. AF 0.05 and 0.60 were excluded. A homozygous ALT marker stayed despite low AF.
  • Red controls: main's extracted task script failed a directory guard with exit 97 after changing directory. The fixed task passed. A smoke copy with --hetLevel 0.5 failed the profile assertion with exit 1. These used synthetic input only. The whole harness ran again on head 4993e74 (only a main merge into CHANGELOG.md since e309d01): main's task still fails the directory guard (FAIL: classification left the task directory, exit 97), the fixed task passes, and the --hetLevel 0.5 copy still fails (FAIL: haplogrep3 profile does not obey hetLevel 0.9, exit 1). The guard wrapper sits in a tmpfs, so that mount needs exec.
  • The legacy task and fixed task produced byte-identical reports (cmp) on the synthetic threshold fixture under the same offline/read-only conditions.
  • The local personal-data guard passed: scanned 5 text files.
  • shellcheck -S warning and shell syntax checks passed for both shell files. git diff --check passed.
  • ORACLE_RUNNER=local scripts/ci/oracle-diff.sh --self-test: all 15 checks passed, including 44 comparator cases. No Rust tool changes, so no tool-specific oracle cases apply.
  • Upstream fast checks run on head 4993e74. Fork E2E belongs to the landing stage. No real-genome run is needed.

Known gap: no CI check reads the MITO_HAPLOGROUP script block itself. The smoke row runs its own copy of the classify command. A static guard (fail if the script block changes directory) needs a file outside this change, so it is left as a follow-up.

Part of #411. Settles lin-37, lin-40 and owner decision D10.

…ectory

Document the 0.9 heterozygous FORMAT/AF threshold and the DeepVariant fallback. Classify from the Nextflow task directory and test threshold boundaries offline.

Bead: lin-37
Bead: lin-40
Bead: D10
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9078a1d and 4993e74.

Files selected for processing: 5

  • CHANGELOG.md
  • docs/12-mito-haplogroup.md
  • modules/local/mito_haplogroup/main.nf
  • scripts/12-mito-haplogroup.sh
  • tests/smoke/haplogrep3.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@geiresx

geiresx commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Local regression evidence for e7fdd67.

The pinned image quay.io/biocontainers/haplogrep3:3.2.2--hdfd78af_1 ran with --platform linux/amd64 --network none --read-only. Only /tmp, /in and /out were writable tmpfs mounts. Inputs were synthetic chrM calls. No host data directory was mounted.

The classifier launcher was wrapped with a guard that required its working directory to stay under /out/.

main task: FAIL: classification left the task directory: /tmp/check
PASS: main fails task-directory guard (exit 97)
fixed task: classification completed in its task directory
PASS: AF 0.90 and 0.95 retained; AF 0.05 and 0.60 excluded; homozygous ALT retained
lowered threshold: FAIL: haplogrep3 profile does not obey hetLevel 0.9
PASS: lowering threshold to 0.5 fails the profile assertion (exit 1)

The task scripts came from the MITO_HAPLOGROUP script blocks on main and this head. Only Nextflow's input and sample interpolations and string escapes were expanded. The lowered-threshold control changed both --hetLevel 0.9 arguments in a copy of the smoke script to --hetLevel 0.5.

The ordinary smoke script also passed in the same read-only image. Its new synthetic checks run in the existing HAPLOGREP3_IMAGE smoke row in Container Test.

A second offline/read-only run used the same five synthetic GT:AF calls for both tasks. The legacy task ran from the binary directory with the default threshold. The fixed task ran from its task directory with explicit 0.9. cmp passed: the report files were byte-identical.

The local personal-data guard also passed: scanned 5 text files.

This branch has not been deployed

No deployments
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.

2 participants