Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/nf-core/staphscan/environment.yml
Original file line number Diff line number Diff line change
@@ -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
46 changes: 46 additions & 0 deletions modules/nf-core/staphscan/main.nf
Original file line number Diff line number Diff line change
@@ -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
"""
}
67 changes: 67 additions & 0 deletions modules/nf-core/staphscan/meta.yml
Original file line number Diff line number Diff line change
@@ -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
65 changes: 65 additions & 0 deletions modules/nf-core/staphscan/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -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(sanitizeOutput(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(sanitizeOutput(process.out)).match() }
)
}
}

}
48 changes: 48 additions & 0 deletions modules/nf-core/staphscan/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"test-staphscan": {
"content": [
{
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test_summary.tsv:md5,c13d6d7e15052d80610185e3546113bd"
]
],
"versions_staphscan": [
"versions.yml:md5,b5af7928d06c090353c94a54c70f1672"
]
}
],
"timestamp": "2026-05-09T15:21:42.171023636",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
},
"test-staphscan-stub": {
"content": [
{
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test_summary.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_staphscan": [
"versions.yml:md5,b5af7928d06c090353c94a54c70f1672"
]
}
],
"timestamp": "2026-05-09T15:31:04.888855131",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
}
}
Loading