Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions modules/nf-core/wfmash/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ process WFMASH {

output:
tuple val(meta), path("*.paf"), emit: paf
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('wfmash'), eval("wfmash --version 2>&1 | sed 's/^v//; s/-.*//'"), topic: versions, emit: versions_wfmash


when:
Expand All @@ -34,11 +34,11 @@ process WFMASH {
--threads $task.cpus \\
$paf_mappings \\
$args > ${prefix}.paf
"""


cat <<-END_VERSIONS > versions.yml
"${task.process}":
wfmash: \$(echo \$(wfmash --version 2>&1) | cut -f 1 -d '-' | cut -f 2 -d 'v')
END_VERSIONS
stub:
def prefix = task.ext.prefix ? task.ext.prefix : paf ? "${meta.id}" + "." + paf.baseName.split("\\.")[-1] : "${meta.id}"
"""
touch ${prefix}.paf
"""
}
40 changes: 28 additions & 12 deletions modules/nf-core/wfmash/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ tools:
documentation: https://github.com/waveygang/wfmash
tool_dev_url: https://github.com/waveygang/wfmash
doi: 10.5281/zenodo.6949373
licence: ["MIT"]
licence:
- "MIT"
identifier: ""
input:
- - meta:
Expand All @@ -28,8 +29,8 @@ input:
ontologies: []
- paf:
type: file
description: Optional inpute file in PAF format to derive the precise alignments
for.
description: Optional inpute file in PAF format to derive the precise
alignments for.
pattern: "*.{paf}"
ontologies: []
- gzi:
Expand All @@ -44,11 +45,12 @@ input:
ontologies: []
- query_self:
type: boolean
description: If set to true, the input FASTA will also be used as the query FASTA.
description: If set to true, the input FASTA will also be used as the query
FASTA.
- fasta_query_list:
type: file
description: Optional inpute file in FASTA format specifying the query sequences
as a list.
description: Optional inpute file in FASTA format specifying the query
sequences as a list.
pattern: "*.{fa,fna,fasta}"
ontologies: []
output:
Expand All @@ -63,13 +65,27 @@ output:
description: Alignments in PAF format
pattern: "*.{paf}"
ontologies: []
versions_wfmash:
- - ${task.process}:
type: string
description: The name of the process
- wfmash:
type: string
description: The name of the tool
- "wfmash --version 2>&1 | sed 's/^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
- wfmash:
type: string
description: The name of the tool
- "wfmash --version 2>&1 | sed 's/^v//; s/-.*//'":
type: eval
description: The expression to obtain the version of the tool
authors:
- "@subwaystation"
maintainers:
Expand Down
31 changes: 30 additions & 1 deletion modules/nf-core/wfmash/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,36 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match("versions") }
{ 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.

The paf channel is unstable, add as such into sanitizeOutput.

)
}

}

test("homo_sapiens - pangenome - pangenome_fa_bgzip - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'pangenomics/homo_sapiens/pangenome.fa.gz', checkIfExists: true),
[], // empty paf input
file(params.modules_testdata_base_path + 'pangenomics/homo_sapiens/pangenome.fa.gz.gzi', checkIfExists: true), // gzi
file(params.modules_testdata_base_path + 'pangenomics/homo_sapiens/pangenome.fa.gz.fai', checkIfExists: true) // fai
]
input[1] = true // empty paf input
input[2] = []
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand Down
58 changes: 50 additions & 8 deletions modules/nf-core/wfmash/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,14 +1,56 @@
{
"versions": {
"homo_sapiens - pangenome - pangenome_fa_bgzip - stub": {
"content": [
[
"versions.yml:md5,9f9bd116e78512f26ddf28b51a46e64e"
]
{
"paf": [
[
{
"id": "test",
"single_end": false
},
"test.paf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_wfmash": [
[
"WFMASH",
"wfmash",
"0.13.0"
]
]
}
],
"timestamp": "2026-04-30T17:43:11.682538",
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-11T15:02:01.736721962"
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
},
"homo_sapiens - pangenome - pangenome_fa_bgzip": {
"content": [
{
"paf": [
[
{
"id": "test",
"single_end": false
},
"test.paf:md5,29f914ce85ab77a33bd740d1f9570eec"
]
],
"versions_wfmash": [
[
"WFMASH",
"wfmash",
"0.13.0"
]
]
}
],
"timestamp": "2026-05-01T09:19:21.270932",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
}
}
Loading