Skip to content
Merged
14 changes: 2 additions & 12 deletions modules/nf-core/samtools/stats/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ process SAMTOOLS_STATS {

output:
tuple val(meta), path("*.stats"), emit: stats
path "versions.yml" , emit: versions

tuple val("${task.process}"), val('samtools'), eval('samtools --version | head -1 | sed -e "s/samtools //"'), emit: versions_samtools, topic: versions
when:
task.ext.when == null || task.ext.when

Expand All @@ -28,21 +28,11 @@ process SAMTOOLS_STATS {
${reference} \\
${input} \\
> ${prefix}.stats

cat <<-END_VERSIONS > versions.yml
"${task.process}":
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.stats

cat <<-END_VERSIONS > versions.yml
"${task.process}":
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
}
29 changes: 22 additions & 7 deletions modules/nf-core/samtools/stats/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,28 @@ output:
description: File containing samtools stats output
pattern: "*.{stats}"
ontologies: []
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
versions_samtools:
- - ${task.process}:
type: string
description: Name of the process
- samtools:
type: string
description: Name of the tool
- samtools --version | head -1 | sed -e "s/samtools //:
type: string
description: Version of samtools used

topics:
- versions:
- - process:
type: string
description: The process the versions were collected from
- tool:
type: string
description: The tool name
- version:
type: string
description: The version of the tool
authors:
- "@drpatelh"
- "@FriederikeHanssen"
Expand Down
80 changes: 56 additions & 24 deletions modules/nf-core/samtools/stats/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
]
],
"1": [
"versions.yml:md5,7668882f411d0f6356f14a1b8b56fa3c"
[
"SAMTOOLS_STATS",
"samtools",
"1.22.1"
]
],
"stats": [
[
Expand All @@ -23,16 +27,20 @@
"test.stats:md5,f4aec6c41b73d34ac2fc6b3253aa39ba"
]
],
"versions": [
"versions.yml:md5,7668882f411d0f6356f14a1b8b56fa3c"
"versions_samtools": [
[
"SAMTOOLS_STATS",
"samtools",
"1.22.1"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-09-10T15:05:52.878044"
"timestamp": "2025-11-01T02:27:18.460724"
},
"bam - stub": {
"content": [
Expand All @@ -47,7 +55,11 @@
]
],
"1": [
"versions.yml:md5,7668882f411d0f6356f14a1b8b56fa3c"
[
"SAMTOOLS_STATS",
"samtools",
"1.22.1"
]
],
"stats": [
[
Expand All @@ -58,16 +70,20 @@
"test.stats:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,7668882f411d0f6356f14a1b8b56fa3c"
"versions_samtools": [
[
"SAMTOOLS_STATS",
"samtools",
"1.22.1"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-09-10T15:05:56.722672"
"timestamp": "2025-11-01T02:27:30.245839"
},
"cram - stub": {
"content": [
Expand All @@ -82,7 +98,11 @@
]
],
"1": [
"versions.yml:md5,7668882f411d0f6356f14a1b8b56fa3c"
[
"SAMTOOLS_STATS",
"samtools",
"1.22.1"
]
],
"stats": [
[
Expand All @@ -93,16 +113,20 @@
"test.stats:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,7668882f411d0f6356f14a1b8b56fa3c"
"versions_samtools": [
[
"SAMTOOLS_STATS",
"samtools",
"1.22.1"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-09-10T15:06:13.766719"
"timestamp": "2025-11-01T02:27:39.041649"
},
"bam": {
"content": [
Expand All @@ -117,7 +141,11 @@
]
],
"1": [
"versions.yml:md5,7668882f411d0f6356f14a1b8b56fa3c"
[
"SAMTOOLS_STATS",
"samtools",
"1.22.1"
]
],
"stats": [
[
Expand All @@ -128,15 +156,19 @@
"test.stats:md5,41ba8ad30ddb598dadb177a54c222ab9"
]
],
"versions": [
"versions.yml:md5,7668882f411d0f6356f14a1b8b56fa3c"
"versions_samtools": [
[
"SAMTOOLS_STATS",
"samtools",
"1.22.1"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-09-10T15:05:30.301153"
"timestamp": "2025-11-01T02:26:55.988241"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@
"versions.yml:md5,15a99b83c8965f9b29d0e9e6dbdef621",
"versions.yml:md5,61bd927f2f2121e34d94692a62305955",
"versions.yml:md5,657bce03545b4c57f9c5fc4314bf85f7",
"versions.yml:md5,67313fdb9b1b2ccee1c00408cc7ae072",
"versions.yml:md5,71d8ff70a0f65311659c446278f10b1a"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-09-10T13:32:36.702719"
"timestamp": "2025-11-01T02:35:06.350407"
},
"test_bam_dedup_stats_samtools_umicollapse_flagstats": {
"content": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,16 @@
],
[
"versions.yml:md5,0ebfc47a75bd075329a7434161100f8f",
"versions.yml:md5,8170256bdee0615a3a9c3ad9f44c99d7",
"versions.yml:md5,a8989d3d3bf9dde36a1d0664e54fccb5",
"versions.yml:md5,c4d5d9b171cc7b206cb14f7043f16e45",
"versions.yml:md5,e687e4e909255370121fcbec5a4299d1"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-09-11T09:42:03.400348"
"timestamp": "2025-11-01T02:35:42.524116"
},
"sarscov2_bam_bai - stub": {
"content": [
Expand Down Expand Up @@ -83,7 +82,7 @@
{
"id": "test"
},
"test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e"
"test.flagstat:md5,67394650dbae96d1a4fcc70484822159"
]
],
"6": [
Expand All @@ -96,7 +95,6 @@
],
"7": [
"versions.yml:md5,0ebfc47a75bd075329a7434161100f8f",
"versions.yml:md5,8170256bdee0615a3a9c3ad9f44c99d7",
"versions.yml:md5,a8989d3d3bf9dde36a1d0664e54fccb5",
"versions.yml:md5,c4d5d9b171cc7b206cb14f7043f16e45",
"versions.yml:md5,e687e4e909255370121fcbec5a4299d1"
Expand Down Expand Up @@ -133,7 +131,7 @@
{
"id": "test"
},
"test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e"
"test.flagstat:md5,67394650dbae96d1a4fcc70484822159"
]
],
"idxstats": [
Expand All @@ -154,17 +152,16 @@
],
"versions": [
"versions.yml:md5,0ebfc47a75bd075329a7434161100f8f",
"versions.yml:md5,8170256bdee0615a3a9c3ad9f44c99d7",
"versions.yml:md5,a8989d3d3bf9dde36a1d0664e54fccb5",
"versions.yml:md5,c4d5d9b171cc7b206cb14f7043f16e45",
"versions.yml:md5,e687e4e909255370121fcbec5a4299d1"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-09-11T09:42:13.338671"
"timestamp": "2025-11-01T02:35:58.59434"
}
}
Loading