diff --git a/modules/nf-core/metamaps/classify/main.nf b/modules/nf-core/metamaps/classify/main.nf index 515de897a6f4..fc53f21fd962 100644 --- a/modules/nf-core/metamaps/classify/main.nf +++ b/modules/nf-core/metamaps/classify/main.nf @@ -20,7 +20,7 @@ process METAMAPS_CLASSIFY { tuple val(meta), path("*classification_res.EM.contigCoverage") , emit: contig_coverage tuple val(meta), path("*classification_res.EM.lengthAndIdentitiesPerMappingUnit") , emit: length_and_id tuple val(meta), path("*classification_res.EM.reads2Taxon.krona") , emit: krona - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('metamaps'), eval("metamaps | sed -n 's/.*MetaMaps v //p'"), emit: versions_metamaps, topic: versions when: task.ext.when == null || task.ext.when @@ -34,11 +34,6 @@ process METAMAPS_CLASSIFY { --mappings ${classification_res} \\ --threads ${task.cpus} \\ --DB ${database_folder} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - metamaps: \$(metamaps | sed -n 2p | sed 's/^.*MetaMaps v //') - END_VERSIONS """ stub: @@ -51,11 +46,6 @@ process METAMAPS_CLASSIFY { touch ${prefix}_classification_res.EM.contigCoverage touch ${prefix}_classification_res.EM.lengthAndIdentitiesPerMappingUnit touch ${prefix}_classification_res.EM.reads2Taxon.krona - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - metamaps: \$(metamaps | sed -n 2p | sed 's/^.*MetaMaps v //') - END_VERSIONS """ } diff --git a/modules/nf-core/metamaps/classify/meta.yml b/modules/nf-core/metamaps/classify/meta.yml index 8d936b10e2c9..1dd85ffee689 100644 --- a/modules/nf-core/metamaps/classify/meta.yml +++ b/modules/nf-core/metamaps/classify/meta.yml @@ -12,7 +12,8 @@ tools: documentation: https://github.com/DiltheyLab/MetaMaps/blob/master/README.md tool_dev_url: https://github.com/DiltheyLab/MetaMaps doi: "10.1038/s41467-019-10934-2" - licence: ["Public Domain"] + licence: + - "Public Domain" identifier: biotools:metamaps input: @@ -123,13 +124,29 @@ output: description: Taxon ID assignment of reads in Krona format pattern: "*.{classification_res.EM.reads2Taxon.krona}" ontologies: [] + versions_metamaps: + - - ${task.process}: + type: string + description: The name of the process + - metamaps: + type: string + description: The name of the tool + - metamaps | sed -n 's/.*MetaMaps v //p': + 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 + - metamaps: + type: string + description: The name of the tool + - metamaps | sed -n 's/.*MetaMaps v //p': + type: eval + description: The expression to obtain the version of the tool + authors: - "@henningonsbring" - "@sofstam" diff --git a/modules/nf-core/metamaps/classify/tests/main.nf.test b/modules/nf-core/metamaps/classify/tests/main.nf.test index e005bc8490c0..9c2a465987c7 100644 --- a/modules/nf-core/metamaps/classify/tests/main.nf.test +++ b/modules/nf-core/metamaps/classify/tests/main.nf.test @@ -2,6 +2,7 @@ nextflow_process { name "Test Process METAMAPS_CLASSIFY" script "../main.nf" + config "./nextflow.config" process "METAMAPS_CLASSIFY" tag "modules" @@ -11,52 +12,49 @@ nextflow_process { tag "metamaps/classify" tag "untar" - test("sarscov2_nanopore_classify") { - setup { - run("UNTAR") { - config "./nextflow.config" - script "../../../untar/main.nf" - process { - """ - input[0] = [ - [],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/metamaps_db.tar.gz', checkIfExists: true) - ] - """ - } + setup { + run("UNTAR") { + script "../../../untar/main.nf" + process { + """ + input[0] = [ + [], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/metamaps_db.tar.gz', checkIfExists: true) + ] + """ } - run("METAMAPS_MAPDIRECTLY") { - script "../../../metamaps/mapdirectly/main.nf" - process { - """ - input[0] = [ - [ id:'test', single_end:true ], // meta map + } + run("METAMAPS_MAPDIRECTLY") { + script "../../../metamaps/mapdirectly/main.nf" + process { + """ + input[0] = [ + [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/nanopore/fastq/test_2.fastq.gz', checkIfExists: true) - ] - input[1] = UNTAR.out.untar.map{ it[1] } - """ - } + ] + input[1] = UNTAR.out.untar.map{ it[1] } + """ } } + } + test("sarscov2_nanopore_classify") { when { process { """ - classification_folder = METAMAPS_MAPDIRECTLY.out.classification_res - .join(METAMAPS_MAPDIRECTLY.out.meta_file) - .join(METAMAPS_MAPDIRECTLY.out.meta_unmappedreadsLengths) - .join(METAMAPS_MAPDIRECTLY.out.para_file) - input[0] = classification_folder + input[0] = METAMAPS_MAPDIRECTLY.out.classification_res + .join(METAMAPS_MAPDIRECTLY.out.meta_file) + .join(METAMAPS_MAPDIRECTLY.out.meta_unmappedreadsLengths) + .join(METAMAPS_MAPDIRECTLY.out.para_file) input[1] = UNTAR.out.untar.map{ it[1] } """ } } - - then { - assertAll( + assertAll( { assert process.success }, - { assert snapshot ( sanitizeOutput(process.out) ).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } @@ -66,55 +64,23 @@ nextflow_process { options "-stub" - setup { - run("UNTAR") { - config "./nextflow.config" - script "../../../untar/main.nf" - process { - """ - input[0] = [ - [],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/metamaps_db.tar.gz', checkIfExists: true) - ] - """ - } - } - run("METAMAPS_MAPDIRECTLY") { - script "../../../metamaps/mapdirectly/main.nf" - process { - """ - input[0] = [ - [ id:'test', single_end:true ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/nanopore/fastq/test_2.fastq.gz', checkIfExists: true) - ] - input[1] = UNTAR.out.untar.map{ it[1] } - """ - } - } - } - when { process { """ - classification_folder = METAMAPS_MAPDIRECTLY.out.classification_res - .join(METAMAPS_MAPDIRECTLY.out.meta_file) - .join(METAMAPS_MAPDIRECTLY.out.meta_unmappedreadsLengths) - .join(METAMAPS_MAPDIRECTLY.out.para_file) - input[0] = classification_folder + input[0] = METAMAPS_MAPDIRECTLY.out.classification_res + .join(METAMAPS_MAPDIRECTLY.out.meta_file) + .join(METAMAPS_MAPDIRECTLY.out.meta_unmappedreadsLengths) + .join(METAMAPS_MAPDIRECTLY.out.para_file) input[1] = UNTAR.out.untar.map{ it[1] } """ } } - - then { - assertAll( + assertAll( { assert process.success }, - { assert snapshot ( sanitizeOutput(process.out) ).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } - } - - } diff --git a/modules/nf-core/metamaps/classify/tests/main.nf.test.snap b/modules/nf-core/metamaps/classify/tests/main.nf.test.snap index 16ccc9834f62..da221e342129 100644 --- a/modules/nf-core/metamaps/classify/tests/main.nf.test.snap +++ b/modules/nf-core/metamaps/classify/tests/main.nf.test.snap @@ -5,8 +5,7 @@ "contig_coverage": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test.classification_res.EM.contigCoverage:md5,131507f62806647f11b1dc10d546c73f" ] @@ -14,8 +13,7 @@ "em": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test.classification_res.EM:md5,c6b1f5475e3fb9c6633aa0623456eebc" ] @@ -23,8 +21,7 @@ "evidence_unknown_species": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test.classification_res.EM.evidenceUnknownSpecies:md5,a8577e31b3d9b3a598b43fc531075e81" ] @@ -32,8 +29,7 @@ "krona": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test.classification_res.EM.reads2Taxon.krona:md5,9f644c743e2f4ed5617fe3d421758771" ] @@ -41,8 +37,7 @@ "length_and_id": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test.classification_res.EM.lengthAndIdentitiesPerMappingUnit:md5,56be33596aa37bc360bbec47cebdc5e2" ] @@ -50,30 +45,32 @@ "reads2taxon": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test.classification_res.EM.reads2Taxon:md5,f08d1d1865a3949a9c542b5b930fb37c" ] ], - "versions": [ - "versions.yml:md5,60993f8b87f7a2e25367c7dc96c9b859" + "versions_metamaps": [ + [ + "METAMAPS_CLASSIFY", + "metamaps", + "0.1 " + ] ], "wimp": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test.classification_res.EM.WIMP:md5,b39a980519a382422ac6da49bea13de8" ] ] } ], - "timestamp": "2026-02-16T10:31:48.827781306", + "timestamp": "2026-07-06T12:50:09.649235078", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.3" } }, "sarscov2_nanopore_classify - stub": { @@ -82,8 +79,7 @@ "contig_coverage": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test_classification_res.EM.contigCoverage:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -91,8 +87,7 @@ "em": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test_classification_res.EM:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -100,8 +95,7 @@ "evidence_unknown_species": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test_classification_res.EM.evidenceUnknownSpecies:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -109,8 +103,7 @@ "krona": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test_classification_res.EM.reads2Taxon.krona:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -118,8 +111,7 @@ "length_and_id": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test_classification_res.EM.lengthAndIdentitiesPerMappingUnit:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -127,30 +119,32 @@ "reads2taxon": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test_classification_res.EM.reads2Taxon:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,60993f8b87f7a2e25367c7dc96c9b859" + "versions_metamaps": [ + [ + "METAMAPS_CLASSIFY", + "metamaps", + "0.1 " + ] ], "wimp": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test_classification_res.EM.WIMP:md5,d41d8cd98f00b204e9800998ecf8427e" ] ] } ], - "timestamp": "2026-02-16T10:31:57.309999771", + "timestamp": "2026-07-06T12:50:20.781697174", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.3" } } } \ No newline at end of file diff --git a/modules/nf-core/metamaps/mapdirectly/main.nf b/modules/nf-core/metamaps/mapdirectly/main.nf index 907c051d69a8..0b5076dadbe9 100644 --- a/modules/nf-core/metamaps/mapdirectly/main.nf +++ b/modules/nf-core/metamaps/mapdirectly/main.nf @@ -16,7 +16,7 @@ process METAMAPS_MAPDIRECTLY { tuple val(meta), path("*classification_res.meta") , emit: meta_file tuple val(meta), path("*classification_res.meta.unmappedReadsLengths"), emit: meta_unmappedreadsLengths tuple val(meta), path("*classification_res.parameters") , emit: para_file - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('metamaps'), eval("metamaps | sed -n 's/.*MetaMaps v //p'"), emit: versions_metamaps, topic: versions when: task.ext.when == null || task.ext.when @@ -28,17 +28,12 @@ process METAMAPS_MAPDIRECTLY { db=`find -L ${database} -name "DB.fa"` metamaps \\ mapDirectly \\ - $args \\ + ${args} \\ --all \\ --reference \$db \\ - --threads $task.cpus \\ - --query $reads \\ + --threads ${task.cpus} \\ + --query ${reads} \\ --output ${prefix}.classification_res - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - metamaps: \$(metamaps | sed -n 2p | sed 's/^.*MetaMaps v //') - END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" @@ -47,10 +42,5 @@ process METAMAPS_MAPDIRECTLY { touch ${prefix}_classification_res.meta touch ${prefix}_classification_res.meta.unmappedReadsLengths touch ${prefix}_classification_res.parameters - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - metamaps: \$(metamaps | sed -n 2p | sed 's/^.*MetaMaps v //') - END_VERSIONS """ } diff --git a/modules/nf-core/metamaps/mapdirectly/meta.yml b/modules/nf-core/metamaps/mapdirectly/meta.yml index 64b372f4a4fc..a3500f3cbd2e 100644 --- a/modules/nf-core/metamaps/mapdirectly/meta.yml +++ b/modules/nf-core/metamaps/mapdirectly/meta.yml @@ -12,7 +12,8 @@ tools: documentation: https://github.com/DiltheyLab/MetaMaps/blob/master/README.md tool_dev_url: https://github.com/DiltheyLab/MetaMaps doi: "10.1038/s41467-019-10934-2" - licence: ["Public Domain"] + licence: + - "Public Domain" identifier: biotools:metamaps input: @@ -77,13 +78,29 @@ output: description: Log with parameters pattern: "*.{classification_res.parameters}" ontologies: [] + versions_metamaps: + - - ${task.process}: + type: string + description: The name of the process + - metamaps: + type: string + description: The name of the tool + - metamaps | sed -n 's/.*MetaMaps v //p': + 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 + - metamaps: + type: string + description: The name of the tool + - metamaps | sed -n 's/.*MetaMaps v //p': + type: eval + description: The expression to obtain the version of the tool + authors: - "@henningonsbring" - "@sofstam" diff --git a/modules/nf-core/metamaps/mapdirectly/tests/main.nf.test b/modules/nf-core/metamaps/mapdirectly/tests/main.nf.test index 8c313154d6cc..dafd853d906b 100644 --- a/modules/nf-core/metamaps/mapdirectly/tests/main.nf.test +++ b/modules/nf-core/metamaps/mapdirectly/tests/main.nf.test @@ -10,27 +10,27 @@ nextflow_process { tag "metamaps/mapdirectly" tag "untar" - test("sarscov2_nanopore_mapdirectly") { - setup { run("UNTAR") { config "./nextflow.config" script "../../../untar/main.nf" - process { - """ - input[0] = [ - [],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/metamaps_db.tar.gz', checkIfExists: true) - ] - """ - } + process { + """ + input[0] = [ + [], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/metamaps_db.tar.gz', checkIfExists: true) + ] + """ } } + } + test("sarscov2_nanopore_mapdirectly") { when { process { """ input[0] = [ - [ id:'test', single_end:true ], // meta map + [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/nanopore/fastq/test.fastq.gz', checkIfExists: true) ] input[1] = UNTAR.out.untar.map{ it[1] } @@ -38,38 +38,21 @@ nextflow_process { } } - then { assertAll( { assert process.success }, - { assert snapshot ( process.out ).match() } + { assert snapshot(sanitizeOutput(process.out, unstableKeys:["classification_res"])).match() } ) } } - test("sarscov2_nanopore_mapdirectly - stub") { - - options "-stub" - - setup { - run("UNTAR") { - config "./nextflow.config" - script "../../../untar/main.nf" - process { - """ - input[0] = [ - [],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/metamaps_db.tar.gz', checkIfExists: true) - ] - """ - } - } - } - + test("sarscov2_nanopore_mapdirectly - stub") { + options "-stub" when { process { """ input[0] = [ - [ id:'test', single_end:true ], // meta map + [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/nanopore/fastq/test.fastq.gz', checkIfExists: true) ] input[1] = UNTAR.out.untar.map{ it[1] } @@ -80,7 +63,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot ( process.out ).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } diff --git a/modules/nf-core/metamaps/mapdirectly/tests/main.nf.test.snap b/modules/nf-core/metamaps/mapdirectly/tests/main.nf.test.snap index 895284f152eb..6ecc40a6b9ce 100644 --- a/modules/nf-core/metamaps/mapdirectly/tests/main.nf.test.snap +++ b/modules/nf-core/metamaps/mapdirectly/tests/main.nf.test.snap @@ -2,50 +2,10 @@ "sarscov2_nanopore_mapdirectly - stub": { "content": [ { - "0": [ - [ - { - "id": "test", - "single_end": true - }, - "test_classification_res:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": true - }, - "test_classification_res.meta:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "2": [ - [ - { - "id": "test", - "single_end": true - }, - "test_classification_res.meta.unmappedReadsLengths:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "3": [ - [ - { - "id": "test", - "single_end": true - }, - "test_classification_res.parameters:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "4": [ - "versions.yml:md5,54af95dffcf4481d255c84d70cf851ef" - ], "classification_res": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test_classification_res:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -53,8 +13,7 @@ "meta_file": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test_classification_res.meta:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -62,8 +21,7 @@ "meta_unmappedreadsLengths": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test_classification_res.meta.unmappedReadsLengths:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -71,79 +29,41 @@ "para_file": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test_classification_res.parameters:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,54af95dffcf4481d255c84d70cf851ef" + "versions_metamaps": [ + [ + "METAMAPS_MAPDIRECTLY", + "metamaps", + "0.1 " + ] ] } ], + "timestamp": "2026-07-06T12:50:40.486373176", "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.3" - }, - "timestamp": "2024-12-17T18:42:07.130639636" + "nf-test": "0.9.5", + "nextflow": "26.04.3" + } }, "sarscov2_nanopore_mapdirectly": { "content": [ { - "0": [ - [ - { - "id": "test", - "single_end": true - }, - "test.classification_res:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": true - }, - "test.classification_res.meta:md5,cf13c221c6d05329af73a0480466ddfb" - ] - ], - "2": [ - [ - { - "id": "test", - "single_end": true - }, - "test.classification_res.meta.unmappedReadsLengths:md5,f636a6dc2372a5c93d472dd109a5e06d" - ] - ], - "3": [ - [ - { - "id": "test", - "single_end": true - }, - "test.classification_res.parameters:md5,c0fedae5209f2ac9ff41b48bdd2a403b" - ] - ], - "4": [ - "versions.yml:md5,54af95dffcf4481d255c84d70cf851ef" - ], "classification_res": [ [ { - "id": "test", - "single_end": true + "id": "test" }, - "test.classification_res:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.classification_res" ] ], "meta_file": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test.classification_res.meta:md5,cf13c221c6d05329af73a0480466ddfb" ] @@ -151,8 +71,7 @@ "meta_unmappedreadsLengths": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test.classification_res.meta.unmappedReadsLengths:md5,f636a6dc2372a5c93d472dd109a5e06d" ] @@ -160,21 +79,24 @@ "para_file": [ [ { - "id": "test", - "single_end": true + "id": "test" }, "test.classification_res.parameters:md5,c0fedae5209f2ac9ff41b48bdd2a403b" ] ], - "versions": [ - "versions.yml:md5,54af95dffcf4481d255c84d70cf851ef" + "versions_metamaps": [ + [ + "METAMAPS_MAPDIRECTLY", + "metamaps", + "0.1 " + ] ] } ], + "timestamp": "2026-07-06T13:02:56.379808387", "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.1" - }, - "timestamp": "2024-06-12T14:12:22.645009" + "nf-test": "0.9.5", + "nextflow": "26.04.3" + } } } \ No newline at end of file