Skip to content

Commit 3e919ce

Browse files
committed
feat(seqsero2): migrate to topic: versions, add stub block, sanitizeOutput assertions
1 parent 6884a9d commit 3e919ce

4 files changed

Lines changed: 143 additions & 30 deletions

File tree

modules/nf-core/seqsero2/main.nf

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ process SEQSERO2 {
1414
tuple val(meta), path("results/*_log.txt") , emit: log
1515
tuple val(meta), path("results/*_result.tsv"), emit: tsv
1616
tuple val(meta), path("results/*_result.txt"), emit: txt
17-
path "versions.yml" , emit: versions
17+
tuple val("${task.process}"), val('seqsero2'), eval('SeqSero2_package.py --version 2>&1 | sed "s/^.*SeqSero2_package.py //"'), topic: versions, emit: versions_seqsero2
1818

1919
when:
2020
task.ext.when == null || task.ext.when
@@ -29,10 +29,15 @@ process SEQSERO2 {
2929
-n $prefix \\
3030
-p $task.cpus \\
3131
-i $seqs
32+
"""
3233

33-
cat <<-END_VERSIONS > versions.yml
34-
"${task.process}":
35-
seqsero2: \$( echo \$( SeqSero2_package.py --version 2>&1) | sed 's/^.*SeqSero2_package.py //' )
36-
END_VERSIONS
34+
stub:
35+
def args = task.ext.args ?: ''
36+
def prefix = task.ext.prefix ?: "${meta.id}"
37+
"""
38+
mkdir -p results/
39+
touch results/SeqSero_log.txt
40+
touch results/SeqSero_result.tsv
41+
touch results/SeqSero_result.txt
3742
"""
3843
}

modules/nf-core/seqsero2/meta.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ tools:
1212
documentation: https://github.com/denglab/SeqSero2
1313
tool_dev_url: https://github.com/denglab/SeqSero2
1414
doi: "10.1128/AEM.01746-19"
15-
licence: ["GPL v2"]
15+
licence:
16+
- "GPL v2"
1617
identifier: biotools:SeqSero2
1718
input:
1819
- - meta:
@@ -48,7 +49,7 @@ output:
4849
description: Tab-delimited summary of the SeqSero2 results
4950
pattern: "*_result.tsv"
5051
ontologies:
51-
- edam: http://edamontology.org/format_3475 # TSV
52+
- edam: http://edamontology.org/format_3475
5253
txt:
5354
- - meta:
5455
type: map
@@ -60,13 +61,27 @@ output:
6061
description: Detailed summary of the SeqSero2 results
6162
pattern: "*_result.txt"
6263
ontologies: []
64+
versions_seqsero2:
65+
- - ${task.process}:
66+
type: string
67+
description: The name of the process
68+
- seqsero2:
69+
type: string
70+
description: seqsero2 version string
71+
- 'SeqSero2_package.py --version 2>&1 | sed "s/^.*SeqSero2_package.py //"':
72+
type: eval
73+
description: The expression to obtain the version of the tool
74+
topics:
6375
versions:
64-
- versions.yml:
65-
type: file
66-
description: File containing software versions
67-
pattern: "versions.yml"
68-
ontologies:
69-
- edam: http://edamontology.org/format_3750 # YAML
76+
- - ${task.process}:
77+
type: string
78+
description: The name of the process
79+
- seqsero2:
80+
type: string
81+
description: seqsero2 version string
82+
- 'SeqSero2_package.py --version 2>&1 | sed "s/^.*SeqSero2_package.py //"':
83+
type: eval
84+
description: The expression to obtain the version of the tool
7085
authors:
7186
- "@rpetit3"
7287
maintainers:

modules/nf-core/seqsero2/tests/main.nf.test

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,31 @@ nextflow_process {
2727
then {
2828
assertAll(
2929
{ assert process.success },
30-
{ assert snapshot(
31-
file(process.out.log[0][1]).name,
32-
file(process.out.tsv[0][1]).readLines()[0],
33-
file(process.out.txt[0][1]).readLines()[0],
34-
process.out.versions
35-
).match()
36-
}
30+
{ assert snapshot(sanitizeOutput(process.out)).match() }
31+
)
32+
}
33+
}
34+
35+
test("test-seqsero2 - stub") {
36+
37+
options "-stub"
38+
39+
when {
40+
process {
41+
"""
42+
input[0] = [
43+
[ id:'test', single_end:false ], // meta map
44+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
45+
]
46+
47+
"""
48+
}
49+
}
50+
51+
then {
52+
assertAll(
53+
{ assert process.success },
54+
{ assert snapshot(sanitizeOutput(process.out)).match() }
3755
)
3856
}
3957
}
Lines changed: 85 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,92 @@
11
{
2+
"test-seqsero2 - stub": {
3+
"content": [
4+
{
5+
"log": [
6+
[
7+
{
8+
"id": "test",
9+
"single_end": false
10+
},
11+
"SeqSero_log.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
12+
]
13+
],
14+
"tsv": [
15+
[
16+
{
17+
"id": "test",
18+
"single_end": false
19+
},
20+
"SeqSero_result.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
21+
]
22+
],
23+
"txt": [
24+
[
25+
{
26+
"id": "test",
27+
"single_end": false
28+
},
29+
"SeqSero_result.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
30+
]
31+
],
32+
"versions_seqsero2": [
33+
[
34+
"SEQSERO2",
35+
"seqsero2",
36+
"1.2.1"
37+
]
38+
]
39+
}
40+
],
41+
"timestamp": "2026-04-30T17:32:40.251762",
42+
"meta": {
43+
"nf-test": "0.9.5",
44+
"nextflow": "26.04.0"
45+
}
46+
},
247
"test-seqsero2": {
348
"content": [
4-
"SeqSero_log.txt",
5-
"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",
6-
"Sample name:\ttest",
7-
[
8-
"versions.yml:md5,58aed3e038f84e5d4827dd22f5c88a13"
9-
]
49+
{
50+
"log": [
51+
[
52+
{
53+
"id": "test",
54+
"single_end": false
55+
},
56+
"SeqSero_log.txt:md5,d00242dfa734b5abb3622a6048f0b4fb"
57+
]
58+
],
59+
"tsv": [
60+
[
61+
{
62+
"id": "test",
63+
"single_end": false
64+
},
65+
"SeqSero_result.tsv:md5,749e60134db116aa688f864f8d3df28b"
66+
]
67+
],
68+
"txt": [
69+
[
70+
{
71+
"id": "test",
72+
"single_end": false
73+
},
74+
"SeqSero_result.txt:md5,bc3587b10bfed29394c6c1bf5d1f5ffa"
75+
]
76+
],
77+
"versions_seqsero2": [
78+
[
79+
"SEQSERO2",
80+
"seqsero2",
81+
"1.2.1"
82+
]
83+
]
84+
}
1085
],
86+
"timestamp": "2026-04-30T17:32:34.459478",
1187
"meta": {
12-
"nf-test": "0.8.4",
13-
"nextflow": "24.04.4"
14-
},
15-
"timestamp": "2024-08-27T13:25:13.677371"
88+
"nf-test": "0.9.5",
89+
"nextflow": "26.04.0"
90+
}
1691
}
1792
}

0 commit comments

Comments
 (0)