From 3e919ce105ca99ee7800f36c86c526453883893f Mon Sep 17 00:00:00 2001 From: "Harrison H. Vaughn Reed" Date: Thu, 30 Apr 2026 17:12:44 -0400 Subject: [PATCH 1/3] feat(seqsero2): migrate to topic: versions, add stub block, sanitizeOutput assertions --- modules/nf-core/seqsero2/main.nf | 15 ++- modules/nf-core/seqsero2/meta.yml | 31 ++++-- modules/nf-core/seqsero2/tests/main.nf.test | 32 +++++-- .../nf-core/seqsero2/tests/main.nf.test.snap | 95 +++++++++++++++++-- 4 files changed, 143 insertions(+), 30 deletions(-) diff --git a/modules/nf-core/seqsero2/main.nf b/modules/nf-core/seqsero2/main.nf index 599fce5c4350..bc13dfb71d95 100644 --- a/modules/nf-core/seqsero2/main.nf +++ b/modules/nf-core/seqsero2/main.nf @@ -14,7 +14,7 @@ process SEQSERO2 { tuple val(meta), path("results/*_log.txt") , emit: log tuple val(meta), path("results/*_result.tsv"), emit: tsv tuple val(meta), path("results/*_result.txt"), emit: txt - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('seqsero2'), eval('SeqSero2_package.py --version 2>&1 | sed "s/^.*SeqSero2_package.py //"'), topic: versions, emit: versions_seqsero2 when: task.ext.when == null || task.ext.when @@ -29,10 +29,15 @@ process SEQSERO2 { -n $prefix \\ -p $task.cpus \\ -i $seqs + """ - cat <<-END_VERSIONS > versions.yml - "${task.process}": - seqsero2: \$( echo \$( SeqSero2_package.py --version 2>&1) | sed 's/^.*SeqSero2_package.py //' ) - END_VERSIONS + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + mkdir -p results/ + touch results/SeqSero_log.txt + touch results/SeqSero_result.tsv + touch results/SeqSero_result.txt """ } diff --git a/modules/nf-core/seqsero2/meta.yml b/modules/nf-core/seqsero2/meta.yml index 50dc4b673ab4..eb56ee5f4eba 100644 --- a/modules/nf-core/seqsero2/meta.yml +++ b/modules/nf-core/seqsero2/meta.yml @@ -12,7 +12,8 @@ tools: documentation: https://github.com/denglab/SeqSero2 tool_dev_url: https://github.com/denglab/SeqSero2 doi: "10.1128/AEM.01746-19" - licence: ["GPL v2"] + licence: + - "GPL v2" identifier: biotools:SeqSero2 input: - - meta: @@ -48,7 +49,7 @@ output: description: Tab-delimited summary of the SeqSero2 results pattern: "*_result.tsv" ontologies: - - edam: http://edamontology.org/format_3475 # TSV + - edam: http://edamontology.org/format_3475 txt: - - meta: type: map @@ -60,13 +61,27 @@ output: description: Detailed summary of the SeqSero2 results pattern: "*_result.txt" ontologies: [] + versions_seqsero2: + - - ${task.process}: + type: string + description: The name of the process + - seqsero2: + type: string + description: seqsero2 version string + - 'SeqSero2_package.py --version 2>&1 | sed "s/^.*SeqSero2_package.py //"': + 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 + - seqsero2: + type: string + description: seqsero2 version string + - 'SeqSero2_package.py --version 2>&1 | sed "s/^.*SeqSero2_package.py //"': + type: eval + description: The expression to obtain the version of the tool authors: - "@rpetit3" maintainers: diff --git a/modules/nf-core/seqsero2/tests/main.nf.test b/modules/nf-core/seqsero2/tests/main.nf.test index 457bec56a151..1aacef28273f 100644 --- a/modules/nf-core/seqsero2/tests/main.nf.test +++ b/modules/nf-core/seqsero2/tests/main.nf.test @@ -27,13 +27,31 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.log[0][1]).name, - file(process.out.tsv[0][1]).readLines()[0], - file(process.out.txt[0][1]).readLines()[0], - process.out.versions - ).match() - } + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + } + + test("test-seqsero2 - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } diff --git a/modules/nf-core/seqsero2/tests/main.nf.test.snap b/modules/nf-core/seqsero2/tests/main.nf.test.snap index 44c2a52c73d2..58c679eb7e44 100644 --- a/modules/nf-core/seqsero2/tests/main.nf.test.snap +++ b/modules/nf-core/seqsero2/tests/main.nf.test.snap @@ -1,17 +1,92 @@ { + "test-seqsero2 - stub": { + "content": [ + { + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "SeqSero_log.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "SeqSero_result.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "SeqSero_result.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_seqsero2": [ + [ + "SEQSERO2", + "seqsero2", + "1.2.1" + ] + ] + } + ], + "timestamp": "2026-04-30T17:32:40.251762", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, "test-seqsero2": { "content": [ - "SeqSero_log.txt", - "Sample name\tOutput directory\tInput files\tO antigen prediction\tH1 antigen prediction(fliC)\tH2 antigen prediction(fljB)\tPredicted identification\tPredicted antigenic profile\tPredicted serotype\tNote", - "Sample name:\ttest", - [ - "versions.yml:md5,58aed3e038f84e5d4827dd22f5c88a13" - ] + { + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "SeqSero_log.txt:md5,d00242dfa734b5abb3622a6048f0b4fb" + ] + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "SeqSero_result.tsv:md5,749e60134db116aa688f864f8d3df28b" + ] + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "SeqSero_result.txt:md5,bc3587b10bfed29394c6c1bf5d1f5ffa" + ] + ], + "versions_seqsero2": [ + [ + "SEQSERO2", + "seqsero2", + "1.2.1" + ] + ] + } ], + "timestamp": "2026-04-30T17:32:34.459478", "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.4" - }, - "timestamp": "2024-08-27T13:25:13.677371" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } } } \ No newline at end of file From 3c453f9fa63216655067bebfbb5495fe604b3239 Mon Sep 17 00:00:00 2001 From: "Harrison H. Vaughn Reed" Date: Fri, 1 May 2026 07:13:10 -0400 Subject: [PATCH 2/3] Standardize version emission and restore EDAM comments --- modules/nf-core/seqsero2/main.nf | 2 +- modules/nf-core/seqsero2/meta.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/seqsero2/main.nf b/modules/nf-core/seqsero2/main.nf index bc13dfb71d95..ff27f00f710b 100644 --- a/modules/nf-core/seqsero2/main.nf +++ b/modules/nf-core/seqsero2/main.nf @@ -14,7 +14,7 @@ process SEQSERO2 { tuple val(meta), path("results/*_log.txt") , emit: log tuple val(meta), path("results/*_result.tsv"), emit: tsv tuple val(meta), path("results/*_result.txt"), emit: txt - tuple val("${task.process}"), val('seqsero2'), eval('SeqSero2_package.py --version 2>&1 | sed "s/^.*SeqSero2_package.py //"'), topic: versions, emit: versions_seqsero2 + tuple val("${task.process}"), val('seqsero2'), eval('SeqSero2_package.py --version 2>&1 | sed "s/^.*SeqSero2_package.py //"'), topic: versions, emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/seqsero2/meta.yml b/modules/nf-core/seqsero2/meta.yml index eb56ee5f4eba..b753f1f6b4a8 100644 --- a/modules/nf-core/seqsero2/meta.yml +++ b/modules/nf-core/seqsero2/meta.yml @@ -49,7 +49,7 @@ output: description: Tab-delimited summary of the SeqSero2 results pattern: "*_result.tsv" ontologies: - - edam: http://edamontology.org/format_3475 + - edam: http://edamontology.org/format_3475 # TSV txt: - - meta: type: map @@ -61,7 +61,7 @@ output: description: Detailed summary of the SeqSero2 results pattern: "*_result.txt" ontologies: [] - versions_seqsero2: + versions: - - ${task.process}: type: string description: The name of the process From 234b1bed7ebc47e8dcff5c147376c4d8cf6bd2ed Mon Sep 17 00:00:00 2001 From: "Harrison H. Vaughn Reed" Date: Fri, 1 May 2026 08:43:03 -0400 Subject: [PATCH 3/3] fix(seqsero2): rename emit to versions_seqsero2, update snapshots - main.nf: emit: versions -> emit: versions_seqsero2 - meta.yml: output key versions: -> versions_seqsero2: - tests/main.nf.test.snap: regenerate snapshots Local lint: 52/0. Local nf-test: 2/2 passed. --- modules/nf-core/seqsero2/main.nf | 2 +- modules/nf-core/seqsero2/meta.yml | 2 +- modules/nf-core/seqsero2/tests/main.nf.test.snap | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/seqsero2/main.nf b/modules/nf-core/seqsero2/main.nf index ff27f00f710b..bc13dfb71d95 100644 --- a/modules/nf-core/seqsero2/main.nf +++ b/modules/nf-core/seqsero2/main.nf @@ -14,7 +14,7 @@ process SEQSERO2 { tuple val(meta), path("results/*_log.txt") , emit: log tuple val(meta), path("results/*_result.tsv"), emit: tsv tuple val(meta), path("results/*_result.txt"), emit: txt - tuple val("${task.process}"), val('seqsero2'), eval('SeqSero2_package.py --version 2>&1 | sed "s/^.*SeqSero2_package.py //"'), topic: versions, emit: versions + tuple val("${task.process}"), val('seqsero2'), eval('SeqSero2_package.py --version 2>&1 | sed "s/^.*SeqSero2_package.py //"'), topic: versions, emit: versions_seqsero2 when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/seqsero2/meta.yml b/modules/nf-core/seqsero2/meta.yml index b753f1f6b4a8..2b203e22a891 100644 --- a/modules/nf-core/seqsero2/meta.yml +++ b/modules/nf-core/seqsero2/meta.yml @@ -61,7 +61,7 @@ output: description: Detailed summary of the SeqSero2 results pattern: "*_result.txt" ontologies: [] - versions: + versions_seqsero2: - - ${task.process}: type: string description: The name of the process diff --git a/modules/nf-core/seqsero2/tests/main.nf.test.snap b/modules/nf-core/seqsero2/tests/main.nf.test.snap index 58c679eb7e44..83e761288da8 100644 --- a/modules/nf-core/seqsero2/tests/main.nf.test.snap +++ b/modules/nf-core/seqsero2/tests/main.nf.test.snap @@ -62,7 +62,7 @@ "id": "test", "single_end": false }, - "SeqSero_result.tsv:md5,749e60134db116aa688f864f8d3df28b" + "SeqSero_result.tsv:md5,048df2c4382064d52fbcc553bccc9b33" ] ], "txt": [ @@ -71,7 +71,7 @@ "id": "test", "single_end": false }, - "SeqSero_result.txt:md5,bc3587b10bfed29394c6c1bf5d1f5ffa" + "SeqSero_result.txt:md5,b9a1e09e7c3f39c38bed94cd4397003d" ] ], "versions_seqsero2": [ @@ -83,7 +83,7 @@ ] } ], - "timestamp": "2026-04-30T17:32:34.459478", + "timestamp": "2026-05-01T08:40:00.703609", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0"