diff --git a/modules/nf-core/wfmash/main.nf b/modules/nf-core/wfmash/main.nf index 4cb9b7ac7c94..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 - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('wfmash'), eval("wfmash --version 2>&1 | sed 's/^v//; s/-.*//'"), 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..accb16ee92c3 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 + - "wfmash --version 2>&1 | sed 's/^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 + - wfmash: + type: string + description: The name of the tool + - "wfmash --version 2>&1 | sed 's/^v//; s/-.*//'": + 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..7f0d4f7c56a7 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,29f914ce85ab77a33bd740d1f9570eec" + ] + ], + "versions_wfmash": [ + [ + "WFMASH", + "wfmash", + "0.13.0" + ] + ] + } + ], + "timestamp": "2026-05-01T09:19:21.270932", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } } } \ No newline at end of file