From 6c34e98399d338b4a46354c9daaf0f312301f84b Mon Sep 17 00:00:00 2001 From: LilyAnderssonLee Date: Thu, 3 Oct 2024 09:30:35 +0200 Subject: [PATCH 1/2] update motus/merge --- CHANGELOG.md | 32 +++---- modules.json | 2 +- modules/nf-core/motus/merge/main.nf | 22 ++++- modules/nf-core/motus/merge/meta.yml | 71 +++++++++------ .../nf-core/motus/merge/tests/main.nf.test | 89 +++++++++++++++++++ .../motus/merge/tests/main.nf.test.snap | 63 +++++++++++++ modules/nf-core/motus/merge/tests/tags.yml | 2 + 7 files changed, 235 insertions(+), 46 deletions(-) create mode 100644 modules/nf-core/motus/merge/tests/main.nf.test create mode 100644 modules/nf-core/motus/merge/tests/main.nf.test.snap create mode 100644 modules/nf-core/motus/merge/tests/tags.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index e5f1f36d..4a541caa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## v1.2 - Bouncy Basenji [2024-09-11] +## v1.2 - Bouncy Basenji [2024-10-03] ### `Added` @@ -25,21 +25,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Dependencies` -| Tool | Previous version | New version | -| ------------- | ---------------- | ----------- | -| bbmap | 39.01 | 39.06 | -| bowtie2 | 2.4.4 | 2.5.2 | -| bracken | 2.7 | 2.9 | -| diamond | 2.0.15 | 2.1.8 | -| ganon | 1.5.1 | 2.0.0 | -| kraken2 | 2.1.2 | 2.1.3 | -| krona | 2.8 | 2.8.1 | -| megan | 6.24.20 | 6.25.9 | -| metaphlan | 4.0.6 | 4.1.1 | -| minimap2 | 2.24 | 2.28 | -| motus/profile | 3.0.3 | 3.1.0 | -| multiqc | 1.21 | 1.25 | -| samtools | 1.17 | 1.20 | +| Tool | Previous version | New version | +| --------- | ---------------- | ----------- | +| bbmap | 39.01 | 39.06 | +| bowtie2 | 2.4.4 | 2.5.2 | +| bracken | 2.7 | 2.9 | +| diamond | 2.0.15 | 2.1.8 | +| ganon | 1.5.1 | 2.0.0 | +| kraken2 | 2.1.2 | 2.1.3 | +| krona | 2.8 | 2.8.1 | +| megan | 6.24.20 | 6.25.9 | +| metaphlan | 4.0.6 | 4.1.1 | +| minimap2 | 2.24 | 2.28 | +| motus | 3.0.3 | 3.1.0 | +| multiqc | 1.21 | 1.25 | +| samtools | 1.17 | 1.20 | ### `Deprecated` diff --git a/modules.json b/modules.json index f8f5f1e5..77bf8131 100644 --- a/modules.json +++ b/modules.json @@ -182,7 +182,7 @@ }, "motus/merge": { "branch": "master", - "git_sha": "e743b2dea725bcfc4b76a209981808987332013a", + "git_sha": "3cf419b5480c5ca8893f5ea6e1746d2b3a7c326d", "installed_by": ["modules"] }, "motus/profile": { diff --git a/modules/nf-core/motus/merge/main.nf b/modules/nf-core/motus/merge/main.nf index 06cb93cc..392024ae 100644 --- a/modules/nf-core/motus/merge/main.nf +++ b/modules/nf-core/motus/merge/main.nf @@ -4,8 +4,8 @@ process MOTUS_MERGE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/motus:3.0.3--pyhdfd78af_0': - 'biocontainers/motus:3.0.3--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/motus:3.1.0--pyhdfd78af_0': + 'biocontainers/motus:3.1.0--pyhdfd78af_0' }" input: tuple val(meta), path(input) @@ -42,4 +42,22 @@ process MOTUS_MERGE { motus: \$VERSION END_VERSIONS """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def cmd_input = input.size() > 1 ? "-i ${input.join(',')}" : input.isDirectory() ? "-d ${input}" : "-i ${input}" + def suffix = task.ext.args?.contains("-B") ? "biom" : "txt" + + """ + touch ${prefix}.txt + + VERSION=\$(cat ${profile_version_yml} | grep '/*motus:.*' | sed 's/.*otus: //g') + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + motus: \$VERSION + END_VERSIONS + """ + } diff --git a/modules/nf-core/motus/merge/meta.yml b/modules/nf-core/motus/merge/meta.yml index 0d7af231..57c95a54 100644 --- a/modules/nf-core/motus/merge/meta.yml +++ b/modules/nf-core/motus/merge/meta.yml @@ -16,37 +16,54 @@ tools: tool_dev_url: "https://github.com/motu-tool/mOTUs" doi: "10.1186/s40168-022-01410-z" licence: ["GPL v3"] + identifier: "" input: - - input: - type: file - description: | - List of output files (more than one) from motus profile, - or a single directory containing motus output files. - - db: - type: directory - description: | - mOTUs database downloaded by `motus downloadDB` - pattern: "db_mOTU/" - - profile_version_yml: - type: file - description: | - A single versions.yml file output from motus/profile. motus/merge cannot reconstruct - this itself without having the motus database present and configured with the tool - so here we take it from what is already reported by the upstream module. - pattern: "versions.yml" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - input: + type: file + description: | + List of output files (more than one) from motus profile, + or a single directory containing motus output files. + - - db: + type: directory + description: | + mOTUs database downloaded by `motus downloadDB` + pattern: "db_mOTU/" + - - profile_version_yml: + type: file + description: | + A single versions.yml file output from motus/profile. motus/merge cannot reconstruct + this itself without having the motus database present and configured with the tool + so here we take it from what is already reported by the upstream module. + pattern: "versions.yml" output: - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - txt: - type: file - description: OTU table in txt format, if BIOM format not requested - pattern: "*.txt" + - meta: + type: file + description: OTU table in txt format, if BIOM format not requested + pattern: "*.txt" + - "*.txt": + type: file + description: OTU table in txt format, if BIOM format not requested + pattern: "*.txt" - biom: - type: file - description: OTU table in biom format, if BIOM format requested - pattern: "*.biom" + - meta: + type: file + description: OTU table in biom format, if BIOM format requested + pattern: "*.biom" + - "*.biom": + type: file + description: OTU table in biom format, if BIOM format requested + pattern: "*.biom" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@jfy133" maintainers: diff --git a/modules/nf-core/motus/merge/tests/main.nf.test b/modules/nf-core/motus/merge/tests/main.nf.test new file mode 100644 index 00000000..13f0121e --- /dev/null +++ b/modules/nf-core/motus/merge/tests/main.nf.test @@ -0,0 +1,89 @@ +nextflow_process { + name "Test Process MOTUS_MERGE" + script "../main.nf" + process "MOTUS_MERGE" + tag "modules" + tag "modules_nfcore" + tag "motus" + tag "motus/downloaddb" + tag "motus/profile" + tag "motus/merge" + + + setup { + run("MOTUS_DOWNLOADDB") { + script "modules/nf-core/motus/downloaddb/main.nf" + process { + """ + input[0] = Channel.of([ + file('https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py') + ]) + """ + } + } + + run("MOTUS_PROFILE") { + script "modules/nf-core/motus/profile/main.nf" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + 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] = MOTUS_DOWNLOADDB.out.db + """ + } + } + } + + test("sarscov2 - illumina paired end [fastq]") { + + + when { + process { + """ + input[0] = MOTUS_PROFILE.out.out.map{ [[id:"test"], it[1]] }.groupTuple() + input[1] = MOTUS_DOWNLOADDB.out.db + input[2] = MOTUS_PROFILE.out.versions.first() + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.txt[0][1]).readLines()[3..10], + process.out.versions, + ).match() + } + ) + } + } + + test("sarscov2 - illumina paired end [fastq] - stub") { + + options "-stub" + + when { + process { + """ + input[0] = MOTUS_PROFILE.out.out.map{ [[id:"test"], it[1]] }.groupTuple() + input[1] = MOTUS_DOWNLOADDB.out.db + input[2] = MOTUS_PROFILE.out.versions.first() + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + } +} diff --git a/modules/nf-core/motus/merge/tests/main.nf.test.snap b/modules/nf-core/motus/merge/tests/main.nf.test.snap new file mode 100644 index 00000000..a8d75f4f --- /dev/null +++ b/modules/nf-core/motus/merge/tests/main.nf.test.snap @@ -0,0 +1,63 @@ +{ + "sarscov2 - illumina paired end [fastq]": { + "content": [ + [ + "Leptospira alexanderi [ref_mOTU_v31_00001]\t0.0000000000", + "Leptospira weilii [ref_mOTU_v31_00002]\t0.0000000000", + "Chryseobacterium sp. [ref_mOTU_v31_00004]\t0.0000000000", + "Chryseobacterium gallinarum [ref_mOTU_v31_00005]\t0.0000000000", + "Chryseobacterium indologenes [ref_mOTU_v31_00006]\t0.0000000000", + "Chryseobacterium artocarpi/ureilyticum [ref_mOTU_v31_00007]\t0.0000000000", + "Chryseobacterium jejuense [ref_mOTU_v31_00008]\t0.0000000000", + "Chryseobacterium sp. G972 [ref_mOTU_v31_00009]\t0.0000000000" + ], + [ + "versions.yml:md5,fb03dc5dcf4912bd54b06f9ee59a7eef" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-03T06:11:21.297394816" + }, + "sarscov2 - illumina paired end [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,fb03dc5dcf4912bd54b06f9ee59a7eef" + ], + "biom": [ + + ], + "txt": [ + [ + { + "id": "test" + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,fb03dc5dcf4912bd54b06f9ee59a7eef" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.1" + }, + "timestamp": "2024-10-02T12:18:09.391582" + } +} \ No newline at end of file diff --git a/modules/nf-core/motus/merge/tests/tags.yml b/modules/nf-core/motus/merge/tests/tags.yml new file mode 100644 index 00000000..44edb8d0 --- /dev/null +++ b/modules/nf-core/motus/merge/tests/tags.yml @@ -0,0 +1,2 @@ +motus/merge: + - modules/nf-core/motus/merge/** From c4d2a89e63616753681dfef7d0e0d9182cef9480 Mon Sep 17 00:00:00 2001 From: LilyAnderssonLee Date: Thu, 3 Oct 2024 09:35:29 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a541caa..9d13eaed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#508](https://github.com/nf-core/taxprofiler/pull/508) Add `nanoq` as a filtering tool for nanopore reads (added by @LilyAnderssonLee) - [#511](https://github.com/nf-core/taxprofiler/pull/511) Add `porechop_abi` as an alternative adapter removal tool for long reads nanopore data (added by @LilyAnderssonLee) - [#512](https://github.com/nf-core/taxprofiler/pull/512) Update all tools to the latest version and include nf-test (updated by @LilyAnderssonLee & @jfy133) +- [#537](https://github.com/nf-core/taxprofiler/pull/537) Update the module `motus/merge` to the latest version (Updated by @sofstam & @LilyAnderssonLee) ### `Fixed`