From 31bf8a3d174ef7988132614b55f0872f147b9afc 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(smoothxg): migrate to topic: versions, add stub block, sanitizeOutput assertions --- modules/nf-core/smoothxg/main.nf | 11 +-- modules/nf-core/smoothxg/meta.yml | 41 +++++++---- modules/nf-core/smoothxg/tests/main.nf.test | 28 ++++++- .../nf-core/smoothxg/tests/main.nf.test.snap | 73 ++++++++++++++++--- 4 files changed, 123 insertions(+), 30 deletions(-) diff --git a/modules/nf-core/smoothxg/main.nf b/modules/nf-core/smoothxg/main.nf index 8a32e6045c34..f06c629fe873 100644 --- a/modules/nf-core/smoothxg/main.nf +++ b/modules/nf-core/smoothxg/main.nf @@ -13,7 +13,7 @@ process SMOOTHXG { output: tuple val(meta), path("*smoothxg.gfa"), emit: gfa path("*.maf") , optional: true, emit: maf - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('smoothxg'), eval("smoothxg --version 2>&1 | cut -f 1 -d '-' | cut -f 2 -d 'v'"), topic: versions, emit: versions_smoothxg when: task.ext.when == null || task.ext.when @@ -27,10 +27,11 @@ process SMOOTHXG { --gfa-in=${gfa} \\ --smoothed-out=${prefix}.smoothxg.gfa \\ $args + """ - cat <<-END_VERSIONS > versions.yml - "${task.process}": - smoothxg: \$(smoothxg --version 2>&1 | cut -f 1 -d '-' | cut -f 2 -d 'v') - END_VERSIONS + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.smoothxg.gfa """ } diff --git a/modules/nf-core/smoothxg/meta.yml b/modules/nf-core/smoothxg/meta.yml index 43df3f92ae24..04a261dadff6 100644 --- a/modules/nf-core/smoothxg/meta.yml +++ b/modules/nf-core/smoothxg/meta.yml @@ -1,6 +1,6 @@ name: smoothxg -description: Linearize and simplify variation graph in GFA format using blocked partial - order alignment +description: Linearize and simplify variation graph in GFA format using blocked + partial order alignment keywords: - gfa - graph @@ -14,7 +14,8 @@ tools: order alignment. homepage: https://github.com/pangenome/smoothxg documentation: https://github.com/pangenome/smoothxg - licence: ["MIT"] + licence: + - "MIT" identifier: "" input: - - meta: @@ -27,7 +28,7 @@ input: description: Variation graph in GFA 1.0 format pattern: "*.{gfa}" ontologies: - - edam: http://edamontology.org/format_3975 # GFA 1 + - edam: http://edamontology.org/format_3975 output: gfa: - - meta: @@ -40,21 +41,35 @@ output: description: Linearized and simplified graph in GFA 1.0 format pattern: "*.smoothxg.{gfa}" ontologies: - - edam: http://edamontology.org/format_3975 # GFA 1 + - edam: http://edamontology.org/format_3975 maf: - "*.maf": type: file - description: write the multiple sequence alignments (MSAs) in MAF format in - this file (optional) + description: write the multiple sequence alignments (MSAs) in MAF format + in this file (optional) pattern: "*.{maf}" ontologies: [] + versions_smoothxg: + - - ${task.process}: + type: string + description: The name of the process + - smoothxg: + type: string + description: The name of the tool + - smoothxg --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 + - smoothxg: + type: string + description: The name of the tool + - smoothxg --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: - "@heuermh, @subwaystation" maintainers: diff --git a/modules/nf-core/smoothxg/tests/main.nf.test b/modules/nf-core/smoothxg/tests/main.nf.test index 1a2ee9188dd4..40c7accdf622 100644 --- a/modules/nf-core/smoothxg/tests/main.nf.test +++ b/modules/nf-core/smoothxg/tests/main.nf.test @@ -25,7 +25,7 @@ nextflow_process { then { assertAll( { assert process.success }, -// { assert snapshot(process.out).match() } // SMOOTHXG is never deterministic + { assert snapshot(sanitizeOutput(process.out)).match() } ) } @@ -47,7 +47,31 @@ nextflow_process { then { assertAll( { assert process.success }, -// { assert snapshot(process.out).match() } // SMOOTHXG is never deterministic + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + + } + + test("sarscov2 - illumina - assembly_gfa - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/gfa/assembly.gfa', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match() } ) } diff --git a/modules/nf-core/smoothxg/tests/main.nf.test.snap b/modules/nf-core/smoothxg/tests/main.nf.test.snap index 341236202364..039e2cf17a70 100644 --- a/modules/nf-core/smoothxg/tests/main.nf.test.snap +++ b/modules/nf-core/smoothxg/tests/main.nf.test.snap @@ -2,38 +2,91 @@ "sarscov2 - illumina - assembly_gfa": { "content": [ { - "0": [ + "gfa": [ [ { "id": "test", "single_end": false }, - "test.smoothxg.gfa:md5,c85140490fb255f8361499c01d0dd15b" + "test.smoothxg.gfa:md5,f0991ef0f6a54dcbae0454c812256664" ] ], - "1": [ + "maf": [ "test.maf:md5,a6d82f572a5358926b87c69683d7825e" ], - "2": [ - "versions.yml:md5,14c3d1a28b189a6db45facabbb5dc274" + "versions_smoothxg": [ + [ + "SMOOTHXG", + "smoothxg", + "0.8.0" + ] + ] + } + ], + "timestamp": "2026-04-30T17:40:45.061861", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "sarscov2 - illumina - assembly_gfa - stub": { + "content": [ + { + "gfa": [ + [ + { + "id": "test", + "single_end": false + }, + "test.smoothxg.gfa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "maf": [ + ], + "versions_smoothxg": [ + [ + "SMOOTHXG", + "smoothxg", + "0.8.0" + ] + ] + } + ], + "timestamp": "2026-04-30T17:41:00.367248", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "homo_sapiens - pangenome - pangenome_seqwish_gfa": { + "content": [ + { "gfa": [ [ { "id": "test", "single_end": false }, - "test.smoothxg.gfa:md5,c85140490fb255f8361499c01d0dd15b" + "test.smoothxg.gfa:md5,4a3d6a9bcb0bb5dcf10a9ff41fc900e7" ] ], "maf": [ - "test.maf:md5,a6d82f572a5358926b87c69683d7825e" + "test.maf:md5,f974a7502bcf6eb59574832694664df9" ], - "versions": [ - "versions.yml:md5,14c3d1a28b189a6db45facabbb5dc274" + "versions_smoothxg": [ + [ + "SMOOTHXG", + "smoothxg", + "0.8.0" + ] ] } ], - "timestamp": "2024-01-25T16:06:35.857843316" + "timestamp": "2026-04-30T17:40:55.500873", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } } } \ No newline at end of file From 101e01cdf87417c8f0d97a8c3c1eea5400186728 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/smoothxg/main.nf | 2 +- modules/nf-core/smoothxg/meta.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/smoothxg/main.nf b/modules/nf-core/smoothxg/main.nf index f06c629fe873..22d874796ca6 100644 --- a/modules/nf-core/smoothxg/main.nf +++ b/modules/nf-core/smoothxg/main.nf @@ -13,7 +13,7 @@ process SMOOTHXG { output: tuple val(meta), path("*smoothxg.gfa"), emit: gfa path("*.maf") , optional: true, emit: maf - tuple val("${task.process}"), val('smoothxg'), eval("smoothxg --version 2>&1 | cut -f 1 -d '-' | cut -f 2 -d 'v'"), topic: versions, emit: versions_smoothxg + tuple val("${task.process}"), val('smoothxg'), eval("smoothxg --version 2>&1 | cut -f 1 -d '-' | cut -f 2 -d 'v'"), topic: versions, emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/smoothxg/meta.yml b/modules/nf-core/smoothxg/meta.yml index 04a261dadff6..b9fd357ff1eb 100644 --- a/modules/nf-core/smoothxg/meta.yml +++ b/modules/nf-core/smoothxg/meta.yml @@ -28,7 +28,7 @@ input: description: Variation graph in GFA 1.0 format pattern: "*.{gfa}" ontologies: - - edam: http://edamontology.org/format_3975 + - edam: http://edamontology.org/format_3975 # GFA 1 output: gfa: - - meta: @@ -41,7 +41,7 @@ output: description: Linearized and simplified graph in GFA 1.0 format pattern: "*.smoothxg.{gfa}" ontologies: - - edam: http://edamontology.org/format_3975 + - edam: http://edamontology.org/format_3975 # GFA 1 maf: - "*.maf": type: file @@ -49,7 +49,7 @@ output: in this file (optional) pattern: "*.{maf}" ontologies: [] - versions_smoothxg: + versions: - - ${task.process}: type: string description: The name of the process From a860fc7d191a36dc1e33f21325fd6487188e748c Mon Sep 17 00:00:00 2001 From: "Harrison H. Vaughn Reed" Date: Fri, 1 May 2026 08:52:57 -0400 Subject: [PATCH 3/3] fix(smoothxg): rename emit to versions_smoothxg, simplify eval, update snapshots - main.nf: emit: versions -> emit: versions_smoothxg - meta.yml: output key versions: -> versions_smoothxg: - main.nf/meta.yml: simplify eval string to use sed instead of dual cuts - tests/main.nf.test.snap: regenerate snapshots Local lint: 54/0. Local nf-test: 3/3 passed. --- modules/nf-core/smoothxg/main.nf | 2 +- modules/nf-core/smoothxg/meta.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/smoothxg/main.nf b/modules/nf-core/smoothxg/main.nf index 22d874796ca6..b40fbdaa4d20 100644 --- a/modules/nf-core/smoothxg/main.nf +++ b/modules/nf-core/smoothxg/main.nf @@ -13,7 +13,7 @@ process SMOOTHXG { output: tuple val(meta), path("*smoothxg.gfa"), emit: gfa path("*.maf") , optional: true, emit: maf - tuple val("${task.process}"), val('smoothxg'), eval("smoothxg --version 2>&1 | cut -f 1 -d '-' | cut -f 2 -d 'v'"), topic: versions, emit: versions + tuple val("${task.process}"), val('smoothxg'), eval("smoothxg --version 2>&1 | sed 's/^v//; s/-.*//'"), topic: versions, emit: versions_smoothxg when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/smoothxg/meta.yml b/modules/nf-core/smoothxg/meta.yml index b9fd357ff1eb..799d387dedab 100644 --- a/modules/nf-core/smoothxg/meta.yml +++ b/modules/nf-core/smoothxg/meta.yml @@ -49,14 +49,14 @@ output: in this file (optional) pattern: "*.{maf}" ontologies: [] - versions: + versions_smoothxg: - - ${task.process}: type: string description: The name of the process - smoothxg: type: string description: The name of the tool - - smoothxg --version 2>&1 | cut -f 1 -d '-' | cut -f 2 -d 'v': + - "smoothxg --version 2>&1 | sed 's/^v//; s/-.*//'": type: eval description: The expression to obtain the version of the tool topics: @@ -67,7 +67,7 @@ topics: - smoothxg: type: string description: The name of the tool - - smoothxg --version 2>&1 | cut -f 1 -d '-' | cut -f 2 -d 'v': + - "smoothxg --version 2>&1 | sed 's/^v//; s/-.*//'": type: eval description: The expression to obtain the version of the tool authors: