From 5994a77c084568f289db65ded6407d8fe28171da 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(whamg): migrate to topic: versions, add stub block, sanitizeOutput assertions --- modules/nf-core/whamg/main.nf | 14 ++-- modules/nf-core/whamg/meta.yml | 38 ++++++--- modules/nf-core/whamg/tests/main.nf.test | 35 ++++++-- modules/nf-core/whamg/tests/main.nf.test.snap | 81 ++++++++++++++++--- 4 files changed, 133 insertions(+), 35 deletions(-) diff --git a/modules/nf-core/whamg/main.nf b/modules/nf-core/whamg/main.nf index 47c4d7066e2c..7fb499d28db2 100644 --- a/modules/nf-core/whamg/main.nf +++ b/modules/nf-core/whamg/main.nf @@ -16,7 +16,7 @@ process WHAMG { tuple val(meta), path("*.vcf.gz") , emit: vcf tuple val(meta), path("*.vcf.gz.tbi") , emit: tbi tuple val(meta), path("*.txt") , emit: graph, optional: true - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('whamg'), eval('whamg 2>&1 | grep Version | sed \'s/^Version: v//; s/-.*$//\''), topic: versions, emit: versions_whamg when: task.ext.when == null || task.ext.when @@ -36,10 +36,14 @@ process WHAMG { | bgzip ${args2} --threads ${task.cpus} --stdout > ${prefix}.vcf.gz tabix ${args3} ${prefix}.vcf.gz + """ - cat <<-END_VERSIONS > versions.yml - "${task.process}": - whamg: \$(echo \$(whamg 2>&1 | grep Version | sed 's/^Version: v//; s/-.*\$//' )) - END_VERSIONS + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + echo "" | gzip > ${prefix}.vcf.gz + touch ${prefix}.vcf.gz.tbi """ } diff --git a/modules/nf-core/whamg/meta.yml b/modules/nf-core/whamg/meta.yml index 80ac9bc1d0a4..353ec0f972e4 100644 --- a/modules/nf-core/whamg/meta.yml +++ b/modules/nf-core/whamg/meta.yml @@ -1,7 +1,8 @@ name: "whamg" -description: The wham suite consists of two programs, wham and whamg. wham, the original - tool, is a very sensitive method with a high false discovery rate. The second program, - whamg, is more accurate and better suited for general structural variant (SV) discovery. +description: The wham suite consists of two programs, wham and whamg. wham, the + original tool, is a very sensitive method with a high false discovery rate. + The second program, whamg, is more accurate and better suited for general + structural variant (SV) discovery. keywords: - whamg - wham @@ -15,7 +16,8 @@ tools: documentation: "https://github.com/zeeev/wham" tool_dev_url: "https://github.com/zeeev/wham" doi: "10.1371/journal.pcbi.1004572" - licence: ["MIT"] + licence: + - "MIT" identifier: "" input: - - meta: @@ -55,7 +57,7 @@ output: description: Compressed VCF file pattern: "*.vcf.gz" ontologies: - - edam: http://edamontology.org/format_3989 # GZIP format + - edam: http://edamontology.org/format_3989 tbi: - - meta: type: map @@ -78,13 +80,27 @@ output: description: Graph file pattern: "*.txt" ontologies: [] + versions_whamg: + - - ${task.process}: + type: string + description: The name of the process + - whamg: + type: string + description: The name of the tool + - "whamg 2>&1 | grep Version | sed 's/^Version: v//; s/-.*$//'": + 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 + - whamg: + type: string + description: The name of the tool + - "whamg 2>&1 | grep Version | sed 's/^Version: v//; s/-.*$//'": + type: eval + description: The expression to obtain the version of the tool authors: - "@nvnieuwk" maintainers: diff --git a/modules/nf-core/whamg/tests/main.nf.test b/modules/nf-core/whamg/tests/main.nf.test index 9dc5e77f4e55..3a965aec31cb 100644 --- a/modules/nf-core/whamg/tests/main.nf.test +++ b/modules/nf-core/whamg/tests/main.nf.test @@ -30,13 +30,34 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - path(process.out.vcf[0][1]).vcf.summary, - file(process.out.tbi[0][1]).name, - process.out.graph, - process.out.versions - ).match() - } + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + } + + test("test-whamg-bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } diff --git a/modules/nf-core/whamg/tests/main.nf.test.snap b/modules/nf-core/whamg/tests/main.nf.test.snap index 306d5acf06d5..e447a741943e 100644 --- a/modules/nf-core/whamg/tests/main.nf.test.snap +++ b/modules/nf-core/whamg/tests/main.nf.test.snap @@ -1,19 +1,76 @@ { "test-whamg-bam": { "content": [ - "VcfFile [chromosomes=[], sampleCount=1, variantCount=0, phased=true, phasedAutodetect=true]", - "test.vcf.gz.tbi", - [ - - ], - [ - "versions.yml:md5,243bed402cdc21ab2fc42a7400399ea9" - ] + { + "graph": [ + + ], + "tbi": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,e45326a91ef59ea91ad3fe85f353748c" + ] + ], + "versions_whamg": [ + [ + "WHAMG", + "whamg", + "1.7.0" + ] + ] + } ], + "timestamp": "2026-04-30T17:44:50.968503", "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.4" - }, - "timestamp": "2024-08-27T11:43:16.953021" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "test-whamg-bam - stub": { + "content": [ + { + "graph": [ + + ], + "tbi": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions_whamg": [ + [ + "WHAMG", + "whamg", + "1.7.0" + ] + ] + } + ], + "timestamp": "2026-04-30T17:44:56.533951", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } } } \ No newline at end of file From c489f4f502f28c74338a871e01f7fc95c898b06f 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/whamg/main.nf | 2 +- modules/nf-core/whamg/meta.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/whamg/main.nf b/modules/nf-core/whamg/main.nf index 7fb499d28db2..09829df9a2a7 100644 --- a/modules/nf-core/whamg/main.nf +++ b/modules/nf-core/whamg/main.nf @@ -16,7 +16,7 @@ process WHAMG { tuple val(meta), path("*.vcf.gz") , emit: vcf tuple val(meta), path("*.vcf.gz.tbi") , emit: tbi tuple val(meta), path("*.txt") , emit: graph, optional: true - tuple val("${task.process}"), val('whamg'), eval('whamg 2>&1 | grep Version | sed \'s/^Version: v//; s/-.*$//\''), topic: versions, emit: versions_whamg + tuple val("${task.process}"), val('whamg'), eval('whamg 2>&1 | grep Version | sed \'s/^Version: v//; s/-.*$//\''), topic: versions, emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/whamg/meta.yml b/modules/nf-core/whamg/meta.yml index 353ec0f972e4..47cfbb495117 100644 --- a/modules/nf-core/whamg/meta.yml +++ b/modules/nf-core/whamg/meta.yml @@ -57,7 +57,7 @@ output: description: Compressed VCF file pattern: "*.vcf.gz" ontologies: - - edam: http://edamontology.org/format_3989 + - edam: http://edamontology.org/format_3989 # GZIP format tbi: - - meta: type: map @@ -80,7 +80,7 @@ output: description: Graph file pattern: "*.txt" ontologies: [] - versions_whamg: + versions: - - ${task.process}: type: string description: The name of the process From a539828e115a1ac6feb5e4f87fac48d1303f7afc Mon Sep 17 00:00:00 2001 From: "Harrison H. Vaughn Reed" Date: Fri, 1 May 2026 09:25:19 -0400 Subject: [PATCH 3/3] fix(whamg): rename emit to versions_whamg per nf-core convention - main.nf: emit: versions -> emit: versions_whamg - meta.yml: output key versions: -> versions_whamg: Local lint: 56/0. Local nf-test: 2/2 passed. --- modules/nf-core/whamg/main.nf | 2 +- modules/nf-core/whamg/meta.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/whamg/main.nf b/modules/nf-core/whamg/main.nf index 09829df9a2a7..7fb499d28db2 100644 --- a/modules/nf-core/whamg/main.nf +++ b/modules/nf-core/whamg/main.nf @@ -16,7 +16,7 @@ process WHAMG { tuple val(meta), path("*.vcf.gz") , emit: vcf tuple val(meta), path("*.vcf.gz.tbi") , emit: tbi tuple val(meta), path("*.txt") , emit: graph, optional: true - tuple val("${task.process}"), val('whamg'), eval('whamg 2>&1 | grep Version | sed \'s/^Version: v//; s/-.*$//\''), topic: versions, emit: versions + tuple val("${task.process}"), val('whamg'), eval('whamg 2>&1 | grep Version | sed \'s/^Version: v//; s/-.*$//\''), topic: versions, emit: versions_whamg when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/whamg/meta.yml b/modules/nf-core/whamg/meta.yml index 47cfbb495117..a535e0cd6567 100644 --- a/modules/nf-core/whamg/meta.yml +++ b/modules/nf-core/whamg/meta.yml @@ -80,7 +80,7 @@ output: description: Graph file pattern: "*.txt" ontologies: [] - versions: + versions_whamg: - - ${task.process}: type: string description: The name of the process