New module: modkit/extractcalls - #11286
Conversation
5035e89 to
fafc527
Compare
SPPearce
left a comment
There was a problem hiding this comment.
This is named incorrectly, it is too nested in the subfolder.
So modkit/foo, but not modkit/foo/bar
|
So modkit/extractcalls here |
|
This PR has been tagged as awaiting-changes or awaiting-feedback by an @nf-core/modules contributor. Remove stale label or add a comment if it is still useful. |
|
@SPPearce thanks — renamed to
Sibling PR #11285 ( |
SPPearce
left a comment
There was a problem hiding this comment.
Generally fine now, please just tidy up the snapshot generation.
Add new nf-core module wrapping `modkit extract calls`, which emits a per-read per-position table of base modification calls using the same pass/fail thresholding as `modkit pileup`. Complementary to `modkit/extract/full` (raw probabilities): this module emits the thresholded categorical decisions. Useful for per-read downstream analysis such as allele-specific methylation and methylation-aware phasing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nf-core module names must be <tool> or <tool>/<subtool> (two levels max); `modkit/extract/calls` failed the `main_nf_module_granularity` lint check. Renamed directory, process name (MODKIT_EXTRACTCALLS), meta.yml name and nf-test tags accordingly, as requested by @SPPearce. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E7RSvpouxbMBdimYSwJ5ZP
… empty config - Snapshot via sanitizeOutput(process.out) with `assert process.success` outside assertAll, so a tool failure fails fast instead of reporting snapshot mismatches against empty output. - Drop the redundant exists/size asserts in the non-stub test; the snapshot already covers the tsv, and an empty file is caught by the md5 lint check. - meta.yml: the index may be a .crai — modkit extract calls reads CRAM (verified against modkit 0.6.1 on a CRAM built from the test modBAM). - Remove tests/nextflow.config (it only set an empty ext.args) and its config directive. Non-stub tsv md5 is unchanged: 0ce2e5a6... Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SHRC2SxQjmF3X1z82LopQb
743f31b to
559d50c
Compare
|
@SPPearce all four addressed, thanks. First a note that explains why the diff is bigger than the four comments: the
Both nf-tests pass locally under the singularity profile. One thing to flag: lint now warns |
|
At some point a bump to the newer version would be good, but they are better to be all on the same version as you say. Happy for a bump to occur within one of these new module PRs. |
|
Ok, can merge this. |
Clears the `bioconda_latest` lint warning. Container tag `0.6.4--h7f49ad2_0` verified on both the Galaxy depot and quay.io. Snapshot regenerated: only the reported version string changes. The non-stub tsv md5 is identical to 0.6.1 (0ce2e5a6bf0889aaf8cbd682e2b17acb), so `modkit extract calls` output is byte-stable across the bump. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JAsT7dzCcLSicJxFRWJozr
…o 0.6.4 Ports the review changes from nf-core#11286 to this module. - Snapshot via `sanitizeOutput(process.out)` with `assert process.success` outside `assertAll`, so a tool failure fails fast rather than reporting a snapshot mismatch against empty output. Requires nft-utils 1.x, which is why master is merged in first. - Drop the redundant exists/size asserts on the non-stub test; the snapshot already covers the tsv and an empty file is caught by the md5 lint check. - Remove tests/nextflow.config (it only set an empty ext.args) and the `config` directive that loaded it. - Bump ont-modkit 0.6.1 -> 0.6.4 (clears the `bioconda_latest` lint warning); container tag `0.6.4--h7f49ad2_0` verified on the Galaxy depot and quay.io. Non-stub tsv md5 is unchanged at 8300986c98d1b67973439ced4e7f233c across both the config removal and the version bump. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JAsT7dzCcLSicJxFRWJozr
….6.4 Ports the review changes from nf-core#11286 to this module. - Snapshot via `sanitizeOutput(process.out)` with `assert process.success` outside `assertAll`, so a tool failure fails fast rather than reporting a snapshot mismatch against empty output. Requires nft-utils 1.x, which is why master is merged in first. - tests/nextflow.config is kept here: unlike extractcalls/extractfull it sets a real `ext.args = '-c C'`, not an empty string. - The raw_accuracy / filtered_accuracy / filter_threshold asserts are kept — they check report content the snapshot's md5 does not describe. - Bump ont-modkit 0.6.1 -> 0.6.4 (clears the `bioconda_latest` lint warning); container tag `0.6.4--h7f49ad2_0` verified on the Galaxy depot and quay.io. Report md5 is unchanged at 8503eee0403386ba18c24b0d584c7ee6 across the bump. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JAsT7dzCcLSicJxFRWJozr
Ports the review changes from nf-core#11286 to this module. - `assert process.success` moved out of `assertAll` and to the top of each `then` block — ahead of the `path(...).readLines()` calls, which would otherwise throw on a failed run before any assertion reported. - The two stub tests snapshot `sanitizeOutput(process.out)`, which drops the duplicated numbered output keys. Requires nft-utils 1.x, which is why master is merged in first. - The two non-stub tests still snapshot only the versions topic: entropy's floating-point columns are not byte-deterministic across CPU counts, so those outputs stay asserted on structure rather than md5. - tests/nextflow.config is kept: it sets a real `ext.args = '--cpg --header'`. - Bump ont-modkit 0.6.1 -> 0.6.4 (clears the `bioconda_latest` lint warning); container tag `0.6.4--h7f49ad2_0` verified on the Galaxy depot and quay.io. The header and column-count assertions pass unchanged at 0.6.4, so the entropy BED/bedgraph layout is stable across the bump. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JAsT7dzCcLSicJxFRWJozr
….6.4 Ports the review changes from nf-core#11286 to this module, keeping all four open modkit module PRs on one modkit version. - Snapshot via `sanitizeOutput(process.out)` with `assert process.success` outside `assertAll`, so a tool failure fails fast rather than reporting a snapshot mismatch against empty output. - tests/nextflow.config is kept: it carries a real `ext.args2 = '-p bed'` for HTSLIB_BGZIPTABIX, not an empty ext.args. - Bump ont-modkit 0.6.1 -> 0.6.4 (clears the `bioconda_latest` lint warning); container tag `0.6.4--h7f49ad2_0` verified on the Galaxy depot and quay.io. All three output md5s are unchanged across the bump (bc5b3b2e…, fdabfb3e…, and the empty-file stub hash). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JAsT7dzCcLSicJxFRWJozr
….6.4 Ports the review changes from nf-core#11286 to this module, keeping all four open modkit module PRs on one modkit version. - Snapshot via `sanitizeOutput(process.out)` with `assert process.success` outside `assertAll`, so a tool failure fails fast rather than reporting a snapshot mismatch against empty output. - tests/nextflow.config is kept: it carries a real `ext.args2 = '-p bed'` for HTSLIB_BGZIPTABIX, not an empty ext.args. - Bump ont-modkit 0.6.1 -> 0.6.4 (clears the `bioconda_latest` lint warning); container tag `0.6.4--h7f49ad2_0` verified on the Galaxy depot and quay.io. All three output md5s are unchanged across the bump (bc5b3b2e…, fdabfb3e…, and the empty-file stub hash). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JAsT7dzCcLSicJxFRWJozr
|
Thanks @SPPearce. Both done:
The two review threads above are addressed and resolved. This one is green and mergeable whenever you are ready. |
* feat: add modkit/extract/full module Add new nf-core module wrapping `modkit extract full`, which transforms the MM/ML tags in a modBAM into a tab-separated per-read-per-position probability table. Output can be BGZF-compressed via `--bgzf` in `ext.args`. Useful for downstream custom filtering, plotting, and ML training on read-level methylation probabilities. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(modkit/extractfull): rename from modkit/extract/full nf-core module names must be <tool> or <tool>/<subtool> (two levels max); `modkit/extract/full` failed the `main_nf_module_granularity` lint check. Renamed directory, process name (MODKIT_EXTRACTFULL), meta.yml name and nf-test tags accordingly. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E7RSvpouxbMBdimYSwJ5ZP * fix(modkit/extractfull): sanitizeOutput snapshots + bump ont-modkit to 0.6.4 Ports the review changes from nf-core#11286 to this module. - Snapshot via `sanitizeOutput(process.out)` with `assert process.success` outside `assertAll`, so a tool failure fails fast rather than reporting a snapshot mismatch against empty output. Requires nft-utils 1.x, which is why master is merged in first. - Drop the redundant exists/size asserts on the non-stub test; the snapshot already covers the tsv and an empty file is caught by the md5 lint check. - Remove tests/nextflow.config (it only set an empty ext.args) and the `config` directive that loaded it. - Bump ont-modkit 0.6.1 -> 0.6.4 (clears the `bioconda_latest` lint warning); container tag `0.6.4--h7f49ad2_0` verified on the Galaxy depot and quay.io. Non-stub tsv md5 is unchanged at 8300986c98d1b67973439ced4e7f233c across both the config removal and the version bump. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JAsT7dzCcLSicJxFRWJozr --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
PR checklist
Summary
Adds a new nf-core module wrapping `modkit extract calls`, which produces a per-read per-position table of base-modification calls (pass / fail / filtered, with the called base) using the same thresholding algorithm as `modkit pileup`.
Complementary to `modkit/extract/full`: `extract calls` emits the thresholded categorical decision per site per read, while `extract full` emits the underlying probabilities.
The module auto-detects `--bgzf` in `ext.args` and adjusts the output filename suffix accordingly.
Why
`modkit extract calls` is the go-to tool for per-read allele-specific methylation, methylation-aware phasing validation, and read-level QC where you want the same thresholded labels as the pileup output but at read level rather than site level.
Test data
Uses the existing `test.sorted.phased.bam` from nf-core/test-datasets (modules branch). No new test data required.
🤖 Generated with Claude Code