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..a535e0cd6567 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: @@ -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