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..2b203e22a891 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: @@ -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..83e761288da8 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,048df2c4382064d52fbcc553bccc9b33" + ] + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "SeqSero_result.txt:md5,b9a1e09e7c3f39c38bed94cd4397003d" + ] + ], + "versions_seqsero2": [ + [ + "SEQSERO2", + "seqsero2", + "1.2.1" + ] + ] + } ], + "timestamp": "2026-05-01T08:40:00.703609", "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