Skip to content

Commit f87ed01

Browse files
authored
topics bamstats generalstats (#9278)
* topics bamstats generalstats * fix version
1 parent 01bfb37 commit f87ed01

File tree

4 files changed

+50
-34
lines changed

4 files changed

+50
-34
lines changed

modules/nf-core/bamstats/generalstats/main.nf

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ process BAMSTATS_GENERALSTATS {
1111

1212
output:
1313
tuple val(meta), path("*.json"), emit: json
14-
path "versions.yml" , emit: versions
14+
tuple val("${task.process}"), val("bamstats"), eval('bamstats --version | grep "version: " | sed -e s"/version: //"'), topic: versions, emit: versions_bamstats
1515

1616
when:
1717
task.ext.when == null || task.ext.when
@@ -28,11 +28,6 @@ process BAMSTATS_GENERALSTATS {
2828
$args \\
2929
-c $task.cpus \\
3030
-o ${prefix}.json
31-
32-
cat <<-END_VERSIONS > versions.yml
33-
"${task.process}":
34-
bamstats: \$(echo \$(bamstats --version 2>&1) | sed 's/^.*bamstats == version://; s/Using.*\$//' | sed 's/built.*//' )
35-
END_VERSIONS
3631
"""
3732

3833
stub:
@@ -41,10 +36,5 @@ process BAMSTATS_GENERALSTATS {
4136

4237
"""
4338
touch ${prefix}.json
44-
45-
cat <<-END_VERSIONS > versions.yml
46-
"${task.process}":
47-
bamstats: \$(echo \$(bamstats --version 2>&1) | sed 's/^.*bamstats == version://; s/Using.*\$//' | sed 's/built.*//' )
48-
END_VERSIONS
4939
"""
5040
}

modules/nf-core/bamstats/generalstats/meta.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,26 @@ output:
3838
pattern: "*.json"
3939
ontologies:
4040
- edam: http://edamontology.org/format_3464 # JSON
41-
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
41+
versions_bamstats:
42+
- - ${task.process}:
43+
type: string
44+
description: The name of the process
45+
- bamstats:
46+
type: string
47+
description: The name of the tool
48+
- 'bamstats --version | grep "version: " | sed -e s"/version: //':
49+
type: string
50+
description: The version of the tool
51+
topics:
52+
- versions:
53+
- - process:
54+
type: string
55+
description: The process the versions were collected from
56+
- tool:
57+
type: string
58+
description: The tool name
59+
- version:
60+
type: string
61+
description: The version of the tool
4862
authors:
4963
- "@johnoooh"

modules/nf-core/bamstats/generalstats/tests/main.nf.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ nextflow_process {
2626
assertAll(
2727
{ assert process.success },
2828
{ assert path(process.out.json.get(0)[1]).exists() },
29-
{ assert snapshot(process.out.versions).match("versions") }
29+
{ assert snapshot(process.out.findAll { key, val -> key.startsWith("versions")}).match() }
3030
)
3131
}
3232

@@ -51,7 +51,7 @@ nextflow_process {
5151
assertAll(
5252
{ assert process.success },
5353
{ assert path(process.out.json.get(0)[1]).exists() },
54-
{ assert snapshot(process.out.versions).match("versions_stub") }
54+
{ assert snapshot(process.out.findAll { key, val -> key.startsWith("versions")}).match() }
5555
)
5656
}
5757

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,38 @@
11
{
2-
"versions_stub": {
2+
"sarscov2 - bam - stub": {
33
"content": [
4-
[
5-
"versions.yml:md5,6d858a3f76d1852b879f15436882c3cf"
6-
]
4+
{
5+
"versions_bamstats": [
6+
[
7+
"BAMSTATS_GENERALSTATS",
8+
"bamstats",
9+
"0.3.5"
10+
]
11+
]
12+
}
713
],
814
"meta": {
9-
"nf-test": "0.8.4",
10-
"nextflow": "23.10.1"
15+
"nf-test": "0.9.2",
16+
"nextflow": "25.10.0"
1117
},
12-
"timestamp": "2024-03-19T16:52:19.198122"
18+
"timestamp": "2025-10-28T16:24:09.688030951"
1319
},
14-
"versions": {
20+
"sarscov2 - bam": {
1521
"content": [
16-
[
17-
"versions.yml:md5,6d858a3f76d1852b879f15436882c3cf"
18-
]
22+
{
23+
"versions_bamstats": [
24+
[
25+
"BAMSTATS_GENERALSTATS",
26+
"bamstats",
27+
"0.3.5"
28+
]
29+
]
30+
}
1931
],
2032
"meta": {
21-
"nf-test": "0.8.4",
22-
"nextflow": "23.10.1"
33+
"nf-test": "0.9.2",
34+
"nextflow": "25.10.0"
2335
},
24-
"timestamp": "2024-03-19T16:52:07.413799"
36+
"timestamp": "2025-10-28T16:24:02.056451549"
2537
}
2638
}

0 commit comments

Comments
 (0)