From 0e01ffe99a28c75424f7405749a11c5533e27e66 Mon Sep 17 00:00:00 2001 From: "Harrison H. Vaughn Reed" Date: Thu, 30 Apr 2026 17:37:06 -0400 Subject: [PATCH 1/3] feat(wfmash): migrate to topic: versions, add stub block, sanitizeOutput assertions --- modules/nf-core/wfmash/main.nf | 12 ++-- modules/nf-core/wfmash/meta.yml | 40 +++++++++---- modules/nf-core/wfmash/tests/main.nf.test | 31 +++++++++- .../nf-core/wfmash/tests/main.nf.test.snap | 58 ++++++++++++++++--- 4 files changed, 114 insertions(+), 27 deletions(-) diff --git a/modules/nf-core/wfmash/main.nf b/modules/nf-core/wfmash/main.nf index 4cb9b7ac7c94..d3d3534a0bdf 100644 --- a/modules/nf-core/wfmash/main.nf +++ b/modules/nf-core/wfmash/main.nf @@ -14,7 +14,7 @@ process WFMASH { output: tuple val(meta), path("*.paf"), emit: paf - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('wfmash'), eval('echo $(wfmash --version 2>&1) | cut -f 1 -d \'-\' | cut -f 2 -d \'v\''), topic: versions, emit: versions_wfmash when: @@ -34,11 +34,11 @@ process WFMASH { --threads $task.cpus \\ $paf_mappings \\ $args > ${prefix}.paf + """ - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - wfmash: \$(echo \$(wfmash --version 2>&1) | cut -f 1 -d '-' | cut -f 2 -d 'v') - END_VERSIONS + stub: + def prefix = task.ext.prefix ? task.ext.prefix : paf ? "${meta.id}" + "." + paf.baseName.split("\\.")[-1] : "${meta.id}" + """ + touch ${prefix}.paf """ } diff --git a/modules/nf-core/wfmash/meta.yml b/modules/nf-core/wfmash/meta.yml index 5f74547feca8..e0423f913e0d 100644 --- a/modules/nf-core/wfmash/meta.yml +++ b/modules/nf-core/wfmash/meta.yml @@ -13,7 +13,8 @@ tools: documentation: https://github.com/waveygang/wfmash tool_dev_url: https://github.com/waveygang/wfmash doi: 10.5281/zenodo.6949373 - licence: ["MIT"] + licence: + - "MIT" identifier: "" input: - - meta: @@ -28,8 +29,8 @@ input: ontologies: [] - paf: type: file - description: Optional inpute file in PAF format to derive the precise alignments - for. + description: Optional inpute file in PAF format to derive the precise + alignments for. pattern: "*.{paf}" ontologies: [] - gzi: @@ -44,11 +45,12 @@ input: ontologies: [] - query_self: type: boolean - description: If set to true, the input FASTA will also be used as the query FASTA. + description: If set to true, the input FASTA will also be used as the query + FASTA. - fasta_query_list: type: file - description: Optional inpute file in FASTA format specifying the query sequences - as a list. + description: Optional inpute file in FASTA format specifying the query + sequences as a list. pattern: "*.{fa,fna,fasta}" ontologies: [] output: @@ -63,13 +65,27 @@ output: description: Alignments in PAF format pattern: "*.{paf}" ontologies: [] + versions_wfmash: + - - ${task.process}: + type: string + description: The name of the process + - wfmash: + type: string + description: The name of the tool + - echo $(wfmash --version 2>&1) | cut -f 1 -d '-' | cut -f 2 -d 'v': + type: eval + description: The expression to obtain the version of the tool +topics: versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" - ontologies: - - edam: http://edamontology.org/format_3750 # YAML + - - ${task.process}: + type: string + description: The name of the process + - wfmash: + type: string + description: The name of the tool + - echo $(wfmash --version 2>&1) | cut -f 1 -d '-' | cut -f 2 -d 'v': + type: eval + description: The expression to obtain the version of the tool authors: - "@subwaystation" maintainers: diff --git a/modules/nf-core/wfmash/tests/main.nf.test b/modules/nf-core/wfmash/tests/main.nf.test index 721541dd5589..24147fee030a 100644 --- a/modules/nf-core/wfmash/tests/main.nf.test +++ b/modules/nf-core/wfmash/tests/main.nf.test @@ -30,7 +30,36 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + + } + + test("homo_sapiens - pangenome - pangenome_fa_bgzip - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'pangenomics/homo_sapiens/pangenome.fa.gz', checkIfExists: true), + [], // empty paf input + file(params.modules_testdata_base_path + 'pangenomics/homo_sapiens/pangenome.fa.gz.gzi', checkIfExists: true), // gzi + file(params.modules_testdata_base_path + 'pangenomics/homo_sapiens/pangenome.fa.gz.fai', checkIfExists: true) // fai + ] + input[1] = true // empty paf input + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match() } ) } diff --git a/modules/nf-core/wfmash/tests/main.nf.test.snap b/modules/nf-core/wfmash/tests/main.nf.test.snap index aa1116279821..204355aafa70 100644 --- a/modules/nf-core/wfmash/tests/main.nf.test.snap +++ b/modules/nf-core/wfmash/tests/main.nf.test.snap @@ -1,14 +1,56 @@ { - "versions": { + "homo_sapiens - pangenome - pangenome_fa_bgzip - stub": { "content": [ - [ - "versions.yml:md5,9f9bd116e78512f26ddf28b51a46e64e" - ] + { + "paf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_wfmash": [ + [ + "WFMASH", + "wfmash", + "0.13.0" + ] + ] + } ], + "timestamp": "2026-04-30T17:43:11.682538", "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-04-11T15:02:01.736721962" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "homo_sapiens - pangenome - pangenome_fa_bgzip": { + "content": [ + { + "paf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paf:md5,180128cf59433692358b992ba4fdec30" + ] + ], + "versions_wfmash": [ + [ + "WFMASH", + "wfmash", + "0.13.0" + ] + ] + } + ], + "timestamp": "2026-04-30T17:43:06.248425", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } } } \ No newline at end of file From d65ae3b83b0544adbb7313eabac995db9b409382 Mon Sep 17 00:00:00 2001 From: "Harrison H. Vaughn Reed" Date: Fri, 1 May 2026 07:13:11 -0400 Subject: [PATCH 2/3] Standardize version emission and restore EDAM comments --- modules/nf-core/wfmash/main.nf | 2 +- modules/nf-core/wfmash/meta.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/wfmash/main.nf b/modules/nf-core/wfmash/main.nf index d3d3534a0bdf..09a734181885 100644 --- a/modules/nf-core/wfmash/main.nf +++ b/modules/nf-core/wfmash/main.nf @@ -14,7 +14,7 @@ process WFMASH { output: tuple val(meta), path("*.paf"), emit: paf - tuple val("${task.process}"), val('wfmash'), eval('echo $(wfmash --version 2>&1) | cut -f 1 -d \'-\' | cut -f 2 -d \'v\''), topic: versions, emit: versions_wfmash + tuple val("${task.process}"), val('wfmash'), eval('echo $(wfmash --version 2>&1) | cut -f 1 -d \'-\' | cut -f 2 -d \'v\''), topic: versions, emit: versions when: diff --git a/modules/nf-core/wfmash/meta.yml b/modules/nf-core/wfmash/meta.yml index e0423f913e0d..8c42e414e56a 100644 --- a/modules/nf-core/wfmash/meta.yml +++ b/modules/nf-core/wfmash/meta.yml @@ -65,7 +65,7 @@ output: description: Alignments in PAF format pattern: "*.{paf}" ontologies: [] - versions_wfmash: + versions: - - ${task.process}: type: string description: The name of the process From a9ef0a7ee19af79309137db1f7d9b786a4b3bf20 Mon Sep 17 00:00:00 2001 From: "Harrison H. Vaughn Reed" Date: Fri, 1 May 2026 09:20:51 -0400 Subject: [PATCH 3/3] fix(wfmash): rename emit to versions_wfmash, simplify eval, update snapshots - main.nf: emit: versions -> emit: versions_wfmash - meta.yml: output key versions: -> versions_wfmash: - main.nf/meta.yml: simplify eval string to use sed instead of dual cuts - tests/main.nf.test.snap: regenerate snapshots Local lint: 52/0. Local nf-test: 2/2 passed. --- modules/nf-core/wfmash/main.nf | 2 +- modules/nf-core/wfmash/meta.yml | 6 +++--- modules/nf-core/wfmash/tests/main.nf.test.snap | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/nf-core/wfmash/main.nf b/modules/nf-core/wfmash/main.nf index 09a734181885..fbfca946f06c 100644 --- a/modules/nf-core/wfmash/main.nf +++ b/modules/nf-core/wfmash/main.nf @@ -14,7 +14,7 @@ process WFMASH { output: tuple val(meta), path("*.paf"), emit: paf - tuple val("${task.process}"), val('wfmash'), eval('echo $(wfmash --version 2>&1) | cut -f 1 -d \'-\' | cut -f 2 -d \'v\''), topic: versions, emit: versions + tuple val("${task.process}"), val('wfmash'), eval("wfmash --version 2>&1 | sed 's/^v//; s/-.*//'"), topic: versions, emit: versions_wfmash when: diff --git a/modules/nf-core/wfmash/meta.yml b/modules/nf-core/wfmash/meta.yml index 8c42e414e56a..accb16ee92c3 100644 --- a/modules/nf-core/wfmash/meta.yml +++ b/modules/nf-core/wfmash/meta.yml @@ -65,14 +65,14 @@ output: description: Alignments in PAF format pattern: "*.{paf}" ontologies: [] - versions: + versions_wfmash: - - ${task.process}: type: string description: The name of the process - wfmash: type: string description: The name of the tool - - echo $(wfmash --version 2>&1) | cut -f 1 -d '-' | cut -f 2 -d 'v': + - "wfmash --version 2>&1 | sed 's/^v//; s/-.*//'": type: eval description: The expression to obtain the version of the tool topics: @@ -83,7 +83,7 @@ topics: - wfmash: type: string description: The name of the tool - - echo $(wfmash --version 2>&1) | cut -f 1 -d '-' | cut -f 2 -d 'v': + - "wfmash --version 2>&1 | sed 's/^v//; s/-.*//'": type: eval description: The expression to obtain the version of the tool authors: diff --git a/modules/nf-core/wfmash/tests/main.nf.test.snap b/modules/nf-core/wfmash/tests/main.nf.test.snap index 204355aafa70..7f0d4f7c56a7 100644 --- a/modules/nf-core/wfmash/tests/main.nf.test.snap +++ b/modules/nf-core/wfmash/tests/main.nf.test.snap @@ -35,7 +35,7 @@ "id": "test", "single_end": false }, - "test.paf:md5,180128cf59433692358b992ba4fdec30" + "test.paf:md5,29f914ce85ab77a33bd740d1f9570eec" ] ], "versions_wfmash": [ @@ -47,7 +47,7 @@ ] } ], - "timestamp": "2026-04-30T17:43:06.248425", + "timestamp": "2026-05-01T09:19:21.270932", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0"