From 1fc3a15a777d2340cda3ec3324a552c5e49e22ae Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Tue, 14 Apr 2026 06:10:22 +0200 Subject: [PATCH 1/8] Update Kaiju to also emit the downstream required nodes file --- modules/nf-core/kaiju/mkfmi/main.nf | 3 +- modules/nf-core/kaiju/mkfmi/meta.yml | 15 ++- .../nf-core/kaiju/mkfmi/tests/main.nf.test | 11 +- .../kaiju/mkfmi/tests/main.nf.test.snap | 107 +++++++++++++++--- 4 files changed, 113 insertions(+), 23 deletions(-) diff --git a/modules/nf-core/kaiju/mkfmi/main.nf b/modules/nf-core/kaiju/mkfmi/main.nf index 300554692c8e..4e99a5aaa0e5 100644 --- a/modules/nf-core/kaiju/mkfmi/main.nf +++ b/modules/nf-core/kaiju/mkfmi/main.nf @@ -9,10 +9,11 @@ process KAIJU_MKFMI { input: tuple val(meta), path(fasta) + path nodes_dmp, stageAs: "nodes.dmp" val keep_intermediate output: - tuple val(meta), path("*.fmi"), emit: fmi + tuple val(meta), path("*.{fmi,dmp}", includeInputs: true), emit: fmi tuple val(meta), path("*.bwt"), optional: true, emit: bwt tuple val(meta), path("*.sa"), optional: true, emit: sa path "versions.yml", emit: versions diff --git a/modules/nf-core/kaiju/mkfmi/meta.yml b/modules/nf-core/kaiju/mkfmi/meta.yml index 57778ff043bb..6cea411b66d3 100644 --- a/modules/nf-core/kaiju/mkfmi/meta.yml +++ b/modules/nf-core/kaiju/mkfmi/meta.yml @@ -26,7 +26,14 @@ input: type: file description: Uncompressed Protein FASTA file (mandatory) pattern: "*.{fa,faa,fasta}" - ontologies: [] + ontologies: + - edam: http://edamontology.org/format_1929 # FASTA + - nodes_dmp: + type: file + description: NCBI nodes.dmp file (mandatory) + pattern: "nodes.dmp" + ontologies: + - edam: http://edamontology.org/format_3751 # DSV - keep_intermediate: type: boolean description: "Keep intermediate files" @@ -38,10 +45,10 @@ output: description: | Groovy Map containing sample information e.g. `[ id:'test', single_end:false ]` - - "*.fmi": + - "*.{fmi,dmp}": type: file - description: Kaiju FM-index file - pattern: "*.{fmi}" + description: Kaiju FM-index file and nodes.dmp file required for Kaiju classification + pattern: "*.{fmi,dmp}" ontologies: [] bwt: - - meta: diff --git a/modules/nf-core/kaiju/mkfmi/tests/main.nf.test b/modules/nf-core/kaiju/mkfmi/tests/main.nf.test index 68170caeb403..ffcf27a401f8 100644 --- a/modules/nf-core/kaiju/mkfmi/tests/main.nf.test +++ b/modules/nf-core/kaiju/mkfmi/tests/main.nf.test @@ -18,7 +18,8 @@ nextflow_process { [ id:'test', single_end:true ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] - input[1] = false + input[1] = file(params.modules_testdata_base_path + 'delete_me/kaiju/nodes.dmp', checkIfExists: true) + input[2] = false """ } } @@ -41,7 +42,8 @@ nextflow_process { [ id:'test', single_end:true ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] - input[1] = true + input[1] = file(params.modules_testdata_base_path + 'delete_me/kaiju/nodes.dmp', checkIfExists: true) + input[2] = true """ } } @@ -66,7 +68,8 @@ nextflow_process { [ id:'test', single_end:true ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] - input[1] = true + input[1] = file(params.modules_testdata_base_path + 'delete_me/kaiju/nodes.dmp', checkIfExists: true) + input[2] = true """ } } @@ -74,7 +77,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.fmi[0][1]).name).match() } + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap b/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap index 8c0ae1b22f11..99e967b34431 100644 --- a/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap +++ b/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap @@ -1,13 +1,80 @@ { "sarscov2 - fasta - stub": { "content": [ - "test.fmi" + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + [ + "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", + "test.fmi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bwt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,3cbd427d0187ffee188347830d33dc12" + ], + "bwt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bwt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fmi": [ + [ + { + "id": "test", + "single_end": true + }, + [ + "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", + "test.fmi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "sa": [ + [ + { + "id": "test", + "single_end": true + }, + "test.sa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,3cbd427d0187ffee188347830d33dc12" + ] + } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.10.2" + "nf-test": "0.9.2", + "nextflow": "25.10.4" }, - "timestamp": "2024-01-20T16:27:00.670884904" + "timestamp": "2026-04-14T06:08:06.043028519" }, "sarscov2 - proteome - fasta": { "content": [ @@ -18,7 +85,10 @@ "id": "test", "single_end": true }, - "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" + [ + "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", + "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" + ] ] ], "1": [ @@ -39,7 +109,10 @@ "id": "test", "single_end": true }, - "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" + [ + "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", + "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" + ] ] ], "sa": [ @@ -51,10 +124,10 @@ } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.10.2" + "nf-test": "0.9.2", + "nextflow": "25.10.4" }, - "timestamp": "2025-01-16T09:29:43.118144301" + "timestamp": "2026-04-14T06:03:37.757184272" }, "sarscov2 - proteome - keep intermediates": { "content": [ @@ -65,7 +138,10 @@ "id": "test", "single_end": true }, - "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" + [ + "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", + "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" + ] ] ], "1": [ @@ -104,7 +180,10 @@ "id": "test", "single_end": true }, - "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" + [ + "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", + "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" + ] ] ], "sa": [ @@ -122,9 +201,9 @@ } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.10.2" + "nf-test": "0.9.2", + "nextflow": "25.10.4" }, - "timestamp": "2025-01-16T09:29:47.890853152" + "timestamp": "2026-04-14T06:00:45.06420002" } } \ No newline at end of file From 71a59d96eea60a2bf1ae51b65ad381ceb9f4b353 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Tue, 14 Apr 2026 08:44:46 +0200 Subject: [PATCH 2/8] Include names file as well --- modules/nf-core/kaiju/kaiju/meta.yml | 4 ++-- modules/nf-core/kaiju/mkfmi/main.nf | 1 + modules/nf-core/kaiju/mkfmi/meta.yml | 2 +- modules/nf-core/kaiju/mkfmi/tests/main.nf.test | 9 ++++++--- modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap | 12 +++++++++--- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/modules/nf-core/kaiju/kaiju/meta.yml b/modules/nf-core/kaiju/kaiju/meta.yml index 1bef0a3b81fa..51819e75fddd 100644 --- a/modules/nf-core/kaiju/kaiju/meta.yml +++ b/modules/nf-core/kaiju/kaiju/meta.yml @@ -32,8 +32,8 @@ input: - db: type: directory description: | - List containing the database and nodes files for Kaiju - e.g. [ 'database.fmi', 'nodes.dmp' ] + List or directory containing the database and NCBI taxonomy files (names and nodes) for Kaiju + e.g. [ 'database.fmi', 'names.dmp', 'nodes.dmp' ] output: results: - - meta: diff --git a/modules/nf-core/kaiju/mkfmi/main.nf b/modules/nf-core/kaiju/mkfmi/main.nf index 4e99a5aaa0e5..ef7c9109c616 100644 --- a/modules/nf-core/kaiju/mkfmi/main.nf +++ b/modules/nf-core/kaiju/mkfmi/main.nf @@ -10,6 +10,7 @@ process KAIJU_MKFMI { input: tuple val(meta), path(fasta) path nodes_dmp, stageAs: "nodes.dmp" + path names_dmp, stageAs: "names.dmp" val keep_intermediate output: diff --git a/modules/nf-core/kaiju/mkfmi/meta.yml b/modules/nf-core/kaiju/mkfmi/meta.yml index 6cea411b66d3..c0ce421891df 100644 --- a/modules/nf-core/kaiju/mkfmi/meta.yml +++ b/modules/nf-core/kaiju/mkfmi/meta.yml @@ -47,7 +47,7 @@ output: e.g. `[ id:'test', single_end:false ]` - "*.{fmi,dmp}": type: file - description: Kaiju FM-index file and nodes.dmp file required for Kaiju classification + description: Kaiju FM-index file, and input {names,nodes}.dmp NCBI taxonomy files required for downstream Kaiju commands pattern: "*.{fmi,dmp}" ontologies: [] bwt: diff --git a/modules/nf-core/kaiju/mkfmi/tests/main.nf.test b/modules/nf-core/kaiju/mkfmi/tests/main.nf.test index ffcf27a401f8..bcb203dc94c2 100644 --- a/modules/nf-core/kaiju/mkfmi/tests/main.nf.test +++ b/modules/nf-core/kaiju/mkfmi/tests/main.nf.test @@ -19,7 +19,8 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] input[1] = file(params.modules_testdata_base_path + 'delete_me/kaiju/nodes.dmp', checkIfExists: true) - input[2] = false + input[2] = file(params.modules_testdata_base_path + 'delete_me/kaiju/names.dmp', checkIfExists: true) + input[3] = false """ } } @@ -43,7 +44,8 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] input[1] = file(params.modules_testdata_base_path + 'delete_me/kaiju/nodes.dmp', checkIfExists: true) - input[2] = true + input[2] = file(params.modules_testdata_base_path + 'delete_me/kaiju/names.dmp', checkIfExists: true) + input[3] = true """ } } @@ -69,7 +71,8 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] input[1] = file(params.modules_testdata_base_path + 'delete_me/kaiju/nodes.dmp', checkIfExists: true) - input[2] = true + input[2] = file(params.modules_testdata_base_path + 'delete_me/kaiju/names.dmp', checkIfExists: true) + input[3] = true """ } } diff --git a/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap b/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap index 99e967b34431..55ce46946105 100644 --- a/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap +++ b/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap @@ -9,6 +9,7 @@ "single_end": true }, [ + "names.dmp:md5,cac3fc251ff837dc31ef4b1832553d48", "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", "test.fmi:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -51,6 +52,7 @@ "single_end": true }, [ + "names.dmp:md5,cac3fc251ff837dc31ef4b1832553d48", "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", "test.fmi:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -74,7 +76,7 @@ "nf-test": "0.9.2", "nextflow": "25.10.4" }, - "timestamp": "2026-04-14T06:08:06.043028519" + "timestamp": "2026-04-14T08:42:39.744579267" }, "sarscov2 - proteome - fasta": { "content": [ @@ -86,6 +88,7 @@ "single_end": true }, [ + "names.dmp:md5,cac3fc251ff837dc31ef4b1832553d48", "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" ] @@ -110,6 +113,7 @@ "single_end": true }, [ + "names.dmp:md5,cac3fc251ff837dc31ef4b1832553d48", "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" ] @@ -127,7 +131,7 @@ "nf-test": "0.9.2", "nextflow": "25.10.4" }, - "timestamp": "2026-04-14T06:03:37.757184272" + "timestamp": "2026-04-14T08:42:29.479915722" }, "sarscov2 - proteome - keep intermediates": { "content": [ @@ -139,6 +143,7 @@ "single_end": true }, [ + "names.dmp:md5,cac3fc251ff837dc31ef4b1832553d48", "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" ] @@ -181,6 +186,7 @@ "single_end": true }, [ + "names.dmp:md5,cac3fc251ff837dc31ef4b1832553d48", "nodes.dmp:md5,cf7b63f1194c1eb7baa5d3e1b745a69b", "test.fmi:md5,54fd89f5e4eab61af30175e8aa389598" ] @@ -204,6 +210,6 @@ "nf-test": "0.9.2", "nextflow": "25.10.4" }, - "timestamp": "2026-04-14T06:00:45.06420002" + "timestamp": "2026-04-14T08:42:34.797981751" } } \ No newline at end of file From 3f2eda9c48c489ac78cd66b4801084aef0120bbf Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Tue, 14 Apr 2026 09:12:02 +0200 Subject: [PATCH 3/8] Update documentation --- modules/nf-core/kaiju/mkfmi/meta.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/nf-core/kaiju/mkfmi/meta.yml b/modules/nf-core/kaiju/mkfmi/meta.yml index c0ce421891df..b066e7c4d6b8 100644 --- a/modules/nf-core/kaiju/mkfmi/meta.yml +++ b/modules/nf-core/kaiju/mkfmi/meta.yml @@ -34,6 +34,12 @@ input: pattern: "nodes.dmp" ontologies: - edam: http://edamontology.org/format_3751 # DSV + - names_dmp: + type: file + description: NCBI names.dmp file (mandatory) + pattern: "names.dmp" + ontologies: + - edam: http://edamontology.org/format_3751 # DSV - keep_intermediate: type: boolean description: "Keep intermediate files" From f4ff3363faa913f688e9a5416bf815b3d1f80078 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Wed, 15 Apr 2026 14:49:19 +0200 Subject: [PATCH 4/8] update all Kaiju modules to topics --- modules/nf-core/kaiju/kaiju/main.nf | 33 +++--- modules/nf-core/kaiju/kaiju/meta.yml | 33 ++++-- .../nf-core/kaiju/kaiju/tests/main.nf.test | 102 ++++++++++-------- .../kaiju/kaiju/tests/main.nf.test.snap | 52 +++++---- modules/nf-core/kaiju/kaiju2krona/main.nf | 24 ++--- modules/nf-core/kaiju/kaiju2krona/meta.yml | 31 ++++-- .../kaiju/kaiju2krona/tests/main.nf.test | 24 ++++- .../kaiju/kaiju2krona/tests/main.nf.test.snap | 24 ++++- modules/nf-core/kaiju/kaiju2table/main.nf | 22 ++-- modules/nf-core/kaiju/kaiju2table/meta.yml | 29 +++-- .../kaiju/kaiju2table/tests/main.nf.test | 12 ++- .../kaiju/kaiju2table/tests/main.nf.test.snap | 26 ++++- modules/nf-core/kaiju/mergeoutputs/main.nf | 38 +++---- modules/nf-core/kaiju/mergeoutputs/meta.yml | 33 ++++-- .../kaiju/mergeoutputs/tests/main.nf.test | 24 ++++- .../mergeoutputs/tests/main.nf.test.snap | 60 +++++++---- modules/nf-core/kaiju/mkfmi/main.nf | 13 +-- modules/nf-core/kaiju/mkfmi/meta.yml | 38 +++++-- .../kaiju/mkfmi/tests/main.nf.test.snap | 48 ++++++--- modules/nf-core/kmcp/profile/main.nf | 23 ++-- modules/nf-core/kmcp/profile/meta.yml | 4 +- 21 files changed, 445 insertions(+), 248 deletions(-) diff --git a/modules/nf-core/kaiju/kaiju/main.nf b/modules/nf-core/kaiju/kaiju/main.nf index a5741121792b..3820c2623dee 100644 --- a/modules/nf-core/kaiju/kaiju/main.nf +++ b/modules/nf-core/kaiju/kaiju/main.nf @@ -1,19 +1,19 @@ process KAIJU_KAIJU { - tag "$meta.id" + tag "${meta.id}" label 'process_high' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/kaiju:1.10.0--h43eeafb_0': - 'biocontainers/kaiju:1.10.0--h43eeafb_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/kaiju:1.10.0--h43eeafb_0' + : 'biocontainers/kaiju:1.10.0--h43eeafb_0'}" input: tuple val(meta), path(reads) - path(db) + path db output: tuple val(meta), path('*.tsv'), emit: results - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('kaiju'), eval("kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //'"), emit: versions_kaiju, topic: versions when: task.ext.when == null || task.ext.when @@ -22,32 +22,25 @@ process KAIJU_KAIJU { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def input = meta.single_end ? "-i ${reads}" : "-i ${reads[0]} -j ${reads[1]}" + + if (!db.find { db_files -> db_files.name.endsWith('names.dmp') } || !db.find { db_files -> db_files.name.endsWith('nodes.dmp') }) { + error('[KAIJU_KAIJU] Module error: Missing one of `nodes.dmp`, `names.dmp`. Check input.') + } """ dbnodes=`find -L ${db} -name "*nodes.dmp"` dbname=`find -L ${db} -name "*.fmi" -not -name "._*"` kaiju \\ - $args \\ - -z $task.cpus \\ + ${args} \\ + -z ${task.cpus} \\ -t \$dbnodes \\ -f \$dbname \\ -o ${prefix}.tsv \\ - $input - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' )) - END_VERSIONS + ${input} """ stub: def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.tsv - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' )) - END_VERSIONS """ - } diff --git a/modules/nf-core/kaiju/kaiju/meta.yml b/modules/nf-core/kaiju/kaiju/meta.yml index 51819e75fddd..d41a59b6729c 100644 --- a/modules/nf-core/kaiju/kaiju/meta.yml +++ b/modules/nf-core/kaiju/kaiju/meta.yml @@ -13,7 +13,8 @@ tools: documentation: https://github.com/bioinformatics-centre/kaiju/blob/master/README.md tool_dev_url: https://github.com/bioinformatics-centre/kaiju doi: "10.1038/ncomms11257" - licence: ["GNU GPL v3"] + licence: + - "GNU GPL v3" identifier: biotools:kaiju input: - - meta: @@ -28,7 +29,7 @@ input: respectively. pattern: "*.{fastq,fq,fasta,fa,fsa,fas,fna,fastq.gz,fq.gz,fasta.gz,fa.gz,fsa.gz,fas.gz,fna.gz}" ontologies: - - edam: http://edamontology.org/format_1930 # FASTQ + - edam: http://edamontology.org/format_1930 - db: type: directory description: | @@ -46,14 +47,28 @@ output: description: Results with taxonomic classification of each read pattern: "*.tsv" ontologies: - - edam: http://edamontology.org/format_3475 # TSV + - edam: http://edamontology.org/format_3475 + versions_kaiju: + - - ${task.process}: + type: string + description: The name of the process + - kaiju: + type: string + description: The name of the tool + - kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //': + 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 + - kaiju: + type: string + description: The name of the tool + - kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //': + type: eval + description: The expression to obtain the version of the tool authors: - "@talnor" - "@sofstam" diff --git a/modules/nf-core/kaiju/kaiju/tests/main.nf.test b/modules/nf-core/kaiju/kaiju/tests/main.nf.test index 1ec583782393..c29a0c1c3499 100644 --- a/modules/nf-core/kaiju/kaiju/tests/main.nf.test +++ b/modules/nf-core/kaiju/kaiju/tests/main.nf.test @@ -10,18 +10,19 @@ nextflow_process { tag "kaiju/kaiju" tag "untar" - test("sarscov2 - fastq - single-end") { - setup { - run ("UNTAR"){ - script "../../../untar/main.nf" - process { - """ - input[0] = [ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kaiju.tar.gz', checkIfExists: true) ] - """ - } + setup { + run ("UNTAR"){ + script "../../../untar/main.nf" + process { + """ + input[0] = [ [id: 'db'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kaiju.tar.gz', checkIfExists: true) ] + """ } } + } + + test("sarscov2 - fastq - single-end") { when { process { @@ -30,7 +31,18 @@ nextflow_process { [ id:'test', single_end:true ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] - input[1] = UNTAR.out.untar.map{ it[1] } + + input[1] = UNTAR.out.untar + .map { + meta, untar -> + db = [ + untar, + file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/kaiju/names.dmp", checkIfExists: true) + ] + [meta, db ] + } + .map{ it[1] } """ } } @@ -41,7 +53,7 @@ nextflow_process { { assert path(process.out.results[0][1]).getText().contains("C\tERR5069949.2257580\t2697049") }, { assert snapshot( file(process.out.results[0][1]).name, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -50,26 +62,25 @@ nextflow_process { test("sarscov2 - fastq - paired-end") { - setup { - run ("UNTAR"){ - script "../../../untar/main.nf" - process { - """ - input[0] = [ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kaiju.tar.gz', checkIfExists: true) ] - """ - } - } - } - when { process { """ - input[0] = [ - [ id:'test', single_end:false ], - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)] - ] - input[1] = UNTAR.out.untar.map{ it[1] } + input[0] = [ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + + input[1] = UNTAR.out.untar + .map { + meta, untar -> + db = [ + untar, + file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/kaiju/names.dmp", checkIfExists: true) + ] + [meta, db ] + } + .map{ it[1] } """ } } @@ -80,7 +91,7 @@ nextflow_process { { assert path(process.out.results[0][1]).getText().contains("C\tERR5069949.2257580\t2697049") }, { assert snapshot( file(process.out.results[0][1]).name, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } @@ -90,26 +101,25 @@ nextflow_process { options '-stub' - setup { - run ("UNTAR"){ - script "../../../untar/main.nf" - process { - """ - input[0] = [ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kaiju.tar.gz', checkIfExists: true) ] - """ - } - } - } - when { process { """ - input[0] = [ - [ id:'test', single_end:false ], - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)] - ] - input[1] = UNTAR.out.untar.map{ it[1] } + input[0] = [ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + + input[1] = UNTAR.out.untar + .map { + meta, untar -> + db = [ + untar, + file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/kaiju/names.dmp", checkIfExists: true) + ] + [meta, db ] + } + .map{ it[1] } """ } } diff --git a/modules/nf-core/kaiju/kaiju/tests/main.nf.test.snap b/modules/nf-core/kaiju/kaiju/tests/main.nf.test.snap index 0643ba5cfa0e..ccacf5e849e2 100644 --- a/modules/nf-core/kaiju/kaiju/tests/main.nf.test.snap +++ b/modules/nf-core/kaiju/kaiju/tests/main.nf.test.snap @@ -6,46 +6,62 @@ [ { "id": "test", - "single_end": false + "single_end": true }, "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,40d9a89cb66d45e9ba8bf57efad15394" + "versions_kaiju": [ + [ + "KAIJU_KAIJU", + "kaiju", + "1.10.0" + ] ] } ], - "timestamp": "2026-02-13T14:06:46.521449807", "meta": { - "nf-test": "0.9.4", + "nf-test": "0.9.2", "nextflow": "25.10.4" - } + }, + "timestamp": "2026-04-15T14:22:59.612319412" }, "sarscov2 - fastq - paired-end": { "content": [ "test.tsv", - [ - "versions.yml:md5,40d9a89cb66d45e9ba8bf57efad15394" - ] + { + "versions_kaiju": [ + [ + "KAIJU_KAIJU", + "kaiju", + "1.10.0" + ] + ] + } ], - "timestamp": "2026-02-13T14:06:39.244068226", "meta": { - "nf-test": "0.9.4", + "nf-test": "0.9.2", "nextflow": "25.10.4" - } + }, + "timestamp": "2026-04-15T14:34:07.640079926" }, "sarscov2 - fastq - single-end": { "content": [ "test.tsv", - [ - "versions.yml:md5,40d9a89cb66d45e9ba8bf57efad15394" - ] + { + "versions_kaiju": [ + [ + "KAIJU_KAIJU", + "kaiju", + "1.10.0" + ] + ] + } ], - "timestamp": "2026-02-13T14:06:31.773946259", "meta": { - "nf-test": "0.9.4", + "nf-test": "0.9.2", "nextflow": "25.10.4" - } + }, + "timestamp": "2026-04-15T14:33:59.077645447" } } \ No newline at end of file diff --git a/modules/nf-core/kaiju/kaiju2krona/main.nf b/modules/nf-core/kaiju/kaiju2krona/main.nf index c63e0e0dd15d..9c7c6c7efe15 100644 --- a/modules/nf-core/kaiju/kaiju2krona/main.nf +++ b/modules/nf-core/kaiju/kaiju2krona/main.nf @@ -1,19 +1,19 @@ process KAIJU_KAIJU2KRONA { - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/kaiju:1.10.0--h43eeafb_0': - 'biocontainers/kaiju:1.10.0--h43eeafb_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/kaiju:1.10.0--h43eeafb_0' + : 'biocontainers/kaiju:1.10.0--h43eeafb_0'}" input: tuple val(meta), path(tsv) - path(db) + path db output: tuple val(meta), path("*.txt"), emit: txt - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('kaiju'), eval("kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //'"), emit: versions_kaiju, topic: versions when: task.ext.when == null || task.ext.when @@ -25,26 +25,16 @@ process KAIJU_KAIJU2KRONA { dbnodes=`find -L ${db} -name "*nodes.dmp"` dbnames=`find -L ${db} -name "*names.dmp"` kaiju2krona \\ - $args \\ + ${args} \\ -t \$dbnodes \\ -n \$dbnames \\ -i ${tsv} \\ -o ${prefix}.txt - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' )) - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.txt - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' )) - END_VERSIONS """ } diff --git a/modules/nf-core/kaiju/kaiju2krona/meta.yml b/modules/nf-core/kaiju/kaiju2krona/meta.yml index e56db04603f5..1498257a9343 100644 --- a/modules/nf-core/kaiju/kaiju2krona/meta.yml +++ b/modules/nf-core/kaiju/kaiju2krona/meta.yml @@ -13,7 +13,8 @@ tools: documentation: https://github.com/bioinformatics-centre/kaiju/blob/master/README.md tool_dev_url: https://github.com/bioinformatics-centre/kaiju doi: "10.1038/ncomms11257" - licence: ["GNU GPL v3"] + licence: + - "GNU GPL v3" identifier: biotools:kaiju input: - - meta: @@ -26,7 +27,7 @@ input: description: Kaiju tab-separated output file pattern: "*.{tsv,txt}" ontologies: - - edam: http://edamontology.org/format_3475 # TSV + - edam: http://edamontology.org/format_3475 - db: type: file description: Kaiju database file @@ -43,13 +44,27 @@ output: description: Krona text-based input file converted from Kaiju report pattern: "*.{txt,krona}" ontologies: [] + versions_kaiju: + - - ${task.process}: + type: string + description: The name of the process + - kaiju: + type: string + description: The name of the tool + - kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //': + 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 + - kaiju: + type: string + description: The name of the tool + - kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //': + type: eval + description: The expression to obtain the version of the tool authors: - "@MillironX" maintainers: diff --git a/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test b/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test index cf522cd0fa28..1c43a860e386 100644 --- a/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test +++ b/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test @@ -32,7 +32,17 @@ nextflow_process { [ id:'test', single_end:true ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] - input[1] = UNTAR.out.untar.map{ it[1] } + input[1] = UNTAR.out.untar + .map { + meta, untar -> + db = [ + untar, + file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/kaiju/names.dmp", checkIfExists: true) + ] + [meta, db ] + } + .map{ it[1] } """ } } @@ -78,7 +88,17 @@ nextflow_process { [ id:'test', single_end:true ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] - input[1] = UNTAR.out.untar.map{ it[1] } + input[1] = UNTAR.out.untar + .map { + meta, untar -> + db = [ + untar, + file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/kaiju/names.dmp", checkIfExists: true) + ] + [meta, db ] + } + .map{ it[1] } """ } } diff --git a/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test.snap b/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test.snap index 5532a6948cab..9514a845a008 100644 --- a/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test.snap +++ b/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test.snap @@ -3,6 +3,10 @@ "content": [ "test.txt" ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.10.4" + }, "timestamp": "2024-01-20T15:06:32.789121011" }, "sarscov2 - fastq - single-end": { @@ -18,7 +22,11 @@ ] ], "1": [ - "versions.yml:md5,f75aa349971d581981d3a0399450b395" + [ + "KAIJU_KAIJU2KRONA", + "kaiju", + "1.10.0" + ] ], "txt": [ [ @@ -29,11 +37,19 @@ "test.txt:md5,68b2309d37767e444193fa6cea7c0494" ] ], - "versions": [ - "versions.yml:md5,f75aa349971d581981d3a0399450b395" + "versions_kaiju": [ + [ + "KAIJU_KAIJU2KRONA", + "kaiju", + "1.10.0" + ] ] } ], - "timestamp": "2024-01-20T15:06:08.840865115" + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.10.4" + }, + "timestamp": "2026-04-15T14:43:28.906858483" } } \ No newline at end of file diff --git a/modules/nf-core/kaiju/kaiju2table/main.nf b/modules/nf-core/kaiju/kaiju2table/main.nf index b75cd727296d..5e5bbd85142a 100644 --- a/modules/nf-core/kaiju/kaiju2table/main.nf +++ b/modules/nf-core/kaiju/kaiju2table/main.nf @@ -1,11 +1,11 @@ process KAIJU_KAIJU2TABLE { - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/kaiju:1.10.0--h43eeafb_0': - 'biocontainers/kaiju:1.10.0--h43eeafb_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/kaiju:1.10.0--h43eeafb_0' + : 'biocontainers/kaiju:1.10.0--h43eeafb_0'}" input: tuple val(meta), path(input) @@ -14,7 +14,7 @@ process KAIJU_KAIJU2TABLE { output: tuple val(meta), path('*.txt'), emit: summary - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('kaiju'), eval("kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //'"), emit: versions_kaiju, topic: versions when: task.ext.when == null || task.ext.when @@ -25,27 +25,17 @@ process KAIJU_KAIJU2TABLE { """ dbnodes=`find -L ${db} -name "*nodes.dmp"` dbnames=`find -L ${db} -name "*names.dmp"` - kaiju2table $args \\ + kaiju2table ${args} \\ -t \$dbnodes \\ -n \$dbnames \\ -r ${taxon_rank} \\ -o ${prefix}.txt \\ ${input} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' )) - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.txt - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' )) - END_VERSIONS """ } diff --git a/modules/nf-core/kaiju/kaiju2table/meta.yml b/modules/nf-core/kaiju/kaiju2table/meta.yml index 425b321ddc54..a659690cf7b6 100644 --- a/modules/nf-core/kaiju/kaiju2table/meta.yml +++ b/modules/nf-core/kaiju/kaiju2table/meta.yml @@ -11,7 +11,8 @@ tools: documentation: https://github.com/bioinformatics-centre/kaiju/blob/master/README.md tool_dev_url: https://github.com/bioinformatics-centre/kaiju doi: "10.1038/ncomms11257" - licence: ["GNU GPL v3"] + licence: + - "GNU GPL v3" identifier: biotools:kaiju input: - - meta: @@ -44,13 +45,27 @@ output: description: Kaiju output file pattern: "*.txt" ontologies: [] + versions_kaiju: + - - ${task.process}: + type: string + description: The name of the process + - kaiju: + type: string + description: The name of the tool + - kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //': + 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 + - kaiju: + type: string + description: The name of the tool + - kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //': + type: eval + description: The expression to obtain the version of the tool authors: - "@sofstam" - "@talnor" diff --git a/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test b/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test index d93fb31ac414..76d7dd2a5bcb 100644 --- a/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test +++ b/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test @@ -32,7 +32,17 @@ nextflow_process { [ id:'test', single_end:true ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] - input[1] = UNTAR.out.untar.map{ it[1] } + input[1] = UNTAR.out.untar + .map { + meta, untar -> + db = [ + untar, + file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/kaiju/names.dmp", checkIfExists: true) + ] + [meta, db ] + } + .map{ it[1] } """ } } diff --git a/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test.snap b/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test.snap index e97eb8b88040..395b2e20add6 100644 --- a/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test.snap +++ b/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test.snap @@ -3,6 +3,10 @@ "content": [ "test.txt" ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.10.4" + }, "timestamp": "2024-01-20T16:10:49.521322767" }, "sarscov2 - fastq - single-end": { @@ -18,7 +22,11 @@ ] ], "1": [ - "versions.yml:md5,2b2b98cb635a611e5eb964e5a77f6248" + [ + "KAIJU_KAIJU2TABLE", + "kaiju", + "1.10.0" + ] ], "summary": [ [ @@ -29,11 +37,19 @@ "test.txt:md5,0d9f8fd36fcf2888296ae12632c5f0a8" ] ], - "versions": [ - "versions.yml:md5,2b2b98cb635a611e5eb964e5a77f6248" + "versions_kaiju": [ + [ + "KAIJU_KAIJU2TABLE", + "kaiju", + "1.10.0" + ] ] } ], - "timestamp": "2024-01-20T16:08:47.644443775" + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.10.4" + }, + "timestamp": "2026-04-15T14:43:46.226835271" } -} +} \ No newline at end of file diff --git a/modules/nf-core/kaiju/mergeoutputs/main.nf b/modules/nf-core/kaiju/mergeoutputs/main.nf index 3149c85255a2..959420e36d1e 100644 --- a/modules/nf-core/kaiju/mergeoutputs/main.nf +++ b/modules/nf-core/kaiju/mergeoutputs/main.nf @@ -1,52 +1,46 @@ process KAIJU_MERGEOUTPUTS { - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/kaiju:1.10.0--h43eeafb_0': - 'biocontainers/kaiju:1.10.0--h43eeafb_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/kaiju:1.10.0--h43eeafb_0' + : 'biocontainers/kaiju:1.10.0--h43eeafb_0'}" input: tuple val(meta), path(kaiju), path(kraken) - path (db) + path db output: tuple val(meta), path("*.tsv"), emit: merged - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('kaiju'), eval("kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //'"), emit: versions_kaiju, topic: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def dbnodes = db ? '-t <(find -L ${db} -name "*nodes.dmp")' : '' - if ("$kaiju" == "${prefix}.tsv") error "Input and output names are the same, set prefix in module configuration to disambiguate!" - if ("$kraken" == "${prefix}.tsv") error "Input and output names are the same, set prefix in module configuration to disambiguate!" + if ("${kaiju}" == "${prefix}.tsv") { + error("Input and output names are the same, set prefix in module configuration to disambiguate!") + } + if ("${kraken}" == "${prefix}.tsv") { + error("Input and output names are the same, set prefix in module configuration to disambiguate!") + } """ kaiju-mergeOutputs \\ -i <(sort -k2,2 ${kaiju}) \\ -j <(sort -k2,2 ${kraken}) \\ -o ${prefix}.tsv \\ - $dbnodes \\ - $args - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' )) - END_VERSIONS + ${dbnodes} \\ + ${args} """ stub: def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.tsv - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' )) - END_VERSIONS """ } diff --git a/modules/nf-core/kaiju/mergeoutputs/meta.yml b/modules/nf-core/kaiju/mergeoutputs/meta.yml index 7faac5f678d1..dfa61a222b54 100644 --- a/modules/nf-core/kaiju/mergeoutputs/meta.yml +++ b/modules/nf-core/kaiju/mergeoutputs/meta.yml @@ -13,7 +13,8 @@ tools: documentation: https://github.com/bioinformatics-centre/kaiju/blob/master/README.md tool_dev_url: https://github.com/bioinformatics-centre/kaiju doi: "10.1038/ncomms11257" - licence: ["GNU GPL v3"] + licence: + - "GNU GPL v3" identifier: biotools:kaiju input: - - meta: @@ -32,7 +33,7 @@ input: Results with taxonomic classification of each read from Kraken pattern: "*.{tsv}" ontologies: - - edam: http://edamontology.org/format_3475 # TSV + - edam: http://edamontology.org/format_3475 - db: type: directory description: | @@ -51,14 +52,28 @@ output: on the given strategy '1', '2', 'lca' [default] or 'lowest' pattern: "*.tsv" ontologies: - - edam: http://edamontology.org/format_3475 # TSV + - edam: http://edamontology.org/format_3475 + versions_kaiju: + - - ${task.process}: + type: string + description: The name of the process + - kaiju: + type: string + description: The name of the tool + - kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //': + 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 + - kaiju: + type: string + description: The name of the tool + - kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //': + type: eval + description: The expression to obtain the version of the tool authors: - "@Joon-Klaps" maintainers: diff --git a/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test b/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test index 5c2d5b3159df..f2a2683fcf90 100644 --- a/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test +++ b/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test @@ -61,7 +61,17 @@ nextflow_process { [ id:'test', single_end:true ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] - input[1] = UNTAR_KAIJU.out.untar.map{ it[1] } + input[1] = UNTAR_KAIJU.out.untar + .map { + meta, untar -> + db = [ + untar, + file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/kaiju/names.dmp", checkIfExists: true) + ] + [meta, db ] + } + .map{ it[1] } """ } } @@ -94,7 +104,17 @@ nextflow_process { process { """ input[0] = KAIJU_KAIJU.out.results.join(KRAKEN2_KRAKEN2.out.classified_reads_assignment) - input[1] = UNTAR_KAIJU.out.untar.map{ it[1] } + input[1] = UNTAR_KAIJU.out.untar + .map { + meta, untar -> + db = [ + untar, + file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), + file(params.modules_testdata_base_path + "delete_me/kaiju/names.dmp", checkIfExists: true) + ] + [meta, db ] + } + .map{ it[1] } """ } } diff --git a/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test.snap b/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test.snap index 7ee125059302..73dbb4c15f88 100644 --- a/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test.snap +++ b/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test.snap @@ -12,7 +12,11 @@ ] ], "1": [ - "versions.yml:md5,fe28eae98973762f4fb19fc562a56b9f" + [ + "KAIJU_MERGEOUTPUTS", + "kaiju", + "1.10.0" + ] ], "merged": [ [ @@ -23,16 +27,20 @@ "test_merged.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,fe28eae98973762f4fb19fc562a56b9f" + "versions_kaiju": [ + [ + "KAIJU_MERGEOUTPUTS", + "kaiju", + "1.10.0" + ] ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "25.10.4" }, - "timestamp": "2024-03-19T13:48:25.353007932" + "timestamp": "2026-04-15T13:46:47.749128294" }, "sarscov2 - kraken2.kaiju.classified - noDB ": { "content": [ @@ -47,7 +55,11 @@ ] ], "1": [ - "versions.yml:md5,fe28eae98973762f4fb19fc562a56b9f" + [ + "KAIJU_MERGEOUTPUTS", + "kaiju", + "1.10.0" + ] ], "merged": [ [ @@ -58,16 +70,20 @@ "test_merged.tsv:md5,64fef9779d5003775c327bb534403859" ] ], - "versions": [ - "versions.yml:md5,fe28eae98973762f4fb19fc562a56b9f" + "versions_kaiju": [ + [ + "KAIJU_MERGEOUTPUTS", + "kaiju", + "1.10.0" + ] ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "25.10.4" }, - "timestamp": "2024-03-19T13:47:53.326864948" + "timestamp": "2026-04-15T14:47:14.325426305" }, "sarscov2 - kraken2.kaiju.classified - kaiju.DB ": { "content": [ @@ -82,7 +98,11 @@ ] ], "1": [ - "versions.yml:md5,fe28eae98973762f4fb19fc562a56b9f" + [ + "KAIJU_MERGEOUTPUTS", + "kaiju", + "1.10.0" + ] ], "merged": [ [ @@ -93,15 +113,19 @@ "test_merged.tsv:md5,64fef9779d5003775c327bb534403859" ] ], - "versions": [ - "versions.yml:md5,fe28eae98973762f4fb19fc562a56b9f" + "versions_kaiju": [ + [ + "KAIJU_MERGEOUTPUTS", + "kaiju", + "1.10.0" + ] ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "25.10.4" }, - "timestamp": "2024-03-19T13:48:11.274433603" + "timestamp": "2026-04-15T14:47:22.758191125" } } \ No newline at end of file diff --git a/modules/nf-core/kaiju/mkfmi/main.nf b/modules/nf-core/kaiju/mkfmi/main.nf index ef7c9109c616..172c3e6373ff 100644 --- a/modules/nf-core/kaiju/mkfmi/main.nf +++ b/modules/nf-core/kaiju/mkfmi/main.nf @@ -17,7 +17,7 @@ process KAIJU_MKFMI { tuple val(meta), path("*.{fmi,dmp}", includeInputs: true), emit: fmi tuple val(meta), path("*.bwt"), optional: true, emit: bwt tuple val(meta), path("*.sa"), optional: true, emit: sa - path "versions.yml", emit: versions + tuple val("${task.process}"), val('kaiju'), eval("kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //'"), emit: versions_kaiju, topic: versions when: task.ext.when == null || task.ext.when @@ -32,14 +32,10 @@ process KAIJU_MKFMI { -n ${task.cpus} \\ -o ${prefix} \\ ${fasta} + kaiju-mkfmi ${prefix} ${run_cleanup} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' )) - END_VERSIONS """ stub: @@ -51,10 +47,5 @@ process KAIJU_MKFMI { touch ${prefix}.sa ${run_cleanup} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' )) - END_VERSIONS """ } diff --git a/modules/nf-core/kaiju/mkfmi/meta.yml b/modules/nf-core/kaiju/mkfmi/meta.yml index b066e7c4d6b8..74a1689e287d 100644 --- a/modules/nf-core/kaiju/mkfmi/meta.yml +++ b/modules/nf-core/kaiju/mkfmi/meta.yml @@ -14,7 +14,8 @@ tools: documentation: "https://github.com/bioinformatics-centre/kaiju/blob/master/README.md" tool_dev_url: "https://github.com/bioinformatics-centre/kaiju" doi: "10.1038/ncomms11257" - licence: ["GNU GPL v3"] + licence: + - "GNU GPL v3" identifier: biotools:kaiju input: - - meta: @@ -27,19 +28,19 @@ input: description: Uncompressed Protein FASTA file (mandatory) pattern: "*.{fa,faa,fasta}" ontologies: - - edam: http://edamontology.org/format_1929 # FASTA + - edam: http://edamontology.org/format_1929 - nodes_dmp: type: file description: NCBI nodes.dmp file (mandatory) pattern: "nodes.dmp" ontologies: - - edam: http://edamontology.org/format_3751 # DSV + - edam: http://edamontology.org/format_3751 - names_dmp: type: file description: NCBI names.dmp file (mandatory) pattern: "names.dmp" ontologies: - - edam: http://edamontology.org/format_3751 # DSV + - edam: http://edamontology.org/format_3751 - keep_intermediate: type: boolean description: "Keep intermediate files" @@ -53,7 +54,8 @@ output: e.g. `[ id:'test', single_end:false ]` - "*.{fmi,dmp}": type: file - description: Kaiju FM-index file, and input {names,nodes}.dmp NCBI taxonomy files required for downstream Kaiju commands + description: Kaiju FM-index file, and input {names,nodes}.dmp NCBI taxonomy + files required for downstream Kaiju commands pattern: "*.{fmi,dmp}" ontologies: [] bwt: @@ -78,13 +80,27 @@ output: description: Kaiju intermedite bwt-index file (not needed for classification) pattern: "*.{sa}" ontologies: [] + versions_kaiju: + - - ${task.process}: + type: string + description: The name of the process + - kaiju: + type: string + description: The name of the tool + - kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //': + 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 + - kaiju: + type: string + description: The name of the tool + - kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //': + type: eval + description: The expression to obtain the version of the tool authors: - "@alxndrdiaz" - "@jfy133" diff --git a/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap b/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap index 55ce46946105..b63e5ed982c7 100644 --- a/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap +++ b/modules/nf-core/kaiju/mkfmi/tests/main.nf.test.snap @@ -34,7 +34,11 @@ ] ], "3": [ - "versions.yml:md5,3cbd427d0187ffee188347830d33dc12" + [ + "KAIJU_MKFMI", + "kaiju", + "1.10.0" + ] ], "bwt": [ [ @@ -67,8 +71,12 @@ "test.sa:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,3cbd427d0187ffee188347830d33dc12" + "versions_kaiju": [ + [ + "KAIJU_MKFMI", + "kaiju", + "1.10.0" + ] ] } ], @@ -76,7 +84,7 @@ "nf-test": "0.9.2", "nextflow": "25.10.4" }, - "timestamp": "2026-04-14T08:42:39.744579267" + "timestamp": "2026-04-15T13:47:09.832728798" }, "sarscov2 - proteome - fasta": { "content": [ @@ -101,7 +109,11 @@ ], "3": [ - "versions.yml:md5,3cbd427d0187ffee188347830d33dc12" + [ + "KAIJU_MKFMI", + "kaiju", + "1.10.0" + ] ], "bwt": [ @@ -122,8 +134,12 @@ "sa": [ ], - "versions": [ - "versions.yml:md5,3cbd427d0187ffee188347830d33dc12" + "versions_kaiju": [ + [ + "KAIJU_MKFMI", + "kaiju", + "1.10.0" + ] ] } ], @@ -131,7 +147,7 @@ "nf-test": "0.9.2", "nextflow": "25.10.4" }, - "timestamp": "2026-04-14T08:42:29.479915722" + "timestamp": "2026-04-15T13:46:55.504745452" }, "sarscov2 - proteome - keep intermediates": { "content": [ @@ -168,7 +184,11 @@ ] ], "3": [ - "versions.yml:md5,3cbd427d0187ffee188347830d33dc12" + [ + "KAIJU_MKFMI", + "kaiju", + "1.10.0" + ] ], "bwt": [ [ @@ -201,8 +221,12 @@ "test.sa:md5,7d4a6481ad5ffdc2058bb35331a64d4d" ] ], - "versions": [ - "versions.yml:md5,3cbd427d0187ffee188347830d33dc12" + "versions_kaiju": [ + [ + "KAIJU_MKFMI", + "kaiju", + "1.10.0" + ] ] } ], @@ -210,6 +234,6 @@ "nf-test": "0.9.2", "nextflow": "25.10.4" }, - "timestamp": "2026-04-14T08:42:34.797981751" + "timestamp": "2026-04-15T13:47:02.754906568" } } \ No newline at end of file diff --git a/modules/nf-core/kmcp/profile/main.nf b/modules/nf-core/kmcp/profile/main.nf index 9dc8b3d308be..4072ed88de3a 100644 --- a/modules/nf-core/kmcp/profile/main.nf +++ b/modules/nf-core/kmcp/profile/main.nf @@ -1,19 +1,19 @@ process KMCP_PROFILE { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/kmcp:0.9.4--h9ee0642_0': - 'biocontainers/kmcp:0.9.4--h9ee0642_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/kmcp:0.9.4--h9ee0642_0' + : 'biocontainers/kmcp:0.9.4--h9ee0642_0'}" input: tuple val(meta), path(search_results) - path (db) + path db output: tuple val(meta), path("*.profile"), emit: profile - path "versions.yml" , emit: versions + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -21,23 +21,28 @@ process KMCP_PROFILE { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + + if (!db.find { db_files -> db_files.name.endsWith('names.dmp') } || !db.find { db_files -> db_files.name.endsWith('nodes.dmp') } || !db.find { db_files -> db_files.name.endsWith('map') }) { + error('[KMCP_PROFILE] ERROR: Missing one of `nodes.dmp`, `names.dmp`, `*.map`. Check input.') + } """ taxid=`find -L ${db} -name "*map"` taxdump=`find -L ${db}/*/ -type d -not -name "R001"` kmcp \\ profile \\ - $args \\ + ${args} \\ -X \$taxdump \\ -T \$taxid \\ - -j $task.cpus \\ + -j ${task.cpus} \\ -o ${prefix}.profile \\ - $search_results + ${search_results} cat <<-END_VERSIONS > versions.yml "${task.process}": kmcp: \$(echo \$(kmcp version 2>&1) | sed -n 1p | sed 's/^.*kmcp v//') END_VERSIONS """ + stub: prefix = task.ext.prefix ?: "${meta.id}" """ diff --git a/modules/nf-core/kmcp/profile/meta.yml b/modules/nf-core/kmcp/profile/meta.yml index a1abab463f71..afd1065a9e9a 100644 --- a/modules/nf-core/kmcp/profile/meta.yml +++ b/modules/nf-core/kmcp/profile/meta.yml @@ -32,7 +32,9 @@ input: - edam: http://edamontology.org/format_3989 # GZIP format - db: type: directory - description: Database directory containing taxdump files and taxid file + description: | + Database directory that also includes containing NCBI-style taxdump taxonomy files (`nodes.dmp`, `names.dmp`) + and a two column accession ID to taxid TSV file ending in `*map` output: profile: - - meta: From 9513f4882cfb1339e1b35d4e22bf1c67001674b0 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Wed, 15 Apr 2026 14:49:33 +0200 Subject: [PATCH 5/8] Remove debug thing from sourmash --- modules/nf-core/sourmash/index/tests/main.nf.test | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/sourmash/index/tests/main.nf.test b/modules/nf-core/sourmash/index/tests/main.nf.test index ac58f11cf5ed..f2d75d8d735e 100644 --- a/modules/nf-core/sourmash/index/tests/main.nf.test +++ b/modules/nf-core/sourmash/index/tests/main.nf.test @@ -9,7 +9,6 @@ nextflow_process { tag "sourmash" tag "sourmash/index" tag "sourmash/sketch" - tag "blah" setup { run("SOURMASH_SKETCH") { From 29d66bd5aa1dd24463b272f0742286cdd1a90d66 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Wed, 15 Apr 2026 15:11:17 +0200 Subject: [PATCH 6/8] Reset KMCP files --- modules/nf-core/kmcp/profile/main.nf | 23 +++++++++-------------- modules/nf-core/kmcp/profile/meta.yml | 4 +--- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/modules/nf-core/kmcp/profile/main.nf b/modules/nf-core/kmcp/profile/main.nf index 4072ed88de3a..9dc8b3d308be 100644 --- a/modules/nf-core/kmcp/profile/main.nf +++ b/modules/nf-core/kmcp/profile/main.nf @@ -1,19 +1,19 @@ process KMCP_PROFILE { - tag "${meta.id}" + tag "$meta.id" label 'process_medium' conda "${moduleDir}/environment.yml" - container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container - ? 'https://depot.galaxyproject.org/singularity/kmcp:0.9.4--h9ee0642_0' - : 'biocontainers/kmcp:0.9.4--h9ee0642_0'}" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/kmcp:0.9.4--h9ee0642_0': + 'biocontainers/kmcp:0.9.4--h9ee0642_0' }" input: tuple val(meta), path(search_results) - path db + path (db) output: tuple val(meta), path("*.profile"), emit: profile - path "versions.yml", emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -21,28 +21,23 @@ process KMCP_PROFILE { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - - if (!db.find { db_files -> db_files.name.endsWith('names.dmp') } || !db.find { db_files -> db_files.name.endsWith('nodes.dmp') } || !db.find { db_files -> db_files.name.endsWith('map') }) { - error('[KMCP_PROFILE] ERROR: Missing one of `nodes.dmp`, `names.dmp`, `*.map`. Check input.') - } """ taxid=`find -L ${db} -name "*map"` taxdump=`find -L ${db}/*/ -type d -not -name "R001"` kmcp \\ profile \\ - ${args} \\ + $args \\ -X \$taxdump \\ -T \$taxid \\ - -j ${task.cpus} \\ + -j $task.cpus \\ -o ${prefix}.profile \\ - ${search_results} + $search_results cat <<-END_VERSIONS > versions.yml "${task.process}": kmcp: \$(echo \$(kmcp version 2>&1) | sed -n 1p | sed 's/^.*kmcp v//') END_VERSIONS """ - stub: prefix = task.ext.prefix ?: "${meta.id}" """ diff --git a/modules/nf-core/kmcp/profile/meta.yml b/modules/nf-core/kmcp/profile/meta.yml index afd1065a9e9a..a1abab463f71 100644 --- a/modules/nf-core/kmcp/profile/meta.yml +++ b/modules/nf-core/kmcp/profile/meta.yml @@ -32,9 +32,7 @@ input: - edam: http://edamontology.org/format_3989 # GZIP format - db: type: directory - description: | - Database directory that also includes containing NCBI-style taxdump taxonomy files (`nodes.dmp`, `names.dmp`) - and a two column accession ID to taxid TSV file ending in `*map` + description: Database directory containing taxdump files and taxid file output: profile: - - meta: From a55b830dc4010a533a17ccd40ecb5cbdb88bfe89 Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Fri, 17 Apr 2026 11:13:00 +0000 Subject: [PATCH 7/8] [automated] Fix code linting --- modules/nf-core/kaiju/kaiju/tests/main.nf.test | 6 +++--- modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test | 4 ++-- modules/nf-core/kaiju/kaiju2table/tests/main.nf.test | 2 +- modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/nf-core/kaiju/kaiju/tests/main.nf.test b/modules/nf-core/kaiju/kaiju/tests/main.nf.test index c29a0c1c3499..831707527445 100644 --- a/modules/nf-core/kaiju/kaiju/tests/main.nf.test +++ b/modules/nf-core/kaiju/kaiju/tests/main.nf.test @@ -34,7 +34,7 @@ nextflow_process { input[1] = UNTAR.out.untar .map { - meta, untar -> + meta, untar -> db = [ untar, file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), @@ -72,7 +72,7 @@ nextflow_process { input[1] = UNTAR.out.untar .map { - meta, untar -> + meta, untar -> db = [ untar, file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), @@ -111,7 +111,7 @@ nextflow_process { input[1] = UNTAR.out.untar .map { - meta, untar -> + meta, untar -> db = [ untar, file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), diff --git a/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test b/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test index 1c43a860e386..bb810d7d88a1 100644 --- a/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test +++ b/modules/nf-core/kaiju/kaiju2krona/tests/main.nf.test @@ -34,7 +34,7 @@ nextflow_process { ] input[1] = UNTAR.out.untar .map { - meta, untar -> + meta, untar -> db = [ untar, file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), @@ -90,7 +90,7 @@ nextflow_process { ] input[1] = UNTAR.out.untar .map { - meta, untar -> + meta, untar -> db = [ untar, file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), diff --git a/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test b/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test index 76d7dd2a5bcb..c0c7fcc91a55 100644 --- a/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test +++ b/modules/nf-core/kaiju/kaiju2table/tests/main.nf.test @@ -34,7 +34,7 @@ nextflow_process { ] input[1] = UNTAR.out.untar .map { - meta, untar -> + meta, untar -> db = [ untar, file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), diff --git a/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test b/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test index f2a2683fcf90..da5c4e662964 100644 --- a/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test +++ b/modules/nf-core/kaiju/mergeoutputs/tests/main.nf.test @@ -63,7 +63,7 @@ nextflow_process { ] input[1] = UNTAR_KAIJU.out.untar .map { - meta, untar -> + meta, untar -> db = [ untar, file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), @@ -106,7 +106,7 @@ nextflow_process { input[0] = KAIJU_KAIJU.out.results.join(KRAKEN2_KRAKEN2.out.classified_reads_assignment) input[1] = UNTAR_KAIJU.out.untar .map { - meta, untar -> + meta, untar -> db = [ untar, file(params.modules_testdata_base_path + "delete_me/kaiju/nodes.dmp", checkIfExists: true), From c869ef43bc7e524cbe754d7dfca0934936a44ce9 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Sun, 17 May 2026 18:41:04 +0200 Subject: [PATCH 8/8] Add mobsuite/typer --- .../nf-core/mobsuite/typer/environment.yml | 7 + modules/nf-core/mobsuite/typer/main.nf | 75 ++++++++ modules/nf-core/mobsuite/typer/meta.yml | 139 +++++++++++++++ .../nf-core/mobsuite/typer/tests/main.nf.test | 81 +++++++++ .../mobsuite/typer/tests/main.nf.test.snap | 161 ++++++++++++++++++ 5 files changed, 463 insertions(+) create mode 100644 modules/nf-core/mobsuite/typer/environment.yml create mode 100644 modules/nf-core/mobsuite/typer/main.nf create mode 100644 modules/nf-core/mobsuite/typer/meta.yml create mode 100644 modules/nf-core/mobsuite/typer/tests/main.nf.test create mode 100644 modules/nf-core/mobsuite/typer/tests/main.nf.test.snap diff --git a/modules/nf-core/mobsuite/typer/environment.yml b/modules/nf-core/mobsuite/typer/environment.yml new file mode 100644 index 000000000000..76393f3a972e --- /dev/null +++ b/modules/nf-core/mobsuite/typer/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::mob_suite=3.1.9" diff --git a/modules/nf-core/mobsuite/typer/main.nf b/modules/nf-core/mobsuite/typer/main.nf new file mode 100644 index 000000000000..ca682932c55b --- /dev/null +++ b/modules/nf-core/mobsuite/typer/main.nf @@ -0,0 +1,75 @@ +process MOBSUITE_TYPER { + tag "${meta.id}" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/mob_suite:3.1.9--pyhdfd78af_0' + : 'quay.io/biocontainers/mob_suite:3.1.9--pyhdfd78af_0'}" + + input: + tuple val(meta), path(fasta) + path db + path plasmid_mash_db + path plasmid_meta_txt + path plasmid_replicons_fas + path repetitive_mask_fas + path plasmid_mob_faa + path plasmid_mpf_faa + path plasmid_orit_fas + val generate_biomarker_report + val generate_mge_report + + output: + tuple val(meta), path("*.txt"), emit: report + tuple val(meta), path("*_biomarker_report.txt"), optional: true, emit: biomarker_report + tuple val(meta), path("*_mge_report.txt"), optional: true, emit: mge_report + tuple val("${task.process}"), val('mobsuite'), eval("mob_typer --version | sed 's/mob_typer //g'"), topic: versions, emit: versions_mobsuite + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def biomarker_report_cmd = generate_biomarker_report ? "--biomarker_report_file ${prefix}_biomarker_report.txt" : '' + def mge_report_cmd = generate_mge_report ? "--mge_report_file ${prefix}_mge_report.txt" : '' + def plasmid_mash_db_cmd = plasmid_mash_db ? "-d ${plasmid_mash_db}" : '' + def plasmid_meta_cmd = plasmid_meta_txt ? "-m ${plasmid_meta_txt}" : '' + def plasmid_replicons_cmd = plasmid_replicons_fas ? "--plasmid_replicons ${plasmid_replicons_fas}" : '' + def repetitive_mask_cmd = repetitive_mask_fas ? "--repetitive_mask ${repetitive_mask_fas}" : '' + def plasmid_mob_cmd = plasmid_mob_faa ? "--plasmid_mob ${plasmid_mob_faa}" : '' + def plasmid_mpf_cmd = plasmid_mpf_faa ? "--plasmid_mpf ${plasmid_mpf_faa}" : '' + def plasmid_orit_fas_cmd = plasmid_orit_fas ? "--plasmid_orit ${plasmid_orit_fas}" : '' + def db_cmd = db ? "-d ${db}" : '' + """ + mob_typer \\ + -n ${task.cpus} \\ + -s ${prefix} \\ + ${args} \\ + -i ${fasta} \\ + ${plasmid_mash_db_cmd} \\ + ${plasmid_meta_cmd} \\ + ${plasmid_replicons_cmd} \\ + ${repetitive_mask_cmd} \\ + ${plasmid_mob_cmd} \\ + ${plasmid_mpf_cmd} \\ + ${plasmid_orit_fas_cmd} \\ + ${db_cmd} \\ + -o ${prefix}.txt \\ + ${biomarker_report_cmd} \\ + ${mge_report_cmd} + + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + echo ${args} + + touch ${prefix}.txt + touch ${prefix}_biomarker_report.txt + touch ${prefix}_mge_report.txt + """ +} diff --git a/modules/nf-core/mobsuite/typer/meta.yml b/modules/nf-core/mobsuite/typer/meta.yml new file mode 100644 index 000000000000..80d2f0da1531 --- /dev/null +++ b/modules/nf-core/mobsuite/typer/meta.yml @@ -0,0 +1,139 @@ +name: "mobsuite_typer" +description: Bacterial plasmid typing and mobility prediction +keywords: + - bacteria + - plasmid + - typing + - genomics +tools: + - "mobsuite": + description: "MOB-suite is a set of tools for finding, typing and reconstruction + of plasmids from draft and complete genome assemblies." + homepage: "https://github.com/phac-nml/mob-suite/blob/master/README.md" + documentation: "https://github.com/phac-nml/mob-suite/blob/master/README.md" + tool_dev_url: "https://github.com/phac-nml/mob-suite" + doi: "10.1099/mgen.0.000435" + licence: + - "Apache-2.0" + identifier: biotools:mob_suite +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fasta: + type: file + description: A bacterial genome assembly in FASTA format + pattern: "*.{fasta,fa,fna}" + ontologies: + - edam: "http://edamontology.org/format_1929" + - db: + type: directory + description: Optional local copy of MOB-suite database directory + pattern: "databases/" + - plasmid_mash_db: + type: file + description: Optional Companion Mash database of reference database + pattern: "*.msh" + ontologies: + - edam: http://edamontology.org/format_3911 + - plasmid_meta_txt: + type: file + description: MOB-cluster plasmid cluster formatted file matched to the reference + plasmid db + pattern: "*.txt" + ontologies: [] + - plasmid_replicons_fas: + type: file + description: Optional nucleotide FASTA file of plasmid replicons + pattern: "*.{fasta,fna,fa,fas}" + ontologies: + - edam: "http://edamontology.org/format_1929" + - repetitive_mask_fas: + type: file + description: Optional nucleotide FASTA file of known repetitive elements + pattern: "*.{fasta,fna,fa,fas}" + ontologies: + - edam: "http://edamontology.org/format_1929" + - plasmid_mob_faa: + type: file + description: Optional protein FASTA file of plasmid mobility proteins + pattern: "*.{fasta,faa,fa,fas}" + ontologies: + - edam: "http://edamontology.org/format_1929" + - plasmid_mpf_faa: + type: file + description: Optional protein FASTA file of plasmid mating pair formation proteins + pattern: "*.{fasta,faa,fa,fas}" + ontologies: + - edam: "http://edamontology.org/format_1929" + - plasmid_orit_fas: + type: file + description: Optional nucleotide FASTA file of known plasmid oriT dna sequences + pattern: "*.{fasta,fna,fa,fas}" + ontologies: + - edam: "http://edamontology.org/format_1929" + - generate_biomarker_report: + type: boolean + description: Whether to generate a biomarker report file + - generate_mge_report: + type: boolean + description: Whether to generate a mobile genetic element (MGE) report file +output: + report: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*.txt": + type: file + description: MOB-suite typer report file + pattern: "*.txt" + ontologies: [] + biomarker_report: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*_biomarker_report.txt": + type: file + description: MOB-suite biomarker report file + pattern: "*_biomarker_report.txt" + mge_report: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*_mge_report.txt": + type: file + description: MOB-suite mobile genetic element (MGE) report file + pattern: "*_mge_report.txt" + versions_mobsuite: + - - ${task.process}: + type: string + description: The name of the process + - mobsuite: + type: string + description: The name of the tool + - mob_typer --version | sed 'mob_typer '/: + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - mobsuite: + type: string + description: The name of the tool + - mob_typer --version | sed 'mob_typer '/: + type: eval + description: The expression to obtain the version of the tool +authors: + - "@jfy133" +maintainers: + - "@jfy133" diff --git a/modules/nf-core/mobsuite/typer/tests/main.nf.test b/modules/nf-core/mobsuite/typer/tests/main.nf.test new file mode 100644 index 000000000000..acc5338a2788 --- /dev/null +++ b/modules/nf-core/mobsuite/typer/tests/main.nf.test @@ -0,0 +1,81 @@ +nextflow_process { + + name "Test Process MOBSUITE_TYPER" + script "../main.nf" + process "MOBSUITE_TYPER" + + tag "modules" + tag "modules_nfcore" + tag "mobsuite" + tag "mobsuite/typer" + + test("sarscov2 - fasta") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + ] + input[1] = [] + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] + input[6] = [] + input[7] = [] + input[8] = [] + input[9] = true + input[10] = true + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } + ) + } + + } + + test("sarscov2 - fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + ] + input[1] = [] + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] + input[6] = [] + input[7] = [] + input[8] = [] + input[9] = true + input[10] = true + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/mobsuite/typer/tests/main.nf.test.snap b/modules/nf-core/mobsuite/typer/tests/main.nf.test.snap new file mode 100644 index 000000000000..fa49124a90dd --- /dev/null +++ b/modules/nf-core/mobsuite/typer/tests/main.nf.test.snap @@ -0,0 +1,161 @@ +{ + "sarscov2 - fasta - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_biomarker_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_mge_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_biomarker_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test_mge_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + "MOBSUITE_TYPER", + "mobsuite", + "3.1.9" + ] + ], + "biomarker_report": [ + [ + { + "id": "test" + }, + "test_biomarker_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "mge_report": [ + [ + { + "id": "test" + }, + "test_mge_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "report": [ + [ + { + "id": "test" + }, + [ + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_biomarker_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_mge_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions_mobsuite": [ + [ + "MOBSUITE_TYPER", + "mobsuite", + "3.1.9" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.10.4" + }, + "timestamp": "2026-05-17T17:14:59.584190491" + }, + "sarscov2 - fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test.txt:md5,b3e2a4ff64fd91e0cf33b963d1f27536", + "test_biomarker_report.txt:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_biomarker_report.txt:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "2": [ + + ], + "3": [ + [ + "MOBSUITE_TYPER", + "mobsuite", + "3.1.9" + ] + ], + "biomarker_report": [ + [ + { + "id": "test" + }, + "test_biomarker_report.txt:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "mge_report": [ + + ], + "report": [ + [ + { + "id": "test" + }, + [ + "test.txt:md5,b3e2a4ff64fd91e0cf33b963d1f27536", + "test_biomarker_report.txt:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "versions_mobsuite": [ + [ + "MOBSUITE_TYPER", + "mobsuite", + "3.1.9" + ] + ] + }, + { + "versions_mobsuite": [ + [ + "MOBSUITE_TYPER", + "mobsuite", + "3.1.9" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.10.4" + }, + "timestamp": "2026-05-17T18:38:37.549682074" + } +} \ No newline at end of file