Skip to content

Commit 9a48bce

Browse files
authored
Migrate samtools dict/faidx/merge to topics (#9598)
* Update samtools dict/faidx/merge * Update subworkflows * Update meta * Update snapshots * Prettier * Add config back * Add config * Prettier
1 parent bcf558d commit 9a48bce

18 files changed

Lines changed: 396 additions & 292 deletions

File tree

modules/nf-core/samtools/dict/main.nf

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ process SAMTOOLS_DICT {
1212

1313
output:
1414
tuple val(meta), path ("*.dict"), emit: dict
15-
path "versions.yml" , emit: versions
15+
tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools
1616

1717
when:
1818
task.ext.when == null || task.ext.when
@@ -26,19 +26,10 @@ process SAMTOOLS_DICT {
2626
$fasta \\
2727
> ${fasta}.dict
2828
29-
cat <<-END_VERSIONS > versions.yml
30-
"${task.process}":
31-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
32-
END_VERSIONS
3329
"""
3430

3531
stub:
3632
"""
3733
touch ${fasta}.dict
38-
cat <<-END_VERSIONS > versions.yml
39-
40-
"${task.process}":
41-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
42-
END_VERSIONS
4334
"""
4435
}

modules/nf-core/samtools/dict/meta.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,28 @@ output:
3838
description: FASTA dictionary file
3939
pattern: "*.{dict}"
4040
ontologies: []
41+
versions_samtools:
42+
- - ${task.process}:
43+
type: string
44+
description: The process the versions were collected from
45+
- samtools:
46+
type: string
47+
description: The tool name
48+
- "samtools version | sed '1!d;s/.* //'":
49+
type: string
50+
description: The command used to generate the version of the tool
51+
52+
topics:
4153
versions:
42-
- versions.yml:
43-
type: file
44-
description: File containing software versions
45-
pattern: "versions.yml"
46-
ontologies:
47-
- edam: http://edamontology.org/format_3750 # YAML
54+
- - ${task.process}:
55+
type: string
56+
description: The process the versions were collected from
57+
- samtools:
58+
type: string
59+
description: The tool name
60+
- "samtools version | sed '1!d;s/.* //'":
61+
type: string
62+
description: The command used to generate the version of the tool
4863
authors:
4964
- "@muffato"
5065
maintainers:

modules/nf-core/samtools/dict/tests/main.nf.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ nextflow_process {
2727
{ assert process.success },
2828
{ assert snapshot(
2929
path(process.out.dict[0][1]).readLines()[0],
30-
process.out.versions
30+
process.out.findAll { key, val -> key.startsWith("versions") }
3131
).match()
3232
}
3333
)
@@ -51,9 +51,9 @@ nextflow_process {
5151
}
5252

5353
then {
54+
assert process.success
5455
assertAll(
55-
{ assert process.success },
56-
{ assert snapshot(process.out).match() }
56+
{ assert snapshot(process.out).match()}
5757
)
5858
}
5959

modules/nf-core/samtools/dict/tests/main.nf.test.snap

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
]
1313
],
1414
"1": [
15-
"versions.yml:md5,e25ce125c2f0fc01fec7ccd56a103541"
15+
[
16+
"SAMTOOLS_DICT",
17+
"samtools",
18+
"1.22.1"
19+
]
1620
],
1721
"dict": [
1822
[
@@ -23,28 +27,38 @@
2327
"genome.fasta.dict:md5,d41d8cd98f00b204e9800998ecf8427e"
2428
]
2529
],
26-
"versions": [
27-
"versions.yml:md5,e25ce125c2f0fc01fec7ccd56a103541"
30+
"versions_samtools": [
31+
[
32+
"SAMTOOLS_DICT",
33+
"samtools",
34+
"1.22.1"
35+
]
2836
]
2937
}
3038
],
3139
"meta": {
32-
"nf-test": "0.9.2",
33-
"nextflow": "25.04.6"
40+
"nf-test": "0.9.3",
41+
"nextflow": "25.10.2"
3442
},
35-
"timestamp": "2025-09-10T13:09:12.86475"
43+
"timestamp": "2025-12-22T09:04:24.522267802"
3644
},
3745
"sarscov2 - fasta": {
3846
"content": [
3947
"@HD\tVN:1.0\tSO:unsorted",
40-
[
41-
"versions.yml:md5,35365a5a4fea834f295d11d90aaff91d"
42-
]
48+
{
49+
"versions_samtools": [
50+
[
51+
"SAMTOOLS_DICT",
52+
"samtools",
53+
"1.22.1"
54+
]
55+
]
56+
}
4357
],
4458
"meta": {
45-
"nf-test": "0.9.2",
46-
"nextflow": "25.04.6"
59+
"nf-test": "0.9.3",
60+
"nextflow": "25.10.2"
4761
},
48-
"timestamp": "2025-09-10T13:09:09.151641"
62+
"timestamp": "2025-12-21T15:33:11.354952955"
4963
}
5064
}

modules/nf-core/samtools/faidx/main.nf

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ process SAMTOOLS_FAIDX {
1717
tuple val(meta), path ("*.sizes") , emit: sizes, optional: true
1818
tuple val(meta), path ("*.fai") , emit: fai, optional: true
1919
tuple val(meta), path ("*.gzi") , emit: gzi, optional: true
20-
path "versions.yml" , emit: versions
20+
tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools
2121

2222
when:
2323
task.ext.when == null || task.ext.when
@@ -32,11 +32,6 @@ process SAMTOOLS_FAIDX {
3232
$args
3333
3434
${get_sizes_command}
35-
36-
cat <<-END_VERSIONS > versions.yml
37-
"${task.process}":
38-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
39-
END_VERSIONS
4035
"""
4136

4237
stub:
@@ -51,11 +46,5 @@ process SAMTOOLS_FAIDX {
5146
fi
5247
5348
${get_sizes_command}
54-
55-
cat <<-END_VERSIONS > versions.yml
56-
57-
"${task.process}":
58-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
59-
END_VERSIONS
6049
"""
6150
}

modules/nf-core/samtools/faidx/meta.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,28 @@ output:
8686
description: Optional gzip index file for compressed inputs
8787
pattern: "*.gzi"
8888
ontologies: []
89+
versions_samtools:
90+
- - ${task.process}:
91+
type: string
92+
description: The process the versions were collected from
93+
- samtools:
94+
type: string
95+
description: The tool name
96+
- "samtools version | sed '1!d;s/.* //'":
97+
type: string
98+
description: The command used to generate the version of the tool
99+
100+
topics:
89101
versions:
90-
- versions.yml:
91-
type: file
92-
description: File containing software versions
93-
pattern: "versions.yml"
94-
ontologies:
95-
- edam: http://edamontology.org/format_3750 # YAML
102+
- - ${task.process}:
103+
type: string
104+
description: The process the versions were collected from
105+
- samtools:
106+
type: string
107+
description: The tool name
108+
- "samtools version | sed '1!d;s/.* //'":
109+
type: string
110+
description: The command used to generate the version of the tool
96111
authors:
97112
- "@drpatelh"
98113
- "@ewels"

0 commit comments

Comments
 (0)