Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 10 additions & 5 deletions modules/nf-core/seqsero2/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
"""
}
31 changes: 23 additions & 8 deletions modules/nf-core/seqsero2/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
32 changes: 25 additions & 7 deletions modules/nf-core/seqsero2/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't just blindly use sanitizeOutput on process.out when we weren't before!

)
}
}

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() }
)
}
}
Expand Down
95 changes: 85 additions & 10 deletions modules/nf-core/seqsero2/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
Loading