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
18 changes: 17 additions & 1 deletion modules/nf-core/ectyper/tests/main.nf.test.snap
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.

This is unrelated.

Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,21 @@
"nextflow": "24.04.4"
},
"timestamp": "2024-08-28T12:49:29.892782"
},
"versions": {
"content": [
[
[
"ECTYPER",
"ectyper",
"1.0.0"
]
]
],
"timestamp": "2024-08-28T12:49:29.892782",
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
}
}
}
}
10 changes: 5 additions & 5 deletions modules/nf-core/maltextract/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ process MALTEXTRACT {

output:
tuple val(meta), path("results") , emit: results
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('maltextract'), eval('MaltExtract --help | head -n 2 | tail -n 1 | sed \'s/MaltExtract version//\''), emit: versions_maltextract, topic: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -30,10 +30,10 @@ process MALTEXTRACT {
-r $ncbi_dir \\
-o results/ \\
$args
"""

cat <<-END_VERSIONS > versions.yml
"${task.process}":
maltextract: \$(MaltExtract --help | head -n 2 | tail -n 1 | sed 's/MaltExtract version//')
END_VERSIONS
stub:
"""
mkdir -p results
"""
}
34 changes: 25 additions & 9 deletions modules/nf-core/maltextract/meta.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: maltextract
description: Tool for evaluation of MALT results for true positives of ancient metagenomic
taxonomic screening
description: Tool for evaluation of MALT results for true positives of ancient
metagenomic taxonomic screening
keywords:
- malt
- MaltExtract
Expand All @@ -22,7 +22,8 @@ tools:
documentation: https://github.com/rhuebler/hops
tool_dev_url: https://github.com/rhuebler/hops
doi: "10.1186/s13059-019-1903-0"
licence: ["GPL 3"]
licence:
- "GPL 3"
identifier: ""
input:
- - meta:
Expand Down Expand Up @@ -54,13 +55,28 @@ output:
type: directory
description: Directory containing MaltExtract text results files
pattern: "results/"

versions_maltextract:
- - ${task.process}:
type: string
description: The name of the process
- maltextract:
type: string
description: The name of the tool
- MaltExtract --help | head -n 2 | tail -n 1 | sed 's/MaltExtract version//':
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
- maltextract:
type: string
description: The name of the tool
- MaltExtract --help | head -n 2 | tail -n 1 | sed 's/MaltExtract version//':
type: eval
description: The expression to obtain the version of the tool
authors:
- "@jfy133"
maintainers:
Expand Down
33 changes: 30 additions & 3 deletions modules/nf-core/maltextract/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,36 @@ nextflow_process {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.versions,
path("${process.out.results.get(0).get(1)}/ScanSummary.txt")
).match() },
path("${process.out.results.get(0).get(1)}/ScanSummary.txt"),
path("${process.out.results.get(0).get(1)}/error.txt").text == "",
path("${process.out.results.get(0).get(1)}/log.txt"),
process.out.versions_maltextract
Copy link
Copy Markdown
Contributor

@SPPearce SPPearce Apr 30, 2026

Choose a reason for hiding this comment

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

This probably needs to be

Suggested change
process.out.versions_maltextract
process.out.findAll { key, val -> key.startsWith('versions') })

to pass linting.

).match() }
)
}
}

test("test_maltextract - stub") {

options "-stub"

when {
process {
"""
input[0] = [ [], // meta map
file(params.modules_testdata_base_path + 'delete_me/malt/test.rma6')
]
input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/maltextract/taxon_list.txt')
input[2] = []
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() },
{ assert snapshot(process.out.versions_maltextract).match("versions") }
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.

Don't need this given that process.out includes all the channels (plus we don't use more than one snapshot (a few old nf-tests do, but they need rewriting)

Suggested change
{ assert snapshot(process.out.versions_maltextract).match("versions") }

)
}
}
Expand Down
62 changes: 54 additions & 8 deletions modules/nf-core/maltextract/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,15 +1,61 @@
{
"test_maltextract - stub": {
"content": [
{
"results": [
[
[],
[]
]
],
"versions_maltextract": [
[
"MALTEXTRACT",
"maltextract",
"1.7"
]
]
}
],
"timestamp": "2026-04-29T22:34:21.854841",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
}
},
"test_maltextract": {
"content": [
"ScanSummary.txt:md5,209fb35426f6a459db0f4af0dc544b10",
true,
"log.txt:md5,7d1a25809c8c92b550a43773fc78cfd4",
[
[
"MALTEXTRACT",
"maltextract",
"1.7"
]
]
],
"timestamp": "2026-04-29T22:33:46.095165",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
}
},
"versions": {
"content": [
[
"versions.yml:md5,4d87de5def1287321effde6545901cf6"
],
"ScanSummary.txt:md5,209fb35426f6a459db0f4af0dc544b10"
[
"MALTEXTRACT",
"maltextract",
"1.7"
]
]
],
"timestamp": "2026-04-29T22:34:21.854841",
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-01T08:19:20.696046683"
"nf-test": "0.9.5",
"nextflow": "25.10.4"
}
}
}
}
18 changes: 17 additions & 1 deletion modules/nf-core/optitype/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,21 @@
"nextflow": "23.10.1"
},
"timestamp": "2024-03-06T13:50:18.885995054"
},
"versions": {
"content": [
[
[
"OPTITYPE",
"optitype",
"1.3.1"
]
]
],
"timestamp": "2024-03-06T13:47:07.297380921",
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
}
}
}
}
18 changes: 14 additions & 4 deletions modules/nf-core/prinseqplusplus/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"test-prinseqplusplus-single-end": {
"content": [
"test_good_out.fastq.gz",
[

],
[],
[
[
{
Expand Down Expand Up @@ -57,5 +55,17 @@
"nextflow": "24.04.4"
},
"timestamp": "2024-08-27T14:57:53.505032"
},
"versions": {
"content": [
[
"versions.yml:md5,366e108ac2695a852af440e61fecad5e"
]
],
"timestamp": "2024-08-27T14:55:34.731661",
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
}
}
}
}
18 changes: 17 additions & 1 deletion modules/nf-core/shasta/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,21 @@
"nextflow": "24.04.4"
},
"timestamp": "2024-08-23T11:50:23.581975"
},
"versions": {
"content": [
[
[
"SHASTA",
"shasta",
"0.8.0"
]
]
],
"timestamp": "2024-08-23T11:50:23.581975",
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
}
}
}
}