UNZIP: modernize to latest nf-core conventions#11014
UNZIP: modernize to latest nf-core conventions#11014maxcumminsandfred-lab wants to merge 5 commits intonf-core:masterfrom
Conversation
Replace heredoc cat <<-END_VERSIONS with eval() inline output and topic: versions. Remove versions.yml heredoc from stub block. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Snapshots verified stable across 2 runs (with and without --update-snapshot). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rsions.yml output Auto-generated topics: section via nf-core modules lint --fix. Removed stale versions: versions.yml output entry left after eval migration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
archive_extract: Remove versions variable and emit entirely — all 3 modules (GUNZIP, UNTAR, UNZIP) now use topic: versions, so version collection at the subworkflow level is no longer needed. homer_groseq: Remove ch_versions.mix(UNZIP.out.versions) — UNZIP now emits versions via topic. Other HOMER modules remain legacy and still use ch_versions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary
Migrate the unzip module from legacy `cat <<-END_VERSIONS > versions.yml` heredoc to the modern `eval()` inline output with `topic: versions`. Remove versions.yml heredoc from stub block (eval runs automatically in stub mode). Update dependent subworkflows to handle the removal of `.out.versions`.
## Changes
- `modules/nf-core/unzip/main.nf`: Replace heredoc version output with `eval('7za --help | sed -n "s/.*p7zip Version //p" | sed "s/ .*//"')` and `topic: versions`. Remove heredoc from both script and stub blocks.
- `modules/nf-core/unzip/meta.yml`: Add `topics:` and `versions_7za:` output sections (auto-generated by lint --fix). Remove stale `versions: versions.yml` output entry.
- `modules/nf-core/unzip/tests/main.nf.test.snap`: Updated snapshots reflecting new version tuple format `["UNZIP", "7za", "16.02"]`.
- `subworkflows/nf-core/archive_extract/main.nf`: Remove `versions` variable and emit entirely — all 3 included modules (GUNZIP, UNTAR, UNZIP) now use `topic: versions`, so subworkflow-level version collection is no longer needed.
- `subworkflows/nf-core/archive_extract/meta.yml`: Remove `versions` output entry.
- `subworkflows/nf-core/archive_extract/tests/main.nf.test.snap`: Updated snapshot (no longer includes `versions` key).
- `subworkflows/nf-core/homer_groseq/main.nf`: Remove `ch_versions.mix(UNZIP.out.versions)` — UNZIP now emits via topic. HOMER modules remain legacy and still use `ch_versions`.
## Verification
- Lint: PASSED (46 passed, 0 warnings, 0 failed)
- Module tests: 2 passed, 0 failed (docker profile)
- archive_extract tests: 1 passed, 0 failed (docker profile)
- homer_groseq tests: 4 passed, 0 failed (docker profile)
- Snapshots: stable (verified across 2 runs for all test suites)
## PR checklist
- [x] This comment contains a description of changes (with reason).
- [x] 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 module conventions in the [contribution docs](https://github.com/nf-core/modules/tree/master/.github/CONTRIBUTING.md)
- [ ] If necessary, include test data in your PR.
- [x] Remove all TODO statements.
- [x] Broadcast software version numbers to `topic: versions` - [See version_topics](https://nf-co.re/blog/2025/version_topics)
- [x] Follow the naming conventions.
- [x] Follow the parameters requirements.
- [x] Follow the input/output options guidelines.
- [x] Add a resource `label`
- [x] Use BioConda and BioContainers if possible to fulfil software requirements.
- Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
- For modules:
- [x] `nf-core modules test <MODULE> --profile docker`
- [ ] `nf-core modules test <MODULE> --profile singularity`
- [ ] `nf-core modules test <MODULE> --profile conda`
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Should archive_extract retain a versions emit after all modules migrate to topic: versions? GUNZIP and UNTAR appear to already be migrated, so with this UNZIP PR all 3 modules use topics. I removed ch_versions.mix() and the versions emit since topic outputs appear to bypass workflow.out at the subworkflow level. Checking for precedent: I found 69 multi-module subworkflows where all included modules appear to use topic: versions. 63 have no ch_versions or versions emit. The remaining 6 still emit versions but the channel appears empty. I was unable to find any Examples that appear to follow this pattern: bam_rseqc (8 modules): https://github.com/nf-core/modules/tree/master/subworkflows/nf-core/bam_rseqc fasta_index_bismark_bwameth (5 modules): Is this correct, or should fully-migrated subworkflows retain versions in some form? |
Summary
Migrate the unzip module from legacy
cat <<-END_VERSIONS > versions.ymlheredoc to the moderneval()inline output withtopic: versions. Remove versions.yml heredoc from stub block (eval runs automatically in stub mode). Update dependent subworkflows to handle the removal of.out.versions.Changes
modules/nf-core/unzip/main.nf: Replace heredoc version output witheval('7za --help | sed -n "s/.*p7zip Version //p" | sed "s/ .*//"')andtopic: versions. Remove heredoc from both script and stub blocks.modules/nf-core/unzip/meta.yml: Addtopics:andversions_7za:output sections (auto-generated by lint --fix). Remove staleversions: versions.ymloutput entry.modules/nf-core/unzip/tests/main.nf.test.snap: Updated snapshots reflecting new version tuple format["UNZIP", "7za", "16.02"].subworkflows/nf-core/archive_extract/main.nf: Removeversionsvariable and emit entirely — all 3 included modules (GUNZIP, UNTAR, UNZIP) now usetopic: versions, so subworkflow-level version collection is no longer needed.subworkflows/nf-core/archive_extract/meta.yml: Removeversionsoutput entry.subworkflows/nf-core/archive_extract/tests/main.nf.test.snap: Updated snapshot (no longer includesversionskey).subworkflows/nf-core/homer_groseq/main.nf: Removech_versions.mix(UNZIP.out.versions)— UNZIP now emits via topic. HOMER modules remain legacy and still usech_versions.Verification
PR checklist
topic: versions- See version_topicslabelnf-core modules test <MODULE> --profile dockernf-core modules test <MODULE> --profile singularitynf-core modules test <MODULE> --profile condaCo-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com