Skip to content

Commit e8ded25

Browse files
Adds version topic channel to SAMTOOLS_STATS
1 parent 0ab9ac3 commit e8ded25

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ process SAMTOOLS_STATS {
1313

1414
output:
1515
tuple val(meta), path("*.stats"), emit: stats
16-
path "versions.yml" , emit: versions
17-
16+
tuple val("${task.process}"), val('samtools'), eval('samtools --version | head -1 | sed -e "s/samtools //"'), emit: versions_samtools, topic: versions
17+
1818
when:
1919
task.ext.when == null || task.ext.when
2020

@@ -28,21 +28,11 @@ process SAMTOOLS_STATS {
2828
${reference} \\
2929
${input} \\
3030
> ${prefix}.stats
31-
32-
cat <<-END_VERSIONS > versions.yml
33-
"${task.process}":
34-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
35-
END_VERSIONS
3631
"""
3732

3833
stub:
3934
def prefix = task.ext.prefix ?: "${meta.id}"
4035
"""
4136
touch ${prefix}.stats
42-
43-
cat <<-END_VERSIONS > versions.yml
44-
"${task.process}":
45-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
46-
END_VERSIONS
4737
"""
4838
}

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

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,28 @@ output:
5555
description: File containing samtools stats output
5656
pattern: "*.{stats}"
5757
ontologies: []
58-
versions:
59-
- versions.yml:
60-
type: file
61-
description: File containing software versions
62-
pattern: "versions.yml"
63-
ontologies:
64-
- edam: http://edamontology.org/format_3750 # YAML
58+
versions_samtools:
59+
- - ${task.process}:
60+
type: string
61+
description: Name of the process
62+
- samtools:
63+
type: string
64+
description: Name of the tool
65+
- samtools --version | head -1 | sed -e "s/samtools //:
66+
type: string
67+
description: Version of samtools used
68+
69+
topics:
70+
- versions:
71+
- - process:
72+
type: string
73+
description: The process the versions were collected from
74+
- tool:
75+
type: string
76+
description: The tool name
77+
- version:
78+
type: string
79+
description: The version of the tool
6580
authors:
6681
- "@drpatelh"
6782
- "@FriederikeHanssen"

0 commit comments

Comments
 (0)