Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions modules/nf-core/whamg/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ process WHAMG {
tuple val(meta), path("*.vcf.gz") , emit: vcf
tuple val(meta), path("*.vcf.gz.tbi") , emit: tbi
tuple val(meta), path("*.txt") , emit: graph, optional: true
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('whamg'), eval('whamg 2>&1 | grep Version | sed \'s/^Version: v//; s/-.*$//\''), topic: versions, emit: versions_whamg
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this one sed command please.


when:
task.ext.when == null || task.ext.when
Expand All @@ -36,10 +36,14 @@ process WHAMG {
| bgzip ${args2} --threads ${task.cpus} --stdout > ${prefix}.vcf.gz

tabix ${args3} ${prefix}.vcf.gz
"""

cat <<-END_VERSIONS > versions.yml
"${task.process}":
whamg: \$(echo \$(whamg 2>&1 | grep Version | sed 's/^Version: v//; s/-.*\$//' ))
END_VERSIONS
stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
echo "" | gzip > ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi
"""
}
38 changes: 27 additions & 11 deletions modules/nf-core/whamg/meta.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: "whamg"
description: The wham suite consists of two programs, wham and whamg. wham, the original
tool, is a very sensitive method with a high false discovery rate. The second program,
whamg, is more accurate and better suited for general structural variant (SV) discovery.
description: The wham suite consists of two programs, wham and whamg. wham, the
original tool, is a very sensitive method with a high false discovery rate.
The second program, whamg, is more accurate and better suited for general
structural variant (SV) discovery.
keywords:
- whamg
- wham
Expand All @@ -15,7 +16,8 @@ tools:
documentation: "https://github.com/zeeev/wham"
tool_dev_url: "https://github.com/zeeev/wham"
doi: "10.1371/journal.pcbi.1004572"
licence: ["MIT"]
licence:
- "MIT"
identifier: ""
input:
- - meta:
Expand Down Expand Up @@ -55,7 +57,7 @@ output:
description: Compressed VCF file
pattern: "*.vcf.gz"
ontologies:
- edam: http://edamontology.org/format_3989 # GZIP format
- edam: http://edamontology.org/format_3989
tbi:
- - meta:
type: map
Expand All @@ -78,13 +80,27 @@ output:
description: Graph file
pattern: "*.txt"
ontologies: []
versions_whamg:
- - ${task.process}:
type: string
description: The name of the process
- whamg:
type: string
description: The name of the tool
- "whamg 2>&1 | grep Version | sed 's/^Version: v//; s/-.*$//'":
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- whamg:
type: string
description: The name of the tool
- "whamg 2>&1 | grep Version | sed 's/^Version: v//; s/-.*$//'":
type: eval
description: The expression to obtain the version of the tool
authors:
- "@nvnieuwk"
maintainers:
Expand Down
35 changes: 28 additions & 7 deletions modules/nf-core/whamg/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,34 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(
path(process.out.vcf[0][1]).vcf.summary,
file(process.out.tbi[0][1]).name,
Comment on lines -34 to -35
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vcf and tbi files are typically unstable due to differences between conda/docker/singularity.
The vcf summary command comes from the nft-vcf plugin.
Any time you see a snapshot split out like this it means you need to take special care and not just snapshot the whole process.out.
You can use unstableKeys for the tbi channel, but the vcf summary is useful to keep for showing the vcf file is not changing.

process.out.graph,
process.out.versions
).match()
}
{ assert snapshot(sanitizeOutput(process.out)).match() }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to swap back to use nft-vcf for the vcf file, and the tbi is unstable

)
}
}

test("test-whamg-bam - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)

"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand Down
81 changes: 69 additions & 12 deletions modules/nf-core/whamg/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,19 +1,76 @@
{
"test-whamg-bam": {
"content": [
"VcfFile [chromosomes=[], sampleCount=1, variantCount=0, phased=true, phasedAutodetect=true]",
"test.vcf.gz.tbi",
[

],
[
"versions.yml:md5,243bed402cdc21ab2fc42a7400399ea9"
]
{
"graph": [

],
"tbi": [
[
{
"id": "test"
},
"test.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905"
]
],
"vcf": [
[
{
"id": "test"
},
"test.vcf.gz:md5,e45326a91ef59ea91ad3fe85f353748c"
]
],
"versions_whamg": [
[
"WHAMG",
"whamg",
"1.7.0"
]
]
}
],
"timestamp": "2026-04-30T17:44:50.968503",
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-27T11:43:16.953021"
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
},
"test-whamg-bam - stub": {
"content": [
{
"graph": [

],
"tbi": [
[
{
"id": "test"
},
"test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"vcf": [
[
{
"id": "test"
},
"test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"versions_whamg": [
[
"WHAMG",
"whamg",
"1.7.0"
]
]
}
],
"timestamp": "2026-04-30T17:44:56.533951",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
}
}
Loading