From bf86ad5383e3e3a2764f2f08a5691dab3dc3d957 Mon Sep 17 00:00:00 2001 From: riccabolla Date: Sat, 9 May 2026 15:06:43 +0200 Subject: [PATCH 1/7] Add STAPHSCAN main.nf to nf-core module . --- modules/nf-core/staphscan/main.nf | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 modules/nf-core/staphscan/main.nf diff --git a/modules/nf-core/staphscan/main.nf b/modules/nf-core/staphscan/main.nf new file mode 100644 index 00000000000..a1b527e5ed0 --- /dev/null +++ b/modules/nf-core/staphscan/main.nf @@ -0,0 +1,46 @@ +process STAPHSCAN { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/staphscan:0.3.1--pyhdfd78af_0' : + 'quay.io/biocontainers/staphscan:0.3.1--pyhdfd78af_0' }" + + input: + tuple val(meta), path(fastas) + + output: + tuple val(meta), path("*.tsv"), emit: tsv + path "versions.yml", topic: versions, emit: versions_staphscan + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + staphscan \\ + $args \\ + -o ${prefix}_outdir \\ + --report ${prefix}_summary.tsv \\ + -i $fastas + mv ${prefix}_outdir/*.tsv . || true + cat <<-END_VERSIONS > versions.yml + "${task.process}": + staphscan: \$( echo \$(staphscan --version | sed 's/staphscan v//;')) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}_summary.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + staphscan: \$( echo \$(staphscan --version | sed 's/staphscan v//;')) + END_VERSIONS + """ +} From d85a4c789e21bf5fe42326eba95e40afd5fd3f77 Mon Sep 17 00:00:00 2001 From: riccabolla Date: Sat, 9 May 2026 15:07:19 +0200 Subject: [PATCH 2/7] added meta and env yml files --- modules/nf-core/staphscan/environment.yml | 7 +++ modules/nf-core/staphscan/meta.yml | 67 +++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 modules/nf-core/staphscan/environment.yml create mode 100644 modules/nf-core/staphscan/meta.yml diff --git a/modules/nf-core/staphscan/environment.yml b/modules/nf-core/staphscan/environment.yml new file mode 100644 index 00000000000..25e6e0a4b9d --- /dev/null +++ b/modules/nf-core/staphscan/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::staphscan=0.3.1 diff --git a/modules/nf-core/staphscan/meta.yml b/modules/nf-core/staphscan/meta.yml new file mode 100644 index 00000000000..f74ca45ddea --- /dev/null +++ b/modules/nf-core/staphscan/meta.yml @@ -0,0 +1,67 @@ +name: staphscan +description: staphscan is a tool to screen genome assemblies of Staphylococcus + aureus +keywords: + - screen + - assembly + - Staphylococcus + - aureus +tools: + - staphscan: + description: a genomic surveillance framework for Staphylococcus aureus + homepage: https://github.com/riccabolla/StaphSCAN + documentation: https://staphscan.readthedocs.io/en/latest/ + tool_dev_url: https://github.com/riccabolla/StaphSCAN + doi: 10.5281/zenodo.18458858 + licence: + - "MIT" + identifier: biotools:staphscan +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fastas: + type: list + description: Staphylococcus aureus genome assemblies to be screened + pattern: "*.fasta" +output: + tsv: + - - meta: + type: string + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tsv": + type: file + description: Result file generated after screening + pattern: "*.tsv" + ontologies: + - edam: http://edamontology.org/format_3475 + versions_staphscan: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 +topics: + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 +authors: + - "@riccabolla" +maintainers: + - "@riccabolla" +versions_staphscan: + - - versions.yml: null + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 From 944411914480fe591e430aa281d51860a74c869c Mon Sep 17 00:00:00 2001 From: riccabolla Date: Sat, 9 May 2026 15:08:42 +0200 Subject: [PATCH 3/7] Implement tests for STAPHSCAN --- modules/nf-core/staphscan/tests/main.nf.test | 65 ++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 modules/nf-core/staphscan/tests/main.nf.test diff --git a/modules/nf-core/staphscan/tests/main.nf.test b/modules/nf-core/staphscan/tests/main.nf.test new file mode 100644 index 00000000000..9ee8566115a --- /dev/null +++ b/modules/nf-core/staphscan/tests/main.nf.test @@ -0,0 +1,65 @@ + +nextflow_process { + + name "Test Process STAPHSCAN" + script "../main.nf" + process "STAPHSCAN" + + tag "modules" + tag "modules_nfcore" + tag "staphscan" + + test("test-staphscan") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/scaffolds.fasta', checkIfExists: true) + ] + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-staphscan-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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/scaffolds.fasta', checkIfExists: true) + ] + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} From b95cf49ef0a3c570a63153165d275d258a196782 Mon Sep 17 00:00:00 2001 From: riccabolla Date: Sat, 9 May 2026 15:09:06 +0200 Subject: [PATCH 4/7] added test snap --- .../nf-core/staphscan/tests/main.nf.test.snap | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 modules/nf-core/staphscan/tests/main.nf.test.snap diff --git a/modules/nf-core/staphscan/tests/main.nf.test.snap b/modules/nf-core/staphscan/tests/main.nf.test.snap new file mode 100644 index 00000000000..0dc540c04fa --- /dev/null +++ b/modules/nf-core/staphscan/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "test-staphscan": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_summary.tsv:md5,c13d6d7e15052d80610185e3546113bd" + ] + ], + "1": [ + "versions.yml:md5,b5af7928d06c090353c94a54c70f1672" + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test_summary.tsv:md5,c13d6d7e15052d80610185e3546113bd" + ] + ], + "versions_staphscan": [ + "versions.yml:md5,b5af7928d06c090353c94a54c70f1672" + ] + } + ], + "timestamp": "2026-05-08T20:30:05.190759302", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "test-staphscan-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_summary.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,b5af7928d06c090353c94a54c70f1672" + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test_summary.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_staphscan": [ + "versions.yml:md5,b5af7928d06c090353c94a54c70f1672" + ] + } + ], + "timestamp": "2026-05-08T20:30:24.249568669", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + } +} \ No newline at end of file From 2f8a3f31ff09cbd24e54fbb2141caef3e64247d0 Mon Sep 17 00:00:00 2001 From: riccabolla Date: Sat, 9 May 2026 15:29:50 +0200 Subject: [PATCH 5/7] Update snapshot assertions to sanitize output --- modules/nf-core/staphscan/tests/main.nf.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/staphscan/tests/main.nf.test b/modules/nf-core/staphscan/tests/main.nf.test index 9ee8566115a..072636b870b 100644 --- a/modules/nf-core/staphscan/tests/main.nf.test +++ b/modules/nf-core/staphscan/tests/main.nf.test @@ -30,7 +30,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } @@ -57,7 +57,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } From 76a0390b1b743b2237319bc7c7d68c5a9f9c8335 Mon Sep 17 00:00:00 2001 From: riccabolla Date: Sat, 9 May 2026 15:32:35 +0200 Subject: [PATCH 6/7] Update snap --- .../nf-core/staphscan/tests/main.nf.test.snap | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/modules/nf-core/staphscan/tests/main.nf.test.snap b/modules/nf-core/staphscan/tests/main.nf.test.snap index 0dc540c04fa..0d24fe35801 100644 --- a/modules/nf-core/staphscan/tests/main.nf.test.snap +++ b/modules/nf-core/staphscan/tests/main.nf.test.snap @@ -2,18 +2,6 @@ "test-staphscan": { "content": [ { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test_summary.tsv:md5,c13d6d7e15052d80610185e3546113bd" - ] - ], - "1": [ - "versions.yml:md5,b5af7928d06c090353c94a54c70f1672" - ], "tsv": [ [ { @@ -28,7 +16,7 @@ ] } ], - "timestamp": "2026-05-08T20:30:05.190759302", + "timestamp": "2026-05-09T15:21:42.171023636", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -37,18 +25,6 @@ "test-staphscan-stub": { "content": [ { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test_summary.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - "versions.yml:md5,b5af7928d06c090353c94a54c70f1672" - ], "tsv": [ [ { @@ -63,10 +39,10 @@ ] } ], - "timestamp": "2026-05-08T20:30:24.249568669", + "timestamp": "2026-05-09T15:31:04.888855131", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" } } -} \ No newline at end of file +} From 3d021122be557f8be23390464e3e6b98cb053b29 Mon Sep 17 00:00:00 2001 From: riccabolla Date: Sat, 9 May 2026 15:38:14 +0200 Subject: [PATCH 7/7] Fix formatting of Staphylococcus entry in meta.yml --- modules/nf-core/staphscan/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/staphscan/meta.yml b/modules/nf-core/staphscan/meta.yml index f74ca45ddea..220ec5d79d7 100644 --- a/modules/nf-core/staphscan/meta.yml +++ b/modules/nf-core/staphscan/meta.yml @@ -4,7 +4,7 @@ description: staphscan is a tool to screen genome assemblies of Staphylococcus keywords: - screen - assembly - - Staphylococcus + - Staphylococcus - aureus tools: - staphscan: