Skip to content

Commit 7abb093

Browse files
authored
Update to topic mashtree (#12202)
Update to topic
1 parent e0ca732 commit 7abb093

4 files changed

Lines changed: 74 additions & 82 deletions

File tree

modules/nf-core/mashtree/main.nf

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ process MASHTREE {
1313
output:
1414
tuple val(meta), path("*.dnd"), emit: tree
1515
tuple val(meta), path("*.tsv"), emit: matrix
16-
path "versions.yml" , emit: versions
16+
tuple val("${task.process}"), val("mashtree"), eval("mashtree --version 2>&1 | sed 's/Mashtree //'"), emit: versions_mashtree, topic: versions
1717

1818
when:
1919
task.ext.when == null || task.ext.when
@@ -23,28 +23,17 @@ process MASHTREE {
2323
def prefix = task.ext.prefix ?: "${meta.id}"
2424
"""
2525
mashtree \\
26-
$args \\
27-
--numcpus $task.cpus \\
26+
${args} \\
27+
--numcpus ${task.cpus} \\
2828
--outmatrix ${prefix}.tsv \\
2929
--outtree ${prefix}.dnd \\
30-
$seqs
31-
32-
cat <<-END_VERSIONS > versions.yml
33-
"${task.process}":
34-
mashtree: \$( echo \$( mashtree --version 2>&1 ) | sed 's/^.*Mashtree //' )
35-
END_VERSIONS
30+
${seqs}
3631
"""
3732

3833
stub:
3934
def prefix = task.ext.prefix ?: "${meta.id}"
4035
"""
4136
touch ${prefix}.dnd
4237
touch ${prefix}.tsv
43-
44-
45-
cat <<-END_VERSIONS > versions.yml
46-
"${task.process}":
47-
mashtree: \$( echo \$( mashtree --version 2>&1 ) | sed 's/^.*Mashtree //' )
48-
END_VERSIONS
4938
"""
5039
}

modules/nf-core/mashtree/meta.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ tools:
1212
documentation: https://github.com/lskatz/mashtree
1313
tool_dev_url: https://github.com/lskatz/mashtree
1414
doi: "10.21105/joss.01762"
15-
licence: ["GPL v3"]
15+
licence:
16+
- "GPL v3"
1617
identifier: ""
1718
input:
1819
- - meta:
@@ -50,13 +51,29 @@ output:
5051
pattern: "*.{tsv}"
5152
ontologies:
5253
- edam: http://edamontology.org/format_3475 # TSV
54+
versions_mashtree:
55+
- - ${task.process}:
56+
type: string
57+
description: The name of the process
58+
- mashtree:
59+
type: string
60+
description: The name of the tool
61+
- mashtree --version 2>&1 | sed 's/Mashtree //':
62+
type: eval
63+
description: The expression to obtain the version of the tool
64+
65+
topics:
5366
versions:
54-
- versions.yml:
55-
type: file
56-
description: File containing software versions
57-
pattern: "versions.yml"
58-
ontologies:
59-
- edam: http://edamontology.org/format_3750 # YAML
67+
- - ${task.process}:
68+
type: string
69+
description: The name of the process
70+
- mashtree:
71+
type: string
72+
description: The name of the tool
73+
- mashtree --version 2>&1 | sed 's/Mashtree //':
74+
type: eval
75+
description: The expression to obtain the version of the tool
76+
6077
authors:
6178
- "@rpetit3"
6279
maintainers:

modules/nf-core/mashtree/tests/main.nf.test

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,20 @@ nextflow_process {
1515
process {
1616
"""
1717
input[0] = [
18-
[ id:'test', single_end:false ], // meta map
19-
[
18+
[ id:'test' ],
19+
[
2020
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
21-
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
21+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
2222
]
23-
]
24-
23+
]
2524
"""
2625
}
2726
}
2827

2928
then {
3029
assertAll(
3130
{ assert process.success },
32-
{ assert snapshot(
33-
process.out.tree,
34-
file(process.out.matrix[0][1]).name,
35-
process.out.versions,
36-
).match()
37-
}
31+
{ assert snapshot(sanitizeOutput(process.out, unstableKeys:["matrix"])).match() }
3832
)
3933
}
4034
}
@@ -46,21 +40,20 @@ nextflow_process {
4640
process {
4741
"""
4842
input[0] = [
49-
[ id:'test', single_end:false ], // meta map
50-
[
43+
[ id:'test' ],
44+
[
5145
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
52-
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
46+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
5347
]
54-
]
55-
48+
]
5649
"""
5750
}
5851
}
5952

6053
then {
6154
assertAll(
6255
{ assert process.success },
63-
{ assert snapshot(process.out).match() }
56+
{ assert snapshot(sanitizeOutput(process.out)).match() }
6457
)
6558
}
6659
}
Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,70 @@
11
{
22
"test-mashtree": {
3-
"content": [
4-
[
5-
[
6-
{
7-
"id": "test",
8-
"single_end": false
9-
},
10-
"test.dnd:md5,007b3949a9f0c991624791d2fb076824"
11-
]
12-
],
13-
"test.tsv",
14-
[
15-
"versions.yml:md5,1a7acba2b849ad7b044bc3ee208f7180"
16-
]
17-
],
18-
"meta": {
19-
"nf-test": "0.9.0",
20-
"nextflow": "24.04.4"
21-
},
22-
"timestamp": "2024-09-02T15:07:35.061484"
23-
},
24-
"test-mashtree-stub": {
253
"content": [
264
{
27-
"0": [
5+
"matrix": [
286
[
297
{
30-
"id": "test",
31-
"single_end": false
8+
"id": "test"
329
},
33-
"test.dnd:md5,d41d8cd98f00b204e9800998ecf8427e"
10+
"test.tsv"
3411
]
3512
],
36-
"1": [
13+
"tree": [
3714
[
3815
{
39-
"id": "test",
40-
"single_end": false
16+
"id": "test"
4117
},
42-
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
18+
"test.dnd:md5,007b3949a9f0c991624791d2fb076824"
4319
]
4420
],
45-
"2": [
46-
"versions.yml:md5,1a7acba2b849ad7b044bc3ee208f7180"
47-
],
21+
"versions_mashtree": [
22+
[
23+
"MASHTREE",
24+
"mashtree",
25+
"1.2.0"
26+
]
27+
]
28+
}
29+
],
30+
"timestamp": "2026-06-30T14:30:54.835588103",
31+
"meta": {
32+
"nf-test": "0.9.5",
33+
"nextflow": "26.04.3"
34+
}
35+
},
36+
"test-mashtree-stub": {
37+
"content": [
38+
{
4839
"matrix": [
4940
[
5041
{
51-
"id": "test",
52-
"single_end": false
42+
"id": "test"
5343
},
5444
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
5545
]
5646
],
5747
"tree": [
5848
[
5949
{
60-
"id": "test",
61-
"single_end": false
50+
"id": "test"
6251
},
6352
"test.dnd:md5,d41d8cd98f00b204e9800998ecf8427e"
6453
]
6554
],
66-
"versions": [
67-
"versions.yml:md5,1a7acba2b849ad7b044bc3ee208f7180"
55+
"versions_mashtree": [
56+
[
57+
"MASHTREE",
58+
"mashtree",
59+
"1.2.0"
60+
]
6861
]
6962
}
7063
],
64+
"timestamp": "2026-06-30T14:31:06.935303201",
7165
"meta": {
72-
"nf-test": "0.9.0",
73-
"nextflow": "24.04.4"
74-
},
75-
"timestamp": "2024-08-30T21:53:00.89027"
66+
"nf-test": "0.9.5",
67+
"nextflow": "26.04.3"
68+
}
7669
}
7770
}

0 commit comments

Comments
 (0)