From 2fcb40905b5b0bdcc59291587a8e12d8728d7af0 Mon Sep 17 00:00:00 2001 From: Carson J Miller Date: Mon, 29 Apr 2024 16:50:57 +0000 Subject: [PATCH 1/3] Only run CI when merging into master branch --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7fe753..4b7a98c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,8 +5,6 @@ on: release: types: [published] merge_group: - types: - - checks_requested branches: - master From ff79d97c6a9821ab671c5c2b118f72744cb7c911 Mon Sep 17 00:00:00 2001 From: Carson J Miller Date: Mon, 29 Apr 2024 16:52:52 +0000 Subject: [PATCH 2/3] Try to run CI only when PR into master branch --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b7a98c..3eee33a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,8 @@ name: nf-core CI on: pull_request: + branches: + - master release: types: [published] merge_group: From 3b9edfef3e80b8f6b4b4d8840cd89418df69eaef Mon Sep 17 00:00:00 2001 From: Carson J Miller Date: Mon, 29 Apr 2024 17:16:13 +0000 Subject: [PATCH 3/3] Fixed linting errors --- .nf-core.yml | 6 + modules.json | 9 +- .../dumpsoftwareversions/environment.yml | 7 + .../custom/dumpsoftwareversions/main.nf | 24 ++ .../custom/dumpsoftwareversions/meta.yml | 37 ++ .../templates/dumpsoftwareversions.py | 101 ++++++ .../dumpsoftwareversions/tests/main.nf.test | 43 +++ .../tests/main.nf.test.snap | 33 ++ .../dumpsoftwareversions/tests/tags.yml | 2 + .../metaphlan/makedb/metaphlan-makedb.diff | 333 ++++++++++++++++++ .../nf-core/metaphlan/makedb/tests/tags.yml | 2 +- .../metaphlan-mergemetaphlantables.diff | 264 ++++++++++++++ .../mergemetaphlantables/tests/tags.yml | 2 +- .../metaphlan/metaphlan-metaphlan.diff | 262 ++++++++++++++ .../metaphlan/metaphlan/tests/tags.yml | 2 +- nextflow_schema.json | 107 ++++++ 16 files changed, 1228 insertions(+), 6 deletions(-) create mode 100644 modules/nf-core/custom/dumpsoftwareversions/environment.yml create mode 100644 modules/nf-core/custom/dumpsoftwareversions/main.nf create mode 100644 modules/nf-core/custom/dumpsoftwareversions/meta.yml create mode 100755 modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py create mode 100644 modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test create mode 100644 modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap create mode 100644 modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml create mode 100644 modules/nf-core/metaphlan/makedb/metaphlan-makedb.diff create mode 100644 modules/nf-core/metaphlan/mergemetaphlantables/metaphlan-mergemetaphlantables.diff create mode 100644 modules/nf-core/metaphlan/metaphlan/metaphlan-metaphlan.diff diff --git a/.nf-core.yml b/.nf-core.yml index 5ed252b..5ae2ab9 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -1,5 +1,8 @@ lint: + actions_ci: false files_exist: + - conf/modules.config + - conf/test_full.config - CODE_OF_CONDUCT.md - assets/nf-core-biobakerymgx_logo_light.png - docs/images/nf-core-biobakerymgx_logo_light.png @@ -9,6 +12,9 @@ lint: - .github/workflows/awsfulltest.yml - conf/igenomes.config files_unchanged: + - .github/PULL_REQUEST_TEMPLATE.md + - .github/CONTRIBUTING.md + - .github/workflows/linting.yml - CODE_OF_CONDUCT.md - assets/nf-core-biobakerymgx_logo_light.png - docs/images/nf-core-biobakerymgx_logo_light.png diff --git a/modules.json b/modules.json index 3ae9b68..489b48e 100644 --- a/modules.json +++ b/modules.json @@ -23,17 +23,20 @@ "metaphlan/makedb": { "branch": "master", "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["modules"] + "installed_by": ["modules"], + "patch": "modules/nf-core/metaphlan/makedb/metaphlan-makedb.diff" }, "metaphlan/mergemetaphlantables": { "branch": "master", "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["modules"] + "installed_by": ["modules"], + "patch": "modules/nf-core/metaphlan/mergemetaphlantables/metaphlan-mergemetaphlantables.diff" }, "metaphlan/metaphlan": { "branch": "master", "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["modules"] + "installed_by": ["modules"], + "patch": "modules/nf-core/metaphlan/metaphlan/metaphlan-metaphlan.diff" }, "multiqc": { "branch": "master", diff --git a/modules/nf-core/custom/dumpsoftwareversions/environment.yml b/modules/nf-core/custom/dumpsoftwareversions/environment.yml new file mode 100644 index 0000000..9b3272b --- /dev/null +++ b/modules/nf-core/custom/dumpsoftwareversions/environment.yml @@ -0,0 +1,7 @@ +name: custom_dumpsoftwareversions +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::multiqc=1.19 diff --git a/modules/nf-core/custom/dumpsoftwareversions/main.nf b/modules/nf-core/custom/dumpsoftwareversions/main.nf new file mode 100644 index 0000000..f218761 --- /dev/null +++ b/modules/nf-core/custom/dumpsoftwareversions/main.nf @@ -0,0 +1,24 @@ +process CUSTOM_DUMPSOFTWAREVERSIONS { + label 'process_single' + + // Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/multiqc:1.19--pyhdfd78af_0' : + 'biocontainers/multiqc:1.19--pyhdfd78af_0' }" + + input: + path versions + + output: + path "software_versions.yml" , emit: yml + path "software_versions_mqc.yml", emit: mqc_yml + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + template 'dumpsoftwareversions.py' +} diff --git a/modules/nf-core/custom/dumpsoftwareversions/meta.yml b/modules/nf-core/custom/dumpsoftwareversions/meta.yml new file mode 100644 index 0000000..5f15a5f --- /dev/null +++ b/modules/nf-core/custom/dumpsoftwareversions/meta.yml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: custom_dumpsoftwareversions +description: Custom module used to dump software versions within the nf-core pipeline template +keywords: + - custom + - dump + - version +tools: + - custom: + description: Custom module used to dump software versions within the nf-core pipeline template + homepage: https://github.com/nf-core/tools + documentation: https://github.com/nf-core/tools + licence: ["MIT"] +input: + - versions: + type: file + description: YML file containing software versions + pattern: "*.yml" +output: + - yml: + type: file + description: Standard YML file containing software versions + pattern: "software_versions.yml" + - mqc_yml: + type: file + description: MultiQC custom content YML file containing software versions + pattern: "software_versions_mqc.yml" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@drpatelh" + - "@grst" +maintainers: + - "@drpatelh" + - "@grst" diff --git a/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py b/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py new file mode 100755 index 0000000..da03340 --- /dev/null +++ b/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python + + +"""Provide functions to merge multiple versions.yml files.""" + + +import yaml +import platform +from textwrap import dedent + + +def _make_versions_html(versions): + """Generate a tabular HTML output of all versions for MultiQC.""" + html = [ + dedent( + """\\ + + + + + + + + + + """ + ) + ] + for process, tmp_versions in sorted(versions.items()): + html.append("") + for i, (tool, version) in enumerate(sorted(tmp_versions.items())): + html.append( + dedent( + f"""\\ + + + + + + """ + ) + ) + html.append("") + html.append("
Process Name Software Version
{process if (i == 0) else ''}{tool}{version}
") + return "\\n".join(html) + + +def main(): + """Load all version files and generate merged output.""" + versions_this_module = {} + versions_this_module["${task.process}"] = { + "python": platform.python_version(), + "yaml": yaml.__version__, + } + + with open("$versions") as f: + versions_by_process = yaml.load(f, Loader=yaml.BaseLoader) | versions_this_module + + # aggregate versions by the module name (derived from fully-qualified process name) + versions_by_module = {} + for process, process_versions in versions_by_process.items(): + module = process.split(":")[-1] + try: + if versions_by_module[module] != process_versions: + raise AssertionError( + "We assume that software versions are the same between all modules. " + "If you see this error-message it means you discovered an edge-case " + "and should open an issue in nf-core/tools. " + ) + except KeyError: + versions_by_module[module] = process_versions + + versions_by_module["Workflow"] = { + "Nextflow": "$workflow.nextflow.version", + "$workflow.manifest.name": "$workflow.manifest.version", + } + + versions_mqc = { + "id": "software_versions", + "section_name": "${workflow.manifest.name} Software Versions", + "section_href": "https://github.com/${workflow.manifest.name}", + "plot_type": "html", + "description": "are collected at run time from the software output.", + "data": _make_versions_html(versions_by_module), + } + + with open("software_versions.yml", "w") as f: + yaml.dump(versions_by_module, f, default_flow_style=False) + with open("software_versions_mqc.yml", "w") as f: + yaml.dump(versions_mqc, f, default_flow_style=False) + + with open("versions.yml", "w") as f: + yaml.dump(versions_this_module, f, default_flow_style=False) + + +if __name__ == "__main__": + main() diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test new file mode 100644 index 0000000..b1e1630 --- /dev/null +++ b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test @@ -0,0 +1,43 @@ +nextflow_process { + + name "Test Process CUSTOM_DUMPSOFTWAREVERSIONS" + script "../main.nf" + process "CUSTOM_DUMPSOFTWAREVERSIONS" + tag "modules" + tag "modules_nfcore" + tag "custom" + tag "dumpsoftwareversions" + tag "custom/dumpsoftwareversions" + + test("Should run without failures") { + when { + process { + """ + def tool1_version = ''' + TOOL1: + tool1: 0.11.9 + '''.stripIndent() + + def tool2_version = ''' + TOOL2: + tool2: 1.9 + '''.stripIndent() + + input[0] = Channel.of(tool1_version, tool2_version).collectFile() + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.versions, + file(process.out.mqc_yml[0]).readLines()[0..10], + file(process.out.yml[0]).readLines()[0..7] + ).match() + } + ) + } + } +} diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap new file mode 100644 index 0000000..5f59a93 --- /dev/null +++ b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap @@ -0,0 +1,33 @@ +{ + "Should run without failures": { + "content": [ + [ + "versions.yml:md5,76d454d92244589d32455833f7c1ba6d" + ], + [ + "data: \"\\n\\n \\n \\n \\n \\n \\n \\n \\n\\", + " \\n\\n\\n \\n \\n\\", + " \\ \\n\\n\\n\\n \\n \\", + " \\ \\n \\n\\n\\n\\n\\", + " \\n\\n \\n \\n\\", + " \\ \\n\\n\\n\\n\\n\\n \\n\\", + " \\ \\n \\n\\n\\n\\n\\", + " \\n\\n \\n \\n\\" + ], + [ + "CUSTOM_DUMPSOFTWAREVERSIONS:", + " python: 3.11.7", + " yaml: 5.4.1", + "TOOL1:", + " tool1: 0.11.9", + "TOOL2:", + " tool2: '1.9'", + "Workflow:" + ] + ], + "timestamp": "2024-01-09T23:01:18.710682" + } +} \ No newline at end of file diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml b/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml new file mode 100644 index 0000000..405aa24 --- /dev/null +++ b/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml @@ -0,0 +1,2 @@ +custom/dumpsoftwareversions: + - modules/nf-core/custom/dumpsoftwareversions/** diff --git a/modules/nf-core/metaphlan/makedb/metaphlan-makedb.diff b/modules/nf-core/metaphlan/makedb/metaphlan-makedb.diff new file mode 100644 index 0000000..75d7787 --- /dev/null +++ b/modules/nf-core/metaphlan/makedb/metaphlan-makedb.diff @@ -0,0 +1,333 @@ +Changes in module 'nf-core/metaphlan/makedb' +--- modules/nf-core/metaphlan/makedb/main.nf ++++ modules/nf-core/metaphlan/makedb/main.nf +@@ -1,26 +1,31 @@ + process METAPHLAN_MAKEDB { ++ tag "${metaphlan_db_version}" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? +- 'https://depot.galaxyproject.org/singularity/metaphlan:4.0.6--pyhca03a8a_0' : +- 'biocontainers/metaphlan:4.0.6--pyhca03a8a_0' }" ++ 'https://depot.galaxyproject.org/singularity/metaphlan:4.1.0--pyhca03a8a_0' : ++ 'biocontainers/metaphlan:4.1.0--pyhca03a8a_0' }" ++ ++ input: ++ val metaphlan_db_version + + output: +- path "metaphlan_db_latest" , emit: db +- path "versions.yml" , emit: versions ++ path "${metaphlan_db_version}" , emit: db ++ path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' +- + """ ++ https_proxy=http://klone-dip1-A-ib:3128 ++ export https_proxy + metaphlan \\ + --install \\ +- --nproc $task.cpus \\ +- --bowtie2db metaphlan_db_latest \\ ++ --index ${metaphlan_db_version} \\ ++ --bowtie2db ${metaphlan_db_version} \\ + $args + + cat <<-END_VERSIONS > versions.yml +@@ -30,18 +35,17 @@ + """ + stub: + """ +- mkdir metaphlan_db_latest +- touch metaphlan_db_latest/mpa_latest +- touch metaphlan_db_latest/mpa_v31_CHOCOPhlAn_201901.1.bt2 +- touch metaphlan_db_latest/mpa_v31_CHOCOPhlAn_201901.2.bt2 +- touch metaphlan_db_latest/mpa_v31_CHOCOPhlAn_201901.3.bt2 +- touch metaphlan_db_latest/mpa_v31_CHOCOPhlAn_201901.4.bt2 +- touch metaphlan_db_latest/mpa_v31_CHOCOPhlAn_201901.fna.bz2 +- touch metaphlan_db_latest/mpa_v31_CHOCOPhlAn_201901.md5 +- touch metaphlan_db_latest/mpa_v31_CHOCOPhlAn_201901.pkl +- touch metaphlan_db_latest/mpa_v31_CHOCOPhlAn_201901.rev.1.bt2 +- touch metaphlan_db_latest/mpa_v31_CHOCOPhlAn_201901.rev.2.bt2 +- touch metaphlan_db_latest/mpa_v31_CHOCOPhlAn_201901.tar ++ mkdir ${metaphlan_db_version} ++ touch ${metaphlan_db_version}/${metaphlan_db_version}.1.bt2l ++ touch ${metaphlan_db_version}/${metaphlan_db_version}.2.bt2l ++ touch ${metaphlan_db_version}/${metaphlan_db_version}.3.bt2l ++ touch ${metaphlan_db_version}/${metaphlan_db_version}.4.bt2l ++ touch ${metaphlan_db_version}/${metaphlan_db_version}.fna.bz2 ++ touch ${metaphlan_db_version}/${metaphlan_db_version}.pkl ++ touch ${metaphlan_db_version}/${metaphlan_db_version}.rev.1.bt2l ++ touch ${metaphlan_db_version}/${metaphlan_db_version}.rev.2.bt2l ++ touch ${metaphlan_db_version}/${metaphlan_db_version}_VINFO.csv ++ touch ${metaphlan_db_version}/${metaphlan_db_version}_VSG.fna + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + +--- /dev/null ++++ modules/nf-core/metaphlan/makedb/nextflow.config +@@ -0,0 +1,10 @@ ++process { ++ withName: METAPHLAN_MAKEDB { ++ publishDir = [ ++ enabled: params.metaphlan_save_db, ++ path: { "${params.outdir}/ReadTaxonomy/metaphlan/makedb" }, ++ mode: params.publish_dir_mode, ++ pattern: '*/' ++ ] ++ } ++} + +--- /dev/null ++++ modules/nf-core/metaphlan/makedb/tests/main.nf.test +@@ -0,0 +1,50 @@ ++nextflow_process { ++ ++ name "Test Process: METAPHLAN_MAKEDB" ++ script "../main.nf" ++ process "METAPHLAN_MAKEDB" ++ ++ tag "modules" ++ tag "modules_local" ++ tag "metaphlan" ++ tag "metaphlan/makedb" ++ ++ ++ test("'mpa_vJan21_TOY_CHOCOPhlAnSGB_202103'") { ++ ++ when { ++ process { ++ """ ++ input[0] = 'mpa_vJan21_TOY_CHOCOPhlAnSGB_202103' ++ """ ++ } ++ } ++ ++ then { ++ assertAll ( ++ { assert process.success }, ++ { assert snapshot(process.out).match() } ++ ) ++ } ++ } ++ ++ test("'mpa_vJan21_TOY_CHOCOPhlAnSGB_202103' -stub ") { ++ ++ options "-stub" ++ ++ when { ++ process { ++ """ ++ input[0] = 'mpa_vJan21_TOY_CHOCOPhlAnSGB_202103' ++ """ ++ } ++ } ++ ++ then { ++ assertAll ( ++ { assert process.success }, ++ { assert snapshot(process.out).match() } ++ ) ++ } ++ } ++} + +--- /dev/null ++++ modules/nf-core/metaphlan/makedb/tests/main.nf.test.snap +@@ -0,0 +1,182 @@ ++{ ++ "'mpa_vJan21_TOY_CHOCOPhlAnSGB_202103' -stub ": { ++ "content": [ ++ { ++ "0": [ ++ [ ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.1.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.2.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.3.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.4.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.fna.bz2:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.pkl:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.1.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.2.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VINFO.csv:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VSG.fna:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "1": [ ++ "versions.yml:md5,980dacf75dc62bb712c40ef951f16500" ++ ], ++ "db": [ ++ [ ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.1.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.2.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.3.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.4.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.fna.bz2:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.pkl:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.1.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.2.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VINFO.csv:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VSG.fna:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions": [ ++ "versions.yml:md5,980dacf75dc62bb712c40ef951f16500" ++ ] ++ } ++ ], ++ "meta": { ++ "nf-test": "0.8.4", ++ "nextflow": "23.10.1" ++ }, ++ "timestamp": "2024-04-24T10:14:02.055529409" ++ }, ++ " metaphlan_db_version = 'mpa_vJan21_TOY_CHOCOPhlAnSGB_202103' ": { ++ "content": [ ++ { ++ "0": [ ++ [ ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.1.bt2l:md5,f560f1878d407cad746b40e19c137b2f", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.2.bt2l:md5,ada1fa4dbfa0bbd00fd9541458d0caab", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.3.bt2l:md5,1b5ec794c2f0c456ea60deb5898f4840", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.4.bt2l:md5,fe7bbac658aece93db332255910e3f4f", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.fna.bz2:md5,43dd63a3263c01105af26b701a9b5562", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.pkl:md5,005453b7c66c85f3e01218653d09e266", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.1.bt2l:md5,7b23ad55748937a1b21f8ed735fe0d73", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.2.bt2l:md5,acc38a28f2e590d5ce12a9defe4c8c87", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VINFO.csv:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VSG.fna:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "1": [ ++ "versions.yml:md5,51519311626c56287ac98fc54452f503" ++ ], ++ "db": [ ++ [ ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.1.bt2l:md5,f560f1878d407cad746b40e19c137b2f", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.2.bt2l:md5,ada1fa4dbfa0bbd00fd9541458d0caab", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.3.bt2l:md5,1b5ec794c2f0c456ea60deb5898f4840", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.4.bt2l:md5,fe7bbac658aece93db332255910e3f4f", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.fna.bz2:md5,43dd63a3263c01105af26b701a9b5562", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.pkl:md5,005453b7c66c85f3e01218653d09e266", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.1.bt2l:md5,7b23ad55748937a1b21f8ed735fe0d73", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.2.bt2l:md5,acc38a28f2e590d5ce12a9defe4c8c87", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VINFO.csv:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VSG.fna:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions": [ ++ "versions.yml:md5,51519311626c56287ac98fc54452f503" ++ ] ++ } ++ ], ++ "meta": { ++ "nf-test": "0.8.4", ++ "nextflow": "23.10.1" ++ }, ++ "timestamp": "2024-01-23T13:44:29.208314843" ++ }, ++ "'mpa_vJan21_TOY_CHOCOPhlAnSGB_202103'": { ++ "content": [ ++ { ++ "0": [ ++ [ ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.1.bt2l:md5,f560f1878d407cad746b40e19c137b2f", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.2.bt2l:md5,ada1fa4dbfa0bbd00fd9541458d0caab", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.3.bt2l:md5,1b5ec794c2f0c456ea60deb5898f4840", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.4.bt2l:md5,fe7bbac658aece93db332255910e3f4f", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.fna.bz2:md5,43dd63a3263c01105af26b701a9b5562", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.pkl:md5,005453b7c66c85f3e01218653d09e266", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.1.bt2l:md5,7b23ad55748937a1b21f8ed735fe0d73", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.2.bt2l:md5,acc38a28f2e590d5ce12a9defe4c8c87", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VINFO.csv:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VSG.fna:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "1": [ ++ "versions.yml:md5,980dacf75dc62bb712c40ef951f16500" ++ ], ++ "db": [ ++ [ ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.1.bt2l:md5,f560f1878d407cad746b40e19c137b2f", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.2.bt2l:md5,ada1fa4dbfa0bbd00fd9541458d0caab", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.3.bt2l:md5,1b5ec794c2f0c456ea60deb5898f4840", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.4.bt2l:md5,fe7bbac658aece93db332255910e3f4f", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.fna.bz2:md5,43dd63a3263c01105af26b701a9b5562", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.pkl:md5,005453b7c66c85f3e01218653d09e266", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.1.bt2l:md5,7b23ad55748937a1b21f8ed735fe0d73", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.2.bt2l:md5,acc38a28f2e590d5ce12a9defe4c8c87", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VINFO.csv:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VSG.fna:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions": [ ++ "versions.yml:md5,980dacf75dc62bb712c40ef951f16500" ++ ] ++ } ++ ], ++ "meta": { ++ "nf-test": "0.8.4", ++ "nextflow": "23.10.1" ++ }, ++ "timestamp": "2024-04-24T10:13:48.493592433" ++ }, ++ " metaphlan_db_version = 'mpa_vJan21_TOY_CHOCOPhlAnSGB_202103' -stub ": { ++ "content": [ ++ { ++ "0": [ ++ [ ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.1.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.2.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.3.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.4.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.fna.bz2:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.pkl:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.1.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.2.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VINFO.csv:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VSG.fna:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "1": [ ++ "versions.yml:md5,51519311626c56287ac98fc54452f503" ++ ], ++ "db": [ ++ [ ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.1.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.2.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.3.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.4.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.fna.bz2:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.pkl:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.1.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103.rev.2.bt2l:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VINFO.csv:md5,d41d8cd98f00b204e9800998ecf8427e", ++ "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103_VSG.fna:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions": [ ++ "versions.yml:md5,51519311626c56287ac98fc54452f503" ++ ] ++ } ++ ], ++ "meta": { ++ "nf-test": "0.8.4", ++ "nextflow": "23.10.1" ++ }, ++ "timestamp": "2024-01-23T13:44:42.591897954" ++ } ++} +--- /dev/null ++++ modules/nf-core/metaphlan/makedb/tests/tags.yml +@@ -0,0 +1,2 @@ ++metaphlan/makedb: ++ - modules/local/metaphlan/makedb/** + +************************************************************ diff --git a/modules/nf-core/metaphlan/makedb/tests/tags.yml b/modules/nf-core/metaphlan/makedb/tests/tags.yml index ed9dfe8..b2d05bf 100644 --- a/modules/nf-core/metaphlan/makedb/tests/tags.yml +++ b/modules/nf-core/metaphlan/makedb/tests/tags.yml @@ -1,2 +1,2 @@ metaphlan/makedb: - - modules/local/metaphlan/makedb/** \ No newline at end of file + - modules/local/metaphlan/makedb/** diff --git a/modules/nf-core/metaphlan/mergemetaphlantables/metaphlan-mergemetaphlantables.diff b/modules/nf-core/metaphlan/mergemetaphlantables/metaphlan-mergemetaphlantables.diff new file mode 100644 index 0000000..cedbf04 --- /dev/null +++ b/modules/nf-core/metaphlan/mergemetaphlantables/metaphlan-mergemetaphlantables.diff @@ -0,0 +1,264 @@ +Changes in module 'nf-core/metaphlan/mergemetaphlantables' +--- modules/nf-core/metaphlan/mergemetaphlantables/main.nf ++++ modules/nf-core/metaphlan/mergemetaphlantables/main.nf +@@ -3,8 +3,8 @@ + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? +- 'https://depot.galaxyproject.org/singularity/metaphlan:4.0.6--pyhca03a8a_0' : +- 'biocontainers/metaphlan:4.0.6--pyhca03a8a_0' }" ++ 'https://depot.galaxyproject.org/singularity/metaphlan:4.1.0--pyhca03a8a_0' : ++ 'biocontainers/metaphlan:4.1.0--pyhca03a8a_0' }" + + input: + tuple val(meta), path(profiles) +@@ -30,4 +30,16 @@ + metaphlan: \$(metaphlan --version 2>&1 | awk '{print \$3}') + END_VERSIONS + """ ++ ++ stub: ++ def args = task.ext.args ?: '' ++ prefix = task.ext.prefix ?: "${meta.id}" ++ """ ++ touch ${prefix}.txt ++ ++ cat <<-END_VERSIONS > versions.yml ++ "${task.process}": ++ metaphlan: \$(metaphlan --version 2>&1 | awk '{print \$3}') ++ END_VERSIONS ++ """ + } + +--- /dev/null ++++ modules/nf-core/metaphlan/mergemetaphlantables/nextflow.config +@@ -0,0 +1,9 @@ ++process { ++ withName: METAPHLAN_MERGEMETAPHLANTABLES { ++ publishDir = [ ++ path: { "${params.outdir}/ReadTaxonomy/metaphlan/mergemetaphlantables" }, ++ mode: params.publish_dir_mode, ++ pattern: '*.txt' ++ ] ++ } ++} +--- /dev/null ++++ modules/nf-core/metaphlan/mergemetaphlantables/tests/main.nf.test +@@ -0,0 +1,72 @@ ++nextflow_process { ++ ++ name "Test Process: METAPHLAN_MERGEMETAPHLANTABLES" ++ script "../main.nf" ++ process "METAPHLAN_MERGEMETAPHLANTABLES" ++ ++ tag "modules" ++ tag "modules_local" ++ tag "metaphlan" ++ tag "metaphlan/mergemetaphlantables" ++ ++ ++ test(" metaphlan_sgb_profile ") { ++ ++ when { ++ process { ++ """ ++ input[0] = Channel.of( ++ [ ++ [ id: 'test' ], ++ file( "$projectDir/assets/test-datasets/metaphlan/metaphlan_sgb_profile1.txt", checkifExists: true) ++ ], ++ [ ++ [ id: 'test2' ], ++ file( "$projectDir/assets/test-datasets/metaphlan/metaphlan_sgb_profile2.txt", checkifExists: true) ++ ] ++ ) ++ .map { [ [ id:'all_samples' ], it[1] ] } ++ .groupTuple( sort: 'deep' ) ++ """ ++ } ++ } ++ ++ then { ++ assertAll ( ++ { assert process.success }, ++ { assert snapshot(process.out).match() } ++ ) ++ } ++ } ++ ++ test(" metaphlan_sgb_profile -stub ") { ++ ++ options "-stub" ++ ++ when { ++ process { ++ """ ++ input[0] = Channel.of( ++ [ ++ [ id: 'test' ], ++ file( "$projectDir/assets/test-datasets/metaphlan/metaphlan_sgb_profile1.txt", checkifExists: true) ++ ], ++ [ ++ [ id: 'test2' ], ++ file( "$projectDir/assets/test-datasets/metaphlan/metaphlan_sgb_profile2.txt", checkifExists: true) ++ ] ++ ) ++ .map { [ [ id:'all_samples' ], it[1] ] } ++ .groupTuple( sort: 'deep' ) ++ """ ++ } ++ } ++ ++ then { ++ assertAll ( ++ { assert process.success }, ++ { assert snapshot(process.out).match() } ++ ) ++ } ++ } ++} + +--- /dev/null ++++ modules/nf-core/metaphlan/mergemetaphlantables/tests/main.nf.test.snap +@@ -0,0 +1,134 @@ ++{ ++ " metaphlan_sgb_profile -stub ": { ++ "content": [ ++ { ++ "0": [ ++ [ ++ { ++ "id": "all_samples" ++ }, ++ "all_samples.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "1": [ ++ "versions.yml:md5,40d6568d6a3dd3eed228bbc7ddbb8a9a" ++ ], ++ "txt": [ ++ [ ++ { ++ "id": "all_samples" ++ }, ++ "all_samples.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions": [ ++ "versions.yml:md5,40d6568d6a3dd3eed228bbc7ddbb8a9a" ++ ] ++ } ++ ], ++ "meta": { ++ "nf-test": "0.8.4", ++ "nextflow": "23.10.1" ++ }, ++ "timestamp": "2024-04-24T10:02:52.20700281" ++ }, ++ " ['assets']['metaphlan']['metaphlan_sgb_profile1_txt'] ": { ++ "content": [ ++ { ++ "0": [ ++ [ ++ { ++ "id": "all_samples" ++ }, ++ "all_samples.txt:md5,f4627b6001fe6dbde372f0a648f574c2" ++ ] ++ ], ++ "1": [ ++ "versions.yml:md5,36d4842de5dd44b8b642cbfbbc6b4aff" ++ ], ++ "txt": [ ++ [ ++ { ++ "id": "all_samples" ++ }, ++ "all_samples.txt:md5,f4627b6001fe6dbde372f0a648f574c2" ++ ] ++ ], ++ "versions": [ ++ "versions.yml:md5,36d4842de5dd44b8b642cbfbbc6b4aff" ++ ] ++ } ++ ], ++ "meta": { ++ "nf-test": "0.8.4", ++ "nextflow": "23.10.1" ++ }, ++ "timestamp": "2024-01-26T08:14:43.460606117" ++ }, ++ " metaphlan_sgb_profile ": { ++ "content": [ ++ { ++ "0": [ ++ [ ++ { ++ "id": "all_samples" ++ }, ++ "all_samples.txt:md5,f4627b6001fe6dbde372f0a648f574c2" ++ ] ++ ], ++ "1": [ ++ "versions.yml:md5,40d6568d6a3dd3eed228bbc7ddbb8a9a" ++ ], ++ "txt": [ ++ [ ++ { ++ "id": "all_samples" ++ }, ++ "all_samples.txt:md5,f4627b6001fe6dbde372f0a648f574c2" ++ ] ++ ], ++ "versions": [ ++ "versions.yml:md5,40d6568d6a3dd3eed228bbc7ddbb8a9a" ++ ] ++ } ++ ], ++ "meta": { ++ "nf-test": "0.8.4", ++ "nextflow": "23.10.1" ++ }, ++ "timestamp": "2024-04-24T10:02:41.196855948" ++ }, ++ " ['assets']['metaphlan']['metaphlan_sgb_profile1_txt'] -stub ": { ++ "content": [ ++ { ++ "0": [ ++ [ ++ { ++ "id": "all_samples" ++ }, ++ "all_samples.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "1": [ ++ "versions.yml:md5,36d4842de5dd44b8b642cbfbbc6b4aff" ++ ], ++ "txt": [ ++ [ ++ { ++ "id": "all_samples" ++ }, ++ "all_samples.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions": [ ++ "versions.yml:md5,36d4842de5dd44b8b642cbfbbc6b4aff" ++ ] ++ } ++ ], ++ "meta": { ++ "nf-test": "0.8.4", ++ "nextflow": "23.10.1" ++ }, ++ "timestamp": "2024-01-26T08:14:56.286600733" ++ } ++} +--- /dev/null ++++ modules/nf-core/metaphlan/mergemetaphlantables/tests/tags.yml +@@ -0,0 +1,2 @@ ++metaphlan/mergemetaphlantables: ++ - modules/local/metaphlan/mergemetaphlantables/** + +************************************************************ diff --git a/modules/nf-core/metaphlan/mergemetaphlantables/tests/tags.yml b/modules/nf-core/metaphlan/mergemetaphlantables/tests/tags.yml index 7d886ee..1f8bd58 100644 --- a/modules/nf-core/metaphlan/mergemetaphlantables/tests/tags.yml +++ b/modules/nf-core/metaphlan/mergemetaphlantables/tests/tags.yml @@ -1,2 +1,2 @@ metaphlan/mergemetaphlantables: - - modules/local/metaphlan/mergemetaphlantables/** \ No newline at end of file + - modules/local/metaphlan/mergemetaphlantables/** diff --git a/modules/nf-core/metaphlan/metaphlan/metaphlan-metaphlan.diff b/modules/nf-core/metaphlan/metaphlan/metaphlan-metaphlan.diff new file mode 100644 index 0000000..2695ea7 --- /dev/null +++ b/modules/nf-core/metaphlan/metaphlan/metaphlan-metaphlan.diff @@ -0,0 +1,262 @@ +Changes in module 'nf-core/metaphlan/metaphlan' +--- modules/nf-core/metaphlan/metaphlan/main.nf ++++ modules/nf-core/metaphlan/metaphlan/main.nf +@@ -4,12 +4,12 @@ + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? +- 'https://depot.galaxyproject.org/singularity/metaphlan:4.0.6--pyhca03a8a_0' : +- 'biocontainers/metaphlan:4.0.6--pyhca03a8a_0' }" ++ 'https://depot.galaxyproject.org/singularity/metaphlan:4.1.0--pyhca03a8a_0' : ++ 'biocontainers/metaphlan:4.1.0--pyhca03a8a_0' }" + + input: + tuple val(meta), path(input) +- path metaphlan_db_latest ++ path metaphlan_db + + output: + tuple val(meta), path("*_profile.txt") , emit: profile +@@ -28,8 +28,8 @@ + def bowtie2_out = "$input_type" == "--input_type bowtie2out" || "$input_type" == "--input_type sam" ? '' : "--bowtie2out ${prefix}.bowtie2out.txt" + + """ +- BT2_DB=`find -L "${metaphlan_db_latest}" -name "*rev.1.bt2*" -exec dirname {} \\;` +- BT2_DB_INDEX=`find -L ${metaphlan_db_latest} -name "*.rev.1.bt2*" | sed 's/\\.rev.1.bt2.*\$//' | sed 's/.*\\///'` ++ BT2_DB=`find -L "${metaphlan_db}" -name "*rev.1.bt2*" -exec dirname {} \\;` ++ BT2_DB_INDEX=`find -L ${metaphlan_db} -name "*.rev.1.bt2*" | sed 's/\\.rev.1.bt2.*\$//' | sed 's/.*\\///'` + + metaphlan \\ + --nproc $task.cpus \\ +@@ -47,4 +47,22 @@ + metaphlan: \$(metaphlan --version 2>&1 | awk '{print \$3}') + END_VERSIONS + """ ++ ++ stub: ++ def args = task.ext.args ?: '' ++ def prefix = task.ext.prefix ?: "${meta.id}" ++ def input_type = "$input" =~ /.*\.(fastq|fq)/ ? "--input_type fastq" : "$input" =~ /.*\.(fasta|fna|fa)/ ? "--input_type fasta" : "$input".endsWith(".bowtie2out.txt") ? "--input_type bowtie2out" : "--input_type sam" ++ def input_data = ("$input_type".contains("fastq")) && !meta.single_end ? "${input[0]},${input[1]}" : "$input" ++ def bowtie2_out = "$input_type" == "--input_type bowtie2out" || "$input_type" == "--input_type sam" ? '' : "--bowtie2out ${prefix}.bowtie2out.txt" ++ ++ """ ++ touch ${prefix}_profile.txt ++ touch ${prefix}.biom ++ touch ${prefix}.bowtie2out.txt ++ ++ cat <<-END_VERSIONS > versions.yml ++ "${task.process}": ++ metaphlan: \$(metaphlan --version 2>&1 | awk '{print \$3}') ++ END_VERSIONS ++ """ + } + +--- /dev/null ++++ modules/nf-core/metaphlan/metaphlan/nextflow.config +@@ -0,0 +1,10 @@ ++process { ++ withName: METAPHLAN_METAPHLAN { ++ publishDir = [ ++ path: { "${params.outdir}/ReadTaxonomy/metaphlan/metaphlan" }, ++ mode: params.publish_dir_mode, ++ pattern: '*_profile.txt' ++ ] ++ ext.args = params.metaphlan_options ? params.metaphlan_options : "" ++ } ++} + +--- /dev/null ++++ modules/nf-core/metaphlan/metaphlan/tests/main.nf.test +@@ -0,0 +1,85 @@ ++nextflow_process { ++ ++ name "Test Process: METAPHLAN_METAPHLAN" ++ script "../main.nf" ++ process "METAPHLAN_METAPHLAN" ++ ++ tag "modules" ++ tag "modules_local" ++ tag "metaphlan" ++ tag "metaphlan/makedb" ++ tag "metaphlan/metaphlan" ++ ++ setup { ++ run("METAPHLAN_MAKEDB") { ++ script "../../makedb/main.nf" ++ process { ++ """ ++ input[0] = "mpa_vJan21_TOY_CHOCOPhlAnSGB_202103" ++ """ ++ } ++ } ++ } ++ ++ ++ test("fastq.gz + metaphlan_db") { ++ ++ when { ++ process { ++ """ ++ input[0] = Channel.of( ++ [ ++ [ id: 'test' ], ++ [ ++ file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz", checkIfExists: true), ++ file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_2.fastq.gz", checkIfExists: true) ++ ] ++ ] ++ ) ++ input[1] = METAPHLAN_MAKEDB.out.db ++ """ ++ } ++ } ++ ++ then { ++ assertAll ( ++ { assert process.success }, ++ { assert snapshot( ++ process.out.profile, ++ process.out.bt2out, ++ process.out.versions ++ ).match() }, ++ { assert process.out.biom != null } ++ ) ++ } ++ } ++ ++ test("fastq.gz + metaphlan_db -stub ") { ++ ++ options "-stub" ++ ++ when { ++ process { ++ """ ++ input[0] = Channel.of( ++ [ ++ [ id: 'test' ], ++ [ ++ file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz", checkIfExists: true), ++ file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_2.fastq.gz", checkIfExists: true) ++ ] ++ ] ++ ) ++ input[1] = METAPHLAN_MAKEDB.out.db ++ """ ++ } ++ } ++ ++ then { ++ assertAll ( ++ { assert process.success }, ++ { assert snapshot(process.out).match() } ++ ) ++ } ++ } ++} + +--- /dev/null ++++ modules/nf-core/metaphlan/metaphlan/tests/main.nf.test.snap +@@ -0,0 +1,95 @@ ++{ ++ "fastq.gz + metaphlan_db -stub ": { ++ "content": [ ++ { ++ "0": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test_profile.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "1": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.biom:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "2": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.bowtie2out.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "3": [ ++ "versions.yml:md5,2a9ed777cd0065f872877f20553df297" ++ ], ++ "biom": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.biom:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "bt2out": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.bowtie2out.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "profile": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test_profile.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions": [ ++ "versions.yml:md5,2a9ed777cd0065f872877f20553df297" ++ ] ++ } ++ ], ++ "meta": { ++ "nf-test": "0.8.4", ++ "nextflow": "23.10.1" ++ }, ++ "timestamp": "2024-04-24T14:49:25.110256152" ++ }, ++ "fastq.gz + metaphlan_db": { ++ "content": [ ++ [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test_profile.txt:md5,33142bd652b3a5c4a7762f91515a802a" ++ ] ++ ], ++ [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.bowtie2out.txt:md5,9bf563c43769e8300be64a8bf1a03c71" ++ ] ++ ], ++ [ ++ "versions.yml:md5,2a9ed777cd0065f872877f20553df297" ++ ] ++ ], ++ "meta": { ++ "nf-test": "0.8.4", ++ "nextflow": "23.10.1" ++ }, ++ "timestamp": "2024-04-24T14:48:47.602042185" ++ } ++} +--- /dev/null ++++ modules/nf-core/metaphlan/metaphlan/tests/tags.yml +@@ -0,0 +1,2 @@ ++metaphlan/metaphlan: ++ - modules/local/metaphlan/metaphlan/** + +************************************************************ diff --git a/modules/nf-core/metaphlan/metaphlan/tests/tags.yml b/modules/nf-core/metaphlan/metaphlan/tests/tags.yml index 24c473a..ce3251b 100644 --- a/modules/nf-core/metaphlan/metaphlan/tests/tags.yml +++ b/modules/nf-core/metaphlan/metaphlan/tests/tags.yml @@ -1,2 +1,2 @@ metaphlan/metaphlan: - - modules/local/metaphlan/metaphlan/** \ No newline at end of file + - modules/local/metaphlan/metaphlan/** diff --git a/nextflow_schema.json b/nextflow_schema.json index ca57b01..3c1e17c 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -43,6 +43,104 @@ } } }, + "read_preprocessing_options": { + "title": "Read preprocessing options", + "type": "object", + "description": "Parameters for raw read trimming and host contamination removal", + "default": "", + "properties": { + "run_runmerging": { + "type": "boolean", + "description": "Merge replicate read sets within samples" + }, + "run_kneaddata": { + "type": "boolean", + "description": "Run KneadData to preprocess raw reads?" + }, + "kneaddata_db": { + "type": "string", + "description": "Path to bowtie2 database for KneadData (will download if False)" + }, + "kneaddata_db_version": { + "type": "string", + "default": "human_genome", + "description": "Version of KneadData's database to download" + }, + "kneaddata_save_db": { + "type": "boolean", + "description": "Save KneadData's database after downloading?" + }, + "kneaddata_trimmomatic_path": { + "type": "string", + "default": "/usr/local/share/trimmomatic-0.39-2", + "description": "Path to trimmomatic when running KneadData" + }, + "kneaddata_options": { + "type": "string", + "description": "Additional KneadData argument" + } + } + }, + "read_based_taxonomy_options": { + "title": "Read-based taxonomy options", + "type": "object", + "description": "Parameters for taxonomically classifying reads with MetaPhlAn", + "default": "", + "properties": { + "run_metaphlan": { + "type": "boolean", + "description": "Run MetaPhlAn to taxonomically classify reads?" + }, + "metaphlan_db": { + "type": "string", + "description": "Path to pre-downloaded MetaPhlAn database" + }, + "metaphlan_db_version": { + "type": "string", + "description": "Version of MetaPhlAn's database to download" + }, + "metaphlan_save_db": { + "type": "boolean", + "description": "Save MetaPhlAn's database if it was downloaded?" + }, + "metaphlan_options": { + "type": "string", + "description": "Additiona MetaPhlAn options" + }, + "metaphlan_sgb2gtbd_file": { + "type": "string", + "default": "https://github.com/biobakery/MetaPhlAn/raw/master/metaphlan/utils/mpa_vOct22_CHOCOPhlAnSGB_202212_SGB2GTDB.tsv", + "description": "Path to MetaPhlAn's SGB2GTDB profile to convert to standard taxonomy" + } + } + }, + "read_based_functional_profiling": { + "title": "Read-based functional profiling", + "type": "object", + "description": "Parameters for assessing functional capacity with HUMAnN", + "default": "", + "properties": { + "run_humann": { + "type": "boolean", + "description": "Run HUMAnN to assess functional capacity of a metagenome?" + }, + "chocophlan_db_version": { + "type": "string", + "default": "DEMO", + "description": "ChocoPhlAn database version to download" + }, + "uniref_db_version": { + "type": "string", + "default": "DEMO_diamond", + "description": "UNIREF database version to download" + }, + "utility_mapping_version": { + "type": "string", + "default": "DEMO", + "description": "Utility mapping version to download" + } + } + }, "institutional_config_options": { "title": "Institutional config options", "type": "object", @@ -242,6 +340,15 @@ { "$ref": "#/definitions/input_output_options" }, + { + "$ref": "#/definitions/read_preprocessing_options" + }, + { + "$ref": "#/definitions/read_based_taxonomy_options" + }, + { + "$ref": "#/definitions/read_based_functional_profiling" + }, { "$ref": "#/definitions/institutional_config_options" },
Process Name \\", + " \\ Software Version
CUSTOM_DUMPSOFTWAREVERSIONSpython3.11.7
yaml5.4.1
TOOL1tool10.11.9
TOOL2tool21.9
WorkflowNextflow