From ab67a1d41b63bf52fd7c147f7f8f6e8d167590b5 Mon Sep 17 00:00:00 2001 From: Gregor Sturm Date: Fri, 24 Sep 2021 11:01:54 +0200 Subject: [PATCH 01/61] Update fastqc to produce multi-version versions.yml (#665) * Update fastqc to produce multi-version versions.yml * Update readme and pull request template * Fix markdownlint * remove variable * Change publish dir to lowercase * Re-add getSoftwareName * Add custom pytest-workflow test to ensure versions.yml is valid * Add docstring * Remove __init__.py as it is not needed * Remove changes to README, since this part went to nf-co.re * Add NF_CORE_TEST env var * Fix editorconfig * Add additional consistency checks for versions.yml * Update multiqc module * Fix output channel --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/pytest-workflow.yml | 2 +- .gitignore | 3 ++ modules/fastqc/functions.nf | 58 ++++++++++++++++----------- modules/fastqc/main.nf | 17 +++++--- modules/fastqc/meta.yml | 2 +- modules/multiqc/functions.nf | 58 ++++++++++++++++----------- modules/multiqc/main.nf | 10 +++-- modules/multiqc/meta.yml | 2 +- tests/test_versions_yml.py | 40 ++++++++++++++++++ 10 files changed, 134 insertions(+), 60 deletions(-) create mode 100644 tests/test_versions_yml.py diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 059133d6..b9f7a4e8 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -20,7 +20,7 @@ Closes #XXX - [ ] If you've added a new tool - have you followed the module conventions in the [contribution docs](https://github.com/nf-core/modules/tree/master/.github/CONTRIBUTING.md) - [ ] If necessary, include test data in your PR. - [ ] Remove all TODO statements. -- [ ] Emit the `.version.txt` file. +- [ ] Emit the `versions.yml` file. - [ ] Follow the naming conventions. - [ ] Follow the parameters requirements. - [ ] Follow the input/output options guidelines. diff --git a/.github/workflows/pytest-workflow.yml b/.github/workflows/pytest-workflow.yml index 43f48c36..9cd768a8 100644 --- a/.github/workflows/pytest-workflow.yml +++ b/.github/workflows/pytest-workflow.yml @@ -89,7 +89,7 @@ jobs: # Test the module - name: Run pytest-workflow # only use one thread for pytest-workflow to avoid race condition on conda cache. - run: TMPDIR=~ PROFILE=${{ matrix.profile }} pytest --tag ${{ matrix.tags }} --symlink --kwdof + run: NF_CORE_MODULES_TEST=1 TMPDIR=~ PROFILE=${{ matrix.profile }} pytest --tag ${{ matrix.tags }} --symlink --kwdof - name: Upload logs on failure if: failure() diff --git a/.gitignore b/.gitignore index 71b9b179..9d982e3f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,7 @@ output/ *.code-workspace .screenrc .*.sw? +__pycache__ +*.pyo +*.pyc tests/data/ diff --git a/modules/fastqc/functions.nf b/modules/fastqc/functions.nf index da9da093..85628ee0 100644 --- a/modules/fastqc/functions.nf +++ b/modules/fastqc/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/fastqc/main.nf b/modules/fastqc/main.nf index 39c327b2..88bfbf5b 100644 --- a/modules/fastqc/main.nf +++ b/modules/fastqc/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,24 +24,31 @@ process FASTQC { output: tuple val(meta), path("*.html"), emit: html tuple val(meta), path("*.zip") , emit: zip - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: // Add soft-links to original FastQs for consistent naming in pipeline - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { """ [ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz fastqc $options.args --threads $task.cpus ${prefix}.fastq.gz - fastqc --version | sed -e "s/FastQC v//g" > ${software}.version.txt + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + END_VERSIONS """ } else { """ [ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz [ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz fastqc $options.args --threads $task.cpus ${prefix}_1.fastq.gz ${prefix}_2.fastq.gz - fastqc --version | sed -e "s/FastQC v//g" > ${software}.version.txt + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + END_VERSIONS """ } } diff --git a/modules/fastqc/meta.yml b/modules/fastqc/meta.yml index 8eb9953d..48031356 100644 --- a/modules/fastqc/meta.yml +++ b/modules/fastqc/meta.yml @@ -43,7 +43,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@grst" diff --git a/modules/multiqc/functions.nf b/modules/multiqc/functions.nf index da9da093..85628ee0 100644 --- a/modules/multiqc/functions.nf +++ b/modules/multiqc/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/multiqc/main.nf b/modules/multiqc/main.nf index 8b6d6f0c..2e7ad932 100644 --- a/modules/multiqc/main.nf +++ b/modules/multiqc/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,12 +24,16 @@ process MULTIQC { path "*multiqc_report.html", emit: report path "*_data" , emit: data path "*_plots" , optional:true, emit: plots - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ multiqc -f $options.args . - multiqc --version | sed -e "s/multiqc, version //g" > ${software}.version.txt + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) + END_VERSIONS """ } diff --git a/modules/multiqc/meta.yml b/modules/multiqc/meta.yml index 532a8bb1..2d99ec0d 100644 --- a/modules/multiqc/meta.yml +++ b/modules/multiqc/meta.yml @@ -32,7 +32,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@abhi18av" - "@bunop" diff --git a/tests/test_versions_yml.py b/tests/test_versions_yml.py new file mode 100644 index 00000000..5d44c7a0 --- /dev/null +++ b/tests/test_versions_yml.py @@ -0,0 +1,40 @@ +from pathlib import Path +import pytest +import yaml +import re + + +def _get_workflow_names(): + """Get all names of all workflows which have a test.yml in the tests directory. + + To do so, recursively finds all test.yml files and parses their content. + """ + here = Path(__file__).parent.resolve() + pytest_workflow_files = here.glob("**/test.yml") + for f in pytest_workflow_files: + test_config = yaml.safe_load(f.read_text()) + for workflow in test_config: + yield workflow["name"] + + +@pytest.mark.workflow(*_get_workflow_names()) +def test_ensure_valid_version_yml(workflow_dir): + workflow_dir = Path(workflow_dir) + software_name = workflow_dir.name.split("_")[0].lower() + versions_yml = (workflow_dir / f"output/{software_name}/versions.yml").read_text() + + assert ( + "END_VERSIONS" not in versions_yml + ), "END_VERSIONS detected in versions.yml. END_VERSIONS being in the text is a sign of an ill-formatted HEREDOC" + + # Raises an exception if yaml is not valid + versions = yaml.safe_load(versions_yml) + try: + software_versions = versions[software_name.upper()] + except KeyError: + raise AssertionError("There is no entry `` in versions.yml. ") + assert len(software_versions), "There must be at least one version emitted." + for tool, version in software_versions.items(): + assert re.match( + r"^\d+.*", str(version) + ), f"Version number for {tool} must start with a number. " From 3d0b87358405df71fc4214e9e9700bca7728aab7 Mon Sep 17 00:00:00 2001 From: Gregor Sturm Date: Mon, 27 Sep 2021 08:03:30 +0200 Subject: [PATCH 02/61] Run CI only on pull-requests and on the master-branch. (#743) * Run CI only on pull-requests and on the master-branch. * also for the other workflows --- .github/workflows/code-linting.yml | 7 ++++++- .github/workflows/nf-core-linting.yml | 7 ++++++- .github/workflows/pytest-workflow.yml | 6 +++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code-linting.yml b/.github/workflows/code-linting.yml index f20e7a61..d15c4af6 100644 --- a/.github/workflows/code-linting.yml +++ b/.github/workflows/code-linting.yml @@ -1,5 +1,10 @@ name: Code Linting -on: [push, pull_request] +on: + push: + branches: [master] + pull_request: + branches: [master] + jobs: Markdown: diff --git a/.github/workflows/nf-core-linting.yml b/.github/workflows/nf-core-linting.yml index df5ba60d..263b36b3 100644 --- a/.github/workflows/nf-core-linting.yml +++ b/.github/workflows/nf-core-linting.yml @@ -1,7 +1,12 @@ name: nf-core linting # This workflow is triggered on pushes and PRs to the repository. # It runs the `nf-core lint` tests to ensure that the module code meets the nf-core guidelines -on: [push, pull_request] +on: + push: + branches: [master] + pull_request: + branches: [master] + jobs: changes: diff --git a/.github/workflows/pytest-workflow.yml b/.github/workflows/pytest-workflow.yml index 9cd768a8..7cbb2689 100644 --- a/.github/workflows/pytest-workflow.yml +++ b/.github/workflows/pytest-workflow.yml @@ -1,5 +1,9 @@ name: Pytest-workflow -on: [push, pull_request] +on: + push: + branches: [master] + pull_request: + branches: [master] jobs: changes: From d73a988ff7279a1873ee41c9526c09a66681f75d Mon Sep 17 00:00:00 2001 From: Gregor Sturm Date: Mon, 27 Sep 2021 10:40:50 +0200 Subject: [PATCH 03/61] Cover case when processes have been imported under different name (#744) Co-authored-by: Harshil Patel --- tests/test_versions_yml.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_versions_yml.py b/tests/test_versions_yml.py index 5d44c7a0..c3944a0f 100644 --- a/tests/test_versions_yml.py +++ b/tests/test_versions_yml.py @@ -25,14 +25,12 @@ def test_ensure_valid_version_yml(workflow_dir): assert ( "END_VERSIONS" not in versions_yml - ), "END_VERSIONS detected in versions.yml. END_VERSIONS being in the text is a sign of an ill-formatted HEREDOC" + ), "END_VERSIONS detected in versions.yml. This is a sign of an ill-formatted HEREDOC" # Raises an exception if yaml is not valid versions = yaml.safe_load(versions_yml) - try: - software_versions = versions[software_name.upper()] - except KeyError: - raise AssertionError("There is no entry `` in versions.yml. ") + assert len(versions) == 1, "The top-level of versions.yml must contain exactely one entry: the process name as dict key" + software_versions = next(iter(versions.values())) assert len(software_versions), "There must be at least one version emitted." for tool, version in software_versions.items(): assert re.match( From 906577873b66253b0d244871bfec2eeeaff73053 Mon Sep 17 00:00:00 2001 From: Gregor Sturm Date: Mon, 27 Sep 2021 10:41:24 +0200 Subject: [PATCH 04/61] Bulk update modules to use versions.yml (#739) * New functions.nf * Convert code to create versions.yml * Update meta.yml * update output channel * Fix more meta.yml * Manually update remaining modules * remove superflous echo * Fix misformatted meta.yml files * Fix yaml, was list instead of dict * fix version for bcftools Co-authored-by: Harshil Patel --- modules/abacas/functions.nf | 58 +++++++++++-------- modules/abacas/main.nf | 9 ++- modules/abacas/meta.yml | 2 +- modules/adapterremoval/functions.nf | 58 +++++++++++-------- modules/adapterremoval/main.nf | 19 ++++-- modules/adapterremoval/meta.yml | 2 +- modules/agrvate/functions.nf | 58 +++++++++++-------- modules/agrvate/main.nf | 9 ++- modules/agrvate/meta.yml | 2 +- modules/allelecounter/functions.nf | 58 +++++++++++-------- modules/allelecounter/main.nf | 9 ++- modules/allelecounter/meta.yml | 2 +- modules/arriba/functions.nf | 58 +++++++++++-------- modules/arriba/main.nf | 9 ++- modules/arriba/meta.yml | 2 +- modules/artic/guppyplex/functions.nf | 58 +++++++++++-------- modules/artic/guppyplex/main.nf | 9 ++- modules/artic/guppyplex/meta.yml | 2 +- modules/artic/minion/functions.nf | 58 +++++++++++-------- modules/artic/minion/main.nf | 9 ++- modules/artic/minion/meta.yml | 2 +- modules/bamaligncleaner/functions.nf | 58 +++++++++++-------- modules/bamaligncleaner/main.nf | 9 ++- modules/bamaligncleaner/meta.yml | 2 +- modules/bandage/image/functions.nf | 58 +++++++++++-------- modules/bandage/image/main.nf | 9 ++- modules/bandage/image/meta.yml | 2 +- modules/bbmap/align/functions.nf | 58 +++++++++++-------- modules/bbmap/align/main.nf | 9 ++- modules/bbmap/align/meta.yml | 2 +- modules/bbmap/bbduk/functions.nf | 58 +++++++++++-------- modules/bbmap/bbduk/main.nf | 9 ++- modules/bbmap/bbduk/meta.yml | 2 +- modules/bbmap/index/functions.nf | 58 +++++++++++-------- modules/bbmap/index/main.nf | 9 ++- modules/bbmap/index/meta.yml | 2 +- modules/bcftools/concat/functions.nf | 58 +++++++++++-------- modules/bcftools/concat/main.nf | 9 ++- modules/bcftools/concat/meta.yml | 2 +- modules/bcftools/consensus/functions.nf | 58 +++++++++++-------- modules/bcftools/consensus/main.nf | 9 ++- modules/bcftools/consensus/meta.yml | 2 +- modules/bcftools/filter/functions.nf | 58 +++++++++++-------- modules/bcftools/filter/main.nf | 9 ++- modules/bcftools/filter/meta.yml | 2 +- modules/bcftools/isec/functions.nf | 58 +++++++++++-------- modules/bcftools/isec/main.nf | 9 ++- modules/bcftools/isec/meta.yml | 2 +- modules/bcftools/merge/functions.nf | 58 +++++++++++-------- modules/bcftools/merge/main.nf | 9 ++- modules/bcftools/merge/meta.yml | 2 +- modules/bcftools/mpileup/functions.nf | 58 +++++++++++-------- modules/bcftools/mpileup/main.nf | 9 ++- modules/bcftools/mpileup/meta.yml | 2 +- modules/bcftools/norm/functions.nf | 58 +++++++++++-------- modules/bcftools/norm/main.nf | 9 ++- modules/bcftools/norm/meta.yml | 2 +- modules/bcftools/query/functions.nf | 58 +++++++++++-------- modules/bcftools/query/main.nf | 9 ++- modules/bcftools/query/meta.yml | 2 +- modules/bcftools/reheader/functions.nf | 58 +++++++++++-------- modules/bcftools/reheader/main.nf | 9 ++- modules/bcftools/reheader/meta.yml | 2 +- modules/bcftools/stats/functions.nf | 58 +++++++++++-------- modules/bcftools/stats/main.nf | 9 ++- modules/bcftools/stats/meta.yml | 2 +- modules/bcftools/view/functions.nf | 58 +++++++++++-------- modules/bcftools/view/main.nf | 9 ++- modules/bcftools/view/meta.yml | 2 +- modules/bedtools/bamtobed/functions.nf | 58 +++++++++++-------- modules/bedtools/bamtobed/main.nf | 9 ++- modules/bedtools/bamtobed/meta.yml | 2 +- modules/bedtools/complement/functions.nf | 58 +++++++++++-------- modules/bedtools/complement/main.nf | 9 ++- modules/bedtools/complement/meta.yml | 2 +- modules/bedtools/genomecov/functions.nf | 58 +++++++++++-------- modules/bedtools/genomecov/main.nf | 14 +++-- modules/bedtools/genomecov/meta.yml | 2 +- modules/bedtools/getfasta/functions.nf | 58 +++++++++++-------- modules/bedtools/getfasta/main.nf | 9 ++- modules/bedtools/getfasta/meta.yml | 2 +- modules/bedtools/intersect/functions.nf | 58 +++++++++++-------- modules/bedtools/intersect/main.nf | 9 ++- modules/bedtools/intersect/meta.yml | 2 +- modules/bedtools/makewindows/functions.nf | 58 +++++++++++-------- modules/bedtools/makewindows/main.nf | 9 ++- modules/bedtools/makewindows/meta.yml | 2 +- modules/bedtools/maskfasta/functions.nf | 58 +++++++++++-------- modules/bedtools/maskfasta/main.nf | 9 ++- modules/bedtools/maskfasta/meta.yml | 2 +- modules/bedtools/merge/functions.nf | 58 +++++++++++-------- modules/bedtools/merge/main.nf | 9 ++- modules/bedtools/merge/meta.yml | 2 +- modules/bedtools/slop/functions.nf | 58 +++++++++++-------- modules/bedtools/slop/main.nf | 9 ++- modules/bedtools/slop/meta.yml | 2 +- modules/bedtools/sort/functions.nf | 58 +++++++++++-------- modules/bedtools/sort/main.nf | 9 ++- modules/bedtools/sort/meta.yml | 2 +- modules/bedtools/subtract/functions.nf | 58 +++++++++++-------- modules/bedtools/subtract/main.nf | 9 ++- modules/bedtools/subtract/meta.yml | 2 +- modules/bismark/align/functions.nf | 58 +++++++++++-------- modules/bismark/align/main.nf | 9 ++- modules/bismark/align/meta.yml | 2 +- modules/bismark/deduplicate/functions.nf | 58 +++++++++++-------- modules/bismark/deduplicate/main.nf | 9 ++- modules/bismark/deduplicate/meta.yml | 2 +- .../bismark/genomepreparation/functions.nf | 58 +++++++++++-------- modules/bismark/genomepreparation/main.nf | 9 ++- modules/bismark/genomepreparation/meta.yml | 2 +- .../bismark/methylationextractor/functions.nf | 58 +++++++++++-------- modules/bismark/methylationextractor/main.nf | 9 ++- modules/bismark/methylationextractor/meta.yml | 2 +- modules/bismark/report/functions.nf | 58 +++++++++++-------- modules/bismark/report/main.nf | 9 ++- modules/bismark/report/meta.yml | 2 +- modules/bismark/summary/functions.nf | 58 +++++++++++-------- modules/bismark/summary/main.nf | 9 ++- modules/bismark/summary/meta.yml | 2 +- modules/blast/blastn/functions.nf | 58 +++++++++++-------- modules/blast/blastn/main.nf | 9 ++- modules/blast/blastn/meta.yml | 2 +- modules/blast/makeblastdb/functions.nf | 58 +++++++++++-------- modules/blast/makeblastdb/main.nf | 9 ++- modules/blast/makeblastdb/meta.yml | 2 +- modules/bowtie/align/functions.nf | 58 +++++++++++-------- modules/bowtie/align/main.nf | 9 ++- modules/bowtie/align/meta.yml | 2 +- modules/bowtie/build/functions.nf | 58 +++++++++++-------- modules/bowtie/build/main.nf | 9 ++- modules/bowtie/build/meta.yml | 2 +- modules/bowtie2/align/functions.nf | 58 +++++++++++-------- modules/bowtie2/align/main.nf | 14 +++-- modules/bowtie2/align/meta.yml | 2 +- modules/bowtie2/build/functions.nf | 58 +++++++++++-------- modules/bowtie2/build/main.nf | 9 ++- modules/bowtie2/build/meta.yml | 2 +- modules/bwa/aln/functions.nf | 58 +++++++++++-------- modules/bwa/aln/main.nf | 14 +++-- modules/bwa/aln/meta.yml | 2 +- modules/bwa/index/functions.nf | 58 +++++++++++-------- modules/bwa/index/main.nf | 9 ++- modules/bwa/index/meta.yml | 2 +- modules/bwa/mem/functions.nf | 58 +++++++++++-------- modules/bwa/mem/main.nf | 9 ++- modules/bwa/mem/meta.yml | 2 +- modules/bwa/sampe/functions.nf | 58 +++++++++++-------- modules/bwa/sampe/main.nf | 9 ++- modules/bwa/sampe/meta.yml | 2 +- modules/bwa/samse/functions.nf | 58 +++++++++++-------- modules/bwa/samse/main.nf | 9 ++- modules/bwa/samse/meta.yml | 2 +- modules/bwamem2/index/functions.nf | 58 +++++++++++-------- modules/bwamem2/index/main.nf | 9 ++- modules/bwamem2/index/meta.yml | 2 +- modules/bwamem2/mem/functions.nf | 58 +++++++++++-------- modules/bwamem2/mem/main.nf | 9 ++- modules/bwamem2/mem/meta.yml | 2 +- modules/bwameth/align/functions.nf | 58 +++++++++++-------- modules/bwameth/align/main.nf | 9 ++- modules/bwameth/align/meta.yml | 2 +- modules/bwameth/index/functions.nf | 58 +++++++++++-------- modules/bwameth/index/main.nf | 9 ++- modules/bwameth/index/meta.yml | 2 +- modules/cat/cat/functions.nf | 58 +++++++++++-------- modules/cat/cat/main.nf | 9 ++- modules/cat/cat/meta.yml | 2 +- modules/cat/fastq/functions.nf | 58 +++++++++++-------- modules/chromap/chromap/functions.nf | 58 +++++++++++-------- modules/chromap/chromap/main.nf | 14 +++-- modules/chromap/chromap/meta.yml | 2 +- modules/chromap/index/functions.nf | 58 +++++++++++-------- modules/chromap/index/main.nf | 9 ++- modules/chromap/index/meta.yml | 2 +- modules/cnvkit/functions.nf | 58 +++++++++++-------- modules/cnvkit/main.nf | 9 ++- modules/cnvkit/meta.yml | 2 +- modules/cooler/digest/functions.nf | 58 +++++++++++-------- modules/cooler/digest/main.nf | 9 ++- modules/cooler/digest/meta.yml | 2 +- modules/cooler/dump/functions.nf | 58 +++++++++++-------- modules/cooler/dump/main.nf | 9 ++- modules/cooler/dump/meta.yml | 2 +- modules/cutadapt/functions.nf | 58 +++++++++++-------- modules/cutadapt/main.nf | 9 ++- modules/cutadapt/meta.yml | 2 +- modules/damageprofiler/functions.nf | 58 +++++++++++-------- modules/damageprofiler/main.nf | 9 ++- modules/damageprofiler/meta.yml | 2 +- modules/deeptools/computematrix/functions.nf | 58 +++++++++++-------- modules/deeptools/computematrix/main.nf | 9 ++- modules/deeptools/computematrix/meta.yml | 2 +- .../deeptools/plotfingerprint/functions.nf | 58 +++++++++++-------- modules/deeptools/plotfingerprint/main.nf | 9 ++- modules/deeptools/plotfingerprint/meta.yml | 2 +- modules/deeptools/plotheatmap/functions.nf | 58 +++++++++++-------- modules/deeptools/plotheatmap/main.nf | 9 ++- modules/deeptools/plotheatmap/meta.yml | 2 +- modules/deeptools/plotprofile/functions.nf | 58 +++++++++++-------- modules/deeptools/plotprofile/main.nf | 9 ++- modules/deeptools/plotprofile/meta.yml | 2 +- modules/delly/call/functions.nf | 58 +++++++++++-------- modules/delly/call/main.nf | 9 ++- modules/delly/call/meta.yml | 2 +- modules/diamond/blastp/functions.nf | 58 +++++++++++-------- modules/diamond/blastp/main.nf | 9 ++- modules/diamond/blastp/meta.yml | 2 +- modules/diamond/blastx/functions.nf | 58 +++++++++++-------- modules/diamond/blastx/main.nf | 9 ++- modules/diamond/blastx/meta.yml | 2 +- modules/diamond/makedb/functions.nf | 58 +++++++++++-------- modules/diamond/makedb/main.nf | 9 ++- modules/diamond/makedb/meta.yml | 2 +- modules/dragonflye/functions.nf | 58 +++++++++++-------- modules/dragonflye/main.nf | 9 ++- modules/dragonflye/meta.yml | 2 +- modules/dshbio/exportsegments/functions.nf | 58 +++++++++++-------- modules/dshbio/exportsegments/main.nf | 9 ++- modules/dshbio/exportsegments/meta.yml | 2 +- modules/dshbio/filterbed/functions.nf | 58 +++++++++++-------- modules/dshbio/filterbed/main.nf | 9 ++- modules/dshbio/filterbed/meta.yml | 2 +- modules/dshbio/filtergff3/functions.nf | 58 +++++++++++-------- modules/dshbio/filtergff3/main.nf | 9 ++- modules/dshbio/filtergff3/meta.yml | 2 +- modules/dshbio/splitbed/functions.nf | 58 +++++++++++-------- modules/dshbio/splitbed/main.nf | 9 ++- modules/dshbio/splitbed/meta.yml | 2 +- modules/dshbio/splitgff3/functions.nf | 58 +++++++++++-------- modules/dshbio/splitgff3/main.nf | 9 ++- modules/dshbio/splitgff3/meta.yml | 2 +- modules/ensemblvep/functions.nf | 58 +++++++++++-------- modules/ensemblvep/main.nf | 9 ++- modules/ensemblvep/meta.yml | 2 +- modules/expansionhunter/functions.nf | 58 +++++++++++-------- modules/expansionhunter/main.nf | 9 ++- modules/expansionhunter/meta.yml | 2 +- modules/fastani/functions.nf | 58 +++++++++++-------- modules/fastani/main.nf | 14 +++-- modules/fastani/meta.yml | 2 +- modules/fastp/functions.nf | 58 +++++++++++-------- modules/fastp/main.nf | 14 +++-- modules/fastp/meta.yml | 2 +- modules/fasttree/functions.nf | 58 +++++++++++-------- modules/fasttree/main.nf | 9 ++- modules/fasttree/meta.yml | 2 +- .../callmolecularconsensusreads/functions.nf | 58 +++++++++++-------- .../fgbio/callmolecularconsensusreads/main.nf | 9 ++- .../callmolecularconsensusreads/meta.yml | 2 +- modules/fgbio/sortbam/functions.nf | 58 +++++++++++-------- modules/fgbio/sortbam/main.nf | 9 ++- modules/fgbio/sortbam/meta.yml | 2 +- modules/flash/functions.nf | 58 +++++++++++-------- modules/flash/main.nf | 9 ++- modules/flash/meta.yml | 2 +- modules/gatk4/applybqsr/functions.nf | 58 +++++++++++-------- modules/gatk4/applybqsr/main.nf | 9 ++- modules/gatk4/applybqsr/meta.yml | 2 +- modules/gatk4/baserecalibrator/functions.nf | 58 +++++++++++-------- modules/gatk4/baserecalibrator/main.nf | 9 ++- modules/gatk4/baserecalibrator/meta.yml | 2 +- modules/gatk4/bedtointervallist/functions.nf | 58 +++++++++++-------- modules/gatk4/bedtointervallist/main.nf | 9 ++- modules/gatk4/bedtointervallist/meta.yml | 2 +- .../createsequencedictionary/functions.nf | 58 +++++++++++-------- .../gatk4/createsequencedictionary/main.nf | 9 ++- .../gatk4/createsequencedictionary/meta.yml | 2 +- modules/gatk4/fastqtosam/functions.nf | 58 +++++++++++-------- modules/gatk4/fastqtosam/main.nf | 9 ++- modules/gatk4/fastqtosam/meta.yml | 2 +- modules/gatk4/getpileupsummaries/functions.nf | 58 +++++++++++-------- modules/gatk4/getpileupsummaries/main.nf | 9 ++- modules/gatk4/getpileupsummaries/meta.yml | 2 +- modules/gatk4/haplotypecaller/functions.nf | 58 +++++++++++-------- modules/gatk4/haplotypecaller/main.nf | 9 ++- modules/gatk4/haplotypecaller/meta.yml | 2 +- modules/gatk4/intervallisttools/functions.nf | 58 +++++++++++-------- modules/gatk4/intervallisttools/main.nf | 9 ++- modules/gatk4/intervallisttools/meta.yml | 2 +- modules/gatk4/markduplicates/functions.nf | 58 +++++++++++-------- modules/gatk4/markduplicates/main.nf | 9 ++- modules/gatk4/markduplicates/meta.yml | 2 +- modules/gatk4/mergebamalignment/functions.nf | 58 +++++++++++-------- modules/gatk4/mergebamalignment/main.nf | 9 ++- modules/gatk4/mergebamalignment/meta.yml | 2 +- modules/gatk4/mergevcfs/functions.nf | 58 +++++++++++-------- modules/gatk4/mergevcfs/main.nf | 9 ++- modules/gatk4/mergevcfs/meta.yml | 2 +- modules/gatk4/mutect2/functions.nf | 58 +++++++++++-------- modules/gatk4/mutect2/main.nf | 9 ++- modules/gatk4/mutect2/meta.yml | 2 +- modules/gatk4/revertsam/functions.nf | 58 +++++++++++-------- modules/gatk4/revertsam/main.nf | 9 ++- modules/gatk4/revertsam/meta.yml | 2 +- modules/gatk4/samtofastq/functions.nf | 58 +++++++++++-------- modules/gatk4/samtofastq/main.nf | 9 ++- modules/gatk4/samtofastq/meta.yml | 2 +- modules/gatk4/splitncigarreads/functions.nf | 58 +++++++++++-------- modules/gatk4/splitncigarreads/main.nf | 9 ++- modules/gatk4/splitncigarreads/meta.yml | 2 +- modules/gatk4/variantfiltration/functions.nf | 58 +++++++++++-------- modules/gatk4/variantfiltration/main.nf | 9 ++- modules/gatk4/variantfiltration/meta.yml | 2 +- modules/genmap/index/functions.nf | 58 +++++++++++-------- modules/genmap/index/main.nf | 9 ++- modules/genmap/index/meta.yml | 2 +- modules/genmap/mappability/functions.nf | 58 +++++++++++-------- modules/genmap/mappability/main.nf | 9 ++- modules/genmap/mappability/meta.yml | 2 +- modules/gffread/functions.nf | 58 +++++++++++-------- modules/gffread/main.nf | 9 ++- modules/gffread/meta.yml | 2 +- modules/glnexus/functions.nf | 58 +++++++++++-------- modules/glnexus/main.nf | 9 ++- modules/glnexus/meta.yml | 2 +- modules/graphmap2/align/functions.nf | 58 +++++++++++-------- modules/graphmap2/align/main.nf | 9 ++- modules/graphmap2/align/meta.yml | 2 +- modules/graphmap2/index/functions.nf | 58 +++++++++++-------- modules/graphmap2/index/main.nf | 9 ++- modules/graphmap2/index/meta.yml | 2 +- modules/gubbins/functions.nf | 58 +++++++++++-------- modules/gubbins/main.nf | 9 ++- modules/gubbins/meta.yml | 2 +- modules/gunzip/functions.nf | 58 +++++++++++-------- modules/gunzip/main.nf | 9 ++- modules/gunzip/meta.yml | 2 +- modules/hifiasm/functions.nf | 58 +++++++++++-------- modules/hifiasm/main.nf | 14 +++-- modules/hifiasm/meta.yml | 2 +- modules/hisat2/align/functions.nf | 58 +++++++++++-------- modules/hisat2/align/main.nf | 14 +++-- modules/hisat2/align/meta.yml | 2 +- modules/hisat2/build/functions.nf | 58 +++++++++++-------- modules/hisat2/build/main.nf | 9 ++- modules/hisat2/build/meta.yml | 2 +- .../hisat2/extractsplicesites/functions.nf | 58 +++++++++++-------- modules/hisat2/extractsplicesites/main.nf | 9 ++- modules/hisat2/extractsplicesites/meta.yml | 2 +- modules/hmmer/hmmalign/functions.nf | 58 +++++++++++-------- modules/hmmer/hmmalign/main.nf | 9 ++- modules/hmmer/hmmalign/meta.yml | 2 +- modules/homer/annotatepeaks/functions.nf | 58 +++++++++++-------- modules/homer/annotatepeaks/main.nf | 9 ++- modules/homer/annotatepeaks/meta.yml | 2 +- modules/homer/findpeaks/functions.nf | 58 +++++++++++-------- modules/homer/findpeaks/main.nf | 9 ++- modules/homer/findpeaks/meta.yml | 2 +- modules/homer/maketagdirectory/functions.nf | 58 +++++++++++-------- modules/homer/maketagdirectory/main.nf | 9 ++- modules/homer/maketagdirectory/meta.yml | 2 +- modules/homer/makeucscfile/functions.nf | 58 +++++++++++-------- modules/homer/makeucscfile/main.nf | 9 ++- modules/homer/makeucscfile/meta.yml | 2 +- modules/iqtree/functions.nf | 58 +++++++++++-------- modules/iqtree/main.nf | 9 ++- modules/iqtree/meta.yml | 2 +- modules/ivar/consensus/functions.nf | 58 +++++++++++-------- modules/ivar/consensus/main.nf | 9 ++- modules/ivar/consensus/meta.yml | 2 +- modules/ivar/trim/functions.nf | 58 +++++++++++-------- modules/ivar/trim/main.nf | 9 ++- modules/ivar/trim/meta.yml | 2 +- modules/ivar/variants/functions.nf | 58 +++++++++++-------- modules/ivar/variants/main.nf | 9 ++- modules/ivar/variants/meta.yml | 2 +- modules/kallisto/index/functions.nf | 58 +++++++++++-------- modules/kallisto/index/main.nf | 9 ++- modules/kallisto/index/meta.yml | 2 +- modules/kallistobustools/count/functions.nf | 58 +++++++++++-------- modules/kallistobustools/count/main.nf | 9 ++- modules/kallistobustools/count/meta.yml | 2 +- modules/kallistobustools/ref/functions.nf | 58 +++++++++++-------- modules/kallistobustools/ref/main.nf | 14 +++-- modules/kallistobustools/ref/meta.yml | 2 +- modules/kleborate/functions.nf | 58 +++++++++++-------- modules/kleborate/main.nf | 9 ++- modules/kleborate/meta.yml | 2 +- modules/kraken2/kraken2/functions.nf | 58 +++++++++++-------- modules/kraken2/kraken2/main.nf | 9 ++- modules/kraken2/kraken2/meta.yml | 2 +- modules/last/dotplot/functions.nf | 58 +++++++++++-------- modules/last/dotplot/main.nf | 9 ++- modules/last/dotplot/meta.yml | 2 +- modules/last/lastal/functions.nf | 58 +++++++++++-------- modules/last/lastal/main.nf | 9 ++- modules/last/lastal/meta.yml | 2 +- modules/last/lastdb/functions.nf | 58 +++++++++++-------- modules/last/lastdb/main.nf | 9 ++- modules/last/lastdb/meta.yml | 2 +- modules/last/mafconvert/functions.nf | 58 +++++++++++-------- modules/last/mafconvert/main.nf | 9 ++- modules/last/mafconvert/meta.yml | 2 +- modules/last/mafswap/functions.nf | 58 +++++++++++-------- modules/last/mafswap/main.nf | 9 ++- modules/last/mafswap/meta.yml | 2 +- modules/last/postmask/functions.nf | 58 +++++++++++-------- modules/last/postmask/main.nf | 9 ++- modules/last/postmask/meta.yml | 2 +- modules/last/split/functions.nf | 58 +++++++++++-------- modules/last/split/main.nf | 9 ++- modules/last/split/meta.yml | 2 +- modules/last/train/functions.nf | 58 +++++++++++-------- modules/last/train/main.nf | 9 ++- modules/last/train/meta.yml | 2 +- modules/lib/functions.nf | 58 +++++++++++-------- modules/lofreq/call/functions.nf | 58 +++++++++++-------- modules/lofreq/call/main.nf | 9 ++- modules/lofreq/call/meta.yml | 2 +- modules/lofreq/callparallel/functions.nf | 58 +++++++++++-------- modules/lofreq/callparallel/main.nf | 9 ++- modules/lofreq/callparallel/meta.yml | 2 +- modules/lofreq/filter/functions.nf | 58 +++++++++++-------- modules/lofreq/filter/main.nf | 9 ++- modules/lofreq/filter/meta.yml | 2 +- modules/lofreq/indelqual/functions.nf | 58 +++++++++++-------- modules/lofreq/indelqual/main.nf | 9 ++- modules/lofreq/indelqual/meta.yml | 2 +- modules/macs2/callpeak/functions.nf | 58 +++++++++++-------- modules/macs2/callpeak/main.nf | 9 ++- modules/malt/build/functions.nf | 58 +++++++++++-------- modules/malt/build/main.nf | 9 ++- modules/malt/build/meta.yml | 2 +- modules/malt/run/functions.nf | 58 +++++++++++-------- modules/malt/run/main.nf | 9 ++- modules/malt/run/meta.yml | 2 +- modules/maltextract/functions.nf | 58 +++++++++++-------- modules/maltextract/main.nf | 9 ++- modules/maltextract/meta.yml | 2 +- modules/mash/sketch/functions.nf | 58 +++++++++++-------- modules/mash/sketch/main.nf | 9 ++- modules/metaphlan3/functions.nf | 58 +++++++++++-------- modules/metaphlan3/main.nf | 9 ++- modules/metaphlan3/meta.yml | 2 +- modules/methyldackel/extract/functions.nf | 58 +++++++++++-------- modules/methyldackel/extract/main.nf | 9 ++- modules/methyldackel/extract/meta.yml | 2 +- modules/methyldackel/mbias/functions.nf | 58 +++++++++++-------- modules/methyldackel/mbias/main.nf | 9 ++- modules/methyldackel/mbias/meta.yml | 2 +- modules/minia/functions.nf | 58 +++++++++++-------- modules/minia/main.nf | 9 ++- modules/minia/meta.yml | 2 +- modules/minimap2/align/functions.nf | 58 +++++++++++-------- modules/minimap2/align/main.nf | 9 ++- modules/minimap2/align/meta.yml | 2 +- modules/minimap2/index/functions.nf | 58 +++++++++++-------- modules/minimap2/index/main.nf | 9 ++- modules/minimap2/index/meta.yml | 2 +- modules/mosdepth/functions.nf | 58 +++++++++++-------- modules/mosdepth/main.nf | 9 ++- modules/mosdepth/meta.yml | 2 +- modules/msisensor/msi/functions.nf | 58 +++++++++++-------- modules/msisensor/msi/main.nf | 9 ++- modules/msisensor/msi/meta.yml | 2 +- modules/msisensor/scan/functions.nf | 58 +++++++++++-------- modules/msisensor/scan/main.nf | 9 ++- modules/msisensor/scan/meta.yml | 2 +- modules/muscle/functions.nf | 58 +++++++++++-------- modules/muscle/main.nf | 9 ++- modules/muscle/meta.yml | 2 +- modules/nanolyse/functions.nf | 58 +++++++++++-------- modules/nanolyse/main.nf | 9 ++- modules/nanolyse/meta.yml | 2 +- modules/nanoplot/functions.nf | 58 +++++++++++-------- modules/nanoplot/main.nf | 9 ++- modules/nanoplot/meta.yml | 2 +- modules/nextclade/functions.nf | 58 +++++++++++-------- modules/nextclade/main.nf | 9 ++- modules/nextclade/meta.yml | 2 +- modules/optitype/functions.nf | 58 +++++++++++-------- modules/optitype/main.nf | 9 ++- modules/optitype/meta.yml | 2 +- modules/pairix/functions.nf | 58 +++++++++++-------- modules/pairix/main.nf | 9 ++- modules/pairix/meta.yml | 2 +- modules/pairtools/dedup/functions.nf | 58 +++++++++++-------- modules/pairtools/dedup/main.nf | 9 ++- modules/pairtools/dedup/meta.yml | 2 +- modules/pairtools/flip/functions.nf | 58 +++++++++++-------- modules/pairtools/flip/main.nf | 9 ++- modules/pairtools/flip/meta.yml | 2 +- modules/pairtools/parse/functions.nf | 58 +++++++++++-------- modules/pairtools/parse/main.nf | 9 ++- modules/pairtools/parse/meta.yml | 2 +- modules/pairtools/restrict/functions.nf | 58 +++++++++++-------- modules/pairtools/restrict/main.nf | 9 ++- modules/pairtools/restrict/meta.yml | 2 +- modules/pairtools/select/functions.nf | 58 +++++++++++-------- modules/pairtools/select/main.nf | 9 ++- modules/pairtools/select/meta.yml | 2 +- modules/pairtools/sort/functions.nf | 58 +++++++++++-------- modules/pairtools/sort/main.nf | 9 ++- modules/pairtools/sort/meta.yml | 2 +- modules/pangolin/functions.nf | 58 +++++++++++-------- modules/pangolin/main.nf | 9 ++- modules/pangolin/meta.yml | 2 +- modules/pbccs/functions.nf | 58 +++++++++++-------- modules/pbccs/main.nf | 9 ++- modules/pbccs/meta.yml | 2 +- modules/phantompeakqualtools/functions.nf | 58 +++++++++++-------- modules/phantompeakqualtools/main.nf | 9 ++- .../collectmultiplemetrics/functions.nf | 58 +++++++++++-------- modules/picard/collectmultiplemetrics/main.nf | 9 ++- .../picard/collectmultiplemetrics/meta.yml | 2 +- modules/picard/collectwgsmetrics/functions.nf | 58 +++++++++++-------- modules/picard/collectwgsmetrics/main.nf | 9 ++- modules/picard/collectwgsmetrics/meta.yml | 2 +- modules/picard/filtersamreads/functions.nf | 58 +++++++++++-------- modules/picard/filtersamreads/main.nf | 14 +++-- modules/picard/filtersamreads/meta.yml | 2 +- modules/picard/markduplicates/functions.nf | 58 +++++++++++-------- modules/picard/markduplicates/main.nf | 9 ++- modules/picard/markduplicates/meta.yml | 2 +- modules/picard/mergesamfiles/functions.nf | 58 +++++++++++-------- modules/picard/mergesamfiles/main.nf | 14 +++-- modules/picard/mergesamfiles/meta.yml | 2 +- modules/picard/sortsam/functions.nf | 58 +++++++++++-------- modules/picard/sortsam/main.nf | 9 ++- modules/picard/sortsam/meta.yml | 2 +- modules/plasmidid/functions.nf | 58 +++++++++++-------- modules/plasmidid/main.nf | 9 ++- modules/plasmidid/meta.yml | 2 +- modules/plink/vcf/functions.nf | 58 +++++++++++-------- modules/plink/vcf/main.nf | 9 ++- modules/plink/vcf/meta.yml | 2 +- modules/preseq/lcextrap/functions.nf | 58 +++++++++++-------- modules/preseq/lcextrap/main.nf | 9 ++- modules/preseq/lcextrap/meta.yml | 2 +- modules/prodigal/functions.nf | 58 +++++++++++-------- modules/prodigal/main.nf | 9 ++- modules/prodigal/meta.yml | 2 +- modules/prokka/functions.nf | 58 +++++++++++-------- modules/prokka/main.nf | 9 ++- modules/prokka/meta.yml | 2 +- modules/pycoqc/functions.nf | 58 +++++++++++-------- modules/pycoqc/main.nf | 9 ++- modules/pycoqc/meta.yml | 2 +- modules/pydamage/analyze/functions.nf | 58 +++++++++++-------- modules/pydamage/analyze/main.nf | 9 ++- modules/pydamage/analyze/meta.yml | 2 +- modules/pydamage/filter/functions.nf | 58 +++++++++++-------- modules/pydamage/filter/main.nf | 9 ++- modules/pydamage/filter/meta.yml | 2 +- modules/qcat/functions.nf | 58 +++++++++++-------- modules/qcat/main.nf | 9 ++- modules/qcat/meta.yml | 2 +- modules/qualimap/bamqc/functions.nf | 58 +++++++++++-------- modules/qualimap/bamqc/main.nf | 9 ++- modules/qualimap/bamqc/meta.yml | 2 +- modules/qualimap/rnaseq/functions.nf | 58 +++++++++++-------- modules/qualimap/rnaseq/main.nf | 9 ++- modules/quast/functions.nf | 58 +++++++++++-------- modules/quast/main.nf | 9 ++- modules/quast/meta.yml | 2 +- modules/rapidnj/functions.nf | 58 +++++++++++-------- modules/rapidnj/main.nf | 9 ++- modules/rapidnj/meta.yml | 2 +- modules/rasusa/functions.nf | 58 +++++++++++-------- modules/rasusa/main.nf | 9 ++- modules/rasusa/meta.yml | 2 +- modules/raxmlng/functions.nf | 58 +++++++++++-------- modules/raxmlng/main.nf | 9 ++- modules/raxmlng/meta.yml | 2 +- modules/rsem/calculateexpression/functions.nf | 58 +++++++++++-------- modules/rsem/calculateexpression/main.nf | 9 ++- modules/rsem/calculateexpression/meta.yml | 2 +- modules/rsem/preparereference/functions.nf | 58 +++++++++++-------- modules/rsem/preparereference/main.nf | 14 +++-- modules/rsem/preparereference/meta.yml | 2 +- modules/rseqc/bamstat/functions.nf | 58 +++++++++++-------- modules/rseqc/bamstat/main.nf | 9 ++- modules/rseqc/bamstat/meta.yml | 2 +- modules/rseqc/inferexperiment/functions.nf | 58 +++++++++++-------- modules/rseqc/inferexperiment/main.nf | 9 ++- modules/rseqc/inferexperiment/meta.yml | 2 +- modules/rseqc/innerdistance/functions.nf | 58 +++++++++++-------- modules/rseqc/innerdistance/main.nf | 14 +++-- modules/rseqc/innerdistance/meta.yml | 2 +- modules/rseqc/junctionannotation/functions.nf | 58 +++++++++++-------- modules/rseqc/junctionannotation/main.nf | 9 ++- modules/rseqc/junctionannotation/meta.yml | 2 +- modules/rseqc/junctionsaturation/functions.nf | 58 +++++++++++-------- modules/rseqc/junctionsaturation/main.nf | 9 ++- modules/rseqc/junctionsaturation/meta.yml | 2 +- modules/rseqc/readdistribution/functions.nf | 58 +++++++++++-------- modules/rseqc/readdistribution/main.nf | 9 ++- modules/rseqc/readdistribution/meta.yml | 2 +- modules/rseqc/readduplication/functions.nf | 58 +++++++++++-------- modules/rseqc/readduplication/main.nf | 9 ++- modules/rseqc/readduplication/meta.yml | 2 +- modules/salmon/index/functions.nf | 58 +++++++++++-------- modules/salmon/index/main.nf | 9 ++- modules/salmon/index/meta.yml | 2 +- modules/salmon/quant/functions.nf | 58 +++++++++++-------- modules/salmon/quant/main.nf | 9 ++- modules/salmon/quant/meta.yml | 2 +- modules/samtools/ampliconclip/functions.nf | 58 +++++++++++-------- modules/samtools/ampliconclip/main.nf | 9 ++- modules/samtools/ampliconclip/meta.yml | 2 +- modules/samtools/faidx/functions.nf | 58 +++++++++++-------- modules/samtools/faidx/main.nf | 9 ++- modules/samtools/faidx/meta.yml | 2 +- modules/samtools/fastq/functions.nf | 58 +++++++++++-------- modules/samtools/fastq/main.nf | 9 ++- modules/samtools/fastq/meta.yml | 2 +- modules/samtools/flagstat/functions.nf | 58 +++++++++++-------- modules/samtools/flagstat/main.nf | 9 ++- modules/samtools/flagstat/meta.yml | 2 +- modules/samtools/idxstats/functions.nf | 58 +++++++++++-------- modules/samtools/idxstats/main.nf | 9 ++- modules/samtools/idxstats/meta.yml | 2 +- modules/samtools/index/functions.nf | 58 +++++++++++-------- modules/samtools/index/main.nf | 9 ++- modules/samtools/index/meta.yml | 2 +- modules/samtools/merge/functions.nf | 58 +++++++++++-------- modules/samtools/merge/main.nf | 9 ++- modules/samtools/merge/meta.yml | 2 +- modules/samtools/mpileup/functions.nf | 58 +++++++++++-------- modules/samtools/mpileup/main.nf | 9 ++- modules/samtools/mpileup/meta.yml | 2 +- modules/samtools/sort/functions.nf | 58 +++++++++++-------- modules/samtools/sort/main.nf | 9 ++- modules/samtools/sort/meta.yml | 2 +- modules/samtools/stats/functions.nf | 58 +++++++++++-------- modules/samtools/stats/main.nf | 9 ++- modules/samtools/stats/meta.yml | 2 +- modules/samtools/view/functions.nf | 58 +++++++++++-------- modules/samtools/view/main.nf | 9 ++- modules/samtools/view/meta.yml | 2 +- modules/seacr/callpeak/functions.nf | 58 +++++++++++-------- modules/seacr/callpeak/main.nf | 9 ++- modules/seacr/callpeak/meta.yml | 2 +- modules/seqkit/split2/functions.nf | 58 +++++++++++-------- modules/seqkit/split2/main.nf | 14 +++-- modules/seqkit/split2/meta.yml | 2 +- modules/seqtk/sample/functions.nf | 58 +++++++++++-------- modules/seqtk/sample/main.nf | 14 +++-- modules/seqtk/sample/meta.yml | 2 +- modules/seqtk/subseq/functions.nf | 58 +++++++++++-------- modules/seqtk/subseq/main.nf | 9 ++- modules/seqtk/subseq/meta.yml | 2 +- modules/sequenzautils/bam2seqz/functions.nf | 58 +++++++++++-------- modules/sequenzautils/bam2seqz/main.nf | 9 ++- modules/sequenzautils/bam2seqz/meta.yml | 2 +- modules/sequenzautils/gcwiggle/functions.nf | 58 +++++++++++-------- modules/sequenzautils/gcwiggle/main.nf | 9 ++- modules/sequenzautils/gcwiggle/meta.yml | 2 +- modules/seqwish/induce/functions.nf | 58 +++++++++++-------- modules/seqwish/induce/main.nf | 9 ++- modules/seqwish/induce/meta.yml | 2 +- modules/shovill/functions.nf | 58 +++++++++++-------- modules/shovill/main.nf | 9 ++- modules/shovill/meta.yml | 2 +- modules/snpdists/functions.nf | 58 +++++++++++-------- modules/snpdists/main.nf | 9 ++- modules/snpdists/meta.yml | 2 +- modules/snpeff/functions.nf | 58 +++++++++++-------- modules/snpeff/main.nf | 9 ++- modules/snpeff/meta.yml | 2 +- modules/snpsites/functions.nf | 58 +++++++++++-------- modules/snpsites/main.nf | 9 ++- modules/snpsites/meta.yml | 2 +- modules/sortmerna/functions.nf | 58 +++++++++++-------- modules/sortmerna/main.nf | 14 +++-- modules/spades/functions.nf | 58 +++++++++++-------- modules/spades/main.nf | 9 ++- modules/spades/meta.yml | 2 +- modules/staphopiasccmec/functions.nf | 58 +++++++++++-------- modules/staphopiasccmec/main.nf | 9 ++- modules/staphopiasccmec/meta.yml | 2 +- modules/star/align/functions.nf | 58 +++++++++++-------- modules/star/align/main.nf | 9 ++- modules/star/align/meta.yml | 2 +- modules/star/genomegenerate/functions.nf | 58 +++++++++++-------- modules/star/genomegenerate/main.nf | 14 +++-- modules/star/genomegenerate/meta.yml | 2 +- modules/strelka/germline/functions.nf | 58 +++++++++++-------- modules/strelka/germline/main.nf | 9 ++- modules/strelka/germline/meta.yml | 2 +- modules/stringtie/merge/functions.nf | 58 +++++++++++-------- modules/stringtie/merge/main.nf | 9 ++- modules/stringtie/stringtie/functions.nf | 58 +++++++++++-------- modules/stringtie/stringtie/main.nf | 9 ++- modules/stringtie/stringtie/meta.yml | 2 +- modules/subread/featurecounts/functions.nf | 58 +++++++++++-------- modules/subread/featurecounts/main.nf | 9 ++- modules/subread/featurecounts/meta.yml | 2 +- modules/tabix/bgzip/functions.nf | 58 +++++++++++-------- modules/tabix/bgzip/main.nf | 9 ++- modules/tabix/bgzip/meta.yml | 2 +- modules/tabix/bgziptabix/functions.nf | 58 +++++++++++-------- modules/tabix/bgziptabix/main.nf | 9 ++- modules/tabix/bgziptabix/meta.yml | 2 +- modules/tabix/tabix/functions.nf | 58 +++++++++++-------- modules/tabix/tabix/main.nf | 9 ++- modules/tabix/tabix/meta.yml | 2 +- modules/tiddit/sv/functions.nf | 58 +++++++++++-------- modules/tiddit/sv/main.nf | 9 ++- modules/tiddit/sv/meta.yml | 2 +- modules/trimgalore/functions.nf | 58 +++++++++++-------- modules/trimgalore/main.nf | 14 +++-- modules/trimgalore/meta.yml | 2 +- modules/ucsc/bed12tobigbed/functions.nf | 58 +++++++++++-------- modules/ucsc/bed12tobigbed/main.nf | 9 ++- modules/ucsc/bed12tobigbed/meta.yml | 2 +- modules/ucsc/bedclip/functions.nf | 58 +++++++++++-------- modules/ucsc/bedclip/main.nf | 9 ++- modules/ucsc/bedclip/meta.yml | 2 +- modules/ucsc/bedgraphtobigwig/functions.nf | 58 +++++++++++-------- modules/ucsc/bedgraphtobigwig/main.nf | 9 ++- modules/ucsc/bedgraphtobigwig/meta.yml | 2 +- .../ucsc/bigwigaverageoverbed/functions.nf | 58 +++++++++++-------- modules/ucsc/bigwigaverageoverbed/main.nf | 9 ++- modules/ucsc/bigwigaverageoverbed/meta.yml | 2 +- modules/ucsc/wigtobigwig/functions.nf | 58 +++++++++++-------- modules/ucsc/wigtobigwig/main.nf | 9 ++- modules/ucsc/wigtobigwig/meta.yml | 2 +- modules/umitools/dedup/functions.nf | 58 +++++++++++-------- modules/umitools/dedup/main.nf | 9 ++- modules/umitools/extract/functions.nf | 58 +++++++++++-------- modules/umitools/extract/main.nf | 14 +++-- modules/unicycler/functions.nf | 58 +++++++++++-------- modules/unicycler/main.nf | 9 ++- modules/unicycler/meta.yml | 4 +- modules/untar/functions.nf | 58 +++++++++++-------- modules/untar/main.nf | 9 ++- modules/untar/meta.yml | 2 +- modules/unzip/functions.nf | 58 +++++++++++-------- modules/unzip/main.nf | 9 ++- modules/unzip/meta.yml | 2 +- modules/variantbam/functions.nf | 58 +++++++++++-------- modules/variantbam/main.nf | 9 ++- modules/variantbam/meta.yml | 2 +- modules/vcftools/functions.nf | 58 +++++++++++-------- modules/vcftools/main.nf | 9 ++- modules/vcftools/meta.yml | 2 +- modules/yara/index/functions.nf | 58 +++++++++++-------- modules/yara/index/main.nf | 9 ++- modules/yara/index/meta.yml | 2 +- modules/yara/mapper/functions.nf | 58 +++++++++++-------- modules/yara/mapper/main.nf | 14 +++-- modules/yara/mapper/meta.yml | 2 +- 744 files changed, 10399 insertions(+), 7063 deletions(-) diff --git a/modules/abacas/functions.nf b/modules/abacas/functions.nf index da9da093..85628ee0 100644 --- a/modules/abacas/functions.nf +++ b/modules/abacas/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/abacas/main.nf b/modules/abacas/main.nf index 6ec65ea2..0e46f854 100644 --- a/modules/abacas/main.nf +++ b/modules/abacas/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process ABACAS { output: tuple val(meta), path('*.abacas*'), emit: results - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -40,6 +40,9 @@ process ABACAS { mv nucmer.filtered.delta ${prefix}.abacas.nucmer.filtered.delta mv nucmer.tiling ${prefix}.abacas.nucmer.tiling mv unused_contigs.out ${prefix}.abacas.unused.contigs.out - echo \$(abacas.pl -v 2>&1) | sed 's/^.*ABACAS.//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(abacas.pl -v 2>&1 | sed 's/^.*ABACAS.//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/abacas/meta.yml b/modules/abacas/meta.yml index d60afee0..d8c45628 100644 --- a/modules/abacas/meta.yml +++ b/modules/abacas/meta.yml @@ -51,7 +51,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/adapterremoval/functions.nf b/modules/adapterremoval/functions.nf index da9da093..85628ee0 100644 --- a/modules/adapterremoval/functions.nf +++ b/modules/adapterremoval/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/adapterremoval/main.nf b/modules/adapterremoval/main.nf index 08b1b8bf..cbf0957a 100644 --- a/modules/adapterremoval/main.nf +++ b/modules/adapterremoval/main.nf @@ -1,4 +1,4 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process ADAPTERREMOVAL { output: tuple val(meta), path('*.fastq.gz'), emit: reads tuple val(meta), path('*.log') , emit: log - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -41,7 +41,10 @@ process ADAPTERREMOVAL { --seed 42 \\ --gzip \\ - AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g") + END_VERSIONS """ } else if (!meta.single_end && !meta.collapse) { """ @@ -57,7 +60,10 @@ process ADAPTERREMOVAL { --seed 42 \\ --gzip \\ - AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g") + END_VERSIONS """ } else { """ @@ -73,7 +79,10 @@ process ADAPTERREMOVAL { --gzip \\ cat *.collapsed.gz *.collapsed.truncated.gz > ${prefix}.merged.fastq.gz - AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g") + END_VERSIONS """ } diff --git a/modules/adapterremoval/meta.yml b/modules/adapterremoval/meta.yml index 15e0a201..6282436a 100644 --- a/modules/adapterremoval/meta.yml +++ b/modules/adapterremoval/meta.yml @@ -44,7 +44,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@maxibor" diff --git a/modules/agrvate/functions.nf b/modules/agrvate/functions.nf index da9da093..85628ee0 100644 --- a/modules/agrvate/functions.nf +++ b/modules/agrvate/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/agrvate/main.nf b/modules/agrvate/main.nf index 8f504927..44ec0825 100644 --- a/modules/agrvate/main.nf +++ b/modules/agrvate/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process AGRVATE { output: tuple val(meta), path("${fasta.baseName}-results/${fasta.baseName}-summary.tab"), emit: summary path "${fasta.baseName}-results" , emit: results_dir - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process AGRVATE { $options.args \\ -i $fasta - echo \$(agrvate -v 2>&1) | sed 's/agrvate //;' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(agrvate -v 2>&1 | sed 's/agrvate //;') + END_VERSIONS """ } diff --git a/modules/agrvate/meta.yml b/modules/agrvate/meta.yml index 97aa5f58..bd27050a 100644 --- a/modules/agrvate/meta.yml +++ b/modules/agrvate/meta.yml @@ -41,6 +41,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/allelecounter/functions.nf b/modules/allelecounter/functions.nf index da9da093..85628ee0 100644 --- a/modules/allelecounter/functions.nf +++ b/modules/allelecounter/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/allelecounter/main.nf b/modules/allelecounter/main.nf index ad24b3c1..31ef3f79 100644 --- a/modules/allelecounter/main.nf +++ b/modules/allelecounter/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process ALLELECOUNTER { output: tuple val(meta), path("*.alleleCount"), emit: allelecount - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process ALLELECOUNTER { -b $bam \\ -o ${prefix}.alleleCount - alleleCounter --version > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(alleleCounter --version) + END_VERSIONS """ } diff --git a/modules/allelecounter/meta.yml b/modules/allelecounter/meta.yml index 28f96836..67b398f3 100644 --- a/modules/allelecounter/meta.yml +++ b/modules/allelecounter/meta.yml @@ -42,7 +42,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - alleleCount: type: file description: Allele count file diff --git a/modules/arriba/functions.nf b/modules/arriba/functions.nf index da9da093..85628ee0 100644 --- a/modules/arriba/functions.nf +++ b/modules/arriba/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/arriba/main.nf b/modules/arriba/main.nf index 739922ef..b94c22d9 100644 --- a/modules/arriba/main.nf +++ b/modules/arriba/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process ARRIBA { output: tuple val(meta), path("*.fusions.tsv") , emit: fusions tuple val(meta), path("*.fusions.discarded.tsv"), emit: fusions_fail - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process ARRIBA { $blacklist \\ $options.args - echo \$(arriba -h | grep 'Version:' 2>&1) | sed 's/Version:\s//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(arriba -h | grep 'Version:' 2>&1 | sed 's/Version:\s//') + END_VERSIONS """ } diff --git a/modules/arriba/meta.yml b/modules/arriba/meta.yml index 370f82ec..ddd2c75b 100644 --- a/modules/arriba/meta.yml +++ b/modules/arriba/meta.yml @@ -40,7 +40,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - fusions: type: file description: File contains fusions which pass all of Arriba's filters. diff --git a/modules/artic/guppyplex/functions.nf b/modules/artic/guppyplex/functions.nf index da9da093..85628ee0 100644 --- a/modules/artic/guppyplex/functions.nf +++ b/modules/artic/guppyplex/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/artic/guppyplex/main.nf b/modules/artic/guppyplex/main.nf index 41178298..5f91e9e3 100644 --- a/modules/artic/guppyplex/main.nf +++ b/modules/artic/guppyplex/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process ARTIC_GUPPYPLEX { output: tuple val(meta), path("*.fastq.gz"), emit: fastq - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process ARTIC_GUPPYPLEX { --output ${prefix}.fastq pigz -p $task.cpus *.fastq - echo \$(artic --version 2>&1) | sed 's/^.*artic //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(artic --version 2>&1 | sed 's/^.*artic //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/artic/guppyplex/meta.yml b/modules/artic/guppyplex/meta.yml index 0caaf5d2..45ec7138 100644 --- a/modules/artic/guppyplex/meta.yml +++ b/modules/artic/guppyplex/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/artic/minion/functions.nf b/modules/artic/minion/functions.nf index da9da093..85628ee0 100644 --- a/modules/artic/minion/functions.nf +++ b/modules/artic/minion/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/artic/minion/main.nf b/modules/artic/minion/main.nf index e408551b..2f810ecf 100644 --- a/modules/artic/minion/main.nf +++ b/modules/artic/minion/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -40,7 +40,7 @@ process ARTIC_MINION { tuple val(meta), path("${prefix}.pass.vcf.gz") , emit: vcf tuple val(meta), path("${prefix}.pass.vcf.gz.tbi") , emit: tbi tuple val(meta), path("*.json"), optional:true , emit: json - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -68,6 +68,9 @@ process ARTIC_MINION { $scheme \\ $prefix - echo \$(artic --version 2>&1) | sed 's/^.*artic //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(artic --version 2>&1 | sed 's/^.*artic //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/artic/minion/meta.yml b/modules/artic/minion/meta.yml index 1b6a73cf..77f325e5 100644 --- a/modules/artic/minion/meta.yml +++ b/modules/artic/minion/meta.yml @@ -106,7 +106,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/bamaligncleaner/functions.nf b/modules/bamaligncleaner/functions.nf index da9da093..85628ee0 100644 --- a/modules/bamaligncleaner/functions.nf +++ b/modules/bamaligncleaner/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bamaligncleaner/main.nf b/modules/bamaligncleaner/main.nf index 8ce73ee4..7372f274 100644 --- a/modules/bamaligncleaner/main.nf +++ b/modules/bamaligncleaner/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BAMALIGNCLEANER { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process BAMALIGNCLEANER { -o ${prefix}.bam \\ ${bam} - echo \$(bamAlignCleaner --version) | sed 's/.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bamAlignCleaner --version | sed 's/.*version //') + END_VERSIONS """ } diff --git a/modules/bamaligncleaner/meta.yml b/modules/bamaligncleaner/meta.yml index 8afdd44b..c236c0ea 100644 --- a/modules/bamaligncleaner/meta.yml +++ b/modules/bamaligncleaner/meta.yml @@ -30,7 +30,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: Sorted BAM/CRAM file diff --git a/modules/bandage/image/functions.nf b/modules/bandage/image/functions.nf index da9da093..85628ee0 100644 --- a/modules/bandage/image/functions.nf +++ b/modules/bandage/image/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bandage/image/main.nf b/modules/bandage/image/main.nf index 6afdb60d..c788e2e1 100644 --- a/modules/bandage/image/main.nf +++ b/modules/bandage/image/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BANDAGE_IMAGE { output: tuple val(meta), path('*.png'), emit: png tuple val(meta), path('*.svg'), emit: svg - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process BANDAGE_IMAGE { Bandage image $gfa ${prefix}.png $options.args Bandage image $gfa ${prefix}.svg $options.args - echo \$(Bandage --version 2>&1) | sed 's/^.*Version: //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(Bandage --version 2>&1 | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bandage/image/meta.yml b/modules/bandage/image/meta.yml index 26c23a07..f655cae4 100644 --- a/modules/bandage/image/meta.yml +++ b/modules/bandage/image/meta.yml @@ -38,6 +38,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/bbmap/align/functions.nf b/modules/bbmap/align/functions.nf index da9da093..85628ee0 100644 --- a/modules/bbmap/align/functions.nf +++ b/modules/bbmap/align/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bbmap/align/main.nf b/modules/bbmap/align/main.nf index eca45ddb..8235e78d 100644 --- a/modules/bbmap/align/main.nf +++ b/modules/bbmap/align/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BBMAP_ALIGN { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -54,6 +54,9 @@ process BBMAP_ALIGN { threads=$task.cpus \\ -Xmx${task.memory.toGiga()}g - echo \$(bbversion.sh) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bbversion.sh) + END_VERSIONS """ } diff --git a/modules/bbmap/align/meta.yml b/modules/bbmap/align/meta.yml index b008ea0f..bb52f06e 100644 --- a/modules/bbmap/align/meta.yml +++ b/modules/bbmap/align/meta.yml @@ -42,7 +42,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: BAM file diff --git a/modules/bbmap/bbduk/functions.nf b/modules/bbmap/bbduk/functions.nf index da9da093..85628ee0 100644 --- a/modules/bbmap/bbduk/functions.nf +++ b/modules/bbmap/bbduk/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bbmap/bbduk/main.nf b/modules/bbmap/bbduk/main.nf index 797dc8b5..4f1540dc 100644 --- a/modules/bbmap/bbduk/main.nf +++ b/modules/bbmap/bbduk/main.nf @@ -1,4 +1,4 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BBMAP_BBDUK { output: tuple val(meta), path('*.fastq.gz'), emit: reads tuple val(meta), path('*.log') , emit: log - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process BBMAP_BBDUK { $options.args \\ $contaminants_fa \\ &> ${prefix}.bbduk.log - echo \$(bbversion.sh) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bbversion.sh) + END_VERSIONS """ } diff --git a/modules/bbmap/bbduk/meta.yml b/modules/bbmap/bbduk/meta.yml index ee2eea2c..a1ab789c 100644 --- a/modules/bbmap/bbduk/meta.yml +++ b/modules/bbmap/bbduk/meta.yml @@ -42,7 +42,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - log: type: file description: Bbduk log file diff --git a/modules/bbmap/index/functions.nf b/modules/bbmap/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/bbmap/index/functions.nf +++ b/modules/bbmap/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bbmap/index/main.nf b/modules/bbmap/index/main.nf index 0e15b13f..6f957d03 100644 --- a/modules/bbmap/index/main.nf +++ b/modules/bbmap/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BBMAP_INDEX { output: path 'ref' , emit: index - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process BBMAP_INDEX { threads=$task.cpus \\ -Xmx${task.memory.toGiga()}g - echo \$(bbversion.sh) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bbversion.sh) + END_VERSIONS """ } diff --git a/modules/bbmap/index/meta.yml b/modules/bbmap/index/meta.yml index a51a44fd..1df990b2 100644 --- a/modules/bbmap/index/meta.yml +++ b/modules/bbmap/index/meta.yml @@ -23,7 +23,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - db: type: directory description: Directory with index files diff --git a/modules/bcftools/concat/functions.nf b/modules/bcftools/concat/functions.nf index da9da093..85628ee0 100644 --- a/modules/bcftools/concat/functions.nf +++ b/modules/bcftools/concat/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bcftools/concat/main.nf b/modules/bcftools/concat/main.nf index 0266f4f0..fab0e83d 100644 --- a/modules/bcftools/concat/main.nf +++ b/modules/bcftools/concat/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BCFTOOLS_CONCAT { output: tuple val(meta), path("*.gz"), emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process BCFTOOLS_CONCAT { --threads $task.cpus \\ ${vcfs} - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bcftools/concat/meta.yml b/modules/bcftools/concat/meta.yml index 566e6dba..81701288 100644 --- a/modules/bcftools/concat/meta.yml +++ b/modules/bcftools/concat/meta.yml @@ -37,6 +37,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/bcftools/consensus/functions.nf b/modules/bcftools/consensus/functions.nf index da9da093..85628ee0 100644 --- a/modules/bcftools/consensus/functions.nf +++ b/modules/bcftools/consensus/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bcftools/consensus/main.nf b/modules/bcftools/consensus/main.nf index 0403f050..29758a4b 100644 --- a/modules/bcftools/consensus/main.nf +++ b/modules/bcftools/consensus/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BCFTOOLS_CONSENSUS { output: tuple val(meta), path('*.fa'), emit: fasta - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process BCFTOOLS_CONSENSUS { header=\$(head -n 1 ${prefix}.fa | sed 's/>//g') sed -i 's/\${header}/${meta.id}/g' ${prefix}.fa - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bcftools/consensus/meta.yml b/modules/bcftools/consensus/meta.yml index ef14479d..4241e441 100644 --- a/modules/bcftools/consensus/meta.yml +++ b/modules/bcftools/consensus/meta.yml @@ -42,7 +42,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/filter/functions.nf b/modules/bcftools/filter/functions.nf index da9da093..85628ee0 100644 --- a/modules/bcftools/filter/functions.nf +++ b/modules/bcftools/filter/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bcftools/filter/main.nf b/modules/bcftools/filter/main.nf index fbdac0de..37b7e28b 100644 --- a/modules/bcftools/filter/main.nf +++ b/modules/bcftools/filter/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BCFTOOLS_FILTER { output: tuple val(meta), path("*.gz"), emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process BCFTOOLS_FILTER { $options.args \\ $vcf - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bcftools/filter/meta.yml b/modules/bcftools/filter/meta.yml index fe9a57e6..6842b1f8 100644 --- a/modules/bcftools/filter/meta.yml +++ b/modules/bcftools/filter/meta.yml @@ -34,7 +34,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/isec/functions.nf b/modules/bcftools/isec/functions.nf index da9da093..85628ee0 100644 --- a/modules/bcftools/isec/functions.nf +++ b/modules/bcftools/isec/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bcftools/isec/main.nf b/modules/bcftools/isec/main.nf index 28c6103e..f700f35c 100644 --- a/modules/bcftools/isec/main.nf +++ b/modules/bcftools/isec/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BCFTOOLS_ISEC { output: tuple val(meta), path("${prefix}"), emit: results - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process BCFTOOLS_ISEC { $options.args \\ -p $prefix \\ *.vcf.gz - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bcftools/isec/meta.yml b/modules/bcftools/isec/meta.yml index fb8f4b4e..7a75a3af 100644 --- a/modules/bcftools/isec/meta.yml +++ b/modules/bcftools/isec/meta.yml @@ -42,7 +42,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/merge/functions.nf b/modules/bcftools/merge/functions.nf index da9da093..85628ee0 100644 --- a/modules/bcftools/merge/functions.nf +++ b/modules/bcftools/merge/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bcftools/merge/main.nf b/modules/bcftools/merge/main.nf index 66c52281..7d8ab670 100644 --- a/modules/bcftools/merge/main.nf +++ b/modules/bcftools/merge/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BCFTOOLS_MERGE { output: tuple val(meta), path("*.gz"), emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process BCFTOOLS_MERGE { --output ${prefix}.vcf.gz \\ $options.args \\ *.vcf.gz - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bcftools/merge/meta.yml b/modules/bcftools/merge/meta.yml index fad7966e..262d883a 100644 --- a/modules/bcftools/merge/meta.yml +++ b/modules/bcftools/merge/meta.yml @@ -40,7 +40,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/mpileup/functions.nf b/modules/bcftools/mpileup/functions.nf index da9da093..85628ee0 100644 --- a/modules/bcftools/mpileup/functions.nf +++ b/modules/bcftools/mpileup/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bcftools/mpileup/main.nf b/modules/bcftools/mpileup/main.nf index de9b951f..1f6eecaa 100644 --- a/modules/bcftools/mpileup/main.nf +++ b/modules/bcftools/mpileup/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process BCFTOOLS_MPILEUP { tuple val(meta), path("*.gz") , emit: vcf tuple val(meta), path("*.tbi") , emit: tbi tuple val(meta), path("*stats.txt"), emit: stats - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process BCFTOOLS_MPILEUP { | bcftools view --output-file ${prefix}.vcf.gz --output-type z $options.args3 tabix -p vcf -f ${prefix}.vcf.gz bcftools stats ${prefix}.vcf.gz > ${prefix}.bcftools_stats.txt - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bcftools/mpileup/meta.yml b/modules/bcftools/mpileup/meta.yml index a15aea14..44f2b81e 100644 --- a/modules/bcftools/mpileup/meta.yml +++ b/modules/bcftools/mpileup/meta.yml @@ -46,7 +46,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/norm/functions.nf b/modules/bcftools/norm/functions.nf index da9da093..85628ee0 100644 --- a/modules/bcftools/norm/functions.nf +++ b/modules/bcftools/norm/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bcftools/norm/main.nf b/modules/bcftools/norm/main.nf index 5d8a7c3c..454fc1d2 100644 --- a/modules/bcftools/norm/main.nf +++ b/modules/bcftools/norm/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BCFTOOLS_NORM { output: tuple val(meta), path("*.gz") , emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process BCFTOOLS_NORM { --threads $task.cpus \\ ${vcf} - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bcftools/norm/meta.yml b/modules/bcftools/norm/meta.yml index abeb8904..f2534452 100644 --- a/modules/bcftools/norm/meta.yml +++ b/modules/bcftools/norm/meta.yml @@ -40,6 +40,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/bcftools/query/functions.nf b/modules/bcftools/query/functions.nf index da9da093..85628ee0 100644 --- a/modules/bcftools/query/functions.nf +++ b/modules/bcftools/query/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bcftools/query/main.nf b/modules/bcftools/query/main.nf index 26eeca63..4815ae90 100644 --- a/modules/bcftools/query/main.nf +++ b/modules/bcftools/query/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process BCFTOOLS_QUERY { output: tuple val(meta), path("*.gz") , emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -44,6 +44,9 @@ process BCFTOOLS_QUERY { $options.args \\ ${vcf} - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bcftools/query/meta.yml b/modules/bcftools/query/meta.yml index 7806c7db..57570c64 100644 --- a/modules/bcftools/query/meta.yml +++ b/modules/bcftools/query/meta.yml @@ -56,6 +56,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/bcftools/reheader/functions.nf b/modules/bcftools/reheader/functions.nf index da9da093..85628ee0 100644 --- a/modules/bcftools/reheader/functions.nf +++ b/modules/bcftools/reheader/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bcftools/reheader/main.nf b/modules/bcftools/reheader/main.nf index 53b00411..a949b6e9 100644 --- a/modules/bcftools/reheader/main.nf +++ b/modules/bcftools/reheader/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process BCFTOOLS_REHEADER { output: tuple val(meta), path("*.vcf.gz"), emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process BCFTOOLS_REHEADER { -o ${prefix}.vcf.gz \\ $vcf - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bcftools/reheader/meta.yml b/modules/bcftools/reheader/meta.yml index 1b9c1a8b..823e3279 100644 --- a/modules/bcftools/reheader/meta.yml +++ b/modules/bcftools/reheader/meta.yml @@ -41,7 +41,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - vcf: type: file description: VCF with updated header diff --git a/modules/bcftools/stats/functions.nf b/modules/bcftools/stats/functions.nf index da9da093..85628ee0 100644 --- a/modules/bcftools/stats/functions.nf +++ b/modules/bcftools/stats/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bcftools/stats/main.nf b/modules/bcftools/stats/main.nf index 90be5d2b..f5b1f6b1 100644 --- a/modules/bcftools/stats/main.nf +++ b/modules/bcftools/stats/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process BCFTOOLS_STATS { output: tuple val(meta), path("*stats.txt"), emit: stats - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bcftools stats $options.args $vcf > ${prefix}.bcftools_stats.txt - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bcftools/stats/meta.yml b/modules/bcftools/stats/meta.yml index 6b70f83a..33675cb9 100644 --- a/modules/bcftools/stats/meta.yml +++ b/modules/bcftools/stats/meta.yml @@ -35,7 +35,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/view/functions.nf b/modules/bcftools/view/functions.nf index da9da093..85628ee0 100644 --- a/modules/bcftools/view/functions.nf +++ b/modules/bcftools/view/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bcftools/view/main.nf b/modules/bcftools/view/main.nf index 92f7036b..5a944e89 100644 --- a/modules/bcftools/view/main.nf +++ b/modules/bcftools/view/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process BCFTOOLS_VIEW { output: tuple val(meta), path("*.gz") , emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -46,6 +46,9 @@ process BCFTOOLS_VIEW { --threads $task.cpus \\ ${vcf} - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bcftools/view/meta.yml b/modules/bcftools/view/meta.yml index 947e2562..e37e41b5 100644 --- a/modules/bcftools/view/meta.yml +++ b/modules/bcftools/view/meta.yml @@ -57,6 +57,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/bedtools/bamtobed/functions.nf b/modules/bedtools/bamtobed/functions.nf index da9da093..85628ee0 100644 --- a/modules/bedtools/bamtobed/functions.nf +++ b/modules/bedtools/bamtobed/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bedtools/bamtobed/main.nf b/modules/bedtools/bamtobed/main.nf index 22f5713c..19986371 100644 --- a/modules/bedtools/bamtobed/main.nf +++ b/modules/bedtools/bamtobed/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BEDTOOLS_BAMTOBED { output: tuple val(meta), path("*.bed"), emit: bed - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process BEDTOOLS_BAMTOBED { -i $bam \\ | bedtools sort > ${prefix}.bed - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } diff --git a/modules/bedtools/bamtobed/meta.yml b/modules/bedtools/bamtobed/meta.yml index 3594d2d4..5d7889ea 100644 --- a/modules/bedtools/bamtobed/meta.yml +++ b/modules/bedtools/bamtobed/meta.yml @@ -31,7 +31,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@yuukiiwa" - "@drpatelh" diff --git a/modules/bedtools/complement/functions.nf b/modules/bedtools/complement/functions.nf index da9da093..85628ee0 100644 --- a/modules/bedtools/complement/functions.nf +++ b/modules/bedtools/complement/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bedtools/complement/main.nf b/modules/bedtools/complement/main.nf index 3c39f289..5b3bbea9 100644 --- a/modules/bedtools/complement/main.nf +++ b/modules/bedtools/complement/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BEDTOOLS_COMPLEMENT { output: tuple val(meta), path('*.bed'), emit: bed - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process BEDTOOLS_COMPLEMENT { $options.args \\ > ${prefix}.bed - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } diff --git a/modules/bedtools/complement/meta.yml b/modules/bedtools/complement/meta.yml index 60d97263..183c9e8f 100644 --- a/modules/bedtools/complement/meta.yml +++ b/modules/bedtools/complement/meta.yml @@ -35,7 +35,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" diff --git a/modules/bedtools/genomecov/functions.nf b/modules/bedtools/genomecov/functions.nf index da9da093..85628ee0 100644 --- a/modules/bedtools/genomecov/functions.nf +++ b/modules/bedtools/genomecov/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bedtools/genomecov/main.nf b/modules/bedtools/genomecov/main.nf index f9b87464..b5deedf1 100644 --- a/modules/bedtools/genomecov/main.nf +++ b/modules/bedtools/genomecov/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process BEDTOOLS_GENOMECOV { output: tuple val(meta), path("*.${extension}"), emit: genomecov - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -38,7 +38,10 @@ process BEDTOOLS_GENOMECOV { $options.args \\ > ${prefix}.${extension} - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } else { """ @@ -49,7 +52,10 @@ process BEDTOOLS_GENOMECOV { $options.args \\ > ${prefix}.${extension} - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } } diff --git a/modules/bedtools/genomecov/meta.yml b/modules/bedtools/genomecov/meta.yml index f629665c..7f28c185 100644 --- a/modules/bedtools/genomecov/meta.yml +++ b/modules/bedtools/genomecov/meta.yml @@ -38,7 +38,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" diff --git a/modules/bedtools/getfasta/functions.nf b/modules/bedtools/getfasta/functions.nf index da9da093..85628ee0 100644 --- a/modules/bedtools/getfasta/functions.nf +++ b/modules/bedtools/getfasta/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bedtools/getfasta/main.nf b/modules/bedtools/getfasta/main.nf index 374a310b..72e457dc 100644 --- a/modules/bedtools/getfasta/main.nf +++ b/modules/bedtools/getfasta/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BEDTOOLS_GETFASTA { output: path "*.fa" , emit: fasta - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process BEDTOOLS_GETFASTA { -bed $bed \\ -fo ${prefix}.fa - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } diff --git a/modules/bedtools/getfasta/meta.yml b/modules/bedtools/getfasta/meta.yml index 1ca63bdc..1ddd4bbb 100644 --- a/modules/bedtools/getfasta/meta.yml +++ b/modules/bedtools/getfasta/meta.yml @@ -27,7 +27,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bedtools/intersect/functions.nf b/modules/bedtools/intersect/functions.nf index da9da093..85628ee0 100644 --- a/modules/bedtools/intersect/functions.nf +++ b/modules/bedtools/intersect/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bedtools/intersect/main.nf b/modules/bedtools/intersect/main.nf index 4519783a..b75bd116 100644 --- a/modules/bedtools/intersect/main.nf +++ b/modules/bedtools/intersect/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BEDTOOLS_INTERSECT { output: tuple val(meta), path("*.${extension}"), emit: intersect - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process BEDTOOLS_INTERSECT { $options.args \\ > ${prefix}.${extension} - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } diff --git a/modules/bedtools/intersect/meta.yml b/modules/bedtools/intersect/meta.yml index e944e355..2c229884 100644 --- a/modules/bedtools/intersect/meta.yml +++ b/modules/bedtools/intersect/meta.yml @@ -38,7 +38,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" diff --git a/modules/bedtools/makewindows/functions.nf b/modules/bedtools/makewindows/functions.nf index da9da093..85628ee0 100644 --- a/modules/bedtools/makewindows/functions.nf +++ b/modules/bedtools/makewindows/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bedtools/makewindows/main.nf b/modules/bedtools/makewindows/main.nf index d3e82f86..5e93f0ae 100644 --- a/modules/bedtools/makewindows/main.nf +++ b/modules/bedtools/makewindows/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BEDTOOLS_MAKEWINDOWS { output: tuple val(meta), path("*.tab"), emit: tab - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process BEDTOOLS_MAKEWINDOWS { $options.args \\ > ${prefix}.tab - echo \$(bedtools --version) | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } diff --git a/modules/bedtools/makewindows/meta.yml b/modules/bedtools/makewindows/meta.yml index 3c1378b8..dcddbc75 100644 --- a/modules/bedtools/makewindows/meta.yml +++ b/modules/bedtools/makewindows/meta.yml @@ -34,7 +34,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - tab: type: file description: Windows TAB file (BED or BED-like format) diff --git a/modules/bedtools/maskfasta/functions.nf b/modules/bedtools/maskfasta/functions.nf index da9da093..85628ee0 100644 --- a/modules/bedtools/maskfasta/functions.nf +++ b/modules/bedtools/maskfasta/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bedtools/maskfasta/main.nf b/modules/bedtools/maskfasta/main.nf index 02110149..67097f3f 100644 --- a/modules/bedtools/maskfasta/main.nf +++ b/modules/bedtools/maskfasta/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BEDTOOLS_MASKFASTA { output: tuple val(meta), path("*.fa"), emit: fasta - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process BEDTOOLS_MASKFASTA { -fi $fasta \\ -bed $bed \\ -fo ${prefix}.fa - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } diff --git a/modules/bedtools/maskfasta/meta.yml b/modules/bedtools/maskfasta/meta.yml index b6e494e6..0474118b 100644 --- a/modules/bedtools/maskfasta/meta.yml +++ b/modules/bedtools/maskfasta/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bedtools/merge/functions.nf b/modules/bedtools/merge/functions.nf index da9da093..85628ee0 100644 --- a/modules/bedtools/merge/functions.nf +++ b/modules/bedtools/merge/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bedtools/merge/main.nf b/modules/bedtools/merge/main.nf index 4ac7d1a5..ba8348af 100644 --- a/modules/bedtools/merge/main.nf +++ b/modules/bedtools/merge/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BEDTOOLS_MERGE { output: tuple val(meta), path('*.bed'), emit: bed - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process BEDTOOLS_MERGE { $options.args \\ > ${prefix}.bed - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } diff --git a/modules/bedtools/merge/meta.yml b/modules/bedtools/merge/meta.yml index f75bea67..0618c0ff 100644 --- a/modules/bedtools/merge/meta.yml +++ b/modules/bedtools/merge/meta.yml @@ -31,7 +31,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" diff --git a/modules/bedtools/slop/functions.nf b/modules/bedtools/slop/functions.nf index da9da093..85628ee0 100644 --- a/modules/bedtools/slop/functions.nf +++ b/modules/bedtools/slop/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bedtools/slop/main.nf b/modules/bedtools/slop/main.nf index 33dc1930..6644b8db 100644 --- a/modules/bedtools/slop/main.nf +++ b/modules/bedtools/slop/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BEDTOOLS_SLOP { output: tuple val(meta), path("*.bed"), emit: bed - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,7 +37,10 @@ process BEDTOOLS_SLOP { $options.args \\ > ${prefix}.bed - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } diff --git a/modules/bedtools/slop/meta.yml b/modules/bedtools/slop/meta.yml index 3d4e2091..bdcdc1d2 100644 --- a/modules/bedtools/slop/meta.yml +++ b/modules/bedtools/slop/meta.yml @@ -31,7 +31,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" diff --git a/modules/bedtools/sort/functions.nf b/modules/bedtools/sort/functions.nf index da9da093..85628ee0 100644 --- a/modules/bedtools/sort/functions.nf +++ b/modules/bedtools/sort/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bedtools/sort/main.nf b/modules/bedtools/sort/main.nf index 908514d9..acc4a593 100644 --- a/modules/bedtools/sort/main.nf +++ b/modules/bedtools/sort/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BEDTOOLS_SORT { output: tuple val(meta), path('*.bed'), emit: bed - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process BEDTOOLS_SORT { $options.args \\ > ${prefix}.bed - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } diff --git a/modules/bedtools/sort/meta.yml b/modules/bedtools/sort/meta.yml index 9962a4f2..d09886a5 100644 --- a/modules/bedtools/sort/meta.yml +++ b/modules/bedtools/sort/meta.yml @@ -31,7 +31,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" diff --git a/modules/bedtools/subtract/functions.nf b/modules/bedtools/subtract/functions.nf index da9da093..85628ee0 100644 --- a/modules/bedtools/subtract/functions.nf +++ b/modules/bedtools/subtract/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bedtools/subtract/main.nf b/modules/bedtools/subtract/main.nf index 5780cd65..a8e2ad02 100644 --- a/modules/bedtools/subtract/main.nf +++ b/modules/bedtools/subtract/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BEDTOOLS_SUBTRACT { output: tuple val(meta), path("*.bed"), emit: bed - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process BEDTOOLS_SUBTRACT { $options.args \\ > ${prefix}.bed - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } diff --git a/modules/bedtools/subtract/meta.yml b/modules/bedtools/subtract/meta.yml index a1a1e087..8c99b80a 100644 --- a/modules/bedtools/subtract/meta.yml +++ b/modules/bedtools/subtract/meta.yml @@ -39,7 +39,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@sidorov-si" diff --git a/modules/bismark/align/functions.nf b/modules/bismark/align/functions.nf index da9da093..85628ee0 100644 --- a/modules/bismark/align/functions.nf +++ b/modules/bismark/align/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bismark/align/main.nf b/modules/bismark/align/main.nf index 02f439f6..00510272 100644 --- a/modules/bismark/align/main.nf +++ b/modules/bismark/align/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process BISMARK_ALIGN { tuple val(meta), path("*bam") , emit: bam tuple val(meta), path("*report.txt"), emit: report tuple val(meta), path("*fq.gz") , optional:true, emit: unmapped - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process BISMARK_ALIGN { --genome $index \\ --bam - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + END_VERSIONS """ } diff --git a/modules/bismark/align/meta.yml b/modules/bismark/align/meta.yml index ed3b1999..d9bacf04 100644 --- a/modules/bismark/align/meta.yml +++ b/modules/bismark/align/meta.yml @@ -53,6 +53,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/deduplicate/functions.nf b/modules/bismark/deduplicate/functions.nf index da9da093..85628ee0 100644 --- a/modules/bismark/deduplicate/functions.nf +++ b/modules/bismark/deduplicate/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bismark/deduplicate/main.nf b/modules/bismark/deduplicate/main.nf index 6d7010af..6e3219f0 100644 --- a/modules/bismark/deduplicate/main.nf +++ b/modules/bismark/deduplicate/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BISMARK_DEDUPLICATE { output: tuple val(meta), path("*.deduplicated.bam") , emit: bam tuple val(meta), path("*.deduplication_report.txt"), emit: report - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process BISMARK_DEDUPLICATE { $seqtype \\ --bam $bam - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + END_VERSIONS """ } diff --git a/modules/bismark/deduplicate/meta.yml b/modules/bismark/deduplicate/meta.yml index 117eed49..11d8797b 100644 --- a/modules/bismark/deduplicate/meta.yml +++ b/modules/bismark/deduplicate/meta.yml @@ -46,6 +46,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/genomepreparation/functions.nf b/modules/bismark/genomepreparation/functions.nf index da9da093..85628ee0 100644 --- a/modules/bismark/genomepreparation/functions.nf +++ b/modules/bismark/genomepreparation/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bismark/genomepreparation/main.nf b/modules/bismark/genomepreparation/main.nf index 3d48d955..029804d9 100644 --- a/modules/bismark/genomepreparation/main.nf +++ b/modules/bismark/genomepreparation/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BISMARK_GENOMEPREPARATION { output: path "BismarkIndex" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -32,6 +32,9 @@ process BISMARK_GENOMEPREPARATION { $options.args \\ BismarkIndex - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + END_VERSIONS """ } diff --git a/modules/bismark/genomepreparation/meta.yml b/modules/bismark/genomepreparation/meta.yml index a31add8a..6d267343 100644 --- a/modules/bismark/genomepreparation/meta.yml +++ b/modules/bismark/genomepreparation/meta.yml @@ -31,6 +31,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/methylationextractor/functions.nf b/modules/bismark/methylationextractor/functions.nf index da9da093..85628ee0 100644 --- a/modules/bismark/methylationextractor/functions.nf +++ b/modules/bismark/methylationextractor/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bismark/methylationextractor/main.nf b/modules/bismark/methylationextractor/main.nf index cdc4999c..5968d38f 100644 --- a/modules/bismark/methylationextractor/main.nf +++ b/modules/bismark/methylationextractor/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -28,7 +28,7 @@ process BISMARK_METHYLATIONEXTRACTOR { tuple val(meta), path("*.cov.gz") , emit: coverage tuple val(meta), path("*_splitting_report.txt"), emit: report tuple val(meta), path("*.M-bias.txt") , emit: mbias - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def seqtype = meta.single_end ? '-s' : '-p' @@ -43,6 +43,9 @@ process BISMARK_METHYLATIONEXTRACTOR { $options.args \\ $bam - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + END_VERSIONS """ } diff --git a/modules/bismark/methylationextractor/meta.yml b/modules/bismark/methylationextractor/meta.yml index a201b586..2ae7cf64 100644 --- a/modules/bismark/methylationextractor/meta.yml +++ b/modules/bismark/methylationextractor/meta.yml @@ -61,6 +61,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/report/functions.nf b/modules/bismark/report/functions.nf index da9da093..85628ee0 100644 --- a/modules/bismark/report/functions.nf +++ b/modules/bismark/report/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bismark/report/main.nf b/modules/bismark/report/main.nf index 180efc7e..8148b061 100644 --- a/modules/bismark/report/main.nf +++ b/modules/bismark/report/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process BISMARK_REPORT { output: tuple val(meta), path("*report.{html,txt}"), emit: report - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ bismark2report $options.args - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + END_VERSIONS """ } diff --git a/modules/bismark/report/meta.yml b/modules/bismark/report/meta.yml index 3e8da1d0..57b8c746 100644 --- a/modules/bismark/report/meta.yml +++ b/modules/bismark/report/meta.yml @@ -54,6 +54,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/summary/functions.nf b/modules/bismark/summary/functions.nf index da9da093..85628ee0 100644 --- a/modules/bismark/summary/functions.nf +++ b/modules/bismark/summary/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bismark/summary/main.nf b/modules/bismark/summary/main.nf index f5c03529..ae8ac27c 100644 --- a/modules/bismark/summary/main.nf +++ b/modules/bismark/summary/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,13 +26,16 @@ process BISMARK_SUMMARY { output: path "*report.{html,txt}", emit: summary - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ bismark2summary - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + END_VERSIONS """ } diff --git a/modules/bismark/summary/meta.yml b/modules/bismark/summary/meta.yml index a88bf8f6..37d8951b 100644 --- a/modules/bismark/summary/meta.yml +++ b/modules/bismark/summary/meta.yml @@ -48,6 +48,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/blast/blastn/functions.nf b/modules/blast/blastn/functions.nf index da9da093..85628ee0 100644 --- a/modules/blast/blastn/functions.nf +++ b/modules/blast/blastn/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/blast/blastn/main.nf b/modules/blast/blastn/main.nf index 87e012e2..1146ede4 100644 --- a/modules/blast/blastn/main.nf +++ b/modules/blast/blastn/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BLAST_BLASTN { output: tuple val(meta), path('*.blastn.txt'), emit: txt - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process BLAST_BLASTN { -query $fasta \\ $options.args \\ -out ${prefix}.blastn.txt - echo \$(blastn -version 2>&1) | sed 's/^.*blastn: //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(blastn -version 2>&1 | sed 's/^.*blastn: //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/blast/blastn/meta.yml b/modules/blast/blastn/meta.yml index d04889a8..b4a832ea 100644 --- a/modules/blast/blastn/meta.yml +++ b/modules/blast/blastn/meta.yml @@ -34,7 +34,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/blast/makeblastdb/functions.nf b/modules/blast/makeblastdb/functions.nf index da9da093..85628ee0 100644 --- a/modules/blast/makeblastdb/functions.nf +++ b/modules/blast/makeblastdb/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/blast/makeblastdb/main.nf b/modules/blast/makeblastdb/main.nf index c938e8f6..9ee02108 100644 --- a/modules/blast/makeblastdb/main.nf +++ b/modules/blast/makeblastdb/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process BLAST_MAKEBLASTDB { output: path 'blast_db' , emit: db - path '*.version.txt', emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process BLAST_MAKEBLASTDB { $options.args mkdir blast_db mv ${fasta}* blast_db - echo \$(blastn -version 2>&1) | sed 's/^.*blastn: //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(blastn -version 2>&1 | sed 's/^.*blastn: //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/blast/makeblastdb/meta.yml b/modules/blast/makeblastdb/meta.yml index 0ea4903f..9a5957db 100644 --- a/modules/blast/makeblastdb/meta.yml +++ b/modules/blast/makeblastdb/meta.yml @@ -24,7 +24,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bowtie/align/functions.nf b/modules/bowtie/align/functions.nf index da9da093..85628ee0 100644 --- a/modules/bowtie/align/functions.nf +++ b/modules/bowtie/align/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bowtie/align/main.nf b/modules/bowtie/align/main.nf index 9cafbfd2..3357a592 100644 --- a/modules/bowtie/align/main.nf +++ b/modules/bowtie/align/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process BOWTIE_ALIGN { output: tuple val(meta), path('*.bam'), emit: bam tuple val(meta), path('*.out'), emit: log - path '*.version.txt' , emit: version + path "versions.yml" , emit: version tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq script: @@ -55,6 +55,9 @@ process BOWTIE_ALIGN { gzip ${prefix}.unmapped_2.fastq fi - echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bowtie --version 2>&1 | sed 's/^.*bowtie-align-s version //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bowtie/align/meta.yml b/modules/bowtie/align/meta.yml index bea8b4dd..e5ada585 100644 --- a/modules/bowtie/align/meta.yml +++ b/modules/bowtie/align/meta.yml @@ -36,7 +36,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - fastq: type: file description: Unaligned FastQ files diff --git a/modules/bowtie/build/functions.nf b/modules/bowtie/build/functions.nf index da9da093..85628ee0 100644 --- a/modules/bowtie/build/functions.nf +++ b/modules/bowtie/build/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bowtie/build/main.nf b/modules/bowtie/build/main.nf index 3a6071a9..382e6717 100644 --- a/modules/bowtie/build/main.nf +++ b/modules/bowtie/build/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process BOWTIE_BUILD { output: path 'bowtie' , emit: index - path '*.version.txt', emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ mkdir bowtie bowtie-build --threads $task.cpus $fasta bowtie/${fasta.baseName} - echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bowtie --version 2>&1 | sed 's/^.*bowtie-align-s version //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bowtie/build/meta.yml b/modules/bowtie/build/meta.yml index a2da42c6..e97068f6 100644 --- a/modules/bowtie/build/meta.yml +++ b/modules/bowtie/build/meta.yml @@ -25,7 +25,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@kevinmenden" - "@drpatelh" diff --git a/modules/bowtie2/align/functions.nf b/modules/bowtie2/align/functions.nf index da9da093..85628ee0 100644 --- a/modules/bowtie2/align/functions.nf +++ b/modules/bowtie2/align/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bowtie2/align/main.nf b/modules/bowtie2/align/main.nf index d43d479d..e1657a8f 100644 --- a/modules/bowtie2/align/main.nf +++ b/modules/bowtie2/align/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process BOWTIE2_ALIGN { output: tuple val(meta), path('*.bam'), emit: bam tuple val(meta), path('*.log'), emit: log - path '*.version.txt' , emit: version + path "versions.yml" , emit: version tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq script: @@ -45,7 +45,10 @@ process BOWTIE2_ALIGN { 2> ${prefix}.bowtie2.log \\ | samtools view -@ ${split_cpus} $options.args2 -bhS -o ${prefix}.bam - - echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bowtie2 --version 2>&1 | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') + END_VERSIONS """ } else { def unaligned = params.save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' @@ -67,7 +70,10 @@ process BOWTIE2_ALIGN { if [ -f ${prefix}.unmapped.fastq.2.gz ]; then mv ${prefix}.unmapped.fastq.2.gz ${prefix}.unmapped_2.fastq.gz fi - echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bowtie2 --version 2>&1 | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') + END_VERSIONS """ } } diff --git a/modules/bowtie2/align/meta.yml b/modules/bowtie2/align/meta.yml index 9d9cd004..cba6eacf 100644 --- a/modules/bowtie2/align/meta.yml +++ b/modules/bowtie2/align/meta.yml @@ -36,7 +36,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - fastq: type: file description: Unaligned FastQ files diff --git a/modules/bowtie2/build/functions.nf b/modules/bowtie2/build/functions.nf index da9da093..85628ee0 100644 --- a/modules/bowtie2/build/functions.nf +++ b/modules/bowtie2/build/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bowtie2/build/main.nf b/modules/bowtie2/build/main.nf index 442fed18..04880aeb 100644 --- a/modules/bowtie2/build/main.nf +++ b/modules/bowtie2/build/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process BOWTIE2_BUILD { output: path 'bowtie2' , emit: index - path '*.version.txt', emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ mkdir bowtie2 bowtie2-build $options.args --threads $task.cpus $fasta bowtie2/${fasta.baseName} - echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bowtie2 --version 2>&1 | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/bowtie2/build/meta.yml b/modules/bowtie2/build/meta.yml index 0a4cd3de..70045f3c 100644 --- a/modules/bowtie2/build/meta.yml +++ b/modules/bowtie2/build/meta.yml @@ -26,7 +26,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bwa/aln/functions.nf b/modules/bwa/aln/functions.nf index da9da093..85628ee0 100644 --- a/modules/bwa/aln/functions.nf +++ b/modules/bwa/aln/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bwa/aln/main.nf b/modules/bwa/aln/main.nf index 59f1396c..8728884c 100644 --- a/modules/bwa/aln/main.nf +++ b/modules/bwa/aln/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BWA_ALN { output: tuple val(meta), path("*.sai"), emit: sai - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -41,7 +41,10 @@ process BWA_ALN { \$INDEX \\ ${reads} - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + END_VERSIONS """ } else { """ @@ -61,7 +64,10 @@ process BWA_ALN { \$INDEX \\ ${reads[1]} - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + END_VERSIONS """ } } diff --git a/modules/bwa/aln/meta.yml b/modules/bwa/aln/meta.yml index 4f81588d..b3797eac 100644 --- a/modules/bwa/aln/meta.yml +++ b/modules/bwa/aln/meta.yml @@ -44,7 +44,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - sai: type: file description: Single or paired SA coordinate files diff --git a/modules/bwa/index/functions.nf b/modules/bwa/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/bwa/index/functions.nf +++ b/modules/bwa/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bwa/index/main.nf b/modules/bwa/index/main.nf index aabd187c..9b64bd37 100644 --- a/modules/bwa/index/main.nf +++ b/modules/bwa/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process BWA_INDEX { output: path "bwa" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ mkdir bwa bwa index $options.args $fasta -p bwa/${fasta.baseName} - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + END_VERSIONS """ } diff --git a/modules/bwa/index/meta.yml b/modules/bwa/index/meta.yml index 181204c3..43ffd73d 100644 --- a/modules/bwa/index/meta.yml +++ b/modules/bwa/index/meta.yml @@ -25,7 +25,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@maxulysse" diff --git a/modules/bwa/mem/functions.nf b/modules/bwa/mem/functions.nf index da9da093..85628ee0 100644 --- a/modules/bwa/mem/functions.nf +++ b/modules/bwa/mem/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bwa/mem/main.nf b/modules/bwa/mem/main.nf index 5e139d5a..b9096cb8 100644 --- a/modules/bwa/mem/main.nf +++ b/modules/bwa/mem/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BWA_MEM { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def split_cpus = Math.floor(task.cpus/2) @@ -42,6 +42,9 @@ process BWA_MEM { $reads \\ | samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + END_VERSIONS """ } diff --git a/modules/bwa/mem/meta.yml b/modules/bwa/mem/meta.yml index 693c5450..618f20d5 100644 --- a/modules/bwa/mem/meta.yml +++ b/modules/bwa/mem/meta.yml @@ -39,7 +39,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@jeremy1805" diff --git a/modules/bwa/sampe/functions.nf b/modules/bwa/sampe/functions.nf index da9da093..85628ee0 100644 --- a/modules/bwa/sampe/functions.nf +++ b/modules/bwa/sampe/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bwa/sampe/main.nf b/modules/bwa/sampe/main.nf index 7a724908..cb3493c8 100644 --- a/modules/bwa/sampe/main.nf +++ b/modules/bwa/sampe/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BWA_SAMPE { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -41,6 +41,9 @@ process BWA_SAMPE { $sai \\ $reads | samtools sort -@ ${task.cpus - 1} -O bam - > ${prefix}.bam - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + END_VERSIONS """ } diff --git a/modules/bwa/sampe/meta.yml b/modules/bwa/sampe/meta.yml index 6dc1bcc5..aeb592f7 100644 --- a/modules/bwa/sampe/meta.yml +++ b/modules/bwa/sampe/meta.yml @@ -48,7 +48,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: BAM file diff --git a/modules/bwa/samse/functions.nf b/modules/bwa/samse/functions.nf index da9da093..85628ee0 100644 --- a/modules/bwa/samse/functions.nf +++ b/modules/bwa/samse/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bwa/samse/main.nf b/modules/bwa/samse/main.nf index 3fe8bdd8..82d23854 100644 --- a/modules/bwa/samse/main.nf +++ b/modules/bwa/samse/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BWA_SAMSE { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -41,6 +41,9 @@ process BWA_SAMSE { $sai \\ $reads | samtools sort -@ ${task.cpus - 1} -O bam - > ${prefix}.bam - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + END_VERSIONS """ } diff --git a/modules/bwa/samse/meta.yml b/modules/bwa/samse/meta.yml index 89917703..3c44741d 100644 --- a/modules/bwa/samse/meta.yml +++ b/modules/bwa/samse/meta.yml @@ -49,7 +49,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: BAM file diff --git a/modules/bwamem2/index/functions.nf b/modules/bwamem2/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/bwamem2/index/functions.nf +++ b/modules/bwamem2/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bwamem2/index/main.nf b/modules/bwamem2/index/main.nf index b667f266..f052d172 100644 --- a/modules/bwamem2/index/main.nf +++ b/modules/bwamem2/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process BWAMEM2_INDEX { output: path "bwamem2" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ mkdir bwamem2 bwa-mem2 index $options.args $fasta -p bwamem2/${fasta} - echo \$(bwa-mem2 version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bwa-mem2 version 2>&1) + END_VERSIONS """ } diff --git a/modules/bwamem2/index/meta.yml b/modules/bwamem2/index/meta.yml index 9d717f73..ee84ccfc 100644 --- a/modules/bwamem2/index/meta.yml +++ b/modules/bwamem2/index/meta.yml @@ -24,6 +24,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/bwamem2/mem/functions.nf b/modules/bwamem2/mem/functions.nf index da9da093..85628ee0 100644 --- a/modules/bwamem2/mem/functions.nf +++ b/modules/bwamem2/mem/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bwamem2/mem/main.nf b/modules/bwamem2/mem/main.nf index 5d0ff617..2838cdda 100644 --- a/modules/bwamem2/mem/main.nf +++ b/modules/bwamem2/mem/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BWAMEM2_MEM { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def split_cpus = Math.floor(task.cpus/2) @@ -42,6 +42,9 @@ process BWAMEM2_MEM { $reads \\ | samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - - echo \$(bwa-mem2 version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bwa-mem2 version 2>&1) + END_VERSIONS """ } diff --git a/modules/bwamem2/mem/meta.yml b/modules/bwamem2/mem/meta.yml index 2fc7713d..434fc7ca 100644 --- a/modules/bwamem2/mem/meta.yml +++ b/modules/bwamem2/mem/meta.yml @@ -39,6 +39,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/bwameth/align/functions.nf b/modules/bwameth/align/functions.nf index da9da093..85628ee0 100644 --- a/modules/bwameth/align/functions.nf +++ b/modules/bwameth/align/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bwameth/align/main.nf b/modules/bwameth/align/main.nf index 0e8db58f..0f605bd1 100644 --- a/modules/bwameth/align/main.nf +++ b/modules/bwameth/align/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process BWAMETH_ALIGN { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def split_cpus = Math.floor(task.cpus/2) @@ -42,6 +42,9 @@ process BWAMETH_ALIGN { $reads \\ | samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - - echo \$(bwameth.py --version 2>&1) | cut -f2 -d" " > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bwameth.py --version 2>&1 | cut -f2 -d" ") + END_VERSIONS """ } diff --git a/modules/bwameth/align/meta.yml b/modules/bwameth/align/meta.yml index ac578031..03bd66f7 100644 --- a/modules/bwameth/align/meta.yml +++ b/modules/bwameth/align/meta.yml @@ -46,6 +46,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bwameth/index/functions.nf b/modules/bwameth/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/bwameth/index/functions.nf +++ b/modules/bwameth/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/bwameth/index/main.nf b/modules/bwameth/index/main.nf index dbea0ae4..7b75d328 100644 --- a/modules/bwameth/index/main.nf +++ b/modules/bwameth/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process BWAMETH_INDEX { output: path "bwameth" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ bwameth.py index $fasta - echo \$(bwameth.py --version 2>&1) | cut -f2 -d" " > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bwameth.py --version 2>&1 | cut -f2 -d" ") + END_VERSIONS """ } diff --git a/modules/bwameth/index/meta.yml b/modules/bwameth/index/meta.yml index 79c54862..b07dbde5 100644 --- a/modules/bwameth/index/meta.yml +++ b/modules/bwameth/index/meta.yml @@ -27,6 +27,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/cat/cat/functions.nf b/modules/cat/cat/functions.nf index da9da093..85628ee0 100644 --- a/modules/cat/cat/functions.nf +++ b/modules/cat/cat/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/cat/cat/main.nf b/modules/cat/cat/main.nf index 1c7dbd7c..2dc9944f 100644 --- a/modules/cat/cat/main.nf +++ b/modules/cat/cat/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process CAT_CAT { output: path "${file_out}*" , emit: file_out - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def file_list = files_in.collect { it.toString() } @@ -47,7 +47,10 @@ process CAT_CAT { $command2 \\ > $file_out - echo \$(pigz --version 2>&1) | sed 's/pigz //g' > pigz.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) + END_VERSIONS """ } } diff --git a/modules/cat/cat/meta.yml b/modules/cat/cat/meta.yml index a1318b19..d283107e 100644 --- a/modules/cat/cat/meta.yml +++ b/modules/cat/cat/meta.yml @@ -24,7 +24,7 @@ output: - version: type: file description: File containing version of the pigz software - pattern: "*.{version.txt}" + pattern: "versions.yml" - file_out: type: file description: Concatenated file. Will be gzipped if file_out ends with ".gz" diff --git a/modules/cat/fastq/functions.nf b/modules/cat/fastq/functions.nf index da9da093..85628ee0 100644 --- a/modules/cat/fastq/functions.nf +++ b/modules/cat/fastq/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/chromap/chromap/functions.nf b/modules/chromap/chromap/functions.nf index da9da093..85628ee0 100644 --- a/modules/chromap/chromap/functions.nf +++ b/modules/chromap/chromap/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/chromap/chromap/main.nf b/modules/chromap/chromap/main.nf index be60c6bd..cbee7fc0 100644 --- a/modules/chromap/chromap/main.nf +++ b/modules/chromap/chromap/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -34,7 +34,7 @@ process CHROMAP_CHROMAP { tuple val(meta), path("*.bam") , optional:true, emit: bam tuple val(meta), path("*.tagAlign.gz"), optional:true, emit: tagAlign tuple val(meta), path("*.pairs.gz") , optional:true, emit: pairs - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -75,7 +75,10 @@ process CHROMAP_CHROMAP { -1 ${reads.join(',')} \\ -o ${prefix}.${file_extension} - echo "$VERSION" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo "$VERSION") + END_VERSIONS """ + compression_cmds } else { """ @@ -87,7 +90,10 @@ process CHROMAP_CHROMAP { -2 ${reads[1]} \\ -o ${prefix}.${file_extension} - echo "$VERSION" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo "$VERSION") + END_VERSIONS """ + compression_cmds } } diff --git a/modules/chromap/chromap/meta.yml b/modules/chromap/chromap/meta.yml index c088ab35..d52e4202 100644 --- a/modules/chromap/chromap/meta.yml +++ b/modules/chromap/chromap/meta.yml @@ -66,7 +66,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bed: type: file description: BED file diff --git a/modules/chromap/index/functions.nf b/modules/chromap/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/chromap/index/functions.nf +++ b/modules/chromap/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/chromap/index/main.nf b/modules/chromap/index/main.nf index c8a75935..764eefe1 100644 --- a/modules/chromap/index/main.nf +++ b/modules/chromap/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process CHROMAP_INDEX { output: path "*.index" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process CHROMAP_INDEX { -t $task.cpus \\ -r $fasta \\ -o ${prefix}.index - echo "$VERSION" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo "$VERSION") + END_VERSIONS """ } diff --git a/modules/chromap/index/meta.yml b/modules/chromap/index/meta.yml index 6a86fbeb..0b3aba75 100644 --- a/modules/chromap/index/meta.yml +++ b/modules/chromap/index/meta.yml @@ -23,7 +23,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - index: type: file description: Index file of the reference genome diff --git a/modules/cnvkit/functions.nf b/modules/cnvkit/functions.nf index da9da093..85628ee0 100755 --- a/modules/cnvkit/functions.nf +++ b/modules/cnvkit/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/cnvkit/main.nf b/modules/cnvkit/main.nf index 4416919e..1219584c 100755 --- a/modules/cnvkit/main.nf +++ b/modules/cnvkit/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -28,7 +28,7 @@ process CNVKIT { tuple val(meta), path("*.cnn"), emit: cnn tuple val(meta), path("*.cnr"), emit: cnr tuple val(meta), path("*.cns"), emit: cns - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -41,6 +41,9 @@ process CNVKIT { --targets $targetfile \\ $options.args - echo \$(cnvkit.py version) | sed -e "s/cnvkit v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(cnvkit.py version | sed -e "s/cnvkit v//g") + END_VERSIONS """ } diff --git a/modules/cnvkit/meta.yml b/modules/cnvkit/meta.yml index d3d81ecc..5094308f 100755 --- a/modules/cnvkit/meta.yml +++ b/modules/cnvkit/meta.yml @@ -78,7 +78,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@kaurravneet4123" - "@KevinMenden" diff --git a/modules/cooler/digest/functions.nf b/modules/cooler/digest/functions.nf index da9da093..85628ee0 100644 --- a/modules/cooler/digest/functions.nf +++ b/modules/cooler/digest/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/cooler/digest/main.nf b/modules/cooler/digest/main.nf index bb4081d9..ee8b347e 100644 --- a/modules/cooler/digest/main.nf +++ b/modules/cooler/digest/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process COOLER_DIGEST { output: path "*.bed" , emit: bed - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process COOLER_DIGEST { $fasta \\ $enzyme - echo \$(cooler --version 2>&1) | sed 's/cooler, version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(cooler --version 2>&1 | sed 's/cooler, version //') + END_VERSIONS """ } diff --git a/modules/cooler/digest/meta.yml b/modules/cooler/digest/meta.yml index 4623adda..f46fbaff 100644 --- a/modules/cooler/digest/meta.yml +++ b/modules/cooler/digest/meta.yml @@ -29,7 +29,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bed: type: file description: A genome segmentation of restriction fragments as a BED file. diff --git a/modules/cooler/dump/functions.nf b/modules/cooler/dump/functions.nf index da9da093..85628ee0 100644 --- a/modules/cooler/dump/functions.nf +++ b/modules/cooler/dump/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/cooler/dump/main.nf b/modules/cooler/dump/main.nf index c381722c..7d456107 100644 --- a/modules/cooler/dump/main.nf +++ b/modules/cooler/dump/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process COOLER_DUMP { output: tuple val(meta), path("*.bedpe"), emit: bedpe - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process COOLER_DUMP { -o ${prefix}.bedpe \\ $cool - echo \$(cooler --version 2>&1) | sed 's/cooler, version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(cooler --version 2>&1 | sed 's/cooler, version //') + END_VERSIONS """ } diff --git a/modules/cooler/dump/meta.yml b/modules/cooler/dump/meta.yml index 0b2fcc60..ab2d0356 100644 --- a/modules/cooler/dump/meta.yml +++ b/modules/cooler/dump/meta.yml @@ -31,7 +31,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bedpe: type: file description: Output text file diff --git a/modules/cutadapt/functions.nf b/modules/cutadapt/functions.nf index da9da093..85628ee0 100644 --- a/modules/cutadapt/functions.nf +++ b/modules/cutadapt/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/cutadapt/main.nf b/modules/cutadapt/main.nf index 6dccc2bc..3baf9c7f 100644 --- a/modules/cutadapt/main.nf +++ b/modules/cutadapt/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process CUTADAPT { output: tuple val(meta), path('*.trim.fastq.gz'), emit: reads tuple val(meta), path('*.log') , emit: log - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process CUTADAPT { $trimmed \\ $reads \\ > ${prefix}.cutadapt.log - echo \$(cutadapt --version) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(cutadapt --version) + END_VERSIONS """ } diff --git a/modules/cutadapt/meta.yml b/modules/cutadapt/meta.yml index 14652343..87276306 100644 --- a/modules/cutadapt/meta.yml +++ b/modules/cutadapt/meta.yml @@ -39,7 +39,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/damageprofiler/functions.nf b/modules/damageprofiler/functions.nf index da9da093..85628ee0 100644 --- a/modules/damageprofiler/functions.nf +++ b/modules/damageprofiler/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/damageprofiler/main.nf b/modules/damageprofiler/main.nf index b370ae3b..cbb27944 100644 --- a/modules/damageprofiler/main.nf +++ b/modules/damageprofiler/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process DAMAGEPROFILER { output: tuple val(meta), path("${prefix}"), emit: results - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process DAMAGEPROFILER { $options.args - echo \$(damageprofiler -v) | sed 's/^DamageProfiler v//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(damageprofiler -v | sed 's/^DamageProfiler v//') + END_VERSIONS """ } diff --git a/modules/damageprofiler/meta.yml b/modules/damageprofiler/meta.yml index b32b9bff..9451f1b2 100644 --- a/modules/damageprofiler/meta.yml +++ b/modules/damageprofiler/meta.yml @@ -43,7 +43,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - results: type: dir description: DamageProfiler results directory diff --git a/modules/deeptools/computematrix/functions.nf b/modules/deeptools/computematrix/functions.nf index da9da093..85628ee0 100644 --- a/modules/deeptools/computematrix/functions.nf +++ b/modules/deeptools/computematrix/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/deeptools/computematrix/main.nf b/modules/deeptools/computematrix/main.nf index 739e7cc1..21a18526 100644 --- a/modules/deeptools/computematrix/main.nf +++ b/modules/deeptools/computematrix/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process DEEPTOOLS_COMPUTEMATRIX { output: tuple val(meta), path("*.mat.gz") , emit: matrix tuple val(meta), path("*.mat.tab"), emit: table - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process DEEPTOOLS_COMPUTEMATRIX { --outFileNameMatrix ${prefix}.computeMatrix.vals.mat.tab \\ --numberOfProcessors $task.cpus - computeMatrix --version | sed -e "s/computeMatrix //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(computeMatrix --version | sed -e "s/computeMatrix //g") + END_VERSIONS """ } diff --git a/modules/deeptools/computematrix/meta.yml b/modules/deeptools/computematrix/meta.yml index d6fd78c7..e3b0282d 100644 --- a/modules/deeptools/computematrix/meta.yml +++ b/modules/deeptools/computematrix/meta.yml @@ -49,7 +49,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@jeremy1805" diff --git a/modules/deeptools/plotfingerprint/functions.nf b/modules/deeptools/plotfingerprint/functions.nf index da9da093..85628ee0 100644 --- a/modules/deeptools/plotfingerprint/functions.nf +++ b/modules/deeptools/plotfingerprint/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/deeptools/plotfingerprint/main.nf b/modules/deeptools/plotfingerprint/main.nf index 56ecb688..9271a399 100644 --- a/modules/deeptools/plotfingerprint/main.nf +++ b/modules/deeptools/plotfingerprint/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process DEEPTOOLS_PLOTFINGERPRINT { tuple val(meta), path("*.pdf") , emit: pdf tuple val(meta), path("*.raw.txt") , emit: matrix tuple val(meta), path("*.qcmetrics.txt"), emit: metrics - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -41,6 +41,9 @@ process DEEPTOOLS_PLOTFINGERPRINT { --outQualityMetrics ${prefix}.plotFingerprint.qcmetrics.txt \\ --numberOfProcessors $task.cpus - plotFingerprint --version | sed -e "s/plotFingerprint //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(plotFingerprint --version | sed -e "s/plotFingerprint //g") + END_VERSIONS """ } diff --git a/modules/deeptools/plotfingerprint/meta.yml b/modules/deeptools/plotfingerprint/meta.yml index 6b6f9d8e..6ba88882 100644 --- a/modules/deeptools/plotfingerprint/meta.yml +++ b/modules/deeptools/plotfingerprint/meta.yml @@ -53,7 +53,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@emiller88" diff --git a/modules/deeptools/plotheatmap/functions.nf b/modules/deeptools/plotheatmap/functions.nf index da9da093..85628ee0 100644 --- a/modules/deeptools/plotheatmap/functions.nf +++ b/modules/deeptools/plotheatmap/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/deeptools/plotheatmap/main.nf b/modules/deeptools/plotheatmap/main.nf index 8e25d96f..49362666 100644 --- a/modules/deeptools/plotheatmap/main.nf +++ b/modules/deeptools/plotheatmap/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process DEEPTOOLS_PLOTHEATMAP { output: tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.tab"), emit: table - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process DEEPTOOLS_PLOTHEATMAP { --outFileName ${prefix}.plotHeatmap.pdf \\ --outFileNameMatrix ${prefix}.plotHeatmap.mat.tab - plotHeatmap --version | sed -e "s/plotHeatmap //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(plotHeatmap --version | sed -e "s/plotHeatmap //g") + END_VERSIONS """ } diff --git a/modules/deeptools/plotheatmap/meta.yml b/modules/deeptools/plotheatmap/meta.yml index 14311332..97af67f6 100644 --- a/modules/deeptools/plotheatmap/meta.yml +++ b/modules/deeptools/plotheatmap/meta.yml @@ -47,7 +47,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@emiller88" diff --git a/modules/deeptools/plotprofile/functions.nf b/modules/deeptools/plotprofile/functions.nf index da9da093..85628ee0 100644 --- a/modules/deeptools/plotprofile/functions.nf +++ b/modules/deeptools/plotprofile/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/deeptools/plotprofile/main.nf b/modules/deeptools/plotprofile/main.nf index 95f65c84..cba8e161 100644 --- a/modules/deeptools/plotprofile/main.nf +++ b/modules/deeptools/plotprofile/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process DEEPTOOLS_PLOTPROFILE { output: tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.tab"), emit: table - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process DEEPTOOLS_PLOTPROFILE { --outFileName ${prefix}.plotProfile.pdf \\ --outFileNameData ${prefix}.plotProfile.tab - plotProfile --version | sed -e "s/plotProfile //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(plotProfile --version | sed -e "s/plotProfile //g") + END_VERSIONS """ } diff --git a/modules/deeptools/plotprofile/meta.yml b/modules/deeptools/plotprofile/meta.yml index 120280de..08fafa49 100644 --- a/modules/deeptools/plotprofile/meta.yml +++ b/modules/deeptools/plotprofile/meta.yml @@ -47,7 +47,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@emiller88" diff --git a/modules/delly/call/functions.nf b/modules/delly/call/functions.nf index da9da093..85628ee0 100644 --- a/modules/delly/call/functions.nf +++ b/modules/delly/call/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/delly/call/main.nf b/modules/delly/call/main.nf index 3bbda48a..f97ddeb0 100644 --- a/modules/delly/call/main.nf +++ b/modules/delly/call/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process DELLY_CALL { output: tuple val(meta), path("*.bcf"), emit: bcf tuple val(meta), path("*.csi"), emit: csi - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process DELLY_CALL { -g $fasta \\ $bam \\ - echo \$(delly --version 2>&1) | sed 's/^.*Delly //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(delly --version 2>&1 | sed 's/^.*Delly //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/delly/call/meta.yml b/modules/delly/call/meta.yml index 9fb79959..16d1a6f2 100644 --- a/modules/delly/call/meta.yml +++ b/modules/delly/call/meta.yml @@ -41,7 +41,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bcf: type: file description: BCF format diff --git a/modules/diamond/blastp/functions.nf b/modules/diamond/blastp/functions.nf index da9da093..85628ee0 100644 --- a/modules/diamond/blastp/functions.nf +++ b/modules/diamond/blastp/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/diamond/blastp/main.nf b/modules/diamond/blastp/main.nf index 88ace780..556f150c 100644 --- a/modules/diamond/blastp/main.nf +++ b/modules/diamond/blastp/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process DIAMOND_BLASTP { output: tuple val(meta), path('*.txt'), emit: txt - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process DIAMOND_BLASTP { $options.args \\ --out ${prefix}.txt - echo \$(diamond --version 2>&1) | tail -n 1 | sed 's/^diamond version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(diamond --version 2>&1 | tail -n 1 | sed 's/^diamond version //') + END_VERSIONS """ } diff --git a/modules/diamond/blastp/meta.yml b/modules/diamond/blastp/meta.yml index b6e82f95..e92b1594 100644 --- a/modules/diamond/blastp/meta.yml +++ b/modules/diamond/blastp/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@spficklin" diff --git a/modules/diamond/blastx/functions.nf b/modules/diamond/blastx/functions.nf index da9da093..85628ee0 100644 --- a/modules/diamond/blastx/functions.nf +++ b/modules/diamond/blastx/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/diamond/blastx/main.nf b/modules/diamond/blastx/main.nf index cd9e4838..8b0227a2 100644 --- a/modules/diamond/blastx/main.nf +++ b/modules/diamond/blastx/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process DIAMOND_BLASTX { output: tuple val(meta), path('*.txt'), emit: txt - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process DIAMOND_BLASTX { $options.args \\ --out ${prefix}.txt - echo \$(diamond --version 2>&1) | tail -n 1 | sed 's/^diamond version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(diamond --version 2>&1 | tail -n 1 | sed 's/^diamond version //') + END_VERSIONS """ } diff --git a/modules/diamond/blastx/meta.yml b/modules/diamond/blastx/meta.yml index d9670bed..6e92a336 100644 --- a/modules/diamond/blastx/meta.yml +++ b/modules/diamond/blastx/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@spficklin" diff --git a/modules/diamond/makedb/functions.nf b/modules/diamond/makedb/functions.nf index da9da093..85628ee0 100644 --- a/modules/diamond/makedb/functions.nf +++ b/modules/diamond/makedb/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/diamond/makedb/main.nf b/modules/diamond/makedb/main.nf index 3537d0aa..27383955 100644 --- a/modules/diamond/makedb/main.nf +++ b/modules/diamond/makedb/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process DIAMOND_MAKEDB { output: path "${fasta}.dmnd", emit: db - path '*.version.txt', emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process DIAMOND_MAKEDB { -d $fasta \\ $options.args - echo \$(diamond --version 2>&1) | tail -n 1 | sed 's/^diamond version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(diamond --version 2>&1 | tail -n 1 | sed 's/^diamond version //') + END_VERSIONS """ } diff --git a/modules/diamond/makedb/meta.yml b/modules/diamond/makedb/meta.yml index edb63fab..4d8cb695 100644 --- a/modules/diamond/makedb/meta.yml +++ b/modules/diamond/makedb/meta.yml @@ -28,7 +28,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@spficklin" diff --git a/modules/dragonflye/functions.nf b/modules/dragonflye/functions.nf index da9da093..85628ee0 100644 --- a/modules/dragonflye/functions.nf +++ b/modules/dragonflye/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/dragonflye/main.nf b/modules/dragonflye/main.nf index cd0195e9..090c9a13 100644 --- a/modules/dragonflye/main.nf +++ b/modules/dragonflye/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process DRAGONFLYE { tuple val(meta), path("{flye,miniasm,raven}.fasta") , emit: raw_contigs tuple val(meta), path("{miniasm,raven}-unpolished.gfa"), optional:true , emit: gfa tuple val(meta), path("flye-info.txt"), optional:true , emit: txt - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -40,6 +40,9 @@ process DRAGONFLYE { --ram $memory \\ --outdir ./ \\ --force - echo \$(dragonflye --version 2>&1) | sed 's/^.*dragonflye //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(dragonflye --version 2>&1 | sed 's/^.*dragonflye //' ) + END_VERSIONS """ } diff --git a/modules/dragonflye/meta.yml b/modules/dragonflye/meta.yml index a2bf2703..9affa2f3 100644 --- a/modules/dragonflye/meta.yml +++ b/modules/dragonflye/meta.yml @@ -31,7 +31,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - contigs: type: file description: The final assembly produced by Dragonflye diff --git a/modules/dshbio/exportsegments/functions.nf b/modules/dshbio/exportsegments/functions.nf index da9da093..85628ee0 100644 --- a/modules/dshbio/exportsegments/functions.nf +++ b/modules/dshbio/exportsegments/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/dshbio/exportsegments/main.nf b/modules/dshbio/exportsegments/main.nf index bf4c9699..6016f777 100644 --- a/modules/dshbio/exportsegments/main.nf +++ b/modules/dshbio/exportsegments/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process DSHBIO_EXPORTSEGMENTS { output: tuple val(meta), path("*.fa"), emit: fasta - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process DSHBIO_EXPORTSEGMENTS { -i $gfa \\ -o ${prefix}.fa - echo \$(dsh-bio --version 2>&1) | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(dsh-bio --version 2>&1 | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ') + END_VERSIONS """ } diff --git a/modules/dshbio/exportsegments/meta.yml b/modules/dshbio/exportsegments/meta.yml index c064527e..c57a6179 100644 --- a/modules/dshbio/exportsegments/meta.yml +++ b/modules/dshbio/exportsegments/meta.yml @@ -35,6 +35,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/dshbio/filterbed/functions.nf b/modules/dshbio/filterbed/functions.nf index da9da093..85628ee0 100644 --- a/modules/dshbio/filterbed/functions.nf +++ b/modules/dshbio/filterbed/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/dshbio/filterbed/main.nf b/modules/dshbio/filterbed/main.nf index cc1daa7d..3f2a068d 100644 --- a/modules/dshbio/filterbed/main.nf +++ b/modules/dshbio/filterbed/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process DSHBIO_FILTERBED { output: tuple val(meta), path("*.bed.gz"), emit: bed - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process DSHBIO_FILTERBED { -i $bed \\ -o ${prefix}.bed.gz - echo \$(dsh-bio --version 2>&1) | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(dsh-bio --version 2>&1 | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ') + END_VERSIONS """ } diff --git a/modules/dshbio/filterbed/meta.yml b/modules/dshbio/filterbed/meta.yml index 61626ead..5545aac1 100644 --- a/modules/dshbio/filterbed/meta.yml +++ b/modules/dshbio/filterbed/meta.yml @@ -33,6 +33,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/dshbio/filtergff3/functions.nf b/modules/dshbio/filtergff3/functions.nf index da9da093..85628ee0 100644 --- a/modules/dshbio/filtergff3/functions.nf +++ b/modules/dshbio/filtergff3/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/dshbio/filtergff3/main.nf b/modules/dshbio/filtergff3/main.nf index 596c6b8f..2a1ad816 100644 --- a/modules/dshbio/filtergff3/main.nf +++ b/modules/dshbio/filtergff3/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process DSHBIO_FILTERGFF3 { output: tuple val(meta), path("*.gff3.gz"), emit: gff3 - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process DSHBIO_FILTERGFF3 { -i $gff3 \\ -o ${prefix}.gff3.gz - echo \$(dsh-bio --version 2>&1) | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(dsh-bio --version 2>&1 | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ') + END_VERSIONS """ } diff --git a/modules/dshbio/filtergff3/meta.yml b/modules/dshbio/filtergff3/meta.yml index 3f89d71b..d1b7a509 100644 --- a/modules/dshbio/filtergff3/meta.yml +++ b/modules/dshbio/filtergff3/meta.yml @@ -33,6 +33,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/dshbio/splitbed/functions.nf b/modules/dshbio/splitbed/functions.nf index da9da093..85628ee0 100644 --- a/modules/dshbio/splitbed/functions.nf +++ b/modules/dshbio/splitbed/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/dshbio/splitbed/main.nf b/modules/dshbio/splitbed/main.nf index 75307b14..388ba0ef 100644 --- a/modules/dshbio/splitbed/main.nf +++ b/modules/dshbio/splitbed/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process DSHBIO_SPLITBED { output: tuple val(meta), path("*.bed.gz"), emit: bed - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process DSHBIO_SPLITBED { -s '.bed.gz' \\ -i $bed - echo \$(dsh-bio --version 2>&1) | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(dsh-bio --version 2>&1 | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ') + END_VERSIONS """ } diff --git a/modules/dshbio/splitbed/meta.yml b/modules/dshbio/splitbed/meta.yml index f2257812..0c4788a1 100644 --- a/modules/dshbio/splitbed/meta.yml +++ b/modules/dshbio/splitbed/meta.yml @@ -33,6 +33,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/dshbio/splitgff3/functions.nf b/modules/dshbio/splitgff3/functions.nf index da9da093..85628ee0 100644 --- a/modules/dshbio/splitgff3/functions.nf +++ b/modules/dshbio/splitgff3/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/dshbio/splitgff3/main.nf b/modules/dshbio/splitgff3/main.nf index fa434b75..b8f81392 100644 --- a/modules/dshbio/splitgff3/main.nf +++ b/modules/dshbio/splitgff3/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process DSHBIO_SPLITGFF3 { output: tuple val(meta), path("*.gff3.gz"), emit: gff3 - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process DSHBIO_SPLITGFF3 { -s '.gff3.gz' \\ -i $gff3 - echo \$(dsh-bio --version 2>&1) | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(dsh-bio --version 2>&1 | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ') + END_VERSIONS """ } diff --git a/modules/dshbio/splitgff3/meta.yml b/modules/dshbio/splitgff3/meta.yml index 46118bb7..1bdfa652 100644 --- a/modules/dshbio/splitgff3/meta.yml +++ b/modules/dshbio/splitgff3/meta.yml @@ -33,6 +33,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/ensemblvep/functions.nf b/modules/ensemblvep/functions.nf index da9da093..85628ee0 100644 --- a/modules/ensemblvep/functions.nf +++ b/modules/ensemblvep/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/ensemblvep/main.nf b/modules/ensemblvep/main.nf index c2194e77..32acc4dd 100644 --- a/modules/ensemblvep/main.nf +++ b/modules/ensemblvep/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -33,7 +33,7 @@ process ENSEMBLVEP { output: tuple val(meta), path("*.ann.vcf"), emit: vcf path "*.summary.html" , emit: report - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -57,6 +57,9 @@ process ENSEMBLVEP { rm -rf $prefix - echo \$(vep --help 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(vep --help 2>&1) + END_VERSIONS """ } diff --git a/modules/ensemblvep/meta.yml b/modules/ensemblvep/meta.yml index 5eb111e9..e97c5609 100644 --- a/modules/ensemblvep/meta.yml +++ b/modules/ensemblvep/meta.yml @@ -59,6 +59,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/expansionhunter/functions.nf b/modules/expansionhunter/functions.nf index da9da093..85628ee0 100644 --- a/modules/expansionhunter/functions.nf +++ b/modules/expansionhunter/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/expansionhunter/main.nf b/modules/expansionhunter/main.nf index 41c6ed6c..7ee97c5a 100644 --- a/modules/expansionhunter/main.nf +++ b/modules/expansionhunter/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process EXPANSIONHUNTER { output: tuple val(meta), path("*.vcf"), emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -40,6 +40,9 @@ process EXPANSIONHUNTER { --variant-catalog $variant_catalog \\ --sex $gender - echo \$(ExpansionHunter --version 2>&1) | sed 's/^.*ExpansionHunter //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(ExpansionHunter --version 2>&1 | sed 's/^.*ExpansionHunter //') + END_VERSIONS """ } diff --git a/modules/expansionhunter/meta.yml b/modules/expansionhunter/meta.yml index cac3ed2b..a5733d93 100644 --- a/modules/expansionhunter/meta.yml +++ b/modules/expansionhunter/meta.yml @@ -40,7 +40,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - vcf: type: file description: VCF with repeat expansions diff --git a/modules/fastani/functions.nf b/modules/fastani/functions.nf index da9da093..85628ee0 100644 --- a/modules/fastani/functions.nf +++ b/modules/fastani/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/fastani/main.nf b/modules/fastani/main.nf index 11916a65..7ee35a0d 100644 --- a/modules/fastani/main.nf +++ b/modules/fastani/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process FASTANI { output: tuple val(meta), path("*.ani.txt"), emit: ani - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,7 +37,10 @@ process FASTANI { -rl $reference \\ -o ${prefix}.ani.txt - echo \$(fastANI --version 2>&1) | sed 's/version//;' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(fastANI --version 2>&1 | sed 's/version//;') + END_VERSIONS """ } else { """ @@ -46,7 +49,10 @@ process FASTANI { -r $reference \\ -o ${prefix}.ani.txt - echo \$(fastANI --version 2>&1) | sed 's/version//;' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(fastANI --version 2>&1 | sed 's/version//;') + END_VERSIONS """ } } diff --git a/modules/fastani/meta.yml b/modules/fastani/meta.yml index ed6be165..783ae068 100644 --- a/modules/fastani/meta.yml +++ b/modules/fastani/meta.yml @@ -38,6 +38,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/fastp/functions.nf b/modules/fastp/functions.nf index da9da093..85628ee0 100644 --- a/modules/fastp/functions.nf +++ b/modules/fastp/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/fastp/main.nf b/modules/fastp/main.nf index 652ffe80..11cd30b4 100644 --- a/modules/fastp/main.nf +++ b/modules/fastp/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -28,7 +28,7 @@ process FASTP { tuple val(meta), path('*.json') , emit: json tuple val(meta), path('*.html') , emit: html tuple val(meta), path('*.log') , emit: log - path '*.version.txt' , emit: version + path "versions.yml" , emit: version tuple val(meta), path('*.fail.fastq.gz') , optional:true, emit: reads_fail tuple val(meta), path('*.merged.fastq.gz'), optional:true, emit: reads_merged @@ -49,7 +49,10 @@ process FASTP { $fail_fastq \\ $options.args \\ 2> ${prefix}.fastp.log - echo \$(fastp --version 2>&1) | sed -e "s/fastp //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(fastp --version 2>&1 | sed -e "s/fastp //g") + END_VERSIONS """ } else { def fail_fastq = save_trimmed_fail ? "--unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : '' @@ -71,7 +74,10 @@ process FASTP { $options.args \\ 2> ${prefix}.fastp.log - echo \$(fastp --version 2>&1) | sed -e "s/fastp //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(fastp --version 2>&1 | sed -e "s/fastp //g") + END_VERSIONS """ } } diff --git a/modules/fastp/meta.yml b/modules/fastp/meta.yml index d9130d6d..72ddb7d7 100644 --- a/modules/fastp/meta.yml +++ b/modules/fastp/meta.yml @@ -47,7 +47,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - reads_fail: type: file description: Reads the failed the preprocessing diff --git a/modules/fasttree/functions.nf b/modules/fasttree/functions.nf index da9da093..85628ee0 100644 --- a/modules/fasttree/functions.nf +++ b/modules/fasttree/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/fasttree/main.nf b/modules/fasttree/main.nf index f0bacb87..08c093b2 100644 --- a/modules/fasttree/main.nf +++ b/modules/fasttree/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -22,7 +22,7 @@ process FASTTREE { output: path "*.tre", emit: phylogeny - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process FASTTREE { -nt $alignment \\ > fasttree_phylogeny.tre - echo \$(fasttree -help 2>&1) | head -1 | sed 's/^FastTree \\([0-9\\.]*\\) .*\$/\\1/' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(fasttree -help 2>&1 | head -1 | sed 's/^FastTree \\([0-9\\.]*\\) .*\$/\\1/') + END_VERSIONS """ } diff --git a/modules/fasttree/meta.yml b/modules/fasttree/meta.yml index 5912395d..70000030 100644 --- a/modules/fasttree/meta.yml +++ b/modules/fasttree/meta.yml @@ -22,7 +22,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - phylogeny: type: file description: A phylogeny in Newick format diff --git a/modules/fgbio/callmolecularconsensusreads/functions.nf b/modules/fgbio/callmolecularconsensusreads/functions.nf index da9da093..85628ee0 100644 --- a/modules/fgbio/callmolecularconsensusreads/functions.nf +++ b/modules/fgbio/callmolecularconsensusreads/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/fgbio/callmolecularconsensusreads/main.nf b/modules/fgbio/callmolecularconsensusreads/main.nf index a530ba55..ba099d8d 100644 --- a/modules/fgbio/callmolecularconsensusreads/main.nf +++ b/modules/fgbio/callmolecularconsensusreads/main.nf @@ -1,4 +1,4 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -22,7 +22,7 @@ process FGBIO_CALLMOLECULARCONSENSUSREADS { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process FGBIO_CALLMOLECULARCONSENSUSREADS { -i $bam \\ $options.args \\ -o ${prefix}.bam - fgbio --version | sed -e "s/fgbio v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(fgbio --version | sed -e "s/fgbio v//g") + END_VERSIONS """ } diff --git a/modules/fgbio/callmolecularconsensusreads/meta.yml b/modules/fgbio/callmolecularconsensusreads/meta.yml index 5f80bce9..3e62c3a6 100644 --- a/modules/fgbio/callmolecularconsensusreads/meta.yml +++ b/modules/fgbio/callmolecularconsensusreads/meta.yml @@ -39,7 +39,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@sruthipsuresh" diff --git a/modules/fgbio/sortbam/functions.nf b/modules/fgbio/sortbam/functions.nf index da9da093..85628ee0 100644 --- a/modules/fgbio/sortbam/functions.nf +++ b/modules/fgbio/sortbam/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/fgbio/sortbam/main.nf b/modules/fgbio/sortbam/main.nf index 798d5f23..81ac89c2 100644 --- a/modules/fgbio/sortbam/main.nf +++ b/modules/fgbio/sortbam/main.nf @@ -1,4 +1,4 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -22,7 +22,7 @@ process FGBIO_SORTBAM { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,7 +33,10 @@ process FGBIO_SORTBAM { -i $bam \\ $options.args \\ -o ${prefix}.bam - fgbio --version | sed -e "s/fgbio v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(fgbio --version | sed -e "s/fgbio v//g") + END_VERSIONS """ } diff --git a/modules/fgbio/sortbam/meta.yml b/modules/fgbio/sortbam/meta.yml index 9e68dac4..def106c3 100644 --- a/modules/fgbio/sortbam/meta.yml +++ b/modules/fgbio/sortbam/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@sruthipsuresh" diff --git a/modules/flash/functions.nf b/modules/flash/functions.nf index da9da093..85628ee0 100644 --- a/modules/flash/functions.nf +++ b/modules/flash/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/flash/main.nf b/modules/flash/main.nf index acdc10a7..8b8d99e4 100644 --- a/modules/flash/main.nf +++ b/modules/flash/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -22,7 +22,7 @@ process FLASH { output: tuple val(meta), path("*.merged.*.fastq.gz"), emit: reads - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process FLASH { $merged \\ -z \\ $input_reads - echo \$(flash --version) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(flash --version) + END_VERSIONS """ } diff --git a/modules/flash/meta.yml b/modules/flash/meta.yml index ff747912..62d40e20 100644 --- a/modules/flash/meta.yml +++ b/modules/flash/meta.yml @@ -38,7 +38,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@Erkison" diff --git a/modules/gatk4/applybqsr/functions.nf b/modules/gatk4/applybqsr/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/applybqsr/functions.nf +++ b/modules/gatk4/applybqsr/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/applybqsr/main.nf b/modules/gatk4/applybqsr/main.nf index 19b8c3d6..9c51ce60 100644 --- a/modules/gatk4/applybqsr/main.nf +++ b/modules/gatk4/applybqsr/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process GATK4_APPLYBQSR { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process GATK4_APPLYBQSR { -O ${prefix}.bam \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/applybqsr/meta.yml b/modules/gatk4/applybqsr/meta.yml index 9bf12f09..b0177c76 100644 --- a/modules/gatk4/applybqsr/meta.yml +++ b/modules/gatk4/applybqsr/meta.yml @@ -48,7 +48,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: Recalibrated BAM file diff --git a/modules/gatk4/baserecalibrator/functions.nf b/modules/gatk4/baserecalibrator/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/baserecalibrator/functions.nf +++ b/modules/gatk4/baserecalibrator/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/baserecalibrator/main.nf b/modules/gatk4/baserecalibrator/main.nf index 4e2730f2..9abca6e9 100644 --- a/modules/gatk4/baserecalibrator/main.nf +++ b/modules/gatk4/baserecalibrator/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -29,7 +29,7 @@ process GATK4_BASERECALIBRATOR { output: tuple val(meta), path("*.table"), emit: table - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -45,6 +45,9 @@ process GATK4_BASERECALIBRATOR { $options.args \ -O ${prefix}.table - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/baserecalibrator/meta.yml b/modules/gatk4/baserecalibrator/meta.yml index 0996dcbe..a5bac064 100644 --- a/modules/gatk4/baserecalibrator/meta.yml +++ b/modules/gatk4/baserecalibrator/meta.yml @@ -48,7 +48,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - table: type: file description: Recalibration table from BaseRecalibrator diff --git a/modules/gatk4/bedtointervallist/functions.nf b/modules/gatk4/bedtointervallist/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/bedtointervallist/functions.nf +++ b/modules/gatk4/bedtointervallist/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/bedtointervallist/main.nf b/modules/gatk4/bedtointervallist/main.nf index af385f8f..fc484f84 100644 --- a/modules/gatk4/bedtointervallist/main.nf +++ b/modules/gatk4/bedtointervallist/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process GATK4_BEDTOINTERVALLIST { output: tuple val(meta), path('*.interval_list'), emit: interval_list - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process GATK4_BEDTOINTERVALLIST { -O ${prefix}.interval_list \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/bedtointervallist/meta.yml b/modules/gatk4/bedtointervallist/meta.yml index 23e98447..28fd5d22 100644 --- a/modules/gatk4/bedtointervallist/meta.yml +++ b/modules/gatk4/bedtointervallist/meta.yml @@ -34,6 +34,6 @@ output: - version: type: file description: File containing software version - pattern: "*.version.txt" + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/createsequencedictionary/functions.nf b/modules/gatk4/createsequencedictionary/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/createsequencedictionary/functions.nf +++ b/modules/gatk4/createsequencedictionary/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/createsequencedictionary/main.nf b/modules/gatk4/createsequencedictionary/main.nf index 0276e8b2..0c0446c6 100644 --- a/modules/gatk4/createsequencedictionary/main.nf +++ b/modules/gatk4/createsequencedictionary/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process GATK4_CREATESEQUENCEDICTIONARY { output: path "*.dict" , emit: dict - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -40,6 +40,9 @@ process GATK4_CREATESEQUENCEDICTIONARY { --URI $fasta \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/createsequencedictionary/meta.yml b/modules/gatk4/createsequencedictionary/meta.yml index d0cc5980..21bdc599 100644 --- a/modules/gatk4/createsequencedictionary/meta.yml +++ b/modules/gatk4/createsequencedictionary/meta.yml @@ -25,6 +25,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/gatk4/fastqtosam/functions.nf b/modules/gatk4/fastqtosam/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/fastqtosam/functions.nf +++ b/modules/gatk4/fastqtosam/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/fastqtosam/main.nf b/modules/gatk4/fastqtosam/main.nf index e00f34f5..e7b38f35 100644 --- a/modules/gatk4/fastqtosam/main.nf +++ b/modules/gatk4/fastqtosam/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process GATK4_FASTQTOSAM { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process GATK4_FASTQTOSAM { -SM $prefix \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/fastqtosam/meta.yml b/modules/gatk4/fastqtosam/meta.yml index d574d67b..4ae9eeaa 100644 --- a/modules/gatk4/fastqtosam/meta.yml +++ b/modules/gatk4/fastqtosam/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: Converted BAM file diff --git a/modules/gatk4/getpileupsummaries/functions.nf b/modules/gatk4/getpileupsummaries/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/getpileupsummaries/functions.nf +++ b/modules/gatk4/getpileupsummaries/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/getpileupsummaries/main.nf b/modules/gatk4/getpileupsummaries/main.nf index 9ae95d9c..da03555c 100644 --- a/modules/gatk4/getpileupsummaries/main.nf +++ b/modules/gatk4/getpileupsummaries/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process GATK4_GETPILEUPSUMMARIES { output: tuple val(meta), path('*.pileups.table'), emit: table - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -43,6 +43,9 @@ process GATK4_GETPILEUPSUMMARIES { -O ${prefix}.pileups.table \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/getpileupsummaries/meta.yml b/modules/gatk4/getpileupsummaries/meta.yml index e784595a..5bb87e80 100644 --- a/modules/gatk4/getpileupsummaries/meta.yml +++ b/modules/gatk4/getpileupsummaries/meta.yml @@ -51,7 +51,7 @@ output: - version: type: file description: File containing software version - pattern: "*.version.txt" + pattern: "versions.yml" authors: - "@GCJMackenzie" diff --git a/modules/gatk4/haplotypecaller/functions.nf b/modules/gatk4/haplotypecaller/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/haplotypecaller/functions.nf +++ b/modules/gatk4/haplotypecaller/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/haplotypecaller/main.nf b/modules/gatk4/haplotypecaller/main.nf index c451de7f..02fd1ee3 100644 --- a/modules/gatk4/haplotypecaller/main.nf +++ b/modules/gatk4/haplotypecaller/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process GATK4_HAPLOTYPECALLER { output: tuple val(meta), path("*.vcf.gz"), emit: vcf tuple val(meta), path("*.tbi") , emit: tbi - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -47,6 +47,9 @@ process GATK4_HAPLOTYPECALLER { -O ${prefix}.vcf.gz \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/haplotypecaller/meta.yml b/modules/gatk4/haplotypecaller/meta.yml index f0fc3910..4b8e8387 100644 --- a/modules/gatk4/haplotypecaller/meta.yml +++ b/modules/gatk4/haplotypecaller/meta.yml @@ -49,7 +49,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - vcf: type: file description: Compressed VCF file diff --git a/modules/gatk4/intervallisttools/functions.nf b/modules/gatk4/intervallisttools/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/intervallisttools/functions.nf +++ b/modules/gatk4/intervallisttools/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/intervallisttools/main.nf b/modules/gatk4/intervallisttools/main.nf index b2486eac..90a77c5a 100644 --- a/modules/gatk4/intervallisttools/main.nf +++ b/modules/gatk4/intervallisttools/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process GATK4_INTERVALLISTTOOLS { output: tuple val(meta), path("*_split/*/*.interval_list"), emit: interval_list - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -48,6 +48,9 @@ process GATK4_INTERVALLISTTOOLS { os.rename(interval, newName) CODE - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/intervallisttools/meta.yml b/modules/gatk4/intervallisttools/meta.yml index efe31da1..65adb7b6 100644 --- a/modules/gatk4/intervallisttools/meta.yml +++ b/modules/gatk4/intervallisttools/meta.yml @@ -36,7 +36,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - interval_list: type: file description: Interval list files diff --git a/modules/gatk4/markduplicates/functions.nf b/modules/gatk4/markduplicates/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/markduplicates/functions.nf +++ b/modules/gatk4/markduplicates/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/markduplicates/main.nf b/modules/gatk4/markduplicates/main.nf index 6df2a47c..68b17366 100644 --- a/modules/gatk4/markduplicates/main.nf +++ b/modules/gatk4/markduplicates/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process GATK4_MARKDUPLICATES { output: tuple val(meta), path("*.bam") , emit: bam tuple val(meta), path("*.metrics"), emit: metrics - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process GATK4_MARKDUPLICATES { --OUTPUT ${prefix}.bam \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/markduplicates/meta.yml b/modules/gatk4/markduplicates/meta.yml index abe61e02..58e30910 100644 --- a/modules/gatk4/markduplicates/meta.yml +++ b/modules/gatk4/markduplicates/meta.yml @@ -35,7 +35,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: Marked duplicates BAM file diff --git a/modules/gatk4/mergebamalignment/functions.nf b/modules/gatk4/mergebamalignment/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/mergebamalignment/functions.nf +++ b/modules/gatk4/mergebamalignment/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/mergebamalignment/main.nf b/modules/gatk4/mergebamalignment/main.nf index b65f4653..269836a7 100644 --- a/modules/gatk4/mergebamalignment/main.nf +++ b/modules/gatk4/mergebamalignment/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process GATK4_MERGEBAMALIGNMENT { output: tuple val(meta), path('*.bam'), emit: bam - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process GATK4_MERGEBAMALIGNMENT { O=${prefix}.bam \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/mergebamalignment/meta.yml b/modules/gatk4/mergebamalignment/meta.yml index 155b6364..e2e7b7ec 100644 --- a/modules/gatk4/mergebamalignment/meta.yml +++ b/modules/gatk4/mergebamalignment/meta.yml @@ -40,6 +40,6 @@ output: - version: type: file description: File containing software version - pattern: "*.version.txt" + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/mergevcfs/functions.nf b/modules/gatk4/mergevcfs/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/mergevcfs/functions.nf +++ b/modules/gatk4/mergevcfs/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/mergevcfs/main.nf b/modules/gatk4/mergevcfs/main.nf index 5a80c9ff..d47aa68f 100644 --- a/modules/gatk4/mergevcfs/main.nf +++ b/modules/gatk4/mergevcfs/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process GATK4_MERGEVCFS { output: tuple val(meta), path('*.vcf.gz'), emit: vcf - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -44,6 +44,9 @@ process GATK4_MERGEVCFS { $ref \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/mergevcfs/meta.yml b/modules/gatk4/mergevcfs/meta.yml index 14b28fa0..d2679ab8 100644 --- a/modules/gatk4/mergevcfs/meta.yml +++ b/modules/gatk4/mergevcfs/meta.yml @@ -37,6 +37,6 @@ output: - version: type: file description: File containing software version - pattern: "*.version.txt" + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/mutect2/functions.nf b/modules/gatk4/mutect2/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/mutect2/functions.nf +++ b/modules/gatk4/mutect2/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/mutect2/main.nf b/modules/gatk4/mutect2/main.nf index 6ab9e1c7..03bcc2d1 100644 --- a/modules/gatk4/mutect2/main.nf +++ b/modules/gatk4/mutect2/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -35,7 +35,7 @@ process GATK4_MUTECT2 { tuple val(meta), path("*.tbi") , emit: tbi tuple val(meta), path("*.stats") , emit: stats tuple val(meta), path("*.f1r2.tar.gz"), optional:true, emit: f1r2 - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -72,6 +72,9 @@ process GATK4_MUTECT2 { -O ${prefix}.vcf.gz \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/mutect2/meta.yml b/modules/gatk4/mutect2/meta.yml index 7833d694..75b38153 100644 --- a/modules/gatk4/mutect2/meta.yml +++ b/modules/gatk4/mutect2/meta.yml @@ -87,7 +87,7 @@ output: - version: type: file description: File containing software version - pattern: "*.version.txt" + pattern: "versions.yml" authors: - "@GCJMackenzie" diff --git a/modules/gatk4/revertsam/functions.nf b/modules/gatk4/revertsam/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/revertsam/functions.nf +++ b/modules/gatk4/revertsam/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/revertsam/main.nf b/modules/gatk4/revertsam/main.nf index 2f4959db..e691d3f9 100644 --- a/modules/gatk4/revertsam/main.nf +++ b/modules/gatk4/revertsam/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process GATK4_REVERTSAM { output: tuple val(meta), path('*.bam'), emit: bam - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process GATK4_REVERTSAM { O=${prefix}.reverted.bam \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/revertsam/meta.yml b/modules/gatk4/revertsam/meta.yml index 258bb253..d6a1d7fa 100644 --- a/modules/gatk4/revertsam/meta.yml +++ b/modules/gatk4/revertsam/meta.yml @@ -30,6 +30,6 @@ output: - version: type: file description: File containing software version - pattern: "*.version.txt" + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/samtofastq/functions.nf b/modules/gatk4/samtofastq/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/samtofastq/functions.nf +++ b/modules/gatk4/samtofastq/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/samtofastq/main.nf b/modules/gatk4/samtofastq/main.nf index 486d6b5d..edf895bb 100644 --- a/modules/gatk4/samtofastq/main.nf +++ b/modules/gatk4/samtofastq/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process GATK4_SAMTOFASTQ { output: tuple val(meta), path('*.fastq.gz'), emit: fastq - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process GATK4_SAMTOFASTQ { $output \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/samtofastq/meta.yml b/modules/gatk4/samtofastq/meta.yml index 0601f3a7..956d2186 100644 --- a/modules/gatk4/samtofastq/meta.yml +++ b/modules/gatk4/samtofastq/meta.yml @@ -30,6 +30,6 @@ output: - version: type: file description: File containing software version - pattern: "*.version.txt" + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/splitncigarreads/functions.nf b/modules/gatk4/splitncigarreads/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/splitncigarreads/functions.nf +++ b/modules/gatk4/splitncigarreads/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/splitncigarreads/main.nf b/modules/gatk4/splitncigarreads/main.nf index a8724e2e..11d6c9a5 100644 --- a/modules/gatk4/splitncigarreads/main.nf +++ b/modules/gatk4/splitncigarreads/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process GATK4_SPLITNCIGARREADS { output: tuple val(meta), path('*.bam'), emit: bam - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process GATK4_SPLITNCIGARREADS { -O ${prefix}.bam \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/splitncigarreads/meta.yml b/modules/gatk4/splitncigarreads/meta.yml index e433cbf6..c4266874 100644 --- a/modules/gatk4/splitncigarreads/meta.yml +++ b/modules/gatk4/splitncigarreads/meta.yml @@ -35,6 +35,6 @@ output: - version: type: file description: File containing software version - pattern: "*.version.txt" + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/variantfiltration/functions.nf b/modules/gatk4/variantfiltration/functions.nf index da9da093..85628ee0 100644 --- a/modules/gatk4/variantfiltration/functions.nf +++ b/modules/gatk4/variantfiltration/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gatk4/variantfiltration/main.nf b/modules/gatk4/variantfiltration/main.nf index 82593d18..90b6ef25 100644 --- a/modules/gatk4/variantfiltration/main.nf +++ b/modules/gatk4/variantfiltration/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process GATK4_VARIANTFILTRATION { output: tuple val(meta), path("*.vcf"), emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: @@ -39,6 +39,9 @@ process GATK4_VARIANTFILTRATION { -O ${prefix}.vcf \\ $options.args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/gatk4/variantfiltration/meta.yml b/modules/gatk4/variantfiltration/meta.yml index d7f72582..6b0a9026 100644 --- a/modules/gatk4/variantfiltration/meta.yml +++ b/modules/gatk4/variantfiltration/meta.yml @@ -42,6 +42,6 @@ output: - version: type: file description: File containing software version - pattern: "*.version.txt" + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/genmap/index/functions.nf b/modules/genmap/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/genmap/index/functions.nf +++ b/modules/genmap/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/genmap/index/main.nf b/modules/genmap/index/main.nf index 8166315e..f1168d4e 100644 --- a/modules/genmap/index/main.nf +++ b/modules/genmap/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process GENMAP_INDEX { output: path "genmap" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process GENMAP_INDEX { -F $fasta \\ -I genmap - echo \$(genmap --version 2>&1) | sed 's/GenMap version: //; s/SeqAn.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(genmap --version 2>&1 | sed 's/GenMap version: //; s/SeqAn.*\$//') + END_VERSIONS """ } diff --git a/modules/genmap/index/meta.yml b/modules/genmap/index/meta.yml index 332c3ba7..cd299da2 100644 --- a/modules/genmap/index/meta.yml +++ b/modules/genmap/index/meta.yml @@ -21,7 +21,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - index: type: index description: Genmap index file diff --git a/modules/genmap/mappability/functions.nf b/modules/genmap/mappability/functions.nf index da9da093..85628ee0 100644 --- a/modules/genmap/mappability/functions.nf +++ b/modules/genmap/mappability/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/genmap/mappability/main.nf b/modules/genmap/mappability/main.nf index 8587c950..9eeb4253 100644 --- a/modules/genmap/mappability/main.nf +++ b/modules/genmap/mappability/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process GENMAP_MAPPABILITY { path "*.wig" , optional:true, emit: wig path "*.bedgraph" , optional:true, emit: bedgraph path "*.txt" , optional:true, emit: txt - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process GENMAP_MAPPABILITY { -I $index \\ -O mappability - echo \$(genmap --version 2>&1) | sed 's/GenMap version: //; s/SeqAn.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(genmap --version 2>&1 | sed 's/GenMap version: //; s/SeqAn.*\$//') + END_VERSIONS """ } diff --git a/modules/genmap/mappability/meta.yml b/modules/genmap/mappability/meta.yml index 851119c9..90807077 100644 --- a/modules/genmap/mappability/meta.yml +++ b/modules/genmap/mappability/meta.yml @@ -24,7 +24,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - wig: type: file description: genmap wig mappability file diff --git a/modules/gffread/functions.nf b/modules/gffread/functions.nf index da9da093..85628ee0 100644 --- a/modules/gffread/functions.nf +++ b/modules/gffread/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gffread/main.nf b/modules/gffread/main.nf index 6b0dd666..1622e98d 100644 --- a/modules/gffread/main.nf +++ b/modules/gffread/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process GFFREAD { output: path "*.gtf" , emit: gtf - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process GFFREAD { $gff \\ $options.args \\ -o ${prefix}.gtf - echo \$(gffread --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gffread --version 2>&1) + END_VERSIONS """ } diff --git a/modules/gffread/meta.yml b/modules/gffread/meta.yml index af2abb6e..1cb7fc91 100644 --- a/modules/gffread/meta.yml +++ b/modules/gffread/meta.yml @@ -27,7 +27,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@emiller88" diff --git a/modules/glnexus/functions.nf b/modules/glnexus/functions.nf index da9da093..85628ee0 100644 --- a/modules/glnexus/functions.nf +++ b/modules/glnexus/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/glnexus/main.nf b/modules/glnexus/main.nf index dadb9d60..60f50932 100644 --- a/modules/glnexus/main.nf +++ b/modules/glnexus/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process GLNEXUS { output: tuple val(meta), path("*.bcf"), emit: bcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -44,6 +44,9 @@ process GLNEXUS { $options.args \\ ${input.join(' ')} \\ > ${prefix}.bcf - echo \$(glnexus_cli 2>&1) | head -n 1 | sed 's/^.*release //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(glnexus_cli 2>&1 | head -n 1 | sed 's/^.*release //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/glnexus/meta.yml b/modules/glnexus/meta.yml index f64a812e..fd1a407d 100644 --- a/modules/glnexus/meta.yml +++ b/modules/glnexus/meta.yml @@ -27,7 +27,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bcf: type: file description: merged BCF file diff --git a/modules/graphmap2/align/functions.nf b/modules/graphmap2/align/functions.nf index da9da093..85628ee0 100644 --- a/modules/graphmap2/align/functions.nf +++ b/modules/graphmap2/align/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/graphmap2/align/main.nf b/modules/graphmap2/align/main.nf index 0ee4c02b..cf598b3d 100644 --- a/modules/graphmap2/align/main.nf +++ b/modules/graphmap2/align/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process GRAPHMAP2_ALIGN { output: tuple val(meta), path("*.sam"), emit: sam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -41,6 +41,9 @@ process GRAPHMAP2_ALIGN { -o ${prefix}.sam \\ $options.args - echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(graphmap2 align 2>&1 | sed 's/^.*Version: v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/graphmap2/align/meta.yml b/modules/graphmap2/align/meta.yml index da773ed2..a5b3cd6c 100644 --- a/modules/graphmap2/align/meta.yml +++ b/modules/graphmap2/align/meta.yml @@ -44,7 +44,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@yuukiiwa" - "@drpatelh" diff --git a/modules/graphmap2/index/functions.nf b/modules/graphmap2/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/graphmap2/index/functions.nf +++ b/modules/graphmap2/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/graphmap2/index/main.nf b/modules/graphmap2/index/main.nf index 17811d4c..906aa6ec 100644 --- a/modules/graphmap2/index/main.nf +++ b/modules/graphmap2/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -22,7 +22,7 @@ process GRAPHMAP2_INDEX { output: path "*.gmidx" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process GRAPHMAP2_INDEX { $options.args \\ -r $fasta - echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(graphmap2 align 2>&1 | sed 's/^.*Version: v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/graphmap2/index/meta.yml b/modules/graphmap2/index/meta.yml index b74f985a..4ff63276 100644 --- a/modules/graphmap2/index/meta.yml +++ b/modules/graphmap2/index/meta.yml @@ -23,7 +23,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@yuukiiwa" - "@drpatelh" diff --git a/modules/gubbins/functions.nf b/modules/gubbins/functions.nf index da9da093..85628ee0 100644 --- a/modules/gubbins/functions.nf +++ b/modules/gubbins/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gubbins/main.nf b/modules/gubbins/main.nf index 7f0041c8..10117ae7 100644 --- a/modules/gubbins/main.nf +++ b/modules/gubbins/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -30,7 +30,7 @@ process GUBBINS { path "*.branch_base_reconstruction.embl", emit: embl_branch path "*.final_tree.tre" , emit: tree path "*.node_labelled.final_tree.tre" , emit: tree_labelled - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process GUBBINS { --threads $task.cpus \\ $options.args \\ $alignment - echo \$(run_gubbins.py --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(run_gubbins.py --version 2>&1) + END_VERSIONS """ } diff --git a/modules/gubbins/meta.yml b/modules/gubbins/meta.yml index d1410afb..1a49b335 100644 --- a/modules/gubbins/meta.yml +++ b/modules/gubbins/meta.yml @@ -19,7 +19,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - fasta: type: file description: Filtered variant alignment in fasta format diff --git a/modules/gunzip/functions.nf b/modules/gunzip/functions.nf index da9da093..85628ee0 100644 --- a/modules/gunzip/functions.nf +++ b/modules/gunzip/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/gunzip/main.nf b/modules/gunzip/main.nf index 29248796..a53a9858 100644 --- a/modules/gunzip/main.nf +++ b/modules/gunzip/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process GUNZIP { output: path "$gunzip", emit: gunzip - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) gunzip = archive.toString() - '.gz' """ gunzip -f $options.args $archive - echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(gunzip --version 2>&1 | sed 's/^.*(gzip) //; s/ Copyright.*\$//') + END_VERSIONS """ } diff --git a/modules/gunzip/meta.yml b/modules/gunzip/meta.yml index 922e74e6..60911685 100644 --- a/modules/gunzip/meta.yml +++ b/modules/gunzip/meta.yml @@ -21,7 +21,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/hifiasm/functions.nf b/modules/hifiasm/functions.nf index da9da093..85628ee0 100644 --- a/modules/hifiasm/functions.nf +++ b/modules/hifiasm/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/hifiasm/main.nf b/modules/hifiasm/main.nf index 5d005ee4..2597afa9 100644 --- a/modules/hifiasm/main.nf +++ b/modules/hifiasm/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -34,7 +34,7 @@ process HIFIASM { tuple val(meta), path("*.asm.a_ctg.gfa") , emit: alternate_contigs, optional: true tuple val(meta), path("*.hap1.p_ctg.gfa") , emit: paternal_contigs , optional: true tuple val(meta), path("*.hap2.p_ctg.gfa") , emit: maternal_contigs , optional: true - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -49,7 +49,10 @@ process HIFIASM { -2 $maternal_kmer_dump \\ $reads - echo \$(hifiasm --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(hifiasm --version 2>&1) + END_VERSIONS """ } else { // Phasing with Hi-C data is not supported yet """ @@ -59,7 +62,10 @@ process HIFIASM { -t $task.cpus \\ $reads - echo \$(hifiasm --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(hifiasm --version 2>&1) + END_VERSIONS """ } } diff --git a/modules/hifiasm/meta.yml b/modules/hifiasm/meta.yml index dc414b93..c6d5a735 100644 --- a/modules/hifiasm/meta.yml +++ b/modules/hifiasm/meta.yml @@ -45,7 +45,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - raw_unitigs: type: file description: Raw unitigs diff --git a/modules/hisat2/align/functions.nf b/modules/hisat2/align/functions.nf index da9da093..85628ee0 100644 --- a/modules/hisat2/align/functions.nf +++ b/modules/hisat2/align/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/hisat2/align/main.nf b/modules/hisat2/align/main.nf index 17547c91..21eb3c7d 100644 --- a/modules/hisat2/align/main.nf +++ b/modules/hisat2/align/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -28,7 +28,7 @@ process HISAT2_ALIGN { output: tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.log"), emit: summary - path "*.version.txt" , emit: version + path "versions.yml" , emit: version tuple val(meta), path("*fastq.gz"), optional:true, emit: fastq @@ -59,7 +59,10 @@ process HISAT2_ALIGN { $options.args \\ | samtools view -bS -F 4 -F 256 - > ${prefix}.bam - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } else { def unaligned = params.save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' @@ -87,7 +90,10 @@ process HISAT2_ALIGN { mv ${prefix}.unmapped.fastq.2.gz ${prefix}.unmapped_2.fastq.gz fi - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } } diff --git a/modules/hisat2/align/meta.yml b/modules/hisat2/align/meta.yml index bf5570fd..799f1808 100644 --- a/modules/hisat2/align/meta.yml +++ b/modules/hisat2/align/meta.yml @@ -51,7 +51,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@ntoda03" diff --git a/modules/hisat2/build/functions.nf b/modules/hisat2/build/functions.nf index da9da093..85628ee0 100644 --- a/modules/hisat2/build/functions.nf +++ b/modules/hisat2/build/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/hisat2/build/main.nf b/modules/hisat2/build/main.nf index 3e74b1d4..ae24a6aa 100644 --- a/modules/hisat2/build/main.nf +++ b/modules/hisat2/build/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -28,7 +28,7 @@ process HISAT2_BUILD { output: path "hisat2" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def avail_mem = 0 @@ -65,6 +65,9 @@ process HISAT2_BUILD { $fasta \\ hisat2/${fasta.baseName} - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/hisat2/build/meta.yml b/modules/hisat2/build/meta.yml index 2f34d9d8..1d3fc7e6 100644 --- a/modules/hisat2/build/meta.yml +++ b/modules/hisat2/build/meta.yml @@ -32,7 +32,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - index: type: file description: HISAT2 genome index file diff --git a/modules/hisat2/extractsplicesites/functions.nf b/modules/hisat2/extractsplicesites/functions.nf index da9da093..85628ee0 100644 --- a/modules/hisat2/extractsplicesites/functions.nf +++ b/modules/hisat2/extractsplicesites/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/hisat2/extractsplicesites/main.nf b/modules/hisat2/extractsplicesites/main.nf index d97fdb89..3387cbd1 100644 --- a/modules/hisat2/extractsplicesites/main.nf +++ b/modules/hisat2/extractsplicesites/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,12 +25,15 @@ process HISAT2_EXTRACTSPLICESITES { output: path "*.splice_sites.txt", emit: txt - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ hisat2_extract_splice_sites.py $gtf > ${gtf.baseName}.splice_sites.txt - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/hisat2/extractsplicesites/meta.yml b/modules/hisat2/extractsplicesites/meta.yml index 228138a8..3befc4dd 100644 --- a/modules/hisat2/extractsplicesites/meta.yml +++ b/modules/hisat2/extractsplicesites/meta.yml @@ -24,7 +24,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - splicesites: type: file description: Splices sites in gtf file diff --git a/modules/hmmer/hmmalign/functions.nf b/modules/hmmer/hmmalign/functions.nf index da9da093..85628ee0 100644 --- a/modules/hmmer/hmmalign/functions.nf +++ b/modules/hmmer/hmmalign/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/hmmer/hmmalign/main.nf b/modules/hmmer/hmmalign/main.nf index 0446707b..a4166fcb 100644 --- a/modules/hmmer/hmmalign/main.nf +++ b/modules/hmmer/hmmalign/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process HMMER_HMMALIGN { output: tuple val(meta), path("*.sthlm.gz"), emit: sthlm - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process HMMER_HMMALIGN { $hmm \\ - | gzip -c > ${meta.id}.sthlm.gz - echo \$(hmmalign -h | grep -o '^# HMMER [0-9.]*') | sed 's/^# HMMER *//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(hmmalign -h | grep -o '^# HMMER [0-9.]*' | sed 's/^# HMMER *//') + END_VERSIONS """ } diff --git a/modules/hmmer/hmmalign/meta.yml b/modules/hmmer/hmmalign/meta.yml index 563d227d..60020b32 100644 --- a/modules/hmmer/hmmalign/meta.yml +++ b/modules/hmmer/hmmalign/meta.yml @@ -35,7 +35,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - sthlm: type: file description: Multiple alignment in gzipped Stockholm format diff --git a/modules/homer/annotatepeaks/functions.nf b/modules/homer/annotatepeaks/functions.nf index da9da093..85628ee0 100644 --- a/modules/homer/annotatepeaks/functions.nf +++ b/modules/homer/annotatepeaks/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/homer/annotatepeaks/main.nf b/modules/homer/annotatepeaks/main.nf index 22dbb955..198ae1fe 100644 --- a/modules/homer/annotatepeaks/main.nf +++ b/modules/homer/annotatepeaks/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process HOMER_ANNOTATEPEAKS { output: tuple val(meta), path("*annotatePeaks.txt"), emit: txt - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -41,6 +41,9 @@ process HOMER_ANNOTATEPEAKS { -cpu $task.cpus \\ > ${prefix}.annotatePeaks.txt - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/homer/annotatepeaks/meta.yml b/modules/homer/annotatepeaks/meta.yml index a22b9618..f311741b 100644 --- a/modules/homer/annotatepeaks/meta.yml +++ b/modules/homer/annotatepeaks/meta.yml @@ -41,7 +41,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/homer/findpeaks/functions.nf b/modules/homer/findpeaks/functions.nf index da9da093..85628ee0 100644 --- a/modules/homer/findpeaks/functions.nf +++ b/modules/homer/findpeaks/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/homer/findpeaks/main.nf b/modules/homer/findpeaks/main.nf index 5fcacc1d..fe8399a1 100644 --- a/modules/homer/findpeaks/main.nf +++ b/modules/homer/findpeaks/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] def options = initOptions(params.options) @@ -25,7 +25,7 @@ process HOMER_FINDPEAKS { output: tuple val(meta), path("*peaks.txt"), emit: txt - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process HOMER_FINDPEAKS { $options.args \\ -o ${prefix}.peaks.txt - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/homer/findpeaks/meta.yml b/modules/homer/findpeaks/meta.yml index d19199d7..51932688 100644 --- a/modules/homer/findpeaks/meta.yml +++ b/modules/homer/findpeaks/meta.yml @@ -32,6 +32,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@EMiller88" diff --git a/modules/homer/maketagdirectory/functions.nf b/modules/homer/maketagdirectory/functions.nf index da9da093..85628ee0 100644 --- a/modules/homer/maketagdirectory/functions.nf +++ b/modules/homer/maketagdirectory/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/homer/maketagdirectory/main.nf b/modules/homer/maketagdirectory/main.nf index e0358bc1..daf0ce60 100644 --- a/modules/homer/maketagdirectory/main.nf +++ b/modules/homer/maketagdirectory/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] def options = initOptions(params.options) @@ -26,7 +26,7 @@ process HOMER_MAKETAGDIRECTORY { output: tuple val(meta), path("tag_dir"), emit: tagdir - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -38,6 +38,9 @@ process HOMER_MAKETAGDIRECTORY { $bed \\ -genome $fasta - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/homer/maketagdirectory/meta.yml b/modules/homer/maketagdirectory/meta.yml index 78dee297..7a35857b 100644 --- a/modules/homer/maketagdirectory/meta.yml +++ b/modules/homer/maketagdirectory/meta.yml @@ -36,6 +36,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@EMiller88" diff --git a/modules/homer/makeucscfile/functions.nf b/modules/homer/makeucscfile/functions.nf index da9da093..85628ee0 100644 --- a/modules/homer/makeucscfile/functions.nf +++ b/modules/homer/makeucscfile/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/homer/makeucscfile/main.nf b/modules/homer/makeucscfile/main.nf index 876d834f..5b23e243 100644 --- a/modules/homer/makeucscfile/main.nf +++ b/modules/homer/makeucscfile/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] def options = initOptions(params.options) @@ -25,7 +25,7 @@ process HOMER_MAKEUCSCFILE { output: tuple val(meta), path("tag_dir/*ucsc.bedGraph.gz"), emit: bedGraph - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process HOMER_MAKEUCSCFILE { -o auto $options.args - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/homer/makeucscfile/meta.yml b/modules/homer/makeucscfile/meta.yml index 891cb295..e63e979a 100644 --- a/modules/homer/makeucscfile/meta.yml +++ b/modules/homer/makeucscfile/meta.yml @@ -33,6 +33,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@EMiller88" diff --git a/modules/iqtree/functions.nf b/modules/iqtree/functions.nf index da9da093..85628ee0 100644 --- a/modules/iqtree/functions.nf +++ b/modules/iqtree/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/iqtree/main.nf b/modules/iqtree/main.nf index 3bd0f3b1..28e07207 100644 --- a/modules/iqtree/main.nf +++ b/modules/iqtree/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process IQTREE { output: path "*.treefile", emit: phylogeny - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process IQTREE { -ntmax $task.cpus \\ -mem $memory \\ - echo \$(iqtree -version 2>&1) | sed 's/^IQ-TREE multicore version \\([0-9\\.]*\\) .*\$/\\1/' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(iqtree -version 2>&1 | sed 's/^IQ-TREE multicore version \\([0-9\\.]*\\) .*\$/\\1/') + END_VERSIONS """ } diff --git a/modules/iqtree/meta.yml b/modules/iqtree/meta.yml index 19f81b15..426ad0cf 100644 --- a/modules/iqtree/meta.yml +++ b/modules/iqtree/meta.yml @@ -23,7 +23,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - phylogeny: type: file description: A phylogeny in Newick format diff --git a/modules/ivar/consensus/functions.nf b/modules/ivar/consensus/functions.nf index da9da093..85628ee0 100644 --- a/modules/ivar/consensus/functions.nf +++ b/modules/ivar/consensus/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/ivar/consensus/main.nf b/modules/ivar/consensus/main.nf index 1b1019cf..7c4a5b57 100644 --- a/modules/ivar/consensus/main.nf +++ b/modules/ivar/consensus/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process IVAR_CONSENSUS { tuple val(meta), path("*.fa") , emit: fasta tuple val(meta), path("*.qual.txt"), emit: qual tuple val(meta), path("*.mpileup") , optional:true, emit: mpileup - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process IVAR_CONSENSUS { $options.args \\ -p $prefix - echo \$(ivar version 2>&1) | sed 's/^.*iVar version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(ivar version 2>&1 | sed 's/^.*iVar version //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/ivar/consensus/meta.yml b/modules/ivar/consensus/meta.yml index 913a7660..2a95c51c 100644 --- a/modules/ivar/consensus/meta.yml +++ b/modules/ivar/consensus/meta.yml @@ -45,7 +45,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@andersgs" - "@drpatelh" diff --git a/modules/ivar/trim/functions.nf b/modules/ivar/trim/functions.nf index da9da093..85628ee0 100644 --- a/modules/ivar/trim/functions.nf +++ b/modules/ivar/trim/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/ivar/trim/main.nf b/modules/ivar/trim/main.nf index afdc99e4..e9b1e23b 100644 --- a/modules/ivar/trim/main.nf +++ b/modules/ivar/trim/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process IVAR_TRIM { output: tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path('*.log'), emit: log - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -38,6 +38,9 @@ process IVAR_TRIM { -p $prefix \\ > ${prefix}.ivar.log - echo \$(ivar version 2>&1) | sed 's/^.*iVar version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(ivar version 2>&1 | sed 's/^.*iVar version //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/ivar/trim/meta.yml b/modules/ivar/trim/meta.yml index 5791db66..762a9fe9 100644 --- a/modules/ivar/trim/meta.yml +++ b/modules/ivar/trim/meta.yml @@ -45,7 +45,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@andersgs" - "@drpatelh" diff --git a/modules/ivar/variants/functions.nf b/modules/ivar/variants/functions.nf index da9da093..85628ee0 100644 --- a/modules/ivar/variants/functions.nf +++ b/modules/ivar/variants/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/ivar/variants/main.nf b/modules/ivar/variants/main.nf index 154f309c..505d72fb 100644 --- a/modules/ivar/variants/main.nf +++ b/modules/ivar/variants/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process IVAR_VARIANTS { output: tuple val(meta), path("*.tsv") , emit: tsv tuple val(meta), path("*.mpileup"), optional:true, emit: mpileup - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -45,6 +45,9 @@ process IVAR_VARIANTS { -r $fasta \\ -p $prefix - echo \$(ivar version 2>&1) | sed 's/^.*iVar version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(ivar version 2>&1 | sed 's/^.*iVar version //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/ivar/variants/meta.yml b/modules/ivar/variants/meta.yml index 7a5fbbc0..37eb9133 100644 --- a/modules/ivar/variants/meta.yml +++ b/modules/ivar/variants/meta.yml @@ -45,7 +45,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@andersgs" - "@drpatelh" diff --git a/modules/kallisto/index/functions.nf b/modules/kallisto/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/kallisto/index/functions.nf +++ b/modules/kallisto/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/kallisto/index/main.nf b/modules/kallisto/index/main.nf index 85eb7f0d..00ae9601 100644 --- a/modules/kallisto/index/main.nf +++ b/modules/kallisto/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process KALLISTO_INDEX { output: path "kallisto" , emit: idx - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process KALLISTO_INDEX { -i kallisto \\ $fasta - echo \$(kallisto 2>&1) | sed 's/^kallisto //; s/Usage.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(kallisto 2>&1 | sed 's/^kallisto //; s/Usage.*\$//') + END_VERSIONS """ } diff --git a/modules/kallisto/index/meta.yml b/modules/kallisto/index/meta.yml index 24b44b0b..ba4855b0 100644 --- a/modules/kallisto/index/meta.yml +++ b/modules/kallisto/index/meta.yml @@ -21,7 +21,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - idx: type: index description: Kallisto genome index diff --git a/modules/kallistobustools/count/functions.nf b/modules/kallistobustools/count/functions.nf index da9da093..85628ee0 100644 --- a/modules/kallistobustools/count/functions.nf +++ b/modules/kallistobustools/count/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/kallistobustools/count/main.nf b/modules/kallistobustools/count/main.nf index cb561a9d..309bd57c 100644 --- a/modules/kallistobustools/count/main.nf +++ b/modules/kallistobustools/count/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -29,7 +29,7 @@ process KALLISTOBUSTOOLS_COUNT { output: tuple val(meta), path ("*.count"), emit: count - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -51,6 +51,9 @@ process KALLISTOBUSTOOLS_COUNT { ${reads[0]} \\ ${reads[1]} - echo \$(kb 2>&1) | sed 's/^.*kb_python //;s/positional arguments.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(kb 2>&1 | sed 's/^.*kb_python //;s/positional arguments.*\$//') + END_VERSIONS """ } diff --git a/modules/kallistobustools/count/meta.yml b/modules/kallistobustools/count/meta.yml index 688dfdef..41cf91a0 100644 --- a/modules/kallistobustools/count/meta.yml +++ b/modules/kallistobustools/count/meta.yml @@ -61,7 +61,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@flowuenne" diff --git a/modules/kallistobustools/ref/functions.nf b/modules/kallistobustools/ref/functions.nf index da9da093..85628ee0 100644 --- a/modules/kallistobustools/ref/functions.nf +++ b/modules/kallistobustools/ref/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/kallistobustools/ref/main.nf b/modules/kallistobustools/ref/main.nf index 93935696..bc9b32f5 100644 --- a/modules/kallistobustools/ref/main.nf +++ b/modules/kallistobustools/ref/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process KALLISTOBUSTOOLS_REF { val workflow output: - path "*.version.txt" , emit: version + path "versions.yml" , emit: version path "kb_ref_out.idx" , emit: index path "t2g.txt" , emit: t2g path "cdna.fa" , emit: cdna @@ -45,7 +45,10 @@ process KALLISTOBUSTOOLS_REF { $fasta \\ $gtf - echo \$(kb 2>&1) | sed 's/^.*kb_python //;s/positional arguments.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(kb 2>&1 | sed 's/^.*kb_python //;s/positional arguments.*\$//') + END_VERSIONS """ } else { """ @@ -61,7 +64,10 @@ process KALLISTOBUSTOOLS_REF { $fasta \\ $gtf - echo \$(kb 2>&1) | sed 's/^.*kb_python //;s/positional arguments.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(kb 2>&1 | sed 's/^.*kb_python //;s/positional arguments.*\$//') + END_VERSIONS """ } } diff --git a/modules/kallistobustools/ref/meta.yml b/modules/kallistobustools/ref/meta.yml index c2a85b37..b9f50f20 100644 --- a/modules/kallistobustools/ref/meta.yml +++ b/modules/kallistobustools/ref/meta.yml @@ -30,7 +30,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - kb_ref_idx: type: file description: Index file from kb ref. diff --git a/modules/kleborate/functions.nf b/modules/kleborate/functions.nf index da9da093..85628ee0 100644 --- a/modules/kleborate/functions.nf +++ b/modules/kleborate/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/kleborate/main.nf b/modules/kleborate/main.nf index ef7eab23..0079071f 100644 --- a/modules/kleborate/main.nf +++ b/modules/kleborate/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process KLEBORATE { output: tuple val(meta), path("*.txt"), emit: txt - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process KLEBORATE { --outfile ${prefix}.results.txt \\ --assemblies *.fasta - echo \$(kleborate -v 2>&1) | sed 's/kleborate //;' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(kleborate -v 2>&1 | sed 's/kleborate //;') + END_VERSIONS """ } diff --git a/modules/kleborate/meta.yml b/modules/kleborate/meta.yml index 19643033..0394a626 100644 --- a/modules/kleborate/meta.yml +++ b/modules/kleborate/meta.yml @@ -32,7 +32,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - txt: type: file description: Result file generated after screening diff --git a/modules/kraken2/kraken2/functions.nf b/modules/kraken2/kraken2/functions.nf index da9da093..85628ee0 100644 --- a/modules/kraken2/kraken2/functions.nf +++ b/modules/kraken2/kraken2/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/kraken2/kraken2/main.nf b/modules/kraken2/kraken2/main.nf index ea0b72fd..9a01389a 100644 --- a/modules/kraken2/kraken2/main.nf +++ b/modules/kraken2/kraken2/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process KRAKEN2_KRAKEN2 { tuple val(meta), path('*classified*') , emit: classified tuple val(meta), path('*unclassified*'), emit: unclassified tuple val(meta), path('*report.txt') , emit: txt - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -48,6 +48,9 @@ process KRAKEN2_KRAKEN2 { pigz -p $task.cpus *.fastq - echo \$(kraken2 --version 2>&1) | sed 's/^.*Kraken version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(kraken2 --version 2>&1 | sed 's/^.*Kraken version //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/kraken2/kraken2/meta.yml b/modules/kraken2/kraken2/meta.yml index cb1ec0de..3996fbc0 100644 --- a/modules/kraken2/kraken2/meta.yml +++ b/modules/kraken2/kraken2/meta.yml @@ -53,7 +53,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/last/dotplot/functions.nf b/modules/last/dotplot/functions.nf index da9da093..85628ee0 100644 --- a/modules/last/dotplot/functions.nf +++ b/modules/last/dotplot/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/last/dotplot/main.nf b/modules/last/dotplot/main.nf index 3644a18e..ca30bbff 100644 --- a/modules/last/dotplot/main.nf +++ b/modules/last/dotplot/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process LAST_DOTPLOT { output: tuple val(meta), path("*.gif"), optional:true, emit: gif tuple val(meta), path("*.png"), optional:true, emit: png - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process LAST_DOTPLOT { $prefix.$format # last-dotplot has no --version option so let's use lastal from the same suite - lastal --version | sed 's/lastal //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(lastal --version | sed 's/lastal //') + END_VERSIONS """ } diff --git a/modules/last/dotplot/meta.yml b/modules/last/dotplot/meta.yml index ab57dab7..fa092b4c 100644 --- a/modules/last/dotplot/meta.yml +++ b/modules/last/dotplot/meta.yml @@ -41,7 +41,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@charles-plessy" diff --git a/modules/last/lastal/functions.nf b/modules/last/lastal/functions.nf index da9da093..85628ee0 100644 --- a/modules/last/lastal/functions.nf +++ b/modules/last/lastal/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/last/lastal/main.nf b/modules/last/lastal/main.nf index e42653cc..3d6518a4 100644 --- a/modules/last/lastal/main.nf +++ b/modules/last/lastal/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process LAST_LASTAL { output: tuple val(meta), path("*.maf.gz"), emit: maf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process LAST_LASTAL { # gzip needs --no-name otherwise it puts a timestamp in the file, # which makes its checksum non-reproducible. - echo \$(lastal --version 2>&1) | sed 's/lastal //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(lastal --version 2>&1 | sed 's/lastal //') + END_VERSIONS """ } diff --git a/modules/last/lastal/meta.yml b/modules/last/lastal/meta.yml index 2237c75a..1f8fde9c 100644 --- a/modules/last/lastal/meta.yml +++ b/modules/last/lastal/meta.yml @@ -42,7 +42,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - maf: type: file description: Gzipped MAF (Multiple Alignment Format) file diff --git a/modules/last/lastdb/functions.nf b/modules/last/lastdb/functions.nf index da9da093..85628ee0 100644 --- a/modules/last/lastdb/functions.nf +++ b/modules/last/lastdb/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/last/lastdb/main.nf b/modules/last/lastdb/main.nf index a8cd4921..ac552e7d 100644 --- a/modules/last/lastdb/main.nf +++ b/modules/last/lastdb/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process LAST_LASTDB { output: tuple val(meta), path("lastdb"), emit: index - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process LAST_LASTDB { lastdb/${prefix} \\ $fastx - echo \$(lastdb --version 2>&1) | sed 's/lastdb //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(lastdb --version 2>&1 | sed 's/lastdb //') + END_VERSIONS """ } diff --git a/modules/last/lastdb/meta.yml b/modules/last/lastdb/meta.yml index 64e4d3e3..cddbc29c 100644 --- a/modules/last/lastdb/meta.yml +++ b/modules/last/lastdb/meta.yml @@ -31,7 +31,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - index: type: directory description: directory containing the files of the LAST index diff --git a/modules/last/mafconvert/functions.nf b/modules/last/mafconvert/functions.nf index da9da093..85628ee0 100644 --- a/modules/last/mafconvert/functions.nf +++ b/modules/last/mafconvert/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/last/mafconvert/main.nf b/modules/last/mafconvert/main.nf index eea53dd1..e112cbd8 100644 --- a/modules/last/mafconvert/main.nf +++ b/modules/last/mafconvert/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -32,7 +32,7 @@ process LAST_MAFCONVERT { tuple val(meta), path("*.psl.gz"), optional:true, emit: psl_gz tuple val(meta), path("*.sam.gz"), optional:true, emit: sam_gz tuple val(meta), path("*.tab.gz"), optional:true, emit: tab_gz - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process LAST_MAFCONVERT { > ${prefix}.${format}.gz # maf-convert has no --version option but lastdb (part of the same package) has. - echo \$(lastdb --version 2>&1) | sed 's/lastdb //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(lastdb --version 2>&1 | sed 's/lastdb //') + END_VERSIONS """ } diff --git a/modules/last/mafconvert/meta.yml b/modules/last/mafconvert/meta.yml index 0ab87457..f0912ccd 100644 --- a/modules/last/mafconvert/meta.yml +++ b/modules/last/mafconvert/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - axt_gz: type: file description: Gzipped pairwise alignment in Axt (Blastz) format (optional) diff --git a/modules/last/mafswap/functions.nf b/modules/last/mafswap/functions.nf index da9da093..85628ee0 100644 --- a/modules/last/mafswap/functions.nf +++ b/modules/last/mafswap/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/last/mafswap/main.nf b/modules/last/mafswap/main.nf index 03292c81..f597693c 100644 --- a/modules/last/mafswap/main.nf +++ b/modules/last/mafswap/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process LAST_MAFSWAP { output: tuple val(meta), path("*.maf.gz"), emit: maf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -32,6 +32,9 @@ process LAST_MAFSWAP { maf-swap $options.args $maf | gzip --no-name > ${prefix}.swapped.maf.gz # maf-swap has no --version option but lastdb, part of the same package, has. - echo \$(lastdb --version 2>&1) | sed 's/lastdb //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(lastdb --version 2>&1 | sed 's/lastdb //') + END_VERSIONS """ } diff --git a/modules/last/mafswap/meta.yml b/modules/last/mafswap/meta.yml index eb35a46c..8821ab47 100644 --- a/modules/last/mafswap/meta.yml +++ b/modules/last/mafswap/meta.yml @@ -33,7 +33,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@charles-plessy" diff --git a/modules/last/postmask/functions.nf b/modules/last/postmask/functions.nf index da9da093..85628ee0 100644 --- a/modules/last/postmask/functions.nf +++ b/modules/last/postmask/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/last/postmask/main.nf b/modules/last/postmask/main.nf index 677b23f6..d3fa02e3 100644 --- a/modules/last/postmask/main.nf +++ b/modules/last/postmask/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process LAST_POSTMASK { output: tuple val(meta), path("*.maf.gz"), emit: maf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process LAST_POSTMASK { last-postmask $options.args $maf | gzip --no-name > ${prefix}.maf.gz # last-postmask does not have a --version option - echo \$(lastal --version 2>&1) | sed 's/lastal //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(lastal --version 2>&1 | sed 's/lastal //') + END_VERSIONS """ } diff --git a/modules/last/postmask/meta.yml b/modules/last/postmask/meta.yml index 45eaa2b9..d3a184eb 100644 --- a/modules/last/postmask/meta.yml +++ b/modules/last/postmask/meta.yml @@ -33,7 +33,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@charles-plessy" diff --git a/modules/last/split/functions.nf b/modules/last/split/functions.nf index da9da093..85628ee0 100644 --- a/modules/last/split/functions.nf +++ b/modules/last/split/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/last/split/main.nf b/modules/last/split/main.nf index a6fe1dda..78d59ed4 100644 --- a/modules/last/split/main.nf +++ b/modules/last/split/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process LAST_SPLIT { output: tuple val(meta), path("*.maf.gz"), emit: maf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -31,6 +31,9 @@ process LAST_SPLIT { """ zcat < $maf | last-split $options.args | gzip --no-name > ${prefix}.maf.gz - echo \$(last-split --version 2>&1) | sed 's/last-split //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(last-split --version 2>&1 | sed 's/last-split //') + END_VERSIONS """ } diff --git a/modules/last/split/meta.yml b/modules/last/split/meta.yml index 73f37784..7b11bcd5 100644 --- a/modules/last/split/meta.yml +++ b/modules/last/split/meta.yml @@ -35,7 +35,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - maf: type: file description: Multiple Aligment Format (MAF) file, compressed with gzip diff --git a/modules/last/train/functions.nf b/modules/last/train/functions.nf index da9da093..85628ee0 100644 --- a/modules/last/train/functions.nf +++ b/modules/last/train/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/last/train/main.nf b/modules/last/train/main.nf index cc1fa544..39728ced 100644 --- a/modules/last/train/main.nf +++ b/modules/last/train/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process LAST_TRAIN { output: tuple val(meta), path("*.par"), emit: param_file - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process LAST_TRAIN { $fastx \\ > ${prefix}.\$INDEX_NAME.par - lastdb --version | sed 's/lastdb //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(lastdb --version | sed 's/lastdb //') + END_VERSIONS """ } diff --git a/modules/last/train/meta.yml b/modules/last/train/meta.yml index 5796b764..820e4bc8 100644 --- a/modules/last/train/meta.yml +++ b/modules/last/train/meta.yml @@ -38,7 +38,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - param_file: type: file description: Trained parameter file diff --git a/modules/lib/functions.nf b/modules/lib/functions.nf index da9da093..85628ee0 100644 --- a/modules/lib/functions.nf +++ b/modules/lib/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/lofreq/call/functions.nf b/modules/lofreq/call/functions.nf index da9da093..85628ee0 100644 --- a/modules/lofreq/call/functions.nf +++ b/modules/lofreq/call/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/lofreq/call/main.nf b/modules/lofreq/call/main.nf index d342c929..b205f041 100644 --- a/modules/lofreq/call/main.nf +++ b/modules/lofreq/call/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process LOFREQ_CALL { output: tuple val(meta), path("*.vcf.gz"), emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process LOFREQ_CALL { -o ${prefix}.vcf.gz \\ $bam - echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(lofreq version 2>&1 | sed 's/^version: //; s/ *commit.*\$//') + END_VERSIONS """ } diff --git a/modules/lofreq/call/meta.yml b/modules/lofreq/call/meta.yml index f14115d2..16d23cd9 100644 --- a/modules/lofreq/call/meta.yml +++ b/modules/lofreq/call/meta.yml @@ -36,7 +36,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - vcf: type: file description: VCF output file diff --git a/modules/lofreq/callparallel/functions.nf b/modules/lofreq/callparallel/functions.nf index da9da093..85628ee0 100644 --- a/modules/lofreq/callparallel/functions.nf +++ b/modules/lofreq/callparallel/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/lofreq/callparallel/main.nf b/modules/lofreq/callparallel/main.nf index 4392c700..2bea68f2 100644 --- a/modules/lofreq/callparallel/main.nf +++ b/modules/lofreq/callparallel/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process LOFREQ_CALLPARALLEL { output: tuple val(meta), path("*.vcf.gz"), emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process LOFREQ_CALLPARALLEL { -o ${prefix}.vcf.gz \\ $bam - echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(lofreq version 2>&1 | sed 's/^version: //; s/ *commit.*\$//') + END_VERSIONS """ } diff --git a/modules/lofreq/callparallel/meta.yml b/modules/lofreq/callparallel/meta.yml index 3154f412..15257180 100644 --- a/modules/lofreq/callparallel/meta.yml +++ b/modules/lofreq/callparallel/meta.yml @@ -43,7 +43,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - vcf: type: file description: Predicted variants file diff --git a/modules/lofreq/filter/functions.nf b/modules/lofreq/filter/functions.nf index da9da093..85628ee0 100644 --- a/modules/lofreq/filter/functions.nf +++ b/modules/lofreq/filter/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/lofreq/filter/main.nf b/modules/lofreq/filter/main.nf index a2b53f08..693cef23 100644 --- a/modules/lofreq/filter/main.nf +++ b/modules/lofreq/filter/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process LOFREQ_FILTER { output: tuple val(meta), path("*.gz"), emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process LOFREQ_FILTER { -i $vcf \\ -o ${prefix}.vcf.gz - echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(lofreq version 2>&1 | sed 's/^version: //; s/ *commit.*\$//') + END_VERSIONS """ } diff --git a/modules/lofreq/filter/meta.yml b/modules/lofreq/filter/meta.yml index 9de18d4d..9aa92da7 100644 --- a/modules/lofreq/filter/meta.yml +++ b/modules/lofreq/filter/meta.yml @@ -34,7 +34,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - vcf: type: file description: VCF filtered output file diff --git a/modules/lofreq/indelqual/functions.nf b/modules/lofreq/indelqual/functions.nf index da9da093..85628ee0 100644 --- a/modules/lofreq/indelqual/functions.nf +++ b/modules/lofreq/indelqual/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/lofreq/indelqual/main.nf b/modules/lofreq/indelqual/main.nf index befd8d7a..89c79c39 100644 --- a/modules/lofreq/indelqual/main.nf +++ b/modules/lofreq/indelqual/main.nf @@ -1,4 +1,4 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process LOFREQ_INDELQUAL { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process LOFREQ_INDELQUAL { -o ${prefix}.bam \\ $bam - echo \$(lofreq version 2>&1) | sed 's/^.*lofreq //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(lofreq version 2>&1 | sed 's/^.*lofreq //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/lofreq/indelqual/meta.yml b/modules/lofreq/indelqual/meta.yml index 294cf17d..34f296d7 100644 --- a/modules/lofreq/indelqual/meta.yml +++ b/modules/lofreq/indelqual/meta.yml @@ -34,7 +34,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: BAM file with indel qualities inserted into it diff --git a/modules/macs2/callpeak/functions.nf b/modules/macs2/callpeak/functions.nf index da9da093..85628ee0 100644 --- a/modules/macs2/callpeak/functions.nf +++ b/modules/macs2/callpeak/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/macs2/callpeak/main.nf b/modules/macs2/callpeak/main.nf index 67d686c6..4fcd6b05 100644 --- a/modules/macs2/callpeak/main.nf +++ b/modules/macs2/callpeak/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process MACS2_CALLPEAK { output: tuple val(meta), path("*.{narrowPeak,broadPeak}"), emit: peak tuple val(meta), path("*.xls") , emit: xls - path "*.version.txt" , emit: version + path "versions.yml" , emit: version tuple val(meta), path("*.gappedPeak"), optional:true, emit: gapped tuple val(meta), path("*.bed") , optional:true, emit: bed @@ -46,6 +46,9 @@ process MACS2_CALLPEAK { --treatment $ipbam \\ $control - macs2 --version | sed -e "s/macs2 //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(macs2 --version | sed -e "s/macs2 //g") + END_VERSIONS """ } diff --git a/modules/malt/build/functions.nf b/modules/malt/build/functions.nf index da9da093..85628ee0 100644 --- a/modules/malt/build/functions.nf +++ b/modules/malt/build/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/malt/build/main.nf b/modules/malt/build/main.nf index a7e3751b..3b494c0c 100644 --- a/modules/malt/build/main.nf +++ b/modules/malt/build/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process MALT_BUILD { output: path "malt_index/" , emit: index - path "*.version.txt" , emit: version + path "versions.yml" , emit: version path "malt-build.log", emit: log script: @@ -51,6 +51,9 @@ process MALT_BUILD { $options.args \\ -mdb ${map_db}/*.db |&tee malt-build.log - malt-build --help |& tail -n 3 | head -n 1 | cut -f 2 -d'(' | cut -f 1 -d ',' | cut -d ' ' -f 2 > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(malt-build --help |& tail -n 3 | head -n 1 | cut -f 2 -d'(' | cut -f 1 -d ',' | cut -d ' ' -f 2) + END_VERSIONS """ } diff --git a/modules/malt/build/meta.yml b/modules/malt/build/meta.yml index 5ace4d29..f1668b94 100644 --- a/modules/malt/build/meta.yml +++ b/modules/malt/build/meta.yml @@ -41,7 +41,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - index: type: directory description: Directory containing MALT database index directory diff --git a/modules/malt/run/functions.nf b/modules/malt/run/functions.nf index da9da093..85628ee0 100644 --- a/modules/malt/run/functions.nf +++ b/modules/malt/run/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/malt/run/main.nf b/modules/malt/run/main.nf index 8add081c..689dabf4 100644 --- a/modules/malt/run/main.nf +++ b/modules/malt/run/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process MALT_RUN { path "*.rma6" , emit: rma6 path "*.{tab,text,sam}", optional:true, emit: alignments path "*.log" , emit: log - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -49,6 +49,9 @@ process MALT_RUN { -m $mode \\ --index $index/ |&tee malt-run.log - echo \$(malt-run --help 2>&1) | grep -o 'version.* ' | cut -f 1 -d ',' | cut -f2 -d ' ' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(malt-run --help 2>&1 | grep -o 'version.* ' | cut -f 1 -d ',' | cut -f2 -d ' ') + END_VERSIONS """ } diff --git a/modules/malt/run/meta.yml b/modules/malt/run/meta.yml index 30421a48..3ad78622 100644 --- a/modules/malt/run/meta.yml +++ b/modules/malt/run/meta.yml @@ -35,7 +35,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - rma6: type: file description: MEGAN6 RMA6 file diff --git a/modules/maltextract/functions.nf b/modules/maltextract/functions.nf index da9da093..85628ee0 100644 --- a/modules/maltextract/functions.nf +++ b/modules/maltextract/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/maltextract/main.nf b/modules/maltextract/main.nf index d7402cb8..426a9fc3 100644 --- a/modules/maltextract/main.nf +++ b/modules/maltextract/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process MALTEXTRACT { output: path "results" , emit: results - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process MALTEXTRACT { -o results/ \\ $options.args - echo \$(MaltExtract --help | head -n 2 | tail -n 1) | sed 's/MaltExtract version//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(MaltExtract --help | head -n 2 | tail -n 1 | sed 's/MaltExtract version//') + END_VERSIONS """ } diff --git a/modules/maltextract/meta.yml b/modules/maltextract/meta.yml index 3cb20fa2..29271753 100644 --- a/modules/maltextract/meta.yml +++ b/modules/maltextract/meta.yml @@ -41,7 +41,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - results: type: directory description: Directory containing MaltExtract text results files diff --git a/modules/mash/sketch/functions.nf b/modules/mash/sketch/functions.nf index da9da093..85628ee0 100644 --- a/modules/mash/sketch/functions.nf +++ b/modules/mash/sketch/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/mash/sketch/main.nf b/modules/mash/sketch/main.nf index 3cc7e199..ed018b1a 100644 --- a/modules/mash/sketch/main.nf +++ b/modules/mash/sketch/main.nf @@ -1,4 +1,4 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -22,7 +22,7 @@ process MASH_SKETCH { output: tuple val(meta), path("*.msh") , emit: mash tuple val(meta), path("*.mash_stats") , emit: stats - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process MASH_SKETCH { -o ${prefix} \\ -r $reads \\ 2> ${prefix}.mash_stats - echo \$(mash --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(mash --version 2>&1) + END_VERSIONS """ } diff --git a/modules/metaphlan3/functions.nf b/modules/metaphlan3/functions.nf index da9da093..85628ee0 100644 --- a/modules/metaphlan3/functions.nf +++ b/modules/metaphlan3/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/metaphlan3/main.nf b/modules/metaphlan3/main.nf index 6c75c2a0..8893c2ab 100644 --- a/modules/metaphlan3/main.nf +++ b/modules/metaphlan3/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process METAPHLAN3 { tuple val(meta), path("*_profile.txt") , emit: profile tuple val(meta), path("*.biom") , emit: biom tuple val(meta), path('*.bowtie2out.txt'), optional:true, emit: bt2out - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -45,6 +45,9 @@ process METAPHLAN3 { --bowtie2db ${metaphlan_db} \\ --biom ${prefix}.biom \\ --output_file ${prefix}_profile.txt - echo \$(metaphlan --version 2>&1) | awk '{print \$3}' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(metaphlan --version 2>&1 | awk '{print \$3}') + END_VERSIONS """ } diff --git a/modules/metaphlan3/meta.yml b/modules/metaphlan3/meta.yml index e0d54d88..d9f9f520 100644 --- a/modules/metaphlan3/meta.yml +++ b/modules/metaphlan3/meta.yml @@ -34,7 +34,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - profile: type: file description: Tab-separated output file of the predicted taxon relative abundances diff --git a/modules/methyldackel/extract/functions.nf b/modules/methyldackel/extract/functions.nf index da9da093..85628ee0 100644 --- a/modules/methyldackel/extract/functions.nf +++ b/modules/methyldackel/extract/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/methyldackel/extract/main.nf b/modules/methyldackel/extract/main.nf index 4c7da3f4..149f4aa0 100644 --- a/modules/methyldackel/extract/main.nf +++ b/modules/methyldackel/extract/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process METHYLDACKEL_EXTRACT { output: tuple val(meta), path("*.bedGraph"), emit: bedgraph - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process METHYLDACKEL_EXTRACT { $fasta \\ $bam - echo \$(MethylDackel --version 2>&1) | cut -f1 -d" " > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(MethylDackel --version 2>&1 | cut -f1 -d" ") + END_VERSIONS """ } diff --git a/modules/methyldackel/extract/meta.yml b/modules/methyldackel/extract/meta.yml index 525ddebe..7219bb81 100644 --- a/modules/methyldackel/extract/meta.yml +++ b/modules/methyldackel/extract/meta.yml @@ -52,6 +52,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/methyldackel/mbias/functions.nf b/modules/methyldackel/mbias/functions.nf index da9da093..85628ee0 100644 --- a/modules/methyldackel/mbias/functions.nf +++ b/modules/methyldackel/mbias/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/methyldackel/mbias/main.nf b/modules/methyldackel/mbias/main.nf index 7c18197f..9fa39b82 100644 --- a/modules/methyldackel/mbias/main.nf +++ b/modules/methyldackel/mbias/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process METHYLDACKEL_MBIAS { output: tuple val(meta), path("*.mbias.txt"), emit: txt - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process METHYLDACKEL_MBIAS { --txt \\ > ${prefix}.mbias.txt - echo \$(MethylDackel --version 2>&1) | cut -f1 -d" " > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(MethylDackel --version 2>&1 | cut -f1 -d" ") + END_VERSIONS """ } diff --git a/modules/methyldackel/mbias/meta.yml b/modules/methyldackel/mbias/meta.yml index e41d0208..a6f58d09 100644 --- a/modules/methyldackel/mbias/meta.yml +++ b/modules/methyldackel/mbias/meta.yml @@ -53,6 +53,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/minia/functions.nf b/modules/minia/functions.nf index da9da093..85628ee0 100644 --- a/modules/minia/functions.nf +++ b/modules/minia/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/minia/main.nf b/modules/minia/main.nf index 9ae79ede..b7aa9272 100644 --- a/modules/minia/main.nf +++ b/modules/minia/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process MINIA { tuple val(meta), path('*.contigs.fa'), emit: contigs tuple val(meta), path('*.unitigs.fa'), emit: unitigs tuple val(meta), path('*.h5') , emit: h5 - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -38,6 +38,9 @@ process MINIA { -in input_files.txt \\ -out $prefix - echo \$(minia --version 2>&1) | sed 's/^.*Minia version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(minia --version 2>&1 | sed 's/^.*Minia version //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/minia/meta.yml b/modules/minia/meta.yml index d3a76be8..638cc3ad 100644 --- a/modules/minia/meta.yml +++ b/modules/minia/meta.yml @@ -40,7 +40,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/minimap2/align/functions.nf b/modules/minimap2/align/functions.nf index da9da093..85628ee0 100644 --- a/modules/minimap2/align/functions.nf +++ b/modules/minimap2/align/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/minimap2/align/main.nf b/modules/minimap2/align/main.nf index ec5f6a07..d0ff9c0f 100644 --- a/modules/minimap2/align/main.nf +++ b/modules/minimap2/align/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process MINIMAP2_ALIGN { output: tuple val(meta), path("*.paf"), emit: paf - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -38,6 +38,9 @@ process MINIMAP2_ALIGN { $input_reads \\ > ${prefix}.paf - echo \$(minimap2 --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(minimap2 --version 2>&1) + END_VERSIONS """ } diff --git a/modules/minimap2/align/meta.yml b/modules/minimap2/align/meta.yml index 3c741b16..1cb20473 100644 --- a/modules/minimap2/align/meta.yml +++ b/modules/minimap2/align/meta.yml @@ -41,6 +41,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/minimap2/index/functions.nf b/modules/minimap2/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/minimap2/index/functions.nf +++ b/modules/minimap2/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/minimap2/index/main.nf b/modules/minimap2/index/main.nf index e143bd62..cfc40417 100644 --- a/modules/minimap2/index/main.nf +++ b/modules/minimap2/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -22,7 +22,7 @@ process MINIMAP2_INDEX { output: path "*.mmi" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process MINIMAP2_INDEX { $options.args \\ $fasta - echo \$(minimap2 --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(minimap2 --version 2>&1) + END_VERSIONS """ } diff --git a/modules/minimap2/index/meta.yml b/modules/minimap2/index/meta.yml index 065e5c32..c1c43c70 100644 --- a/modules/minimap2/index/meta.yml +++ b/modules/minimap2/index/meta.yml @@ -23,7 +23,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@yuukiiwa" - "@drpatelh" diff --git a/modules/mosdepth/functions.nf b/modules/mosdepth/functions.nf index da9da093..85628ee0 100644 --- a/modules/mosdepth/functions.nf +++ b/modules/mosdepth/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/mosdepth/main.nf b/modules/mosdepth/main.nf index 6beea37a..c21ea2a8 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -31,7 +31,7 @@ process MOSDEPTH { tuple val(meta), path('*.per-base.bed.gz.csi'), emit: per_base_csi tuple val(meta), path('*.regions.bed.gz') , emit: regions_bed tuple val(meta), path('*.regions.bed.gz.csi') , emit: regions_csi - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -43,6 +43,9 @@ process MOSDEPTH { $options.args \\ $prefix \\ $bam - echo \$(mosdepth --version 2>&1) | sed 's/^.*mosdepth //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(mosdepth --version 2>&1 | sed 's/^.*mosdepth //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/mosdepth/meta.yml b/modules/mosdepth/meta.yml index d96e474f..4c0be86c 100644 --- a/modules/mosdepth/meta.yml +++ b/modules/mosdepth/meta.yml @@ -70,7 +70,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/msisensor/msi/functions.nf b/modules/msisensor/msi/functions.nf index da9da093..85628ee0 100644 --- a/modules/msisensor/msi/functions.nf +++ b/modules/msisensor/msi/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/msisensor/msi/main.nf b/modules/msisensor/msi/main.nf index b4a0eb3c..41f79b3a 100644 --- a/modules/msisensor/msi/main.nf +++ b/modules/msisensor/msi/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process MSISENSOR_MSI { tuple val(meta), path("${prefix}_dis") , emit: output_dis tuple val(meta), path("${prefix}_germline"), emit: output_germline tuple val(meta), path("${prefix}_somatic") , emit: output_somatic - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -40,6 +40,9 @@ process MSISENSOR_MSI { -o $prefix \\ $options.args - echo \$(msisensor 2>&1) | sed -nE 's/Version:\\sv([0-9]\\.[0-9])/\\1/ p' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(msisensor 2>&1 | sed -nE 's/Version:\\sv([0-9]\\.[0-9])/\\1/ p') + END_VERSIONS """ } diff --git a/modules/msisensor/msi/meta.yml b/modules/msisensor/msi/meta.yml index 214f90e6..c01f74e0 100644 --- a/modules/msisensor/msi/meta.yml +++ b/modules/msisensor/msi/meta.yml @@ -48,7 +48,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - txt: type: file description: MSIsensor MSI final report file diff --git a/modules/msisensor/scan/functions.nf b/modules/msisensor/scan/functions.nf index da9da093..85628ee0 100644 --- a/modules/msisensor/scan/functions.nf +++ b/modules/msisensor/scan/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/msisensor/scan/main.nf b/modules/msisensor/scan/main.nf index 57ebeb28..198657ae 100644 --- a/modules/msisensor/scan/main.nf +++ b/modules/msisensor/scan/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process MSISENSOR_SCAN { output: tuple (val(meta), path("*.tab"), emit: txt) - path ("*.version.txt" , emit: version) + path ("versions.yml" , emit: version) script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process MSISENSOR_SCAN { -o ${prefix}.msisensor_scan.tab \\ $options.args - echo \$(msisensor 2>&1) | sed -nE 's/Version:\\sv([0-9]\\.[0-9])/\\1/ p' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(msisensor 2>&1 | sed -nE 's/Version:\\sv([0-9]\\.[0-9])/\\1/ p') + END_VERSIONS """ } diff --git a/modules/msisensor/scan/meta.yml b/modules/msisensor/scan/meta.yml index 2e4f8f18..940b53a5 100644 --- a/modules/msisensor/scan/meta.yml +++ b/modules/msisensor/scan/meta.yml @@ -32,7 +32,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - txt: type: file description: MSIsensor scan output file of homopolymers & minisatellites diff --git a/modules/muscle/functions.nf b/modules/muscle/functions.nf index da9da093..85628ee0 100644 --- a/modules/muscle/functions.nf +++ b/modules/muscle/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/muscle/main.nf b/modules/muscle/main.nf index 9f4747a4..ef9bf484 100644 --- a/modules/muscle/main.nf +++ b/modules/muscle/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -30,7 +30,7 @@ process MUSCLE { tuple val(meta), path("*.msf") , optional: true, emit: msf tuple val(meta), path("*.tree"), optional: true, emit: tree path "*.log" , emit: log - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -55,6 +55,9 @@ process MUSCLE { $html_out \\ $tree_out \\ -loga muscle_msa.log - muscle -version | sed 's/^MUSCLE v//; s/by.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(muscle -version | sed 's/^MUSCLE v//; s/by.*\$//') + END_VERSIONS """ } diff --git a/modules/muscle/meta.yml b/modules/muscle/meta.yml index e0eb5289..845a8284 100644 --- a/modules/muscle/meta.yml +++ b/modules/muscle/meta.yml @@ -51,6 +51,6 @@ output: - version: type: file description: File containing MUSCLE software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@MGordon" diff --git a/modules/nanolyse/functions.nf b/modules/nanolyse/functions.nf index da9da093..85628ee0 100644 --- a/modules/nanolyse/functions.nf +++ b/modules/nanolyse/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/nanolyse/main.nf b/modules/nanolyse/main.nf index 0abad6cb..84cf579a 100644 --- a/modules/nanolyse/main.nf +++ b/modules/nanolyse/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process NANOLYSE { output: tuple val(meta), path("*.fastq.gz"), emit: fastq path "*.log" , emit: log - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process NANOLYSE { gunzip -c $fastq | NanoLyse -r $fasta | gzip > ${prefix}.fastq.gz mv NanoLyse.log ${prefix}.nanolyse.log - echo \$(NanoLyse --version 2>&1) | sed -e "s/NanoLyse //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(NanoLyse --version 2>&1 | sed -e "s/NanoLyse //g") + END_VERSIONS """ } diff --git a/modules/nanolyse/meta.yml b/modules/nanolyse/meta.yml index aae299da..2411d33d 100644 --- a/modules/nanolyse/meta.yml +++ b/modules/nanolyse/meta.yml @@ -41,6 +41,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@yuukiiwa" diff --git a/modules/nanoplot/functions.nf b/modules/nanoplot/functions.nf index da9da093..85628ee0 100644 --- a/modules/nanoplot/functions.nf +++ b/modules/nanoplot/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/nanoplot/main.nf b/modules/nanoplot/main.nf index f5fffe13..86b300f5 100644 --- a/modules/nanoplot/main.nf +++ b/modules/nanoplot/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process NANOPLOT { tuple val(meta), path("*.png") , emit: png tuple val(meta), path("*.txt") , emit: txt tuple val(meta), path("*.log") , emit: log - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process NANOPLOT { $options.args \\ -t $task.cpus \\ $input_file - echo \$(NanoPlot --version 2>&1) | sed 's/^.*NanoPlot //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(NanoPlot --version 2>&1 | sed 's/^.*NanoPlot //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/nanoplot/meta.yml b/modules/nanoplot/meta.yml index f1d94312..cf897eb9 100644 --- a/modules/nanoplot/meta.yml +++ b/modules/nanoplot/meta.yml @@ -52,7 +52,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@yuukiiwa" diff --git a/modules/nextclade/functions.nf b/modules/nextclade/functions.nf index da9da093..85628ee0 100755 --- a/modules/nextclade/functions.nf +++ b/modules/nextclade/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/nextclade/main.nf b/modules/nextclade/main.nf index 8319f6b1..fabf4520 100755 --- a/modules/nextclade/main.nf +++ b/modules/nextclade/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process NEXTCLADE { tuple val(meta), path("${prefix}.tree.json") , emit: json_tree tuple val(meta), path("${prefix}.tsv") , emit: tsv tuple val(meta), path("${prefix}.clades.tsv"), optional:true, emit: tsv_clades - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -43,6 +43,9 @@ process NEXTCLADE { --output-tsv-clades-only ${prefix}.clades.tsv \\ --output-tree ${prefix}.tree.json - echo \$(nextclade --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(nextclade --version 2>&1) + END_VERSIONS """ } diff --git a/modules/nextclade/meta.yml b/modules/nextclade/meta.yml index d321e08f..730b0fa4 100755 --- a/modules/nextclade/meta.yml +++ b/modules/nextclade/meta.yml @@ -33,7 +33,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - csv: type: file description: CSV file containing nextclade results diff --git a/modules/optitype/functions.nf b/modules/optitype/functions.nf index da9da093..85628ee0 100644 --- a/modules/optitype/functions.nf +++ b/modules/optitype/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/optitype/main.nf b/modules/optitype/main.nf index 15e26c95..4f136d7c 100644 --- a/modules/optitype/main.nf +++ b/modules/optitype/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process OPTITYPE { output: tuple val(meta), path("${prefix}"), emit: output - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -48,6 +48,9 @@ process OPTITYPE { OptiTypePipeline.py -i ${bam} -c config.ini --${meta.seq_type} $options.args --prefix $prefix --outdir $prefix #Couldn't find a nicer way of doing this - cat \$(which OptiTypePipeline.py) | grep -e "Version:" | sed -e "s/Version: //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(cat \$(which OptiTypePipeline.py) | grep -e "Version:" | sed -e "s/Version: //g") + END_VERSIONS """ } diff --git a/modules/optitype/meta.yml b/modules/optitype/meta.yml index 734c4f77..02e5cec1 100644 --- a/modules/optitype/meta.yml +++ b/modules/optitype/meta.yml @@ -32,7 +32,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - output: type: file description: OptiType Results Folder diff --git a/modules/pairix/functions.nf b/modules/pairix/functions.nf index da9da093..85628ee0 100644 --- a/modules/pairix/functions.nf +++ b/modules/pairix/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pairix/main.nf b/modules/pairix/main.nf index ff1b8520..684ea7e6 100644 --- a/modules/pairix/main.nf +++ b/modules/pairix/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process PAIRIX { output: tuple val(meta), path(pair), path("*.px2"), emit: index - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -32,6 +32,9 @@ process PAIRIX { $options.args \\ $pair - echo \$(pairix --help 2>&1) | sed 's/^.*Version: //; s/Usage.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(pairix --help 2>&1 | sed 's/^.*Version: //; s/Usage.*\$//') + END_VERSIONS """ } diff --git a/modules/pairix/meta.yml b/modules/pairix/meta.yml index b0ac1b15..3c43541a 100644 --- a/modules/pairix/meta.yml +++ b/modules/pairix/meta.yml @@ -32,7 +32,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - index: type: file description: pair index file diff --git a/modules/pairtools/dedup/functions.nf b/modules/pairtools/dedup/functions.nf index da9da093..85628ee0 100644 --- a/modules/pairtools/dedup/functions.nf +++ b/modules/pairtools/dedup/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pairtools/dedup/main.nf b/modules/pairtools/dedup/main.nf index 07c81c6c..5b901a77 100644 --- a/modules/pairtools/dedup/main.nf +++ b/modules/pairtools/dedup/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process PAIRTOOLS_DEDUP { output: tuple val(meta), path("*.pairs.gz") , emit: pairs tuple val(meta), path("*.pairs.stat"), emit: stat - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process PAIRTOOLS_DEDUP { --output-stats ${prefix}.pairs.stat \\ $input - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(pairtools --version 2>&1 | sed 's/pairtools.*version //') + END_VERSIONS """ } diff --git a/modules/pairtools/dedup/meta.yml b/modules/pairtools/dedup/meta.yml index 888a52ff..d5a8ae87 100644 --- a/modules/pairtools/dedup/meta.yml +++ b/modules/pairtools/dedup/meta.yml @@ -30,7 +30,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - pairs: type: file description: Duplicates removed pairs diff --git a/modules/pairtools/flip/functions.nf b/modules/pairtools/flip/functions.nf index da9da093..85628ee0 100644 --- a/modules/pairtools/flip/functions.nf +++ b/modules/pairtools/flip/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pairtools/flip/main.nf b/modules/pairtools/flip/main.nf index efde6f55..3010b411 100644 --- a/modules/pairtools/flip/main.nf +++ b/modules/pairtools/flip/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process PAIRTOOLS_FLIP { output: tuple val(meta), path("*.flip.gz"), emit: flip - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process PAIRTOOLS_FLIP { -o ${prefix}.flip.gz \\ $sam - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(pairtools --version 2>&1 | sed 's/pairtools.*version //') + END_VERSIONS """ } diff --git a/modules/pairtools/flip/meta.yml b/modules/pairtools/flip/meta.yml index 50badc23..981e3828 100644 --- a/modules/pairtools/flip/meta.yml +++ b/modules/pairtools/flip/meta.yml @@ -33,7 +33,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - flip: type: file description: output file of flip diff --git a/modules/pairtools/parse/functions.nf b/modules/pairtools/parse/functions.nf index da9da093..85628ee0 100644 --- a/modules/pairtools/parse/functions.nf +++ b/modules/pairtools/parse/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pairtools/parse/main.nf b/modules/pairtools/parse/main.nf index ad3169e1..66c9257b 100644 --- a/modules/pairtools/parse/main.nf +++ b/modules/pairtools/parse/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process PAIRTOOLS_PARSE { output: tuple val(meta), path("*.pairsam.gz") , emit: pairsam tuple val(meta), path("*.pairsam.stat"), emit: stat - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process PAIRTOOLS_PARSE { -o ${prefix}.pairsam.gz \\ $bam - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(pairtools --version 2>&1 | sed 's/pairtools.*version //') + END_VERSIONS """ } diff --git a/modules/pairtools/parse/meta.yml b/modules/pairtools/parse/meta.yml index 311aa0ec..940fe5d1 100644 --- a/modules/pairtools/parse/meta.yml +++ b/modules/pairtools/parse/meta.yml @@ -34,7 +34,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - pairsam: type: file description: parsed pair file diff --git a/modules/pairtools/restrict/functions.nf b/modules/pairtools/restrict/functions.nf index da9da093..85628ee0 100644 --- a/modules/pairtools/restrict/functions.nf +++ b/modules/pairtools/restrict/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pairtools/restrict/main.nf b/modules/pairtools/restrict/main.nf index b9d7c7c7..31f463ad 100644 --- a/modules/pairtools/restrict/main.nf +++ b/modules/pairtools/restrict/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process PAIRTOOLS_RESTRICT { output: tuple val(meta), path("*.pairs.gz"), emit: restrict - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process PAIRTOOLS_RESTRICT { -o ${prefix}.pairs.gz \\ $pairs - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(pairtools --version 2>&1 | sed 's/pairtools.*version //') + END_VERSIONS """ } diff --git a/modules/pairtools/restrict/meta.yml b/modules/pairtools/restrict/meta.yml index 28b8eabc..9dfb8f76 100644 --- a/modules/pairtools/restrict/meta.yml +++ b/modules/pairtools/restrict/meta.yml @@ -36,7 +36,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - restrict: type: file description: Filtered pairs file diff --git a/modules/pairtools/select/functions.nf b/modules/pairtools/select/functions.nf index da9da093..85628ee0 100644 --- a/modules/pairtools/select/functions.nf +++ b/modules/pairtools/select/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pairtools/select/main.nf b/modules/pairtools/select/main.nf index 680ad555..c9218ea9 100644 --- a/modules/pairtools/select/main.nf +++ b/modules/pairtools/select/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process PAIRTOOLS_SELECT { output: tuple val(meta), path("*.selected.pairs.gz") , emit: selected tuple val(meta), path("*.unselected.pairs.gz"), emit: unselected - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process PAIRTOOLS_SELECT { --output-rest ${prefix}.unselected.pairs.gz \\ ${input} - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(pairtools --version 2>&1 | sed 's/pairtools.*version //') + END_VERSIONS """ } diff --git a/modules/pairtools/select/meta.yml b/modules/pairtools/select/meta.yml index cf256de2..18e97e99 100644 --- a/modules/pairtools/select/meta.yml +++ b/modules/pairtools/select/meta.yml @@ -30,7 +30,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - selected: type: file description: Selected pairs file diff --git a/modules/pairtools/sort/functions.nf b/modules/pairtools/sort/functions.nf index da9da093..85628ee0 100644 --- a/modules/pairtools/sort/functions.nf +++ b/modules/pairtools/sort/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pairtools/sort/main.nf b/modules/pairtools/sort/main.nf index d169d354..27caed7b 100644 --- a/modules/pairtools/sort/main.nf +++ b/modules/pairtools/sort/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process PAIRTOOLS_SORT { output: tuple val(meta), path("*.pairs.gz"), emit: sorted - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -38,6 +38,9 @@ process PAIRTOOLS_SORT { -o ${prefix}.pairs.gz \\ $input - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(pairtools --version 2>&1 | sed 's/pairtools.*version //') + END_VERSIONS """ } diff --git a/modules/pairtools/sort/meta.yml b/modules/pairtools/sort/meta.yml index 565961bc..6f36323c 100644 --- a/modules/pairtools/sort/meta.yml +++ b/modules/pairtools/sort/meta.yml @@ -30,7 +30,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - sorted: type: file description: Sorted pairs file diff --git a/modules/pangolin/functions.nf b/modules/pangolin/functions.nf index da9da093..85628ee0 100644 --- a/modules/pangolin/functions.nf +++ b/modules/pangolin/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pangolin/main.nf b/modules/pangolin/main.nf index 5639dd00..5292d1c3 100644 --- a/modules/pangolin/main.nf +++ b/modules/pangolin/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process PANGOLIN { output: tuple val(meta), path('*.csv'), emit: report - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process PANGOLIN { --threads $task.cpus \\ $options.args - echo \$(pangolin --version) | sed "s/pangolin //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(pangolin --version | sed "s/pangolin //g") + END_VERSIONS """ } diff --git a/modules/pangolin/meta.yml b/modules/pangolin/meta.yml index 2b2eb952..b1b583e9 100644 --- a/modules/pangolin/meta.yml +++ b/modules/pangolin/meta.yml @@ -27,7 +27,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@kevinmenden" - "@drpatelh" diff --git a/modules/pbccs/functions.nf b/modules/pbccs/functions.nf index da9da093..85628ee0 100644 --- a/modules/pbccs/functions.nf +++ b/modules/pbccs/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pbccs/main.nf b/modules/pbccs/main.nf index 95f9908c..ccf17cc4 100644 --- a/modules/pbccs/main.nf +++ b/modules/pbccs/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -29,7 +29,7 @@ process PBCCS { tuple val(meta), path("*.ccs_report.txt" ) , emit: ccs_report_txt tuple val(meta), path("*.ccs_report.json" ) , emit: ccs_report_json tuple val(meta), path("*.zmw_metrics.json.gz"), emit: zmw_metrics - tuple val(meta), path("*.version.txt" ) , emit: version + tuple val(meta), path("versions.yml" ) , emit: version script: def software = getSoftwareName(task.process) @@ -49,6 +49,9 @@ process PBCCS { -j $task.cpus \\ $options.args - echo \$(ccs --version 2>&1) | grep -e 'commit' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(ccs --version 2>&1 | grep -e 'commit') + END_VERSIONS """ } diff --git a/modules/pbccs/meta.yml b/modules/pbccs/meta.yml index 8ed27abc..eb89d628 100644 --- a/modules/pbccs/meta.yml +++ b/modules/pbccs/meta.yml @@ -41,7 +41,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - css: type: file description: Consensus sequences diff --git a/modules/phantompeakqualtools/functions.nf b/modules/phantompeakqualtools/functions.nf index da9da093..85628ee0 100644 --- a/modules/phantompeakqualtools/functions.nf +++ b/modules/phantompeakqualtools/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/phantompeakqualtools/main.nf b/modules/phantompeakqualtools/main.nf index 7656420f..166ed8be 100644 --- a/modules/phantompeakqualtools/main.nf +++ b/modules/phantompeakqualtools/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process PHANTOMPEAKQUALTOOLS { tuple val(meta), path("*.out") , emit: spp tuple val(meta), path("*.pdf") , emit: pdf tuple val(meta), path("*.Rdata"), emit: rdata - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process PHANTOMPEAKQUALTOOLS { """ RUN_SPP=`which run_spp.R` Rscript -e "library(caTools); source(\\"\$RUN_SPP\\")" -c="$bam" -savp="${prefix}.spp.pdf" -savd="${prefix}.spp.Rdata" -out="${prefix}.spp.out" -p=$task.cpus - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/picard/collectmultiplemetrics/functions.nf b/modules/picard/collectmultiplemetrics/functions.nf index da9da093..85628ee0 100644 --- a/modules/picard/collectmultiplemetrics/functions.nf +++ b/modules/picard/collectmultiplemetrics/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/picard/collectmultiplemetrics/main.nf b/modules/picard/collectmultiplemetrics/main.nf index 81547e84..11ddee9b 100644 --- a/modules/picard/collectmultiplemetrics/main.nf +++ b/modules/picard/collectmultiplemetrics/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process PICARD_COLLECTMULTIPLEMETRICS { output: tuple val(meta), path("*_metrics"), emit: metrics tuple val(meta), path("*.pdf") , emit: pdf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -45,6 +45,9 @@ process PICARD_COLLECTMULTIPLEMETRICS { OUTPUT=${prefix}.CollectMultipleMetrics \\ REFERENCE_SEQUENCE=$fasta - echo \$(picard CollectMultipleMetrics --version 2>&1) | grep -o 'Version.*' | cut -f2- -d: > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(picard CollectMultipleMetrics --version 2>&1 | grep -o 'Version.*' | cut -f2- -d:) + END_VERSIONS """ } diff --git a/modules/picard/collectmultiplemetrics/meta.yml b/modules/picard/collectmultiplemetrics/meta.yml index 34006093..a588fd98 100644 --- a/modules/picard/collectmultiplemetrics/meta.yml +++ b/modules/picard/collectmultiplemetrics/meta.yml @@ -44,6 +44,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/picard/collectwgsmetrics/functions.nf b/modules/picard/collectwgsmetrics/functions.nf index da9da093..85628ee0 100644 --- a/modules/picard/collectwgsmetrics/functions.nf +++ b/modules/picard/collectwgsmetrics/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/picard/collectwgsmetrics/main.nf b/modules/picard/collectwgsmetrics/main.nf index 2f01354c..b5d11839 100644 --- a/modules/picard/collectwgsmetrics/main.nf +++ b/modules/picard/collectwgsmetrics/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process PICARD_COLLECTWGSMETRICS { output: tuple val(meta), path("*_metrics"), emit: metrics - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -44,6 +44,9 @@ process PICARD_COLLECTWGSMETRICS { OUTPUT=${prefix}.CollectWgsMetrics.coverage_metrics \\ REFERENCE_SEQUENCE=$fasta - echo \$(picard CollectWgsMetrics --version 2>&1) | grep -o 'Version.*' | cut -f2- -d: > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(picard CollectWgsMetrics --version 2>&1 | grep -o 'Version.*' | cut -f2- -d:) + END_VERSIONS """ } diff --git a/modules/picard/collectwgsmetrics/meta.yml b/modules/picard/collectwgsmetrics/meta.yml index d8a2d9fb..ec828af5 100644 --- a/modules/picard/collectwgsmetrics/meta.yml +++ b/modules/picard/collectwgsmetrics/meta.yml @@ -39,7 +39,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@flowuenne" diff --git a/modules/picard/filtersamreads/functions.nf b/modules/picard/filtersamreads/functions.nf index da9da093..85628ee0 100644 --- a/modules/picard/filtersamreads/functions.nf +++ b/modules/picard/filtersamreads/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/picard/filtersamreads/main.nf b/modules/picard/filtersamreads/main.nf index 22b8c5a8..c7e40d27 100644 --- a/modules/picard/filtersamreads/main.nf +++ b/modules/picard/filtersamreads/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process PICARD_FILTERSAMREADS { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -45,7 +45,10 @@ process PICARD_FILTERSAMREADS { --FILTER $filter \\ $options.args - echo \$(picard FilterSamReads --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d: > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(picard FilterSamReads --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:) + END_VERSIONS """ } else if ( filter == 'includeReadList' || filter == 'excludeReadList' ) { """ @@ -58,7 +61,10 @@ process PICARD_FILTERSAMREADS { --READ_LIST_FILE $readlist \\ $options.args - echo \$(picard FilterSamReads --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d: > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(picard FilterSamReads --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:) + END_VERSIONS """ } } diff --git a/modules/picard/filtersamreads/meta.yml b/modules/picard/filtersamreads/meta.yml index b5beba90..82f78065 100644 --- a/modules/picard/filtersamreads/meta.yml +++ b/modules/picard/filtersamreads/meta.yml @@ -45,7 +45,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@jfy133" diff --git a/modules/picard/markduplicates/functions.nf b/modules/picard/markduplicates/functions.nf index da9da093..85628ee0 100644 --- a/modules/picard/markduplicates/functions.nf +++ b/modules/picard/markduplicates/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/picard/markduplicates/main.nf b/modules/picard/markduplicates/main.nf index ac829515..62cd10c2 100644 --- a/modules/picard/markduplicates/main.nf +++ b/modules/picard/markduplicates/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process PICARD_MARKDUPLICATES { tuple val(meta), path("*.bam") , emit: bam tuple val(meta), path("*.bai") , optional:true, emit: bai tuple val(meta), path("*.metrics.txt"), emit: metrics - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -45,6 +45,9 @@ process PICARD_MARKDUPLICATES { -O ${prefix}.bam \\ -M ${prefix}.MarkDuplicates.metrics.txt - echo \$(picard MarkDuplicates --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d: > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(picard MarkDuplicates --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:) + END_VERSIONS """ } diff --git a/modules/picard/markduplicates/meta.yml b/modules/picard/markduplicates/meta.yml index b651b3a0..db72b5c5 100644 --- a/modules/picard/markduplicates/meta.yml +++ b/modules/picard/markduplicates/meta.yml @@ -45,7 +45,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@projectoriented" diff --git a/modules/picard/mergesamfiles/functions.nf b/modules/picard/mergesamfiles/functions.nf index da9da093..85628ee0 100644 --- a/modules/picard/mergesamfiles/functions.nf +++ b/modules/picard/mergesamfiles/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/picard/mergesamfiles/main.nf b/modules/picard/mergesamfiles/main.nf index 9fd28af6..e9cba284 100644 --- a/modules/picard/mergesamfiles/main.nf +++ b/modules/picard/mergesamfiles/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process PICARD_MERGESAMFILES { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -43,12 +43,18 @@ process PICARD_MERGESAMFILES { $options.args \\ ${'INPUT='+bam_files.join(' INPUT=')} \\ OUTPUT=${prefix}.bam - echo \$(picard MergeSamFiles --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d: > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(picard MergeSamFiles --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:) + END_VERSIONS """ } else { """ ln -s ${bam_files[0]} ${prefix}.bam - echo \$(picard MergeSamFiles --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d: > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(picard MergeSamFiles --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:) + END_VERSIONS """ } } diff --git a/modules/picard/mergesamfiles/meta.yml b/modules/picard/mergesamfiles/meta.yml index 4ea9fd17..82ba2a43 100644 --- a/modules/picard/mergesamfiles/meta.yml +++ b/modules/picard/mergesamfiles/meta.yml @@ -35,6 +35,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/picard/sortsam/functions.nf b/modules/picard/sortsam/functions.nf index da9da093..85628ee0 100644 --- a/modules/picard/sortsam/functions.nf +++ b/modules/picard/sortsam/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/picard/sortsam/main.nf b/modules/picard/sortsam/main.nf index bb815c8f..475a30f9 100644 --- a/modules/picard/sortsam/main.nf +++ b/modules/picard/sortsam/main.nf @@ -1,6 +1,6 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process PICARD_SORTSAM { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -44,6 +44,9 @@ process PICARD_SORTSAM { --OUTPUT ${prefix}.bam \\ --SORT_ORDER $sort_order - echo \$(picard SortSam --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d: > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(picard SortSam --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:) + END_VERSIONS """ } diff --git a/modules/picard/sortsam/meta.yml b/modules/picard/sortsam/meta.yml index 42de6eab..37d12b91 100644 --- a/modules/picard/sortsam/meta.yml +++ b/modules/picard/sortsam/meta.yml @@ -36,7 +36,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: Sorted BAM/CRAM/SAM file diff --git a/modules/plasmidid/functions.nf b/modules/plasmidid/functions.nf index da9da093..85628ee0 100644 --- a/modules/plasmidid/functions.nf +++ b/modules/plasmidid/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/plasmidid/main.nf b/modules/plasmidid/main.nf index 986b6451..8be58c57 100644 --- a/modules/plasmidid/main.nf +++ b/modules/plasmidid/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -31,7 +31,7 @@ process PLASMIDID { tuple val(meta), path("${prefix}/database/") , emit: database tuple val(meta), path("${prefix}/fasta_files/") , emit: fasta_files tuple val(meta), path("${prefix}/kmer/") , emit: kmer - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -45,6 +45,9 @@ process PLASMIDID { -o . mv NO_GROUP/$prefix ./$prefix - echo \$(plasmidID --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(plasmidID --version 2>&1) + END_VERSIONS """ } diff --git a/modules/plasmidid/meta.yml b/modules/plasmidid/meta.yml index b7b188f8..a2689ddf 100644 --- a/modules/plasmidid/meta.yml +++ b/modules/plasmidid/meta.yml @@ -69,7 +69,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/plink/vcf/functions.nf b/modules/plink/vcf/functions.nf index da9da093..85628ee0 100644 --- a/modules/plink/vcf/functions.nf +++ b/modules/plink/vcf/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/plink/vcf/main.nf b/modules/plink/vcf/main.nf index 39cc3825..697be55e 100644 --- a/modules/plink/vcf/main.nf +++ b/modules/plink/vcf/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process PLINK_VCF { tuple val(meta), path("*.bim"), emit: bim, optional: true tuple val(meta), path("*.fam"), emit: fam, optional: true - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process PLINK_VCF { --threads $task.cpus \\ --out ${prefix} - echo \$(plink --version 2>&1) | sed 's/^PLINK //' | sed 's/..-bit.*//'> ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + plink: \$( plink --version 2>&1 | sed 's/^PLINK //' | sed 's/..-bit.*//' ) + END_VERSIONS """ } diff --git a/modules/plink/vcf/meta.yml b/modules/plink/vcf/meta.yml index 8673158b..146a0030 100644 --- a/modules/plink/vcf/meta.yml +++ b/modules/plink/vcf/meta.yml @@ -34,7 +34,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bed: type: file description: PLINK binary biallelic genotype table diff --git a/modules/preseq/lcextrap/functions.nf b/modules/preseq/lcextrap/functions.nf index da9da093..85628ee0 100644 --- a/modules/preseq/lcextrap/functions.nf +++ b/modules/preseq/lcextrap/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/preseq/lcextrap/main.nf b/modules/preseq/lcextrap/main.nf index 2f601e4f..059b81f6 100644 --- a/modules/preseq/lcextrap/main.nf +++ b/modules/preseq/lcextrap/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process PRESEQ_LCEXTRAP { output: tuple val(meta), path("*.ccurve.txt"), emit: ccurve tuple val(meta), path("*.log") , emit: log - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -40,6 +40,9 @@ process PRESEQ_LCEXTRAP { $bam cp .command.err ${prefix}.command.log - echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(preseq 2>&1 | sed 's/^.*Version: //; s/Usage:.*\$//') + END_VERSIONS """ } diff --git a/modules/preseq/lcextrap/meta.yml b/modules/preseq/lcextrap/meta.yml index d1716231..616d8243 100755 --- a/modules/preseq/lcextrap/meta.yml +++ b/modules/preseq/lcextrap/meta.yml @@ -33,7 +33,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - ccurve: type: file description: File containing output of Preseq lcextrap diff --git a/modules/prodigal/functions.nf b/modules/prodigal/functions.nf index da9da093..85628ee0 100644 --- a/modules/prodigal/functions.nf +++ b/modules/prodigal/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/prodigal/main.nf b/modules/prodigal/main.nf index 5b73d6f1..6944f86b 100644 --- a/modules/prodigal/main.nf +++ b/modules/prodigal/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process PRODIGAL { tuple val(meta), path("${prefix}.fna"), emit: nucleotide_fasta tuple val(meta), path("${prefix}.faa"), emit: amino_acid_fasta tuple val(meta), path("${prefix}_all.txt"), emit: all_gene_annotations - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -41,6 +41,9 @@ process PRODIGAL { -a "${prefix}.faa" \\ -s "${prefix}_all.txt" - echo \$(prodigal -v 2>&1) | sed -n 's/Prodigal V\\(.*\\):.*/\\1/p' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(prodigal -v 2>&1 | sed -n 's/Prodigal V\\(.*\\):.*/\\1/p') + END_VERSIONS """ } diff --git a/modules/prodigal/meta.yml b/modules/prodigal/meta.yml index f48fe96d..c24ca4a3 100644 --- a/modules/prodigal/meta.yml +++ b/modules/prodigal/meta.yml @@ -31,7 +31,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: Sorted BAM/CRAM/SAM file diff --git a/modules/prokka/functions.nf b/modules/prokka/functions.nf index da9da093..85628ee0 100644 --- a/modules/prokka/functions.nf +++ b/modules/prokka/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/prokka/main.nf b/modules/prokka/main.nf index 1fa3f3d9..c2a9d682 100644 --- a/modules/prokka/main.nf +++ b/modules/prokka/main.nf @@ -1,4 +1,4 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -35,7 +35,7 @@ process PROKKA { tuple val(meta), path("${prefix}/*.log"), emit: log tuple val(meta), path("${prefix}/*.txt"), emit: txt tuple val(meta), path("${prefix}/*.tsv"), emit: tsv - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -51,6 +51,9 @@ process PROKKA { $prodigal_tf \\ $fasta - echo \$(prokka --version 2>&1) | sed 's/^.*prokka //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(prokka --version 2>&1 | sed 's/^.*prokka //') + END_VERSIONS """ } diff --git a/modules/prokka/meta.yml b/modules/prokka/meta.yml index 4489b2fd..26fb767a 100644 --- a/modules/prokka/meta.yml +++ b/modules/prokka/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - gff: type: file description: annotation in GFF3 format, containing both sequences and annotations diff --git a/modules/pycoqc/functions.nf b/modules/pycoqc/functions.nf index da9da093..85628ee0 100644 --- a/modules/pycoqc/functions.nf +++ b/modules/pycoqc/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pycoqc/main.nf b/modules/pycoqc/main.nf index 3f010247..f3b164ee 100644 --- a/modules/pycoqc/main.nf +++ b/modules/pycoqc/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process PYCOQC { output: path "*.html" , emit: html path "*.json" , emit: json - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process PYCOQC { -o pycoqc.html \\ -j pycoqc.json - echo \$(pycoQC --version 2>&1) | sed 's/^.*pycoQC v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(pycoQC --version 2>&1 | sed 's/^.*pycoQC v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/pycoqc/meta.yml b/modules/pycoqc/meta.yml index 059b2f15..32012e83 100644 --- a/modules/pycoqc/meta.yml +++ b/modules/pycoqc/meta.yml @@ -41,7 +41,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/pydamage/analyze/functions.nf b/modules/pydamage/analyze/functions.nf index da9da093..85628ee0 100644 --- a/modules/pydamage/analyze/functions.nf +++ b/modules/pydamage/analyze/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pydamage/analyze/main.nf b/modules/pydamage/analyze/main.nf index 5a2f331b..042e6c74 100644 --- a/modules/pydamage/analyze/main.nf +++ b/modules/pydamage/analyze/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process PYDAMAGE_ANALYZE { output: tuple val(meta), path("pydamage_results/pydamage_results.csv"), emit: csv - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process PYDAMAGE_ANALYZE { -p $task.cpus \\ $bam - echo \$(pydamage --version 2>&1) | sed -e 's/pydamage, version //g' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(pydamage --version 2>&1 | sed -e 's/pydamage, version //g') + END_VERSIONS """ } diff --git a/modules/pydamage/analyze/meta.yml b/modules/pydamage/analyze/meta.yml index 3da9f793..7369a3a3 100644 --- a/modules/pydamage/analyze/meta.yml +++ b/modules/pydamage/analyze/meta.yml @@ -45,7 +45,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - csv: type: file description: PyDamage results as csv files diff --git a/modules/pydamage/filter/functions.nf b/modules/pydamage/filter/functions.nf index da9da093..85628ee0 100644 --- a/modules/pydamage/filter/functions.nf +++ b/modules/pydamage/filter/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/pydamage/filter/main.nf b/modules/pydamage/filter/main.nf index 0010a7e0..9cb95b4a 100644 --- a/modules/pydamage/filter/main.nf +++ b/modules/pydamage/filter/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process PYDAMAGE_FILTER { output: tuple val(meta), path("pydamage_results/pydamage_filtered_results.csv"), emit: csv - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process PYDAMAGE_FILTER { $options.args \\ $csv - echo \$(pydamage --version 2>&1) | sed -e 's/pydamage, version //g' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(pydamage --version 2>&1 | sed -e 's/pydamage, version //g') + END_VERSIONS """ } diff --git a/modules/pydamage/filter/meta.yml b/modules/pydamage/filter/meta.yml index 0870636b..29d4642b 100644 --- a/modules/pydamage/filter/meta.yml +++ b/modules/pydamage/filter/meta.yml @@ -41,7 +41,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - csv: type: file description: PyDamage filtered results as csv file diff --git a/modules/qcat/functions.nf b/modules/qcat/functions.nf index da9da093..85628ee0 100644 --- a/modules/qcat/functions.nf +++ b/modules/qcat/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/qcat/main.nf b/modules/qcat/main.nf index 8fc0814a..be239816 100644 --- a/modules/qcat/main.nf +++ b/modules/qcat/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process QCAT { output: tuple val(meta), path("fastq/*.fastq.gz"), emit: reads - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -47,6 +47,9 @@ process QCAT { ## Zip fastq files gzip fastq/* - echo \$(qcat --version 2>&1) | sed 's/^.*qcat //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(qcat --version 2>&1 | sed 's/^.*qcat //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/qcat/meta.yml b/modules/qcat/meta.yml index 3280f26e..5946eaa8 100644 --- a/modules/qcat/meta.yml +++ b/modules/qcat/meta.yml @@ -33,7 +33,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@yuukiiwa" - "@drpatelh" diff --git a/modules/qualimap/bamqc/functions.nf b/modules/qualimap/bamqc/functions.nf index da9da093..85628ee0 100644 --- a/modules/qualimap/bamqc/functions.nf +++ b/modules/qualimap/bamqc/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/qualimap/bamqc/main.nf b/modules/qualimap/bamqc/main.nf index 463cde4c..17779e27 100644 --- a/modules/qualimap/bamqc/main.nf +++ b/modules/qualimap/bamqc/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process QUALIMAP_BAMQC { output: tuple val(meta), path("${prefix}"), emit: results - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -56,6 +56,9 @@ process QUALIMAP_BAMQC { -outdir $prefix \\ -nt $task.cpus - echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(qualimap 2>&1 | sed 's/^.*QualiMap v.//; s/Built.*\$//') + END_VERSIONS """ } diff --git a/modules/qualimap/bamqc/meta.yml b/modules/qualimap/bamqc/meta.yml index 3c608f31..74c3ffdf 100644 --- a/modules/qualimap/bamqc/meta.yml +++ b/modules/qualimap/bamqc/meta.yml @@ -44,6 +44,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/qualimap/rnaseq/functions.nf b/modules/qualimap/rnaseq/functions.nf index da9da093..85628ee0 100644 --- a/modules/qualimap/rnaseq/functions.nf +++ b/modules/qualimap/rnaseq/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/qualimap/rnaseq/main.nf b/modules/qualimap/rnaseq/main.nf index 96fe2cd4..d1ed1021 100644 --- a/modules/qualimap/rnaseq/main.nf +++ b/modules/qualimap/rnaseq/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process QUALIMAP_RNASEQ { output: tuple val(meta), path("${prefix}"), emit: results - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -52,6 +52,9 @@ process QUALIMAP_RNASEQ { $paired_end \\ -outdir $prefix - echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(qualimap 2>&1 | sed 's/^.*QualiMap v.//; s/Built.*\$//') + END_VERSIONS """ } diff --git a/modules/quast/functions.nf b/modules/quast/functions.nf index da9da093..85628ee0 100644 --- a/modules/quast/functions.nf +++ b/modules/quast/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/quast/main.nf b/modules/quast/main.nf index 0b94c410..97ff93e2 100644 --- a/modules/quast/main.nf +++ b/modules/quast/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process QUAST { output: path "${prefix}" , emit: results path '*.tsv' , emit: tsv - path '*.version.txt', emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -43,6 +43,9 @@ process QUAST { $options.args \\ ${consensus.join(' ')} ln -s ${prefix}/report.tsv - echo \$(quast.py --version 2>&1) | sed 's/^.*QUAST v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(quast.py --version 2>&1 | sed 's/^.*QUAST v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/quast/meta.yml b/modules/quast/meta.yml index cc79486e..742dc8f0 100644 --- a/modules/quast/meta.yml +++ b/modules/quast/meta.yml @@ -39,7 +39,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/rapidnj/functions.nf b/modules/rapidnj/functions.nf index da9da093..85628ee0 100644 --- a/modules/rapidnj/functions.nf +++ b/modules/rapidnj/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/rapidnj/main.nf b/modules/rapidnj/main.nf index 78ed7693..a46fbfe8 100644 --- a/modules/rapidnj/main.nf +++ b/modules/rapidnj/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process RAPIDNJ { output: path "*.sth" , emit: stockholm_alignment path "*.tre" , emit: phylogeny - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -39,6 +39,9 @@ process RAPIDNJ { -x rapidnj_phylogeny.tre # Doesn't appear to be a way of getting the version number - echo 2.3.2 > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo 2.3.2) + END_VERSIONS """ } diff --git a/modules/rapidnj/meta.yml b/modules/rapidnj/meta.yml index cf2c61fc..7f7da9b9 100644 --- a/modules/rapidnj/meta.yml +++ b/modules/rapidnj/meta.yml @@ -23,7 +23,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - phylogeny: type: file description: A phylogeny in Newick format diff --git a/modules/rasusa/functions.nf b/modules/rasusa/functions.nf index da9da093..85628ee0 100644 --- a/modules/rasusa/functions.nf +++ b/modules/rasusa/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/rasusa/main.nf b/modules/rasusa/main.nf index f895e1a2..88f3a208 100644 --- a/modules/rasusa/main.nf +++ b/modules/rasusa/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process RASUSA { output: tuple val(meta), path('*.fastq.gz'), emit: reads - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process RASUSA { --genome-size $genome_size \\ --input $reads \\ $output - echo \$(rasusa --version 2>&1) | sed -e "s/rasusa //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(rasusa --version 2>&1 | sed -e "s/rasusa //g") + END_VERSIONS """ } diff --git a/modules/rasusa/meta.yml b/modules/rasusa/meta.yml index 074ab2f0..61cdbe0c 100644 --- a/modules/rasusa/meta.yml +++ b/modules/rasusa/meta.yml @@ -38,7 +38,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - reads: type: file description: Reads with subsampled coverage diff --git a/modules/raxmlng/functions.nf b/modules/raxmlng/functions.nf index da9da093..85628ee0 100644 --- a/modules/raxmlng/functions.nf +++ b/modules/raxmlng/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/raxmlng/main.nf b/modules/raxmlng/main.nf index 9f8597b5..7094eaa7 100644 --- a/modules/raxmlng/main.nf +++ b/modules/raxmlng/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process RAXMLNG { output: path "*.raxml.bestTree", emit: phylogeny path "*.raxml.support" , optional:true, emit: phylogeny_bootstrapped - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process RAXMLNG { --threads $task.cpus \\ --prefix output - echo \$(raxml-ng --version 2>&1) | sed 's/^.*RAxML-NG v. //; s/released.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(raxml-ng --version 2>&1 | sed 's/^.*RAxML-NG v. //; s/released.*\$//') + END_VERSIONS """ } diff --git a/modules/raxmlng/meta.yml b/modules/raxmlng/meta.yml index 1df98148..d5f755c5 100644 --- a/modules/raxmlng/meta.yml +++ b/modules/raxmlng/meta.yml @@ -23,7 +23,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - phylogeny: type: file description: A phylogeny in Newick format diff --git a/modules/rsem/calculateexpression/functions.nf b/modules/rsem/calculateexpression/functions.nf index da9da093..85628ee0 100644 --- a/modules/rsem/calculateexpression/functions.nf +++ b/modules/rsem/calculateexpression/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/rsem/calculateexpression/main.nf b/modules/rsem/calculateexpression/main.nf index 1f9ab854..33f34904 100644 --- a/modules/rsem/calculateexpression/main.nf +++ b/modules/rsem/calculateexpression/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process RSEM_CALCULATEEXPRESSION { tuple val(meta), path("*.isoforms.results"), emit: counts_transcript tuple val(meta), path("*.stat") , emit: stat tuple val(meta), path("*.log") , emit: logs - path "*.version.txt" , emit: version + path "versions.yml" , emit: version tuple val(meta), path("*.STAR.genome.bam") , optional:true, emit: bam_star tuple val(meta), path("${prefix}.genome.bam") , optional:true, emit: bam_genome @@ -56,6 +56,9 @@ process RSEM_CALCULATEEXPRESSION { \$INDEX \\ $prefix - rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g") + END_VERSIONS """ } diff --git a/modules/rsem/calculateexpression/meta.yml b/modules/rsem/calculateexpression/meta.yml index f8577085..079751d3 100644 --- a/modules/rsem/calculateexpression/meta.yml +++ b/modules/rsem/calculateexpression/meta.yml @@ -45,7 +45,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam_star: type: file description: BAM file generated by STAR (optional) diff --git a/modules/rsem/preparereference/functions.nf b/modules/rsem/preparereference/functions.nf index da9da093..85628ee0 100644 --- a/modules/rsem/preparereference/functions.nf +++ b/modules/rsem/preparereference/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/rsem/preparereference/main.nf b/modules/rsem/preparereference/main.nf index a378eb6b..560b5a63 100644 --- a/modules/rsem/preparereference/main.nf +++ b/modules/rsem/preparereference/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process RSEM_PREPAREREFERENCE { output: path "rsem" , emit: index path "rsem/*transcripts.fa", emit: transcript_fasta - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -50,7 +50,10 @@ process RSEM_PREPAREREFERENCE { $fasta \\ rsem/genome - rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g") + END_VERSIONS """ } else { """ @@ -61,7 +64,10 @@ process RSEM_PREPAREREFERENCE { $fasta \\ rsem/genome - rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g") + END_VERSIONS """ } } diff --git a/modules/rsem/preparereference/meta.yml b/modules/rsem/preparereference/meta.yml index d7c02154..5ccca28a 100644 --- a/modules/rsem/preparereference/meta.yml +++ b/modules/rsem/preparereference/meta.yml @@ -31,7 +31,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/bamstat/functions.nf b/modules/rseqc/bamstat/functions.nf index da9da093..85628ee0 100644 --- a/modules/rseqc/bamstat/functions.nf +++ b/modules/rseqc/bamstat/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/rseqc/bamstat/main.nf b/modules/rseqc/bamstat/main.nf index 913c3f53..fa71dd11 100644 --- a/modules/rseqc/bamstat/main.nf +++ b/modules/rseqc/bamstat/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process RSEQC_BAMSTAT { output: tuple val(meta), path("*.bam_stat.txt"), emit: txt - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process RSEQC_BAMSTAT { $options.args \\ > ${prefix}.bam_stat.txt - bam_stat.py --version | sed -e "s/bam_stat.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bam_stat.py --version | sed -e "s/bam_stat.py //g") + END_VERSIONS """ } diff --git a/modules/rseqc/bamstat/meta.yml b/modules/rseqc/bamstat/meta.yml index ff00d8c9..adb81c1c 100644 --- a/modules/rseqc/bamstat/meta.yml +++ b/modules/rseqc/bamstat/meta.yml @@ -30,7 +30,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/inferexperiment/functions.nf b/modules/rseqc/inferexperiment/functions.nf index da9da093..85628ee0 100644 --- a/modules/rseqc/inferexperiment/functions.nf +++ b/modules/rseqc/inferexperiment/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/rseqc/inferexperiment/main.nf b/modules/rseqc/inferexperiment/main.nf index a887e6e6..a9842c0d 100644 --- a/modules/rseqc/inferexperiment/main.nf +++ b/modules/rseqc/inferexperiment/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process RSEQC_INFEREXPERIMENT { output: tuple val(meta), path("*.infer_experiment.txt"), emit: txt - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process RSEQC_INFEREXPERIMENT { $options.args \\ > ${prefix}.infer_experiment.txt - infer_experiment.py --version | sed -e "s/infer_experiment.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(infer_experiment.py --version | sed -e "s/infer_experiment.py //g") + END_VERSIONS """ } diff --git a/modules/rseqc/inferexperiment/meta.yml b/modules/rseqc/inferexperiment/meta.yml index 366c3e33..f89f90d1 100644 --- a/modules/rseqc/inferexperiment/meta.yml +++ b/modules/rseqc/inferexperiment/meta.yml @@ -33,7 +33,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/innerdistance/functions.nf b/modules/rseqc/innerdistance/functions.nf index da9da093..85628ee0 100644 --- a/modules/rseqc/innerdistance/functions.nf +++ b/modules/rseqc/innerdistance/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/rseqc/innerdistance/main.nf b/modules/rseqc/innerdistance/main.nf index e2e8f909..d98780f1 100644 --- a/modules/rseqc/innerdistance/main.nf +++ b/modules/rseqc/innerdistance/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -28,7 +28,7 @@ process RSEQC_INNERDISTANCE { tuple val(meta), path("*mean.txt") , optional:true, emit: mean tuple val(meta), path("*.pdf") , optional:true, emit: pdf tuple val(meta), path("*.r") , optional:true, emit: rscript - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -43,11 +43,17 @@ process RSEQC_INNERDISTANCE { > stdout.txt head -n 2 stdout.txt > ${prefix}.inner_distance_mean.txt - inner_distance.py --version | sed -e "s/inner_distance.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(inner_distance.py --version | sed -e "s/inner_distance.py //g") + END_VERSIONS """ } else { """ - inner_distance.py --version | sed -e "s/inner_distance.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(inner_distance.py --version | sed -e "s/inner_distance.py //g") + END_VERSIONS """ } } diff --git a/modules/rseqc/innerdistance/meta.yml b/modules/rseqc/innerdistance/meta.yml index ed72c51c..5b2b5e79 100644 --- a/modules/rseqc/innerdistance/meta.yml +++ b/modules/rseqc/innerdistance/meta.yml @@ -49,7 +49,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/junctionannotation/functions.nf b/modules/rseqc/junctionannotation/functions.nf index da9da093..85628ee0 100644 --- a/modules/rseqc/junctionannotation/functions.nf +++ b/modules/rseqc/junctionannotation/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/rseqc/junctionannotation/main.nf b/modules/rseqc/junctionannotation/main.nf index 30bdcd11..cfb12d69 100644 --- a/modules/rseqc/junctionannotation/main.nf +++ b/modules/rseqc/junctionannotation/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -30,7 +30,7 @@ process RSEQC_JUNCTIONANNOTATION { tuple val(meta), path("*.Interact.bed"), optional:true, emit: interact_bed tuple val(meta), path("*junction.pdf") , optional:true, emit: pdf tuple val(meta), path("*events.pdf") , optional:true, emit: events_pdf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -43,6 +43,9 @@ process RSEQC_JUNCTIONANNOTATION { $options.args \\ 2> ${prefix}.junction_annotation.log - junction_annotation.py --version | sed -e "s/junction_annotation.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(junction_annotation.py --version | sed -e "s/junction_annotation.py //g") + END_VERSIONS """ } diff --git a/modules/rseqc/junctionannotation/meta.yml b/modules/rseqc/junctionannotation/meta.yml index 64926ce0..d96e7756 100644 --- a/modules/rseqc/junctionannotation/meta.yml +++ b/modules/rseqc/junctionannotation/meta.yml @@ -55,7 +55,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/junctionsaturation/functions.nf b/modules/rseqc/junctionsaturation/functions.nf index da9da093..85628ee0 100644 --- a/modules/rseqc/junctionsaturation/functions.nf +++ b/modules/rseqc/junctionsaturation/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/rseqc/junctionsaturation/main.nf b/modules/rseqc/junctionsaturation/main.nf index 837006d0..a5aa5461 100644 --- a/modules/rseqc/junctionsaturation/main.nf +++ b/modules/rseqc/junctionsaturation/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process RSEQC_JUNCTIONSATURATION { output: tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.r") , emit: rscript - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process RSEQC_JUNCTIONSATURATION { -o $prefix \\ $options.args - junction_saturation.py --version | sed -e "s/junction_saturation.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(junction_saturation.py --version | sed -e "s/junction_saturation.py //g") + END_VERSIONS """ } diff --git a/modules/rseqc/junctionsaturation/meta.yml b/modules/rseqc/junctionsaturation/meta.yml index 38008577..aaf44cdc 100644 --- a/modules/rseqc/junctionsaturation/meta.yml +++ b/modules/rseqc/junctionsaturation/meta.yml @@ -38,7 +38,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/readdistribution/functions.nf b/modules/rseqc/readdistribution/functions.nf index da9da093..85628ee0 100644 --- a/modules/rseqc/readdistribution/functions.nf +++ b/modules/rseqc/readdistribution/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/rseqc/readdistribution/main.nf b/modules/rseqc/readdistribution/main.nf index 1b09908e..56086c89 100644 --- a/modules/rseqc/readdistribution/main.nf +++ b/modules/rseqc/readdistribution/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process RSEQC_READDISTRIBUTION { output: tuple val(meta), path("*.read_distribution.txt"), emit: txt - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process RSEQC_READDISTRIBUTION { -r $bed \\ > ${prefix}.read_distribution.txt - read_distribution.py --version | sed -e "s/read_distribution.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(read_distribution.py --version | sed -e "s/read_distribution.py //g") + END_VERSIONS """ } diff --git a/modules/rseqc/readdistribution/meta.yml b/modules/rseqc/readdistribution/meta.yml index ce2b0f5a..7ffab04f 100644 --- a/modules/rseqc/readdistribution/meta.yml +++ b/modules/rseqc/readdistribution/meta.yml @@ -34,7 +34,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/readduplication/functions.nf b/modules/rseqc/readduplication/functions.nf index da9da093..85628ee0 100644 --- a/modules/rseqc/readduplication/functions.nf +++ b/modules/rseqc/readduplication/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/rseqc/readduplication/main.nf b/modules/rseqc/readduplication/main.nf index c86b05b6..ca7c2b13 100644 --- a/modules/rseqc/readduplication/main.nf +++ b/modules/rseqc/readduplication/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process RSEQC_READDUPLICATION { tuple val(meta), path("*pos.DupRate.xls"), emit: pos_xls tuple val(meta), path("*.pdf") , emit: pdf tuple val(meta), path("*.r") , emit: rscript - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process RSEQC_READDUPLICATION { -o $prefix \\ $options.args - read_duplication.py --version | sed -e "s/read_duplication.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(read_duplication.py --version | sed -e "s/read_duplication.py //g") + END_VERSIONS """ } diff --git a/modules/rseqc/readduplication/meta.yml b/modules/rseqc/readduplication/meta.yml index c43ea688..efc48c0d 100644 --- a/modules/rseqc/readduplication/meta.yml +++ b/modules/rseqc/readduplication/meta.yml @@ -45,7 +45,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/salmon/index/functions.nf b/modules/salmon/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/salmon/index/functions.nf +++ b/modules/salmon/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/salmon/index/main.nf b/modules/salmon/index/main.nf index e72ff121..df4e2ed8 100644 --- a/modules/salmon/index/main.nf +++ b/modules/salmon/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process SALMON_INDEX { output: path "salmon" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -46,6 +46,9 @@ process SALMON_INDEX { -d decoys.txt \\ $options.args \\ -i salmon - salmon --version | sed -e "s/salmon //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(salmon --version | sed -e "s/salmon //g") + END_VERSIONS """ } diff --git a/modules/salmon/index/meta.yml b/modules/salmon/index/meta.yml index 652e2a77..4d16b359 100644 --- a/modules/salmon/index/meta.yml +++ b/modules/salmon/index/meta.yml @@ -28,7 +28,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/salmon/quant/functions.nf b/modules/salmon/quant/functions.nf index da9da093..85628ee0 100644 --- a/modules/salmon/quant/functions.nf +++ b/modules/salmon/quant/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/salmon/quant/main.nf b/modules/salmon/quant/main.nf index 1b9b5803..92d85f58 100644 --- a/modules/salmon/quant/main.nf +++ b/modules/salmon/quant/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -28,7 +28,7 @@ process SALMON_QUANT { output: tuple val(meta), path("${prefix}"), emit: results - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -72,6 +72,9 @@ process SALMON_QUANT { $options.args \\ -o $prefix - salmon --version | sed -e "s/salmon //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(salmon --version | sed -e "s/salmon //g") + END_VERSIONS """ } diff --git a/modules/salmon/quant/meta.yml b/modules/salmon/quant/meta.yml index f37c9884..981df89e 100644 --- a/modules/salmon/quant/meta.yml +++ b/modules/salmon/quant/meta.yml @@ -48,7 +48,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/samtools/ampliconclip/functions.nf b/modules/samtools/ampliconclip/functions.nf index da9da093..85628ee0 100644 --- a/modules/samtools/ampliconclip/functions.nf +++ b/modules/samtools/ampliconclip/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/samtools/ampliconclip/main.nf b/modules/samtools/ampliconclip/main.nf index 6ec27ccf..4a08026e 100644 --- a/modules/samtools/ampliconclip/main.nf +++ b/modules/samtools/ampliconclip/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -28,7 +28,7 @@ process SAMTOOLS_AMPLICONCLIP { tuple val(meta), path("*.bam") , emit: bam tuple val(meta), path("*.clipstats.txt") , optional:true, emit: stats tuple val(meta), path("*.cliprejects.bam"), optional:true, emit: rejects_bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -46,6 +46,9 @@ process SAMTOOLS_AMPLICONCLIP { -o ${prefix}.bam \\ $bam - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/samtools/ampliconclip/meta.yml b/modules/samtools/ampliconclip/meta.yml index fce06986..2ecbf463 100644 --- a/modules/samtools/ampliconclip/meta.yml +++ b/modules/samtools/ampliconclip/meta.yml @@ -46,7 +46,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: Clipped reads BAM file diff --git a/modules/samtools/faidx/functions.nf b/modules/samtools/faidx/functions.nf index da9da093..85628ee0 100644 --- a/modules/samtools/faidx/functions.nf +++ b/modules/samtools/faidx/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/samtools/faidx/main.nf b/modules/samtools/faidx/main.nf index a89ff2bb..fad14602 100644 --- a/modules/samtools/faidx/main.nf +++ b/modules/samtools/faidx/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,12 +23,15 @@ process SAMTOOLS_FAIDX { output: path "*.fai" , emit: fai - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ samtools faidx $fasta - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/samtools/faidx/meta.yml b/modules/samtools/faidx/meta.yml index f92234d0..77d21861 100644 --- a/modules/samtools/faidx/meta.yml +++ b/modules/samtools/faidx/meta.yml @@ -25,7 +25,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/samtools/fastq/functions.nf b/modules/samtools/fastq/functions.nf index da9da093..85628ee0 100644 --- a/modules/samtools/fastq/functions.nf +++ b/modules/samtools/fastq/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/samtools/fastq/main.nf b/modules/samtools/fastq/main.nf index 6bedbb4e..73d32db8 100644 --- a/modules/samtools/fastq/main.nf +++ b/modules/samtools/fastq/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process SAMTOOLS_FASTQ { output: tuple val(meta), path("*.fastq.gz"), emit: fastq - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process SAMTOOLS_FASTQ { -@ $task.cpus \\ $endedness \\ $bam - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/samtools/fastq/meta.yml b/modules/samtools/fastq/meta.yml index ce269552..7c4cc488 100644 --- a/modules/samtools/fastq/meta.yml +++ b/modules/samtools/fastq/meta.yml @@ -37,6 +37,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@suzannejin" diff --git a/modules/samtools/flagstat/functions.nf b/modules/samtools/flagstat/functions.nf index da9da093..85628ee0 100644 --- a/modules/samtools/flagstat/functions.nf +++ b/modules/samtools/flagstat/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/samtools/flagstat/main.nf b/modules/samtools/flagstat/main.nf index d4852c66..70c04b23 100644 --- a/modules/samtools/flagstat/main.nf +++ b/modules/samtools/flagstat/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,12 +23,15 @@ process SAMTOOLS_FLAGSTAT { output: tuple val(meta), path("*.flagstat"), emit: flagstat - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ samtools flagstat $bam > ${bam}.flagstat - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/samtools/flagstat/meta.yml b/modules/samtools/flagstat/meta.yml index 8414bf54..d40e45b4 100644 --- a/modules/samtools/flagstat/meta.yml +++ b/modules/samtools/flagstat/meta.yml @@ -43,6 +43,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/idxstats/functions.nf b/modules/samtools/idxstats/functions.nf index da9da093..85628ee0 100644 --- a/modules/samtools/idxstats/functions.nf +++ b/modules/samtools/idxstats/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/samtools/idxstats/main.nf b/modules/samtools/idxstats/main.nf index 14a07cfb..33605f30 100644 --- a/modules/samtools/idxstats/main.nf +++ b/modules/samtools/idxstats/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,12 +23,15 @@ process SAMTOOLS_IDXSTATS { output: tuple val(meta), path("*.idxstats"), emit: idxstats - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ samtools idxstats $bam > ${bam}.idxstats - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/samtools/idxstats/meta.yml b/modules/samtools/idxstats/meta.yml index 530d0772..93e8f694 100644 --- a/modules/samtools/idxstats/meta.yml +++ b/modules/samtools/idxstats/meta.yml @@ -44,6 +44,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/index/functions.nf b/modules/samtools/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/samtools/index/functions.nf +++ b/modules/samtools/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/samtools/index/main.nf b/modules/samtools/index/main.nf index e1966fb3..83802d95 100644 --- a/modules/samtools/index/main.nf +++ b/modules/samtools/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,12 +24,15 @@ process SAMTOOLS_INDEX { output: tuple val(meta), path("*.bai"), optional:true, emit: bai tuple val(meta), path("*.csi"), optional:true, emit: csi - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ samtools index $options.args $bam - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/samtools/index/meta.yml b/modules/samtools/index/meta.yml index 5d076e3b..6f7dc887 100644 --- a/modules/samtools/index/meta.yml +++ b/modules/samtools/index/meta.yml @@ -41,7 +41,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/samtools/merge/functions.nf b/modules/samtools/merge/functions.nf index da9da093..85628ee0 100644 --- a/modules/samtools/merge/functions.nf +++ b/modules/samtools/merge/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/samtools/merge/main.nf b/modules/samtools/merge/main.nf index 0182b9fd..85a41926 100644 --- a/modules/samtools/merge/main.nf +++ b/modules/samtools/merge/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process SAMTOOLS_MERGE { output: tuple val(meta), path("${prefix}.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ samtools merge ${prefix}.bam $bams - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/samtools/merge/meta.yml b/modules/samtools/merge/meta.yml index 9092f22e..c5f15a14 100644 --- a/modules/samtools/merge/meta.yml +++ b/modules/samtools/merge/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@yuukiiwa " diff --git a/modules/samtools/mpileup/functions.nf b/modules/samtools/mpileup/functions.nf index da9da093..85628ee0 100644 --- a/modules/samtools/mpileup/functions.nf +++ b/modules/samtools/mpileup/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/samtools/mpileup/main.nf b/modules/samtools/mpileup/main.nf index f736e9c7..28185934 100644 --- a/modules/samtools/mpileup/main.nf +++ b/modules/samtools/mpileup/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process SAMTOOLS_MPILEUP { output: tuple val(meta), path("*.mpileup"), emit: mpileup - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process SAMTOOLS_MPILEUP { --output ${prefix}.mpileup \\ $options.args \\ $bam - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/samtools/mpileup/meta.yml b/modules/samtools/mpileup/meta.yml index 7e432a78..aa0ccc6d 100644 --- a/modules/samtools/mpileup/meta.yml +++ b/modules/samtools/mpileup/meta.yml @@ -41,7 +41,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@joseespinosa" diff --git a/modules/samtools/sort/functions.nf b/modules/samtools/sort/functions.nf index da9da093..85628ee0 100644 --- a/modules/samtools/sort/functions.nf +++ b/modules/samtools/sort/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/samtools/sort/main.nf b/modules/samtools/sort/main.nf index 0a6b7048..4c3c4c1f 100644 --- a/modules/samtools/sort/main.nf +++ b/modules/samtools/sort/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process SAMTOOLS_SORT { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ samtools sort $options.args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/samtools/sort/meta.yml b/modules/samtools/sort/meta.yml index 704e8c1f..d4f70a8e 100644 --- a/modules/samtools/sort/meta.yml +++ b/modules/samtools/sort/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/samtools/stats/functions.nf b/modules/samtools/stats/functions.nf index da9da093..85628ee0 100644 --- a/modules/samtools/stats/functions.nf +++ b/modules/samtools/stats/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/samtools/stats/main.nf b/modules/samtools/stats/main.nf index 8c72d725..b1fd325f 100644 --- a/modules/samtools/stats/main.nf +++ b/modules/samtools/stats/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,12 +23,15 @@ process SAMTOOLS_STATS { output: tuple val(meta), path("*.stats"), emit: stats - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ samtools stats $bam > ${bam}.stats - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/samtools/stats/meta.yml b/modules/samtools/stats/meta.yml index b549ff5c..1c7dcc8b 100644 --- a/modules/samtools/stats/meta.yml +++ b/modules/samtools/stats/meta.yml @@ -42,6 +42,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/view/functions.nf b/modules/samtools/view/functions.nf index da9da093..85628ee0 100644 --- a/modules/samtools/view/functions.nf +++ b/modules/samtools/view/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/samtools/view/main.nf b/modules/samtools/view/main.nf index 2ca57032..824b9bab 100644 --- a/modules/samtools/view/main.nf +++ b/modules/samtools/view/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process SAMTOOLS_VIEW { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ samtools view $options.args $bam > ${prefix}.bam - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/samtools/view/meta.yml b/modules/samtools/view/meta.yml index c35a8b03..6388f9bc 100644 --- a/modules/samtools/view/meta.yml +++ b/modules/samtools/view/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@joseespinosa" diff --git a/modules/seacr/callpeak/functions.nf b/modules/seacr/callpeak/functions.nf index da9da093..85628ee0 100644 --- a/modules/seacr/callpeak/functions.nf +++ b/modules/seacr/callpeak/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/seacr/callpeak/main.nf b/modules/seacr/callpeak/main.nf index 429c45cf..cc567dfb 100644 --- a/modules/seacr/callpeak/main.nf +++ b/modules/seacr/callpeak/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process SEACR_CALLPEAK { output: tuple val(meta), path("*.bed"), emit: bed - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process SEACR_CALLPEAK { $options.args \\ $prefix - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/seacr/callpeak/meta.yml b/modules/seacr/callpeak/meta.yml index 579961e2..80da69e4 100644 --- a/modules/seacr/callpeak/meta.yml +++ b/modules/seacr/callpeak/meta.yml @@ -43,6 +43,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@chris-cheshire" diff --git a/modules/seqkit/split2/functions.nf b/modules/seqkit/split2/functions.nf index da9da093..85628ee0 100644 --- a/modules/seqkit/split2/functions.nf +++ b/modules/seqkit/split2/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/seqkit/split2/main.nf b/modules/seqkit/split2/main.nf index 5eeb0ad0..44e0046f 100644 --- a/modules/seqkit/split2/main.nf +++ b/modules/seqkit/split2/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process SEQKIT_SPLIT2 { output: tuple val(meta), path("*.split/*.gz"), emit: reads - path("*.version.txt") , emit: version + path("versions.yml") , emit: version script: @@ -41,7 +41,10 @@ process SEQKIT_SPLIT2 { -1 ${reads} \ --out-dir ${prefix}.split - echo \$(seqkit --version 2>&1) | sed 's/^.*seqkit //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(seqkit --version 2>&1 | sed 's/^.*seqkit //; s/Using.*\$//') + END_VERSIONS """ } else { """ @@ -53,7 +56,10 @@ process SEQKIT_SPLIT2 { -2 ${reads[1]} \ --out-dir ${prefix}.split - echo \$(seqkit --version 2>&1) | sed 's/^.*seqkit //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(seqkit --version 2>&1 | sed 's/^.*seqkit //; s/Using.*\$//') + END_VERSIONS """ } } diff --git a/modules/seqkit/split2/meta.yml b/modules/seqkit/split2/meta.yml index 44ae4ea7..5dfee7f9 100644 --- a/modules/seqkit/split2/meta.yml +++ b/modules/seqkit/split2/meta.yml @@ -33,6 +33,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@FriederikeHanssen" diff --git a/modules/seqtk/sample/functions.nf b/modules/seqtk/sample/functions.nf index da9da093..85628ee0 100644 --- a/modules/seqtk/sample/functions.nf +++ b/modules/seqtk/sample/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/seqtk/sample/main.nf b/modules/seqtk/sample/main.nf index b50a5a2a..d62d8cac 100644 --- a/modules/seqtk/sample/main.nf +++ b/modules/seqtk/sample/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process SEQTK_SAMPLE { output: tuple val(meta), path("*.fastq.gz"), emit: reads - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -38,7 +38,10 @@ process SEQTK_SAMPLE { $sample_size \\ | gzip --no-name > ${prefix}.fastq.gz \\ - echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(seqtk 2>&1 | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS """ } else { if (!(options.args ==~ /.*-s[0-9]+.*/)) { @@ -59,7 +62,10 @@ process SEQTK_SAMPLE { $sample_size \\ | gzip --no-name > ${prefix}_2.fastq.gz \\ - echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(seqtk 2>&1 | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS """ } } diff --git a/modules/seqtk/sample/meta.yml b/modules/seqtk/sample/meta.yml index f9122936..b9422433 100644 --- a/modules/seqtk/sample/meta.yml +++ b/modules/seqtk/sample/meta.yml @@ -33,7 +33,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - reads: type: file description: Subsampled FastQ files, 1 for single-end data or 2 for paired-end data. diff --git a/modules/seqtk/subseq/functions.nf b/modules/seqtk/subseq/functions.nf index da9da093..85628ee0 100644 --- a/modules/seqtk/subseq/functions.nf +++ b/modules/seqtk/subseq/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/seqtk/subseq/main.nf b/modules/seqtk/subseq/main.nf index 810a8a48..2907d282 100644 --- a/modules/seqtk/subseq/main.nf +++ b/modules/seqtk/subseq/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process SEQTK_SUBSEQ { output: path "*.gz" , emit: sequences - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -41,6 +41,9 @@ process SEQTK_SUBSEQ { $filter_list | \\ gzip --no-name > ${sequences}${prefix}.${ext}.gz - echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(seqtk 2>&1 | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/seqtk/subseq/meta.yml b/modules/seqtk/subseq/meta.yml index 0676229d..f7c6c624 100644 --- a/modules/seqtk/subseq/meta.yml +++ b/modules/seqtk/subseq/meta.yml @@ -24,7 +24,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - sequences: type: file description: FASTQ/FASTA file diff --git a/modules/sequenzautils/bam2seqz/functions.nf b/modules/sequenzautils/bam2seqz/functions.nf index da9da093..85628ee0 100755 --- a/modules/sequenzautils/bam2seqz/functions.nf +++ b/modules/sequenzautils/bam2seqz/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/sequenzautils/bam2seqz/main.nf b/modules/sequenzautils/bam2seqz/main.nf index aec19725..ad4f6847 100644 --- a/modules/sequenzautils/bam2seqz/main.nf +++ b/modules/sequenzautils/bam2seqz/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process SEQUENZAUTILS_BAM2SEQZ { output: tuple val(meta), path("*.seqz.gz"), emit: seqz - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -40,6 +40,9 @@ process SEQUENZAUTILS_BAM2SEQZ { -gc $wigfile \\ -o ${prefix}.seqz.gz - echo \$(sequenzautils --version 2>&1) | sed 's/^.*sequenzautils //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(sequenzautils --version 2>&1 | sed 's/^.*sequenzautils //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/sequenzautils/bam2seqz/meta.yml b/modules/sequenzautils/bam2seqz/meta.yml index 171e155c..2ce4ab7f 100755 --- a/modules/sequenzautils/bam2seqz/meta.yml +++ b/modules/sequenzautils/bam2seqz/meta.yml @@ -40,7 +40,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - seqz: type: file description: Seqz file diff --git a/modules/sequenzautils/gcwiggle/functions.nf b/modules/sequenzautils/gcwiggle/functions.nf index da9da093..85628ee0 100755 --- a/modules/sequenzautils/gcwiggle/functions.nf +++ b/modules/sequenzautils/gcwiggle/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/sequenzautils/gcwiggle/main.nf b/modules/sequenzautils/gcwiggle/main.nf index fd200b6b..a0575d7e 100644 --- a/modules/sequenzautils/gcwiggle/main.nf +++ b/modules/sequenzautils/gcwiggle/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process SEQUENZAUTILS_GCWIGGLE { output: tuple val(meta), path("*.wig.gz"), emit: wig - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -35,6 +35,9 @@ process SEQUENZAUTILS_GCWIGGLE { --fasta $fasta \\ -o ${prefix}.wig.gz - echo \$(sequenzautils --version 2>&1) | sed 's/^.*sequenzautils //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(sequenzautils --version 2>&1 | sed 's/^.*sequenzautils //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/sequenzautils/gcwiggle/meta.yml b/modules/sequenzautils/gcwiggle/meta.yml index e1cb7b03..35daa498 100644 --- a/modules/sequenzautils/gcwiggle/meta.yml +++ b/modules/sequenzautils/gcwiggle/meta.yml @@ -28,7 +28,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - wig: type: file description: GC Wiggle track file diff --git a/modules/seqwish/induce/functions.nf b/modules/seqwish/induce/functions.nf index da9da093..85628ee0 100644 --- a/modules/seqwish/induce/functions.nf +++ b/modules/seqwish/induce/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/seqwish/induce/main.nf b/modules/seqwish/induce/main.nf index ebf714ff..e9b2836b 100644 --- a/modules/seqwish/induce/main.nf +++ b/modules/seqwish/induce/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process SEQWISH_INDUCE { output: tuple val(meta), path("*.gfa"), emit: gfa - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: @@ -39,6 +39,9 @@ process SEQWISH_INDUCE { --gfa=${prefix}.gfa \\ $options.args - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/seqwish/induce/meta.yml b/modules/seqwish/induce/meta.yml index f357f0df..c2836824 100644 --- a/modules/seqwish/induce/meta.yml +++ b/modules/seqwish/induce/meta.yml @@ -41,6 +41,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/shovill/functions.nf b/modules/shovill/functions.nf index da9da093..85628ee0 100644 --- a/modules/shovill/functions.nf +++ b/modules/shovill/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/shovill/main.nf b/modules/shovill/main.nf index e751b2a8..8319e75f 100644 --- a/modules/shovill/main.nf +++ b/modules/shovill/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process SHOVILL { tuple val(meta), path("shovill.log") , emit: log tuple val(meta), path("{skesa,spades,megahit,velvet}.fasta"), emit: raw_contigs tuple val(meta), path("contigs.{fastg,gfa,LastGraph}") , optional:true, emit: gfa - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process SHOVILL { --outdir ./ \\ --force - echo \$(shovill --version 2>&1) | sed 's/^.*shovill //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(shovill --version 2>&1 | sed 's/^.*shovill //' ) + END_VERSIONS """ } diff --git a/modules/shovill/meta.yml b/modules/shovill/meta.yml index b8f24e34..b878f93d 100644 --- a/modules/shovill/meta.yml +++ b/modules/shovill/meta.yml @@ -31,7 +31,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - contigs: type: file description: The final assembly produced by Shovill diff --git a/modules/snpdists/functions.nf b/modules/snpdists/functions.nf index da9da093..85628ee0 100644 --- a/modules/snpdists/functions.nf +++ b/modules/snpdists/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/snpdists/main.nf b/modules/snpdists/main.nf index c103bb33..ede94906 100644 --- a/modules/snpdists/main.nf +++ b/modules/snpdists/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process SNPDISTS { output: tuple val(meta), path("*.tsv"), emit: tsv - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process SNPDISTS { $options.args \\ $alignment > ${prefix}.tsv - echo \$(snp-dists -v 2>&1) | sed 's/snp-dists //;' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(snp-dists -v 2>&1 | sed 's/snp-dists //;') + END_VERSIONS """ } diff --git a/modules/snpdists/meta.yml b/modules/snpdists/meta.yml index 590d034a..e86e3092 100644 --- a/modules/snpdists/meta.yml +++ b/modules/snpdists/meta.yml @@ -36,6 +36,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/snpeff/functions.nf b/modules/snpeff/functions.nf index da9da093..85628ee0 100644 --- a/modules/snpeff/functions.nf +++ b/modules/snpeff/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/snpeff/main.nf b/modules/snpeff/main.nf index af0fd816..aa25a092 100644 --- a/modules/snpeff/main.nf +++ b/modules/snpeff/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -31,7 +31,7 @@ process SNPEFF { output: tuple val(meta), path("*.ann.vcf"), emit: vcf path "*.csv" , emit: report - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -52,6 +52,9 @@ process SNPEFF { $vcf \\ > ${prefix}.ann.vcf - echo \$(snpEff -version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(snpEff -version 2>&1) + END_VERSIONS """ } diff --git a/modules/snpeff/meta.yml b/modules/snpeff/meta.yml index 7ba62cde..aa21e2bc 100644 --- a/modules/snpeff/meta.yml +++ b/modules/snpeff/meta.yml @@ -52,6 +52,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/snpsites/functions.nf b/modules/snpsites/functions.nf index da9da093..85628ee0 100644 --- a/modules/snpsites/functions.nf +++ b/modules/snpsites/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/snpsites/main.nf b/modules/snpsites/main.nf index 5104572e..5cc85773 100644 --- a/modules/snpsites/main.nf +++ b/modules/snpsites/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process SNPSITES { output: path "*.fas" , emit: fasta path "*.sites.txt" , emit: constant_sites - path "*.version.txt", emit: version + path "versions.yml" , emit: version env CONSTANT_SITES, emit: constant_sites_string script: @@ -38,6 +38,9 @@ process SNPSITES { CONSTANT_SITES=\$(cat constant.sites.txt) - echo \$(snp-sites -V 2>&1) | sed 's/snp-sites //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(snp-sites -V 2>&1 | sed 's/snp-sites //') + END_VERSIONS """ } diff --git a/modules/snpsites/meta.yml b/modules/snpsites/meta.yml index 0a22b879..ae250e5f 100644 --- a/modules/snpsites/meta.yml +++ b/modules/snpsites/meta.yml @@ -18,7 +18,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - fasta: type: file description: Variant fasta file diff --git a/modules/sortmerna/functions.nf b/modules/sortmerna/functions.nf index da9da093..85628ee0 100644 --- a/modules/sortmerna/functions.nf +++ b/modules/sortmerna/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/sortmerna/main.nf b/modules/sortmerna/main.nf index 32ca4ca9..01975979 100644 --- a/modules/sortmerna/main.nf +++ b/modules/sortmerna/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process SORTMERNA { output: tuple val(meta), path("*.fastq.gz"), emit: reads tuple val(meta), path("*.log") , emit: log - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -47,7 +47,10 @@ process SORTMERNA { gzip -f < non_rRNA_reads.fq > ${prefix}.fastq.gz mv rRNA_reads.log ${prefix}.sortmerna.log - echo \$(sortmerna --version 2>&1) | sed 's/^.*SortMeRNA version //; s/ Build Date.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(sortmerna --version 2>&1 | sed 's/^.*SortMeRNA version //; s/ Build Date.*\$//') + END_VERSIONS """ } else { """ @@ -67,7 +70,10 @@ process SORTMERNA { gzip -f < non_rRNA_reads_rev.fq > ${prefix}_2.fastq.gz mv rRNA_reads.log ${prefix}.sortmerna.log - echo \$(sortmerna --version 2>&1) | sed 's/^.*SortMeRNA version //; s/ Build Date.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(sortmerna --version 2>&1 | sed 's/^.*SortMeRNA version //; s/ Build Date.*\$//') + END_VERSIONS """ } } diff --git a/modules/spades/functions.nf b/modules/spades/functions.nf index da9da093..85628ee0 100644 --- a/modules/spades/functions.nf +++ b/modules/spades/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/spades/main.nf b/modules/spades/main.nf index e78500f2..a260de54 100644 --- a/modules/spades/main.nf +++ b/modules/spades/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -29,7 +29,7 @@ process SPADES { tuple val(meta), path('*.gene_clusters.fa'), optional:true, emit: gene_clusters tuple val(meta), path('*.assembly.gfa') , optional:true, emit: gfa tuple val(meta), path('*.log') , emit: log - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -62,6 +62,9 @@ process SPADES { mv gene_clusters.fasta ${prefix}.gene_clusters.fa fi - echo \$(spades.py --version 2>&1) | sed 's/^.*SPAdes genome assembler v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(spades.py --version 2>&1 | sed 's/^.*SPAdes genome assembler v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/spades/meta.yml b/modules/spades/meta.yml index 5a05e5f3..38c5c2ae 100644 --- a/modules/spades/meta.yml +++ b/modules/spades/meta.yml @@ -62,7 +62,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@JoseEspinosa" diff --git a/modules/staphopiasccmec/functions.nf b/modules/staphopiasccmec/functions.nf index da9da093..85628ee0 100644 --- a/modules/staphopiasccmec/functions.nf +++ b/modules/staphopiasccmec/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/staphopiasccmec/main.nf b/modules/staphopiasccmec/main.nf index 85a61514..0e57128b 100644 --- a/modules/staphopiasccmec/main.nf +++ b/modules/staphopiasccmec/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process STAPHOPIASCCMEC { output: tuple val(meta), path("*.tsv"), emit: tsv - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -31,6 +31,9 @@ process STAPHOPIASCCMEC { """ staphopia-sccmec --assembly $fasta $options.args > ${prefix}.tsv - echo \$(staphopia-sccmec --version 2>&1) | sed 's/^.*staphopia-sccmec //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(staphopia-sccmec --version 2>&1 | sed 's/^.*staphopia-sccmec //') + END_VERSIONS """ } diff --git a/modules/staphopiasccmec/meta.yml b/modules/staphopiasccmec/meta.yml index 2054c6b3..e1ce3a05 100644 --- a/modules/staphopiasccmec/meta.yml +++ b/modules/staphopiasccmec/meta.yml @@ -34,7 +34,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - tsv: type: file description: Tab-delimited results diff --git a/modules/star/align/functions.nf b/modules/star/align/functions.nf index da9da093..85628ee0 100644 --- a/modules/star/align/functions.nf +++ b/modules/star/align/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/star/align/main.nf b/modules/star/align/main.nf index d5d88ce8..677d1f2a 100644 --- a/modules/star/align/main.nf +++ b/modules/star/align/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -29,7 +29,7 @@ process STAR_ALIGN { tuple val(meta), path('*Log.final.out') , emit: log_final tuple val(meta), path('*Log.out') , emit: log_out tuple val(meta), path('*Log.progress.out'), emit: log_progress - path '*.version.txt' , emit: version + path "versions.yml" , emit: version tuple val(meta), path('*sortedByCoord.out.bam') , optional:true, emit: bam_sorted tuple val(meta), path('*toTranscriptome.out.bam'), optional:true, emit: bam_transcript @@ -68,6 +68,9 @@ process STAR_ALIGN { gzip ${prefix}.unmapped_2.fastq fi - STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(STAR --version | sed -e "s/STAR_//g") + END_VERSIONS """ } diff --git a/modules/star/align/meta.yml b/modules/star/align/meta.yml index a589d145..7f0217ea 100644 --- a/modules/star/align/meta.yml +++ b/modules/star/align/meta.yml @@ -48,7 +48,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam_sorted: type: file description: Sorted BAM file of read alignments (optional) diff --git a/modules/star/genomegenerate/functions.nf b/modules/star/genomegenerate/functions.nf index da9da093..85628ee0 100644 --- a/modules/star/genomegenerate/functions.nf +++ b/modules/star/genomegenerate/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/star/genomegenerate/main.nf b/modules/star/genomegenerate/main.nf index 9335b9b5..5ccb38e8 100644 --- a/modules/star/genomegenerate/main.nf +++ b/modules/star/genomegenerate/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process STAR_GENOMEGENERATE { output: path "star" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -43,7 +43,10 @@ process STAR_GENOMEGENERATE { $memory \\ $options.args - STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(STAR --version | sed -e "s/STAR_//g") + END_VERSIONS """ } else { """ @@ -61,7 +64,10 @@ process STAR_GENOMEGENERATE { $memory \\ $options.args - STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(STAR --version | sed -e "s/STAR_//g") + END_VERSIONS """ } } diff --git a/modules/star/genomegenerate/meta.yml b/modules/star/genomegenerate/meta.yml index aae0219b..70525738 100644 --- a/modules/star/genomegenerate/meta.yml +++ b/modules/star/genomegenerate/meta.yml @@ -29,7 +29,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/strelka/germline/functions.nf b/modules/strelka/germline/functions.nf index da9da093..85628ee0 100644 --- a/modules/strelka/germline/functions.nf +++ b/modules/strelka/germline/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/strelka/germline/main.nf b/modules/strelka/germline/main.nf index 48f795b0..d2203fa4 100644 --- a/modules/strelka/germline/main.nf +++ b/modules/strelka/germline/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -29,7 +29,7 @@ process STRELKA_GERMLINE { tuple val(meta), path("*variants.vcf.gz.tbi"), emit: vcf_tbi tuple val(meta), path("*genome.vcf.gz") , emit: genome_vcf tuple val(meta), path("*genome.vcf.gz.tbi") , emit: genome_vcf_tbi - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -49,6 +49,9 @@ process STRELKA_GERMLINE { mv strelka/results/variants/variants.vcf.gz ${prefix}.variants.vcf.gz mv strelka/results/variants/variants.vcf.gz.tbi ${prefix}.variants.vcf.gz.tbi - echo configureStrelkaGermlineWorkflow.py --version &> ${software}.version.txt #2>&1 + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + strelka: \$( configureStrelkaGermlineWorkflow.py --version ) + END_VERSIONS """ } diff --git a/modules/strelka/germline/meta.yml b/modules/strelka/germline/meta.yml index ae0ecb47..4423e437 100644 --- a/modules/strelka/germline/meta.yml +++ b/modules/strelka/germline/meta.yml @@ -58,6 +58,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@arontommi" diff --git a/modules/stringtie/merge/functions.nf b/modules/stringtie/merge/functions.nf index da9da093..85628ee0 100644 --- a/modules/stringtie/merge/functions.nf +++ b/modules/stringtie/merge/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/stringtie/merge/main.nf b/modules/stringtie/merge/main.nf index f0820be1..85670a91 100644 --- a/modules/stringtie/merge/main.nf +++ b/modules/stringtie/merge/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process STRINGTIE_MERGE { output: path "stringtie.merged.gtf", emit: gtf - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process STRINGTIE_MERGE { -G $annotation_gtf \\ -o stringtie.merged.gtf - echo \$(stringtie --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(stringtie --version 2>&1) + END_VERSIONS """ } diff --git a/modules/stringtie/stringtie/functions.nf b/modules/stringtie/stringtie/functions.nf index da9da093..85628ee0 100644 --- a/modules/stringtie/stringtie/functions.nf +++ b/modules/stringtie/stringtie/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/stringtie/stringtie/main.nf b/modules/stringtie/stringtie/main.nf index 6cff993a..92986dba 100644 --- a/modules/stringtie/stringtie/main.nf +++ b/modules/stringtie/stringtie/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process STRINGTIE { tuple val(meta), path("*.transcripts.gtf"), emit: transcript_gtf tuple val(meta), path("*.abundance.txt") , emit: abundance tuple val(meta), path("*.ballgown") , emit: ballgown - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -51,6 +51,9 @@ process STRINGTIE { -p $task.cpus \\ $options.args - echo \$(stringtie --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(stringtie --version 2>&1) + END_VERSIONS """ } diff --git a/modules/stringtie/stringtie/meta.yml b/modules/stringtie/stringtie/meta.yml index 52ec899d..f9363009 100644 --- a/modules/stringtie/stringtie/meta.yml +++ b/modules/stringtie/stringtie/meta.yml @@ -51,6 +51,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/subread/featurecounts/functions.nf b/modules/subread/featurecounts/functions.nf index da9da093..85628ee0 100644 --- a/modules/subread/featurecounts/functions.nf +++ b/modules/subread/featurecounts/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/subread/featurecounts/main.nf b/modules/subread/featurecounts/main.nf index cde14a74..3e2eb765 100644 --- a/modules/subread/featurecounts/main.nf +++ b/modules/subread/featurecounts/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process SUBREAD_FEATURECOUNTS { output: tuple val(meta), path("*featureCounts.txt") , emit: counts tuple val(meta), path("*featureCounts.txt.summary"), emit: summary - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -47,6 +47,9 @@ process SUBREAD_FEATURECOUNTS { -o ${prefix}.featureCounts.txt \\ ${bams.join(' ')} - echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(featureCounts -v 2>&1 | sed -e "s/featureCounts v//g") + END_VERSIONS """ } diff --git a/modules/subread/featurecounts/meta.yml b/modules/subread/featurecounts/meta.yml index d24f70bd..504d2f48 100644 --- a/modules/subread/featurecounts/meta.yml +++ b/modules/subread/featurecounts/meta.yml @@ -46,7 +46,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@ntoda03" diff --git a/modules/tabix/bgzip/functions.nf b/modules/tabix/bgzip/functions.nf index da9da093..85628ee0 100644 --- a/modules/tabix/bgzip/functions.nf +++ b/modules/tabix/bgzip/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/tabix/bgzip/main.nf b/modules/tabix/bgzip/main.nf index e9d2e96e..eb95de62 100644 --- a/modules/tabix/bgzip/main.nf +++ b/modules/tabix/bgzip/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process TABIX_BGZIP { output: tuple val(meta), path("*.gz"), emit: gz - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -31,6 +31,9 @@ process TABIX_BGZIP { """ bgzip -c $options.args $input > ${prefix}.${input.getExtension()}.gz - echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(tabix -h 2>&1 | sed 's/^.*Version: //; s/(.*\$//') + END_VERSIONS """ } diff --git a/modules/tabix/bgzip/meta.yml b/modules/tabix/bgzip/meta.yml index 686d72e6..801d98bc 100644 --- a/modules/tabix/bgzip/meta.yml +++ b/modules/tabix/bgzip/meta.yml @@ -33,7 +33,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/tabix/bgziptabix/functions.nf b/modules/tabix/bgziptabix/functions.nf index da9da093..85628ee0 100644 --- a/modules/tabix/bgziptabix/functions.nf +++ b/modules/tabix/bgziptabix/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/tabix/bgziptabix/main.nf b/modules/tabix/bgziptabix/main.nf index 6cc3322f..7179a97e 100644 --- a/modules/tabix/bgziptabix/main.nf +++ b/modules/tabix/bgziptabix/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process TABIX_BGZIPTABIX { output: tuple val(meta), path("*.gz"), path("*.tbi"), emit: tbi - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -32,6 +32,9 @@ process TABIX_BGZIPTABIX { bgzip -c $options.args $input > ${prefix}.gz tabix $options.args2 ${prefix}.gz - echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(tabix -h 2>&1 | sed 's/^.*Version: //; s/(.*\$//') + END_VERSIONS """ } diff --git a/modules/tabix/bgziptabix/meta.yml b/modules/tabix/bgziptabix/meta.yml index 5bef2350..92f62bf3 100644 --- a/modules/tabix/bgziptabix/meta.yml +++ b/modules/tabix/bgziptabix/meta.yml @@ -39,6 +39,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/tabix/tabix/functions.nf b/modules/tabix/tabix/functions.nf index da9da093..85628ee0 100644 --- a/modules/tabix/tabix/functions.nf +++ b/modules/tabix/tabix/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/tabix/tabix/main.nf b/modules/tabix/tabix/main.nf index df1e84ee..f703a787 100644 --- a/modules/tabix/tabix/main.nf +++ b/modules/tabix/tabix/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process TABIX_TABIX { output: tuple val(meta), path("*.tbi"), emit: tbi - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) """ tabix $options.args $tab - echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(tabix -h 2>&1 | sed 's/^.*Version: //; s/(.*\$//') + END_VERSIONS """ } diff --git a/modules/tabix/tabix/meta.yml b/modules/tabix/tabix/meta.yml index f66270db..1ca58bcf 100644 --- a/modules/tabix/tabix/meta.yml +++ b/modules/tabix/tabix/meta.yml @@ -33,7 +33,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/tiddit/sv/functions.nf b/modules/tiddit/sv/functions.nf index da9da093..85628ee0 100644 --- a/modules/tiddit/sv/functions.nf +++ b/modules/tiddit/sv/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/tiddit/sv/main.nf b/modules/tiddit/sv/main.nf index bd42f7d1..b7fe1b03 100644 --- a/modules/tiddit/sv/main.nf +++ b/modules/tiddit/sv/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -27,7 +27,7 @@ process TIDDIT_SV { tuple val(meta), path("*.vcf") , emit: vcf tuple val(meta), path("*.ploidy.tab") , emit: ploidy tuple val(meta), path("*.signals.tab"), emit: signals - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -40,6 +40,9 @@ process TIDDIT_SV { $reference \\ -o $prefix - echo \$(tiddit -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(tiddit -h 2>&1 | sed 's/^.*Version: //; s/(.*\$//') + END_VERSIONS """ } diff --git a/modules/tiddit/sv/meta.yml b/modules/tiddit/sv/meta.yml index f1601f72..2a351766 100644 --- a/modules/tiddit/sv/meta.yml +++ b/modules/tiddit/sv/meta.yml @@ -45,6 +45,6 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/trimgalore/functions.nf b/modules/trimgalore/functions.nf index da9da093..85628ee0 100644 --- a/modules/trimgalore/functions.nf +++ b/modules/trimgalore/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/trimgalore/main.nf b/modules/trimgalore/main.nf index 3c16d66f..c002062a 100644 --- a/modules/trimgalore/main.nf +++ b/modules/trimgalore/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process TRIMGALORE { output: tuple val(meta), path("*.fq.gz") , emit: reads tuple val(meta), path("*report.txt"), emit: log - path "*.version.txt" , emit: version + path "versions.yml" , emit: version tuple val(meta), path("*.html"), emit: html optional true tuple val(meta), path("*.zip") , emit: zip optional true @@ -60,7 +60,10 @@ process TRIMGALORE { $c_r1 \\ $tpc_r1 \\ ${prefix}.fastq.gz - echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(trim_galore --version 2>&1 | sed 's/^.*version //; s/Last.*\$//') + END_VERSIONS """ } else { """ @@ -77,7 +80,10 @@ process TRIMGALORE { $tpc_r2 \\ ${prefix}_1.fastq.gz \\ ${prefix}_2.fastq.gz - echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(trim_galore --version 2>&1 | sed 's/^.*version //; s/Last.*\$//') + END_VERSIONS """ } } diff --git a/modules/trimgalore/meta.yml b/modules/trimgalore/meta.yml index 73538707..0c9fc925 100644 --- a/modules/trimgalore/meta.yml +++ b/modules/trimgalore/meta.yml @@ -51,7 +51,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/ucsc/bed12tobigbed/functions.nf b/modules/ucsc/bed12tobigbed/functions.nf index da9da093..85628ee0 100644 --- a/modules/ucsc/bed12tobigbed/functions.nf +++ b/modules/ucsc/bed12tobigbed/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/ucsc/bed12tobigbed/main.nf b/modules/ucsc/bed12tobigbed/main.nf index 407379fd..2f9b287b 100644 --- a/modules/ucsc/bed12tobigbed/main.nf +++ b/modules/ucsc/bed12tobigbed/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process UCSC_BED12TOBIGBED { output: tuple val(meta), path("*.bigBed"), emit: bigbed - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process UCSC_BED12TOBIGBED { $sizes \\ ${prefix}.bigBed - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/ucsc/bed12tobigbed/meta.yml b/modules/ucsc/bed12tobigbed/meta.yml index 7541eb2d..9bd2dd46 100755 --- a/modules/ucsc/bed12tobigbed/meta.yml +++ b/modules/ucsc/bed12tobigbed/meta.yml @@ -36,7 +36,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bigbed: type: file description: bigBed file diff --git a/modules/ucsc/bedclip/functions.nf b/modules/ucsc/bedclip/functions.nf index da9da093..85628ee0 100755 --- a/modules/ucsc/bedclip/functions.nf +++ b/modules/ucsc/bedclip/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/ucsc/bedclip/main.nf b/modules/ucsc/bedclip/main.nf index d1a47554..c001b410 100755 --- a/modules/ucsc/bedclip/main.nf +++ b/modules/ucsc/bedclip/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,7 +26,7 @@ process UCSC_BEDCLIP { output: tuple val(meta), path("*.bedGraph"), emit: bedgraph - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,6 +37,9 @@ process UCSC_BEDCLIP { $sizes \\ ${prefix}.bedGraph - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/ucsc/bedclip/meta.yml b/modules/ucsc/bedclip/meta.yml index f20b4617..b11d2083 100755 --- a/modules/ucsc/bedclip/meta.yml +++ b/modules/ucsc/bedclip/meta.yml @@ -31,7 +31,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bedgraph: type: file description: bedGraph file diff --git a/modules/ucsc/bedgraphtobigwig/functions.nf b/modules/ucsc/bedgraphtobigwig/functions.nf index da9da093..85628ee0 100644 --- a/modules/ucsc/bedgraphtobigwig/functions.nf +++ b/modules/ucsc/bedgraphtobigwig/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/ucsc/bedgraphtobigwig/main.nf b/modules/ucsc/bedgraphtobigwig/main.nf index e5fe3b7f..60e046f9 100644 --- a/modules/ucsc/bedgraphtobigwig/main.nf +++ b/modules/ucsc/bedgraphtobigwig/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -26,13 +26,16 @@ process UCSC_BEDGRAPHTOBIGWIG { output: tuple val(meta), path("*.bigWig"), emit: bigwig - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedGraphToBigWig $bedgraph $sizes ${prefix}.bigWig - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/ucsc/bedgraphtobigwig/meta.yml b/modules/ucsc/bedgraphtobigwig/meta.yml index 31365f48..ea20604c 100755 --- a/modules/ucsc/bedgraphtobigwig/meta.yml +++ b/modules/ucsc/bedgraphtobigwig/meta.yml @@ -36,7 +36,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bigwig: type: file description: bigWig file diff --git a/modules/ucsc/bigwigaverageoverbed/functions.nf b/modules/ucsc/bigwigaverageoverbed/functions.nf index da9da093..85628ee0 100755 --- a/modules/ucsc/bigwigaverageoverbed/functions.nf +++ b/modules/ucsc/bigwigaverageoverbed/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/ucsc/bigwigaverageoverbed/main.nf b/modules/ucsc/bigwigaverageoverbed/main.nf index 0aef3fca..adba3c76 100644 --- a/modules/ucsc/bigwigaverageoverbed/main.nf +++ b/modules/ucsc/bigwigaverageoverbed/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process UCSC_BIGWIGAVERAGEOVERBED { output: tuple val(meta), path("*.tab") , emit: tab - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -33,6 +33,9 @@ process UCSC_BIGWIGAVERAGEOVERBED { # there is a bug that bigWigAverageOverBed can not handle ensembl seqlevels style. bigWigAverageOverBed ${options.args} $bigwig $bed ${bed.getSimpleName()}.tab - echo \$(bigWigAverageOverBed 2>&1) | sed 's/bigWigAverageOverBed v//; s/ - Compute.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bigWigAverageOverBed 2>&1 | sed 's/bigWigAverageOverBed v//; s/ - Compute.*\$//') + END_VERSIONS """ } diff --git a/modules/ucsc/bigwigaverageoverbed/meta.yml b/modules/ucsc/bigwigaverageoverbed/meta.yml index 1f007f42..93328df0 100644 --- a/modules/ucsc/bigwigaverageoverbed/meta.yml +++ b/modules/ucsc/bigwigaverageoverbed/meta.yml @@ -36,7 +36,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - tab: type: file description: tab file diff --git a/modules/ucsc/wigtobigwig/functions.nf b/modules/ucsc/wigtobigwig/functions.nf index da9da093..85628ee0 100755 --- a/modules/ucsc/wigtobigwig/functions.nf +++ b/modules/ucsc/wigtobigwig/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/ucsc/wigtobigwig/main.nf b/modules/ucsc/wigtobigwig/main.nf index dee2d0bd..945f07c9 100644 --- a/modules/ucsc/wigtobigwig/main.nf +++ b/modules/ucsc/wigtobigwig/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process UCSC_WIGTOBIGWIG { output: path "*.bw" , emit: bw - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process UCSC_WIGTOBIGWIG { $chromsizes \\ ${wig.getSimpleName()}.bw - echo \$(wigToBigWig 2>&1) | sed 's/wigToBigWig v //; s/ - Convert.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(wigToBigWig 2>&1 | sed 's/wigToBigWig v //; s/ - Convert.*\$//') + END_VERSIONS """ } diff --git a/modules/ucsc/wigtobigwig/meta.yml b/modules/ucsc/wigtobigwig/meta.yml index 6ed4b026..102fd8ef 100644 --- a/modules/ucsc/wigtobigwig/meta.yml +++ b/modules/ucsc/wigtobigwig/meta.yml @@ -27,7 +27,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bw: type: file description: bigwig file diff --git a/modules/umitools/dedup/functions.nf b/modules/umitools/dedup/functions.nf index da9da093..85628ee0 100644 --- a/modules/umitools/dedup/functions.nf +++ b/modules/umitools/dedup/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/umitools/dedup/main.nf b/modules/umitools/dedup/main.nf index f30ab164..0f15c86c 100644 --- a/modules/umitools/dedup/main.nf +++ b/modules/umitools/dedup/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process UMITOOLS_DEDUP { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process UMITOOLS_DEDUP { $paired \\ $options.args - echo \$(umi_tools --version 2>&1) | sed 's/^.*UMI-tools version://; s/ *\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') + END_VERSIONS """ } diff --git a/modules/umitools/extract/functions.nf b/modules/umitools/extract/functions.nf index da9da093..85628ee0 100644 --- a/modules/umitools/extract/functions.nf +++ b/modules/umitools/extract/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/umitools/extract/main.nf b/modules/umitools/extract/main.nf index e5c4e21c..0a5e6636 100644 --- a/modules/umitools/extract/main.nf +++ b/modules/umitools/extract/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process UMITOOLS_EXTRACT { output: tuple val(meta), path("*.fastq.gz"), emit: reads tuple val(meta), path("*.log") , emit: log - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -38,7 +38,10 @@ process UMITOOLS_EXTRACT { $options.args \\ > ${prefix}.umi_extract.log - echo \$(umi_tools --version 2>&1) | sed 's/^.*UMI-tools version://; s/ *\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') + END_VERSIONS """ } else { """ @@ -51,7 +54,10 @@ process UMITOOLS_EXTRACT { $options.args \\ > ${prefix}.umi_extract.log - echo \$(umi_tools --version 2>&1) | sed 's/^.*UMI-tools version://; s/ *\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') + END_VERSIONS """ } } diff --git a/modules/unicycler/functions.nf b/modules/unicycler/functions.nf index da9da093..85628ee0 100644 --- a/modules/unicycler/functions.nf +++ b/modules/unicycler/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/unicycler/main.nf b/modules/unicycler/main.nf index 320c0f29..2b031c42 100644 --- a/modules/unicycler/main.nf +++ b/modules/unicycler/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process UNICYCLER { tuple val(meta), path('*.scaffolds.fa'), emit: scaffolds tuple val(meta), path('*.assembly.gfa'), emit: gfa tuple val(meta), path('*.log') , emit: log - path '*.version.txt' , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -42,6 +42,9 @@ process UNICYCLER { mv assembly.gfa ${prefix}.assembly.gfa mv unicycler.log ${prefix}.unicycler.log - echo \$(unicycler --version 2>&1) | sed 's/^.*Unicycler v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(unicycler --version 2>&1 | sed 's/^.*Unicycler v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/unicycler/meta.yml b/modules/unicycler/meta.yml index 286b7f67..f6581919 100644 --- a/modules/unicycler/meta.yml +++ b/modules/unicycler/meta.yml @@ -33,7 +33,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - scaffolds: type: file description: Fasta file containing scaffolds @@ -49,7 +49,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@JoseEspinosa" - "@drpatelh" diff --git a/modules/untar/functions.nf b/modules/untar/functions.nf index da9da093..85628ee0 100644 --- a/modules/untar/functions.nf +++ b/modules/untar/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/untar/main.nf b/modules/untar/main.nf index fc6d7ec5..25b39904 100644 --- a/modules/untar/main.nf +++ b/modules/untar/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,13 +23,16 @@ process UNTAR { output: path "$untar" , emit: untar - path "*.version.txt", emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) untar = archive.toString() - '.tar.gz' """ tar -xzvf $options.args $archive - echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(tar --version 2>&1 | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//') + END_VERSIONS """ } diff --git a/modules/untar/meta.yml b/modules/untar/meta.yml index af4674f0..0dc38292 100644 --- a/modules/untar/meta.yml +++ b/modules/untar/meta.yml @@ -21,7 +21,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/unzip/functions.nf b/modules/unzip/functions.nf index da9da093..85628ee0 100644 --- a/modules/unzip/functions.nf +++ b/modules/unzip/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/unzip/main.nf b/modules/unzip/main.nf index b52fbb04..a2fe2594 100644 --- a/modules/unzip/main.nf +++ b/modules/unzip/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process UNZIP { output: path "${archive.baseName}/" , emit: unzipped_archive - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -38,6 +38,9 @@ process UNZIP { $options.args \\ $archive - echo \$(7za --help) | grep Version | sed 's/.*p7zip Version//; s/(.*//' 1> ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + 7za: \$( 7za --help) grep Version | sed 's/.*p7zip Version//; s/(.*//' ) + END_VERSIONS """ } diff --git a/modules/unzip/meta.yml b/modules/unzip/meta.yml index 97b1f1fc..386ca8bb 100644 --- a/modules/unzip/meta.yml +++ b/modules/unzip/meta.yml @@ -21,7 +21,7 @@ output: - version: type: file description: File or directory of decompressed archive - pattern: "*.{version.txt}" + pattern: "versions.yml" - unzipped_archive: type: directory description: Directory contents of the unzipped archive diff --git a/modules/variantbam/functions.nf b/modules/variantbam/functions.nf index da9da093..85628ee0 100644 --- a/modules/variantbam/functions.nf +++ b/modules/variantbam/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/variantbam/main.nf b/modules/variantbam/main.nf index dc29de58..c4ac3742 100644 --- a/modules/variantbam/main.nf +++ b/modules/variantbam/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -25,7 +25,7 @@ process VARIANTBAM { output: tuple val(meta), path("*.bam") , emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -36,6 +36,9 @@ process VARIANTBAM { -o ${prefix}.bam \\ $options.args - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo $VERSION) + END_VERSIONS """ } diff --git a/modules/variantbam/meta.yml b/modules/variantbam/meta.yml index da0ff5e0..62ddb578 100644 --- a/modules/variantbam/meta.yml +++ b/modules/variantbam/meta.yml @@ -36,7 +36,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: Filtered or downsampled BAM file diff --git a/modules/vcftools/functions.nf b/modules/vcftools/functions.nf index da9da093..85628ee0 100644 --- a/modules/vcftools/functions.nf +++ b/modules/vcftools/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/vcftools/main.nf b/modules/vcftools/main.nf index a0d8cd5a..7ae1619f 100644 --- a/modules/vcftools/main.nf +++ b/modules/vcftools/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -28,7 +28,7 @@ process VCFTOOLS { path(diff_variant_file) output: - path("*.version.txt"), emit: version + path("versions.yml") , emit: version tuple val(meta), path("*.vcf"), optional:true, emit: vcf tuple val(meta), path("*.bcf"), optional:true, emit: bcf @@ -124,6 +124,9 @@ process VCFTOOLS { $bed_arg \\ $diff_variant_arg \\ - echo \$(vcftools --version 2>&1) | sed 's/^.*vcftools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(vcftools --version 2>&1 | sed 's/^.*vcftools //; s/Using.*\$//') + END_VERSIONS """ } diff --git a/modules/vcftools/meta.yml b/modules/vcftools/meta.yml index 4da9b6c2..e39a0347 100644 --- a/modules/vcftools/meta.yml +++ b/modules/vcftools/meta.yml @@ -36,7 +36,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - vcf: type: file description: vcf file (optional) diff --git a/modules/yara/index/functions.nf b/modules/yara/index/functions.nf index da9da093..85628ee0 100644 --- a/modules/yara/index/functions.nf +++ b/modules/yara/index/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/yara/index/main.nf b/modules/yara/index/main.nf index f1fe13a5..c621e866 100644 --- a/modules/yara/index/main.nf +++ b/modules/yara/index/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,7 +23,7 @@ process YARA_INDEX { output: path "yara", emit: index - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,6 +34,9 @@ process YARA_INDEX { mv *.{lf,rid,sa,txt}.* yara cp $fasta yara/yara.fasta - echo \$(yara_indexer --help 2>&1) | grep -e "yara_indexer version:" | sed 's/yara_indexer version: //g' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(yara_indexer --help 2>&1 | grep -e "yara_indexer version:" | sed 's/yara_indexer version: //g') + END_VERSIONS """ } diff --git a/modules/yara/index/meta.yml b/modules/yara/index/meta.yml index f1e2ab93..acf70f2b 100644 --- a/modules/yara/index/meta.yml +++ b/modules/yara/index/meta.yml @@ -24,7 +24,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - index: type: file description: YARA genome index files diff --git a/modules/yara/mapper/functions.nf b/modules/yara/mapper/functions.nf index da9da093..85628ee0 100644 --- a/modules/yara/mapper/functions.nf +++ b/modules/yara/mapper/functions.nf @@ -9,6 +9,13 @@ def getSoftwareName(task_process) { return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() } +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + // // Function to initialise default values and to generate a Groovy Map of available options for nf-core modules // @@ -37,32 +44,35 @@ def getPathFromList(path_list) { // Function to save/publish module results // def saveFiles(Map args) { - if (!args.filename.endsWith('.version.txt')) { - def ioptions = initOptions(args.options) - def path_list = [ ioptions.publish_dir ?: args.publish_dir ] - if (ioptions.publish_by_meta) { - def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta - for (key in key_list) { - if (args.meta && key instanceof String) { - def path = key - if (args.meta.containsKey(key)) { - path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] - } - path = path instanceof String ? path : '' - path_list.add(path) + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] } + path = path instanceof String ? path : '' + path_list.add(path) } } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(ext.value) - return "${getPathFromList(ext_list)}/$args.filename" - } - } - } else if (ioptions.publish_files == null) { - return "${getPathFromList(path_list)}/$args.filename" - } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" } } diff --git a/modules/yara/mapper/main.nf b/modules/yara/mapper/main.nf index f888ae14..3404d591 100644 --- a/modules/yara/mapper/main.nf +++ b/modules/yara/mapper/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -24,7 +24,7 @@ process YARA_MAPPER { output: tuple val(meta), path("*.mapped.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -34,14 +34,20 @@ process YARA_MAPPER { """ yara_mapper $options.args -t ${task.cpus} -f bam ${index}/yara $reads | samtools view -@ ${task.cpus} -hb -F4 > ${prefix}.mapped.bam - echo \$(yara_mapper --help 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(yara_mapper --help 2>&1) + END_VERSIONS """ } else { """ yara_mapper $options.args -t ${task.cpus} -f bam ${index}/yara ${reads[0]} ${reads[1]} > output.bam samtools view -@ ${task.cpus} -hF 4 -f 0x40 -b output.bam > ${prefix}_1.mapped.bam samtools view -@ ${task.cpus} -hF 4 -f 0x80 -b output.bam > ${prefix}_2.mapped.bam - echo \$(yara_mapper --version 2>&1) | grep -e "yara_mapper version:" | sed 's/yara_mapper version: //g' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(yara_mapper --version 2>&1 | grep -e "yara_mapper version:" | sed 's/yara_mapper version: //g') + END_VERSIONS """ } diff --git a/modules/yara/mapper/meta.yml b/modules/yara/mapper/meta.yml index 4a8e6494..4beb0c78 100644 --- a/modules/yara/mapper/meta.yml +++ b/modules/yara/mapper/meta.yml @@ -37,7 +37,7 @@ output: - version: type: file description: File containing software version - pattern: "*.{version.txt}" + pattern: "versions.yml" - bam: type: file description: Sorted BAM file From 4ec8b025bdb436e138230ceda06bcff94585dc01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Guizard?= Date: Mon, 27 Sep 2021 16:14:35 +0100 Subject: [PATCH 05/61] New module: `LIMA` (#719) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * πŸ“¦ NEW: Add module lima * πŸ‘Œ IMPROVE: Move .pbi output to reports channel * πŸ› FIX: Fix report channel definition * πŸ‘ŒIMPROVE; Remove options from command line update test script with removed options * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ› FIX: Add pbi input * πŸ‘Œ IMPROVE: Add parallelization to lima * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The accept one channel (primers move into the first channel) * πŸ‘Œ IMPROVE: Assign a value channel for pimers Improve code workflow readability * πŸ‘Œ IMPROVE: Update .gitignore * πŸ‘Œ IMPROVE: Update module to last template version * πŸ› FIX: Correct Singularity and Docker URL * πŸ‘Œ IMPROVE: Update to the last version of modules template * πŸ‘Œ IMPROVE: Update test_data.config * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ› FIX: Fill contains args * πŸ“¦ NEW: Add module lima * πŸ‘Œ IMPROVE: Move .pbi output to reports channel * πŸ› FIX: Fix report channel definition * πŸ‘ŒIMPROVE; Remove options from command line update test script with removed options * πŸ› FIX: Add pbi input * πŸ‘Œ IMPROVE: Add parallelization to lima * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The accept one channel (primers move into the first channel) * πŸ‘Œ IMPROVE: Assign a value channel for pimers Improve code workflow readability * πŸ‘Œ IMPROVE: Update .gitignore * πŸ‘Œ IMPROVE: Update module to last template version * πŸ› FIX: Correct Singularity and Docker URL * πŸ‘Œ IMPROVE: Update to the last version of modules template * πŸ‘Œ IMPROVE: Update test_data.config * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ› FIX: Fill contains args * πŸ‘Œ IMPROVE: Add channel for each output * πŸ‘Œ IMPROVE: Remove comments * πŸ“¦ NEW: Add module lima * πŸ‘Œ IMPROVE: Move .pbi output to reports channel * πŸ› FIX: Fix report channel definition * πŸ‘ŒIMPROVE; Remove options from command line update test script with removed options * πŸ› FIX: Add pbi input * πŸ‘Œ IMPROVE: Add parallelization to lima * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The accept one channel (primers move into the first channel) * πŸ‘Œ IMPROVE: Assign a value channel for pimers Improve code workflow readability * πŸ‘Œ IMPROVE: Update module to last template version * πŸ› FIX: Correct Singularity and Docker URL * πŸ‘Œ IMPROVE: Update to the last version of modules template * πŸ‘Œ IMPROVE: Update test_data.config * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ› FIX: Fill contains args * πŸ“¦ NEW: Add module lima * πŸ‘Œ IMPROVE: Move .pbi output to reports channel * πŸ› FIX: Fix report channel definition * πŸ‘ŒIMPROVE; Remove options from command line update test script with removed options * πŸ› FIX: Add pbi input * πŸ‘Œ IMPROVE: Add parallelization to lima * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The accept one channel (primers move into the first channel) * πŸ‘Œ IMPROVE: Assign a value channel for pimers Improve code workflow readability * πŸ‘Œ IMPROVE: Update module to last template version * πŸ› FIX: Correct Singularity and Docker URL * πŸ‘Œ IMPROVE: Update to the last version of modules template * πŸ‘Œ IMPROVE: Update test_data.config * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ› FIX: Fill contains args * πŸ‘Œ IMPROVE: Add channel for each output * πŸ‘Œ IMPROVE: Remove comments * πŸ› FIX: Clean test_data.config * Update modules/lima/main.nf Add meta to each output Co-authored-by: Harshil Patel * Update modules/lima/main.nf Remove useless parenthesis Co-authored-by: Harshil Patel * πŸ› FIX: Keep version number only * πŸ› FIX: Reintegrate prefix variable and use it to define output file name * πŸ‘Œ IMPROVE: add suffix arg to check output files names * πŸ‘Œ IMPROVE: Use prefix for output filename * πŸ› FIX: Set optional output Allow usage of different input formats * πŸ‘Œ IMPROVE: Update meta file * πŸ‘Œ IMPROVE: Update test One test for each input file type * πŸ‘Œ IMPROVE: add fasta, fastq.gz, fastq, fastq.gz test files * πŸ‘Œ IMPROVE: Update with last templates / Follow new version.yaml rule * πŸ› FIX: Fix typos and include getProcessName function * πŸ‘Œ IMPROVE: Update .gitignore * πŸ‘Œ IMPROVE: Using suffix to manage output was not a my best idea Add a bash code to detect extension and update output file name * πŸ‘Œ IMPROVE: clean code Co-authored-by: Harshil Patel Co-authored-by: Gregor Sturm Co-authored-by: Mahesh Binzer-Panchal --- .gitignore | 2 + modules/lima/functions.nf | 78 ++++++++++++++++++++++++++++ modules/lima/main.nf | 73 ++++++++++++++++++++++++++ modules/lima/meta.yml | 77 ++++++++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/config/test_data.config | 5 ++ tests/modules/lima/main.nf | 60 ++++++++++++++++++++++ tests/modules/lima/test.yml | 91 +++++++++++++++++++++++++++++++++ 8 files changed, 390 insertions(+) create mode 100644 modules/lima/functions.nf create mode 100644 modules/lima/main.nf create mode 100644 modules/lima/meta.yml create mode 100644 tests/modules/lima/main.nf create mode 100644 tests/modules/lima/test.yml diff --git a/.gitignore b/.gitignore index 9d982e3f..06eae014 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ __pycache__ *.pyo *.pyc tests/data/ +modules/modtest/ +tests/modules/modtest/ diff --git a/modules/lima/functions.nf b/modules/lima/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/lima/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/lima/main.nf b/modules/lima/main.nf new file mode 100644 index 00000000..1ff5ac48 --- /dev/null +++ b/modules/lima/main.nf @@ -0,0 +1,73 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process LIMA { + tag "$meta.id" + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::lima=2.2.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/lima:2.2.0--h9ee0642_0" + } else { + container "quay.io/biocontainers/lima:2.2.0--h9ee0642_0" + } + + input: + tuple val(meta), path(ccs) + path primers + + output: + tuple val(meta), path("*.clips") , emit: clips + tuple val(meta), path("*.counts") , emit: counts + tuple val(meta), path("*.guess") , emit: guess + tuple val(meta), path("*.report") , emit: report + tuple val(meta), path("*.summary"), emit: summary + path "versions.yml" , emit: version + + tuple val(meta), path("*.bam") , optional: true, emit: bam + tuple val(meta), path("*.bam.pbi") , optional: true, emit: pbi + tuple val(meta), path("*.{fa, fasta}") , optional: true, emit: fasta + tuple val(meta), path("*.{fa.gz, fasta.gz}"), optional: true, emit: fastagz + tuple val(meta), path("*.fastq") , optional: true, emit: fastq + tuple val(meta), path("*.fastq.gz") , optional: true, emit: fastqgz + tuple val(meta), path("*.xml") , optional: true, emit: xml + tuple val(meta), path("*.json") , optional: true, emit: json + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + + """ + OUT_EXT="" + + if [[ $ccs =~ bam\$ ]]; then + OUT_EXT="bam" + elif [[ $ccs =~ fasta\$ ]]; then + OUT_EXT="fasta" + elif [[ $ccs =~ fasta.gz\$ ]]; then + OUT_EXT="fasta.gz" + elif [[ $ccs =~ fastq\$ ]]; then + OUT_EXT="fastq" + elif [[ $ccs =~ fastq.gz\$ ]]; then + OUT_EXT="fastq.gz" + fi + + echo \$OUT_EXT + lima \\ + $ccs \\ + $primers \\ + $prefix.\$OUT_EXT \\ + -j $task.cpus \\ + $options.args + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + lima: \$( lima --version | sed 's/lima //g' | sed 's/ (.\\+//g' ) + END_VERSIONS + """ +} diff --git a/modules/lima/meta.yml b/modules/lima/meta.yml new file mode 100644 index 00000000..3bb861b5 --- /dev/null +++ b/modules/lima/meta.yml @@ -0,0 +1,77 @@ +name: lima +description: lima - The PacBio Barcode Demultiplexer and Primer Remover +keywords: + - sort +tools: + - lima: + description: lima - The PacBio Barcode Demultiplexer and Primer Remover + homepage: https://github.com/PacificBiosciences/pbbioconda + documentation: https://lima.how/ + tool_dev_url: https://github.com/pacificbiosciences/barcoding/ + doi: "" + licence: ['BSD-3-clause-Clear'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - ccs: + type: file + description: A BAM or fasta or fasta.gz or fastq or fastq.gz file of subreads or ccs + pattern: "*.{bam,fasta,fasta.gz,fastq,fastq.gz}" + - primers: + type: file + description: Fasta file, sequences of primers + pattern: "*.fasta" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - bam: + type: file + description: A bam file of ccs purged of primers + pattern: "*.bam" + - pbi: + type: file + description: Pacbio index file of ccs purged of primers + pattern: "*.bam" + - xml: + type: file + description: An XML file representing a set of a particular sequence data type such as subreads, references or aligned subreads. + pattern: "*.xml" + - json: + type: file + description: A metadata json file + pattern: "*.json" + - clips: + type: file + description: A fasta file of clipped primers + pattern: "*.clips" + - counts: + type: file + description: A tabulated file of describing pairs of primers + pattern: "*.counts" + - guess: + type: file + description: A second tabulated file of describing pairs of primers (no doc available) + pattern: "*.guess" + - report: + type: file + description: A tab-separated file about each ZMW, unfiltered + pattern: "*.report" + - summary: + type: file + description: This file shows how many ZMWs have been filtered, how ZMWs many are same/different, and how many reads have been filtered. + pattern: "*.summary" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" + +authors: + - "@sguizard" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 74673511..16d4790d 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -562,6 +562,10 @@ last/train: - modules/last/train/** - tests/modules/last/train/** +lima: + - modules/lima/** + - tests/modules/lima/** + lofreq/call: - modules/lofreq/call/** - tests/modules/lofreq/call/** diff --git a/tests/config/test_data.config b/tests/config/test_data.config index eda747e0..8b246c7c 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -175,6 +175,11 @@ params { alz = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.bam" alzpbi = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.bam.pbi" ccs = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.bam" + ccs_fa = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/alz.ccs.fasta" + ccs_fa_gz = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/alz.ccs.fasta.gz" + ccs_fq = "${test_data_dir}/genomics/homo_sapiens/pacbio/fastq/alz.ccs.fastq" + ccs_fq_gz = "${test_data_dir}/genomics/homo_sapiens/pacbio/fastq/alz.ccs.fastq.gz" + ccs_xml = "${test_data_dir}/genomics/homo_sapiens/pacbio/xml/alz.ccs.consensusreadset.xml" lima = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.bam" refine = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.bam" cluster = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.bam" diff --git a/tests/modules/lima/main.nf b/tests/modules/lima/main.nf new file mode 100644 index 00000000..df4b2be2 --- /dev/null +++ b/tests/modules/lima/main.nf @@ -0,0 +1,60 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { LIMA } from '../../../modules/lima/main.nf' addParams( options: [args: '--isoseq --peek-guess', suffix: ".fl"] ) + +workflow test_lima_bam { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['pacbio']['ccs'], checkIfExists: true), + ] + primers = [ file(params.test_data['homo_sapiens']['pacbio']['primers'], checkIfExists: true) ] + + LIMA ( input, primers ) +} + +workflow test_lima_fa { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['pacbio']['ccs_fa'], checkIfExists: true), + ] + primers = [ file(params.test_data['homo_sapiens']['pacbio']['primers'], checkIfExists: true) ] + + LIMA ( input, primers ) +} + +workflow test_lima_fa_gz { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['pacbio']['ccs_fa_gz'], checkIfExists: true), + ] + primers = [ file(params.test_data['homo_sapiens']['pacbio']['primers'], checkIfExists: true) ] + + LIMA ( input, primers ) +} + +workflow test_lima_fq { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['pacbio']['ccs_fq'], checkIfExists: true), + ] + primers = [ file(params.test_data['homo_sapiens']['pacbio']['primers'], checkIfExists: true) ] + + LIMA ( input, primers ) +} + +workflow test_lima_fq_gz { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['pacbio']['ccs_fq_gz'], checkIfExists: true), + ] + primers = [ file(params.test_data['homo_sapiens']['pacbio']['primers'], checkIfExists: true) ] + + LIMA ( input, primers ) +} diff --git a/tests/modules/lima/test.yml b/tests/modules/lima/test.yml new file mode 100644 index 00000000..1ff860d9 --- /dev/null +++ b/tests/modules/lima/test.yml @@ -0,0 +1,91 @@ +- name: lima test_lima_bam + command: nextflow run tests/modules/lima -entry test_lima_bam -c tests/config/nextflow.config + tags: + - lima + files: + - path: output/lima/test.fl.NEB_5p--NEB_Clontech_3p.bam + md5sum: 14b51d7f44e30c05a5b14e431a992097 + - path: output/lima/test.fl.NEB_5p--NEB_Clontech_3p.bam.pbi + md5sum: 6ae7f057304ad17dd9d5f565d72d3f7b + - path: output/lima/test.fl.NEB_5p--NEB_Clontech_3p.consensusreadset.xml + contains: [ 'ConsensusReadSet' ] + - path: output/lima/test.fl.json + contains: [ 'ConsensusReadSet' ] + - path: output/lima/test.fl.lima.clips + md5sum: fa03bc75bd78b2648a139fd67c69208f + - path: output/lima/test.fl.lima.counts + md5sum: 842c6a23ca2de504ced4538ad5111da1 + - path: output/lima/test.fl.lima.guess + md5sum: d3675af3ca8a908ee9e3c231668392d3 + - path: output/lima/test.fl.lima.report + md5sum: dc073985322ae0a003ccc7e0fa4db5e6 + - path: output/lima/test.fl.lima.summary + md5sum: bcbcaaaca418bdeb91141c81715ca420 + +- name: lima test_lima_fa + command: nextflow run tests/modules/lima -entry test_lima_fa -c tests/config/nextflow.config + tags: + - lima + files: + - path: output/lima/test.fl.lima.clips + md5sum: 1012bc8874a14836f291bac48e8482a4 + - path: output/lima/test.fl.lima.counts + md5sum: a4ceaa408be334eaa711577e95f8730e + - path: output/lima/test.fl.lima.guess + md5sum: 651e5f2b438b8ceadb3e06a2177e1818 + - path: output/lima/test.fl.lima.report + md5sum: bd4a8bde17471563cf91aab4c787911d + - path: output/lima/test.fl.lima.summary + md5sum: 03be2311ba4afb878d8e547ab38c11eb + +- name: lima test_lima_fa_gz + command: nextflow run tests/modules/lima -entry test_lima_fa_gz -c tests/config/nextflow.config + tags: + - lima + files: + - path: output/lima/test.fl.lima.clips + md5sum: 1012bc8874a14836f291bac48e8482a4 + - path: output/lima/test.fl.lima.counts + md5sum: a4ceaa408be334eaa711577e95f8730e + - path: output/lima/test.fl.lima.guess + md5sum: 651e5f2b438b8ceadb3e06a2177e1818 + - path: output/lima/test.fl.lima.report + md5sum: bd4a8bde17471563cf91aab4c787911d + - path: output/lima/test.fl.lima.summary + md5sum: 03be2311ba4afb878d8e547ab38c11eb + +- name: lima test_lima_fq + command: nextflow run tests/modules/lima -entry test_lima_fq -c tests/config/nextflow.config + tags: + - lima + files: + - path: output/lima/test.fl.NEB_5p--NEB_Clontech_3p.fastq + md5sum: ef395f689c5566f501e300bb83d7a5f2 + - path: output/lima/test.fl.lima.clips + md5sum: 5c16ef8122f6f1798acc30eb8a30828c + - path: output/lima/test.fl.lima.counts + md5sum: 767b687e6eda7b24cd0e577f527eb2f0 + - path: output/lima/test.fl.lima.guess + md5sum: 31b988aab6bda84867e704b9edd8a763 + - path: output/lima/test.fl.lima.report + md5sum: ad2a9b1eeb4cda4a1f69ef4b7520b5fd + - path: output/lima/test.fl.lima.summary + md5sum: e91d3c386aaf4effa63f33ee2eb7da2a + +- name: lima test_lima_fq_gz + command: nextflow run tests/modules/lima -entry test_lima_fq_gz -c tests/config/nextflow.config + tags: + - lima + files: + - path: output/lima/test.fl.NEB_5p--NEB_Clontech_3p.fastq.gz + md5sum: 32c11db85f69a1b4454b6bbd794b6df2 + - path: output/lima/test.fl.lima.clips + md5sum: 5c16ef8122f6f1798acc30eb8a30828c + - path: output/lima/test.fl.lima.counts + md5sum: 767b687e6eda7b24cd0e577f527eb2f0 + - path: output/lima/test.fl.lima.guess + md5sum: 31b988aab6bda84867e704b9edd8a763 + - path: output/lima/test.fl.lima.report + md5sum: ad2a9b1eeb4cda4a1f69ef4b7520b5fd + - path: output/lima/test.fl.lima.summary + md5sum: e91d3c386aaf4effa63f33ee2eb7da2a From 43c27792583b3db3faedf189adea48939e300cf2 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Mon, 27 Sep 2021 22:10:37 +0100 Subject: [PATCH 06/61] Fix version commands (#749) * Fix version commands * Fix version commands: again --- modules/abacas/main.nf | 2 +- modules/agrvate/main.nf | 2 +- modules/bandage/image/main.nf | 2 +- modules/bismark/align/main.nf | 2 +- modules/bismark/deduplicate/main.nf | 2 +- modules/bismark/genomepreparation/main.nf | 2 +- modules/bismark/methylationextractor/main.nf | 2 +- modules/bismark/report/main.nf | 2 +- modules/bowtie/align/main.nf | 2 +- modules/bowtie/build/main.nf | 2 +- modules/bowtie2/align/main.nf | 8 ++--- modules/bowtie2/build/main.nf | 2 +- modules/bwa/aln/main.nf | 6 ++-- modules/bwa/index/main.nf | 13 +++++--- modules/bwa/mem/main.nf | 4 +-- modules/bwa/sampe/main.nf | 2 +- modules/bwa/samse/main.nf | 2 +- modules/bwamem2/index/main.nf | 8 +++-- modules/bwamem2/mem/main.nf | 7 +++-- modules/bwameth/align/main.nf | 2 +- modules/bwameth/index/main.nf | 2 +- modules/chromap/chromap/main.nf | 8 +++-- modules/chromap/index/main.nf | 1 + modules/gatk4/applybqsr/main.nf | 2 +- modules/gatk4/baserecalibrator/main.nf | 2 +- modules/gatk4/bedtointervallist/main.nf | 2 +- .../gatk4/createsequencedictionary/main.nf | 2 +- modules/gatk4/fastqtosam/main.nf | 2 +- modules/gatk4/getpileupsummaries/main.nf | 2 +- modules/gatk4/haplotypecaller/main.nf | 2 +- modules/gatk4/intervallisttools/main.nf | 2 +- modules/gatk4/markduplicates/main.nf | 2 +- modules/gatk4/mergebamalignment/main.nf | 2 +- modules/gatk4/mergevcfs/main.nf | 2 +- modules/gatk4/mutect2/main.nf | 2 +- modules/gatk4/revertsam/main.nf | 2 +- modules/gatk4/samtofastq/main.nf | 2 +- modules/gatk4/splitncigarreads/main.nf | 2 +- modules/gatk4/variantfiltration/main.nf | 2 +- modules/salmon/index/main.nf | 2 +- modules/salmon/quant/main.nf | 2 +- modules/samtools/ampliconclip/main.nf | 2 +- modules/samtools/faidx/main.nf | 2 +- modules/samtools/fastq/main.nf | 2 +- modules/samtools/flagstat/main.nf | 2 +- modules/samtools/idxstats/main.nf | 2 +- modules/samtools/index/main.nf | 2 +- modules/samtools/merge/main.nf | 2 +- modules/samtools/mpileup/main.nf | 2 +- modules/samtools/sort/main.nf | 2 +- modules/samtools/stats/main.nf | 2 +- modules/samtools/view/main.nf | 2 +- modules/trimgalore/main.nf | 6 ++-- tests/modules/bandage/image/main.nf | 8 ++--- tests/modules/bbmap/align/main.nf | 14 ++++----- tests/modules/bismark/align/test.yml | 4 +-- tests/modules/bismark/deduplicate/test.yml | 2 +- .../bismark/genomepreparation/test.yml | 2 +- .../bismark/methylationextractor/test.yml | 2 +- tests/modules/bismark/report/test.yml | 2 +- tests/modules/bismark/summary/test.yml | 2 +- tests/modules/bowtie/build_test/main.nf | 2 +- tests/modules/bowtie/build_test/test.yml | 12 ++++---- tests/modules/bowtie2/build_test/main.nf | 2 +- tests/modules/bowtie2/build_test/test.yml | 12 ++++---- tests/modules/bwa/index/main.nf | 2 +- tests/modules/bwa/index/test.yml | 10 +++---- tests/modules/bwamem2/index/main.nf | 2 +- tests/modules/bwamem2/index/test.yml | 10 +++---- tests/modules/bwameth/align/test.yml | 4 +-- tests/modules/bwameth/index/main.nf | 2 +- tests/modules/bwameth/index/test.yml | 14 ++++----- tests/modules/methyldackel/extract/test.yml | 2 +- tests/modules/methyldackel/mbias/test.yml | 2 +- tests/modules/minia/test.yml | 2 +- tests/modules/qualimap/bamqc/test.yml | 2 +- tests/modules/salmon/index/main.nf | 4 +-- tests/modules/salmon/index/test.yml | 30 +++++++++---------- tests/modules/samtools/faidx/test.yml | 2 +- 79 files changed, 159 insertions(+), 142 deletions(-) diff --git a/modules/abacas/main.nf b/modules/abacas/main.nf index 0e46f854..307e17d2 100644 --- a/modules/abacas/main.nf +++ b/modules/abacas/main.nf @@ -42,7 +42,7 @@ process ABACAS { mv unused_contigs.out ${prefix}.abacas.unused.contigs.out cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(abacas.pl -v 2>&1 | sed 's/^.*ABACAS.//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(abacas.pl -v 2>&1) | sed 's/^.*ABACAS.//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/agrvate/main.nf b/modules/agrvate/main.nf index 44ec0825..3ca2e0f4 100644 --- a/modules/agrvate/main.nf +++ b/modules/agrvate/main.nf @@ -36,7 +36,7 @@ process AGRVATE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(agrvate -v 2>&1 | sed 's/agrvate //;') + ${getSoftwareName(task.process)}: \$(echo \$(agrvate -v 2>&1) | sed 's/agrvate v//;') END_VERSIONS """ } diff --git a/modules/bandage/image/main.nf b/modules/bandage/image/main.nf index c788e2e1..d15d4826 100644 --- a/modules/bandage/image/main.nf +++ b/modules/bandage/image/main.nf @@ -35,7 +35,7 @@ process BANDAGE_IMAGE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(Bandage --version 2>&1 | sed 's/^.*Version: //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(Bandage --version 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/bismark/align/main.nf b/modules/bismark/align/main.nf index 00510272..ce042933 100644 --- a/modules/bismark/align/main.nf +++ b/modules/bismark/align/main.nf @@ -41,7 +41,7 @@ process BISMARK_ALIGN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') END_VERSIONS """ } diff --git a/modules/bismark/deduplicate/main.nf b/modules/bismark/deduplicate/main.nf index 6e3219f0..8555563d 100644 --- a/modules/bismark/deduplicate/main.nf +++ b/modules/bismark/deduplicate/main.nf @@ -38,7 +38,7 @@ process BISMARK_DEDUPLICATE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') END_VERSIONS """ } diff --git a/modules/bismark/genomepreparation/main.nf b/modules/bismark/genomepreparation/main.nf index 029804d9..0a3fae14 100644 --- a/modules/bismark/genomepreparation/main.nf +++ b/modules/bismark/genomepreparation/main.nf @@ -34,7 +34,7 @@ process BISMARK_GENOMEPREPARATION { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') END_VERSIONS """ } diff --git a/modules/bismark/methylationextractor/main.nf b/modules/bismark/methylationextractor/main.nf index 5968d38f..bafeaad6 100644 --- a/modules/bismark/methylationextractor/main.nf +++ b/modules/bismark/methylationextractor/main.nf @@ -45,7 +45,7 @@ process BISMARK_METHYLATIONEXTRACTOR { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') END_VERSIONS """ } diff --git a/modules/bismark/report/main.nf b/modules/bismark/report/main.nf index 8148b061..d7ab3e01 100644 --- a/modules/bismark/report/main.nf +++ b/modules/bismark/report/main.nf @@ -32,7 +32,7 @@ process BISMARK_REPORT { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') END_VERSIONS """ } diff --git a/modules/bowtie/align/main.nf b/modules/bowtie/align/main.nf index 3357a592..73554fa2 100644 --- a/modules/bowtie/align/main.nf +++ b/modules/bowtie/align/main.nf @@ -57,7 +57,7 @@ process BOWTIE_ALIGN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bowtie --version 2>&1 | sed 's/^.*bowtie-align-s version //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/bowtie/build/main.nf b/modules/bowtie/build/main.nf index 382e6717..3ae07729 100644 --- a/modules/bowtie/build/main.nf +++ b/modules/bowtie/build/main.nf @@ -32,7 +32,7 @@ process BOWTIE_BUILD { bowtie-build --threads $task.cpus $fasta bowtie/${fasta.baseName} cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bowtie --version 2>&1 | sed 's/^.*bowtie-align-s version //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/bowtie2/align/main.nf b/modules/bowtie2/align/main.nf index e1657a8f..7d33da03 100644 --- a/modules/bowtie2/align/main.nf +++ b/modules/bowtie2/align/main.nf @@ -39,7 +39,7 @@ process BOWTIE2_ALIGN { bowtie2 \\ -x \$INDEX \\ -U $reads \\ - --threads ${split_cpus} \\ + --threads $split_cpus \\ $unaligned \\ $options.args \\ 2> ${prefix}.bowtie2.log \\ @@ -47,7 +47,7 @@ process BOWTIE2_ALIGN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bowtie2 --version 2>&1 | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') END_VERSIONS """ } else { @@ -58,7 +58,7 @@ process BOWTIE2_ALIGN { -x \$INDEX \\ -1 ${reads[0]} \\ -2 ${reads[1]} \\ - --threads ${split_cpus} \\ + --threads $split_cpus \\ $unaligned \\ $options.args \\ 2> ${prefix}.bowtie2.log \\ @@ -72,7 +72,7 @@ process BOWTIE2_ALIGN { fi cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bowtie2 --version 2>&1 | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/bowtie2/build/main.nf b/modules/bowtie2/build/main.nf index 04880aeb..f140d7a4 100644 --- a/modules/bowtie2/build/main.nf +++ b/modules/bowtie2/build/main.nf @@ -32,7 +32,7 @@ process BOWTIE2_BUILD { bowtie2-build $options.args --threads $task.cpus $fasta bowtie2/${fasta.baseName} cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bowtie2 --version 2>&1 | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/bwa/aln/main.nf b/modules/bwa/aln/main.nf index 8728884c..ae4ee147 100644 --- a/modules/bwa/aln/main.nf +++ b/modules/bwa/aln/main.nf @@ -24,7 +24,7 @@ process BWA_ALN { output: tuple val(meta), path("*.sai"), emit: sai - path "versions.yml" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -43,7 +43,7 @@ process BWA_ALN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') END_VERSIONS """ } else { @@ -66,7 +66,7 @@ process BWA_ALN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') END_VERSIONS """ } diff --git a/modules/bwa/index/main.nf b/modules/bwa/index/main.nf index 9b64bd37..9de3fe0c 100644 --- a/modules/bwa/index/main.nf +++ b/modules/bwa/index/main.nf @@ -22,17 +22,22 @@ process BWA_INDEX { path fasta output: - path "bwa" , emit: index - path "versions.yml" , emit: version + path "bwa" , emit: index + path "versions.yml", emit: version script: def software = getSoftwareName(task.process) """ mkdir bwa - bwa index $options.args $fasta -p bwa/${fasta.baseName} + bwa \\ + index \\ + $options.args \\ + $fasta \\ + -p bwa/${fasta.baseName} + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') END_VERSIONS """ } diff --git a/modules/bwa/mem/main.nf b/modules/bwa/mem/main.nf index b9096cb8..05e5260c 100644 --- a/modules/bwa/mem/main.nf +++ b/modules/bwa/mem/main.nf @@ -37,14 +37,14 @@ process BWA_MEM { bwa mem \\ $options.args \\ $read_group \\ - -t ${split_cpus} \\ + -t $split_cpus \\ \$INDEX \\ $reads \\ | samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') END_VERSIONS """ } diff --git a/modules/bwa/sampe/main.nf b/modules/bwa/sampe/main.nf index cb3493c8..ae2998d8 100644 --- a/modules/bwa/sampe/main.nf +++ b/modules/bwa/sampe/main.nf @@ -43,7 +43,7 @@ process BWA_SAMPE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') END_VERSIONS """ } diff --git a/modules/bwa/samse/main.nf b/modules/bwa/samse/main.nf index 82d23854..89310153 100644 --- a/modules/bwa/samse/main.nf +++ b/modules/bwa/samse/main.nf @@ -43,7 +43,7 @@ process BWA_SAMSE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bwa 2>&1 | sed 's/^.*Version: //; s/Contact:.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') END_VERSIONS """ } diff --git a/modules/bwamem2/index/main.nf b/modules/bwamem2/index/main.nf index f052d172..9274ebe8 100644 --- a/modules/bwamem2/index/main.nf +++ b/modules/bwamem2/index/main.nf @@ -29,10 +29,14 @@ process BWAMEM2_INDEX { def software = getSoftwareName(task.process) """ mkdir bwamem2 - bwa-mem2 index $options.args $fasta -p bwamem2/${fasta} + bwa-mem2 \\ + index \\ + $options.args \\ + $fasta -p bwamem2/${fasta} + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bwa-mem2 version 2>&1) + ${getSoftwareName(task.process)}: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') END_VERSIONS """ } diff --git a/modules/bwamem2/mem/main.nf b/modules/bwamem2/mem/main.nf index 2838cdda..f47bfea3 100644 --- a/modules/bwamem2/mem/main.nf +++ b/modules/bwamem2/mem/main.nf @@ -34,17 +34,18 @@ process BWAMEM2_MEM { """ INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` - bwa-mem2 mem \\ + bwa-mem2 \\ + mem \\ $options.args \\ $read_group \\ - -t ${split_cpus} \\ + -t $split_cpus \\ \$INDEX \\ $reads \\ | samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bwa-mem2 version 2>&1) + ${getSoftwareName(task.process)}: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') END_VERSIONS """ } diff --git a/modules/bwameth/align/main.nf b/modules/bwameth/align/main.nf index 0f605bd1..814faa2b 100644 --- a/modules/bwameth/align/main.nf +++ b/modules/bwameth/align/main.nf @@ -44,7 +44,7 @@ process BWAMETH_ALIGN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bwameth.py --version 2>&1 | cut -f2 -d" ") + ${getSoftwareName(task.process)}: \$(echo \$(bwameth.py --version 2>&1) | cut -f2 -d" ") END_VERSIONS """ } diff --git a/modules/bwameth/index/main.nf b/modules/bwameth/index/main.nf index 7b75d328..a7a0b783 100644 --- a/modules/bwameth/index/main.nf +++ b/modules/bwameth/index/main.nf @@ -32,7 +32,7 @@ process BWAMETH_INDEX { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bwameth.py --version 2>&1 | cut -f2 -d" ") + ${getSoftwareName(task.process)}: \$(echo \$(bwameth.py --version 2>&1) | cut -f2 -d" ") END_VERSIONS """ } diff --git a/modules/chromap/chromap/main.nf b/modules/chromap/chromap/main.nf index cbee7fc0..193dfd5e 100644 --- a/modules/chromap/chromap/main.nf +++ b/modules/chromap/chromap/main.nf @@ -75,11 +75,13 @@ process CHROMAP_CHROMAP { -1 ${reads.join(',')} \\ -o ${prefix}.${file_extension} + $compression_cmds + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo "$VERSION") END_VERSIONS - """ + compression_cmds + """ } else { """ chromap ${args.join(' ')} \\ @@ -90,10 +92,12 @@ process CHROMAP_CHROMAP { -2 ${reads[1]} \\ -o ${prefix}.${file_extension} + $compression_cmds + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo "$VERSION") END_VERSIONS - """ + compression_cmds + """ } } diff --git a/modules/chromap/index/main.nf b/modules/chromap/index/main.nf index 764eefe1..e52ffe4b 100644 --- a/modules/chromap/index/main.nf +++ b/modules/chromap/index/main.nf @@ -35,6 +35,7 @@ process CHROMAP_INDEX { -t $task.cpus \\ -r $fasta \\ -o ${prefix}.index + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo "$VERSION") diff --git a/modules/gatk4/applybqsr/main.nf b/modules/gatk4/applybqsr/main.nf index 9c51ce60..91c23b29 100644 --- a/modules/gatk4/applybqsr/main.nf +++ b/modules/gatk4/applybqsr/main.nf @@ -44,7 +44,7 @@ process GATK4_APPLYBQSR { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/baserecalibrator/main.nf b/modules/gatk4/baserecalibrator/main.nf index 9abca6e9..2f368014 100644 --- a/modules/gatk4/baserecalibrator/main.nf +++ b/modules/gatk4/baserecalibrator/main.nf @@ -47,7 +47,7 @@ process GATK4_BASERECALIBRATOR { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/bedtointervallist/main.nf b/modules/gatk4/bedtointervallist/main.nf index fc484f84..28b88f5b 100644 --- a/modules/gatk4/bedtointervallist/main.nf +++ b/modules/gatk4/bedtointervallist/main.nf @@ -38,7 +38,7 @@ process GATK4_BEDTOINTERVALLIST { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/createsequencedictionary/main.nf b/modules/gatk4/createsequencedictionary/main.nf index 0c0446c6..b384d405 100644 --- a/modules/gatk4/createsequencedictionary/main.nf +++ b/modules/gatk4/createsequencedictionary/main.nf @@ -42,7 +42,7 @@ process GATK4_CREATESEQUENCEDICTIONARY { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/fastqtosam/main.nf b/modules/gatk4/fastqtosam/main.nf index e7b38f35..cb8ec0ea 100644 --- a/modules/gatk4/fastqtosam/main.nf +++ b/modules/gatk4/fastqtosam/main.nf @@ -38,7 +38,7 @@ process GATK4_FASTQTOSAM { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/getpileupsummaries/main.nf b/modules/gatk4/getpileupsummaries/main.nf index da03555c..782b7653 100644 --- a/modules/gatk4/getpileupsummaries/main.nf +++ b/modules/gatk4/getpileupsummaries/main.nf @@ -45,7 +45,7 @@ process GATK4_GETPILEUPSUMMARIES { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/haplotypecaller/main.nf b/modules/gatk4/haplotypecaller/main.nf index 02fd1ee3..63771393 100644 --- a/modules/gatk4/haplotypecaller/main.nf +++ b/modules/gatk4/haplotypecaller/main.nf @@ -49,7 +49,7 @@ process GATK4_HAPLOTYPECALLER { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/intervallisttools/main.nf b/modules/gatk4/intervallisttools/main.nf index 90a77c5a..99257354 100644 --- a/modules/gatk4/intervallisttools/main.nf +++ b/modules/gatk4/intervallisttools/main.nf @@ -50,7 +50,7 @@ process GATK4_INTERVALLISTTOOLS { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/markduplicates/main.nf b/modules/gatk4/markduplicates/main.nf index 68b17366..3a3c8e70 100644 --- a/modules/gatk4/markduplicates/main.nf +++ b/modules/gatk4/markduplicates/main.nf @@ -41,7 +41,7 @@ process GATK4_MARKDUPLICATES { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/mergebamalignment/main.nf b/modules/gatk4/mergebamalignment/main.nf index 269836a7..978b7cff 100644 --- a/modules/gatk4/mergebamalignment/main.nf +++ b/modules/gatk4/mergebamalignment/main.nf @@ -41,7 +41,7 @@ process GATK4_MERGEBAMALIGNMENT { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/mergevcfs/main.nf b/modules/gatk4/mergevcfs/main.nf index d47aa68f..c62a6289 100644 --- a/modules/gatk4/mergevcfs/main.nf +++ b/modules/gatk4/mergevcfs/main.nf @@ -46,7 +46,7 @@ process GATK4_MERGEVCFS { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/mutect2/main.nf b/modules/gatk4/mutect2/main.nf index 03bcc2d1..c4efc724 100644 --- a/modules/gatk4/mutect2/main.nf +++ b/modules/gatk4/mutect2/main.nf @@ -74,7 +74,7 @@ process GATK4_MUTECT2 { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/revertsam/main.nf b/modules/gatk4/revertsam/main.nf index e691d3f9..0a95b604 100644 --- a/modules/gatk4/revertsam/main.nf +++ b/modules/gatk4/revertsam/main.nf @@ -36,7 +36,7 @@ process GATK4_REVERTSAM { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/samtofastq/main.nf b/modules/gatk4/samtofastq/main.nf index edf895bb..eed7a83f 100644 --- a/modules/gatk4/samtofastq/main.nf +++ b/modules/gatk4/samtofastq/main.nf @@ -37,7 +37,7 @@ process GATK4_SAMTOFASTQ { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/splitncigarreads/main.nf b/modules/gatk4/splitncigarreads/main.nf index 11d6c9a5..0c4ba163 100644 --- a/modules/gatk4/splitncigarreads/main.nf +++ b/modules/gatk4/splitncigarreads/main.nf @@ -38,7 +38,7 @@ process GATK4_SPLITNCIGARREADS { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gatk4/variantfiltration/main.nf b/modules/gatk4/variantfiltration/main.nf index 90b6ef25..a79bce8f 100644 --- a/modules/gatk4/variantfiltration/main.nf +++ b/modules/gatk4/variantfiltration/main.nf @@ -41,7 +41,7 @@ process GATK4_VARIANTFILTRATION { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gatk --version 2>&1 | sed 's/^.*(GATK) v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/salmon/index/main.nf b/modules/salmon/index/main.nf index df4e2ed8..9e62eb8a 100644 --- a/modules/salmon/index/main.nf +++ b/modules/salmon/index/main.nf @@ -48,7 +48,7 @@ process SALMON_INDEX { -i salmon cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(salmon --version | sed -e "s/salmon //g") + ${getSoftwareName(task.process)}: \$(echo \$(salmon --version) | sed -e "s/salmon //g") END_VERSIONS """ } diff --git a/modules/salmon/quant/main.nf b/modules/salmon/quant/main.nf index 92d85f58..397bdd31 100644 --- a/modules/salmon/quant/main.nf +++ b/modules/salmon/quant/main.nf @@ -74,7 +74,7 @@ process SALMON_QUANT { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(salmon --version | sed -e "s/salmon //g") + ${getSoftwareName(task.process)}: \$(echo \$(salmon --version) | sed -e "s/salmon //g") END_VERSIONS """ } diff --git a/modules/samtools/ampliconclip/main.nf b/modules/samtools/ampliconclip/main.nf index 4a08026e..cccf2f7c 100644 --- a/modules/samtools/ampliconclip/main.nf +++ b/modules/samtools/ampliconclip/main.nf @@ -48,7 +48,7 @@ process SAMTOOLS_AMPLICONCLIP { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/samtools/faidx/main.nf b/modules/samtools/faidx/main.nf index fad14602..f7d6cbef 100644 --- a/modules/samtools/faidx/main.nf +++ b/modules/samtools/faidx/main.nf @@ -31,7 +31,7 @@ process SAMTOOLS_FAIDX { samtools faidx $fasta cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/samtools/fastq/main.nf b/modules/samtools/fastq/main.nf index 73d32db8..02110870 100644 --- a/modules/samtools/fastq/main.nf +++ b/modules/samtools/fastq/main.nf @@ -38,7 +38,7 @@ process SAMTOOLS_FASTQ { $bam cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/samtools/flagstat/main.nf b/modules/samtools/flagstat/main.nf index 70c04b23..d0cf86aa 100644 --- a/modules/samtools/flagstat/main.nf +++ b/modules/samtools/flagstat/main.nf @@ -31,7 +31,7 @@ process SAMTOOLS_FLAGSTAT { samtools flagstat $bam > ${bam}.flagstat cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/samtools/idxstats/main.nf b/modules/samtools/idxstats/main.nf index 33605f30..06a07964 100644 --- a/modules/samtools/idxstats/main.nf +++ b/modules/samtools/idxstats/main.nf @@ -31,7 +31,7 @@ process SAMTOOLS_IDXSTATS { samtools idxstats $bam > ${bam}.idxstats cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/samtools/index/main.nf b/modules/samtools/index/main.nf index 83802d95..c2ba4de7 100644 --- a/modules/samtools/index/main.nf +++ b/modules/samtools/index/main.nf @@ -32,7 +32,7 @@ process SAMTOOLS_INDEX { samtools index $options.args $bam cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/samtools/merge/main.nf b/modules/samtools/merge/main.nf index 85a41926..ec574105 100644 --- a/modules/samtools/merge/main.nf +++ b/modules/samtools/merge/main.nf @@ -32,7 +32,7 @@ process SAMTOOLS_MERGE { samtools merge ${prefix}.bam $bams cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/samtools/mpileup/main.nf b/modules/samtools/mpileup/main.nf index 28185934..903bfd33 100644 --- a/modules/samtools/mpileup/main.nf +++ b/modules/samtools/mpileup/main.nf @@ -37,7 +37,7 @@ process SAMTOOLS_MPILEUP { $bam cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/samtools/sort/main.nf b/modules/samtools/sort/main.nf index 4c3c4c1f..edd558bf 100644 --- a/modules/samtools/sort/main.nf +++ b/modules/samtools/sort/main.nf @@ -32,7 +32,7 @@ process SAMTOOLS_SORT { samtools sort $options.args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/samtools/stats/main.nf b/modules/samtools/stats/main.nf index b1fd325f..823b5f31 100644 --- a/modules/samtools/stats/main.nf +++ b/modules/samtools/stats/main.nf @@ -31,7 +31,7 @@ process SAMTOOLS_STATS { samtools stats $bam > ${bam}.stats cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/samtools/view/main.nf b/modules/samtools/view/main.nf index 824b9bab..110d5abf 100644 --- a/modules/samtools/view/main.nf +++ b/modules/samtools/view/main.nf @@ -32,7 +32,7 @@ process SAMTOOLS_VIEW { samtools view $options.args $bam > ${prefix}.bam cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/trimgalore/main.nf b/modules/trimgalore/main.nf index c002062a..6f5a65c2 100644 --- a/modules/trimgalore/main.nf +++ b/modules/trimgalore/main.nf @@ -62,7 +62,8 @@ process TRIMGALORE { ${prefix}.fastq.gz cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(trim_galore --version 2>&1 | sed 's/^.*version //; s/Last.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//') + cutadapt: \$(cutadapt --version) END_VERSIONS """ } else { @@ -82,7 +83,8 @@ process TRIMGALORE { ${prefix}_2.fastq.gz cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(trim_galore --version 2>&1 | sed 's/^.*version //; s/Last.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//') + cutadapt: \$(cutadapt --version) END_VERSIONS """ } diff --git a/tests/modules/bandage/image/main.nf b/tests/modules/bandage/image/main.nf index becfb450..524066b0 100644 --- a/tests/modules/bandage/image/main.nf +++ b/tests/modules/bandage/image/main.nf @@ -5,10 +5,10 @@ nextflow.enable.dsl = 2 include { BANDAGE_IMAGE } from '../../../../modules/bandage/image/main.nf' addParams( options: [:] ) workflow test_bandage_image { - input = [ [ id:'B-3106' ], // meta map - [ file("${launchDir}/tests/data/generic/gfa/B-3106.gfa", checkIfExists: true) ] - //[ file("${launchDir}/tests/data/genomics/sarscov2/genome/gfa/test.gfa", checkIfExists: true) ] - ] + input = [ + [ id:'B-3106' ], // meta map + file( params.test_data['sarscov2']['illumina']['assembly_gfa'], checkIfExists: true) + ] BANDAGE_IMAGE ( input ) } diff --git a/tests/modules/bbmap/align/main.nf b/tests/modules/bbmap/align/main.nf index 248e3975..c3bf43ba 100644 --- a/tests/modules/bbmap/align/main.nf +++ b/tests/modules/bbmap/align/main.nf @@ -7,11 +7,11 @@ include { BBMAP_ALIGN } from '../../../../modules/bbmap/align/main.nf' addParams include { BBMAP_ALIGN as BBMAP_ALIGN_PIGZ } from '../../../../modules/bbmap/align/main.nf' addParams( options: [args: "unpigz=t" ] ) workflow test_bbmap_align_paired_end_fasta_ref { - + input = [ [ id:'test', single_end:false ], // meta map [ file( params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file( params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + file( params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) @@ -20,11 +20,11 @@ workflow test_bbmap_align_paired_end_fasta_ref { } workflow test_bbmap_align_paired_end_index_ref { - + input = [ [ id:'test', single_end:false ], // meta map [ file( params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file( params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + file( params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) @@ -34,7 +34,7 @@ workflow test_bbmap_align_paired_end_index_ref { } workflow test_bbmap_align_single_end_index_ref { - + input = [ [ id:'test', single_end:true ], // meta map file( params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] @@ -45,11 +45,11 @@ workflow test_bbmap_align_single_end_index_ref { } workflow test_bbmap_align_paired_end_index_ref_pigz { - + input = [ [ id:'test', single_end:false ], // meta map [ file( params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file( params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + file( params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bismark/align/test.yml b/tests/modules/bismark/align/test.yml index 662a4aef..42dc44b3 100644 --- a/tests/modules/bismark/align/test.yml +++ b/tests/modules/bismark/align/test.yml @@ -1,4 +1,4 @@ -- name: Run bismark align single-end test workflow +- name: bismark align single-end test workflow command: nextflow run ./tests/modules/bismark/align -entry test_bismark_align_single_end -c tests/config/nextflow.config tags: - bismark @@ -8,7 +8,7 @@ md5sum: dca4ba9ff705b70446f812e59bdb1a32 - path: output/test_single_end/test.methylated_1_bismark_bt2_SE_report.txt -- name: Run bismark align paired-end test workflow +- name: bismark align paired-end test workflow command: nextflow run ./tests/modules/bismark/align -entry test_bismark_align_paired_end -c tests/config/nextflow.config tags: - bismark diff --git a/tests/modules/bismark/deduplicate/test.yml b/tests/modules/bismark/deduplicate/test.yml index b0fb858c..604c1023 100644 --- a/tests/modules/bismark/deduplicate/test.yml +++ b/tests/modules/bismark/deduplicate/test.yml @@ -1,4 +1,4 @@ -- name: Run bismark deduplicate test workflow +- name: bismark deduplicate test workflow command: nextflow run ./tests/modules/bismark/deduplicate -entry test_bismark_deduplicate -c tests/config/nextflow.config tags: - bismark diff --git a/tests/modules/bismark/genomepreparation/test.yml b/tests/modules/bismark/genomepreparation/test.yml index 5ce272c6..15a7e7d6 100644 --- a/tests/modules/bismark/genomepreparation/test.yml +++ b/tests/modules/bismark/genomepreparation/test.yml @@ -1,4 +1,4 @@ -- name: Run bismark_genomepreparation test workflow +- name: bismark genomepreparation test workflow command: nextflow run ./tests/modules/bismark/genomepreparation -entry test_bismark_genomepreparation -c tests/config/nextflow.config tags: - bismark diff --git a/tests/modules/bismark/methylationextractor/test.yml b/tests/modules/bismark/methylationextractor/test.yml index a64c1edf..4505c428 100644 --- a/tests/modules/bismark/methylationextractor/test.yml +++ b/tests/modules/bismark/methylationextractor/test.yml @@ -1,4 +1,4 @@ -- name: Run bismark methylation extractor test workflow +- name: bismark methylation extractor test workflow command: nextflow run ./tests/modules/bismark/methylationextractor -entry test_bismark_methylationextractor -c tests/config/nextflow.config tags: - bismark diff --git a/tests/modules/bismark/report/test.yml b/tests/modules/bismark/report/test.yml index 7025d38c..7e85e4dd 100644 --- a/tests/modules/bismark/report/test.yml +++ b/tests/modules/bismark/report/test.yml @@ -1,4 +1,4 @@ -- name: Run bismark report test workflow +- name: bismark report test workflow command: nextflow run ./tests/modules/bismark/report -entry test_bismark_report -c tests/config/nextflow.config tags: - bismark diff --git a/tests/modules/bismark/summary/test.yml b/tests/modules/bismark/summary/test.yml index ee438991..06478873 100644 --- a/tests/modules/bismark/summary/test.yml +++ b/tests/modules/bismark/summary/test.yml @@ -1,4 +1,4 @@ -- name: Run bismark summary test workflow +- name: bismark summary test workflow command: nextflow run ./tests/modules/bismark/summary -entry test_bismark_summary -c tests/config/nextflow.config tags: - bismark diff --git a/tests/modules/bowtie/build_test/main.nf b/tests/modules/bowtie/build_test/main.nf index 6796aad2..a89091a8 100644 --- a/tests/modules/bowtie/build_test/main.nf +++ b/tests/modules/bowtie/build_test/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BOWTIE_BUILD } from '../../../../modules/bowtie/build/main.nf' addParams( options: [:] ) +include { BOWTIE_BUILD } from '../../../../modules/bowtie/build/main.nf' addParams( options: [publish_dir:'bowtie'] ) workflow test_bowtie_build { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bowtie/build_test/test.yml b/tests/modules/bowtie/build_test/test.yml index 0ba58194..c6b765c9 100644 --- a/tests/modules/bowtie/build_test/test.yml +++ b/tests/modules/bowtie/build_test/test.yml @@ -4,15 +4,15 @@ - bowtie - bowtie/build files: - - path: ./output/index/bowtie/genome.3.ebwt + - path: ./output/bowtie/bowtie/genome.3.ebwt md5sum: 4ed93abba181d8dfab2e303e33114777 - - path: ./output/index/bowtie/genome.2.ebwt + - path: ./output/bowtie/bowtie/genome.2.ebwt md5sum: 02b44af9f94c62ecd3c583048e25d4cf - - path: ./output/index/bowtie/genome.rev.2.ebwt + - path: ./output/bowtie/bowtie/genome.rev.2.ebwt md5sum: 9e6b0c4c1ddb99ae71ff8a4fe5ec6459 - - path: ./output/index/bowtie/genome.4.ebwt + - path: ./output/bowtie/bowtie/genome.4.ebwt md5sum: c25be5f8b0378abf7a58c8a880b87626 - - path: ./output/index/bowtie/genome.rev.1.ebwt + - path: ./output/bowtie/bowtie/genome.rev.1.ebwt md5sum: b37aaf11853e65a3b13561f27a912b06 - - path: ./output/index/bowtie/genome.1.ebwt + - path: ./output/bowtie/bowtie/genome.1.ebwt md5sum: d9b76ecf9fd0413240173273b38d8199 diff --git a/tests/modules/bowtie2/build_test/main.nf b/tests/modules/bowtie2/build_test/main.nf index f1a95156..2b41fab2 100644 --- a/tests/modules/bowtie2/build_test/main.nf +++ b/tests/modules/bowtie2/build_test/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BOWTIE2_BUILD } from '../../../../modules/bowtie2/build/main.nf' addParams( options: [:] ) +include { BOWTIE2_BUILD } from '../../../../modules/bowtie2/build/main.nf' addParams( options: [publish_dir:'bowtie2'] ) workflow test_bowtie2_build { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bowtie2/build_test/test.yml b/tests/modules/bowtie2/build_test/test.yml index cb7283e3..3fd049b9 100644 --- a/tests/modules/bowtie2/build_test/test.yml +++ b/tests/modules/bowtie2/build_test/test.yml @@ -4,15 +4,15 @@ - bowtie2 - bowtie2/build files: - - path: ./output/index/bowtie2/genome.3.bt2 + - path: ./output/bowtie2/bowtie2/genome.3.bt2 md5sum: 4ed93abba181d8dfab2e303e33114777 - - path: ./output/index/bowtie2/genome.2.bt2 + - path: ./output/bowtie2/bowtie2/genome.2.bt2 md5sum: 47b153cd1319abc88dda532462651fcf - - path: ./output/index/bowtie2/genome.1.bt2 + - path: ./output/bowtie2/bowtie2/genome.1.bt2 md5sum: cbe3d0bbea55bc57c99b4bfa25b5fbdf - - path: ./output/index/bowtie2/genome.4.bt2 + - path: ./output/bowtie2/bowtie2/genome.4.bt2 md5sum: c25be5f8b0378abf7a58c8a880b87626 - - path: ./output/index/bowtie2/genome.rev.1.bt2 + - path: ./output/bowtie2/bowtie2/genome.rev.1.bt2 md5sum: 52be6950579598a990570fbcf5372184 - - path: ./output/index/bowtie2/genome.rev.2.bt2 + - path: ./output/bowtie2/bowtie2/genome.rev.2.bt2 md5sum: e3b4ef343dea4dd571642010a7d09597 diff --git a/tests/modules/bwa/index/main.nf b/tests/modules/bwa/index/main.nf index fa7fffbc..30d31202 100644 --- a/tests/modules/bwa/index/main.nf +++ b/tests/modules/bwa/index/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' addParams( options: [:] ) +include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' addParams( options: [publish_dir:'bwa'] ) workflow test_bwa_index { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bwa/index/test.yml b/tests/modules/bwa/index/test.yml index 58af27e3..cdcb5e53 100644 --- a/tests/modules/bwa/index/test.yml +++ b/tests/modules/bwa/index/test.yml @@ -4,13 +4,13 @@ - bwa - bwa/index files: - - path: ./output/index/bwa/genome.bwt + - path: ./output/bwa/bwa/genome.bwt md5sum: 0469c30a1e239dd08f68afe66fde99da - - path: ./output/index/bwa/genome.amb + - path: ./output/bwa/bwa/genome.amb md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e - - path: ./output/index/bwa/genome.sa + - path: ./output/bwa/bwa/genome.sa md5sum: ab3952cabf026b48cd3eb5bccbb636d1 - - path: ./output/index/bwa/genome.pac + - path: ./output/bwa/bwa/genome.pac md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 - - path: ./output/index/bwa/genome.ann + - path: ./output/bwa/bwa/genome.ann md5sum: c32e11f6c859f166c7525a9c1d583567 diff --git a/tests/modules/bwamem2/index/main.nf b/tests/modules/bwamem2/index/main.nf index 897a62fe..bb7d0803 100644 --- a/tests/modules/bwamem2/index/main.nf +++ b/tests/modules/bwamem2/index/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BWAMEM2_INDEX } from '../../../../modules/bwamem2/index/main.nf' addParams( options: [:] ) +include { BWAMEM2_INDEX } from '../../../../modules/bwamem2/index/main.nf' addParams( options: [publish_dir:'bwamem2'] ) workflow test_bwamem2_index { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bwamem2/index/test.yml b/tests/modules/bwamem2/index/test.yml index b71b6901..d9d15c53 100644 --- a/tests/modules/bwamem2/index/test.yml +++ b/tests/modules/bwamem2/index/test.yml @@ -4,13 +4,13 @@ - bwamem2 - bwamem2/index files: - - path: ./output/index/bwamem2/genome.fasta.amb + - path: ./output/bwamem2/bwamem2/genome.fasta.amb md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e - - path: ./output/index/bwamem2/genome.fasta.pac + - path: ./output/bwamem2/bwamem2/genome.fasta.pac md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 - - path: ./output/index/bwamem2/genome.fasta.0123 + - path: ./output/bwamem2/bwamem2/genome.fasta.0123 md5sum: b02870de80106104abcb03cd9463e7d8 - - path: ./output/index/bwamem2/genome.fasta.bwt.2bit.64 + - path: ./output/bwamem2/bwamem2/genome.fasta.bwt.2bit.64 md5sum: d097a1b82dee375d41a1ea69895a9216 - - path: ./output/index/bwamem2/genome.fasta.ann + - path: ./output/bwamem2/bwamem2/genome.fasta.ann md5sum: c32e11f6c859f166c7525a9c1d583567 diff --git a/tests/modules/bwameth/align/test.yml b/tests/modules/bwameth/align/test.yml index a7d9fdbc..8545972f 100644 --- a/tests/modules/bwameth/align/test.yml +++ b/tests/modules/bwameth/align/test.yml @@ -1,4 +1,4 @@ -- name: Run bwameth single-end test workflow +- name: bwameth align single-end test workflow command: nextflow run ./tests/modules/bwameth/align -entry test_bwameth_align_single_end -c tests/config/nextflow.config tags: - bwameth @@ -6,7 +6,7 @@ files: - path: output/test_single_end/test.bam -- name: Run bwameth paired-end test workflow +- name: bwameth align paired-end test workflow command: nextflow run ./tests/modules/bwameth/align -entry test_bwameth_align_paired_end -c tests/config/nextflow.config tags: - bwameth diff --git a/tests/modules/bwameth/index/main.nf b/tests/modules/bwameth/index/main.nf index 17477ca0..46662201 100644 --- a/tests/modules/bwameth/index/main.nf +++ b/tests/modules/bwameth/index/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BWAMETH_INDEX } from '../../../../modules/bwameth/index/main.nf' addParams( options: [:] ) +include { BWAMETH_INDEX } from '../../../../modules/bwameth/index/main.nf' addParams( options: [publish_dir:'bwameth'] ) workflow test_bwameth_index { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bwameth/index/test.yml b/tests/modules/bwameth/index/test.yml index 5a2595d8..0cc7922e 100644 --- a/tests/modules/bwameth/index/test.yml +++ b/tests/modules/bwameth/index/test.yml @@ -1,18 +1,18 @@ -- name: Run bwameth index test workflow +- name: bwameth index test workflow command: nextflow run ./tests/modules/bwameth/index -entry test_bwameth_index -c tests/config/nextflow.config tags: - bwameth - bwameth/index files: - - path: ./output/index/bwameth/genome.fasta.bwameth.c2t + - path: ./output/bwameth/bwameth/genome.fasta.bwameth.c2t md5sum: 98039984526a41d04d6bd92fcc040c62 - - path: ./output/index/bwameth/genome.fasta.bwameth.c2t.pac + - path: ./output/bwameth/bwameth/genome.fasta.bwameth.c2t.pac md5sum: 4d8e51cb0bbdeaf24576bdf0264d8653 - - path: ./output/index/bwameth/genome.fasta.bwameth.c2t.amb + - path: ./output/bwameth/bwameth/genome.fasta.bwameth.c2t.amb md5sum: 249a4195069071ce47cd0bae68abe376 - - path: ./output/index/bwameth/genome.fasta.bwameth.c2t.ann + - path: ./output/bwameth/bwameth/genome.fasta.bwameth.c2t.ann md5sum: 46524d4359dcdfb203a235ab3b930dbb - - path: ./output/index/bwameth/genome.fasta.bwameth.c2t.bwt + - path: ./output/bwameth/bwameth/genome.fasta.bwameth.c2t.bwt md5sum: 84f65df7d42dbe84c9ccfaddfdd5ea6b - - path: ./output/index/bwameth/genome.fasta.bwameth.c2t.sa + - path: ./output/bwameth/bwameth/genome.fasta.bwameth.c2t.sa md5sum: d25f6486f5134f57ed5b258f6fbb8673 diff --git a/tests/modules/methyldackel/extract/test.yml b/tests/modules/methyldackel/extract/test.yml index e2494181..70c371d7 100644 --- a/tests/modules/methyldackel/extract/test.yml +++ b/tests/modules/methyldackel/extract/test.yml @@ -1,4 +1,4 @@ -- name: Run methyldackel extract test workflow +- name: methyldackel extract command: nextflow run ./tests/modules/methyldackel/extract -entry test_methyldackel_extract -c tests/config/nextflow.config tags: - methyldackel diff --git a/tests/modules/methyldackel/mbias/test.yml b/tests/modules/methyldackel/mbias/test.yml index 37102aec..43074291 100644 --- a/tests/modules/methyldackel/mbias/test.yml +++ b/tests/modules/methyldackel/mbias/test.yml @@ -1,4 +1,4 @@ -- name: Run methyldackel mbias test workflow +- name: methyldackel mbias command: nextflow run ./tests/modules/methyldackel/mbias -entry test_methyldackel_mbias -c tests/config/nextflow.config tags: - methyldackel diff --git a/tests/modules/minia/test.yml b/tests/modules/minia/test.yml index d4e84e52..6836f51d 100644 --- a/tests/modules/minia/test.yml +++ b/tests/modules/minia/test.yml @@ -1,4 +1,4 @@ -- name: Run tests for minia - test_minia +- name: minia command: nextflow run tests/modules/minia -entry test_minia -c tests/config/nextflow.config tags: - minia diff --git a/tests/modules/qualimap/bamqc/test.yml b/tests/modules/qualimap/bamqc/test.yml index 704c08b2..71a40c13 100644 --- a/tests/modules/qualimap/bamqc/test.yml +++ b/tests/modules/qualimap/bamqc/test.yml @@ -1,4 +1,4 @@ -- name: Run qualimap bamqc test workflow +- name: qualimap bamqc test workflow command: nextflow run ./tests/modules/qualimap/bamqc -entry test_qualimap_bamqc -c tests/config/nextflow.config tags: - qualimap diff --git a/tests/modules/salmon/index/main.nf b/tests/modules/salmon/index/main.nf index d4c87c45..98804733 100644 --- a/tests/modules/salmon/index/main.nf +++ b/tests/modules/salmon/index/main.nf @@ -2,11 +2,11 @@ nextflow.enable.dsl = 2 -include { SALMON_INDEX } from '../../../../modules/salmon/index/main.nf' addParams( options: [:] ) +include { SALMON_INDEX } from '../../../../modules/salmon/index/main.nf' addParams( options: [publish_dir:'salmon'] ) workflow test_salmon_index { genome_fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) transcript_fasta = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) - + SALMON_INDEX ( genome_fasta, transcript_fasta ) } diff --git a/tests/modules/salmon/index/test.yml b/tests/modules/salmon/index/test.yml index 156bc5ca..acefb044 100644 --- a/tests/modules/salmon/index/test.yml +++ b/tests/modules/salmon/index/test.yml @@ -4,28 +4,28 @@ - salmon - salmon/index files: - - path: ./output/index/salmon/ref_indexing.log - - path: ./output/index/salmon/refseq.bin + - path: ./output/salmon/salmon/ref_indexing.log + - path: ./output/salmon/salmon/refseq.bin md5sum: 79c4ddf34be3a98d5a7b9d153629a6f7 - - path: ./output/index/salmon/versionInfo.json + - path: ./output/salmon/salmon/versionInfo.json md5sum: 6c764bd219b7bc17168a99d232c0fe09 - - path: ./output/index/salmon/complete_ref_lens.bin + - path: ./output/salmon/salmon/complete_ref_lens.bin md5sum: f57562f1fca3ae7b133f895ae13c3d08 - - path: ./output/index/salmon/mphf.bin + - path: ./output/salmon/salmon/mphf.bin md5sum: 53669a47610e33e031faafd32703b714 - - path: ./output/index/salmon/pre_indexing.log - - path: ./output/index/salmon/ctable.bin - - path: ./output/index/salmon/duplicate_clusters.tsv + - path: ./output/salmon/salmon/pre_indexing.log + - path: ./output/salmon/salmon/ctable.bin + - path: ./output/salmon/salmon/duplicate_clusters.tsv md5sum: 51b5292e3a874119c0e1aa566e95d70c - - path: ./output/index/salmon/reflengths.bin + - path: ./output/salmon/salmon/reflengths.bin md5sum: f57562f1fca3ae7b133f895ae13c3d08 - - path: ./output/index/salmon/info.json + - path: ./output/salmon/salmon/info.json md5sum: 61ff4d3471134c280668355ddd39e99f - - path: ./output/index/salmon/refAccumLengths.bin + - path: ./output/salmon/salmon/refAccumLengths.bin md5sum: 8d1970505b2b08ca0eb5ff7722b48cde - - path: ./output/index/salmon/ctg_offsets.bin + - path: ./output/salmon/salmon/ctg_offsets.bin md5sum: 27a76542337df436436e66017f66dd25 - - path: ./output/index/salmon/rank.bin + - path: ./output/salmon/salmon/rank.bin md5sum: 3f34dca1ec26cdf89a6d19b1d1c07e71 - - path: ./output/index/salmon/pos.bin - - path: ./output/index/salmon/seq.bin + - path: ./output/salmon/salmon/pos.bin + - path: ./output/salmon/salmon/seq.bin diff --git a/tests/modules/samtools/faidx/test.yml b/tests/modules/samtools/faidx/test.yml index bcadf955..49a92265 100644 --- a/tests/modules/samtools/faidx/test.yml +++ b/tests/modules/samtools/faidx/test.yml @@ -1,4 +1,4 @@ -- name: Run samtools faidx test workflow +- name: samtools faidx test workflow command: nextflow run tests/modules/samtools/faidx -entry test_samtools_faidx -c tests/config/nextflow.config tags: - samtools From 3c5492b4a383ebd822422804d74cc9e15a747b0d Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Tue, 28 Sep 2021 06:56:27 +0100 Subject: [PATCH 07/61] Fix more version commands (#750) * Fix outstanding tests * Fix more version commands * Fix remaining modules --- modules/bismark/summary/main.nf | 2 +- modules/chromap/chromap/main.nf | 2 +- modules/graphmap2/align/main.nf | 2 +- modules/graphmap2/index/main.nf | 2 +- modules/gunzip/main.nf | 8 ++- modules/ivar/consensus/main.nf | 2 +- modules/ivar/trim/main.nf | 2 +- modules/ivar/variants/main.nf | 2 +- modules/kraken2/kraken2/main.nf | 2 +- modules/lofreq/call/main.nf | 2 +- modules/lofreq/callparallel/main.nf | 2 +- modules/lofreq/filter/main.nf | 2 +- modules/lofreq/indelqual/main.nf | 2 +- modules/minia/main.nf | 2 +- modules/preseq/lcextrap/main.nf | 2 +- modules/qualimap/bamqc/main.nf | 2 +- modules/tabix/bgzip/main.nf | 2 +- modules/tabix/bgziptabix/main.nf | 2 +- modules/tabix/tabix/main.nf | 2 +- modules/ucsc/wigtobigwig/main.nf | 4 +- modules/untar/main.nf | 12 +++-- modules/unzip/main.nf | 2 +- tests/modules/bwa/sampe/main.nf | 15 ++++-- tests/modules/bwa/samse/main.nf | 13 +++-- tests/modules/bwameth/align/main.nf | 9 ++-- tests/modules/bwameth/align/test.yml | 4 +- tests/modules/genmap/index/main.nf | 2 +- tests/modules/genmap/index/test.yml | 42 +++++++-------- tests/modules/ivar/trim/test.yml | 2 +- tests/modules/qualimap/bamqc/test.yml | 2 +- .../modules/rsem/calculateexpression/main.nf | 17 +++--- tests/modules/rsem/preparereference/main.nf | 2 +- tests/modules/rsem/preparereference/test.yml | 16 +++--- tests/modules/star/genomegenerate/main.nf | 2 +- tests/modules/star/genomegenerate/test.yml | 32 +++++------ tests/modules/stringtie/merge/main.nf | 54 +++++++++++-------- tests/modules/stringtie/merge/test.yml | 8 +-- tests/modules/stringtie/stringtie/main.nf | 24 +++++---- tests/modules/stringtie/stringtie/test.yml | 36 ++++++------- 39 files changed, 185 insertions(+), 157 deletions(-) diff --git a/modules/bismark/summary/main.nf b/modules/bismark/summary/main.nf index ae8ac27c..d71772b3 100644 --- a/modules/bismark/summary/main.nf +++ b/modules/bismark/summary/main.nf @@ -35,7 +35,7 @@ process BISMARK_SUMMARY { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bismark -v 2>&1 | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') END_VERSIONS """ } diff --git a/modules/chromap/chromap/main.nf b/modules/chromap/chromap/main.nf index 193dfd5e..00aae27e 100644 --- a/modules/chromap/chromap/main.nf +++ b/modules/chromap/chromap/main.nf @@ -4,7 +4,7 @@ include { initOptions; saveFiles; getSoftwareName; getProcessName } from './func params.options = [:] options = initOptions(params.options) -def VERSION = 0.1 // No version information printed +def VERSION = '0.1' // No version information printed process CHROMAP_CHROMAP { tag "$meta.id" diff --git a/modules/graphmap2/align/main.nf b/modules/graphmap2/align/main.nf index cf598b3d..30d6cbfd 100644 --- a/modules/graphmap2/align/main.nf +++ b/modules/graphmap2/align/main.nf @@ -43,7 +43,7 @@ process GRAPHMAP2_ALIGN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(graphmap2 align 2>&1 | sed 's/^.*Version: v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/graphmap2/index/main.nf b/modules/graphmap2/index/main.nf index 906aa6ec..194c3594 100644 --- a/modules/graphmap2/index/main.nf +++ b/modules/graphmap2/index/main.nf @@ -36,7 +36,7 @@ process GRAPHMAP2_INDEX { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(graphmap2 align 2>&1 | sed 's/^.*Version: v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/gunzip/main.nf b/modules/gunzip/main.nf index a53a9858..6a2287b6 100644 --- a/modules/gunzip/main.nf +++ b/modules/gunzip/main.nf @@ -29,10 +29,14 @@ process GUNZIP { def software = getSoftwareName(task.process) gunzip = archive.toString() - '.gz' """ - gunzip -f $options.args $archive + gunzip \\ + -f \\ + $options.args \\ + $archive + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(gunzip --version 2>&1 | sed 's/^.*(gzip) //; s/ Copyright.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//') END_VERSIONS """ } diff --git a/modules/ivar/consensus/main.nf b/modules/ivar/consensus/main.nf index 7c4a5b57..b29450b7 100644 --- a/modules/ivar/consensus/main.nf +++ b/modules/ivar/consensus/main.nf @@ -44,7 +44,7 @@ process IVAR_CONSENSUS { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(ivar version 2>&1 | sed 's/^.*iVar version //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(ivar version 2>&1) | sed 's/^.*iVar version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/ivar/trim/main.nf b/modules/ivar/trim/main.nf index e9b1e23b..2a698249 100644 --- a/modules/ivar/trim/main.nf +++ b/modules/ivar/trim/main.nf @@ -40,7 +40,7 @@ process IVAR_TRIM { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(ivar version 2>&1 | sed 's/^.*iVar version //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(ivar version 2>&1) | sed 's/^.*iVar version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/ivar/variants/main.nf b/modules/ivar/variants/main.nf index 505d72fb..2bf82a37 100644 --- a/modules/ivar/variants/main.nf +++ b/modules/ivar/variants/main.nf @@ -47,7 +47,7 @@ process IVAR_VARIANTS { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(ivar version 2>&1 | sed 's/^.*iVar version //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(ivar version 2>&1) | sed 's/^.*iVar version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/kraken2/kraken2/main.nf b/modules/kraken2/kraken2/main.nf index 9a01389a..4000d12a 100644 --- a/modules/kraken2/kraken2/main.nf +++ b/modules/kraken2/kraken2/main.nf @@ -50,7 +50,7 @@ process KRAKEN2_KRAKEN2 { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(kraken2 --version 2>&1 | sed 's/^.*Kraken version //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(kraken2 --version 2>&1) | sed 's/^.*Kraken version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/lofreq/call/main.nf b/modules/lofreq/call/main.nf index b205f041..9fb113ff 100644 --- a/modules/lofreq/call/main.nf +++ b/modules/lofreq/call/main.nf @@ -39,7 +39,7 @@ process LOFREQ_CALL { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(lofreq version 2>&1 | sed 's/^version: //; s/ *commit.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//') END_VERSIONS """ } diff --git a/modules/lofreq/callparallel/main.nf b/modules/lofreq/callparallel/main.nf index 2bea68f2..42400793 100644 --- a/modules/lofreq/callparallel/main.nf +++ b/modules/lofreq/callparallel/main.nf @@ -41,7 +41,7 @@ process LOFREQ_CALLPARALLEL { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(lofreq version 2>&1 | sed 's/^version: //; s/ *commit.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//') END_VERSIONS """ } diff --git a/modules/lofreq/filter/main.nf b/modules/lofreq/filter/main.nf index 693cef23..09c91c8c 100644 --- a/modules/lofreq/filter/main.nf +++ b/modules/lofreq/filter/main.nf @@ -37,7 +37,7 @@ process LOFREQ_FILTER { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(lofreq version 2>&1 | sed 's/^version: //; s/ *commit.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//') END_VERSIONS """ } diff --git a/modules/lofreq/indelqual/main.nf b/modules/lofreq/indelqual/main.nf index 89c79c39..78466574 100644 --- a/modules/lofreq/indelqual/main.nf +++ b/modules/lofreq/indelqual/main.nf @@ -37,7 +37,7 @@ process LOFREQ_INDELQUAL { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(lofreq version 2>&1 | sed 's/^.*lofreq //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//') END_VERSIONS """ } diff --git a/modules/minia/main.nf b/modules/minia/main.nf index b7aa9272..518e8264 100644 --- a/modules/minia/main.nf +++ b/modules/minia/main.nf @@ -40,7 +40,7 @@ process MINIA { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(minia --version 2>&1 | sed 's/^.*Minia version //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(minia --version 2>&1) | sed 's/^.*Minia version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/preseq/lcextrap/main.nf b/modules/preseq/lcextrap/main.nf index 059b81f6..69f682d3 100644 --- a/modules/preseq/lcextrap/main.nf +++ b/modules/preseq/lcextrap/main.nf @@ -42,7 +42,7 @@ process PRESEQ_LCEXTRAP { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(preseq 2>&1 | sed 's/^.*Version: //; s/Usage:.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//') END_VERSIONS """ } diff --git a/modules/qualimap/bamqc/main.nf b/modules/qualimap/bamqc/main.nf index 17779e27..0cc101ef 100644 --- a/modules/qualimap/bamqc/main.nf +++ b/modules/qualimap/bamqc/main.nf @@ -58,7 +58,7 @@ process QUALIMAP_BAMQC { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(qualimap 2>&1 | sed 's/^.*QualiMap v.//; s/Built.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//') END_VERSIONS """ } diff --git a/modules/tabix/bgzip/main.nf b/modules/tabix/bgzip/main.nf index eb95de62..c76588df 100644 --- a/modules/tabix/bgzip/main.nf +++ b/modules/tabix/bgzip/main.nf @@ -33,7 +33,7 @@ process TABIX_BGZIP { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(tabix -h 2>&1 | sed 's/^.*Version: //; s/(.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/tabix/bgziptabix/main.nf b/modules/tabix/bgziptabix/main.nf index 7179a97e..302c8500 100644 --- a/modules/tabix/bgziptabix/main.nf +++ b/modules/tabix/bgziptabix/main.nf @@ -34,7 +34,7 @@ process TABIX_BGZIPTABIX { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(tabix -h 2>&1 | sed 's/^.*Version: //; s/(.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/tabix/tabix/main.nf b/modules/tabix/tabix/main.nf index f703a787..1fabeba4 100644 --- a/modules/tabix/tabix/main.nf +++ b/modules/tabix/tabix/main.nf @@ -32,7 +32,7 @@ process TABIX_TABIX { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(tabix -h 2>&1 | sed 's/^.*Version: //; s/(.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/ucsc/wigtobigwig/main.nf b/modules/ucsc/wigtobigwig/main.nf index 945f07c9..29e5cd99 100644 --- a/modules/ucsc/wigtobigwig/main.nf +++ b/modules/ucsc/wigtobigwig/main.nf @@ -4,6 +4,8 @@ include { initOptions; saveFiles; getSoftwareName; getProcessName } from './func params.options = [:] options = initOptions(params.options) +def VERSION = '377' // No version information printed + process UCSC_WIGTOBIGWIG { tag '$wig' label 'process_medium' @@ -38,7 +40,7 @@ process UCSC_WIGTOBIGWIG { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(wigToBigWig 2>&1 | sed 's/wigToBigWig v //; s/ - Convert.*\$//') + ${getSoftwareName(task.process)}: \$(echo "$VERSION") END_VERSIONS """ } diff --git a/modules/untar/main.nf b/modules/untar/main.nf index 25b39904..0866dd55 100644 --- a/modules/untar/main.nf +++ b/modules/untar/main.nf @@ -22,17 +22,21 @@ process UNTAR { path archive output: - path "$untar" , emit: untar - path "versions.yml" , emit: version + path "$untar" , emit: untar + path "versions.yml", emit: version script: def software = getSoftwareName(task.process) untar = archive.toString() - '.tar.gz' """ - tar -xzvf $options.args $archive + tar \\ + -xzvf \\ + $options.args \\ + $archive + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(tar --version 2>&1 | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//') END_VERSIONS """ } diff --git a/modules/unzip/main.nf b/modules/unzip/main.nf index a2fe2594..9e64bb1b 100644 --- a/modules/unzip/main.nf +++ b/modules/unzip/main.nf @@ -40,7 +40,7 @@ process UNZIP { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - 7za: \$( 7za --help) grep Version | sed 's/.*p7zip Version//; s/(.*//' ) + 7za: \$(echo \$(7za --help) | sed 's/.*p7zip Version //; s/(.*//') END_VERSIONS """ } diff --git a/tests/modules/bwa/sampe/main.nf b/tests/modules/bwa/sampe/main.nf index 86b019b5..017f27e5 100644 --- a/tests/modules/bwa/sampe/main.nf +++ b/tests/modules/bwa/sampe/main.nf @@ -3,18 +3,23 @@ nextflow.enable.dsl = 2 include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' addParams( options: [:] ) -include { BWA_ALN } from '../../../../modules/bwa/aln/main.nf' addParams( options: [:] ) +include { BWA_ALN } from '../../../../modules/bwa/aln/main.nf' addParams( options: [:] ) include { BWA_SAMPE } from '../../../../modules/bwa/sampe/main.nf' addParams( options: [:] ) workflow test_bwa_sampe { - input = [ [ id:'test', single_end:false ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + Channel + .fromList( + [ + [ id:'test', single_end:false ], + [ [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] ] ] + ).collect() + .set { input } fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) BWA_INDEX ( fasta ) BWA_ALN ( input, BWA_INDEX.out.index ) - BWA_SAMPE ( BWA_ALN.out.sai, BWA_INDEX.out.index ) + BWA_SAMPE ( input.join(BWA_ALN.out.sai), BWA_INDEX.out.index ) } diff --git a/tests/modules/bwa/samse/main.nf b/tests/modules/bwa/samse/main.nf index 5a5d8d2b..87a7c7b1 100644 --- a/tests/modules/bwa/samse/main.nf +++ b/tests/modules/bwa/samse/main.nf @@ -3,17 +3,20 @@ nextflow.enable.dsl = 2 include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' addParams( options: [:] ) -include { BWA_ALN } from '../../../../modules/bwa/aln/main.nf' addParams( options: [:] ) +include { BWA_ALN } from '../../../../modules/bwa/aln/main.nf' addParams( options: [:] ) include { BWA_SAMSE } from '../../../../modules/bwa/samse/main.nf' addParams( options: [:] ) workflow test_bwa_samse { - input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] - ] + Channel + .fromList( + [ [ id:'test', single_end:true ], + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ).collect() + .set { input } fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) BWA_INDEX ( fasta ) BWA_ALN ( input, BWA_INDEX.out.index ) - BWA_SAMSE ( BWA_ALN.out.sai, BWA_INDEX.out.index ) + BWA_SAMSE ( input.join(BWA_ALN.out.sai, by:[0]), BWA_INDEX.out.index ) } diff --git a/tests/modules/bwameth/align/main.nf b/tests/modules/bwameth/align/main.nf index 7a7aa99c..fb8cad6a 100644 --- a/tests/modules/bwameth/align/main.nf +++ b/tests/modules/bwameth/align/main.nf @@ -2,9 +2,8 @@ nextflow.enable.dsl = 2 -include { BWAMETH_INDEX } from '../../../../modules/bwameth/index/main.nf' addParams( options: [:] ) -include { BWAMETH_ALIGN as BWAMETH_ALIGN_SE } from '../../../../modules/bwameth/align/main.nf' addParams( options: [ publish_dir:'test_single_end' ] ) -include { BWAMETH_ALIGN as BWAMETH_ALIGN_PE } from '../../../../modules/bwameth/align/main.nf' addParams( options: [ publish_dir:'test_paired_end' ] ) +include { BWAMETH_INDEX } from '../../../../modules/bwameth/index/main.nf' addParams( options: [:] ) +include { BWAMETH_ALIGN } from '../../../../modules/bwameth/align/main.nf' addParams( options: [:] ) // // Test with single-end data @@ -16,7 +15,7 @@ workflow test_bwameth_align_single_end { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) BWAMETH_INDEX ( fasta ) - BWAMETH_ALIGN_SE ( input, BWAMETH_INDEX.out.index ) + BWAMETH_ALIGN ( input, BWAMETH_INDEX.out.index ) } // @@ -30,5 +29,5 @@ workflow test_bwameth_align_paired_end { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) BWAMETH_INDEX ( fasta ) - BWAMETH_ALIGN_PE ( input, BWAMETH_INDEX.out.index ) + BWAMETH_ALIGN ( input, BWAMETH_INDEX.out.index ) } diff --git a/tests/modules/bwameth/align/test.yml b/tests/modules/bwameth/align/test.yml index 8545972f..5cf4b84d 100644 --- a/tests/modules/bwameth/align/test.yml +++ b/tests/modules/bwameth/align/test.yml @@ -4,7 +4,7 @@ - bwameth - bwameth/align files: - - path: output/test_single_end/test.bam + - path: output/bwameth/test.bam - name: bwameth align paired-end test workflow command: nextflow run ./tests/modules/bwameth/align -entry test_bwameth_align_paired_end -c tests/config/nextflow.config @@ -12,5 +12,5 @@ - bwameth - bwameth/align files: - - path: output/test_paired_end/test.bam + - path: output/bwameth/test.bam diff --git a/tests/modules/genmap/index/main.nf b/tests/modules/genmap/index/main.nf index dfbdbbed..358ebb35 100644 --- a/tests/modules/genmap/index/main.nf +++ b/tests/modules/genmap/index/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { GENMAP_INDEX } from '../../../../modules/genmap/index/main.nf' addParams( options: [:] ) +include { GENMAP_INDEX } from '../../../../modules/genmap/index/main.nf' addParams( options: [publish_dir:'genmap'] ) workflow test_genmap_index { diff --git a/tests/modules/genmap/index/test.yml b/tests/modules/genmap/index/test.yml index 8b06e75e..c5078014 100644 --- a/tests/modules/genmap/index/test.yml +++ b/tests/modules/genmap/index/test.yml @@ -4,45 +4,45 @@ - genmap - genmap/index files: - - path: output/index/genmap/index.ids.concat + - path: output/genmap/genmap/index.ids.concat md5sum: da6caa25f62c5407ccdfbcce1fa92408 - - path: output/index/genmap/index.ids.limits + - path: output/genmap/genmap/index.ids.limits md5sum: f82636c5da188aec131d3a809473eff1 - - path: output/index/genmap/index.info.concat + - path: output/genmap/genmap/index.info.concat md5sum: 8ba5273aa9e58722bf45b9cc39fc6bfe - - path: output/index/genmap/index.info.limits + - path: output/genmap/genmap/index.info.limits md5sum: 3522f2811f4ddf04598809fc84a1459e - - path: output/index/genmap/index.lf.drp + - path: output/genmap/genmap/index.lf.drp md5sum: dd85d6a23af2c7adf2695658e3056c08 - - path: output/index/genmap/index.lf.drp.sbl + - path: output/genmap/genmap/index.lf.drp.sbl md5sum: f1d3ff8443297732862df21dc4e57262 - - path: output/index/genmap/index.lf.drs + - path: output/genmap/genmap/index.lf.drs md5sum: 93b885adfe0da089cdf634904fd59f71 - - path: output/index/genmap/index.lf.drv + - path: output/genmap/genmap/index.lf.drv md5sum: e06b605496bd91b32afa3c4f56d934ac - - path: output/index/genmap/index.lf.drv.sbl + - path: output/genmap/genmap/index.lf.drv.sbl md5sum: 8dd6bb7329a71449b0a1b292b5999164 - - path: output/index/genmap/index.lf.pst + - path: output/genmap/genmap/index.lf.pst md5sum: e8daba34298e99e42942435286f9b3f0 - - path: output/index/genmap/index.rev.lf.drp + - path: output/genmap/genmap/index.rev.lf.drp md5sum: 5d9107e3aeec0721553dd661d4365fef - - path: output/index/genmap/index.rev.lf.drp.sbl + - path: output/genmap/genmap/index.rev.lf.drp.sbl md5sum: f1d3ff8443297732862df21dc4e57262 - - path: output/index/genmap/index.rev.lf.drs + - path: output/genmap/genmap/index.rev.lf.drs md5sum: 93b885adfe0da089cdf634904fd59f71 - - path: output/index/genmap/index.rev.lf.drv + - path: output/genmap/genmap/index.rev.lf.drv md5sum: df7e795edc0a034577a9d2599fe8cfeb - - path: output/index/genmap/index.rev.lf.drv.sbl + - path: output/genmap/genmap/index.rev.lf.drv.sbl md5sum: 8dd6bb7329a71449b0a1b292b5999164 - - path: output/index/genmap/index.rev.lf.pst + - path: output/genmap/genmap/index.rev.lf.pst md5sum: e8daba34298e99e42942435286f9b3f0 - - path: output/index/genmap/index.sa.ind + - path: output/genmap/genmap/index.sa.ind md5sum: e21e5c7ce887cc8e3d0fa44ab1019cab - - path: output/index/genmap/index.sa.len + - path: output/genmap/genmap/index.sa.len md5sum: 5dfc20cfe8ed9892451461a8d402f51c - - path: output/index/genmap/index.sa.val + - path: output/genmap/genmap/index.sa.val md5sum: 400ee7f2fe93b2000ae3a5da5e509730 - - path: output/index/genmap/index.txt.concat + - path: output/genmap/genmap/index.txt.concat md5sum: b4303962e0c176107945f3405370e6ae - - path: output/index/genmap/index.txt.limits + - path: output/genmap/genmap/index.txt.limits md5sum: 4480a068db603e4c9a27bc4fa9ceaf14 diff --git a/tests/modules/ivar/trim/test.yml b/tests/modules/ivar/trim/test.yml index 013c6365..f2f46676 100644 --- a/tests/modules/ivar/trim/test.yml +++ b/tests/modules/ivar/trim/test.yml @@ -5,4 +5,4 @@ - ivar/trim files: - path: output/ivar/test.bam - md5sum: 8705d032b28a1c3dbfe78fa762a2132f + md5sum: 12cff17d43b1efdba8120a6bff5311e3 diff --git a/tests/modules/qualimap/bamqc/test.yml b/tests/modules/qualimap/bamqc/test.yml index 71a40c13..7d746a51 100644 --- a/tests/modules/qualimap/bamqc/test.yml +++ b/tests/modules/qualimap/bamqc/test.yml @@ -6,7 +6,7 @@ files: - path: ./output/qualimap/test/qualimapReport.html - path: ./output/qualimap/test/genome_results.txt - md5sum: 00ad697dbec5141428ac8d850c13e1c5 + md5sum: 5ec87ea86ad734d512c8c76fe8eb37b1 - path: ./output/qualimap/test/css/plus.png md5sum: 0125e6faa04e2cf0141a2d599d3bb220 - path: ./output/qualimap/test/css/down-pressed.png diff --git a/tests/modules/rsem/calculateexpression/main.nf b/tests/modules/rsem/calculateexpression/main.nf index ee01687e..e7de83a4 100644 --- a/tests/modules/rsem/calculateexpression/main.nf +++ b/tests/modules/rsem/calculateexpression/main.nf @@ -2,20 +2,21 @@ nextflow.enable.dsl = 2 -include { RSEM_PREPAREREFERENCE } from '../../../../modules/rsem/preparereference/main.nf' addParams(options: [args: "--star"]) -include { RSEM_CALCULATEEXPRESSION } from '../../../../modules/rsem/calculateexpression/main.nf' addParams(options: [args: "--star --star-gzipped-read-file"]) +include { RSEM_PREPAREREFERENCE } from '../../../../modules/rsem/preparereference/main.nf' addParams(options: [args: "--star"]) +include { RSEM_CALCULATEEXPRESSION } from '../../../../modules/rsem/calculateexpression/main.nf' addParams(options: [args: "--star --star-gzipped-read-file"]) workflow test_rsem_calculateexpression { + input = [ + [ id:'test', single_end:false, strandedness: 'forward' ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_2_fastq_gz'], checkIfExists: true) + ] + ] fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) - input = [ [ id:'test', single_end:false, strandedness: 'forward' ], // meta map - [file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_1_fastq_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_2_fastq_gz'], checkIfExists: true)] - ] - RSEM_PREPAREREFERENCE ( fasta, gtf ) - RSEM_CALCULATEEXPRESSION( input, RSEM_PREPAREREFERENCE.out.index ) } diff --git a/tests/modules/rsem/preparereference/main.nf b/tests/modules/rsem/preparereference/main.nf index a579960b..2d4a9053 100644 --- a/tests/modules/rsem/preparereference/main.nf +++ b/tests/modules/rsem/preparereference/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { RSEM_PREPAREREFERENCE } from '../../../../modules/rsem/preparereference/main.nf' addParams(options: [:]) +include { RSEM_PREPAREREFERENCE } from '../../../../modules/rsem/preparereference/main.nf' addParams(options: [publish_dir:'rsem']) workflow test_rsem_preparereference { diff --git a/tests/modules/rsem/preparereference/test.yml b/tests/modules/rsem/preparereference/test.yml index 1526120e..734a92b2 100644 --- a/tests/modules/rsem/preparereference/test.yml +++ b/tests/modules/rsem/preparereference/test.yml @@ -4,19 +4,19 @@ - rsem - rsem/preparereference files: - - path: output/index/rsem/genome.chrlist + - path: output/rsem/rsem/genome.chrlist md5sum: b190587cae0531f3cf25552d8aa674db - - path: output/index/rsem/genome.fasta + - path: output/rsem/rsem/genome.fasta md5sum: f315020d899597c1b57e5fe9f60f4c3e - - path: output/index/rsem/genome.grp + - path: output/rsem/rsem/genome.grp md5sum: c2848a8b6d495956c11ec53efc1de67e - - path: output/index/rsem/genome.idx.fa + - path: output/rsem/rsem/genome.idx.fa md5sum: 050c521a2719c2ae48267c1e65218f29 - - path: output/index/rsem/genome.n2g.idx.fa + - path: output/rsem/rsem/genome.n2g.idx.fa md5sum: 050c521a2719c2ae48267c1e65218f29 - - path: output/index/rsem/genome.seq + - path: output/rsem/rsem/genome.seq md5sum: 94da0c6b88c33e63c9a052a11f4f57c1 - - path: output/index/rsem/genome.ti + - path: output/rsem/rsem/genome.ti md5sum: c9e4ae8d4d13a504eec2acf1b8589a66 - - path: output/index/rsem/genome.transcripts.fa + - path: output/rsem/rsem/genome.transcripts.fa md5sum: 050c521a2719c2ae48267c1e65218f29 diff --git a/tests/modules/star/genomegenerate/main.nf b/tests/modules/star/genomegenerate/main.nf index 4753de9e..7f9e3072 100644 --- a/tests/modules/star/genomegenerate/main.nf +++ b/tests/modules/star/genomegenerate/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { STAR_GENOMEGENERATE } from '../../../../modules/star/genomegenerate/main.nf' addParams( options: [:] ) +include { STAR_GENOMEGENERATE } from '../../../../modules/star/genomegenerate/main.nf' addParams( options: [publish_dir:'star'] ) workflow test_star_genomegenerate { fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/star/genomegenerate/test.yml b/tests/modules/star/genomegenerate/test.yml index 0a4bff80..1df59378 100644 --- a/tests/modules/star/genomegenerate/test.yml +++ b/tests/modules/star/genomegenerate/test.yml @@ -4,34 +4,34 @@ - star/genomegenerate - star files: - - path: output/index/star/Genome + - path: output/star/star/Genome md5sum: a654229fbca6071dcb6b01ce7df704da - - path: output/index/star/Log.out - - path: output/index/star/SA + - path: output/star/star/Log.out + - path: output/star/star/SA md5sum: 8c3edc46697b72c9e92440d4cf43506c - - path: output/index/star/SAindex + - path: output/star/star/SAindex md5sum: d0fbf2789ee1e9f60c352ba3655d9de4 - - path: output/index/star/chrLength.txt + - path: output/star/star/chrLength.txt md5sum: c81f40f27e72606d7d07097c1d56a5b5 - - path: output/index/star/chrName.txt + - path: output/star/star/chrName.txt md5sum: 5ae68a67b70976ee95342a7451cb5af1 - - path: output/index/star/chrNameLength.txt + - path: output/star/star/chrNameLength.txt md5sum: b190587cae0531f3cf25552d8aa674db - - path: output/index/star/chrStart.txt + - path: output/star/star/chrStart.txt md5sum: 8d3291e6bcdbe9902fbd7c887494173f - - path: output/index/star/exonGeTrInfo.tab + - path: output/star/star/exonGeTrInfo.tab md5sum: d04497f69d6ef889efd4d34fe63edcc4 - - path: output/index/star/exonInfo.tab + - path: output/star/star/exonInfo.tab md5sum: 0d560290fab688b7268d88d5494bf9fe - - path: output/index/star/geneInfo.tab + - path: output/star/star/geneInfo.tab md5sum: 8b608537307443ffaee4927d2b428805 - - path: output/index/star/genomeParameters.txt + - path: output/star/star/genomeParameters.txt md5sum: 5a1ec027e575c3d7c1851e6b80fb8c5d - - path: output/index/star/sjdbInfo.txt + - path: output/star/star/sjdbInfo.txt md5sum: 5690ea9d9f09f7ff85b7fd47bd234903 - - path: output/index/star/sjdbList.fromGTF.out.tab + - path: output/star/star/sjdbList.fromGTF.out.tab md5sum: 8760c33e966dad0b39f440301ebbdee4 - - path: output/index/star/sjdbList.out.tab + - path: output/star/star/sjdbList.out.tab md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1 - - path: output/index/star/transcriptInfo.tab + - path: output/star/star/transcriptInfo.tab md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 diff --git a/tests/modules/stringtie/merge/main.nf b/tests/modules/stringtie/merge/main.nf index f0202c33..49ff5a41 100644 --- a/tests/modules/stringtie/merge/main.nf +++ b/tests/modules/stringtie/merge/main.nf @@ -2,37 +2,45 @@ nextflow.enable.dsl = 2 -include { STRINGTIE as STRINGTIE_FORWARD } from '../../../../modules/stringtie/stringtie/main.nf' addParams( options: [ publish_dir:'test_stringtie_forward' ] ) -include { STRINGTIE as STRINGTIE_REVERSE } from '../../../../modules/stringtie/stringtie/main.nf' addParams( options: [ publish_dir:'test_stringtie_reverse' ] ) -include { STRINGTIE_MERGE as STRINGTIE_FORWARD_MERGE} from '../../../../modules/stringtie/merge/main.nf' addParams( options: [ publish_dir:'test_stringtie_forward_merge'] ) -include { STRINGTIE_MERGE as STRINGTIE_REVERSE_MERGE} from '../../../../modules/stringtie/merge/main.nf' addParams( options: [ publish_dir:'test_stringtie_reverse_merge'] ) +include { STRINGTIE } from '../../../../modules/stringtie/stringtie/main.nf' addParams( options: [:] ) +include { STRINGTIE_MERGE } from '../../../../modules/stringtie/merge/main.nf' addParams( options: [:] ) + /* * Test with forward strandedness */ workflow test_stringtie_forward_merge { - input = [ [ id:'test', strandedness:'forward' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] ] - annotation_gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) - - STRINGTIE_FORWARD ( input, annotation_gtf ) - STRINGTIE_FORWARD.out.transcript_gtf - .map { it -> it[1] } - .set { stringtie_gtf } - STRINGTIE_FORWARD_MERGE ( stringtie_gtf, annotation_gtf ) + input = [ + [ id:'test', strandedness:'forward' ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + ] + annotation_gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) + + STRINGTIE ( input, annotation_gtf ) + STRINGTIE + .out + .transcript_gtf + .map { it -> it[1] } + .set { stringtie_gtf } + + STRINGTIE_MERGE ( stringtie_gtf, annotation_gtf ) } /* * Test with reverse strandedness */ workflow test_stringtie_reverse_merge { - input = [ [ id:'test', strandedness:'reverse' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] - ] - annotation_gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) - - STRINGTIE_REVERSE ( input, annotation_gtf ) - STRINGTIE_REVERSE.out.transcript_gtf - .map { it -> it[1] } - .set { stringtie_gtf } - STRINGTIE_REVERSE_MERGE ( stringtie_gtf, annotation_gtf ) + input = [ + [ id:'test', strandedness:'reverse' ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + ] + annotation_gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) + + STRINGTIE ( input, annotation_gtf ) + STRINGTIE + .out + .transcript_gtf + .map { it -> it[1] } + .set { stringtie_gtf } + + STRINGTIE_MERGE ( stringtie_gtf, annotation_gtf ) } diff --git a/tests/modules/stringtie/merge/test.yml b/tests/modules/stringtie/merge/test.yml index e49122be..ea47ad48 100644 --- a/tests/modules/stringtie/merge/test.yml +++ b/tests/modules/stringtie/merge/test.yml @@ -1,22 +1,22 @@ -- name: stringtie forward-strand merge +- name: stringtie merge forward-strand command: nextflow run ./tests/modules/stringtie/merge/ -entry test_stringtie_forward_merge -c tests/config/nextflow.config tags: - stringtie - stringtie/merge files: - - path: ./output/test_stringtie_forward_merge/stringtie.merged.gtf + - path: ./output/stringtie/stringtie.merged.gtf contains: - 'stringtie' - 'merge' - 'chr22' -- name: stringtie reverse-strand merge +- name: stringtie merge reverse-strand command: nextflow run ./tests/modules/stringtie/merge/ -entry test_stringtie_reverse_merge -c tests/config/nextflow.config tags: - stringtie - stringtie/merge files: - - path: ./output/test_stringtie_reverse_merge/stringtie.merged.gtf + - path: ./output/stringtie/stringtie.merged.gtf contains: - 'stringtie' - 'merge' diff --git a/tests/modules/stringtie/stringtie/main.nf b/tests/modules/stringtie/stringtie/main.nf index fc321f8f..b902cc41 100644 --- a/tests/modules/stringtie/stringtie/main.nf +++ b/tests/modules/stringtie/stringtie/main.nf @@ -2,27 +2,29 @@ nextflow.enable.dsl = 2 -include { STRINGTIE as STRINGTIE_FORWARD } from '../../../../modules/stringtie/stringtie/main.nf' addParams( options: [ publish_dir:'test_stringtie_forward' ] ) -include { STRINGTIE as STRINGTIE_REVERSE } from '../../../../modules/stringtie/stringtie/main.nf' addParams( options: [ publish_dir:'test_stringtie_reverse' ] ) - +include { STRINGTIE } from '../../../../modules/stringtie/stringtie/main.nf' addParams( options: [:] ) // // Test with forward strandedness // workflow test_stringtie_forward { - input = [ [ id:'test', strandedness:'forward' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] ] - annotation_gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) + input = [ + [ id:'test', strandedness:'forward' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + ] + annotation_gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) - STRINGTIE_FORWARD ( input, annotation_gtf ) + STRINGTIE ( input, annotation_gtf ) } // // Test with reverse strandedness // workflow test_stringtie_reverse { - input = [ [ id:'test', strandedness:'reverse' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] ] - annotation_gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) + input = [ + [ id:'test', strandedness:'reverse' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + ] + annotation_gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) - STRINGTIE_REVERSE ( input, annotation_gtf ) + STRINGTIE ( input, annotation_gtf ) } diff --git a/tests/modules/stringtie/stringtie/test.yml b/tests/modules/stringtie/stringtie/test.yml index 14eff6eb..28c1b3c2 100644 --- a/tests/modules/stringtie/stringtie/test.yml +++ b/tests/modules/stringtie/stringtie/test.yml @@ -1,43 +1,43 @@ -- name: test_stringtie_forward +- name: stringtie stringtie forward command: nextflow run ./tests/modules/stringtie/stringtie/ -entry test_stringtie_forward -c tests/config/nextflow.config tags: - stringtie - stringtie/stringtie files: - - path: ./output/test_stringtie_forward/test.transcripts.gtf - - path: ./output/test_stringtie_forward/test.gene.abundance.txt + - path: ./output/stringtie/test.transcripts.gtf + - path: ./output/stringtie/test.gene.abundance.txt md5sum: 7d8bce7f2a922e367cedccae7267c22e - - path: ./output/test_stringtie_forward/test.coverage.gtf + - path: ./output/stringtie/test.coverage.gtf md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: ./output/test_stringtie_forward/test.ballgown/e_data.ctab + - path: ./output/stringtie/test.ballgown/e_data.ctab md5sum: 6b4cf69bc03f3f69890f972a0e8b7471 - - path: ./output/test_stringtie_forward/test.ballgown/i_data.ctab + - path: ./output/stringtie/test.ballgown/i_data.ctab md5sum: be3abe09740603213f83d50dcf81427f - - path: ./output/test_stringtie_forward/test.ballgown/t_data.ctab + - path: ./output/stringtie/test.ballgown/t_data.ctab md5sum: 3b66c065da73ae0dd41cc332eff6a818 - - path: ./output/test_stringtie_forward/test.ballgown/i2t.ctab + - path: ./output/stringtie/test.ballgown/i2t.ctab md5sum: 8a117c8aa4334b4c2d4711932b006fb4 - - path: ./output/test_stringtie_forward/test.ballgown/e2t.ctab + - path: ./output/stringtie/test.ballgown/e2t.ctab md5sum: e981c0038295ae54b63cedb1083f1540 -- name: test_stringtie_reverse +- name: stringtie stringtie reverse command: nextflow run ./tests/modules/stringtie/stringtie/ -entry test_stringtie_reverse -c tests/config/nextflow.config tags: - stringtie - stringtie/stringtie files: - - path: ./output/test_stringtie_reverse/test.transcripts.gtf - - path: ./output/test_stringtie_reverse/test.gene.abundance.txt + - path: ./output/stringtie/test.transcripts.gtf + - path: ./output/stringtie/test.gene.abundance.txt md5sum: 7385b870b955dae2c2ab78a70cf05cce - - path: ./output/test_stringtie_reverse/test.coverage.gtf + - path: ./output/stringtie/test.coverage.gtf md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: ./output/test_stringtie_reverse/test.ballgown/e_data.ctab + - path: ./output/stringtie/test.ballgown/e_data.ctab md5sum: 879b6696029d19c4737b562e9d149218 - - path: ./output/test_stringtie_reverse/test.ballgown/i_data.ctab + - path: ./output/stringtie/test.ballgown/i_data.ctab md5sum: be3abe09740603213f83d50dcf81427f - - path: ./output/test_stringtie_reverse/test.ballgown/t_data.ctab + - path: ./output/stringtie/test.ballgown/t_data.ctab md5sum: 3b66c065da73ae0dd41cc332eff6a818 - - path: ./output/test_stringtie_reverse/test.ballgown/i2t.ctab + - path: ./output/stringtie/test.ballgown/i2t.ctab md5sum: 8a117c8aa4334b4c2d4711932b006fb4 - - path: ./output/test_stringtie_reverse/test.ballgown/e2t.ctab + - path: ./output/stringtie/test.ballgown/e2t.ctab md5sum: e981c0038295ae54b63cedb1083f1540 From e971f538a99bfa190f36f9303bede205e00b90a4 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Tue, 28 Sep 2021 11:51:19 +0200 Subject: [PATCH 08/61] Module new version reporting fixes (#753) * Specify more guidelines on input channels * Linting * Updates based on code review * Update README.md * Fix broken sentence * Fix IQ tree * Fix picard markdup and merge sam * Fix plink/vcf version * Fix plink version output * Fix prokka version command * Fix pydamage * Try fixing markduplicates * Fix snpEff * Fix vcftools version * Fix pydamage and filtersamreads test run * Fix MarkDuplicates tests * Add missing unsorted checks * Remove MD5 sym due to stochasicity in BAM file --- modules/iqtree/main.nf | 2 +- modules/picard/markduplicates/main.nf | 2 +- modules/picard/mergesamfiles/main.nf | 4 ++-- modules/plink/vcf/main.nf | 2 +- modules/prokka/main.nf | 2 +- modules/pydamage/analyze/main.nf | 2 +- modules/pydamage/filter/main.nf | 2 +- modules/snpeff/main.nf | 2 +- modules/vcftools/main.nf | 2 +- tests/modules/iqtree/test.yml | 2 +- tests/modules/picard/filtersamreads/test.yml | 2 +- tests/modules/picard/markduplicates/main.nf | 3 ++- tests/modules/picard/markduplicates/test.yml | 10 +++++++--- tests/modules/picard/mergesamfiles/test.yml | 1 - tests/modules/pydamage/analyze/test.yml | 2 +- tests/modules/pydamage/filter/test.yml | 2 +- 16 files changed, 23 insertions(+), 19 deletions(-) diff --git a/modules/iqtree/main.nf b/modules/iqtree/main.nf index 28e07207..357faf33 100644 --- a/modules/iqtree/main.nf +++ b/modules/iqtree/main.nf @@ -41,7 +41,7 @@ process IQTREE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(iqtree -version 2>&1 | sed 's/^IQ-TREE multicore version \\([0-9\\.]*\\) .*\$/\\1/') + ${getSoftwareName(task.process)}: \$(echo \$(iqtree -version 2>&1) | sed 's/^IQ-TREE multicore version //;s/ .*//') END_VERSIONS """ } diff --git a/modules/picard/markduplicates/main.nf b/modules/picard/markduplicates/main.nf index 62cd10c2..dc8d460b 100644 --- a/modules/picard/markduplicates/main.nf +++ b/modules/picard/markduplicates/main.nf @@ -47,7 +47,7 @@ process PICARD_MARKDUPLICATES { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(picard MarkDuplicates --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:) + ${getSoftwareName(task.process)}: \$(echo \$(picard MarkDuplicates --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:) END_VERSIONS """ } diff --git a/modules/picard/mergesamfiles/main.nf b/modules/picard/mergesamfiles/main.nf index e9cba284..c6ecfe58 100644 --- a/modules/picard/mergesamfiles/main.nf +++ b/modules/picard/mergesamfiles/main.nf @@ -45,7 +45,7 @@ process PICARD_MERGESAMFILES { OUTPUT=${prefix}.bam cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(picard MergeSamFiles --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:) + ${getSoftwareName(task.process)}: \$( echo \$(picard MergeSamFiles --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:) END_VERSIONS """ } else { @@ -53,7 +53,7 @@ process PICARD_MERGESAMFILES { ln -s ${bam_files[0]} ${prefix}.bam cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(picard MergeSamFiles --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:) + ${getSoftwareName(task.process)}: \$( echo \$(picard MergeSamFiles --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:) END_VERSIONS """ } diff --git a/modules/plink/vcf/main.nf b/modules/plink/vcf/main.nf index 697be55e..735fef88 100644 --- a/modules/plink/vcf/main.nf +++ b/modules/plink/vcf/main.nf @@ -41,7 +41,7 @@ process PLINK_VCF { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - plink: \$( plink --version 2>&1 | sed 's/^PLINK //' | sed 's/..-bit.*//' ) + plink: \$(echo \$(plink --version 2>&1) | sed 's/^PLINK v//' | sed 's/..-bit.*//' ) END_VERSIONS """ } diff --git a/modules/prokka/main.nf b/modules/prokka/main.nf index c2a9d682..8aefda7c 100644 --- a/modules/prokka/main.nf +++ b/modules/prokka/main.nf @@ -53,7 +53,7 @@ process PROKKA { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(prokka --version 2>&1 | sed 's/^.*prokka //') + ${getSoftwareName(task.process)}: \$(echo \$(prokka --version 2>&1) | sed 's/^.*prokka //') END_VERSIONS """ } diff --git a/modules/pydamage/analyze/main.nf b/modules/pydamage/analyze/main.nf index 042e6c74..df787e44 100644 --- a/modules/pydamage/analyze/main.nf +++ b/modules/pydamage/analyze/main.nf @@ -37,7 +37,7 @@ process PYDAMAGE_ANALYZE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(pydamage --version 2>&1 | sed -e 's/pydamage, version //g') + ${getSoftwareName(task.process)}: \$(echo \$(pydamage --version 2>&1) | sed -e 's/pydamage, version //g') END_VERSIONS """ } diff --git a/modules/pydamage/filter/main.nf b/modules/pydamage/filter/main.nf index 9cb95b4a..87677367 100644 --- a/modules/pydamage/filter/main.nf +++ b/modules/pydamage/filter/main.nf @@ -37,7 +37,7 @@ process PYDAMAGE_FILTER { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(pydamage --version 2>&1 | sed -e 's/pydamage, version //g') + ${getSoftwareName(task.process)}: \$(echo \$(pydamage --version 2>&1) | sed -e 's/pydamage, version //g') END_VERSIONS """ } diff --git a/modules/snpeff/main.nf b/modules/snpeff/main.nf index aa25a092..8b30360a 100644 --- a/modules/snpeff/main.nf +++ b/modules/snpeff/main.nf @@ -54,7 +54,7 @@ process SNPEFF { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(snpEff -version 2>&1) + ${getSoftwareName(task.process)}: \$(echo \$(snpEff -version 2>&1) | cut -f 2 -d ' ') END_VERSIONS """ } diff --git a/modules/vcftools/main.nf b/modules/vcftools/main.nf index 7ae1619f..a8d8969c 100644 --- a/modules/vcftools/main.nf +++ b/modules/vcftools/main.nf @@ -126,7 +126,7 @@ process VCFTOOLS { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(vcftools --version 2>&1 | sed 's/^.*vcftools //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(vcftools --version 2>&1) | sed 's/^.*VCFtools (//;s/).*//') END_VERSIONS """ } diff --git a/tests/modules/iqtree/test.yml b/tests/modules/iqtree/test.yml index 7bacd0e6..e40656a2 100644 --- a/tests/modules/iqtree/test.yml +++ b/tests/modules/iqtree/test.yml @@ -1,4 +1,4 @@ -- name: iqtree +- name: iqtree test workflow command: nextflow run ./tests/modules/iqtree -entry test_iqtree -c tests/config/nextflow.config tags: - iqtree diff --git a/tests/modules/picard/filtersamreads/test.yml b/tests/modules/picard/filtersamreads/test.yml index 34dd85c4..e8e73ed0 100644 --- a/tests/modules/picard/filtersamreads/test.yml +++ b/tests/modules/picard/filtersamreads/test.yml @@ -8,7 +8,7 @@ md5sum: b44a6ca04811a9470c7813c3c9465fd5 -- name: picard filtersamreads_readlist +- name: picard filtersamreads readlist command: nextflow run ./tests/modules/picard/filtersamreads -entry test_picard_filtersamreads_readlist -c tests/config/nextflow.config tags: - picard diff --git a/tests/modules/picard/markduplicates/main.nf b/tests/modules/picard/markduplicates/main.nf index 2d4ff746..78643f8b 100644 --- a/tests/modules/picard/markduplicates/main.nf +++ b/tests/modules/picard/markduplicates/main.nf @@ -3,6 +3,7 @@ nextflow.enable.dsl = 2 include { PICARD_MARKDUPLICATES } from '../../../../modules/picard/markduplicates/main.nf' addParams( options: [:] ) +include { PICARD_MARKDUPLICATES as PICARD_MARKDUPLICATES_UNSORTED} from '../../../../modules/picard/markduplicates/main.nf' addParams( options: [args : '--ASSUME_SORT_ORDER queryname' ] ) workflow test_picard_markduplicates_sorted_bam { input = [ [ id:'test', single_end:false ], // meta map @@ -17,5 +18,5 @@ workflow test_picard_markduplicates_unsorted_bam { file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) ] - PICARD_MARKDUPLICATES ( input ) + PICARD_MARKDUPLICATES_UNSORTED ( input ) } diff --git a/tests/modules/picard/markduplicates/test.yml b/tests/modules/picard/markduplicates/test.yml index ffb385f3..04075548 100644 --- a/tests/modules/picard/markduplicates/test.yml +++ b/tests/modules/picard/markduplicates/test.yml @@ -1,4 +1,4 @@ -- name: picard markduplicates on sorted bam +- name: picard markduplicates sorted bam command: nextflow run ./tests/modules/picard/markduplicates -entry test_picard_markduplicates_sorted_bam -c tests/config/nextflow.config tags: - picard @@ -7,9 +7,13 @@ - path: ./output/picard/test.MarkDuplicates.metrics.txt - path: ./output/picard/test.bam md5sum: b520ccdc3a9edf3c6a314983752881f2 -- name: picard markduplicates on unsorted bam +- name: picard markduplicates unsorted bam command: nextflow run ./tests/modules/picard/markduplicates -entry test_picard_markduplicates_unsorted_bam -c tests/config/nextflow.config tags: - picard - picard/markduplicates - exit_code: 1 + files: + - path: ./output/picard/test.MarkDuplicates.metrics.txt + - path: ./output/picard/test.bam + md5sum: 46a6fc76048ba801d328f869ac9db020 + diff --git a/tests/modules/picard/mergesamfiles/test.yml b/tests/modules/picard/mergesamfiles/test.yml index 114c1f01..a331c96f 100644 --- a/tests/modules/picard/mergesamfiles/test.yml +++ b/tests/modules/picard/mergesamfiles/test.yml @@ -5,4 +5,3 @@ - picard/mergesamfiles files: - path: ./output/picard/test.bam - md5sum: 82bb91735aff82eae4f0b631114e9e15 diff --git a/tests/modules/pydamage/analyze/test.yml b/tests/modules/pydamage/analyze/test.yml index c54e64a4..e480c1b4 100644 --- a/tests/modules/pydamage/analyze/test.yml +++ b/tests/modules/pydamage/analyze/test.yml @@ -1,4 +1,4 @@ -- name: test_pydamage_analyze +- name: pydamage analyze test workflow command: nextflow run tests/modules/pydamage/analyze -entry test_pydamage -c tests/config/nextflow.config tags: - pydamage diff --git a/tests/modules/pydamage/filter/test.yml b/tests/modules/pydamage/filter/test.yml index e131d505..248be44b 100644 --- a/tests/modules/pydamage/filter/test.yml +++ b/tests/modules/pydamage/filter/test.yml @@ -1,4 +1,4 @@ -- name: test_pydamage_filter +- name: pydamage filter test workflow command: nextflow run tests/modules/pydamage/filter -entry test_pydamage -c tests/config/nextflow.config tags: - pydamage From 9c31cf1566fa4f8660ac3973e02fe0caebe86235 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Tue, 28 Sep 2021 14:37:47 +0100 Subject: [PATCH 09/61] Fix version commands: round 3 (#754) * Fix version commands: round 3 * Fix seqkit/split2 modules --- modules/bbmap/align/main.nf | 2 + modules/bowtie/align/main.nf | 1 + modules/bowtie2/align/main.nf | 5 ++ modules/bwa/mem/main.nf | 1 + modules/bwa/sampe/main.nf | 1 + modules/bwa/samse/main.nf | 1 + modules/bwamem2/mem/main.nf | 1 + modules/chromap/index/main.nf | 9 ++- modules/hisat2/align/main.nf | 2 + modules/kraken2/kraken2/main.nf | 1 + modules/rapidnj/main.nf | 12 ++-- modules/rsem/calculateexpression/main.nf | 5 +- modules/rsem/preparereference/main.nf | 2 + modules/samtools/faidx/main.nf | 4 +- modules/seacr/callpeak/main.nf | 2 + modules/seqkit/split2/main.nf | 60 +++++++++---------- modules/seqtk/sample/main.nf | 4 +- modules/seqtk/subseq/main.nf | 2 +- modules/sequenzautils/bam2seqz/main.nf | 8 +-- modules/sequenzautils/gcwiggle/main.nf | 4 +- modules/shovill/main.nf | 2 +- modules/star/genomegenerate/main.nf | 4 ++ modules/tiddit/sv/main.nf | 5 +- modules/ucsc/bedgraphtobigwig/main.nf | 6 +- modules/ucsc/bigwigaverageoverbed/main.nf | 14 +++-- modules/unicycler/main.nf | 2 +- modules/yara/index/main.nf | 12 ++-- modules/yara/mapper/main.nf | 53 +++++++++------- tests/modules/seacr/callpeak/main.nf | 9 +-- tests/modules/seqkit/split2/test.yml | 42 ++++++------- tests/modules/sequenzautils/bam2seqz/test.yml | 2 +- .../modules/ucsc/bigwigaverageoverbed/main.nf | 7 ++- tests/modules/yara/index/main.nf | 4 +- tests/modules/yara/index/test.yml | 24 ++++---- 34 files changed, 184 insertions(+), 129 deletions(-) diff --git a/modules/bbmap/align/main.nf b/modules/bbmap/align/main.nf index 8235e78d..63989be0 100644 --- a/modules/bbmap/align/main.nf +++ b/modules/bbmap/align/main.nf @@ -57,6 +57,8 @@ process BBMAP_ALIGN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(bbversion.sh) + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) END_VERSIONS """ } diff --git a/modules/bowtie/align/main.nf b/modules/bowtie/align/main.nf index 73554fa2..060c5fc4 100644 --- a/modules/bowtie/align/main.nf +++ b/modules/bowtie/align/main.nf @@ -58,6 +58,7 @@ process BOWTIE_ALIGN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/bowtie2/align/main.nf b/modules/bowtie2/align/main.nf index 7d33da03..00bcf83c 100644 --- a/modules/bowtie2/align/main.nf +++ b/modules/bowtie2/align/main.nf @@ -48,6 +48,8 @@ process BOWTIE2_ALIGN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) END_VERSIONS """ } else { @@ -70,9 +72,12 @@ process BOWTIE2_ALIGN { if [ -f ${prefix}.unmapped.fastq.2.gz ]; then mv ${prefix}.unmapped.fastq.2.gz ${prefix}.unmapped_2.fastq.gz fi + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) END_VERSIONS """ } diff --git a/modules/bwa/mem/main.nf b/modules/bwa/mem/main.nf index 05e5260c..a081a69a 100644 --- a/modules/bwa/mem/main.nf +++ b/modules/bwa/mem/main.nf @@ -45,6 +45,7 @@ process BWA_MEM { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/bwa/sampe/main.nf b/modules/bwa/sampe/main.nf index ae2998d8..f4519541 100644 --- a/modules/bwa/sampe/main.nf +++ b/modules/bwa/sampe/main.nf @@ -44,6 +44,7 @@ process BWA_SAMPE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/bwa/samse/main.nf b/modules/bwa/samse/main.nf index 89310153..5303b24f 100644 --- a/modules/bwa/samse/main.nf +++ b/modules/bwa/samse/main.nf @@ -44,6 +44,7 @@ process BWA_SAMSE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/bwamem2/mem/main.nf b/modules/bwamem2/mem/main.nf index f47bfea3..d21b8b99 100644 --- a/modules/bwamem2/mem/main.nf +++ b/modules/bwamem2/mem/main.nf @@ -46,6 +46,7 @@ process BWAMEM2_MEM { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/chromap/index/main.nf b/modules/chromap/index/main.nf index e52ffe4b..61b7a856 100644 --- a/modules/chromap/index/main.nf +++ b/modules/chromap/index/main.nf @@ -24,14 +24,16 @@ process CHROMAP_INDEX { path fasta output: - path "*.index" , emit: index - path "versions.yml" , emit: version + path "*.index" , emit: index + path "versions.yml", emit: version script: def software = getSoftwareName(task.process) def prefix = fasta.baseName """ - chromap -i $options.args \\ + chromap \\ + -i \\ + $options.args \\ -t $task.cpus \\ -r $fasta \\ -o ${prefix}.index @@ -39,6 +41,7 @@ process CHROMAP_INDEX { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo "$VERSION") + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/hisat2/align/main.nf b/modules/hisat2/align/main.nf index 21eb3c7d..583ddc3f 100644 --- a/modules/hisat2/align/main.nf +++ b/modules/hisat2/align/main.nf @@ -62,6 +62,7 @@ process HISAT2_ALIGN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo $VERSION) + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } else { @@ -93,6 +94,7 @@ process HISAT2_ALIGN { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo $VERSION) + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ } diff --git a/modules/kraken2/kraken2/main.nf b/modules/kraken2/kraken2/main.nf index 4000d12a..cc269e98 100644 --- a/modules/kraken2/kraken2/main.nf +++ b/modules/kraken2/kraken2/main.nf @@ -51,6 +51,7 @@ process KRAKEN2_KRAKEN2 { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo \$(kraken2 --version 2>&1) | sed 's/^.*Kraken version //; s/ .*\$//') + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) END_VERSIONS """ } diff --git a/modules/rapidnj/main.nf b/modules/rapidnj/main.nf index a46fbfe8..118ea7af 100644 --- a/modules/rapidnj/main.nf +++ b/modules/rapidnj/main.nf @@ -4,6 +4,8 @@ include { initOptions; saveFiles; getSoftwareName; getProcessName } from './func params.options = [:] options = initOptions(params.options) +def VERSION = '2.3.2' // No version information printed + process RAPIDNJ { label 'process_medium' publishDir "${params.outdir}", @@ -21,9 +23,9 @@ process RAPIDNJ { path alignment output: - path "*.sth" , emit: stockholm_alignment - path "*.tre" , emit: phylogeny - path "versions.yml" , emit: version + path "*.sth" , emit: stockholm_alignment + path "*.tre" , emit: phylogeny + path "versions.yml", emit: version script: def software = getSoftwareName(task.process) @@ -38,10 +40,10 @@ process RAPIDNJ { -c $task.cpus \\ -x rapidnj_phylogeny.tre - # Doesn't appear to be a way of getting the version number cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(echo 2.3.2) + ${getSoftwareName(task.process)}: \$(echo $VERSION) + biopython: \$(python -c "import Bio; print(Bio.__version__)") END_VERSIONS """ } diff --git a/modules/rsem/calculateexpression/main.nf b/modules/rsem/calculateexpression/main.nf index 33f34904..d3d11397 100644 --- a/modules/rsem/calculateexpression/main.nf +++ b/modules/rsem/calculateexpression/main.nf @@ -34,8 +34,8 @@ process RSEM_CALCULATEEXPRESSION { tuple val(meta), path("${prefix}.transcript.bam"), optional:true, emit: bam_transcript script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def software = getSoftwareName(task.process) + prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def strandedness = '' if (meta.strandedness == 'forward') { @@ -59,6 +59,7 @@ process RSEM_CALCULATEEXPRESSION { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g") + star: \$(STAR --version | sed -e "s/STAR_//g") END_VERSIONS """ } diff --git a/modules/rsem/preparereference/main.nf b/modules/rsem/preparereference/main.nf index 560b5a63..b4a613bd 100644 --- a/modules/rsem/preparereference/main.nf +++ b/modules/rsem/preparereference/main.nf @@ -53,6 +53,7 @@ process RSEM_PREPAREREFERENCE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g") + star: \$(STAR --version | sed -e "s/STAR_//g") END_VERSIONS """ } else { @@ -67,6 +68,7 @@ process RSEM_PREPAREREFERENCE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g") + star: \$(STAR --version | sed -e "s/STAR_//g") END_VERSIONS """ } diff --git a/modules/samtools/faidx/main.nf b/modules/samtools/faidx/main.nf index f7d6cbef..cdbae99b 100644 --- a/modules/samtools/faidx/main.nf +++ b/modules/samtools/faidx/main.nf @@ -22,8 +22,8 @@ process SAMTOOLS_FAIDX { path fasta output: - path "*.fai" , emit: fai - path "versions.yml" , emit: version + path "*.fai" , emit: fai + path "versions.yml", emit: version script: def software = getSoftwareName(task.process) diff --git a/modules/seacr/callpeak/main.nf b/modules/seacr/callpeak/main.nf index cc567dfb..8892ab6d 100644 --- a/modules/seacr/callpeak/main.nf +++ b/modules/seacr/callpeak/main.nf @@ -40,6 +40,8 @@ process SEACR_CALLPEAK { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo $VERSION) + bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") + r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/seqkit/split2/main.nf b/modules/seqkit/split2/main.nf index 44e0046f..b178b1da 100644 --- a/modules/seqkit/split2/main.nf +++ b/modules/seqkit/split2/main.nf @@ -7,13 +7,11 @@ options = initOptions(params.options) process SEQKIT_SPLIT2 { tag "$meta.id" label 'process_medium' - publishDir "${params.outdir}", mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } conda (params.enable_conda ? 'bioconda::seqkit=0.16.1' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/seqkit:0.16.1--h9ee0642_0" } else { @@ -24,42 +22,40 @@ process SEQKIT_SPLIT2 { tuple val(meta), path(reads) output: - tuple val(meta), path("*.split/*.gz"), emit: reads - path("versions.yml") , emit: version - + tuple val(meta), path("*${prefix}/*.gz"), emit: reads + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - + prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if(meta.single_end){ - """ - seqkit \ - split2 \ - $options.args \ - --threads $task.cpus \ - -1 ${reads} \ - --out-dir ${prefix}.split + """ + seqkit \\ + split2 \\ + $options.args \\ + --threads $task.cpus \\ + -1 $reads \\ + --out-dir $prefix - cat <<-END_VERSIONS > versions.yml - ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(seqkit --version 2>&1 | sed 's/^.*seqkit //; s/Using.*\$//') - END_VERSIONS - """ + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(seqkit 2>&1) | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS + """ } else { - """ - seqkit \ - split2 \ - $options.args \ - --threads $task.cpus \ - -1 ${reads[0]} \ - -2 ${reads[1]} \ - --out-dir ${prefix}.split + """ + seqkit \\ + split2 \\ + $options.args \\ + --threads $task.cpus \\ + -1 ${reads[0]} \\ + -2 ${reads[1]} \\ + --out-dir $prefix - cat <<-END_VERSIONS > versions.yml - ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(seqkit --version 2>&1 | sed 's/^.*seqkit //; s/Using.*\$//') - END_VERSIONS - """ + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(seqkit 2>&1) | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS + """ } } diff --git a/modules/seqtk/sample/main.nf b/modules/seqtk/sample/main.nf index d62d8cac..277d74ca 100644 --- a/modules/seqtk/sample/main.nf +++ b/modules/seqtk/sample/main.nf @@ -40,7 +40,7 @@ process SEQTK_SAMPLE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(seqtk 2>&1 | sed 's/^.*Version: //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ } else { @@ -64,7 +64,7 @@ process SEQTK_SAMPLE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(seqtk 2>&1 | sed 's/^.*Version: //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/seqtk/subseq/main.nf b/modules/seqtk/subseq/main.nf index 2907d282..41326402 100644 --- a/modules/seqtk/subseq/main.nf +++ b/modules/seqtk/subseq/main.nf @@ -43,7 +43,7 @@ process SEQTK_SUBSEQ { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(seqtk 2>&1 | sed 's/^.*Version: //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/sequenzautils/bam2seqz/main.nf b/modules/sequenzautils/bam2seqz/main.nf index ad4f6847..9c4fc12f 100644 --- a/modules/sequenzautils/bam2seqz/main.nf +++ b/modules/sequenzautils/bam2seqz/main.nf @@ -24,8 +24,8 @@ process SEQUENZAUTILS_BAM2SEQZ { path wigfile output: - tuple val(meta), path("*.seqz.gz"), emit: seqz - path "versions.yml" , emit: version + tuple val(meta), path("*.gz"), emit: seqz + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -38,11 +38,11 @@ process SEQUENZAUTILS_BAM2SEQZ { -t $tumourbam \\ --fasta $fasta \\ -gc $wigfile \\ - -o ${prefix}.seqz.gz + -o ${prefix}.gz cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(sequenzautils --version 2>&1 | sed 's/^.*sequenzautils //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(sequenza-utils 2>&1) | sed 's/^.*is version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/sequenzautils/gcwiggle/main.nf b/modules/sequenzautils/gcwiggle/main.nf index a0575d7e..a352256a 100644 --- a/modules/sequenzautils/gcwiggle/main.nf +++ b/modules/sequenzautils/gcwiggle/main.nf @@ -23,7 +23,7 @@ process SEQUENZAUTILS_GCWIGGLE { output: tuple val(meta), path("*.wig.gz"), emit: wig - path "versions.yml" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) @@ -37,7 +37,7 @@ process SEQUENZAUTILS_GCWIGGLE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(sequenzautils --version 2>&1 | sed 's/^.*sequenzautils //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(sequenza-utils 2>&1) | sed 's/^.*is version //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/shovill/main.nf b/modules/shovill/main.nf index 8319e75f..92b10732 100644 --- a/modules/shovill/main.nf +++ b/modules/shovill/main.nf @@ -44,7 +44,7 @@ process SHOVILL { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(shovill --version 2>&1 | sed 's/^.*shovill //' ) + ${getSoftwareName(task.process)}: \$(echo \$(shovill --version 2>&1) | sed 's/^.*shovill //') END_VERSIONS """ } diff --git a/modules/star/genomegenerate/main.nf b/modules/star/genomegenerate/main.nf index 5ccb38e8..520f6b21 100644 --- a/modules/star/genomegenerate/main.nf +++ b/modules/star/genomegenerate/main.nf @@ -46,6 +46,8 @@ process STAR_GENOMEGENERATE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(STAR --version | sed -e "s/STAR_//g") + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + gawk: \$(echo \$(gawk --version 2>&1) | sed 's/^.*GNU Awk //; s/, .*\$//') END_VERSIONS """ } else { @@ -67,6 +69,8 @@ process STAR_GENOMEGENERATE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(STAR --version | sed -e "s/STAR_//g") + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + gawk: \$(echo \$(gawk --version 2>&1) | sed 's/^.*GNU Awk //; s/, .*\$//') END_VERSIONS """ } diff --git a/modules/tiddit/sv/main.nf b/modules/tiddit/sv/main.nf index b7fe1b03..fce5c49b 100644 --- a/modules/tiddit/sv/main.nf +++ b/modules/tiddit/sv/main.nf @@ -35,14 +35,15 @@ process TIDDIT_SV { def reference = fasta == "dummy_file.txt" ? "--ref $fasta" : "" """ tiddit \\ - --sv $options.args \\ + --sv \\ + $options.args \\ --bam $bam \\ $reference \\ -o $prefix cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(tiddit -h 2>&1 | sed 's/^.*Version: //; s/(.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(tiddit 2>&1) | sed 's/^.*TIDDIT-//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/ucsc/bedgraphtobigwig/main.nf b/modules/ucsc/bedgraphtobigwig/main.nf index 60e046f9..4a779644 100644 --- a/modules/ucsc/bedgraphtobigwig/main.nf +++ b/modules/ucsc/bedgraphtobigwig/main.nf @@ -32,7 +32,11 @@ process UCSC_BEDGRAPHTOBIGWIG { def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ - bedGraphToBigWig $bedgraph $sizes ${prefix}.bigWig + bedGraphToBigWig \\ + $bedgraph \\ + $sizes \\ + ${prefix}.bigWig + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(echo $VERSION) diff --git a/modules/ucsc/bigwigaverageoverbed/main.nf b/modules/ucsc/bigwigaverageoverbed/main.nf index adba3c76..76c00cfe 100644 --- a/modules/ucsc/bigwigaverageoverbed/main.nf +++ b/modules/ucsc/bigwigaverageoverbed/main.nf @@ -4,6 +4,8 @@ include { initOptions; saveFiles; getSoftwareName; getProcessName } from './func params.options = [:] options = initOptions(params.options) +def VERSION = '377' + process UCSC_BIGWIGAVERAGEOVERBED { tag "$meta.id" label 'process_medium' @@ -23,19 +25,23 @@ process UCSC_BIGWIGAVERAGEOVERBED { path bigwig output: - tuple val(meta), path("*.tab") , emit: tab - path "versions.yml" , emit: version + tuple val(meta), path("*.tab"), emit: tab + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ # there is a bug that bigWigAverageOverBed can not handle ensembl seqlevels style. - bigWigAverageOverBed ${options.args} $bigwig $bed ${bed.getSimpleName()}.tab + bigWigAverageOverBed \\ + $options.args \\ + $bigwig \\ + $bed \\ + ${prefix}.tab cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(bigWigAverageOverBed 2>&1 | sed 's/bigWigAverageOverBed v//; s/ - Compute.*\$//') + ${getSoftwareName(task.process)}: \$(echo $VERSION) END_VERSIONS """ } diff --git a/modules/unicycler/main.nf b/modules/unicycler/main.nf index 2b031c42..1dd97c40 100644 --- a/modules/unicycler/main.nf +++ b/modules/unicycler/main.nf @@ -44,7 +44,7 @@ process UNICYCLER { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(unicycler --version 2>&1 | sed 's/^.*Unicycler v//; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(unicycler --version 2>&1) | sed 's/^.*Unicycler v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/yara/index/main.nf b/modules/yara/index/main.nf index c621e866..e99d99ba 100644 --- a/modules/yara/index/main.nf +++ b/modules/yara/index/main.nf @@ -22,21 +22,25 @@ process YARA_INDEX { path fasta output: - path "yara", emit: index - path "versions.yml" , emit: version + path "yara" , emit: index + path "versions.yml", emit: version script: def software = getSoftwareName(task.process) """ mkdir yara - yara_indexer $fasta -o "yara" + + yara_indexer \\ + $fasta \\ + -o "yara" + mv *.{lf,rid,sa,txt}.* yara cp $fasta yara/yara.fasta cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(yara_indexer --help 2>&1 | grep -e "yara_indexer version:" | sed 's/yara_indexer version: //g') + ${getSoftwareName(task.process)}: \$(echo \$(yara_indexer --version 2>&1) | sed 's/^.*yara_indexer version: //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/yara/mapper/main.nf b/modules/yara/mapper/main.nf index 3404d591..88e3d411 100644 --- a/modules/yara/mapper/main.nf +++ b/modules/yara/mapper/main.nf @@ -24,31 +24,44 @@ process YARA_MAPPER { output: tuple val(meta), path("*.mapped.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + if (meta.single_end) { + """ + yara_mapper \\ + $options.args \\ + -t $task.cpus \\ + -f bam \\ + ${index}/yara \\ + $reads | samtools view -@ $task.cpus -hb -F4 > ${prefix}.mapped.bam - if(meta.single_end) { - """ - yara_mapper $options.args -t ${task.cpus} -f bam ${index}/yara $reads | samtools view -@ ${task.cpus} -hb -F4 > ${prefix}.mapped.bam - - cat <<-END_VERSIONS > versions.yml - ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(yara_mapper --help 2>&1) - END_VERSIONS - """ + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(yara_mapper --version 2>&1) | sed 's/^.*yara_mapper version: //; s/ .*\$//') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } else { - """ - yara_mapper $options.args -t ${task.cpus} -f bam ${index}/yara ${reads[0]} ${reads[1]} > output.bam - samtools view -@ ${task.cpus} -hF 4 -f 0x40 -b output.bam > ${prefix}_1.mapped.bam - samtools view -@ ${task.cpus} -hF 4 -f 0x80 -b output.bam > ${prefix}_2.mapped.bam - cat <<-END_VERSIONS > versions.yml - ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(yara_mapper --version 2>&1 | grep -e "yara_mapper version:" | sed 's/yara_mapper version: //g') - END_VERSIONS - """ - } + """ + yara_mapper \\ + $options.args \\ + -t ${task.cpus} \\ + -f bam \\ + ${index}/yara \\ + ${reads[0]} \\ + ${reads[1]} > output.bam + samtools view -@ $task.cpus -hF 4 -f 0x40 -b output.bam > ${prefix}_1.mapped.bam + samtools view -@ $task.cpus -hF 4 -f 0x80 -b output.bam > ${prefix}_2.mapped.bam + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(yara_mapper --version 2>&1) | sed 's/^.*yara_mapper version: //; s/ .*\$//') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ + } } diff --git a/tests/modules/seacr/callpeak/main.nf b/tests/modules/seacr/callpeak/main.nf index 82fd6eb3..7e9cef8a 100644 --- a/tests/modules/seacr/callpeak/main.nf +++ b/tests/modules/seacr/callpeak/main.nf @@ -5,10 +5,11 @@ nextflow.enable.dsl = 2 include { SEACR_CALLPEAK } from '../../../../modules/seacr/callpeak/main.nf' addParams( options: [ args:'norm stringent' ] ) workflow test_seacr_callpeak { - input = [ [ id:'test_1'], - file("${launchDir}/tests/data/generic/bedgraph/K27me3_1_to_chr20.bedgraph", checkIfExists: true), - file("${launchDir}/tests/data/generic/bedgraph/IgG_1_to_chr20.bedgraph", checkIfExists: true) - ] + input = [ + [ id:'test_1'], + file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/bedgraph/K27me3_1_to_chr20.bedgraph", checkIfExists: true), + file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/bedgraph/IgG_1_to_chr20.bedgraph", checkIfExists: true) + ] SEACR_CALLPEAK ( input ) } diff --git a/tests/modules/seqkit/split2/test.yml b/tests/modules/seqkit/split2/test.yml index b3e0e020..13f3b003 100644 --- a/tests/modules/seqkit/split2/test.yml +++ b/tests/modules/seqkit/split2/test.yml @@ -4,9 +4,9 @@ - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz + - path: output/seqkit/test/test_1.part_001.fastq.gz md5sum: 6f7d58ba35c254c0817fe9a7c69862e4 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz + - path: output/seqkit/test/test_1.part_002.fastq.gz md5sum: cf38c51506e45380fe25abdd1bd5ccc6 - name: seqkit split2 single-end size @@ -15,9 +15,9 @@ - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz + - path: output/seqkit/test/test_1.part_001.fastq.gz md5sum: bf835e685d597fc1ab5e5ac7dd689619 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz + - path: output/seqkit/test/test_1.part_002.fastq.gz md5sum: 703d95ff4fbb5b7fb4da8a164ba9aa54 - name: seqkit split2 single-end part @@ -26,11 +26,11 @@ - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz + - path: output/seqkit/test/test_1.part_001.fastq.gz md5sum: fa25951435471238d5567fd2cae31f55 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz + - path: output/seqkit/test/test_1.part_002.fastq.gz md5sum: 1dcf631aaaa5e7e0bd6c9668fbc6e04a - - path: output/seqkit/test.split/test_1.part_003.fastq.gz + - path: output/seqkit/test/test_1.part_003.fastq.gz md5sum: 8bc86ba83a611c54f592f4eae19b680f - name: seqkit split2 paired-end length @@ -39,13 +39,13 @@ - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz + - path: output/seqkit/test/test_1.part_001.fastq.gz md5sum: 6f7d58ba35c254c0817fe9a7c69862e4 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz + - path: output/seqkit/test/test_1.part_002.fastq.gz md5sum: cf38c51506e45380fe25abdd1bd5ccc6 - - path: output/seqkit/test.split/test_2.part_001.fastq.gz + - path: output/seqkit/test/test_2.part_001.fastq.gz md5sum: 6b094b1ba7c439fe44c1bb5e99a02ba4 - - path: output/seqkit/test.split/test_2.part_002.fastq.gz + - path: output/seqkit/test/test_2.part_002.fastq.gz md5sum: 927097c6ac7522199a9e016333181a8e - name: seqkit split2 paired-end size @@ -54,13 +54,13 @@ - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz + - path: output/seqkit/test/test_1.part_001.fastq.gz md5sum: bf835e685d597fc1ab5e5ac7dd689619 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz + - path: output/seqkit/test/test_1.part_002.fastq.gz md5sum: 703d95ff4fbb5b7fb4da8a164ba9aa54 - - path: output/seqkit/test.split/test_2.part_001.fastq.gz + - path: output/seqkit/test/test_2.part_001.fastq.gz md5sum: 09d0dd83b5b1b9b95d316eeed79ea5ba - - path: output/seqkit/test.split/test_2.part_002.fastq.gz + - path: output/seqkit/test/test_2.part_002.fastq.gz md5sum: 8796c3f327b1094244bfcdb36d536526 - name: seqkit split2 paired-end part @@ -69,15 +69,15 @@ - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz + - path: output/seqkit/test/test_1.part_001.fastq.gz md5sum: fa25951435471238d5567fd2cae31f55 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz + - path: output/seqkit/test/test_1.part_002.fastq.gz md5sum: 1dcf631aaaa5e7e0bd6c9668fbc6e04a - - path: output/seqkit/test.split/test_1.part_003.fastq.gz + - path: output/seqkit/test/test_1.part_003.fastq.gz md5sum: 8bc86ba83a611c54f592f4eae19b680f - - path: output/seqkit/test.split/test_2.part_001.fastq.gz + - path: output/seqkit/test/test_2.part_001.fastq.gz md5sum: f0055c99cd193fd97466b3cde9dd1b8f - - path: output/seqkit/test.split/test_2.part_002.fastq.gz + - path: output/seqkit/test/test_2.part_002.fastq.gz md5sum: 8a90df768201785f7a7cd5dbb41e846a - - path: output/seqkit/test.split/test_2.part_003.fastq.gz + - path: output/seqkit/test/test_2.part_003.fastq.gz md5sum: 890b90083e8e1606bd13ba34149cedd7 diff --git a/tests/modules/sequenzautils/bam2seqz/test.yml b/tests/modules/sequenzautils/bam2seqz/test.yml index d8a21430..0b9cac53 100644 --- a/tests/modules/sequenzautils/bam2seqz/test.yml +++ b/tests/modules/sequenzautils/bam2seqz/test.yml @@ -4,5 +4,5 @@ - sequenzautils - sequenzautils/bam2seqz files: - - path: output/sequenzautils/test.seqz.gz + - path: output/sequenzautils/test.gz md5sum: 12b41979a498ac10c0aff162b12e6a6e diff --git a/tests/modules/ucsc/bigwigaverageoverbed/main.nf b/tests/modules/ucsc/bigwigaverageoverbed/main.nf index 88310a0b..9bd5a5e2 100644 --- a/tests/modules/ucsc/bigwigaverageoverbed/main.nf +++ b/tests/modules/ucsc/bigwigaverageoverbed/main.nf @@ -5,9 +5,10 @@ nextflow.enable.dsl = 2 include { UCSC_BIGWIGAVERAGEOVERBED } from '../../../../modules/ucsc/bigwigaverageoverbed/main.nf' addParams( options: [:] ) workflow test_ucsc_bigwigaverageoverbed { - input = [ [ id: 'test' ], // meta map - [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true ) ] - ] + input = [ + [ id: 'test' ], // meta map + [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true ) ] + ] bigwig = file(params.test_data['sarscov2']['illumina']['test_bigwig'], checkIfExists: true) UCSC_BIGWIGAVERAGEOVERBED ( input, bigwig ) diff --git a/tests/modules/yara/index/main.nf b/tests/modules/yara/index/main.nf index dcedc61b..35a86182 100644 --- a/tests/modules/yara/index/main.nf +++ b/tests/modules/yara/index/main.nf @@ -2,11 +2,11 @@ nextflow.enable.dsl = 2 -include { YARA_INDEX } from '../../../../modules/yara/index/main.nf' addParams( options: [:] ) +include { YARA_INDEX } from '../../../../modules/yara/index/main.nf' addParams( options: [publish_dir:'yara'] ) workflow test_yara_index { - def input = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + input = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) YARA_INDEX ( input ) } diff --git a/tests/modules/yara/index/test.yml b/tests/modules/yara/index/test.yml index 384aeee8..de6f1cf6 100644 --- a/tests/modules/yara/index/test.yml +++ b/tests/modules/yara/index/test.yml @@ -4,27 +4,27 @@ - yara/index - yara files: - - path: output/index/yara/yara.rid.limits + - path: output/yara/yara/yara.rid.limits md5sum: 8b814661f30a0c9e350bfbcb454930ce - - path: output/index/yara/yara.sa.len + - path: output/yara/yara/yara.sa.len md5sum: 45677f66c28c79c02250ceb8b58645e8 - - path: output/index/yara/yara.sa.ind + - path: output/yara/yara/yara.sa.ind md5sum: 464314583efb5f07260b0efecc29a1ce - - path: output/index/yara/yara.lf.drp + - path: output/yara/yara/yara.lf.drp md5sum: 3ef99a87a4e44513f46d42f4261f7842 - - path: output/index/yara/yara.txt.size + - path: output/yara/yara/yara.txt.size md5sum: 063987b3c3f747be7d2b8043c9d91000 - - path: output/index/yara/yara.rid.concat + - path: output/yara/yara/yara.rid.concat md5sum: 1e4e4c88ddeaf907a12f02f0d88367c5 - - path: output/index/yara/yara.txt.concat + - path: output/yara/yara/yara.txt.concat md5sum: 6074d1933c9e7e5ab05fa0def5ce28c0 - - path: output/index/yara/yara.lf.drs + - path: output/yara/yara/yara.lf.drs md5sum: 55a54008ad1ba589aa210d2629c1df41 - - path: output/index/yara/yara.txt.limits + - path: output/yara/yara/yara.txt.limits md5sum: 4480a068db603e4c9a27bc4fa9ceaf14 - - path: output/index/yara/yara.sa.val + - path: output/yara/yara/yara.sa.val md5sum: ce57cc82e2d3ae7b9824210f54168ce9 - - path: output/index/yara/yara.lf.pst + - path: output/yara/yara/yara.lf.pst md5sum: e8daba34298e99e42942435286f9b3f0 - - path: output/index/yara/yara.lf.drv + - path: output/yara/yara/yara.lf.drv md5sum: cf6408307fe9fd7f99c33f521bf95550 From 512f5dfc27397cae436d9fc2e82aa055fc89d31a Mon Sep 17 00:00:00 2001 From: Gregor Sturm Date: Tue, 28 Sep 2021 16:51:35 +0200 Subject: [PATCH 10/61] Better error message for FileNotFoundErrors (#755) * Better error message for FileNotFoundErrors * Update tests/test_versions_yml.py Co-authored-by: James A. Fellows Yates * Update test_versions_yml.py Co-authored-by: James A. Fellows Yates --- tests/test_versions_yml.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/test_versions_yml.py b/tests/test_versions_yml.py index c3944a0f..b6392b87 100644 --- a/tests/test_versions_yml.py +++ b/tests/test_versions_yml.py @@ -2,6 +2,7 @@ from pathlib import Path import pytest import yaml import re +from textwrap import dedent def _get_workflow_names(): @@ -21,7 +22,22 @@ def _get_workflow_names(): def test_ensure_valid_version_yml(workflow_dir): workflow_dir = Path(workflow_dir) software_name = workflow_dir.name.split("_")[0].lower() - versions_yml = (workflow_dir / f"output/{software_name}/versions.yml").read_text() + try: + versions_yml_file = workflow_dir / f"output/{software_name}/versions.yml" + versions_yml = versions_yml_file.read_text() + except FileNotFoundError: + raise AssertionError( + dedent( + f"""\ + `versions.yml` not found in the output directory. + Expected path: `{versions_yml_file}` + + This can have multiple reasons: + * The test-workflow failed before a `versions.yml` could be generated. + * The workflow name in `test.yml` does not start with the tool name. + """ + ) + ) assert ( "END_VERSIONS" not in versions_yml @@ -29,7 +45,9 @@ def test_ensure_valid_version_yml(workflow_dir): # Raises an exception if yaml is not valid versions = yaml.safe_load(versions_yml) - assert len(versions) == 1, "The top-level of versions.yml must contain exactely one entry: the process name as dict key" + assert ( + len(versions) == 1 + ), "The top-level of versions.yml must contain exactly one entry: the process name as dict key" software_versions = next(iter(versions.values())) assert len(software_versions), "There must be at least one version emitted." for tool, version in software_versions.items(): From cde1d827f993f71ac5e07de4381d80f81d4f813e Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Tue, 28 Sep 2021 18:33:07 +0200 Subject: [PATCH 11/61] Fix yml ver (#756) * Fix kallisto index tests * Fix nanoplot * Fix kallistobustools * Fix pairix * Fix plasmidid * Fix pbccs * Fix raxmlng * Fix prokka * Fix shovill * Fix typo * Deleted workflow by mistake added again --- modules/kallisto/index/main.nf | 2 +- modules/kallisto/index/meta.yml | 4 ++-- modules/kallistobustools/count/main.nf | 2 +- modules/kallistobustools/ref/main.nf | 4 ++-- modules/nanoplot/main.nf | 2 +- modules/pairix/main.nf | 2 +- modules/pbccs/main.nf | 2 +- modules/plasmidid/main.nf | 2 +- modules/raxmlng/main.nf | 2 +- tests/modules/kallisto/index/main.nf | 2 +- tests/modules/kallistobustools/count/main.nf | 2 +- tests/modules/kallistobustools/ref/main.nf | 1 + tests/modules/plasmidid/test.yml | 2 -- 13 files changed, 14 insertions(+), 15 deletions(-) diff --git a/modules/kallisto/index/main.nf b/modules/kallisto/index/main.nf index 00ae9601..801f339e 100644 --- a/modules/kallisto/index/main.nf +++ b/modules/kallisto/index/main.nf @@ -36,7 +36,7 @@ process KALLISTO_INDEX { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(kallisto 2>&1 | sed 's/^kallisto //; s/Usage.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(kallisto 2>&1) | sed 's/^kallisto //; s/Usage.*\$//') END_VERSIONS """ } diff --git a/modules/kallisto/index/meta.yml b/modules/kallisto/index/meta.yml index ba4855b0..6080eb77 100644 --- a/modules/kallisto/index/meta.yml +++ b/modules/kallisto/index/meta.yml @@ -1,7 +1,7 @@ name: kallisto_index -description: write your description here +description: Create kallisto index keywords: - - sort + - index tools: - kallisto: description: Quantifying abundances of transcripts from bulk and single-cell RNA-Seq data, or more generally of target sequences using high-throughput sequencing reads. diff --git a/modules/kallistobustools/count/main.nf b/modules/kallistobustools/count/main.nf index 309bd57c..b0dd3a06 100644 --- a/modules/kallistobustools/count/main.nf +++ b/modules/kallistobustools/count/main.nf @@ -53,7 +53,7 @@ process KALLISTOBUSTOOLS_COUNT { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(kb 2>&1 | sed 's/^.*kb_python //;s/positional arguments.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(kb --version 2>&1) | sed 's/^.*kb_python //;s/positional arguments.*\$//') END_VERSIONS """ } diff --git a/modules/kallistobustools/ref/main.nf b/modules/kallistobustools/ref/main.nf index bc9b32f5..c8e02687 100644 --- a/modules/kallistobustools/ref/main.nf +++ b/modules/kallistobustools/ref/main.nf @@ -47,7 +47,7 @@ process KALLISTOBUSTOOLS_REF { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(kb 2>&1 | sed 's/^.*kb_python //;s/positional arguments.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(kb --version 2>&1) | sed 's/^.*kb_python //;s/positional arguments.*\$//') END_VERSIONS """ } else { @@ -66,7 +66,7 @@ process KALLISTOBUSTOOLS_REF { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(kb 2>&1 | sed 's/^.*kb_python //;s/positional arguments.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(kb --version 2>&1) | sed 's/^.*kb_python //;s/positional arguments.*\$//') END_VERSIONS """ } diff --git a/modules/nanoplot/main.nf b/modules/nanoplot/main.nf index 86b300f5..e36b2da2 100644 --- a/modules/nanoplot/main.nf +++ b/modules/nanoplot/main.nf @@ -39,7 +39,7 @@ process NANOPLOT { $input_file cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(NanoPlot --version 2>&1 | sed 's/^.*NanoPlot //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(NanoPlot --version 2>&1) | sed 's/^.*NanoPlot //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/pairix/main.nf b/modules/pairix/main.nf index 684ea7e6..c00af657 100644 --- a/modules/pairix/main.nf +++ b/modules/pairix/main.nf @@ -34,7 +34,7 @@ process PAIRIX { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(pairix --help 2>&1 | sed 's/^.*Version: //; s/Usage.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(pairix --help 2>&1) | sed 's/^.*Version: //; s/Usage.*\$//') END_VERSIONS """ } diff --git a/modules/pbccs/main.nf b/modules/pbccs/main.nf index ccf17cc4..5df852cf 100644 --- a/modules/pbccs/main.nf +++ b/modules/pbccs/main.nf @@ -51,7 +51,7 @@ process PBCCS { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(ccs --version 2>&1 | grep -e 'commit') + ${getSoftwareName(task.process)}: \$(echo \$(ccs --version 2>&1) | grep 'ccs' | sed 's/^.*ccs //; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/plasmidid/main.nf b/modules/plasmidid/main.nf index 8be58c57..792b3c12 100644 --- a/modules/plasmidid/main.nf +++ b/modules/plasmidid/main.nf @@ -47,7 +47,7 @@ process PLASMIDID { mv NO_GROUP/$prefix ./$prefix cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(plasmidID --version 2>&1) + ${getSoftwareName(task.process)}: \$(echo \$(plasmidID --version 2>&1)) END_VERSIONS """ } diff --git a/modules/raxmlng/main.nf b/modules/raxmlng/main.nf index 7094eaa7..e3bde2f3 100644 --- a/modules/raxmlng/main.nf +++ b/modules/raxmlng/main.nf @@ -36,7 +36,7 @@ process RAXMLNG { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(raxml-ng --version 2>&1 | sed 's/^.*RAxML-NG v. //; s/released.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(raxml-ng --version 2>&1) | sed 's/^.*RAxML-NG v. //; s/released.*\$//') END_VERSIONS """ } diff --git a/tests/modules/kallisto/index/main.nf b/tests/modules/kallisto/index/main.nf index bab78f51..7c6078f8 100644 --- a/tests/modules/kallisto/index/main.nf +++ b/tests/modules/kallisto/index/main.nf @@ -7,7 +7,7 @@ include { KALLISTO_INDEX } from '../../../../modules/kallisto/index/main.nf' add workflow test_kallisto_index { def input = [] - input = file("${launchDir}/tests/data/genomics/sarscov2/genome/genome.fasta", checkIfExists: true) + input = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) KALLISTO_INDEX ( input ) } diff --git a/tests/modules/kallistobustools/count/main.nf b/tests/modules/kallistobustools/count/main.nf index 4400976a..9172ddfc 100644 --- a/tests/modules/kallistobustools/count/main.nf +++ b/tests/modules/kallistobustools/count/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { KALLISTOBUSTOOLS_COUNT } from '../../../../modules/kallistobustools/count/main.nf' addParams( options: [args:"--cellranger"] ) +include { KALLISTOBUSTOOLS_COUNT } from '../../../../modules/kallistobustools/count/main.nf' addParams( options: [args:"--cellranger -m 1"] ) workflow test_kallistobustools_count { diff --git a/tests/modules/kallistobustools/ref/main.nf b/tests/modules/kallistobustools/ref/main.nf index 1ecfa339..31b36d0d 100644 --- a/tests/modules/kallistobustools/ref/main.nf +++ b/tests/modules/kallistobustools/ref/main.nf @@ -30,3 +30,4 @@ workflow test_kallistobustools_ref_nucleus { KALLISTOBUSTOOLS_REF( fasta, gtf, workflow) } + diff --git a/tests/modules/plasmidid/test.yml b/tests/modules/plasmidid/test.yml index dd472a72..838af394 100644 --- a/tests/modules/plasmidid/test.yml +++ b/tests/modules/plasmidid/test.yml @@ -12,7 +12,6 @@ - path: output/plasmidid/test/data/test.fna md5sum: 503a5e1d4654bb2df19420e211070db3 - path: output/plasmidid/test/data/test.gbk - md5sum: c851bba9da6ec72cce591617067df50b - path: output/plasmidid/test/data/test.gff md5sum: 3ed8912ee9b0712ca491fa78ff5f4da1 - path: output/plasmidid/test/data/test.karyotype_individual.txt @@ -28,7 +27,6 @@ - path: output/plasmidid/test/database/test.fna md5sum: 6b843fe652b4369addb382f61952c3dd - path: output/plasmidid/test/database/test.gbk - md5sum: 1f7972ecbb868823727157d2c482700d - path: output/plasmidid/test/database/test.gff md5sum: 7e65da147d0a413020b0d92b7b03ffcd - path: output/plasmidid/test/fasta_files/MT192765.1_term.fasta From c3687ef54bc0f651ea332c228317baf34c643c18 Mon Sep 17 00:00:00 2001 From: Gregor Sturm Date: Tue, 28 Sep 2021 21:25:10 +0200 Subject: [PATCH 12/61] fix more ver yml (#757) * Fix featurecounts * whitespace change to trigger CI on yara/mapper * update test yaml --- modules/subread/featurecounts/main.nf | 2 +- tests/modules/subread/featurecounts/test.yml | 18 +++++++++--------- tests/modules/yara/mapper/main.nf | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/subread/featurecounts/main.nf b/modules/subread/featurecounts/main.nf index 3e2eb765..76209a0d 100644 --- a/modules/subread/featurecounts/main.nf +++ b/modules/subread/featurecounts/main.nf @@ -49,7 +49,7 @@ process SUBREAD_FEATURECOUNTS { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(featureCounts -v 2>&1 | sed -e "s/featureCounts v//g") + ${getSoftwareName(task.process)}: \$( echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g") END_VERSIONS """ } diff --git a/tests/modules/subread/featurecounts/test.yml b/tests/modules/subread/featurecounts/test.yml index 2cba9e15..be6bed47 100644 --- a/tests/modules/subread/featurecounts/test.yml +++ b/tests/modules/subread/featurecounts/test.yml @@ -4,10 +4,10 @@ - subread - subread/featurecounts files: - - path: output/subread/test.featureCounts.txt.summary - md5sum: d78617192451a57f6ef249ddcaf13720 - path: output/subread/test.featureCounts.txt - md5sum: b0a1f7563afe49007f422d4c9ca5ee6c + md5sum: 0012df4c0a0e47eec1440017ab34f75f + - path: output/subread/test.featureCounts.txt.summary + md5sum: 8f602ff9a8ef467af43294e80b367cdf - name: subread featurecounts test_subread_featurecounts_reverse command: nextflow run tests/modules/subread/featurecounts -entry test_subread_featurecounts_reverse -c tests/config/nextflow.config @@ -15,10 +15,10 @@ - subread - subread/featurecounts files: - - path: output/subread/test.featureCounts.txt.summary - md5sum: 4217004d0b55f870f77092364f59e44d - path: output/subread/test.featureCounts.txt - md5sum: 412840a8880cd29674b3d5404d3de19b + md5sum: 8175816b8260ed444d59232bd7e7120b + - path: output/subread/test.featureCounts.txt.summary + md5sum: 7cfa30ad678b9bc1bc63afbb0281547b - name: subread featurecounts test_subread_featurecounts_unstranded command: nextflow run tests/modules/subread/featurecounts -entry test_subread_featurecounts_unstranded -c tests/config/nextflow.config @@ -26,7 +26,7 @@ - subread - subread/featurecounts files: - - path: output/subread/test.featureCounts.txt.summary - md5sum: ee585faeb1edfcd2188a5e486a0e98a9 - path: output/subread/test.featureCounts.txt - md5sum: 6b684e11a1e54bec7e1ee5e3f651d7fd + md5sum: 3307d31b44a5d6bb3389786bb8f4e91f + - path: output/subread/test.featureCounts.txt.summary + md5sum: 23164b79f9f23f11c82820db61a35560 diff --git a/tests/modules/yara/mapper/main.nf b/tests/modules/yara/mapper/main.nf index 06582eb3..9cdce40d 100644 --- a/tests/modules/yara/mapper/main.nf +++ b/tests/modules/yara/mapper/main.nf @@ -3,8 +3,8 @@ nextflow.enable.dsl = 2 -include { YARA_INDEX } from '../../../../modules/yara/index/main.nf' addParams( options: ['args': '-e 3'] ) -include { YARA_MAPPER } from '../../../../modules/yara/mapper/main.nf' addParams( options: ['args': '-e 3'] ) +include { YARA_INDEX } from '../../../../modules/yara/index/main.nf' addParams(options: ['args': '-e 3']) +include { YARA_MAPPER } from '../../../../modules/yara/mapper/main.nf' addParams(options: ['args': '-e 3']) workflow test_yara_single_end { From 5c463ca6b46b0a452253f5ae5ce7b8253674cff0 Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Tue, 28 Sep 2021 13:42:04 -0600 Subject: [PATCH 13/61] few version and test data config fixes (#758) * update kleborate version info * fix stderr capture * few more version fixes * fix version info on more tools --- modules/chromap/chromap/main.nf | 13 +++++-------- modules/delly/call/main.nf | 2 +- modules/ensemblvep/main.nf | 2 +- modules/expansionhunter/main.nf | 2 +- modules/fgbio/callmolecularconsensusreads/main.nf | 3 ++- modules/fgbio/sortbam/main.nf | 2 +- modules/glnexus/main.nf | 3 ++- modules/kleborate/main.nf | 2 +- modules/minia/main.nf | 5 +++-- tests/config/test_data.config | 1 + tests/modules/delly/call/test.yml | 2 +- tests/modules/hifiasm/main.nf | 4 ++-- 12 files changed, 21 insertions(+), 20 deletions(-) diff --git a/modules/chromap/chromap/main.nf b/modules/chromap/chromap/main.nf index 00aae27e..c7b0a5a3 100644 --- a/modules/chromap/chromap/main.nf +++ b/modules/chromap/chromap/main.nf @@ -41,9 +41,7 @@ process CHROMAP_CHROMAP { def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def args = options.args.tokenize() - def file_extension = options.args.contains("--SAM")? 'sam' : - options.args.contains("--TagAlign")? 'tagAlign' : - options.args.contains("--pairs")? 'pairs' : 'bed' + def file_extension = options.args.contains("--SAM") ? 'sam' : options.args.contains("--TagAlign")? 'tagAlign' : options.args.contains("--pairs")? 'pairs' : 'bed' if (barcodes) { args << "-b ${barcodes.join(',')}" if (whitelist) { @@ -56,9 +54,8 @@ process CHROMAP_CHROMAP { if (pairs_chr_order){ args << "--pairs-natural-chr-order $pairs_chr_order" } - def compression_cmds = """ - gzip ${prefix}.${file_extension} - """ + def final_args = args.join(' ') + def compression_cmds = "gzip ${prefix}.${file_extension}" if (options.args.contains("--SAM")) { compression_cmds = """ samtools view $options.args2 -@ ${task.cpus} -bh \\ @@ -68,7 +65,7 @@ process CHROMAP_CHROMAP { } if (meta.single_end) { """ - chromap ${args.join(' ')} \\ + chromap ${final_args} \\ -t $task.cpus \\ -x $index \\ -r $fasta \\ @@ -84,7 +81,7 @@ process CHROMAP_CHROMAP { """ } else { """ - chromap ${args.join(' ')} \\ + chromap ${final_args} \\ -t $task.cpus \\ -x $index \\ -r $fasta \\ diff --git a/modules/delly/call/main.nf b/modules/delly/call/main.nf index f97ddeb0..0688949e 100644 --- a/modules/delly/call/main.nf +++ b/modules/delly/call/main.nf @@ -41,7 +41,7 @@ process DELLY_CALL { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(delly --version 2>&1 | sed 's/^.*Delly //; s/Using.*\$//') + ${getSoftwareName(task.process)}: \$( echo \$(delly --version 2>&1) | sed 's/^.*Delly version: v//; s/ using.*\$//') END_VERSIONS """ } diff --git a/modules/ensemblvep/main.nf b/modules/ensemblvep/main.nf index 32acc4dd..17eaf720 100644 --- a/modules/ensemblvep/main.nf +++ b/modules/ensemblvep/main.nf @@ -59,7 +59,7 @@ process ENSEMBLVEP { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(vep --help 2>&1) + ${getSoftwareName(task.process)}: \$( echo \$(vep --help 2>&1) | sed 's/^.*Versions:.*ensembl-vep : //;s/ .*\$//') END_VERSIONS """ } diff --git a/modules/expansionhunter/main.nf b/modules/expansionhunter/main.nf index 7ee97c5a..1c02f404 100644 --- a/modules/expansionhunter/main.nf +++ b/modules/expansionhunter/main.nf @@ -42,7 +42,7 @@ process EXPANSIONHUNTER { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(ExpansionHunter --version 2>&1 | sed 's/^.*ExpansionHunter //') + ${getSoftwareName(task.process)}: \$( echo \$(ExpansionHunter --version 2>&1) | sed 's/^.*ExpansionHunter v//') END_VERSIONS """ } diff --git a/modules/fgbio/callmolecularconsensusreads/main.nf b/modules/fgbio/callmolecularconsensusreads/main.nf index ba099d8d..a3d047a7 100644 --- a/modules/fgbio/callmolecularconsensusreads/main.nf +++ b/modules/fgbio/callmolecularconsensusreads/main.nf @@ -33,9 +33,10 @@ process FGBIO_CALLMOLECULARCONSENSUSREADS { -i $bam \\ $options.args \\ -o ${prefix}.bam + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(fgbio --version | sed -e "s/fgbio v//g") + ${getSoftwareName(task.process)}: \$( echo \$(fgbio --version 2>&1 | tr -d '[:cntrl:]' ) | sed -e 's/^.*Version: //;s/\\[.*\$//') END_VERSIONS """ } diff --git a/modules/fgbio/sortbam/main.nf b/modules/fgbio/sortbam/main.nf index 81ac89c2..928765f5 100644 --- a/modules/fgbio/sortbam/main.nf +++ b/modules/fgbio/sortbam/main.nf @@ -35,7 +35,7 @@ process FGBIO_SORTBAM { -o ${prefix}.bam cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(fgbio --version | sed -e "s/fgbio v//g") + ${getSoftwareName(task.process)}: \$( echo \$(fgbio --version 2>&1 | tr -d '[:cntrl:]' ) | sed -e 's/^.*Version: //;s/\\[.*\$//') END_VERSIONS """ } diff --git a/modules/glnexus/main.nf b/modules/glnexus/main.nf index 60f50932..5cff088b 100644 --- a/modules/glnexus/main.nf +++ b/modules/glnexus/main.nf @@ -44,9 +44,10 @@ process GLNEXUS { $options.args \\ ${input.join(' ')} \\ > ${prefix}.bcf + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(glnexus_cli 2>&1 | head -n 1 | sed 's/^.*release //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$( echo \$(glnexus_cli 2>&1) | head -n 1 | sed 's/^.*release v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/kleborate/main.nf b/modules/kleborate/main.nf index 0079071f..5a4be104 100644 --- a/modules/kleborate/main.nf +++ b/modules/kleborate/main.nf @@ -36,7 +36,7 @@ process KLEBORATE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(kleborate -v 2>&1 | sed 's/kleborate //;') + ${getSoftwareName(task.process)}: \$( echo \$(kleborate --version | sed 's/Kleborate v//;')) END_VERSIONS """ } diff --git a/modules/minia/main.nf b/modules/minia/main.nf index 518e8264..9ab344fd 100644 --- a/modules/minia/main.nf +++ b/modules/minia/main.nf @@ -30,8 +30,9 @@ process MINIA { script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def read_list = reads.join(",") """ - echo "${reads.join("\n")}" > input_files.txt + echo "${read_list}" | sed 's/,/\\n/g' > input_files.txt minia \\ $options.args \\ -nb-cores $task.cpus \\ @@ -40,7 +41,7 @@ process MINIA { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(echo \$(minia --version 2>&1) | sed 's/^.*Minia version //; s/ .*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(minia --version 2>&1 | grep Minia) | sed 's/^.*Minia version //;') END_VERSIONS """ } diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 8b246c7c..8d5ecd92 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -180,6 +180,7 @@ params { ccs_fq = "${test_data_dir}/genomics/homo_sapiens/pacbio/fastq/alz.ccs.fastq" ccs_fq_gz = "${test_data_dir}/genomics/homo_sapiens/pacbio/fastq/alz.ccs.fastq.gz" ccs_xml = "${test_data_dir}/genomics/homo_sapiens/pacbio/xml/alz.ccs.consensusreadset.xml" + hifi = "${test_data_dir}/genomics/homo_sapiens/pacbio/fastq/test_hifi.fastq.gz" lima = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.bam" refine = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.bam" cluster = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.bam" diff --git a/tests/modules/delly/call/test.yml b/tests/modules/delly/call/test.yml index 8faeba78..d8750892 100644 --- a/tests/modules/delly/call/test.yml +++ b/tests/modules/delly/call/test.yml @@ -5,6 +5,6 @@ - delly/call files: - path: output/delly/test.bcf - md5sum: b20df3b9086faccd6bfd2641d97712c8 + md5sum: 360c1bf6867f33bd2a868ddfb4d957fc - path: output/delly/test.bcf.csi md5sum: 19e0cdf06c415f4942f6d4dbd5fb7271 diff --git a/tests/modules/hifiasm/main.nf b/tests/modules/hifiasm/main.nf index aeb64fb2..30614389 100644 --- a/tests/modules/hifiasm/main.nf +++ b/tests/modules/hifiasm/main.nf @@ -10,7 +10,7 @@ include { HIFIASM } from '../../../modules/hifiasm/main.nf' addParams( options: workflow test_hifiasm_hifi_only { input = [ [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['pacbio']['test_hifi_fastq_gz'], checkIfExists: true) ] + [ file(params.test_data['homo_sapiens']['pacbio']['hifi'], checkIfExists: true) ] ] HIFIASM ( input, [], [], false ) @@ -22,7 +22,7 @@ workflow test_hifiasm_hifi_only { workflow test_hifiasm_with_parental_reads { input = [ [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['pacbio']['test_hifi_fastq_gz'], checkIfExists: true) ] + [ file(params.test_data['homo_sapiens']['pacbio']['hifi'], checkIfExists: true) ] ] paternal_kmer_dump = file(params.test_data['homo_sapiens']['illumina']['test_yak'], checkIfExists: true) maternal_kmer_dump = file(params.test_data['homo_sapiens']['illumina']['test2_yak'], checkIfExists: true) From b932210f270a1fea1f36c181abfb064448572846 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Tue, 28 Sep 2021 21:14:11 +0100 Subject: [PATCH 14/61] Fix flash and cat/fastq modules (#759) * Fix version commands: round 3 * Fix seqkit/split2 modules * Fix flash and cat/fastq modules * Remove md5sums on gz files --- modules/cat/fastq/main.nf | 13 ++++++++++++- modules/flash/main.nf | 14 +++++++------- tests/modules/cat/fastq/main.nf | 24 +++++++++++++----------- tests/modules/cat/fastq/test.yml | 6 +++--- tests/modules/flash/main.nf | 9 +++++---- tests/modules/flash/test.yml | 9 +++------ 6 files changed, 43 insertions(+), 32 deletions(-) diff --git a/modules/cat/fastq/main.nf b/modules/cat/fastq/main.nf index 55ccca90..712364e1 100644 --- a/modules/cat/fastq/main.nf +++ b/modules/cat/fastq/main.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { initOptions; saveFiles } from './functions' +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' params.options = [:] options = initOptions(params.options) @@ -23,6 +23,7 @@ process CAT_FASTQ { output: tuple val(meta), path("*.merged.fastq.gz"), emit: reads + path "versions.yml" , emit: version script: def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" @@ -31,6 +32,11 @@ process CAT_FASTQ { if (readList.size > 1) { """ cat ${readList.sort().join(' ')} > ${prefix}.merged.fastq.gz + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//') + END_VERSIONS """ } } else { @@ -41,6 +47,11 @@ process CAT_FASTQ { """ cat ${read1.sort().join(' ')} > ${prefix}_1.merged.fastq.gz cat ${read2.sort().join(' ')} > ${prefix}_2.merged.fastq.gz + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//') + END_VERSIONS """ } } diff --git a/modules/flash/main.nf b/modules/flash/main.nf index 8b8d99e4..f9a381e9 100644 --- a/modules/flash/main.nf +++ b/modules/flash/main.nf @@ -21,23 +21,23 @@ process FLASH { tuple val(meta), path(reads) output: - tuple val(meta), path("*.merged.*.fastq.gz"), emit: reads - path "versions.yml" , emit: version + tuple val(meta), path("*.fastq.gz"), emit: reads + path "versions.yml" , emit: version script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def merged = "-o ${prefix}.merged" - def input_reads = "${reads[0]} ${reads[1]}" """ flash \\ $options.args \\ - $merged \\ + -o ${prefix} \\ -z \\ - $input_reads + ${reads[0]} \\ + ${reads[1]} + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(flash --version) + ${getSoftwareName(task.process)}: \$(echo \$(flash --version 2>&1) | sed 's/^.*FLASH v//; s/ .*\$//') END_VERSIONS """ } diff --git a/tests/modules/cat/fastq/main.nf b/tests/modules/cat/fastq/main.nf index de11bcf2..027bd108 100644 --- a/tests/modules/cat/fastq/main.nf +++ b/tests/modules/cat/fastq/main.nf @@ -2,24 +2,26 @@ nextflow.enable.dsl = 2 -include { CAT_FASTQ } from '../../../../modules/cat/fastq/main.nf' addParams( options: [:] ) +include { CAT_FASTQ } from '../../../../modules/cat/fastq/main.nf' addParams( options: [publish_dir:'cat'] ) workflow test_cat_fastq_single_end { - input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true) ] - ] + input = [ + [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true) ] + ] CAT_FASTQ ( input ) } workflow test_cat_fastq_paired_end { - input = [ [ id:'test', single_end:false ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_2_fastq_gz'], checkIfExists: true) ] - ] + input = [ + [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_2_fastq_gz'], checkIfExists: true) ] + ] CAT_FASTQ ( input ) } diff --git a/tests/modules/cat/fastq/test.yml b/tests/modules/cat/fastq/test.yml index 3a23d309..9a5af25c 100644 --- a/tests/modules/cat/fastq/test.yml +++ b/tests/modules/cat/fastq/test.yml @@ -4,7 +4,7 @@ - cat - cat/fastq files: - - path: ./output/merged_fastq/test.merged.fastq.gz + - path: ./output/cat/test.merged.fastq.gz md5sum: 59f6dbe193741bb40f498f254aeb2e99 - name: cat fastq fastqc_paired_end @@ -13,7 +13,7 @@ - cat - cat/fastq files: - - path: ./output/merged_fastq/test_2.merged.fastq.gz + - path: ./output/cat/test_2.merged.fastq.gz md5sum: d2b1a836eef1058738ecab36c907c5ba - - path: ./output/merged_fastq/test_1.merged.fastq.gz + - path: ./output/cat/test_1.merged.fastq.gz md5sum: 59f6dbe193741bb40f498f254aeb2e99 diff --git a/tests/modules/flash/main.nf b/tests/modules/flash/main.nf index e0f5e623..2128650d 100644 --- a/tests/modules/flash/main.nf +++ b/tests/modules/flash/main.nf @@ -5,10 +5,11 @@ nextflow.enable.dsl = 2 include { FLASH } from '../../../modules/flash/main.nf' addParams( options: [args:'-m 20 -M 100'] ) workflow test_flash { - input = [ [ id:'test', single_end:false ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] - ] + input = [ + [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + ] FLASH ( input ) } diff --git a/tests/modules/flash/test.yml b/tests/modules/flash/test.yml index 61ea9eab..31cdaeff 100644 --- a/tests/modules/flash/test.yml +++ b/tests/modules/flash/test.yml @@ -3,9 +3,6 @@ tags: - flash files: - - path: output/flash/test.merged.notCombined_2.fastq.gz - md5sum: 96ec044281fe60e0061976d928810314 - - path: output/flash/test.merged.extendedFrags.fastq.gz - md5sum: da20afa705e8ea881e66960bb75607c9 - - path: output/flash/test.merged.notCombined_1.fastq.gz - md5sum: 32451c87f89172c764bec19136592d29 + - path: output/flash/test.notCombined_2.fastq.gz + - path: output/flash/test.extendedFrags.fastq.gz + - path: output/flash/test.notCombined_1.fastq.gz From b2c2d4deb456d92e21777985bb2eda59002748cc Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 29 Sep 2021 14:27:00 +0100 Subject: [PATCH 15/61] Add custom/dumpsoftwareversions modules for nf-core pipeline template (#761) * Add custom/dumpsoftwareversions modules for nf-core pipeline template * Remove md5sums due to differing NF versions --- .../custom/dumpsoftwareversions/functions.nf | 78 +++++++++++++ modules/custom/dumpsoftwareversions/main.nf | 105 ++++++++++++++++++ modules/custom/dumpsoftwareversions/meta.yml | 33 ++++++ tests/config/pytest_modules.yml | 12 +- .../custom/dumpsoftwareversions/main.nf | 24 ++++ .../custom/dumpsoftwareversions/test.yml | 8 ++ 6 files changed, 256 insertions(+), 4 deletions(-) create mode 100644 modules/custom/dumpsoftwareversions/functions.nf create mode 100644 modules/custom/dumpsoftwareversions/main.nf create mode 100644 modules/custom/dumpsoftwareversions/meta.yml create mode 100644 tests/modules/custom/dumpsoftwareversions/main.nf create mode 100644 tests/modules/custom/dumpsoftwareversions/test.yml diff --git a/modules/custom/dumpsoftwareversions/functions.nf b/modules/custom/dumpsoftwareversions/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/custom/dumpsoftwareversions/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/custom/dumpsoftwareversions/main.nf b/modules/custom/dumpsoftwareversions/main.nf new file mode 100644 index 00000000..79e60cb2 --- /dev/null +++ b/modules/custom/dumpsoftwareversions/main.nf @@ -0,0 +1,105 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process CUSTOM_DUMPSOFTWAREVERSIONS { + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'pipeline_info', meta:[:], publish_by_meta:[]) } + + // Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container + conda (params.enable_conda ? "bioconda::multiqc=1.11" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/multiqc:1.11--pyhdfd78af_0" + } else { + container "quay.io/biocontainers/multiqc:1.11--pyhdfd78af_0" + } + + input: + path versions + + output: + path 'software_versions.yml' , emit: yml + path 'software_versions_mqc.yml', emit: mqc_yaml + path 'versions.yml' , emit: versions + + script: + """ + #!/usr/bin/env python + + import yaml + import platform + from textwrap import dedent + + def _make_versions_html(versions): + 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) + + with open("$versions") as f: + versions = yaml.safe_load(f) + + versions["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) + } + + with open("software_versions.yml", 'w') as f: + yaml.dump(versions, f, default_flow_style=False) + with open("software_versions_mqc.yml", 'w') as f: + yaml.dump(versions_mqc, f, default_flow_style=False) + + yaml_version = {} + yaml_version["${getProcessName(task.process)}"] = { + 'python': platform.python_version(), + 'yaml': yaml.__version__ + } + with open('versions.yml', 'w') as f: + yaml.dump(yaml_version, f, default_flow_style=False) + """ +} diff --git a/modules/custom/dumpsoftwareversions/meta.yml b/modules/custom/dumpsoftwareversions/meta.yml new file mode 100644 index 00000000..1cf61615 --- /dev/null +++ b/modules/custom/dumpsoftwareversions/meta.yml @@ -0,0 +1,33 @@ +name: custom_dumpsoftwareversions +description: Custom module used to dump software versions within the nf-core pipeline template +keywords: + - custom + - 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 + +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" + - version: + type: file + description: File containing software version + pattern: "versions.yml" + +authors: + - "@drpatelh" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 16d4790d..ebe91db0 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -258,6 +258,10 @@ cooler/dump: - modules/cooler/dump/** - tests/modules/cooler/dump/** +custom/dumpsoftwareversions: + - modules/custom/dumpsoftwareversions/** + - tests/modules/custom/dumpsoftwareversions/** + cutadapt: - modules/cutadapt/** - tests/modules/cutadapt/** @@ -286,14 +290,14 @@ delly/call: - modules/delly/call/** - tests/modules/delly/call/** -diamond/blastx: - - modules/diamond/blastx/** - - tests/modules/diamond/blastx/** - diamond/blastp: - modules/diamond/blastp/** - tests/modules/diamond/blastp/** +diamond/blastx: + - modules/diamond/blastx/** + - tests/modules/diamond/blastx/** + diamond/makedb: - modules/diamond/makedb/** - tests/modules/diamond/makedb/** diff --git a/tests/modules/custom/dumpsoftwareversions/main.nf b/tests/modules/custom/dumpsoftwareversions/main.nf new file mode 100644 index 00000000..94dbc5fb --- /dev/null +++ b/tests/modules/custom/dumpsoftwareversions/main.nf @@ -0,0 +1,24 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { FASTQC } from '../../../../modules/fastqc/main.nf' addParams( options: [:] ) +include { MULTIQC } from '../../../../modules/multiqc/main.nf' addParams( options: [:] ) +include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../../../../modules/custom/dumpsoftwareversions/main.nf' addParams( options: [publish_dir:'custom'] ) + +workflow test_custom_dumpsoftwareversions { + input = [ + [ id: 'test', single_end: false ], + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + ] + + FASTQC ( input ) + MULTIQC ( FASTQC.out.zip.collect { it[1] } ) + + ch_software_versions = Channel.empty() + ch_software_versions = ch_software_versions.mix(FASTQC.out.version) + ch_software_versions = ch_software_versions.mix(MULTIQC.out.version) + + CUSTOM_DUMPSOFTWAREVERSIONS ( ch_software_versions.collectFile() ) +} diff --git a/tests/modules/custom/dumpsoftwareversions/test.yml b/tests/modules/custom/dumpsoftwareversions/test.yml new file mode 100644 index 00000000..1815c0ba --- /dev/null +++ b/tests/modules/custom/dumpsoftwareversions/test.yml @@ -0,0 +1,8 @@ +- name: custom dumpsoftwareversions + command: nextflow run ./tests/modules/custom/dumpsoftwareversions -entry test_custom_dumpsoftwareversions -c tests/config/nextflow.config + tags: + - custom + - custom/dumpsoftwareversions + files: + - path: output/custom/software_versions.yml + - path: output/custom/software_versions_mqc.yml From 5a757b2981b634b94015da5969931b96a9f6b8da Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 29 Sep 2021 14:35:43 +0100 Subject: [PATCH 16/61] Fix tyop in custom/dumpsoftwareversions (#762) * Add custom/dumpsoftwareversions modules for nf-core pipeline template * Remove md5sums due to differing NF versions * Fix tyop in custom/dumpsoftwareversions --- modules/custom/dumpsoftwareversions/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/custom/dumpsoftwareversions/main.nf b/modules/custom/dumpsoftwareversions/main.nf index 79e60cb2..94e112f0 100644 --- a/modules/custom/dumpsoftwareversions/main.nf +++ b/modules/custom/dumpsoftwareversions/main.nf @@ -23,7 +23,7 @@ process CUSTOM_DUMPSOFTWAREVERSIONS { output: path 'software_versions.yml' , emit: yml - path 'software_versions_mqc.yml', emit: mqc_yaml + path 'software_versions_mqc.yml', emit: mqc_yml path 'versions.yml' , emit: versions script: From 22ec5c6007159d441585ef54bfa6272b6f93c78a Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Thu, 30 Sep 2021 09:00:33 +0100 Subject: [PATCH 17/61] Dump version for /custom/dumpsoftwareversions module itself (#764) --- modules/custom/dumpsoftwareversions/main.nf | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/custom/dumpsoftwareversions/main.nf b/modules/custom/dumpsoftwareversions/main.nf index 94e112f0..8424ab07 100644 --- a/modules/custom/dumpsoftwareversions/main.nf +++ b/modules/custom/dumpsoftwareversions/main.nf @@ -72,10 +72,16 @@ process CUSTOM_DUMPSOFTWAREVERSIONS { html.append("") return "\\n".join(html) - with open("$versions") as f: - versions = yaml.safe_load(f) + module_versions = {} + module_versions["${getProcessName(task.process)}"] = { + 'python': platform.python_version(), + 'yaml': yaml.__version__ + } - versions["Workflow"] = { + with open("$versions") as f: + workflow_versions = yaml.safe_load(f) | module_versions + + workflow_versions["Workflow"] = { "Nextflow": "$workflow.nextflow.version", "$workflow.manifest.name": "$workflow.manifest.version" } @@ -86,20 +92,15 @@ process CUSTOM_DUMPSOFTWAREVERSIONS { '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) + 'data': _make_versions_html(workflow_versions) } with open("software_versions.yml", 'w') as f: - yaml.dump(versions, f, default_flow_style=False) + yaml.dump(workflow_versions, f, default_flow_style=False) with open("software_versions_mqc.yml", 'w') as f: yaml.dump(versions_mqc, f, default_flow_style=False) - yaml_version = {} - yaml_version["${getProcessName(task.process)}"] = { - 'python': platform.python_version(), - 'yaml': yaml.__version__ - } with open('versions.yml', 'w') as f: - yaml.dump(yaml_version, f, default_flow_style=False) + yaml.dump(module_versions, f, default_flow_style=False) """ } From 216dc8c984bfc65a5865f9c7b2e0c1bf56c9a973 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Thu, 30 Sep 2021 10:26:52 +0200 Subject: [PATCH 18/61] remove cpu restrictions (#760) Co-authored-by: Harshil Patel --- modules/bowtie/align/main.nf | 5 ++--- modules/bowtie2/align/main.nf | 9 ++++----- modules/bwa/mem/main.nf | 5 ++--- modules/bwamem2/mem/main.nf | 5 ++--- modules/bwameth/align/main.nf | 5 ++--- 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/modules/bowtie/align/main.nf b/modules/bowtie/align/main.nf index 060c5fc4..7c71cb82 100644 --- a/modules/bowtie/align/main.nf +++ b/modules/bowtie/align/main.nf @@ -29,7 +29,6 @@ process BOWTIE_ALIGN { tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq script: - def split_cpus = Math.floor(task.cpus/2) def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped.fastq" : '' @@ -37,7 +36,7 @@ process BOWTIE_ALIGN { """ INDEX=`find -L ./ -name "*.3.ebwt" | sed 's/.3.ebwt//'` bowtie \\ - --threads ${split_cpus} \\ + --threads $task.cpus \\ --sam \\ -x \$INDEX \\ -q \\ @@ -45,7 +44,7 @@ process BOWTIE_ALIGN { $options.args \\ $endedness \\ 2> ${prefix}.out \\ - | samtools view $options.args2 -@ ${split_cpus} -bS -o ${prefix}.bam - + | samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam - if [ -f ${prefix}.unmapped.fastq ]; then gzip ${prefix}.unmapped.fastq diff --git a/modules/bowtie2/align/main.nf b/modules/bowtie2/align/main.nf index 00bcf83c..4a972373 100644 --- a/modules/bowtie2/align/main.nf +++ b/modules/bowtie2/align/main.nf @@ -29,7 +29,6 @@ process BOWTIE2_ALIGN { tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq script: - def split_cpus = Math.floor(task.cpus/2) def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { @@ -39,11 +38,11 @@ process BOWTIE2_ALIGN { bowtie2 \\ -x \$INDEX \\ -U $reads \\ - --threads $split_cpus \\ + --threads $task.cpus \\ $unaligned \\ $options.args \\ 2> ${prefix}.bowtie2.log \\ - | samtools view -@ ${split_cpus} $options.args2 -bhS -o ${prefix}.bam - + | samtools view -@ $task.cpus $options.args2 -bhS -o ${prefix}.bam - cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: @@ -60,11 +59,11 @@ process BOWTIE2_ALIGN { -x \$INDEX \\ -1 ${reads[0]} \\ -2 ${reads[1]} \\ - --threads $split_cpus \\ + --threads $task.cpus \\ $unaligned \\ $options.args \\ 2> ${prefix}.bowtie2.log \\ - | samtools view -@ ${split_cpus} $options.args2 -bhS -o ${prefix}.bam - + | samtools view -@ $task.cpus $options.args2 -bhS -o ${prefix}.bam - if [ -f ${prefix}.unmapped.fastq.1.gz ]; then mv ${prefix}.unmapped.fastq.1.gz ${prefix}.unmapped_1.fastq.gz diff --git a/modules/bwa/mem/main.nf b/modules/bwa/mem/main.nf index a081a69a..f20e0c39 100644 --- a/modules/bwa/mem/main.nf +++ b/modules/bwa/mem/main.nf @@ -27,7 +27,6 @@ process BWA_MEM { path "versions.yml" , emit: version script: - def split_cpus = Math.floor(task.cpus/2) def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_group = meta.read_group ? "-R ${meta.read_group}" : "" @@ -37,10 +36,10 @@ process BWA_MEM { bwa mem \\ $options.args \\ $read_group \\ - -t $split_cpus \\ + -t $task.cpus \\ \$INDEX \\ $reads \\ - | samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - + | samtools view $options.args2 -@ $task.cpus -bhS -o ${prefix}.bam - cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: diff --git a/modules/bwamem2/mem/main.nf b/modules/bwamem2/mem/main.nf index d21b8b99..ea584a39 100644 --- a/modules/bwamem2/mem/main.nf +++ b/modules/bwamem2/mem/main.nf @@ -27,7 +27,6 @@ process BWAMEM2_MEM { path "versions.yml" , emit: version script: - def split_cpus = Math.floor(task.cpus/2) def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_group = meta.read_group ? "-R ${meta.read_group}" : "" @@ -38,10 +37,10 @@ process BWAMEM2_MEM { mem \\ $options.args \\ $read_group \\ - -t $split_cpus \\ + -t $task.cpus \\ \$INDEX \\ $reads \\ - | samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - + | samtools view $options.args2 -@ $task.cpus -bhS -o ${prefix}.bam - cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: diff --git a/modules/bwameth/align/main.nf b/modules/bwameth/align/main.nf index 814faa2b..d78055fc 100644 --- a/modules/bwameth/align/main.nf +++ b/modules/bwameth/align/main.nf @@ -27,7 +27,6 @@ process BWAMETH_ALIGN { path "versions.yml" , emit: version script: - def split_cpus = Math.floor(task.cpus/2) def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_group = meta.read_group ? "-R ${meta.read_group}" : "" @@ -37,10 +36,10 @@ process BWAMETH_ALIGN { bwameth.py \\ $options.args \\ $read_group \\ - -t ${split_cpus} \\ + -t $task.cpus \\ --reference \$INDEX \\ $reads \\ - | samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - + | samtools view $options.args2 -@ $task.cpus -bhS -o ${prefix}.bam - cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: From 01cc326c2326d17615857953d81c586e2a3e5c60 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 30 Sep 2021 12:54:16 +0200 Subject: [PATCH 19/61] add Amps (#768) * Specify more guidelines on input channels * Linting * Updates based on code review * Update README.md * Fix broken sentence * Start work, continue once on non-mobile internet * finished and working on conda * Update modules/amps/main.nf Co-authored-by: Jose Espinosa-Carrasco * Apply suggestions from code review Co-authored-by: Jose Espinosa-Carrasco Co-authored-by: Jose Espinosa-Carrasco --- modules/amps/functions.nf | 78 +++++++++++++++++++++++++++++++++ modules/amps/main.nf | 47 ++++++++++++++++++++ modules/amps/meta.yml | 66 ++++++++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/amps/main.nf | 32 ++++++++++++++ tests/modules/amps/test.yml | 11 +++++ 6 files changed, 238 insertions(+) create mode 100644 modules/amps/functions.nf create mode 100644 modules/amps/main.nf create mode 100644 modules/amps/meta.yml create mode 100644 tests/modules/amps/main.nf create mode 100644 tests/modules/amps/test.yml diff --git a/modules/amps/functions.nf b/modules/amps/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/amps/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/amps/main.nf b/modules/amps/main.nf new file mode 100644 index 00000000..676435f1 --- /dev/null +++ b/modules/amps/main.nf @@ -0,0 +1,47 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process AMPS { + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:[:], publish_by_meta:[]) } + + conda (params.enable_conda ? "bioconda::hops=0.35" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/hops:0.35--hdfd78af_1" + } else { + container "quay.io/biocontainers/hops:0.35--hdfd78af_1" + } + + input: + path maltextract_results + path taxon_list + val filter + + output: + path "results/heatmap_overview_Wevid.json" , emit: json + path "results/heatmap_overview_Wevid.pdf" , emit: summary_pdf + path "results/heatmap_overview_Wevid.tsv" , emit: tsv + path "results/pdf_candidate_profiles/" , emit: candidate_pdfs + path "versions.yml" , emit: version + + script: + """ + postprocessing.AMPS.r \\ + -r $maltextract_results \\ + -n $taxon_list \\ + -m $filter \\ + -t $task.cpus \\ + -j \\ + $options.args + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + amps: \$(echo \$(hops --version 2>&1) | sed 's/HOPS version//') + END_VERSIONS + """ +} diff --git a/modules/amps/meta.yml b/modules/amps/meta.yml new file mode 100644 index 00000000..62844f6a --- /dev/null +++ b/modules/amps/meta.yml @@ -0,0 +1,66 @@ +name: amps +description: Post-processing script of the MaltExtract component of the HOPS package +keywords: + - malt + - MaltExtract + - HOPS + - amps + - alignment + - metagenomics + - ancient DNA + - aDNA + - palaeogenomics + - archaeogenomics + - microbiome + - authentication + - damage + - edit distance + - post Post-processing + - visualisation +tools: + - amps: + description: Post-processing script of the MaltExtract tool for ancient metagenomics + homepage: "https://github.com/rhuebler/HOPS" + documentation: "https://github.com/keyfm/amps" + tool_dev_url: "https://github.com/keyfm/amps" + doi: "10.1186/s13059-019-1903-0" + licence: ['GPL >=3'] + +input: + - maltextract_results: + type: directory + description: MaltExtract output directory + pattern: "results/" + - taxon_list: + type: file + description: List of target taxa to evaluate used in MaltExtract + pattern: "*.txt" + - filter: + type: string + description: The filter mode used in MaltExtract + pattern: "def_anc|default|scan|ancient|crawl" + +output: + - version: + type: file + description: File containing software version + pattern: "versions.yml" + - json: + type: file + description: Candidate summary heatmap in MultiQC compatible JSON format + pattern: "heatmap_overview_Wevid.json" + - summary_pdf: + type: file + description: Candidate summary heatmap in PDF format + pattern: "heatmap_overview_Wevid.pdf" + - tsv: + type: file + description: Candidate summary heatmap in TSV format + pattern: "heatmap_overview_Wevid.tsv" + - candidate_pdfs: + type: directory + description: Directory of per sample output PDFs organised by reference + pattern: "pdf_candidate_profiles/" + +authors: + - "@jfy133" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index ebe91db0..3dda1d94 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -14,6 +14,10 @@ allelecounter: - modules/allelecounter/** - tests/modules/allelecounter/** +amps: + - modules/amps/** + - tests/modules/amps/** + arriba: - modules/arriba/** - tests/modules/arriba/** diff --git a/tests/modules/amps/main.nf b/tests/modules/amps/main.nf new file mode 100644 index 00000000..7d7a40d1 --- /dev/null +++ b/tests/modules/amps/main.nf @@ -0,0 +1,32 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UNZIP as UNZIP_MALT } from '../../../modules/unzip/main.nf' addParams( options: [:] ) +include { UNZIP as UNZIP_MALTEXTRACT } from '../../../modules/unzip/main.nf' addParams( options: [:] ) +include { MALT_BUILD } from '../../../modules/malt/build/main.nf' addParams( options: [:] ) +include { MALT_RUN } from '../../../modules/malt/run/main.nf' addParams( options: [:] ) +include { MALTEXTRACT } from '../../../modules/maltextract/main.nf' addParams( options: [args: "-f def_anc"] ) +include { AMPS } from '../../../modules/amps/main.nf' addParams( options: [:] ) + + +workflow test_amps { + + fastas = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + gff = [] + seq_type = "DNA" + map_db = file("https://software-ab.informatik.uni-tuebingen.de/download/megan6/megan-nucl-Jan2021.db.zip", checkIfExists: true) + input = file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + mode = "BlastN" + taxon_list = file(params.test_data['sarscov2']['genome']['taxon_list_txt'], checkIfExists: true) + ncbi_dir = file(params.test_data['sarscov2']['genome']['ncbi_taxmap_zip'], checkIfExists: true) + filter = "def_anc" + + UNZIP_MALT ( map_db ) + UNZIP_MALTEXTRACT ( ncbi_dir ) + MALT_BUILD ( fastas, seq_type, gff, UNZIP_MALT.out.unzipped_archive ) + MALT_RUN ( input, mode, MALT_BUILD.out.index ) + MALTEXTRACT ( MALT_RUN.out.rma6, taxon_list, UNZIP_MALTEXTRACT.out.unzipped_archive) + + AMPS ( MALTEXTRACT.out.results, taxon_list, filter ) +} diff --git a/tests/modules/amps/test.yml b/tests/modules/amps/test.yml new file mode 100644 index 00000000..04691f18 --- /dev/null +++ b/tests/modules/amps/test.yml @@ -0,0 +1,11 @@ +- name: amps + command: nextflow run ./tests/modules/amps -entry test_amps -c tests/config/nextflow.config + tags: + - amps + files: + - path: output/amps/results/heatmap_overview_Wevid.json + md5sum: 82f484d02a9e3d0cc3d5bcdcc2965e44 + - path: output/amps/results/heatmap_overview_Wevid.pdf + - path: output/amps/results/heatmap_overview_Wevid.tsv + md5sum: 1a7d565a37ef4d6054f7ade63fbadc2f + - path: output/amps/results/pdf_candidate_profiles/Severe_acute_respiratory_syndrome_coronavirus_2/stp1_test_1.rma6_Severe_acute_respiratory_syndrome_coronavirus_2_summary.pdf From 5b1cea7f7f38b78a8fd8e2b90b1b877bd117ed96 Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Thu, 30 Sep 2021 14:37:35 +0200 Subject: [PATCH 20/61] Add bbmap/bbsplit module (#771) * Add bbmap/bbsplit module * Conda complains about md5sum * Apply suggestions from code review Co-authored-by: Harshil Patel --- modules/bbmap/bbsplit/functions.nf | 78 ++++++++++++++++++++++ modules/bbmap/bbsplit/main.nf | 96 ++++++++++++++++++++++++++++ modules/bbmap/bbsplit/meta.yml | 75 ++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/bbmap/bbsplit/main.nf | 22 +++++++ tests/modules/bbmap/bbsplit/test.yml | 24 +++++++ 6 files changed, 299 insertions(+) create mode 100644 modules/bbmap/bbsplit/functions.nf create mode 100644 modules/bbmap/bbsplit/main.nf create mode 100644 modules/bbmap/bbsplit/meta.yml create mode 100644 tests/modules/bbmap/bbsplit/main.nf create mode 100644 tests/modules/bbmap/bbsplit/test.yml diff --git a/modules/bbmap/bbsplit/functions.nf b/modules/bbmap/bbsplit/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/bbmap/bbsplit/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/bbmap/bbsplit/main.nf b/modules/bbmap/bbsplit/main.nf new file mode 100644 index 00000000..614a4c02 --- /dev/null +++ b/modules/bbmap/bbsplit/main.nf @@ -0,0 +1,96 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process BBMAP_BBSPLIT { + tag "$meta.id" + label 'process_high' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::bbmap=38.93" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/bbmap:38.93--he522d1c_0" + } else { + container "quay.io/biocontainers/bbmap:38.93--he522d1c_0" + } + + input: + tuple val(meta), path(reads) + path index + path primary_ref + tuple val(other_ref_names), path (other_ref_paths) + val only_build_index + + output: + path "bbsplit" , optional:true, emit: index + tuple val(meta), path('*primary*fastq.gz'), optional:true, emit: primary_fastq + tuple val(meta), path('*fastq.gz') , optional:true, emit: all_fastq + tuple val(meta), path('*txt') , optional:true, emit: stats + path "versions.yml" , emit: version + + script: + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + + def avail_mem = 3 + if (!task.memory) { + log.info '[BBSplit] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + + def other_refs = [] + other_ref_names.eachWithIndex { name, index -> + other_refs << "ref_${name}=${other_ref_paths[index]}" + } + if (only_build_index) { + if (primary_ref && other_ref_names && other_ref_paths) { + """ + bbsplit.sh \\ + -Xmx${avail_mem}g \\ + ref_primary=$primary_ref \\ + ${other_refs.join(' ')} \\ + path=bbsplit \\ + threads=$task.cpus \\ + $options.args + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bbversion.sh 2>&1) + END_VERSIONS + """ + } else { + log.error 'ERROR: Please specify as input a primary fasta file along with names and paths to non-primary fasta files.' + } + } else { + def index_files = '' + if (index) { + index_files = "path=$index" + } else if (primary_ref && other_ref_names && other_ref_paths) { + index_files = "ref_primary=${primary_ref} ${other_refs.join(' ')}" + } else { + log.error 'ERROR: Please either specify a BBSplit index as input or a primary fasta file along with names and paths to non-primary fasta files.' + } + def fastq_in = meta.single_end ? "in=${reads}" : "in=${reads[0]} in2=${reads[1]}" + def fastq_out = meta.single_end ? "basename=${prefix}_%.fastq.gz" : "basename=${prefix}_%_#.fastq.gz" + """ + bbsplit.sh \\ + -Xmx${avail_mem}g \\ + $index_files \\ + threads=$task.cpus \\ + $fastq_in \\ + $fastq_out \\ + refstats=${prefix}.stats.txt \\ + $options.args + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bbversion.sh 2>&1) + END_VERSIONS + """ + } +} diff --git a/modules/bbmap/bbsplit/meta.yml b/modules/bbmap/bbsplit/meta.yml new file mode 100644 index 00000000..2eb3a6c9 --- /dev/null +++ b/modules/bbmap/bbsplit/meta.yml @@ -0,0 +1,75 @@ +name: bbmap_bbsplit +description: write your description here +keywords: + - align + - map + - genome + - reference +tools: + - bbmap: + description: BBMap is a short read aligner, as well as various other bioinformatic tools. + homepage: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ + documentation: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ + tool_dev_url: None + doi: "" + licence: ['UC-LBL license (see package)'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + - index: + type: directory + description: Directory to place generated index + pattern: "*" + - primary_ref: + type: path + description: Path to the primary reference + pattern: "*" + - other_ref_names: + type: list + description: List of other reference ids apart from the primary + - other_ref_paths: + type: list + description: Path to other references paths corresponding to "other_ref_names" + - only_build_index: + type: string + description: true = only build index; false = mapping + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - version: + type: file + description: File containing software version + pattern: "versions.yml" + - index: + type: directory + description: Directory with index files + pattern: "bbsplit" + - primary_fastq: + type: file + description: Output reads that map to the primary reference + pattern: "*primary*fastq.gz" + - all_fastq: + type: file + description: All reads mapping to any of the references + pattern: "*fastq.gz" + - stats: + type: file + description: Tab-delimited text file containing mapping statistics + pattern: "*.txt" + +authors: + - "@joseespinosa" + - "@drpatelh" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 3dda1d94..63152fe0 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -46,6 +46,10 @@ bbmap/bbduk: - modules/bbmap/bbduk/** - tests/modules/bbmap/bbduk/** +bbmap/bbsplit: + - modules/bbmap/bbsplit/** + - tests/modules/bbmap/bbsplit/** + bbmap/index: - modules/bbmap/index/** - tests/modules/bbmap/index/** diff --git a/tests/modules/bbmap/bbsplit/main.nf b/tests/modules/bbmap/bbsplit/main.nf new file mode 100644 index 00000000..1d3c30c1 --- /dev/null +++ b/tests/modules/bbmap/bbsplit/main.nf @@ -0,0 +1,22 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BBMAP_BBSPLIT as BBMAP_BBSPLIT_INDEX } from '../../../../modules/bbmap/bbsplit/main.nf' addParams( options: [:] ) +include { BBMAP_BBSPLIT as BBMAP_BBSPLIT_SPLIT } from '../../../../modules/bbmap/bbsplit/main.nf' addParams( options: [:] ) + +workflow test_bbmap_bbsplit { + + input = [ + [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + bbsplit_fasta_list = [ + ['human'], + file('https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/reference/chr22_23800000-23980000.fa', checkIfExists: true) + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + BBMAP_BBSPLIT_INDEX ( [ [:], [] ], [], fasta, bbsplit_fasta_list, true ) + BBMAP_BBSPLIT_SPLIT ( input, BBMAP_BBSPLIT_INDEX.out.index, fasta, bbsplit_fasta_list, true ) +} diff --git a/tests/modules/bbmap/bbsplit/test.yml b/tests/modules/bbmap/bbsplit/test.yml new file mode 100644 index 00000000..87bdebea --- /dev/null +++ b/tests/modules/bbmap/bbsplit/test.yml @@ -0,0 +1,24 @@ +- name: bbmap bbsplit test_bbmap_bbsplit + command: nextflow run tests/modules/bbmap/bbsplit -entry test_bbmap_bbsplit -c tests/config/nextflow.config + tags: + - bbmap/bbsplit + - bbmap + files: + - path: output/bbmap/bbsplit/ref/genome/1/chr1.chrom.gz + - path: output/bbmap/bbsplit/ref/genome/1/info.txt + contains: + - 'Chromosome' + - path: output/bbmap/bbsplit/ref/genome/1/merged_ref_9222711925172838098.fa.gz + - path: output/bbmap/bbsplit/ref/genome/1/namelist.txt + md5sum: 45e7a4cdc7a11a39ada56844ca3a1e30 + - path: output/bbmap/bbsplit/ref/genome/1/reflist.txt + contains: + - 'genome.fasta' + - path: output/bbmap/bbsplit/ref/genome/1/scaffolds.txt.gz + - path: output/bbmap/bbsplit/ref/genome/1/summary.txt + contains: + - 'scaffolds' + - path: output/bbmap/bbsplit/ref/index/1/chr1_index_k13_c13_b1.block + md5sum: 385913c1e84b77dc7bf36288ee1c8706 + - path: output/bbmap/bbsplit/ref/index/1/chr1_index_k13_c13_b1.block2.gz + md5sum: 9de572b603abe5b6540056db8dee05a5 From de1453396489895eecbdfd72d101a85743f8bea1 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Fri, 1 Oct 2021 13:29:02 +0100 Subject: [PATCH 21/61] Fix version command for qualimap/rnaseq (#779) --- modules/qualimap/rnaseq/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/qualimap/rnaseq/main.nf b/modules/qualimap/rnaseq/main.nf index d1ed1021..fa32a6a7 100644 --- a/modules/qualimap/rnaseq/main.nf +++ b/modules/qualimap/rnaseq/main.nf @@ -54,7 +54,7 @@ process QUALIMAP_RNASEQ { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(qualimap 2>&1 | sed 's/^.*QualiMap v.//; s/Built.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//') END_VERSIONS """ } From 7b3315591a149609e27914965f858c9a7e071564 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Fri, 1 Oct 2021 14:04:56 +0100 Subject: [PATCH 22/61] Remove def software lines and emit versions channel as plural (#780) * Remove def software line * Replace version with versions in emit statement * Fix default software names --- modules/abacas/main.nf | 3 +-- modules/adapterremoval/main.nf | 3 +-- modules/agrvate/main.nf | 3 +-- modules/allelecounter/main.nf | 3 +-- modules/amps/main.nf | 4 ++-- modules/arriba/main.nf | 3 +-- modules/artic/guppyplex/main.nf | 3 +-- modules/artic/minion/main.nf | 3 +-- modules/bamaligncleaner/main.nf | 3 +-- modules/bandage/image/main.nf | 3 +-- modules/bbmap/align/main.nf | 3 +-- modules/bbmap/bbduk/main.nf | 3 +-- modules/bbmap/bbsplit/main.nf | 3 +-- modules/bbmap/index/main.nf | 3 +-- modules/bcftools/concat/main.nf | 3 +-- modules/bcftools/consensus/main.nf | 3 +-- modules/bcftools/filter/main.nf | 3 +-- modules/bcftools/isec/main.nf | 3 +-- modules/bcftools/merge/main.nf | 3 +-- modules/bcftools/mpileup/main.nf | 3 +-- modules/bcftools/norm/main.nf | 3 +-- modules/bcftools/query/main.nf | 3 +-- modules/bcftools/reheader/main.nf | 3 +-- modules/bcftools/stats/main.nf | 3 +-- modules/bcftools/view/main.nf | 3 +-- modules/bedtools/bamtobed/main.nf | 3 +-- modules/bedtools/complement/main.nf | 3 +-- modules/bedtools/genomecov/main.nf | 3 +-- modules/bedtools/getfasta/main.nf | 3 +-- modules/bedtools/intersect/main.nf | 3 +-- modules/bedtools/makewindows/main.nf | 3 +-- modules/bedtools/maskfasta/main.nf | 3 +-- modules/bedtools/merge/main.nf | 3 +-- modules/bedtools/slop/main.nf | 3 +-- modules/bedtools/sort/main.nf | 3 +-- modules/bedtools/subtract/main.nf | 3 +-- modules/bismark/align/main.nf | 3 +-- modules/bismark/deduplicate/main.nf | 3 +-- modules/bismark/genomepreparation/main.nf | 3 +-- modules/bismark/methylationextractor/main.nf | 3 +-- modules/bismark/report/main.nf | 3 +-- modules/bismark/summary/main.nf | 3 +-- modules/blast/blastn/main.nf | 3 +-- modules/blast/makeblastdb/main.nf | 3 +-- modules/bowtie/align/main.nf | 3 +-- modules/bowtie/build/main.nf | 3 +-- modules/bowtie2/align/main.nf | 3 +-- modules/bowtie2/build/main.nf | 3 +-- modules/bwa/aln/main.nf | 3 +-- modules/bwa/index/main.nf | 3 +-- modules/bwa/mem/main.nf | 3 +-- modules/bwa/sampe/main.nf | 3 +-- modules/bwa/samse/main.nf | 3 +-- modules/bwamem2/index/main.nf | 3 +-- modules/bwamem2/mem/main.nf | 3 +-- modules/bwameth/align/main.nf | 3 +-- modules/bwameth/index/main.nf | 3 +-- modules/cat/cat/main.nf | 2 +- modules/cat/fastq/main.nf | 2 +- modules/chromap/chromap/main.nf | 3 +-- modules/chromap/index/main.nf | 3 +-- modules/cnvkit/main.nf | 3 +-- modules/cooler/digest/main.nf | 3 +-- modules/cooler/dump/main.nf | 3 +-- modules/custom/dumpsoftwareversions/main.nf | 6 +++--- modules/cutadapt/main.nf | 3 +-- modules/damageprofiler/main.nf | 3 +-- modules/deeptools/computematrix/main.nf | 3 +-- modules/deeptools/plotfingerprint/main.nf | 3 +-- modules/deeptools/plotheatmap/main.nf | 3 +-- modules/deeptools/plotprofile/main.nf | 3 +-- modules/delly/call/main.nf | 3 +-- modules/diamond/blastp/main.nf | 3 +-- modules/diamond/blastx/main.nf | 3 +-- modules/diamond/makedb/main.nf | 3 +-- modules/dragonflye/main.nf | 3 +-- modules/dshbio/exportsegments/main.nf | 3 +-- modules/dshbio/filterbed/main.nf | 3 +-- modules/dshbio/filtergff3/main.nf | 3 +-- modules/dshbio/splitbed/main.nf | 3 +-- modules/dshbio/splitgff3/main.nf | 3 +-- modules/ensemblvep/main.nf | 3 +-- modules/expansionhunter/main.nf | 3 +-- modules/fastani/main.nf | 3 +-- modules/fastp/main.nf | 3 +-- modules/fastqc/main.nf | 8 ++++---- modules/fasttree/main.nf | 3 +-- modules/fgbio/callmolecularconsensusreads/main.nf | 3 +-- modules/fgbio/sortbam/main.nf | 3 +-- modules/flash/main.nf | 3 +-- modules/gatk4/applybqsr/main.nf | 3 +-- modules/gatk4/baserecalibrator/main.nf | 3 +-- modules/gatk4/bedtointervallist/main.nf | 3 +-- modules/gatk4/createsequencedictionary/main.nf | 3 +-- modules/gatk4/fastqtosam/main.nf | 3 +-- modules/gatk4/getpileupsummaries/main.nf | 3 +-- modules/gatk4/haplotypecaller/main.nf | 3 +-- modules/gatk4/intervallisttools/main.nf | 3 +-- modules/gatk4/markduplicates/main.nf | 3 +-- modules/gatk4/mergebamalignment/main.nf | 3 +-- modules/gatk4/mergevcfs/main.nf | 3 +-- modules/gatk4/mutect2/main.nf | 3 +-- modules/gatk4/revertsam/main.nf | 3 +-- modules/gatk4/samtofastq/main.nf | 3 +-- modules/gatk4/splitncigarreads/main.nf | 3 +-- modules/gatk4/variantfiltration/main.nf | 3 +-- modules/genmap/index/main.nf | 3 +-- modules/genmap/mappability/main.nf | 3 +-- modules/gffread/main.nf | 3 +-- modules/glnexus/main.nf | 3 +-- modules/graphmap2/align/main.nf | 3 +-- modules/graphmap2/index/main.nf | 3 +-- modules/gubbins/main.nf | 3 +-- modules/gunzip/main.nf | 3 +-- modules/hifiasm/main.nf | 3 +-- modules/hisat2/align/main.nf | 3 +-- modules/hisat2/build/main.nf | 3 +-- modules/hisat2/extractsplicesites/main.nf | 3 +-- modules/hmmer/hmmalign/main.nf | 3 +-- modules/homer/annotatepeaks/main.nf | 3 +-- modules/homer/findpeaks/main.nf | 3 +-- modules/homer/maketagdirectory/main.nf | 3 +-- modules/homer/makeucscfile/main.nf | 3 +-- modules/iqtree/main.nf | 3 +-- modules/ivar/consensus/main.nf | 3 +-- modules/ivar/trim/main.nf | 3 +-- modules/ivar/variants/main.nf | 3 +-- modules/kallisto/index/main.nf | 3 +-- modules/kallistobustools/count/main.nf | 3 +-- modules/kallistobustools/ref/main.nf | 3 +-- modules/kleborate/main.nf | 3 +-- modules/kraken2/kraken2/main.nf | 3 +-- modules/last/dotplot/main.nf | 3 +-- modules/last/lastal/main.nf | 3 +-- modules/last/lastdb/main.nf | 3 +-- modules/last/mafconvert/main.nf | 3 +-- modules/last/mafswap/main.nf | 3 +-- modules/last/postmask/main.nf | 3 +-- modules/last/split/main.nf | 3 +-- modules/last/train/main.nf | 3 +-- modules/lima/main.nf | 5 ++--- modules/lofreq/call/main.nf | 3 +-- modules/lofreq/callparallel/main.nf | 3 +-- modules/lofreq/filter/main.nf | 3 +-- modules/lofreq/indelqual/main.nf | 3 +-- modules/macs2/callpeak/main.nf | 3 +-- modules/malt/build/main.nf | 3 +-- modules/malt/run/main.nf | 3 +-- modules/maltextract/main.nf | 3 +-- modules/mash/sketch/main.nf | 3 +-- modules/metaphlan3/main.nf | 3 +-- modules/methyldackel/extract/main.nf | 3 +-- modules/methyldackel/mbias/main.nf | 3 +-- modules/minia/main.nf | 3 +-- modules/minimap2/align/main.nf | 3 +-- modules/minimap2/index/main.nf | 3 +-- modules/mosdepth/main.nf | 3 +-- modules/msisensor/msi/main.nf | 3 +-- modules/msisensor/scan/main.nf | 7 +++---- modules/multiqc/main.nf | 5 ++--- modules/muscle/main.nf | 3 +-- modules/nanolyse/main.nf | 3 +-- modules/nanoplot/main.nf | 3 +-- modules/nextclade/main.nf | 3 +-- modules/optitype/main.nf | 3 +-- modules/pairix/main.nf | 3 +-- modules/pairtools/dedup/main.nf | 3 +-- modules/pairtools/flip/main.nf | 3 +-- modules/pairtools/parse/main.nf | 3 +-- modules/pairtools/restrict/main.nf | 3 +-- modules/pairtools/select/main.nf | 3 +-- modules/pairtools/sort/main.nf | 3 +-- modules/pangolin/main.nf | 3 +-- modules/pbccs/main.nf | 4 +--- modules/phantompeakqualtools/main.nf | 3 +-- modules/picard/collectmultiplemetrics/main.nf | 3 +-- modules/picard/collectwgsmetrics/main.nf | 3 +-- modules/picard/filtersamreads/main.nf | 3 +-- modules/picard/markduplicates/main.nf | 3 +-- modules/picard/mergesamfiles/main.nf | 3 +-- modules/picard/sortsam/main.nf | 3 +-- modules/plasmidid/main.nf | 3 +-- modules/plink/vcf/main.nf | 5 ++--- modules/preseq/lcextrap/main.nf | 3 +-- modules/prodigal/main.nf | 3 +-- modules/prokka/main.nf | 3 +-- modules/pycoqc/main.nf | 3 +-- modules/pydamage/analyze/main.nf | 3 +-- modules/pydamage/filter/main.nf | 3 +-- modules/qcat/main.nf | 3 +-- modules/qualimap/bamqc/main.nf | 3 +-- modules/qualimap/rnaseq/main.nf | 3 +-- modules/quast/main.nf | 3 +-- modules/rapidnj/main.nf | 3 +-- modules/rasusa/main.nf | 3 +-- modules/raxmlng/main.nf | 3 +-- modules/rsem/calculateexpression/main.nf | 3 +-- modules/rsem/preparereference/main.nf | 3 +-- modules/rseqc/bamstat/main.nf | 3 +-- modules/rseqc/inferexperiment/main.nf | 3 +-- modules/rseqc/innerdistance/main.nf | 3 +-- modules/rseqc/junctionannotation/main.nf | 3 +-- modules/rseqc/junctionsaturation/main.nf | 3 +-- modules/rseqc/readdistribution/main.nf | 3 +-- modules/rseqc/readduplication/main.nf | 3 +-- modules/salmon/index/main.nf | 3 +-- modules/salmon/quant/main.nf | 3 +-- modules/samtools/ampliconclip/main.nf | 3 +-- modules/samtools/faidx/main.nf | 3 +-- modules/samtools/fastq/main.nf | 3 +-- modules/samtools/flagstat/main.nf | 3 +-- modules/samtools/idxstats/main.nf | 3 +-- modules/samtools/index/main.nf | 3 +-- modules/samtools/merge/main.nf | 3 +-- modules/samtools/mpileup/main.nf | 3 +-- modules/samtools/sort/main.nf | 3 +-- modules/samtools/stats/main.nf | 3 +-- modules/samtools/view/main.nf | 3 +-- modules/seacr/callpeak/main.nf | 3 +-- modules/seqkit/split2/main.nf | 3 +-- modules/seqtk/sample/main.nf | 3 +-- modules/seqtk/subseq/main.nf | 3 +-- modules/sequenzautils/bam2seqz/main.nf | 3 +-- modules/sequenzautils/gcwiggle/main.nf | 3 +-- modules/seqwish/induce/main.nf | 3 +-- modules/shovill/main.nf | 3 +-- modules/snpdists/main.nf | 3 +-- modules/snpeff/main.nf | 3 +-- modules/snpsites/main.nf | 3 +-- modules/sortmerna/main.nf | 3 +-- modules/spades/main.nf | 3 +-- modules/staphopiasccmec/main.nf | 3 +-- modules/star/align/main.nf | 3 +-- modules/star/genomegenerate/main.nf | 3 +-- modules/strelka/germline/main.nf | 5 ++--- modules/stringtie/merge/main.nf | 3 +-- modules/stringtie/stringtie/main.nf | 3 +-- modules/subread/featurecounts/main.nf | 3 +-- modules/tabix/bgzip/main.nf | 3 +-- modules/tabix/bgziptabix/main.nf | 3 +-- modules/tabix/tabix/main.nf | 3 +-- modules/tiddit/sv/main.nf | 3 +-- modules/trimgalore/main.nf | 3 +-- modules/ucsc/bed12tobigbed/main.nf | 3 +-- modules/ucsc/bedclip/main.nf | 3 +-- modules/ucsc/bedgraphtobigwig/main.nf | 3 +-- modules/ucsc/bigwigaverageoverbed/main.nf | 3 +-- modules/ucsc/wigtobigwig/main.nf | 3 +-- modules/umitools/dedup/main.nf | 3 +-- modules/umitools/extract/main.nf | 3 +-- modules/unicycler/main.nf | 3 +-- modules/untar/main.nf | 3 +-- modules/unzip/main.nf | 3 +-- modules/variantbam/main.nf | 3 +-- modules/vcftools/main.nf | 7 +++---- modules/yara/index/main.nf | 3 +-- modules/yara/mapper/main.nf | 3 +-- 257 files changed, 271 insertions(+), 524 deletions(-) diff --git a/modules/abacas/main.nf b/modules/abacas/main.nf index 307e17d2..bc5440b1 100644 --- a/modules/abacas/main.nf +++ b/modules/abacas/main.nf @@ -24,10 +24,9 @@ process ABACAS { output: tuple val(meta), path('*.abacas*'), emit: results - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ abacas.pl \\ diff --git a/modules/adapterremoval/main.nf b/modules/adapterremoval/main.nf index cbf0957a..fad3963f 100644 --- a/modules/adapterremoval/main.nf +++ b/modules/adapterremoval/main.nf @@ -23,10 +23,9 @@ process ADAPTERREMOVAL { output: tuple val(meta), path('*.fastq.gz'), emit: reads tuple val(meta), path('*.log') , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { diff --git a/modules/agrvate/main.nf b/modules/agrvate/main.nf index 3ca2e0f4..c1a6748e 100644 --- a/modules/agrvate/main.nf +++ b/modules/agrvate/main.nf @@ -24,10 +24,9 @@ process AGRVATE { output: tuple val(meta), path("${fasta.baseName}-results/${fasta.baseName}-summary.tab"), emit: summary path "${fasta.baseName}-results" , emit: results_dir - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ agrvate \\ diff --git a/modules/allelecounter/main.nf b/modules/allelecounter/main.nf index 31ef3f79..5184df7d 100644 --- a/modules/allelecounter/main.nf +++ b/modules/allelecounter/main.nf @@ -24,10 +24,9 @@ process ALLELECOUNTER { output: tuple val(meta), path("*.alleleCount"), emit: allelecount - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ alleleCounter \\ diff --git a/modules/amps/main.nf b/modules/amps/main.nf index 676435f1..f34423b5 100644 --- a/modules/amps/main.nf +++ b/modules/amps/main.nf @@ -27,7 +27,7 @@ process AMPS { path "results/heatmap_overview_Wevid.pdf" , emit: summary_pdf path "results/heatmap_overview_Wevid.tsv" , emit: tsv path "results/pdf_candidate_profiles/" , emit: candidate_pdfs - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: """ @@ -41,7 +41,7 @@ process AMPS { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - amps: \$(echo \$(hops --version 2>&1) | sed 's/HOPS version//') + ${getSoftwareName(task.process)}: \$(echo \$(hops --version 2>&1) | sed 's/HOPS version//') END_VERSIONS """ } diff --git a/modules/arriba/main.nf b/modules/arriba/main.nf index b94c22d9..6abae233 100644 --- a/modules/arriba/main.nf +++ b/modules/arriba/main.nf @@ -26,10 +26,9 @@ process ARRIBA { output: tuple val(meta), path("*.fusions.tsv") , emit: fusions tuple val(meta), path("*.fusions.discarded.tsv"), emit: fusions_fail - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def blacklist = (options.args.contains('-b')) ? '' : '-f blacklist' """ diff --git a/modules/artic/guppyplex/main.nf b/modules/artic/guppyplex/main.nf index 5f91e9e3..87bd99c8 100644 --- a/modules/artic/guppyplex/main.nf +++ b/modules/artic/guppyplex/main.nf @@ -23,10 +23,9 @@ process ARTIC_GUPPYPLEX { output: tuple val(meta), path("*.fastq.gz"), emit: fastq - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ artic \\ diff --git a/modules/artic/minion/main.nf b/modules/artic/minion/main.nf index 2f810ecf..68474f19 100644 --- a/modules/artic/minion/main.nf +++ b/modules/artic/minion/main.nf @@ -40,10 +40,9 @@ process ARTIC_MINION { tuple val(meta), path("${prefix}.pass.vcf.gz") , emit: vcf tuple val(meta), path("${prefix}.pass.vcf.gz.tbi") , emit: tbi tuple val(meta), path("*.json"), optional:true , emit: json - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def version = scheme_version.toString().toLowerCase().replaceAll('v','') def fast5 = params.fast5_dir ? "--fast5-directory $fast5_dir" : "" diff --git a/modules/bamaligncleaner/main.nf b/modules/bamaligncleaner/main.nf index 7372f274..720b495a 100644 --- a/modules/bamaligncleaner/main.nf +++ b/modules/bamaligncleaner/main.nf @@ -23,10 +23,9 @@ process BAMALIGNCLEANER { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ diff --git a/modules/bandage/image/main.nf b/modules/bandage/image/main.nf index d15d4826..b7a30a0b 100644 --- a/modules/bandage/image/main.nf +++ b/modules/bandage/image/main.nf @@ -24,10 +24,9 @@ process BANDAGE_IMAGE { output: tuple val(meta), path('*.png'), emit: png tuple val(meta), path('*.svg'), emit: svg - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ Bandage image $gfa ${prefix}.png $options.args diff --git a/modules/bbmap/align/main.nf b/modules/bbmap/align/main.nf index 63989be0..733fd4d5 100644 --- a/modules/bbmap/align/main.nf +++ b/modules/bbmap/align/main.nf @@ -24,10 +24,9 @@ process BBMAP_ALIGN { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" input = meta.single_end ? "in=${fastq}" : "in=${fastq[0]} in2=${fastq[1]}" diff --git a/modules/bbmap/bbduk/main.nf b/modules/bbmap/bbduk/main.nf index 4f1540dc..d7243fdb 100644 --- a/modules/bbmap/bbduk/main.nf +++ b/modules/bbmap/bbduk/main.nf @@ -24,10 +24,9 @@ process BBMAP_BBDUK { output: tuple val(meta), path('*.fastq.gz'), emit: reads tuple val(meta), path('*.log') , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def raw = meta.single_end ? "in=${reads[0]}" : "in1=${reads[0]} in2=${reads[1]}" def trimmed = meta.single_end ? "out=${prefix}.fastq.gz" : "out1=${prefix}_1.fastq.gz out2=${prefix}_2.fastq.gz" diff --git a/modules/bbmap/bbsplit/main.nf b/modules/bbmap/bbsplit/main.nf index 614a4c02..7a24312b 100644 --- a/modules/bbmap/bbsplit/main.nf +++ b/modules/bbmap/bbsplit/main.nf @@ -30,10 +30,9 @@ process BBMAP_BBSPLIT { tuple val(meta), path('*primary*fastq.gz'), optional:true, emit: primary_fastq tuple val(meta), path('*fastq.gz') , optional:true, emit: all_fastq tuple val(meta), path('*txt') , optional:true, emit: stats - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def avail_mem = 3 diff --git a/modules/bbmap/index/main.nf b/modules/bbmap/index/main.nf index 6f957d03..b9e52ec7 100644 --- a/modules/bbmap/index/main.nf +++ b/modules/bbmap/index/main.nf @@ -23,10 +23,9 @@ process BBMAP_INDEX { output: path 'ref' , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ bbmap.sh \\ ref=${fasta} \\ diff --git a/modules/bcftools/concat/main.nf b/modules/bcftools/concat/main.nf index fab0e83d..48280eea 100644 --- a/modules/bcftools/concat/main.nf +++ b/modules/bcftools/concat/main.nf @@ -23,10 +23,9 @@ process BCFTOOLS_CONCAT { output: tuple val(meta), path("*.gz"), emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bcftools concat \\ diff --git a/modules/bcftools/consensus/main.nf b/modules/bcftools/consensus/main.nf index 29758a4b..954b0eb8 100644 --- a/modules/bcftools/consensus/main.nf +++ b/modules/bcftools/consensus/main.nf @@ -23,10 +23,9 @@ process BCFTOOLS_CONSENSUS { output: tuple val(meta), path('*.fa'), emit: fasta - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ cat $fasta | bcftools consensus $vcf $options.args > ${prefix}.fa diff --git a/modules/bcftools/filter/main.nf b/modules/bcftools/filter/main.nf index 37b7e28b..5323e0fb 100644 --- a/modules/bcftools/filter/main.nf +++ b/modules/bcftools/filter/main.nf @@ -23,10 +23,9 @@ process BCFTOOLS_FILTER { output: tuple val(meta), path("*.gz"), emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bcftools filter \\ diff --git a/modules/bcftools/isec/main.nf b/modules/bcftools/isec/main.nf index f700f35c..cc3e425e 100644 --- a/modules/bcftools/isec/main.nf +++ b/modules/bcftools/isec/main.nf @@ -23,10 +23,9 @@ process BCFTOOLS_ISEC { output: tuple val(meta), path("${prefix}"), emit: results - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bcftools isec \\ diff --git a/modules/bcftools/merge/main.nf b/modules/bcftools/merge/main.nf index 7d8ab670..bb68f184 100644 --- a/modules/bcftools/merge/main.nf +++ b/modules/bcftools/merge/main.nf @@ -23,10 +23,9 @@ process BCFTOOLS_MERGE { output: tuple val(meta), path("*.gz"), emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bcftools merge -Oz \\ diff --git a/modules/bcftools/mpileup/main.nf b/modules/bcftools/mpileup/main.nf index 1f6eecaa..df8455a5 100644 --- a/modules/bcftools/mpileup/main.nf +++ b/modules/bcftools/mpileup/main.nf @@ -26,10 +26,9 @@ process BCFTOOLS_MPILEUP { tuple val(meta), path("*.gz") , emit: vcf tuple val(meta), path("*.tbi") , emit: tbi tuple val(meta), path("*stats.txt"), emit: stats - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ echo "${meta.id}" > sample_name.list diff --git a/modules/bcftools/norm/main.nf b/modules/bcftools/norm/main.nf index 454fc1d2..7e506e49 100644 --- a/modules/bcftools/norm/main.nf +++ b/modules/bcftools/norm/main.nf @@ -24,10 +24,9 @@ process BCFTOOLS_NORM { output: tuple val(meta), path("*.gz") , emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bcftools norm \\ diff --git a/modules/bcftools/query/main.nf b/modules/bcftools/query/main.nf index 4815ae90..dae8bbc4 100644 --- a/modules/bcftools/query/main.nf +++ b/modules/bcftools/query/main.nf @@ -26,10 +26,9 @@ process BCFTOOLS_QUERY { output: tuple val(meta), path("*.gz") , emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def regions_file = regions ? "--regions-file ${regions}" : "" def targets_file = targets ? "--targets-file ${targets}" : "" diff --git a/modules/bcftools/reheader/main.nf b/modules/bcftools/reheader/main.nf index a949b6e9..953a8adb 100644 --- a/modules/bcftools/reheader/main.nf +++ b/modules/bcftools/reheader/main.nf @@ -25,10 +25,9 @@ process BCFTOOLS_REHEADER { output: tuple val(meta), path("*.vcf.gz"), emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def update_sequences = fai ? "-f $fai" : "" def new_header = header ? "-h $header" : "" diff --git a/modules/bcftools/stats/main.nf b/modules/bcftools/stats/main.nf index f5b1f6b1..31bed814 100644 --- a/modules/bcftools/stats/main.nf +++ b/modules/bcftools/stats/main.nf @@ -23,10 +23,9 @@ process BCFTOOLS_STATS { output: tuple val(meta), path("*stats.txt"), emit: stats - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bcftools stats $options.args $vcf > ${prefix}.bcftools_stats.txt diff --git a/modules/bcftools/view/main.nf b/modules/bcftools/view/main.nf index 5a944e89..ef72f081 100644 --- a/modules/bcftools/view/main.nf +++ b/modules/bcftools/view/main.nf @@ -26,10 +26,9 @@ process BCFTOOLS_VIEW { output: tuple val(meta), path("*.gz") , emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def regions_file = regions ? "--regions-file ${regions}" : "" def targets_file = targets ? "--targets-file ${targets}" : "" diff --git a/modules/bedtools/bamtobed/main.nf b/modules/bedtools/bamtobed/main.nf index 19986371..71c439d3 100644 --- a/modules/bedtools/bamtobed/main.nf +++ b/modules/bedtools/bamtobed/main.nf @@ -23,10 +23,9 @@ process BEDTOOLS_BAMTOBED { output: tuple val(meta), path("*.bed"), emit: bed - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedtools \\ diff --git a/modules/bedtools/complement/main.nf b/modules/bedtools/complement/main.nf index 5b3bbea9..77214c64 100644 --- a/modules/bedtools/complement/main.nf +++ b/modules/bedtools/complement/main.nf @@ -24,10 +24,9 @@ process BEDTOOLS_COMPLEMENT { output: tuple val(meta), path('*.bed'), emit: bed - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedtools \\ diff --git a/modules/bedtools/genomecov/main.nf b/modules/bedtools/genomecov/main.nf index b5deedf1..9d014466 100644 --- a/modules/bedtools/genomecov/main.nf +++ b/modules/bedtools/genomecov/main.nf @@ -25,10 +25,9 @@ process BEDTOOLS_GENOMECOV { output: tuple val(meta), path("*.${extension}"), emit: genomecov - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (intervals.name =~ /\.bam/) { """ diff --git a/modules/bedtools/getfasta/main.nf b/modules/bedtools/getfasta/main.nf index 72e457dc..b27f6183 100644 --- a/modules/bedtools/getfasta/main.nf +++ b/modules/bedtools/getfasta/main.nf @@ -24,10 +24,9 @@ process BEDTOOLS_GETFASTA { output: path "*.fa" , emit: fasta - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${bed.baseName}${options.suffix}" : "${bed.baseName}" """ bedtools \\ diff --git a/modules/bedtools/intersect/main.nf b/modules/bedtools/intersect/main.nf index b75bd116..1ab0a8b2 100644 --- a/modules/bedtools/intersect/main.nf +++ b/modules/bedtools/intersect/main.nf @@ -24,10 +24,9 @@ process BEDTOOLS_INTERSECT { output: tuple val(meta), path("*.${extension}"), emit: intersect - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedtools \\ diff --git a/modules/bedtools/makewindows/main.nf b/modules/bedtools/makewindows/main.nf index 5e93f0ae..c9f863d0 100644 --- a/modules/bedtools/makewindows/main.nf +++ b/modules/bedtools/makewindows/main.nf @@ -24,10 +24,9 @@ process BEDTOOLS_MAKEWINDOWS { output: tuple val(meta), path("*.tab"), emit: tab - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def arg_input = use_bed ? "-b $regions" : "-g $regions" """ diff --git a/modules/bedtools/maskfasta/main.nf b/modules/bedtools/maskfasta/main.nf index 67097f3f..8ee33d7a 100644 --- a/modules/bedtools/maskfasta/main.nf +++ b/modules/bedtools/maskfasta/main.nf @@ -24,10 +24,9 @@ process BEDTOOLS_MASKFASTA { output: tuple val(meta), path("*.fa"), emit: fasta - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedtools \\ diff --git a/modules/bedtools/merge/main.nf b/modules/bedtools/merge/main.nf index ba8348af..92a59f9e 100644 --- a/modules/bedtools/merge/main.nf +++ b/modules/bedtools/merge/main.nf @@ -23,10 +23,9 @@ process BEDTOOLS_MERGE { output: tuple val(meta), path('*.bed'), emit: bed - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedtools \\ diff --git a/modules/bedtools/slop/main.nf b/modules/bedtools/slop/main.nf index 6644b8db..4b412b1f 100644 --- a/modules/bedtools/slop/main.nf +++ b/modules/bedtools/slop/main.nf @@ -24,10 +24,9 @@ process BEDTOOLS_SLOP { output: tuple val(meta), path("*.bed"), emit: bed - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedtools \\ diff --git a/modules/bedtools/sort/main.nf b/modules/bedtools/sort/main.nf index acc4a593..bdba3376 100644 --- a/modules/bedtools/sort/main.nf +++ b/modules/bedtools/sort/main.nf @@ -23,10 +23,9 @@ process BEDTOOLS_SORT { output: tuple val(meta), path('*.bed'), emit: bed - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedtools \\ diff --git a/modules/bedtools/subtract/main.nf b/modules/bedtools/subtract/main.nf index a8e2ad02..54a12bf4 100644 --- a/modules/bedtools/subtract/main.nf +++ b/modules/bedtools/subtract/main.nf @@ -23,10 +23,9 @@ process BEDTOOLS_SUBTRACT { output: tuple val(meta), path("*.bed"), emit: bed - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedtools \\ diff --git a/modules/bismark/align/main.nf b/modules/bismark/align/main.nf index ce042933..aa4879ba 100644 --- a/modules/bismark/align/main.nf +++ b/modules/bismark/align/main.nf @@ -26,10 +26,9 @@ process BISMARK_ALIGN { tuple val(meta), path("*bam") , emit: bam tuple val(meta), path("*report.txt"), emit: report tuple val(meta), path("*fq.gz") , optional:true, emit: unmapped - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def fastq = meta.single_end ? reads : "-1 ${reads[0]} -2 ${reads[1]}" """ diff --git a/modules/bismark/deduplicate/main.nf b/modules/bismark/deduplicate/main.nf index 8555563d..c3ff27d6 100644 --- a/modules/bismark/deduplicate/main.nf +++ b/modules/bismark/deduplicate/main.nf @@ -24,10 +24,9 @@ process BISMARK_DEDUPLICATE { output: tuple val(meta), path("*.deduplicated.bam") , emit: bam tuple val(meta), path("*.deduplication_report.txt"), emit: report - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def seqtype = meta.single_end ? '-s' : '-p' """ diff --git a/modules/bismark/genomepreparation/main.nf b/modules/bismark/genomepreparation/main.nf index 0a3fae14..0a86173d 100644 --- a/modules/bismark/genomepreparation/main.nf +++ b/modules/bismark/genomepreparation/main.nf @@ -23,10 +23,9 @@ process BISMARK_GENOMEPREPARATION { output: path "BismarkIndex" , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ bismark_genome_preparation \\ $options.args \\ diff --git a/modules/bismark/methylationextractor/main.nf b/modules/bismark/methylationextractor/main.nf index bafeaad6..5e89e6f8 100644 --- a/modules/bismark/methylationextractor/main.nf +++ b/modules/bismark/methylationextractor/main.nf @@ -28,11 +28,10 @@ process BISMARK_METHYLATIONEXTRACTOR { tuple val(meta), path("*.cov.gz") , emit: coverage tuple val(meta), path("*_splitting_report.txt"), emit: report tuple val(meta), path("*.M-bias.txt") , emit: mbias - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: def seqtype = meta.single_end ? '-s' : '-p' - def software = getSoftwareName(task.process) """ bismark_methylation_extractor \\ --bedGraph \\ diff --git a/modules/bismark/report/main.nf b/modules/bismark/report/main.nf index d7ab3e01..70c6ba3b 100644 --- a/modules/bismark/report/main.nf +++ b/modules/bismark/report/main.nf @@ -23,10 +23,9 @@ process BISMARK_REPORT { output: tuple val(meta), path("*report.{html,txt}"), emit: report - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ bismark2report $options.args diff --git a/modules/bismark/summary/main.nf b/modules/bismark/summary/main.nf index d71772b3..3d5f294e 100644 --- a/modules/bismark/summary/main.nf +++ b/modules/bismark/summary/main.nf @@ -26,10 +26,9 @@ process BISMARK_SUMMARY { output: path "*report.{html,txt}", emit: summary - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ bismark2summary diff --git a/modules/blast/blastn/main.nf b/modules/blast/blastn/main.nf index 1146ede4..0d65f1d0 100644 --- a/modules/blast/blastn/main.nf +++ b/modules/blast/blastn/main.nf @@ -24,10 +24,9 @@ process BLAST_BLASTN { output: tuple val(meta), path('*.blastn.txt'), emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ DB=`find -L ./ -name "*.ndb" | sed 's/.ndb//'` diff --git a/modules/blast/makeblastdb/main.nf b/modules/blast/makeblastdb/main.nf index 9ee02108..0538e0db 100644 --- a/modules/blast/makeblastdb/main.nf +++ b/modules/blast/makeblastdb/main.nf @@ -23,10 +23,9 @@ process BLAST_MAKEBLASTDB { output: path 'blast_db' , emit: db - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ makeblastdb \\ -in $fasta \\ diff --git a/modules/bowtie/align/main.nf b/modules/bowtie/align/main.nf index 7c71cb82..764b5be2 100644 --- a/modules/bowtie/align/main.nf +++ b/modules/bowtie/align/main.nf @@ -25,11 +25,10 @@ process BOWTIE_ALIGN { output: tuple val(meta), path('*.bam'), emit: bam tuple val(meta), path('*.out'), emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped.fastq" : '' def endedness = meta.single_end ? "$reads" : "-1 ${reads[0]} -2 ${reads[1]}" diff --git a/modules/bowtie/build/main.nf b/modules/bowtie/build/main.nf index 3ae07729..1b83541b 100644 --- a/modules/bowtie/build/main.nf +++ b/modules/bowtie/build/main.nf @@ -23,10 +23,9 @@ process BOWTIE_BUILD { output: path 'bowtie' , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ mkdir bowtie bowtie-build --threads $task.cpus $fasta bowtie/${fasta.baseName} diff --git a/modules/bowtie2/align/main.nf b/modules/bowtie2/align/main.nf index 4a972373..6f923951 100644 --- a/modules/bowtie2/align/main.nf +++ b/modules/bowtie2/align/main.nf @@ -25,11 +25,10 @@ process BOWTIE2_ALIGN { output: tuple val(meta), path('*.bam'), emit: bam tuple val(meta), path('*.log'), emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { def unaligned = params.save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : '' diff --git a/modules/bowtie2/build/main.nf b/modules/bowtie2/build/main.nf index f140d7a4..bc95eea8 100644 --- a/modules/bowtie2/build/main.nf +++ b/modules/bowtie2/build/main.nf @@ -23,10 +23,9 @@ process BOWTIE2_BUILD { output: path 'bowtie2' , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ mkdir bowtie2 bowtie2-build $options.args --threads $task.cpus $fasta bowtie2/${fasta.baseName} diff --git a/modules/bwa/aln/main.nf b/modules/bwa/aln/main.nf index ae4ee147..07135aea 100644 --- a/modules/bwa/aln/main.nf +++ b/modules/bwa/aln/main.nf @@ -24,10 +24,9 @@ process BWA_ALN { output: tuple val(meta), path("*.sai"), emit: sai - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { diff --git a/modules/bwa/index/main.nf b/modules/bwa/index/main.nf index 9de3fe0c..479431ed 100644 --- a/modules/bwa/index/main.nf +++ b/modules/bwa/index/main.nf @@ -23,10 +23,9 @@ process BWA_INDEX { output: path "bwa" , emit: index - path "versions.yml", emit: version + path "versions.yml", emit: versions script: - def software = getSoftwareName(task.process) """ mkdir bwa bwa \\ diff --git a/modules/bwa/mem/main.nf b/modules/bwa/mem/main.nf index f20e0c39..b6a548d7 100644 --- a/modules/bwa/mem/main.nf +++ b/modules/bwa/mem/main.nf @@ -24,10 +24,9 @@ process BWA_MEM { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_group = meta.read_group ? "-R ${meta.read_group}" : "" """ diff --git a/modules/bwa/sampe/main.nf b/modules/bwa/sampe/main.nf index f4519541..38127793 100644 --- a/modules/bwa/sampe/main.nf +++ b/modules/bwa/sampe/main.nf @@ -24,10 +24,9 @@ process BWA_SAMPE { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_group = meta.read_group ? "-r ${meta.read_group}" : "" diff --git a/modules/bwa/samse/main.nf b/modules/bwa/samse/main.nf index 5303b24f..68fa95c7 100644 --- a/modules/bwa/samse/main.nf +++ b/modules/bwa/samse/main.nf @@ -24,10 +24,9 @@ process BWA_SAMSE { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_group = meta.read_group ? "-r ${meta.read_group}" : "" diff --git a/modules/bwamem2/index/main.nf b/modules/bwamem2/index/main.nf index 9274ebe8..5732017f 100644 --- a/modules/bwamem2/index/main.nf +++ b/modules/bwamem2/index/main.nf @@ -23,10 +23,9 @@ process BWAMEM2_INDEX { output: path "bwamem2" , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ mkdir bwamem2 bwa-mem2 \\ diff --git a/modules/bwamem2/mem/main.nf b/modules/bwamem2/mem/main.nf index ea584a39..f88d840f 100644 --- a/modules/bwamem2/mem/main.nf +++ b/modules/bwamem2/mem/main.nf @@ -24,10 +24,9 @@ process BWAMEM2_MEM { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_group = meta.read_group ? "-R ${meta.read_group}" : "" """ diff --git a/modules/bwameth/align/main.nf b/modules/bwameth/align/main.nf index d78055fc..9b1d2b86 100644 --- a/modules/bwameth/align/main.nf +++ b/modules/bwameth/align/main.nf @@ -24,10 +24,9 @@ process BWAMETH_ALIGN { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_group = meta.read_group ? "-R ${meta.read_group}" : "" """ diff --git a/modules/bwameth/index/main.nf b/modules/bwameth/index/main.nf index a7a0b783..68fb33d4 100644 --- a/modules/bwameth/index/main.nf +++ b/modules/bwameth/index/main.nf @@ -23,10 +23,9 @@ process BWAMETH_INDEX { output: path "bwameth" , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ bwameth.py index $fasta diff --git a/modules/cat/cat/main.nf b/modules/cat/cat/main.nf index 2dc9944f..dac301cb 100644 --- a/modules/cat/cat/main.nf +++ b/modules/cat/cat/main.nf @@ -23,7 +23,7 @@ process CAT_CAT { output: path "${file_out}*" , emit: file_out - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: def file_list = files_in.collect { it.toString() } diff --git a/modules/cat/fastq/main.nf b/modules/cat/fastq/main.nf index 712364e1..538915a7 100644 --- a/modules/cat/fastq/main.nf +++ b/modules/cat/fastq/main.nf @@ -23,7 +23,7 @@ process CAT_FASTQ { output: tuple val(meta), path("*.merged.fastq.gz"), emit: reads - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" diff --git a/modules/chromap/chromap/main.nf b/modules/chromap/chromap/main.nf index c7b0a5a3..9826eed1 100644 --- a/modules/chromap/chromap/main.nf +++ b/modules/chromap/chromap/main.nf @@ -34,10 +34,9 @@ process CHROMAP_CHROMAP { tuple val(meta), path("*.bam") , optional:true, emit: bam tuple val(meta), path("*.tagAlign.gz"), optional:true, emit: tagAlign tuple val(meta), path("*.pairs.gz") , optional:true, emit: pairs - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def args = options.args.tokenize() diff --git a/modules/chromap/index/main.nf b/modules/chromap/index/main.nf index 61b7a856..efe85733 100644 --- a/modules/chromap/index/main.nf +++ b/modules/chromap/index/main.nf @@ -25,10 +25,9 @@ process CHROMAP_INDEX { output: path "*.index" , emit: index - path "versions.yml", emit: version + path "versions.yml", emit: versions script: - def software = getSoftwareName(task.process) def prefix = fasta.baseName """ chromap \\ diff --git a/modules/cnvkit/main.nf b/modules/cnvkit/main.nf index 1219584c..27c8bb0d 100755 --- a/modules/cnvkit/main.nf +++ b/modules/cnvkit/main.nf @@ -28,10 +28,9 @@ process CNVKIT { tuple val(meta), path("*.cnn"), emit: cnn tuple val(meta), path("*.cnr"), emit: cnr tuple val(meta), path("*.cns"), emit: cns - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ cnvkit.py \\ batch \\ diff --git a/modules/cooler/digest/main.nf b/modules/cooler/digest/main.nf index ee8b347e..5728b649 100644 --- a/modules/cooler/digest/main.nf +++ b/modules/cooler/digest/main.nf @@ -25,10 +25,9 @@ process COOLER_DIGEST { output: path "*.bed" , emit: bed - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ cooler digest \\ $options.args \\ diff --git a/modules/cooler/dump/main.nf b/modules/cooler/dump/main.nf index 7d456107..2028f5f0 100644 --- a/modules/cooler/dump/main.nf +++ b/modules/cooler/dump/main.nf @@ -23,10 +23,9 @@ process COOLER_DUMP { output: tuple val(meta), path("*.bedpe"), emit: bedpe - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ cooler dump \\ diff --git a/modules/custom/dumpsoftwareversions/main.nf b/modules/custom/dumpsoftwareversions/main.nf index 8424ab07..cf10a8e0 100644 --- a/modules/custom/dumpsoftwareversions/main.nf +++ b/modules/custom/dumpsoftwareversions/main.nf @@ -22,9 +22,9 @@ process CUSTOM_DUMPSOFTWAREVERSIONS { path versions output: - path 'software_versions.yml' , emit: yml - path 'software_versions_mqc.yml', emit: mqc_yml - path 'versions.yml' , emit: versions + path "software_versions.yml" , emit: yml + path "software_versions_mqc.yml", emit: mqc_yml + path "versions.yml" , emit: versions script: """ diff --git a/modules/cutadapt/main.nf b/modules/cutadapt/main.nf index 3baf9c7f..32faf2cf 100644 --- a/modules/cutadapt/main.nf +++ b/modules/cutadapt/main.nf @@ -24,10 +24,9 @@ process CUTADAPT { output: tuple val(meta), path('*.trim.fastq.gz'), emit: reads tuple val(meta), path('*.log') , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def trimmed = meta.single_end ? "-o ${prefix}.trim.fastq.gz" : "-o ${prefix}_1.trim.fastq.gz -p ${prefix}_2.trim.fastq.gz" """ diff --git a/modules/damageprofiler/main.nf b/modules/damageprofiler/main.nf index cbb27944..1537b019 100644 --- a/modules/damageprofiler/main.nf +++ b/modules/damageprofiler/main.nf @@ -25,10 +25,9 @@ process DAMAGEPROFILER { output: tuple val(meta), path("${prefix}"), emit: results - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ diff --git a/modules/deeptools/computematrix/main.nf b/modules/deeptools/computematrix/main.nf index 21a18526..9fffdb8e 100644 --- a/modules/deeptools/computematrix/main.nf +++ b/modules/deeptools/computematrix/main.nf @@ -25,10 +25,9 @@ process DEEPTOOLS_COMPUTEMATRIX { output: tuple val(meta), path("*.mat.gz") , emit: matrix tuple val(meta), path("*.mat.tab"), emit: table - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ computeMatrix \\ diff --git a/modules/deeptools/plotfingerprint/main.nf b/modules/deeptools/plotfingerprint/main.nf index 9271a399..b2d167f9 100644 --- a/modules/deeptools/plotfingerprint/main.nf +++ b/modules/deeptools/plotfingerprint/main.nf @@ -25,10 +25,9 @@ process DEEPTOOLS_PLOTFINGERPRINT { tuple val(meta), path("*.pdf") , emit: pdf tuple val(meta), path("*.raw.txt") , emit: matrix tuple val(meta), path("*.qcmetrics.txt"), emit: metrics - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def extend = (meta.single_end && params.fragment_size > 0) ? "--extendReads ${params.fragment_size}" : '' """ diff --git a/modules/deeptools/plotheatmap/main.nf b/modules/deeptools/plotheatmap/main.nf index 49362666..19c243df 100644 --- a/modules/deeptools/plotheatmap/main.nf +++ b/modules/deeptools/plotheatmap/main.nf @@ -24,10 +24,9 @@ process DEEPTOOLS_PLOTHEATMAP { output: tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.tab"), emit: table - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ plotHeatmap \\ diff --git a/modules/deeptools/plotprofile/main.nf b/modules/deeptools/plotprofile/main.nf index cba8e161..3a196bd5 100644 --- a/modules/deeptools/plotprofile/main.nf +++ b/modules/deeptools/plotprofile/main.nf @@ -24,10 +24,9 @@ process DEEPTOOLS_PLOTPROFILE { output: tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.tab"), emit: table - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ plotProfile \\ diff --git a/modules/delly/call/main.nf b/modules/delly/call/main.nf index 0688949e..59979dc9 100644 --- a/modules/delly/call/main.nf +++ b/modules/delly/call/main.nf @@ -26,10 +26,9 @@ process DELLY_CALL { output: tuple val(meta), path("*.bcf"), emit: bcf tuple val(meta), path("*.csi"), emit: csi - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ delly \\ diff --git a/modules/diamond/blastp/main.nf b/modules/diamond/blastp/main.nf index 556f150c..6afc66c4 100644 --- a/modules/diamond/blastp/main.nf +++ b/modules/diamond/blastp/main.nf @@ -26,10 +26,9 @@ process DIAMOND_BLASTP { output: tuple val(meta), path('*.txt'), emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ DB=`find -L ./ -name "*.dmnd" | sed 's/.dmnd//'` diff --git a/modules/diamond/blastx/main.nf b/modules/diamond/blastx/main.nf index 8b0227a2..db2953da 100644 --- a/modules/diamond/blastx/main.nf +++ b/modules/diamond/blastx/main.nf @@ -26,10 +26,9 @@ process DIAMOND_BLASTX { output: tuple val(meta), path('*.txt'), emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ DB=`find -L ./ -name "*.dmnd" | sed 's/.dmnd//'` diff --git a/modules/diamond/makedb/main.nf b/modules/diamond/makedb/main.nf index 27383955..e4533f8f 100644 --- a/modules/diamond/makedb/main.nf +++ b/modules/diamond/makedb/main.nf @@ -25,10 +25,9 @@ process DIAMOND_MAKEDB { output: path "${fasta}.dmnd", emit: db - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ diamond \\ makedb \\ diff --git a/modules/dragonflye/main.nf b/modules/dragonflye/main.nf index 090c9a13..f9dc9004 100644 --- a/modules/dragonflye/main.nf +++ b/modules/dragonflye/main.nf @@ -27,10 +27,9 @@ process DRAGONFLYE { tuple val(meta), path("{flye,miniasm,raven}.fasta") , emit: raw_contigs tuple val(meta), path("{miniasm,raven}-unpolished.gfa"), optional:true , emit: gfa tuple val(meta), path("flye-info.txt"), optional:true , emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def memory = task.memory.toGiga() """ dragonflye \\ diff --git a/modules/dshbio/exportsegments/main.nf b/modules/dshbio/exportsegments/main.nf index 6016f777..84f59e89 100644 --- a/modules/dshbio/exportsegments/main.nf +++ b/modules/dshbio/exportsegments/main.nf @@ -23,10 +23,9 @@ process DSHBIO_EXPORTSEGMENTS { output: tuple val(meta), path("*.fa"), emit: fasta - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ dsh-bio \\ diff --git a/modules/dshbio/filterbed/main.nf b/modules/dshbio/filterbed/main.nf index 3f2a068d..35039f21 100644 --- a/modules/dshbio/filterbed/main.nf +++ b/modules/dshbio/filterbed/main.nf @@ -23,10 +23,9 @@ process DSHBIO_FILTERBED { output: tuple val(meta), path("*.bed.gz"), emit: bed - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ dsh-bio \\ diff --git a/modules/dshbio/filtergff3/main.nf b/modules/dshbio/filtergff3/main.nf index 2a1ad816..bf677da8 100644 --- a/modules/dshbio/filtergff3/main.nf +++ b/modules/dshbio/filtergff3/main.nf @@ -23,10 +23,9 @@ process DSHBIO_FILTERGFF3 { output: tuple val(meta), path("*.gff3.gz"), emit: gff3 - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ dsh-bio \\ diff --git a/modules/dshbio/splitbed/main.nf b/modules/dshbio/splitbed/main.nf index 388ba0ef..3e8d656c 100644 --- a/modules/dshbio/splitbed/main.nf +++ b/modules/dshbio/splitbed/main.nf @@ -23,10 +23,9 @@ process DSHBIO_SPLITBED { output: tuple val(meta), path("*.bed.gz"), emit: bed - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ dsh-bio \\ diff --git a/modules/dshbio/splitgff3/main.nf b/modules/dshbio/splitgff3/main.nf index b8f81392..dd477181 100644 --- a/modules/dshbio/splitgff3/main.nf +++ b/modules/dshbio/splitgff3/main.nf @@ -23,10 +23,9 @@ process DSHBIO_SPLITGFF3 { output: tuple val(meta), path("*.gff3.gz"), emit: gff3 - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ dsh-bio \\ diff --git a/modules/ensemblvep/main.nf b/modules/ensemblvep/main.nf index 17eaf720..ad9c38a6 100644 --- a/modules/ensemblvep/main.nf +++ b/modules/ensemblvep/main.nf @@ -33,10 +33,9 @@ process ENSEMBLVEP { output: tuple val(meta), path("*.ann.vcf"), emit: vcf path "*.summary.html" , emit: report - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" dir_cache = params.use_cache ? "\${PWD}/${cache}" : "/.vep" """ diff --git a/modules/expansionhunter/main.nf b/modules/expansionhunter/main.nf index 1c02f404..845de15d 100644 --- a/modules/expansionhunter/main.nf +++ b/modules/expansionhunter/main.nf @@ -25,10 +25,9 @@ process EXPANSIONHUNTER { output: tuple val(meta), path("*.vcf"), emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def gender = (meta.gender == 'male' || meta.gender == 1 || meta.gender == 'XY') ? "male" : "female" """ diff --git a/modules/fastani/main.nf b/modules/fastani/main.nf index 7ee35a0d..5c6366f9 100644 --- a/modules/fastani/main.nf +++ b/modules/fastani/main.nf @@ -24,10 +24,9 @@ process FASTANI { output: tuple val(meta), path("*.ani.txt"), emit: ani - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.batch_input) { diff --git a/modules/fastp/main.nf b/modules/fastp/main.nf index 11cd30b4..e99540d5 100644 --- a/modules/fastp/main.nf +++ b/modules/fastp/main.nf @@ -28,13 +28,12 @@ process FASTP { tuple val(meta), path('*.json') , emit: json tuple val(meta), path('*.html') , emit: html tuple val(meta), path('*.log') , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions tuple val(meta), path('*.fail.fastq.gz') , optional:true, emit: reads_fail tuple val(meta), path('*.merged.fastq.gz'), optional:true, emit: reads_merged script: // Added soft-links to original fastqs for consistent naming in MultiQC - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { def fail_fastq = save_trimmed_fail ? "--failed_out ${prefix}.fail.fastq.gz" : '' diff --git a/modules/fastqc/main.nf b/modules/fastqc/main.nf index 88bfbf5b..9f6cfc55 100644 --- a/modules/fastqc/main.nf +++ b/modules/fastqc/main.nf @@ -24,11 +24,11 @@ process FASTQC { output: tuple val(meta), path("*.html"), emit: html tuple val(meta), path("*.zip") , emit: zip - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: // Add soft-links to original FastQs for consistent naming in pipeline - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { """ [ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz @@ -36,7 +36,7 @@ process FASTQC { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + ${getSoftwareName(task.process)}: \$( fastqc --version | sed -e "s/FastQC v//g" ) END_VERSIONS """ } else { @@ -47,7 +47,7 @@ process FASTQC { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + ${getSoftwareName(task.process)}: \$( fastqc --version | sed -e "s/FastQC v//g" ) END_VERSIONS """ } diff --git a/modules/fasttree/main.nf b/modules/fasttree/main.nf index 08c093b2..5f81d1f2 100644 --- a/modules/fasttree/main.nf +++ b/modules/fasttree/main.nf @@ -22,10 +22,9 @@ process FASTTREE { output: path "*.tre", emit: phylogeny - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ fasttree \\ $options.args \\ diff --git a/modules/fgbio/callmolecularconsensusreads/main.nf b/modules/fgbio/callmolecularconsensusreads/main.nf index a3d047a7..23056b90 100644 --- a/modules/fgbio/callmolecularconsensusreads/main.nf +++ b/modules/fgbio/callmolecularconsensusreads/main.nf @@ -22,10 +22,9 @@ process FGBIO_CALLMOLECULARCONSENSUSREADS { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ fgbio \\ diff --git a/modules/fgbio/sortbam/main.nf b/modules/fgbio/sortbam/main.nf index 928765f5..34e0b377 100644 --- a/modules/fgbio/sortbam/main.nf +++ b/modules/fgbio/sortbam/main.nf @@ -22,10 +22,9 @@ process FGBIO_SORTBAM { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ fgbio \\ diff --git a/modules/flash/main.nf b/modules/flash/main.nf index f9a381e9..912b2961 100644 --- a/modules/flash/main.nf +++ b/modules/flash/main.nf @@ -22,10 +22,9 @@ process FLASH { output: tuple val(meta), path("*.fastq.gz"), emit: reads - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ flash \\ diff --git a/modules/gatk4/applybqsr/main.nf b/modules/gatk4/applybqsr/main.nf index 91c23b29..e804bcff 100644 --- a/modules/gatk4/applybqsr/main.nf +++ b/modules/gatk4/applybqsr/main.nf @@ -27,10 +27,9 @@ process GATK4_APPLYBQSR { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def interval = intervals ? "-L ${intervals}" : "" """ diff --git a/modules/gatk4/baserecalibrator/main.nf b/modules/gatk4/baserecalibrator/main.nf index 2f368014..6033fbf1 100644 --- a/modules/gatk4/baserecalibrator/main.nf +++ b/modules/gatk4/baserecalibrator/main.nf @@ -29,10 +29,9 @@ process GATK4_BASERECALIBRATOR { output: tuple val(meta), path("*.table"), emit: table - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def intervalsCommand = intervalsBed ? "-L ${intervalsBed}" : "" def sitesCommand = knownSites.collect{"--known-sites ${it}"}.join(' ') diff --git a/modules/gatk4/bedtointervallist/main.nf b/modules/gatk4/bedtointervallist/main.nf index 28b88f5b..064247cc 100644 --- a/modules/gatk4/bedtointervallist/main.nf +++ b/modules/gatk4/bedtointervallist/main.nf @@ -24,10 +24,9 @@ process GATK4_BEDTOINTERVALLIST { output: tuple val(meta), path('*.interval_list'), emit: interval_list - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gatk BedToIntervalList \\ diff --git a/modules/gatk4/createsequencedictionary/main.nf b/modules/gatk4/createsequencedictionary/main.nf index b384d405..12372bdf 100644 --- a/modules/gatk4/createsequencedictionary/main.nf +++ b/modules/gatk4/createsequencedictionary/main.nf @@ -23,10 +23,9 @@ process GATK4_CREATESEQUENCEDICTIONARY { output: path "*.dict" , emit: dict - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def avail_mem = 6 if (!task.memory) { log.info '[GATK] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.' diff --git a/modules/gatk4/fastqtosam/main.nf b/modules/gatk4/fastqtosam/main.nf index cb8ec0ea..ebd081ac 100644 --- a/modules/gatk4/fastqtosam/main.nf +++ b/modules/gatk4/fastqtosam/main.nf @@ -23,10 +23,9 @@ process GATK4_FASTQTOSAM { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_files = meta.single_end ? "-F1 $reads" : "-F1 ${reads[0]} -F2 ${reads[1]}" """ diff --git a/modules/gatk4/getpileupsummaries/main.nf b/modules/gatk4/getpileupsummaries/main.nf index 782b7653..09449f12 100644 --- a/modules/gatk4/getpileupsummaries/main.nf +++ b/modules/gatk4/getpileupsummaries/main.nf @@ -26,10 +26,9 @@ process GATK4_GETPILEUPSUMMARIES { output: tuple val(meta), path('*.pileups.table'), emit: table - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def sitesCommand = '' diff --git a/modules/gatk4/haplotypecaller/main.nf b/modules/gatk4/haplotypecaller/main.nf index 63771393..01b71ccb 100644 --- a/modules/gatk4/haplotypecaller/main.nf +++ b/modules/gatk4/haplotypecaller/main.nf @@ -27,10 +27,9 @@ process GATK4_HAPLOTYPECALLER { output: tuple val(meta), path("*.vcf.gz"), emit: vcf tuple val(meta), path("*.tbi") , emit: tbi - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def avail_mem = 3 if (!task.memory) { diff --git a/modules/gatk4/intervallisttools/main.nf b/modules/gatk4/intervallisttools/main.nf index 99257354..2f464919 100644 --- a/modules/gatk4/intervallisttools/main.nf +++ b/modules/gatk4/intervallisttools/main.nf @@ -23,10 +23,9 @@ process GATK4_INTERVALLISTTOOLS { output: tuple val(meta), path("*_split/*/*.interval_list"), emit: interval_list - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ diff --git a/modules/gatk4/markduplicates/main.nf b/modules/gatk4/markduplicates/main.nf index 3a3c8e70..8f94f4dd 100644 --- a/modules/gatk4/markduplicates/main.nf +++ b/modules/gatk4/markduplicates/main.nf @@ -24,10 +24,9 @@ process GATK4_MARKDUPLICATES { output: tuple val(meta), path("*.bam") , emit: bam tuple val(meta), path("*.metrics"), emit: metrics - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gatk MarkDuplicates \\ diff --git a/modules/gatk4/mergebamalignment/main.nf b/modules/gatk4/mergebamalignment/main.nf index 978b7cff..0c9fe5ee 100644 --- a/modules/gatk4/mergebamalignment/main.nf +++ b/modules/gatk4/mergebamalignment/main.nf @@ -26,10 +26,9 @@ process GATK4_MERGEBAMALIGNMENT { output: tuple val(meta), path('*.bam'), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gatk MergeBamAlignment \\ diff --git a/modules/gatk4/mergevcfs/main.nf b/modules/gatk4/mergevcfs/main.nf index c62a6289..ce9a52c3 100644 --- a/modules/gatk4/mergevcfs/main.nf +++ b/modules/gatk4/mergevcfs/main.nf @@ -25,10 +25,9 @@ process GATK4_MERGEVCFS { output: tuple val(meta), path('*.vcf.gz'), emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" // Make list of VCFs to merge diff --git a/modules/gatk4/mutect2/main.nf b/modules/gatk4/mutect2/main.nf index c4efc724..9b3f8b3f 100644 --- a/modules/gatk4/mutect2/main.nf +++ b/modules/gatk4/mutect2/main.nf @@ -35,10 +35,9 @@ process GATK4_MUTECT2 { tuple val(meta), path("*.tbi") , emit: tbi tuple val(meta), path("*.stats") , emit: stats tuple val(meta), path("*.f1r2.tar.gz"), optional:true, emit: f1r2 - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def inputsList = [] def normalsList = [] diff --git a/modules/gatk4/revertsam/main.nf b/modules/gatk4/revertsam/main.nf index 0a95b604..b3c9085a 100644 --- a/modules/gatk4/revertsam/main.nf +++ b/modules/gatk4/revertsam/main.nf @@ -23,10 +23,9 @@ process GATK4_REVERTSAM { output: tuple val(meta), path('*.bam'), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gatk RevertSam \\ diff --git a/modules/gatk4/samtofastq/main.nf b/modules/gatk4/samtofastq/main.nf index eed7a83f..324f3bae 100644 --- a/modules/gatk4/samtofastq/main.nf +++ b/modules/gatk4/samtofastq/main.nf @@ -23,10 +23,9 @@ process GATK4_SAMTOFASTQ { output: tuple val(meta), path('*.fastq.gz'), emit: fastq - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def output = meta.single_end ? "FASTQ=${prefix}.fastq.gz" : "FASTQ=${prefix}_1.fastq.gz SECOND_END_FASTQ=${prefix}_2.fastq.gz" """ diff --git a/modules/gatk4/splitncigarreads/main.nf b/modules/gatk4/splitncigarreads/main.nf index 0c4ba163..793cc671 100644 --- a/modules/gatk4/splitncigarreads/main.nf +++ b/modules/gatk4/splitncigarreads/main.nf @@ -24,10 +24,9 @@ process GATK4_SPLITNCIGARREADS { output: tuple val(meta), path('*.bam'), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gatk SplitNCigarReads \\ diff --git a/modules/gatk4/variantfiltration/main.nf b/modules/gatk4/variantfiltration/main.nf index a79bce8f..28084645 100644 --- a/modules/gatk4/variantfiltration/main.nf +++ b/modules/gatk4/variantfiltration/main.nf @@ -26,11 +26,10 @@ process GATK4_VARIANTFILTRATION { output: tuple val(meta), path("*.vcf"), emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gatk VariantFiltration \\ diff --git a/modules/genmap/index/main.nf b/modules/genmap/index/main.nf index f1168d4e..c79596f0 100644 --- a/modules/genmap/index/main.nf +++ b/modules/genmap/index/main.nf @@ -23,10 +23,9 @@ process GENMAP_INDEX { output: path "genmap" , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ genmap \\ index \\ diff --git a/modules/genmap/mappability/main.nf b/modules/genmap/mappability/main.nf index 9eeb4253..4d858cbb 100644 --- a/modules/genmap/mappability/main.nf +++ b/modules/genmap/mappability/main.nf @@ -25,10 +25,9 @@ process GENMAP_MAPPABILITY { path "*.wig" , optional:true, emit: wig path "*.bedgraph" , optional:true, emit: bedgraph path "*.txt" , optional:true, emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ genmap \\ map \\ diff --git a/modules/gffread/main.nf b/modules/gffread/main.nf index 1622e98d..4133ee08 100644 --- a/modules/gffread/main.nf +++ b/modules/gffread/main.nf @@ -23,10 +23,9 @@ process GFFREAD { output: path "*.gtf" , emit: gtf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${gff.baseName}${options.suffix}" : "${gff.baseName}" """ gffread \\ diff --git a/modules/glnexus/main.nf b/modules/glnexus/main.nf index 5cff088b..1384334f 100644 --- a/modules/glnexus/main.nf +++ b/modules/glnexus/main.nf @@ -23,10 +23,9 @@ process GLNEXUS { output: tuple val(meta), path("*.bcf"), emit: bcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" // Make list of GVCFs to merge diff --git a/modules/graphmap2/align/main.nf b/modules/graphmap2/align/main.nf index 30d6cbfd..831b0b3b 100644 --- a/modules/graphmap2/align/main.nf +++ b/modules/graphmap2/align/main.nf @@ -26,10 +26,9 @@ process GRAPHMAP2_ALIGN { output: tuple val(meta), path("*.sam"), emit: sam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ graphmap2 \\ diff --git a/modules/graphmap2/index/main.nf b/modules/graphmap2/index/main.nf index 194c3594..a8b03074 100644 --- a/modules/graphmap2/index/main.nf +++ b/modules/graphmap2/index/main.nf @@ -22,10 +22,9 @@ process GRAPHMAP2_INDEX { output: path "*.gmidx" , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ graphmap2 \\ align \\ diff --git a/modules/gubbins/main.nf b/modules/gubbins/main.nf index 10117ae7..da194906 100644 --- a/modules/gubbins/main.nf +++ b/modules/gubbins/main.nf @@ -30,10 +30,9 @@ process GUBBINS { path "*.branch_base_reconstruction.embl", emit: embl_branch path "*.final_tree.tre" , emit: tree path "*.node_labelled.final_tree.tre" , emit: tree_labelled - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ run_gubbins.py \\ --threads $task.cpus \\ diff --git a/modules/gunzip/main.nf b/modules/gunzip/main.nf index 6a2287b6..aec4569f 100644 --- a/modules/gunzip/main.nf +++ b/modules/gunzip/main.nf @@ -23,10 +23,9 @@ process GUNZIP { output: path "$gunzip", emit: gunzip - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) gunzip = archive.toString() - '.gz' """ gunzip \\ diff --git a/modules/hifiasm/main.nf b/modules/hifiasm/main.nf index 2597afa9..9dfc9618 100644 --- a/modules/hifiasm/main.nf +++ b/modules/hifiasm/main.nf @@ -34,10 +34,9 @@ process HIFIASM { tuple val(meta), path("*.asm.a_ctg.gfa") , emit: alternate_contigs, optional: true tuple val(meta), path("*.hap1.p_ctg.gfa") , emit: paternal_contigs , optional: true tuple val(meta), path("*.hap2.p_ctg.gfa") , emit: maternal_contigs , optional: true - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (use_parental_kmers) { """ diff --git a/modules/hisat2/align/main.nf b/modules/hisat2/align/main.nf index 583ddc3f..9b73216b 100644 --- a/modules/hisat2/align/main.nf +++ b/modules/hisat2/align/main.nf @@ -28,12 +28,11 @@ process HISAT2_ALIGN { output: tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.log"), emit: summary - path "versions.yml" , emit: version + path "versions.yml" , emit: versions tuple val(meta), path("*fastq.gz"), optional:true, emit: fastq script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def strandedness = '' diff --git a/modules/hisat2/build/main.nf b/modules/hisat2/build/main.nf index ae24a6aa..015f6f59 100644 --- a/modules/hisat2/build/main.nf +++ b/modules/hisat2/build/main.nf @@ -28,7 +28,7 @@ process HISAT2_BUILD { output: path "hisat2" , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: def avail_mem = 0 @@ -53,7 +53,6 @@ process HISAT2_BUILD { log.info "[HISAT2 index build] Use --hisat2_build_memory [small number] to skip this check." } - def software = getSoftwareName(task.process) """ mkdir hisat2 $extract_exons diff --git a/modules/hisat2/extractsplicesites/main.nf b/modules/hisat2/extractsplicesites/main.nf index 3387cbd1..1c8b7830 100644 --- a/modules/hisat2/extractsplicesites/main.nf +++ b/modules/hisat2/extractsplicesites/main.nf @@ -25,10 +25,9 @@ process HISAT2_EXTRACTSPLICESITES { output: path "*.splice_sites.txt", emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ hisat2_extract_splice_sites.py $gtf > ${gtf.baseName}.splice_sites.txt cat <<-END_VERSIONS > versions.yml diff --git a/modules/hmmer/hmmalign/main.nf b/modules/hmmer/hmmalign/main.nf index a4166fcb..b4292feb 100644 --- a/modules/hmmer/hmmalign/main.nf +++ b/modules/hmmer/hmmalign/main.nf @@ -24,10 +24,9 @@ process HMMER_HMMALIGN { output: tuple val(meta), path("*.sthlm.gz"), emit: sthlm - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def fastacmd = fasta.getExtension() == 'gz' ? "gunzip -c $fasta" : "cat $fasta" """ diff --git a/modules/homer/annotatepeaks/main.nf b/modules/homer/annotatepeaks/main.nf index 198ae1fe..1714644b 100644 --- a/modules/homer/annotatepeaks/main.nf +++ b/modules/homer/annotatepeaks/main.nf @@ -27,10 +27,9 @@ process HOMER_ANNOTATEPEAKS { output: tuple val(meta), path("*annotatePeaks.txt"), emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ annotatePeaks.pl \\ diff --git a/modules/homer/findpeaks/main.nf b/modules/homer/findpeaks/main.nf index fe8399a1..2e0b6db9 100644 --- a/modules/homer/findpeaks/main.nf +++ b/modules/homer/findpeaks/main.nf @@ -25,10 +25,9 @@ process HOMER_FINDPEAKS { output: tuple val(meta), path("*peaks.txt"), emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ diff --git a/modules/homer/maketagdirectory/main.nf b/modules/homer/maketagdirectory/main.nf index daf0ce60..4f531e82 100644 --- a/modules/homer/maketagdirectory/main.nf +++ b/modules/homer/maketagdirectory/main.nf @@ -26,10 +26,9 @@ process HOMER_MAKETAGDIRECTORY { output: tuple val(meta), path("tag_dir"), emit: tagdir - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ makeTagDirectory \\ diff --git a/modules/homer/makeucscfile/main.nf b/modules/homer/makeucscfile/main.nf index 5b23e243..c56da24b 100644 --- a/modules/homer/makeucscfile/main.nf +++ b/modules/homer/makeucscfile/main.nf @@ -25,10 +25,9 @@ process HOMER_MAKEUCSCFILE { output: tuple val(meta), path("tag_dir/*ucsc.bedGraph.gz"), emit: bedGraph - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ makeUCSCfile \\ diff --git a/modules/iqtree/main.nf b/modules/iqtree/main.nf index 357faf33..bec879df 100644 --- a/modules/iqtree/main.nf +++ b/modules/iqtree/main.nf @@ -24,10 +24,9 @@ process IQTREE { output: path "*.treefile", emit: phylogeny - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def fconst_args = constant_sites ? "-fconst $constant_sites" : '' def memory = task.memory.toString().replaceAll(' ', '') """ diff --git a/modules/ivar/consensus/main.nf b/modules/ivar/consensus/main.nf index b29450b7..33fa11f7 100644 --- a/modules/ivar/consensus/main.nf +++ b/modules/ivar/consensus/main.nf @@ -26,10 +26,9 @@ process IVAR_CONSENSUS { tuple val(meta), path("*.fa") , emit: fasta tuple val(meta), path("*.qual.txt"), emit: qual tuple val(meta), path("*.mpileup") , optional:true, emit: mpileup - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def save_mpileup = params.save_mpileup ? "tee ${prefix}.mpileup |" : "" """ diff --git a/modules/ivar/trim/main.nf b/modules/ivar/trim/main.nf index 2a698249..6cf8171c 100644 --- a/modules/ivar/trim/main.nf +++ b/modules/ivar/trim/main.nf @@ -25,10 +25,9 @@ process IVAR_TRIM { output: tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path('*.log'), emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ ivar trim \\ diff --git a/modules/ivar/variants/main.nf b/modules/ivar/variants/main.nf index 2bf82a37..d079a8e9 100644 --- a/modules/ivar/variants/main.nf +++ b/modules/ivar/variants/main.nf @@ -26,10 +26,9 @@ process IVAR_VARIANTS { output: tuple val(meta), path("*.tsv") , emit: tsv tuple val(meta), path("*.mpileup"), optional:true, emit: mpileup - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def save_mpileup = params.save_mpileup ? "tee ${prefix}.mpileup |" : "" def features = params.gff ? "-g $gff" : "" diff --git a/modules/kallisto/index/main.nf b/modules/kallisto/index/main.nf index 801f339e..96457b6d 100644 --- a/modules/kallisto/index/main.nf +++ b/modules/kallisto/index/main.nf @@ -23,10 +23,9 @@ process KALLISTO_INDEX { output: path "kallisto" , emit: idx - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ kallisto \\ index \\ diff --git a/modules/kallistobustools/count/main.nf b/modules/kallistobustools/count/main.nf index b0dd3a06..8c705e51 100644 --- a/modules/kallistobustools/count/main.nf +++ b/modules/kallistobustools/count/main.nf @@ -29,10 +29,9 @@ process KALLISTOBUSTOOLS_COUNT { output: tuple val(meta), path ("*.count"), emit: count - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def cdna = t1c ? "-c1 $t1c" : '' def introns = t2c ? "-c2 $t2c" : '' diff --git a/modules/kallistobustools/ref/main.nf b/modules/kallistobustools/ref/main.nf index c8e02687..a8287498 100644 --- a/modules/kallistobustools/ref/main.nf +++ b/modules/kallistobustools/ref/main.nf @@ -24,7 +24,7 @@ process KALLISTOBUSTOOLS_REF { val workflow output: - path "versions.yml" , emit: version + path "versions.yml" , emit: versions path "kb_ref_out.idx" , emit: index path "t2g.txt" , emit: t2g path "cdna.fa" , emit: cdna @@ -33,7 +33,6 @@ process KALLISTOBUSTOOLS_REF { path "intron_t2c.txt" , optional:true, emit: intron_t2c script: - def software = getSoftwareName(task.process) if (workflow == "standard") { """ kb \\ diff --git a/modules/kleborate/main.nf b/modules/kleborate/main.nf index 5a4be104..5bb76ad0 100644 --- a/modules/kleborate/main.nf +++ b/modules/kleborate/main.nf @@ -23,10 +23,9 @@ process KLEBORATE { output: tuple val(meta), path("*.txt"), emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ kleborate \\ diff --git a/modules/kraken2/kraken2/main.nf b/modules/kraken2/kraken2/main.nf index cc269e98..0d4e5840 100644 --- a/modules/kraken2/kraken2/main.nf +++ b/modules/kraken2/kraken2/main.nf @@ -26,10 +26,9 @@ process KRAKEN2_KRAKEN2 { tuple val(meta), path('*classified*') , emit: classified tuple val(meta), path('*unclassified*'), emit: unclassified tuple val(meta), path('*report.txt') , emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def paired = meta.single_end ? "" : "--paired" def classified = meta.single_end ? "${prefix}.classified.fastq" : "${prefix}.classified#.fastq" diff --git a/modules/last/dotplot/main.nf b/modules/last/dotplot/main.nf index ca30bbff..d02e98ad 100644 --- a/modules/last/dotplot/main.nf +++ b/modules/last/dotplot/main.nf @@ -25,10 +25,9 @@ process LAST_DOTPLOT { output: tuple val(meta), path("*.gif"), optional:true, emit: gif tuple val(meta), path("*.png"), optional:true, emit: png - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ last-dotplot \\ diff --git a/modules/last/lastal/main.nf b/modules/last/lastal/main.nf index 3d6518a4..c4335f25 100644 --- a/modules/last/lastal/main.nf +++ b/modules/last/lastal/main.nf @@ -24,10 +24,9 @@ process LAST_LASTAL { output: tuple val(meta), path("*.maf.gz"), emit: maf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def trained_params = param_file ? "-p ${param_file}" : '' """ diff --git a/modules/last/lastdb/main.nf b/modules/last/lastdb/main.nf index ac552e7d..fb765ada 100644 --- a/modules/last/lastdb/main.nf +++ b/modules/last/lastdb/main.nf @@ -23,10 +23,9 @@ process LAST_LASTDB { output: tuple val(meta), path("lastdb"), emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ mkdir lastdb diff --git a/modules/last/mafconvert/main.nf b/modules/last/mafconvert/main.nf index e112cbd8..5e259109 100644 --- a/modules/last/mafconvert/main.nf +++ b/modules/last/mafconvert/main.nf @@ -32,10 +32,9 @@ process LAST_MAFCONVERT { tuple val(meta), path("*.psl.gz"), optional:true, emit: psl_gz tuple val(meta), path("*.sam.gz"), optional:true, emit: sam_gz tuple val(meta), path("*.tab.gz"), optional:true, emit: tab_gz - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ maf-convert $options.args $format $maf | gzip --no-name \\ diff --git a/modules/last/mafswap/main.nf b/modules/last/mafswap/main.nf index f597693c..5ce38c92 100644 --- a/modules/last/mafswap/main.nf +++ b/modules/last/mafswap/main.nf @@ -23,10 +23,9 @@ process LAST_MAFSWAP { output: tuple val(meta), path("*.maf.gz"), emit: maf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ maf-swap $options.args $maf | gzip --no-name > ${prefix}.swapped.maf.gz diff --git a/modules/last/postmask/main.nf b/modules/last/postmask/main.nf index d3fa02e3..3102fbe6 100644 --- a/modules/last/postmask/main.nf +++ b/modules/last/postmask/main.nf @@ -23,10 +23,9 @@ process LAST_POSTMASK { output: tuple val(meta), path("*.maf.gz"), emit: maf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if( "$maf" == "${prefix}.maf.gz" ) error "Input and output names are the same, use the suffix option to disambiguate" """ diff --git a/modules/last/split/main.nf b/modules/last/split/main.nf index 78d59ed4..2a9e5621 100644 --- a/modules/last/split/main.nf +++ b/modules/last/split/main.nf @@ -23,10 +23,9 @@ process LAST_SPLIT { output: tuple val(meta), path("*.maf.gz"), emit: maf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ zcat < $maf | last-split $options.args | gzip --no-name > ${prefix}.maf.gz diff --git a/modules/last/train/main.nf b/modules/last/train/main.nf index 39728ced..f0b958bc 100644 --- a/modules/last/train/main.nf +++ b/modules/last/train/main.nf @@ -24,10 +24,9 @@ process LAST_TRAIN { output: tuple val(meta), path("*.par"), emit: param_file - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ INDEX_NAME=\$(basename \$(ls $index/*.des) .des) diff --git a/modules/lima/main.nf b/modules/lima/main.nf index 1ff5ac48..16525953 100644 --- a/modules/lima/main.nf +++ b/modules/lima/main.nf @@ -28,7 +28,7 @@ process LIMA { tuple val(meta), path("*.guess") , emit: guess tuple val(meta), path("*.report") , emit: report tuple val(meta), path("*.summary"), emit: summary - path "versions.yml" , emit: version + path "versions.yml" , emit: versions tuple val(meta), path("*.bam") , optional: true, emit: bam tuple val(meta), path("*.bam.pbi") , optional: true, emit: pbi @@ -41,7 +41,6 @@ process LIMA { script: def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - """ OUT_EXT="" @@ -67,7 +66,7 @@ process LIMA { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - lima: \$( lima --version | sed 's/lima //g' | sed 's/ (.\\+//g' ) + ${getSoftwareName(task.process)}: \$( lima --version | sed 's/lima //g' | sed 's/ (.\\+//g' ) END_VERSIONS """ } diff --git a/modules/lofreq/call/main.nf b/modules/lofreq/call/main.nf index 9fb113ff..e77d7a78 100644 --- a/modules/lofreq/call/main.nf +++ b/modules/lofreq/call/main.nf @@ -24,10 +24,9 @@ process LOFREQ_CALL { output: tuple val(meta), path("*.vcf.gz"), emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ lofreq \\ diff --git a/modules/lofreq/callparallel/main.nf b/modules/lofreq/callparallel/main.nf index 42400793..a86748d7 100644 --- a/modules/lofreq/callparallel/main.nf +++ b/modules/lofreq/callparallel/main.nf @@ -25,10 +25,9 @@ process LOFREQ_CALLPARALLEL { output: tuple val(meta), path("*.vcf.gz"), emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ lofreq \\ diff --git a/modules/lofreq/filter/main.nf b/modules/lofreq/filter/main.nf index 09c91c8c..905a961d 100644 --- a/modules/lofreq/filter/main.nf +++ b/modules/lofreq/filter/main.nf @@ -23,10 +23,9 @@ process LOFREQ_FILTER { output: tuple val(meta), path("*.gz"), emit: vcf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ lofreq \\ diff --git a/modules/lofreq/indelqual/main.nf b/modules/lofreq/indelqual/main.nf index 78466574..b33a1e04 100644 --- a/modules/lofreq/indelqual/main.nf +++ b/modules/lofreq/indelqual/main.nf @@ -23,10 +23,9 @@ process LOFREQ_INDELQUAL { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ lofreq indelqual \\ diff --git a/modules/macs2/callpeak/main.nf b/modules/macs2/callpeak/main.nf index 4fcd6b05..d54d406d 100644 --- a/modules/macs2/callpeak/main.nf +++ b/modules/macs2/callpeak/main.nf @@ -25,14 +25,13 @@ process MACS2_CALLPEAK { output: tuple val(meta), path("*.{narrowPeak,broadPeak}"), emit: peak tuple val(meta), path("*.xls") , emit: xls - path "versions.yml" , emit: version + path "versions.yml" , emit: versions tuple val(meta), path("*.gappedPeak"), optional:true, emit: gapped tuple val(meta), path("*.bed") , optional:true, emit: bed tuple val(meta), path("*.bdg") , optional:true, emit: bdg script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def format = meta.single_end ? 'BAM' : 'BAMPE' def control = controlbam ? "--control $controlbam" : '' diff --git a/modules/malt/build/main.nf b/modules/malt/build/main.nf index 3b494c0c..48259a50 100644 --- a/modules/malt/build/main.nf +++ b/modules/malt/build/main.nf @@ -26,11 +26,10 @@ process MALT_BUILD { output: path "malt_index/" , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions path "malt-build.log", emit: log script: - def software = getSoftwareName(task.process) def avail_mem = 6 if (!task.memory) { log.info '[MALT_BUILD] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.' diff --git a/modules/malt/run/main.nf b/modules/malt/run/main.nf index 689dabf4..bc78de8c 100644 --- a/modules/malt/run/main.nf +++ b/modules/malt/run/main.nf @@ -27,10 +27,9 @@ process MALT_RUN { path "*.rma6" , emit: rma6 path "*.{tab,text,sam}", optional:true, emit: alignments path "*.log" , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def avail_mem = 6 if (!task.memory) { log.info '[MALT_RUN] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.' diff --git a/modules/maltextract/main.nf b/modules/maltextract/main.nf index 426a9fc3..d909ec96 100644 --- a/modules/maltextract/main.nf +++ b/modules/maltextract/main.nf @@ -25,10 +25,9 @@ process MALTEXTRACT { output: path "results" , emit: results - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ MaltExtract \\ -Xmx${task.memory.toGiga()}g \\ diff --git a/modules/mash/sketch/main.nf b/modules/mash/sketch/main.nf index ed018b1a..7a99cc50 100644 --- a/modules/mash/sketch/main.nf +++ b/modules/mash/sketch/main.nf @@ -22,10 +22,9 @@ process MASH_SKETCH { output: tuple val(meta), path("*.msh") , emit: mash tuple val(meta), path("*.mash_stats") , emit: stats - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ mash \\ diff --git a/modules/metaphlan3/main.nf b/modules/metaphlan3/main.nf index 8893c2ab..c5157b66 100644 --- a/modules/metaphlan3/main.nf +++ b/modules/metaphlan3/main.nf @@ -26,10 +26,9 @@ process METAPHLAN3 { tuple val(meta), path("*_profile.txt") , emit: profile tuple val(meta), path("*.biom") , emit: biom tuple val(meta), path('*.bowtie2out.txt'), optional:true, emit: bt2out - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def input_type = ("$input".endsWith(".fastq.gz")) ? "--input_type fastq" : ("$input".contains(".fasta")) ? "--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" diff --git a/modules/methyldackel/extract/main.nf b/modules/methyldackel/extract/main.nf index 149f4aa0..94e4b379 100644 --- a/modules/methyldackel/extract/main.nf +++ b/modules/methyldackel/extract/main.nf @@ -25,10 +25,9 @@ process METHYLDACKEL_EXTRACT { output: tuple val(meta), path("*.bedGraph"), emit: bedgraph - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ MethylDackel extract \\ $options.args \\ diff --git a/modules/methyldackel/mbias/main.nf b/modules/methyldackel/mbias/main.nf index 9fa39b82..c8fd2fa2 100644 --- a/modules/methyldackel/mbias/main.nf +++ b/modules/methyldackel/mbias/main.nf @@ -25,10 +25,9 @@ process METHYLDACKEL_MBIAS { output: tuple val(meta), path("*.mbias.txt"), emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ MethylDackel mbias \\ diff --git a/modules/minia/main.nf b/modules/minia/main.nf index 9ab344fd..140ef9e7 100644 --- a/modules/minia/main.nf +++ b/modules/minia/main.nf @@ -25,10 +25,9 @@ process MINIA { tuple val(meta), path('*.contigs.fa'), emit: contigs tuple val(meta), path('*.unitigs.fa'), emit: unitigs tuple val(meta), path('*.h5') , emit: h5 - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def read_list = reads.join(",") """ diff --git a/modules/minimap2/align/main.nf b/modules/minimap2/align/main.nf index d0ff9c0f..215e4fb5 100644 --- a/modules/minimap2/align/main.nf +++ b/modules/minimap2/align/main.nf @@ -24,10 +24,9 @@ process MINIMAP2_ALIGN { output: tuple val(meta), path("*.paf"), emit: paf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def input_reads = meta.single_end ? "$reads" : "${reads[0]} ${reads[1]}" """ diff --git a/modules/minimap2/index/main.nf b/modules/minimap2/index/main.nf index cfc40417..b154a649 100644 --- a/modules/minimap2/index/main.nf +++ b/modules/minimap2/index/main.nf @@ -22,10 +22,9 @@ process MINIMAP2_INDEX { output: path "*.mmi" , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ minimap2 \\ -t $task.cpus \\ diff --git a/modules/mosdepth/main.nf b/modules/mosdepth/main.nf index c21ea2a8..8fe3cfee 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -31,10 +31,9 @@ process MOSDEPTH { tuple val(meta), path('*.per-base.bed.gz.csi'), emit: per_base_csi tuple val(meta), path('*.regions.bed.gz') , emit: regions_bed tuple val(meta), path('*.regions.bed.gz.csi') , emit: regions_csi - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def interval = window_size ? "--by ${window_size}" : "--by ${bed}" """ diff --git a/modules/msisensor/msi/main.nf b/modules/msisensor/msi/main.nf index 41f79b3a..bd5a0a0e 100644 --- a/modules/msisensor/msi/main.nf +++ b/modules/msisensor/msi/main.nf @@ -26,10 +26,9 @@ process MSISENSOR_MSI { tuple val(meta), path("${prefix}_dis") , emit: output_dis tuple val(meta), path("${prefix}_germline"), emit: output_germline tuple val(meta), path("${prefix}_somatic") , emit: output_somatic - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ msisensor \\ diff --git a/modules/msisensor/scan/main.nf b/modules/msisensor/scan/main.nf index 198657ae..ebd8785a 100644 --- a/modules/msisensor/scan/main.nf +++ b/modules/msisensor/scan/main.nf @@ -22,12 +22,11 @@ process MSISENSOR_SCAN { tuple val(meta), path(fasta) output: - tuple (val(meta), path("*.tab"), emit: txt) - path ("versions.yml" , emit: version) + tuple val(meta), path("*.tab"), emit: txt + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ msisensor \\ scan \\ diff --git a/modules/multiqc/main.nf b/modules/multiqc/main.nf index 2e7ad932..0861aa59 100644 --- a/modules/multiqc/main.nf +++ b/modules/multiqc/main.nf @@ -24,16 +24,15 @@ process MULTIQC { path "*multiqc_report.html", emit: report path "*_data" , emit: data path "*_plots" , optional:true, emit: plots - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ multiqc -f $options.args . cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) + ${getSoftwareName(task.process)}: \$( multiqc --version | sed -e "s/multiqc, version //g" ) END_VERSIONS """ } diff --git a/modules/muscle/main.nf b/modules/muscle/main.nf index ef9bf484..6ffb97ac 100644 --- a/modules/muscle/main.nf +++ b/modules/muscle/main.nf @@ -30,10 +30,9 @@ process MUSCLE { tuple val(meta), path("*.msf") , optional: true, emit: msf tuple val(meta), path("*.tree"), optional: true, emit: tree path "*.log" , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def fasta_out = options.args.contains('-fasta') ? "-fastaout ${prefix}_muscle_msa.afa" : '' def clw_out = options.args.contains('-clw') ? "-clwout ${prefix}_muscle_msa.clw" : '' diff --git a/modules/nanolyse/main.nf b/modules/nanolyse/main.nf index 84cf579a..271592f7 100644 --- a/modules/nanolyse/main.nf +++ b/modules/nanolyse/main.nf @@ -25,10 +25,9 @@ process NANOLYSE { output: tuple val(meta), path("*.fastq.gz"), emit: fastq path "*.log" , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ gunzip -c $fastq | NanoLyse -r $fasta | gzip > ${prefix}.fastq.gz diff --git a/modules/nanoplot/main.nf b/modules/nanoplot/main.nf index e36b2da2..16e2248c 100644 --- a/modules/nanoplot/main.nf +++ b/modules/nanoplot/main.nf @@ -26,10 +26,9 @@ process NANOPLOT { tuple val(meta), path("*.png") , emit: png tuple val(meta), path("*.txt") , emit: txt tuple val(meta), path("*.log") , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def input_file = ("$ontfile".endsWith(".fastq.gz")) ? "--fastq ${ontfile}" : ("$ontfile".endsWith(".txt")) ? "--summary ${ontfile}" : '' """ diff --git a/modules/nextclade/main.nf b/modules/nextclade/main.nf index fabf4520..6fc6efc4 100755 --- a/modules/nextclade/main.nf +++ b/modules/nextclade/main.nf @@ -27,10 +27,9 @@ process NEXTCLADE { tuple val(meta), path("${prefix}.tree.json") , emit: json_tree tuple val(meta), path("${prefix}.tsv") , emit: tsv tuple val(meta), path("${prefix}.clades.tsv"), optional:true, emit: tsv_clades - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ nextclade \\ diff --git a/modules/optitype/main.nf b/modules/optitype/main.nf index 4f136d7c..083b03a7 100644 --- a/modules/optitype/main.nf +++ b/modules/optitype/main.nf @@ -23,10 +23,9 @@ process OPTITYPE { output: tuple val(meta), path("${prefix}"), emit: output - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ diff --git a/modules/pairix/main.nf b/modules/pairix/main.nf index c00af657..4bfd3b0d 100644 --- a/modules/pairix/main.nf +++ b/modules/pairix/main.nf @@ -23,10 +23,9 @@ process PAIRIX { output: tuple val(meta), path(pair), path("*.px2"), emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ pairix \\ $options.args \\ diff --git a/modules/pairtools/dedup/main.nf b/modules/pairtools/dedup/main.nf index 5b901a77..eabf24dd 100644 --- a/modules/pairtools/dedup/main.nf +++ b/modules/pairtools/dedup/main.nf @@ -24,10 +24,9 @@ process PAIRTOOLS_DEDUP { output: tuple val(meta), path("*.pairs.gz") , emit: pairs tuple val(meta), path("*.pairs.stat"), emit: stat - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ pairtools dedup \\ diff --git a/modules/pairtools/flip/main.nf b/modules/pairtools/flip/main.nf index 3010b411..50cfdfd2 100644 --- a/modules/pairtools/flip/main.nf +++ b/modules/pairtools/flip/main.nf @@ -24,10 +24,9 @@ process PAIRTOOLS_FLIP { output: tuple val(meta), path("*.flip.gz"), emit: flip - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ pairtools \\ diff --git a/modules/pairtools/parse/main.nf b/modules/pairtools/parse/main.nf index 66c9257b..cd6099e1 100644 --- a/modules/pairtools/parse/main.nf +++ b/modules/pairtools/parse/main.nf @@ -25,10 +25,9 @@ process PAIRTOOLS_PARSE { output: tuple val(meta), path("*.pairsam.gz") , emit: pairsam tuple val(meta), path("*.pairsam.stat"), emit: stat - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ pairtools \\ diff --git a/modules/pairtools/restrict/main.nf b/modules/pairtools/restrict/main.nf index 31f463ad..b1b21da7 100644 --- a/modules/pairtools/restrict/main.nf +++ b/modules/pairtools/restrict/main.nf @@ -24,10 +24,9 @@ process PAIRTOOLS_RESTRICT { output: tuple val(meta), path("*.pairs.gz"), emit: restrict - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ pairtools \\ diff --git a/modules/pairtools/select/main.nf b/modules/pairtools/select/main.nf index c9218ea9..dec29573 100644 --- a/modules/pairtools/select/main.nf +++ b/modules/pairtools/select/main.nf @@ -24,10 +24,9 @@ process PAIRTOOLS_SELECT { output: tuple val(meta), path("*.selected.pairs.gz") , emit: selected tuple val(meta), path("*.unselected.pairs.gz"), emit: unselected - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ pairtools select \\ diff --git a/modules/pairtools/sort/main.nf b/modules/pairtools/sort/main.nf index 27caed7b..996bcb0b 100644 --- a/modules/pairtools/sort/main.nf +++ b/modules/pairtools/sort/main.nf @@ -23,10 +23,9 @@ process PAIRTOOLS_SORT { output: tuple val(meta), path("*.pairs.gz"), emit: sorted - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def mem = task.memory.toString().replaceAll(/(\s|\.|B)+/, '') """ diff --git a/modules/pangolin/main.nf b/modules/pangolin/main.nf index 5292d1c3..edf67dd7 100644 --- a/modules/pangolin/main.nf +++ b/modules/pangolin/main.nf @@ -23,10 +23,9 @@ process PANGOLIN { output: tuple val(meta), path('*.csv'), emit: report - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ pangolin \\ diff --git a/modules/pbccs/main.nf b/modules/pbccs/main.nf index 5df852cf..49c47fda 100644 --- a/modules/pbccs/main.nf +++ b/modules/pbccs/main.nf @@ -29,11 +29,9 @@ process PBCCS { tuple val(meta), path("*.ccs_report.txt" ) , emit: ccs_report_txt tuple val(meta), path("*.ccs_report.json" ) , emit: ccs_report_json tuple val(meta), path("*.zmw_metrics.json.gz"), emit: zmw_metrics - tuple val(meta), path("versions.yml" ) , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - // def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def ccs = bam.toString().replaceAll(/bam$/, '') + chunk_num + '.ccs.bam' def report_txt = bam.toString().replaceAll(/bam$/, '') + chunk_num + '.ccs_report.txt' def report_json = bam.toString().replaceAll(/bam$/, '') + chunk_num + '.ccs_report.json' diff --git a/modules/phantompeakqualtools/main.nf b/modules/phantompeakqualtools/main.nf index 166ed8be..b390bf7e 100644 --- a/modules/phantompeakqualtools/main.nf +++ b/modules/phantompeakqualtools/main.nf @@ -27,10 +27,9 @@ process PHANTOMPEAKQUALTOOLS { tuple val(meta), path("*.out") , emit: spp tuple val(meta), path("*.pdf") , emit: pdf tuple val(meta), path("*.Rdata"), emit: rdata - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ RUN_SPP=`which run_spp.R` diff --git a/modules/picard/collectmultiplemetrics/main.nf b/modules/picard/collectmultiplemetrics/main.nf index 11ddee9b..dd8fdaca 100644 --- a/modules/picard/collectmultiplemetrics/main.nf +++ b/modules/picard/collectmultiplemetrics/main.nf @@ -25,10 +25,9 @@ process PICARD_COLLECTMULTIPLEMETRICS { output: tuple val(meta), path("*_metrics"), emit: metrics tuple val(meta), path("*.pdf") , emit: pdf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def avail_mem = 3 if (!task.memory) { diff --git a/modules/picard/collectwgsmetrics/main.nf b/modules/picard/collectwgsmetrics/main.nf index b5d11839..6028feef 100644 --- a/modules/picard/collectwgsmetrics/main.nf +++ b/modules/picard/collectwgsmetrics/main.nf @@ -24,10 +24,9 @@ process PICARD_COLLECTWGSMETRICS { output: tuple val(meta), path("*_metrics"), emit: metrics - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def avail_mem = 3 if (!task.memory) { diff --git a/modules/picard/filtersamreads/main.nf b/modules/picard/filtersamreads/main.nf index c7e40d27..68cee34d 100644 --- a/modules/picard/filtersamreads/main.nf +++ b/modules/picard/filtersamreads/main.nf @@ -24,10 +24,9 @@ process PICARD_FILTERSAMREADS { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def avail_mem = 3 if (!task.memory) { diff --git a/modules/picard/markduplicates/main.nf b/modules/picard/markduplicates/main.nf index dc8d460b..37b825d7 100644 --- a/modules/picard/markduplicates/main.nf +++ b/modules/picard/markduplicates/main.nf @@ -25,10 +25,9 @@ process PICARD_MARKDUPLICATES { tuple val(meta), path("*.bam") , emit: bam tuple val(meta), path("*.bai") , optional:true, emit: bai tuple val(meta), path("*.metrics.txt"), emit: metrics - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def avail_mem = 3 if (!task.memory) { diff --git a/modules/picard/mergesamfiles/main.nf b/modules/picard/mergesamfiles/main.nf index c6ecfe58..355c0bf3 100644 --- a/modules/picard/mergesamfiles/main.nf +++ b/modules/picard/mergesamfiles/main.nf @@ -23,10 +23,9 @@ process PICARD_MERGESAMFILES { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def bam_files = bams.sort() def avail_mem = 3 diff --git a/modules/picard/sortsam/main.nf b/modules/picard/sortsam/main.nf index 475a30f9..939df1c0 100644 --- a/modules/picard/sortsam/main.nf +++ b/modules/picard/sortsam/main.nf @@ -25,10 +25,9 @@ process PICARD_SORTSAM { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def avail_mem = 3 if (!task.memory) { diff --git a/modules/plasmidid/main.nf b/modules/plasmidid/main.nf index 792b3c12..1edc5eeb 100644 --- a/modules/plasmidid/main.nf +++ b/modules/plasmidid/main.nf @@ -31,10 +31,9 @@ process PLASMIDID { tuple val(meta), path("${prefix}/database/") , emit: database tuple val(meta), path("${prefix}/fasta_files/") , emit: fasta_files tuple val(meta), path("${prefix}/kmer/") , emit: kmer - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ plasmidID \\ diff --git a/modules/plink/vcf/main.nf b/modules/plink/vcf/main.nf index 735fef88..a676b723 100644 --- a/modules/plink/vcf/main.nf +++ b/modules/plink/vcf/main.nf @@ -26,10 +26,9 @@ process PLINK_VCF { tuple val(meta), path("*.bim"), emit: bim, optional: true tuple val(meta), path("*.fam"), emit: fam, optional: true - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ @@ -41,7 +40,7 @@ process PLINK_VCF { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - plink: \$(echo \$(plink --version 2>&1) | sed 's/^PLINK v//' | sed 's/..-bit.*//' ) + ${getSoftwareName(task.process)}: \$(echo \$(plink --version 2>&1) | sed 's/^PLINK v//' | sed 's/..-bit.*//' ) END_VERSIONS """ } diff --git a/modules/preseq/lcextrap/main.nf b/modules/preseq/lcextrap/main.nf index 69f682d3..f551a549 100644 --- a/modules/preseq/lcextrap/main.nf +++ b/modules/preseq/lcextrap/main.nf @@ -25,10 +25,9 @@ process PRESEQ_LCEXTRAP { output: tuple val(meta), path("*.ccurve.txt"), emit: ccurve tuple val(meta), path("*.log") , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def paired_end = meta.single_end ? '' : '-pe' """ diff --git a/modules/prodigal/main.nf b/modules/prodigal/main.nf index 6944f86b..572ffe92 100644 --- a/modules/prodigal/main.nf +++ b/modules/prodigal/main.nf @@ -27,10 +27,9 @@ process PRODIGAL { tuple val(meta), path("${prefix}.fna"), emit: nucleotide_fasta tuple val(meta), path("${prefix}.faa"), emit: amino_acid_fasta tuple val(meta), path("${prefix}_all.txt"), emit: all_gene_annotations - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ prodigal -i "${genome}" \\ diff --git a/modules/prokka/main.nf b/modules/prokka/main.nf index 8aefda7c..fb86078c 100644 --- a/modules/prokka/main.nf +++ b/modules/prokka/main.nf @@ -35,10 +35,9 @@ process PROKKA { tuple val(meta), path("${prefix}/*.log"), emit: log tuple val(meta), path("${prefix}/*.txt"), emit: txt tuple val(meta), path("${prefix}/*.tsv"), emit: tsv - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def proteins_opt = proteins ? "--proteins ${proteins[0]}" : "" def prodigal_opt = prodigal_tf ? "--prodigaltf ${prodigal_tf[0]}" : "" diff --git a/modules/pycoqc/main.nf b/modules/pycoqc/main.nf index f3b164ee..2c263d61 100644 --- a/modules/pycoqc/main.nf +++ b/modules/pycoqc/main.nf @@ -24,10 +24,9 @@ process PYCOQC { output: path "*.html" , emit: html path "*.json" , emit: json - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ pycoQC \\ $options.args \\ diff --git a/modules/pydamage/analyze/main.nf b/modules/pydamage/analyze/main.nf index df787e44..9cfb8a1a 100644 --- a/modules/pydamage/analyze/main.nf +++ b/modules/pydamage/analyze/main.nf @@ -23,10 +23,9 @@ process PYDAMAGE_ANALYZE { output: tuple val(meta), path("pydamage_results/pydamage_results.csv"), emit: csv - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ pydamage \\ diff --git a/modules/pydamage/filter/main.nf b/modules/pydamage/filter/main.nf index 87677367..6cd7ae7a 100644 --- a/modules/pydamage/filter/main.nf +++ b/modules/pydamage/filter/main.nf @@ -23,10 +23,9 @@ process PYDAMAGE_FILTER { output: tuple val(meta), path("pydamage_results/pydamage_filtered_results.csv"), emit: csv - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ diff --git a/modules/qcat/main.nf b/modules/qcat/main.nf index be239816..b650fb8c 100644 --- a/modules/qcat/main.nf +++ b/modules/qcat/main.nf @@ -24,10 +24,9 @@ process QCAT { output: tuple val(meta), path("fastq/*.fastq.gz"), emit: reads - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ ## Unzip fastq file diff --git a/modules/qualimap/bamqc/main.nf b/modules/qualimap/bamqc/main.nf index 0cc101ef..d33f1e67 100644 --- a/modules/qualimap/bamqc/main.nf +++ b/modules/qualimap/bamqc/main.nf @@ -25,10 +25,9 @@ process QUALIMAP_BAMQC { output: tuple val(meta), path("${prefix}"), emit: results - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def collect_pairs = meta.single_end ? '' : '--collect-overlap-pairs' diff --git a/modules/qualimap/rnaseq/main.nf b/modules/qualimap/rnaseq/main.nf index fa32a6a7..9492cec6 100644 --- a/modules/qualimap/rnaseq/main.nf +++ b/modules/qualimap/rnaseq/main.nf @@ -24,10 +24,9 @@ process QUALIMAP_RNASEQ { output: tuple val(meta), path("${prefix}"), emit: results - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def paired_end = meta.single_end ? '' : '-pe' def memory = task.memory.toGiga() + "G" diff --git a/modules/quast/main.nf b/modules/quast/main.nf index 97ff93e2..072d649d 100644 --- a/modules/quast/main.nf +++ b/modules/quast/main.nf @@ -27,10 +27,9 @@ process QUAST { output: path "${prefix}" , emit: results path '*.tsv' , emit: tsv - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ?: software def features = use_gff ? "--features $gff" : '' def reference = use_fasta ? "-r $fasta" : '' diff --git a/modules/rapidnj/main.nf b/modules/rapidnj/main.nf index 118ea7af..aa23b56e 100644 --- a/modules/rapidnj/main.nf +++ b/modules/rapidnj/main.nf @@ -25,10 +25,9 @@ process RAPIDNJ { output: path "*.sth" , emit: stockholm_alignment path "*.tre" , emit: phylogeny - path "versions.yml", emit: version + path "versions.yml", emit: versions script: - def software = getSoftwareName(task.process) """ python \\ -c 'from Bio import SeqIO; SeqIO.convert("$alignment", "fasta", "alignment.sth", "stockholm")' diff --git a/modules/rasusa/main.nf b/modules/rasusa/main.nf index 88f3a208..b9ba0b13 100644 --- a/modules/rasusa/main.nf +++ b/modules/rasusa/main.nf @@ -24,10 +24,9 @@ process RASUSA { output: tuple val(meta), path('*.fastq.gz'), emit: reads - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def output = meta.single_end ? "--output ${prefix}.fastq.gz" : "--output ${prefix}_1.fastq.gz ${prefix}_2.fastq.gz" """ diff --git a/modules/raxmlng/main.nf b/modules/raxmlng/main.nf index e3bde2f3..f607b506 100644 --- a/modules/raxmlng/main.nf +++ b/modules/raxmlng/main.nf @@ -23,10 +23,9 @@ process RAXMLNG { output: path "*.raxml.bestTree", emit: phylogeny path "*.raxml.support" , optional:true, emit: phylogeny_bootstrapped - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ raxml-ng \\ $options.args \\ diff --git a/modules/rsem/calculateexpression/main.nf b/modules/rsem/calculateexpression/main.nf index d3d11397..f19392f7 100644 --- a/modules/rsem/calculateexpression/main.nf +++ b/modules/rsem/calculateexpression/main.nf @@ -27,14 +27,13 @@ process RSEM_CALCULATEEXPRESSION { tuple val(meta), path("*.isoforms.results"), emit: counts_transcript tuple val(meta), path("*.stat") , emit: stat tuple val(meta), path("*.log") , emit: logs - path "versions.yml" , emit: version + path "versions.yml" , emit: versions tuple val(meta), path("*.STAR.genome.bam") , optional:true, emit: bam_star tuple val(meta), path("${prefix}.genome.bam") , optional:true, emit: bam_genome tuple val(meta), path("${prefix}.transcript.bam"), optional:true, emit: bam_transcript script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def strandedness = '' diff --git a/modules/rsem/preparereference/main.nf b/modules/rsem/preparereference/main.nf index b4a613bd..7e671207 100644 --- a/modules/rsem/preparereference/main.nf +++ b/modules/rsem/preparereference/main.nf @@ -25,10 +25,9 @@ process RSEM_PREPAREREFERENCE { output: path "rsem" , emit: index path "rsem/*transcripts.fa", emit: transcript_fasta - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def args = options.args.tokenize() if (args.contains('--star')) { args.removeIf { it.contains('--star') } diff --git a/modules/rseqc/bamstat/main.nf b/modules/rseqc/bamstat/main.nf index fa71dd11..64939add 100644 --- a/modules/rseqc/bamstat/main.nf +++ b/modules/rseqc/bamstat/main.nf @@ -23,10 +23,9 @@ process RSEQC_BAMSTAT { output: tuple val(meta), path("*.bam_stat.txt"), emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bam_stat.py \\ diff --git a/modules/rseqc/inferexperiment/main.nf b/modules/rseqc/inferexperiment/main.nf index a9842c0d..c5e94943 100644 --- a/modules/rseqc/inferexperiment/main.nf +++ b/modules/rseqc/inferexperiment/main.nf @@ -24,10 +24,9 @@ process RSEQC_INFEREXPERIMENT { output: tuple val(meta), path("*.infer_experiment.txt"), emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ infer_experiment.py \\ diff --git a/modules/rseqc/innerdistance/main.nf b/modules/rseqc/innerdistance/main.nf index d98780f1..622cd5cd 100644 --- a/modules/rseqc/innerdistance/main.nf +++ b/modules/rseqc/innerdistance/main.nf @@ -28,10 +28,9 @@ process RSEQC_INNERDISTANCE { tuple val(meta), path("*mean.txt") , optional:true, emit: mean tuple val(meta), path("*.pdf") , optional:true, emit: pdf tuple val(meta), path("*.r") , optional:true, emit: rscript - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (!meta.single_end) { """ diff --git a/modules/rseqc/junctionannotation/main.nf b/modules/rseqc/junctionannotation/main.nf index cfb12d69..1b75d915 100644 --- a/modules/rseqc/junctionannotation/main.nf +++ b/modules/rseqc/junctionannotation/main.nf @@ -30,10 +30,9 @@ process RSEQC_JUNCTIONANNOTATION { tuple val(meta), path("*.Interact.bed"), optional:true, emit: interact_bed tuple val(meta), path("*junction.pdf") , optional:true, emit: pdf tuple val(meta), path("*events.pdf") , optional:true, emit: events_pdf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ junction_annotation.py \\ diff --git a/modules/rseqc/junctionsaturation/main.nf b/modules/rseqc/junctionsaturation/main.nf index a5aa5461..fa435aea 100644 --- a/modules/rseqc/junctionsaturation/main.nf +++ b/modules/rseqc/junctionsaturation/main.nf @@ -25,10 +25,9 @@ process RSEQC_JUNCTIONSATURATION { output: tuple val(meta), path("*.pdf"), emit: pdf tuple val(meta), path("*.r") , emit: rscript - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ junction_saturation.py \\ diff --git a/modules/rseqc/readdistribution/main.nf b/modules/rseqc/readdistribution/main.nf index 56086c89..0c83fdf0 100644 --- a/modules/rseqc/readdistribution/main.nf +++ b/modules/rseqc/readdistribution/main.nf @@ -24,10 +24,9 @@ process RSEQC_READDISTRIBUTION { output: tuple val(meta), path("*.read_distribution.txt"), emit: txt - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ read_distribution.py \\ diff --git a/modules/rseqc/readduplication/main.nf b/modules/rseqc/readduplication/main.nf index ca7c2b13..bee82682 100644 --- a/modules/rseqc/readduplication/main.nf +++ b/modules/rseqc/readduplication/main.nf @@ -26,10 +26,9 @@ process RSEQC_READDUPLICATION { tuple val(meta), path("*pos.DupRate.xls"), emit: pos_xls tuple val(meta), path("*.pdf") , emit: pdf tuple val(meta), path("*.r") , emit: rscript - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ read_duplication.py \\ diff --git a/modules/salmon/index/main.nf b/modules/salmon/index/main.nf index 9e62eb8a..c3fcef01 100644 --- a/modules/salmon/index/main.nf +++ b/modules/salmon/index/main.nf @@ -24,10 +24,9 @@ process SALMON_INDEX { output: path "salmon" , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def get_decoy_ids = "grep '^>' $genome_fasta | cut -d ' ' -f 1 > decoys.txt" def gentrome = "gentrome.fa" if (genome_fasta.endsWith('.gz')) { diff --git a/modules/salmon/quant/main.nf b/modules/salmon/quant/main.nf index 397bdd31..7c2e0e17 100644 --- a/modules/salmon/quant/main.nf +++ b/modules/salmon/quant/main.nf @@ -28,10 +28,9 @@ process SALMON_QUANT { output: tuple val(meta), path("${prefix}"), emit: results - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def reference = "--index $index" diff --git a/modules/samtools/ampliconclip/main.nf b/modules/samtools/ampliconclip/main.nf index cccf2f7c..3da1d6fe 100644 --- a/modules/samtools/ampliconclip/main.nf +++ b/modules/samtools/ampliconclip/main.nf @@ -28,10 +28,9 @@ process SAMTOOLS_AMPLICONCLIP { tuple val(meta), path("*.bam") , emit: bam tuple val(meta), path("*.clipstats.txt") , optional:true, emit: stats tuple val(meta), path("*.cliprejects.bam"), optional:true, emit: rejects_bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def rejects = save_cliprejects ? "--rejects-file ${prefix}.cliprejects.bam" : "" def stats = save_clipstats ? "-f ${prefix}.clipstats.txt" : "" diff --git a/modules/samtools/faidx/main.nf b/modules/samtools/faidx/main.nf index cdbae99b..80cedeab 100644 --- a/modules/samtools/faidx/main.nf +++ b/modules/samtools/faidx/main.nf @@ -23,10 +23,9 @@ process SAMTOOLS_FAIDX { output: path "*.fai" , emit: fai - path "versions.yml", emit: version + path "versions.yml", emit: versions script: - def software = getSoftwareName(task.process) """ samtools faidx $fasta cat <<-END_VERSIONS > versions.yml diff --git a/modules/samtools/fastq/main.nf b/modules/samtools/fastq/main.nf index 02110870..0b454360 100644 --- a/modules/samtools/fastq/main.nf +++ b/modules/samtools/fastq/main.nf @@ -23,10 +23,9 @@ process SAMTOOLS_FASTQ { output: tuple val(meta), path("*.fastq.gz"), emit: fastq - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def endedness = meta.single_end ? "-0 ${prefix}.fastq.gz" : "-1 ${prefix}_1.fastq.gz -2 ${prefix}_2.fastq.gz" diff --git a/modules/samtools/flagstat/main.nf b/modules/samtools/flagstat/main.nf index d0cf86aa..f9115c6b 100644 --- a/modules/samtools/flagstat/main.nf +++ b/modules/samtools/flagstat/main.nf @@ -23,10 +23,9 @@ process SAMTOOLS_FLAGSTAT { output: tuple val(meta), path("*.flagstat"), emit: flagstat - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ samtools flagstat $bam > ${bam}.flagstat cat <<-END_VERSIONS > versions.yml diff --git a/modules/samtools/idxstats/main.nf b/modules/samtools/idxstats/main.nf index 06a07964..b005088a 100644 --- a/modules/samtools/idxstats/main.nf +++ b/modules/samtools/idxstats/main.nf @@ -23,10 +23,9 @@ process SAMTOOLS_IDXSTATS { output: tuple val(meta), path("*.idxstats"), emit: idxstats - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ samtools idxstats $bam > ${bam}.idxstats cat <<-END_VERSIONS > versions.yml diff --git a/modules/samtools/index/main.nf b/modules/samtools/index/main.nf index c2ba4de7..febbc11c 100644 --- a/modules/samtools/index/main.nf +++ b/modules/samtools/index/main.nf @@ -24,10 +24,9 @@ process SAMTOOLS_INDEX { output: tuple val(meta), path("*.bai"), optional:true, emit: bai tuple val(meta), path("*.csi"), optional:true, emit: csi - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ samtools index $options.args $bam cat <<-END_VERSIONS > versions.yml diff --git a/modules/samtools/merge/main.nf b/modules/samtools/merge/main.nf index ec574105..34c40d57 100644 --- a/modules/samtools/merge/main.nf +++ b/modules/samtools/merge/main.nf @@ -23,10 +23,9 @@ process SAMTOOLS_MERGE { output: tuple val(meta), path("${prefix}.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ samtools merge ${prefix}.bam $bams diff --git a/modules/samtools/mpileup/main.nf b/modules/samtools/mpileup/main.nf index 903bfd33..9e120526 100644 --- a/modules/samtools/mpileup/main.nf +++ b/modules/samtools/mpileup/main.nf @@ -24,10 +24,9 @@ process SAMTOOLS_MPILEUP { output: tuple val(meta), path("*.mpileup"), emit: mpileup - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ samtools mpileup \\ diff --git a/modules/samtools/sort/main.nf b/modules/samtools/sort/main.nf index edd558bf..b30f6f45 100644 --- a/modules/samtools/sort/main.nf +++ b/modules/samtools/sort/main.nf @@ -23,10 +23,9 @@ process SAMTOOLS_SORT { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ samtools sort $options.args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam diff --git a/modules/samtools/stats/main.nf b/modules/samtools/stats/main.nf index 823b5f31..6218dd2d 100644 --- a/modules/samtools/stats/main.nf +++ b/modules/samtools/stats/main.nf @@ -23,10 +23,9 @@ process SAMTOOLS_STATS { output: tuple val(meta), path("*.stats"), emit: stats - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ samtools stats $bam > ${bam}.stats cat <<-END_VERSIONS > versions.yml diff --git a/modules/samtools/view/main.nf b/modules/samtools/view/main.nf index 110d5abf..ec1663e0 100644 --- a/modules/samtools/view/main.nf +++ b/modules/samtools/view/main.nf @@ -23,10 +23,9 @@ process SAMTOOLS_VIEW { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ samtools view $options.args $bam > ${prefix}.bam diff --git a/modules/seacr/callpeak/main.nf b/modules/seacr/callpeak/main.nf index 8892ab6d..4c3fd922 100644 --- a/modules/seacr/callpeak/main.nf +++ b/modules/seacr/callpeak/main.nf @@ -25,10 +25,9 @@ process SEACR_CALLPEAK { output: tuple val(meta), path("*.bed"), emit: bed - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ SEACR_1.3.sh \\ diff --git a/modules/seqkit/split2/main.nf b/modules/seqkit/split2/main.nf index b178b1da..80f55bb6 100644 --- a/modules/seqkit/split2/main.nf +++ b/modules/seqkit/split2/main.nf @@ -23,10 +23,9 @@ process SEQKIT_SPLIT2 { output: tuple val(meta), path("*${prefix}/*.gz"), emit: reads - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if(meta.single_end){ """ diff --git a/modules/seqtk/sample/main.nf b/modules/seqtk/sample/main.nf index 277d74ca..3b039fb9 100644 --- a/modules/seqtk/sample/main.nf +++ b/modules/seqtk/sample/main.nf @@ -24,10 +24,9 @@ process SEQTK_SAMPLE { output: tuple val(meta), path("*.fastq.gz"), emit: reads - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { """ diff --git a/modules/seqtk/subseq/main.nf b/modules/seqtk/subseq/main.nf index 41326402..df8783de 100644 --- a/modules/seqtk/subseq/main.nf +++ b/modules/seqtk/subseq/main.nf @@ -24,10 +24,9 @@ process SEQTK_SUBSEQ { output: path "*.gz" , emit: sequences - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ?: '' def ext = "fa" if ("$sequences" ==~ /.+\.fq|.+\.fq.gz|.+\.fastq|.+\.fastq.gz/) { diff --git a/modules/sequenzautils/bam2seqz/main.nf b/modules/sequenzautils/bam2seqz/main.nf index 9c4fc12f..61ca70c6 100644 --- a/modules/sequenzautils/bam2seqz/main.nf +++ b/modules/sequenzautils/bam2seqz/main.nf @@ -25,10 +25,9 @@ process SEQUENZAUTILS_BAM2SEQZ { output: tuple val(meta), path("*.gz"), emit: seqz - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ sequenza-utils \\ diff --git a/modules/sequenzautils/gcwiggle/main.nf b/modules/sequenzautils/gcwiggle/main.nf index a352256a..c952bb70 100644 --- a/modules/sequenzautils/gcwiggle/main.nf +++ b/modules/sequenzautils/gcwiggle/main.nf @@ -23,10 +23,9 @@ process SEQUENZAUTILS_GCWIGGLE { output: tuple val(meta), path("*.wig.gz"), emit: wig - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ sequenza-utils \\ diff --git a/modules/seqwish/induce/main.nf b/modules/seqwish/induce/main.nf index e9b2836b..aaabce51 100644 --- a/modules/seqwish/induce/main.nf +++ b/modules/seqwish/induce/main.nf @@ -25,11 +25,10 @@ process SEQWISH_INDUCE { output: tuple val(meta), path("*.gfa"), emit: gfa - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ seqwish \\ diff --git a/modules/shovill/main.nf b/modules/shovill/main.nf index 92b10732..48425f9f 100644 --- a/modules/shovill/main.nf +++ b/modules/shovill/main.nf @@ -27,10 +27,9 @@ process SHOVILL { tuple val(meta), path("shovill.log") , emit: log tuple val(meta), path("{skesa,spades,megahit,velvet}.fasta"), emit: raw_contigs tuple val(meta), path("contigs.{fastg,gfa,LastGraph}") , optional:true, emit: gfa - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def memory = task.memory.toGiga() """ shovill \\ diff --git a/modules/snpdists/main.nf b/modules/snpdists/main.nf index ede94906..506a922a 100644 --- a/modules/snpdists/main.nf +++ b/modules/snpdists/main.nf @@ -23,10 +23,9 @@ process SNPDISTS { output: tuple val(meta), path("*.tsv"), emit: tsv - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ snp-dists \\ diff --git a/modules/snpeff/main.nf b/modules/snpeff/main.nf index 8b30360a..3a1f6a52 100644 --- a/modules/snpeff/main.nf +++ b/modules/snpeff/main.nf @@ -31,10 +31,9 @@ process SNPEFF { output: tuple val(meta), path("*.ann.vcf"), emit: vcf path "*.csv" , emit: report - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def avail_mem = 6 if (!task.memory) { log.info '[snpEff] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.' diff --git a/modules/snpsites/main.nf b/modules/snpsites/main.nf index 5cc85773..543ee01c 100644 --- a/modules/snpsites/main.nf +++ b/modules/snpsites/main.nf @@ -23,11 +23,10 @@ process SNPSITES { output: path "*.fas" , emit: fasta path "*.sites.txt" , emit: constant_sites - path "versions.yml" , emit: version + path "versions.yml" , emit: versions env CONSTANT_SITES, emit: constant_sites_string script: - def software = getSoftwareName(task.process) """ snp-sites \\ $alignment \\ diff --git a/modules/sortmerna/main.nf b/modules/sortmerna/main.nf index 01975979..f35b1468 100644 --- a/modules/sortmerna/main.nf +++ b/modules/sortmerna/main.nf @@ -25,10 +25,9 @@ process SORTMERNA { output: tuple val(meta), path("*.fastq.gz"), emit: reads tuple val(meta), path("*.log") , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def Refs = "" diff --git a/modules/spades/main.nf b/modules/spades/main.nf index a260de54..c21066e2 100644 --- a/modules/spades/main.nf +++ b/modules/spades/main.nf @@ -29,10 +29,9 @@ process SPADES { tuple val(meta), path('*.gene_clusters.fa'), optional:true, emit: gene_clusters tuple val(meta), path('*.assembly.gfa') , optional:true, emit: gfa tuple val(meta), path('*.log') , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def input_reads = meta.single_end ? "-s $reads" : "-1 ${reads[0]} -2 ${reads[1]}" def custom_hmms = params.spades_hmm ? "--custom-hmms $hmm" : "" diff --git a/modules/staphopiasccmec/main.nf b/modules/staphopiasccmec/main.nf index 0e57128b..08def401 100644 --- a/modules/staphopiasccmec/main.nf +++ b/modules/staphopiasccmec/main.nf @@ -23,10 +23,9 @@ process STAPHOPIASCCMEC { output: tuple val(meta), path("*.tsv"), emit: tsv - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ staphopia-sccmec --assembly $fasta $options.args > ${prefix}.tsv diff --git a/modules/star/align/main.nf b/modules/star/align/main.nf index 677d1f2a..e0ccba8c 100644 --- a/modules/star/align/main.nf +++ b/modules/star/align/main.nf @@ -29,7 +29,7 @@ process STAR_ALIGN { tuple val(meta), path('*Log.final.out') , emit: log_final tuple val(meta), path('*Log.out') , emit: log_out tuple val(meta), path('*Log.progress.out'), emit: log_progress - path "versions.yml" , emit: version + path "versions.yml" , emit: versions tuple val(meta), path('*sortedByCoord.out.bam') , optional:true, emit: bam_sorted tuple val(meta), path('*toTranscriptome.out.bam'), optional:true, emit: bam_transcript @@ -39,7 +39,6 @@ process STAR_ALIGN { tuple val(meta), path('*.out.junction') , optional:true, emit: junction script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def ignore_gtf = params.star_ignore_sjdbgtf ? '' : "--sjdbGTFfile $gtf" def seq_platform = params.seq_platform ? "'PL:$params.seq_platform'" : "" diff --git a/modules/star/genomegenerate/main.nf b/modules/star/genomegenerate/main.nf index 520f6b21..c932fafe 100644 --- a/modules/star/genomegenerate/main.nf +++ b/modules/star/genomegenerate/main.nf @@ -25,10 +25,9 @@ process STAR_GENOMEGENERATE { output: path "star" , emit: index - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' def args = options.args.tokenize() if (args.contains('--genomeSAindexNbases')) { diff --git a/modules/strelka/germline/main.nf b/modules/strelka/germline/main.nf index d2203fa4..64a01e6c 100644 --- a/modules/strelka/germline/main.nf +++ b/modules/strelka/germline/main.nf @@ -29,10 +29,9 @@ process STRELKA_GERMLINE { tuple val(meta), path("*variants.vcf.gz.tbi"), emit: vcf_tbi tuple val(meta), path("*genome.vcf.gz") , emit: genome_vcf tuple val(meta), path("*genome.vcf.gz.tbi") , emit: genome_vcf_tbi - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def regions = params.target_bed ? "--exome --callRegions ${target_bed}" : "" """ @@ -51,7 +50,7 @@ process STRELKA_GERMLINE { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - strelka: \$( configureStrelkaGermlineWorkflow.py --version ) + ${getSoftwareName(task.process)}: \$( configureStrelkaGermlineWorkflow.py --version ) END_VERSIONS """ } diff --git a/modules/stringtie/merge/main.nf b/modules/stringtie/merge/main.nf index 85670a91..371533bb 100644 --- a/modules/stringtie/merge/main.nf +++ b/modules/stringtie/merge/main.nf @@ -24,10 +24,9 @@ process STRINGTIE_MERGE { output: path "stringtie.merged.gtf", emit: gtf - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ stringtie \\ --merge $stringtie_gtf \\ diff --git a/modules/stringtie/stringtie/main.nf b/modules/stringtie/stringtie/main.nf index 92986dba..3579e47c 100644 --- a/modules/stringtie/stringtie/main.nf +++ b/modules/stringtie/stringtie/main.nf @@ -27,10 +27,9 @@ process STRINGTIE { tuple val(meta), path("*.transcripts.gtf"), emit: transcript_gtf tuple val(meta), path("*.abundance.txt") , emit: abundance tuple val(meta), path("*.ballgown") , emit: ballgown - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def strandedness = '' diff --git a/modules/subread/featurecounts/main.nf b/modules/subread/featurecounts/main.nf index 76209a0d..0a0285db 100644 --- a/modules/subread/featurecounts/main.nf +++ b/modules/subread/featurecounts/main.nf @@ -24,10 +24,9 @@ process SUBREAD_FEATURECOUNTS { output: tuple val(meta), path("*featureCounts.txt") , emit: counts tuple val(meta), path("*featureCounts.txt.summary"), emit: summary - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def paired_end = meta.single_end ? '' : '-p' diff --git a/modules/tabix/bgzip/main.nf b/modules/tabix/bgzip/main.nf index c76588df..43726f17 100644 --- a/modules/tabix/bgzip/main.nf +++ b/modules/tabix/bgzip/main.nf @@ -23,10 +23,9 @@ process TABIX_BGZIP { output: tuple val(meta), path("*.gz"), emit: gz - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bgzip -c $options.args $input > ${prefix}.${input.getExtension()}.gz diff --git a/modules/tabix/bgziptabix/main.nf b/modules/tabix/bgziptabix/main.nf index 302c8500..e44a7226 100644 --- a/modules/tabix/bgziptabix/main.nf +++ b/modules/tabix/bgziptabix/main.nf @@ -23,10 +23,9 @@ process TABIX_BGZIPTABIX { output: tuple val(meta), path("*.gz"), path("*.tbi"), emit: tbi - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bgzip -c $options.args $input > ${prefix}.gz diff --git a/modules/tabix/tabix/main.nf b/modules/tabix/tabix/main.nf index 1fabeba4..1574c0b5 100644 --- a/modules/tabix/tabix/main.nf +++ b/modules/tabix/tabix/main.nf @@ -23,10 +23,9 @@ process TABIX_TABIX { output: tuple val(meta), path("*.tbi"), emit: tbi - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ tabix $options.args $tab diff --git a/modules/tiddit/sv/main.nf b/modules/tiddit/sv/main.nf index fce5c49b..e262221a 100644 --- a/modules/tiddit/sv/main.nf +++ b/modules/tiddit/sv/main.nf @@ -27,10 +27,9 @@ process TIDDIT_SV { tuple val(meta), path("*.vcf") , emit: vcf tuple val(meta), path("*.ploidy.tab") , emit: ploidy tuple val(meta), path("*.signals.tab"), emit: signals - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def reference = fasta == "dummy_file.txt" ? "--ref $fasta" : "" """ diff --git a/modules/trimgalore/main.nf b/modules/trimgalore/main.nf index 6f5a65c2..8e77f1f7 100644 --- a/modules/trimgalore/main.nf +++ b/modules/trimgalore/main.nf @@ -24,7 +24,7 @@ process TRIMGALORE { output: tuple val(meta), path("*.fq.gz") , emit: reads tuple val(meta), path("*report.txt"), emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions tuple val(meta), path("*.html"), emit: html optional true tuple val(meta), path("*.zip") , emit: zip optional true @@ -48,7 +48,6 @@ process TRIMGALORE { def tpc_r2 = params.three_prime_clip_r2 > 0 ? "--three_prime_clip_r2 ${params.three_prime_clip_r2}" : '' // Added soft-links to original fastqs for consistent naming in MultiQC - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { """ diff --git a/modules/ucsc/bed12tobigbed/main.nf b/modules/ucsc/bed12tobigbed/main.nf index 2f9b287b..81f39a6f 100644 --- a/modules/ucsc/bed12tobigbed/main.nf +++ b/modules/ucsc/bed12tobigbed/main.nf @@ -26,10 +26,9 @@ process UCSC_BED12TOBIGBED { output: tuple val(meta), path("*.bigBed"), emit: bigbed - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedToBigBed \\ diff --git a/modules/ucsc/bedclip/main.nf b/modules/ucsc/bedclip/main.nf index c001b410..5fbc2b3b 100755 --- a/modules/ucsc/bedclip/main.nf +++ b/modules/ucsc/bedclip/main.nf @@ -26,10 +26,9 @@ process UCSC_BEDCLIP { output: tuple val(meta), path("*.bedGraph"), emit: bedgraph - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedClip \\ diff --git a/modules/ucsc/bedgraphtobigwig/main.nf b/modules/ucsc/bedgraphtobigwig/main.nf index 4a779644..f55cdb07 100644 --- a/modules/ucsc/bedgraphtobigwig/main.nf +++ b/modules/ucsc/bedgraphtobigwig/main.nf @@ -26,10 +26,9 @@ process UCSC_BEDGRAPHTOBIGWIG { output: tuple val(meta), path("*.bigWig"), emit: bigwig - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ bedGraphToBigWig \\ diff --git a/modules/ucsc/bigwigaverageoverbed/main.nf b/modules/ucsc/bigwigaverageoverbed/main.nf index 76c00cfe..72491443 100644 --- a/modules/ucsc/bigwigaverageoverbed/main.nf +++ b/modules/ucsc/bigwigaverageoverbed/main.nf @@ -26,10 +26,9 @@ process UCSC_BIGWIGAVERAGEOVERBED { output: tuple val(meta), path("*.tab"), emit: tab - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ # there is a bug that bigWigAverageOverBed can not handle ensembl seqlevels style. diff --git a/modules/ucsc/wigtobigwig/main.nf b/modules/ucsc/wigtobigwig/main.nf index 29e5cd99..d03a2c4a 100644 --- a/modules/ucsc/wigtobigwig/main.nf +++ b/modules/ucsc/wigtobigwig/main.nf @@ -26,10 +26,9 @@ process UCSC_WIGTOBIGWIG { output: path "*.bw" , emit: bw - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ wigToBigWig \\ diff --git a/modules/umitools/dedup/main.nf b/modules/umitools/dedup/main.nf index 0f15c86c..0ec9741b 100644 --- a/modules/umitools/dedup/main.nf +++ b/modules/umitools/dedup/main.nf @@ -23,10 +23,9 @@ process UMITOOLS_DEDUP { output: tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def paired = meta.single_end ? "" : "--paired" """ diff --git a/modules/umitools/extract/main.nf b/modules/umitools/extract/main.nf index 0a5e6636..d90a3ba8 100644 --- a/modules/umitools/extract/main.nf +++ b/modules/umitools/extract/main.nf @@ -24,10 +24,9 @@ process UMITOOLS_EXTRACT { output: tuple val(meta), path("*.fastq.gz"), emit: reads tuple val(meta), path("*.log") , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { """ diff --git a/modules/unicycler/main.nf b/modules/unicycler/main.nf index 1dd97c40..2f7c49d6 100644 --- a/modules/unicycler/main.nf +++ b/modules/unicycler/main.nf @@ -25,10 +25,9 @@ process UNICYCLER { tuple val(meta), path('*.scaffolds.fa'), emit: scaffolds tuple val(meta), path('*.assembly.gfa'), emit: gfa tuple val(meta), path('*.log') , emit: log - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def input_reads = meta.single_end ? "-s $reads" : "-1 ${reads[0]} -2 ${reads[1]}" """ diff --git a/modules/untar/main.nf b/modules/untar/main.nf index 0866dd55..efb9d825 100644 --- a/modules/untar/main.nf +++ b/modules/untar/main.nf @@ -23,10 +23,9 @@ process UNTAR { output: path "$untar" , emit: untar - path "versions.yml", emit: version + path "versions.yml", emit: versions script: - def software = getSoftwareName(task.process) untar = archive.toString() - '.tar.gz' """ tar \\ diff --git a/modules/unzip/main.nf b/modules/unzip/main.nf index 9e64bb1b..6530bd40 100644 --- a/modules/unzip/main.nf +++ b/modules/unzip/main.nf @@ -24,10 +24,9 @@ process UNZIP { output: path "${archive.baseName}/" , emit: unzipped_archive - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) if ( archive instanceof List && archive.name.size > 1 ) { exit 1, "[UNZIP] error: 7za only accepts a single archive as input. Please check module input." } diff --git a/modules/variantbam/main.nf b/modules/variantbam/main.nf index c4ac3742..e73b8bf1 100644 --- a/modules/variantbam/main.nf +++ b/modules/variantbam/main.nf @@ -25,10 +25,9 @@ process VARIANTBAM { output: tuple val(meta), path("*.bam") , emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ variant \\ diff --git a/modules/vcftools/main.nf b/modules/vcftools/main.nf index a8d8969c..32607958 100644 --- a/modules/vcftools/main.nf +++ b/modules/vcftools/main.nf @@ -24,11 +24,11 @@ process VCFTOOLS { // Other optional input files can be utilised in a similar way to below but we do not exhaustively itterate through all // possible options. Instead we leave that to the user. tuple val(meta), path(variant_file) - path(bed) - path(diff_variant_file) + path bed) + path diff_variant_file output: - path("versions.yml") , emit: version + path "versions.yml", emit: versions tuple val(meta), path("*.vcf"), optional:true, emit: vcf tuple val(meta), path("*.bcf"), optional:true, emit: bcf @@ -94,7 +94,6 @@ process VCFTOOLS { tuple val(meta), path("*.diff.switch"), optional:true, emit: diff_switch_error script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def args = options.args.tokenize() diff --git a/modules/yara/index/main.nf b/modules/yara/index/main.nf index e99d99ba..51ae8a32 100644 --- a/modules/yara/index/main.nf +++ b/modules/yara/index/main.nf @@ -23,10 +23,9 @@ process YARA_INDEX { output: path "yara" , emit: index - path "versions.yml", emit: version + path "versions.yml", emit: versions script: - def software = getSoftwareName(task.process) """ mkdir yara diff --git a/modules/yara/mapper/main.nf b/modules/yara/mapper/main.nf index 88e3d411..3d69674c 100644 --- a/modules/yara/mapper/main.nf +++ b/modules/yara/mapper/main.nf @@ -24,10 +24,9 @@ process YARA_MAPPER { output: tuple val(meta), path("*.mapped.bam"), emit: bam - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { """ From cf15ece503fd69d5fe630f96841ff7bafd47fcb4 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Fri, 1 Oct 2021 14:54:50 +0100 Subject: [PATCH 23/61] Address Jose's comments in #780 (#781) * Remove def software line * Replace version with versions in emit statement * Fix default software names * Address Jose's comments in #780 --- modules/unzip/main.nf | 5 +- modules/vcftools/main.nf | 135 +++++++++++++++++++-------------------- 2 files changed, 69 insertions(+), 71 deletions(-) diff --git a/modules/unzip/main.nf b/modules/unzip/main.nf index 6530bd40..f39e75e8 100644 --- a/modules/unzip/main.nf +++ b/modules/unzip/main.nf @@ -23,13 +23,12 @@ process UNZIP { path archive output: - path "${archive.baseName}/" , emit: unzipped_archive - path "versions.yml" , emit: versions + path "${archive.baseName}/", emit: unzipped_archive + path "versions.yml" , emit: versions script: if ( archive instanceof List && archive.name.size > 1 ) { exit 1, "[UNZIP] error: 7za only accepts a single archive as input. Please check module input." } - """ 7za \\ e \\ diff --git a/modules/vcftools/main.nf b/modules/vcftools/main.nf index 32607958..768d5a23 100644 --- a/modules/vcftools/main.nf +++ b/modules/vcftools/main.nf @@ -24,78 +24,77 @@ process VCFTOOLS { // Other optional input files can be utilised in a similar way to below but we do not exhaustively itterate through all // possible options. Instead we leave that to the user. tuple val(meta), path(variant_file) - path bed) - path diff_variant_file + path bed + path diff_variant_file output: - path "versions.yml", emit: versions - - tuple val(meta), path("*.vcf"), optional:true, emit: vcf - tuple val(meta), path("*.bcf"), optional:true, emit: bcf - tuple val(meta), path("*.frq"), optional:true, emit: frq - tuple val(meta), path("*.frq.count"), optional:true, emit: frq_count - tuple val(meta), path("*.idepth"), optional:true, emit: idepth - tuple val(meta), path("*.ldepth"), optional:true, emit: ldepth - tuple val(meta), path("*.ldepth.mean"), optional:true, emit: ldepth_mean - tuple val(meta), path("*.gdepth"), optional:true, emit: gdepth - tuple val(meta), path("*.hap.ld"), optional:true, emit: hap_ld - tuple val(meta), path("*.geno.ld"), optional:true, emit: geno_ld - tuple val(meta), path("*.geno.chisq"), optional:true, emit: geno_chisq - tuple val(meta), path("*.list.hap.ld"), optional:true, emit: list_hap_ld - tuple val(meta), path("*.list.geno.ld"), optional:true, emit: list_geno_ld - tuple val(meta), path("*.interchrom.hap.ld"), optional:true, emit: interchrom_hap_ld - tuple val(meta), path("*.interchrom.geno.ld"), optional:true, emit: interchrom_geno_ld - tuple val(meta), path("*.TsTv"), optional:true, emit: tstv - tuple val(meta), path("*.TsTv.summary"), optional:true, emit: tstv_summary - tuple val(meta), path("*.TsTv.count"), optional:true, emit: tstv_count - tuple val(meta), path("*.TsTv.qual"), optional:true, emit: tstv_qual - tuple val(meta), path("*.FILTER.summary"), optional:true, emit: filter_summary - tuple val(meta), path("*.sites.pi"), optional:true, emit: sites_pi - tuple val(meta), path("*.windowed.pi"), optional:true, emit: windowed_pi - tuple val(meta), path("*.weir.fst"), optional:true, emit: weir_fst - tuple val(meta), path("*.het"), optional:true, emit: heterozygosity - tuple val(meta), path("*.hwe"), optional:true, emit: hwe - tuple val(meta), path("*.Tajima.D"), optional:true, emit: tajima_d - tuple val(meta), path("*.ifreqburden"), optional:true, emit: freq_burden - tuple val(meta), path("*.LROH"), optional:true, emit: lroh - tuple val(meta), path("*.relatedness"), optional:true, emit: relatedness - tuple val(meta), path("*.relatedness2"), optional:true, emit: relatedness2 - tuple val(meta), path("*.lqual"), optional:true, emit: lqual - tuple val(meta), path("*.imiss"), optional:true, emit: missing_individual - tuple val(meta), path("*.lmiss"), optional:true, emit: missing_site - tuple val(meta), path("*.snpden"), optional:true, emit: snp_density - tuple val(meta), path("*.kept.sites"), optional:true, emit: kept_sites - tuple val(meta), path("*.removed.sites"), optional:true, emit: removed_sites - tuple val(meta), path("*.singletons"), optional:true, emit: singeltons - tuple val(meta), path("*.indel.hist"), optional:true, emit: indel_hist - tuple val(meta), path("*.hapcount"), optional:true, emit: hapcount - tuple val(meta), path("*.mendel"), optional:true, emit: mendel - tuple val(meta), path("*.FORMAT"), optional:true, emit: format - tuple val(meta), path("*.INFO"), optional:true, emit: info - tuple val(meta), path("*.012"), optional:true, emit: genotypes_matrix - tuple val(meta), path("*.012.indv"), optional:true, emit: genotypes_matrix_individual - tuple val(meta), path("*.012.pos"), optional:true, emit: genotypes_matrix_position - tuple val(meta), path("*.impute.hap"), optional:true, emit: impute_hap - tuple val(meta), path("*.impute.hap.legend"), optional:true, emit: impute_hap_legend - tuple val(meta), path("*.impute.hap.indv"), optional:true, emit: impute_hap_indv - tuple val(meta), path("*.ldhat.sites"), optional:true, emit: ldhat_sites - tuple val(meta), path("*.ldhat.locs"), optional:true, emit: ldhat_locs - tuple val(meta), path("*.BEAGLE.GL"), optional:true, emit: beagle_gl - tuple val(meta), path("*.BEAGLE.PL"), optional:true, emit: beagle_pl - tuple val(meta), path("*.ped"), optional:true, emit: ped - tuple val(meta), path("*.map"), optional:true, emit: map_ - tuple val(meta), path("*.tped"), optional:true, emit: tped - tuple val(meta), path("*.tfam"), optional:true, emit: tfam - tuple val(meta), path("*.diff.sites_in_files"), optional:true, emit: diff_sites_in_files - tuple val(meta), path("*.diff.indv_in_files"), optional:true, emit: diff_indv_in_files - tuple val(meta), path("*.diff.sites"), optional:true, emit: diff_sites - tuple val(meta), path("*.diff.indv"), optional:true, emit: diff_indv + tuple val(meta), path("*.vcf") , optional:true, emit: vcf + tuple val(meta), path("*.bcf") , optional:true, emit: bcf + tuple val(meta), path("*.frq") , optional:true, emit: frq + tuple val(meta), path("*.frq.count") , optional:true, emit: frq_count + tuple val(meta), path("*.idepth") , optional:true, emit: idepth + tuple val(meta), path("*.ldepth") , optional:true, emit: ldepth + tuple val(meta), path("*.ldepth.mean") , optional:true, emit: ldepth_mean + tuple val(meta), path("*.gdepth") , optional:true, emit: gdepth + tuple val(meta), path("*.hap.ld") , optional:true, emit: hap_ld + tuple val(meta), path("*.geno.ld") , optional:true, emit: geno_ld + tuple val(meta), path("*.geno.chisq") , optional:true, emit: geno_chisq + tuple val(meta), path("*.list.hap.ld") , optional:true, emit: list_hap_ld + tuple val(meta), path("*.list.geno.ld") , optional:true, emit: list_geno_ld + tuple val(meta), path("*.interchrom.hap.ld") , optional:true, emit: interchrom_hap_ld + tuple val(meta), path("*.interchrom.geno.ld") , optional:true, emit: interchrom_geno_ld + tuple val(meta), path("*.TsTv") , optional:true, emit: tstv + tuple val(meta), path("*.TsTv.summary") , optional:true, emit: tstv_summary + tuple val(meta), path("*.TsTv.count") , optional:true, emit: tstv_count + tuple val(meta), path("*.TsTv.qual") , optional:true, emit: tstv_qual + tuple val(meta), path("*.FILTER.summary") , optional:true, emit: filter_summary + tuple val(meta), path("*.sites.pi") , optional:true, emit: sites_pi + tuple val(meta), path("*.windowed.pi") , optional:true, emit: windowed_pi + tuple val(meta), path("*.weir.fst") , optional:true, emit: weir_fst + tuple val(meta), path("*.het") , optional:true, emit: heterozygosity + tuple val(meta), path("*.hwe") , optional:true, emit: hwe + tuple val(meta), path("*.Tajima.D") , optional:true, emit: tajima_d + tuple val(meta), path("*.ifreqburden") , optional:true, emit: freq_burden + tuple val(meta), path("*.LROH") , optional:true, emit: lroh + tuple val(meta), path("*.relatedness") , optional:true, emit: relatedness + tuple val(meta), path("*.relatedness2") , optional:true, emit: relatedness2 + tuple val(meta), path("*.lqual") , optional:true, emit: lqual + tuple val(meta), path("*.imiss") , optional:true, emit: missing_individual + tuple val(meta), path("*.lmiss") , optional:true, emit: missing_site + tuple val(meta), path("*.snpden") , optional:true, emit: snp_density + tuple val(meta), path("*.kept.sites") , optional:true, emit: kept_sites + tuple val(meta), path("*.removed.sites") , optional:true, emit: removed_sites + tuple val(meta), path("*.singletons") , optional:true, emit: singeltons + tuple val(meta), path("*.indel.hist") , optional:true, emit: indel_hist + tuple val(meta), path("*.hapcount") , optional:true, emit: hapcount + tuple val(meta), path("*.mendel") , optional:true, emit: mendel + tuple val(meta), path("*.FORMAT") , optional:true, emit: format + tuple val(meta), path("*.INFO") , optional:true, emit: info + tuple val(meta), path("*.012") , optional:true, emit: genotypes_matrix + tuple val(meta), path("*.012.indv") , optional:true, emit: genotypes_matrix_individual + tuple val(meta), path("*.012.pos") , optional:true, emit: genotypes_matrix_position + tuple val(meta), path("*.impute.hap") , optional:true, emit: impute_hap + tuple val(meta), path("*.impute.hap.legend") , optional:true, emit: impute_hap_legend + tuple val(meta), path("*.impute.hap.indv") , optional:true, emit: impute_hap_indv + tuple val(meta), path("*.ldhat.sites") , optional:true, emit: ldhat_sites + tuple val(meta), path("*.ldhat.locs") , optional:true, emit: ldhat_locs + tuple val(meta), path("*.BEAGLE.GL") , optional:true, emit: beagle_gl + tuple val(meta), path("*.BEAGLE.PL") , optional:true, emit: beagle_pl + tuple val(meta), path("*.ped") , optional:true, emit: ped + tuple val(meta), path("*.map") , optional:true, emit: map_ + tuple val(meta), path("*.tped") , optional:true, emit: tped + tuple val(meta), path("*.tfam") , optional:true, emit: tfam + tuple val(meta), path("*.diff.sites_in_files") , optional:true, emit: diff_sites_in_files + tuple val(meta), path("*.diff.indv_in_files") , optional:true, emit: diff_indv_in_files + tuple val(meta), path("*.diff.sites") , optional:true, emit: diff_sites + tuple val(meta), path("*.diff.indv") , optional:true, emit: diff_indv tuple val(meta), path("*.diff.discordance.matrix"), optional:true, emit: diff_discd_matrix - tuple val(meta), path("*.diff.switch"), optional:true, emit: diff_switch_error + tuple val(meta), path("*.diff.switch") , optional:true, emit: diff_switch_error + path "versions.yml" , emit: versions script: - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def args = options.args.tokenize() + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = options.args.tokenize() def bed_arg = (options.args.contains('--bed')) ? "--bed ${bed}" : (options.args.contains('--exclude-bed')) ? "--exclude-bed ${bed}" : @@ -121,7 +120,7 @@ process VCFTOOLS { --out $prefix \\ ${args.join(' ')} \\ $bed_arg \\ - $diff_variant_arg \\ + $diff_variant_arg cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: From 49da8642876ae4d91128168cd0db4f1c858d7792 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Sun, 3 Oct 2021 08:20:26 +0100 Subject: [PATCH 24/61] Update versions key in meta.yml for all modules (#787) --- modules/abacas/meta.yml | 4 ++-- modules/adapterremoval/meta.yml | 4 ++-- modules/agrvate/meta.yml | 4 ++-- modules/allelecounter/meta.yml | 4 ++-- modules/amps/meta.yml | 4 ++-- modules/arriba/meta.yml | 4 ++-- modules/artic/guppyplex/meta.yml | 4 ++-- modules/artic/minion/meta.yml | 4 ++-- modules/bamaligncleaner/meta.yml | 4 ++-- modules/bandage/image/meta.yml | 4 ++-- modules/bbmap/align/meta.yml | 4 ++-- modules/bbmap/bbduk/meta.yml | 4 ++-- modules/bbmap/bbsplit/meta.yml | 4 ++-- modules/bbmap/index/meta.yml | 4 ++-- modules/bcftools/concat/meta.yml | 4 ++-- modules/bcftools/consensus/meta.yml | 4 ++-- modules/bcftools/filter/meta.yml | 4 ++-- modules/bcftools/isec/meta.yml | 4 ++-- modules/bcftools/merge/meta.yml | 4 ++-- modules/bcftools/mpileup/meta.yml | 4 ++-- modules/bcftools/norm/meta.yml | 4 ++-- modules/bcftools/query/meta.yml | 4 ++-- modules/bcftools/reheader/meta.yml | 4 ++-- modules/bcftools/stats/meta.yml | 4 ++-- modules/bcftools/view/meta.yml | 4 ++-- modules/bedtools/bamtobed/meta.yml | 4 ++-- modules/bedtools/complement/meta.yml | 4 ++-- modules/bedtools/genomecov/meta.yml | 4 ++-- modules/bedtools/getfasta/meta.yml | 4 ++-- modules/bedtools/intersect/meta.yml | 4 ++-- modules/bedtools/makewindows/meta.yml | 4 ++-- modules/bedtools/maskfasta/meta.yml | 4 ++-- modules/bedtools/merge/meta.yml | 4 ++-- modules/bedtools/slop/meta.yml | 4 ++-- modules/bedtools/sort/meta.yml | 4 ++-- modules/bedtools/subtract/meta.yml | 4 ++-- modules/bismark/align/meta.yml | 4 ++-- modules/bismark/deduplicate/meta.yml | 4 ++-- modules/bismark/genomepreparation/meta.yml | 4 ++-- modules/bismark/methylationextractor/meta.yml | 4 ++-- modules/bismark/report/meta.yml | 4 ++-- modules/bismark/summary/meta.yml | 4 ++-- modules/blast/blastn/meta.yml | 4 ++-- modules/blast/makeblastdb/meta.yml | 4 ++-- modules/bowtie/align/meta.yml | 4 ++-- modules/bowtie/build/meta.yml | 4 ++-- modules/bowtie2/align/meta.yml | 4 ++-- modules/bowtie2/build/meta.yml | 4 ++-- modules/bwa/aln/meta.yml | 4 ++-- modules/bwa/index/meta.yml | 4 ++-- modules/bwa/mem/meta.yml | 4 ++-- modules/bwa/sampe/meta.yml | 4 ++-- modules/bwa/samse/meta.yml | 4 ++-- modules/bwamem2/index/meta.yml | 4 ++-- modules/bwamem2/mem/meta.yml | 4 ++-- modules/bwameth/align/meta.yml | 4 ++-- modules/bwameth/index/meta.yml | 4 ++-- modules/cat/cat/meta.yml | 4 ++-- modules/cat/fastq/meta.yml | 5 +++++ modules/chromap/chromap/meta.yml | 4 ++-- modules/chromap/index/meta.yml | 4 ++-- modules/cnvkit/meta.yml | 4 ++-- modules/cooler/digest/meta.yml | 4 ++-- modules/cooler/dump/meta.yml | 4 ++-- modules/custom/dumpsoftwareversions/meta.yml | 4 ++-- modules/cutadapt/meta.yml | 4 ++-- modules/damageprofiler/meta.yml | 4 ++-- modules/deeptools/computematrix/meta.yml | 4 ++-- modules/deeptools/plotfingerprint/meta.yml | 4 ++-- modules/deeptools/plotheatmap/meta.yml | 4 ++-- modules/deeptools/plotprofile/meta.yml | 4 ++-- modules/delly/call/meta.yml | 4 ++-- modules/diamond/blastp/meta.yml | 4 ++-- modules/diamond/blastx/meta.yml | 4 ++-- modules/diamond/makedb/meta.yml | 4 ++-- modules/dragonflye/meta.yml | 4 ++-- modules/dshbio/exportsegments/meta.yml | 4 ++-- modules/dshbio/filterbed/meta.yml | 4 ++-- modules/dshbio/filtergff3/meta.yml | 4 ++-- modules/dshbio/splitbed/meta.yml | 4 ++-- modules/dshbio/splitgff3/meta.yml | 4 ++-- modules/ensemblvep/meta.yml | 4 ++-- modules/expansionhunter/meta.yml | 4 ++-- modules/fastani/meta.yml | 4 ++-- modules/fastp/meta.yml | 4 ++-- modules/fastqc/meta.yml | 4 ++-- modules/fasttree/meta.yml | 4 ++-- modules/fgbio/callmolecularconsensusreads/meta.yml | 4 ++-- modules/fgbio/sortbam/meta.yml | 4 ++-- modules/flash/meta.yml | 4 ++-- modules/gatk4/applybqsr/meta.yml | 4 ++-- modules/gatk4/baserecalibrator/meta.yml | 4 ++-- modules/gatk4/bedtointervallist/meta.yml | 4 ++-- modules/gatk4/createsequencedictionary/meta.yml | 4 ++-- modules/gatk4/fastqtosam/meta.yml | 4 ++-- modules/gatk4/getpileupsummaries/meta.yml | 4 ++-- modules/gatk4/haplotypecaller/meta.yml | 4 ++-- modules/gatk4/intervallisttools/meta.yml | 4 ++-- modules/gatk4/markduplicates/meta.yml | 4 ++-- modules/gatk4/mergebamalignment/meta.yml | 4 ++-- modules/gatk4/mergevcfs/meta.yml | 4 ++-- modules/gatk4/mutect2/meta.yml | 4 ++-- modules/gatk4/revertsam/meta.yml | 4 ++-- modules/gatk4/samtofastq/meta.yml | 4 ++-- modules/gatk4/splitncigarreads/meta.yml | 4 ++-- modules/gatk4/variantfiltration/meta.yml | 4 ++-- modules/genmap/index/meta.yml | 4 ++-- modules/genmap/mappability/meta.yml | 4 ++-- modules/gffread/meta.yml | 4 ++-- modules/glnexus/meta.yml | 4 ++-- modules/graphmap2/align/meta.yml | 4 ++-- modules/graphmap2/index/meta.yml | 4 ++-- modules/gubbins/meta.yml | 4 ++-- modules/gunzip/meta.yml | 4 ++-- modules/hifiasm/meta.yml | 4 ++-- modules/hisat2/align/meta.yml | 4 ++-- modules/hisat2/build/meta.yml | 4 ++-- modules/hisat2/extractsplicesites/meta.yml | 4 ++-- modules/hmmer/hmmalign/meta.yml | 4 ++-- modules/homer/annotatepeaks/meta.yml | 4 ++-- modules/homer/findpeaks/meta.yml | 4 ++-- modules/homer/maketagdirectory/meta.yml | 4 ++-- modules/homer/makeucscfile/meta.yml | 4 ++-- modules/iqtree/meta.yml | 4 ++-- modules/ivar/consensus/meta.yml | 4 ++-- modules/ivar/trim/meta.yml | 4 ++-- modules/ivar/variants/meta.yml | 4 ++-- modules/kallisto/index/meta.yml | 4 ++-- modules/kallistobustools/count/meta.yml | 4 ++-- modules/kallistobustools/ref/meta.yml | 4 ++-- modules/kleborate/meta.yml | 4 ++-- modules/kraken2/kraken2/meta.yml | 4 ++-- modules/last/dotplot/meta.yml | 4 ++-- modules/last/lastal/meta.yml | 4 ++-- modules/last/lastdb/meta.yml | 4 ++-- modules/last/mafconvert/meta.yml | 4 ++-- modules/last/mafswap/meta.yml | 4 ++-- modules/last/postmask/meta.yml | 4 ++-- modules/last/split/meta.yml | 4 ++-- modules/last/train/meta.yml | 4 ++-- modules/lima/meta.yml | 6 +++--- modules/lofreq/call/meta.yml | 4 ++-- modules/lofreq/callparallel/meta.yml | 4 ++-- modules/lofreq/filter/meta.yml | 4 ++-- modules/lofreq/indelqual/meta.yml | 4 ++-- modules/malt/build/meta.yml | 4 ++-- modules/malt/run/meta.yml | 4 ++-- modules/maltextract/meta.yml | 4 ++-- modules/mash/sketch/main.nf | 1 + modules/mash/sketch/meta.yml | 6 +++++- modules/metaphlan3/meta.yml | 4 ++-- modules/methyldackel/extract/meta.yml | 4 ++-- modules/methyldackel/mbias/meta.yml | 4 ++-- modules/minia/meta.yml | 4 ++-- modules/minimap2/align/meta.yml | 4 ++-- modules/minimap2/index/meta.yml | 4 ++-- modules/mosdepth/meta.yml | 4 ++-- modules/msisensor/msi/meta.yml | 4 ++-- modules/msisensor/scan/meta.yml | 4 ++-- modules/multiqc/meta.yml | 4 ++-- modules/muscle/meta.yml | 4 ++-- modules/nanolyse/meta.yml | 4 ++-- modules/nanoplot/meta.yml | 4 ++-- modules/nextclade/meta.yml | 4 ++-- modules/optitype/meta.yml | 4 ++-- modules/pairix/meta.yml | 4 ++-- modules/pairtools/dedup/meta.yml | 4 ++-- modules/pairtools/flip/meta.yml | 4 ++-- modules/pairtools/parse/meta.yml | 4 ++-- modules/pairtools/restrict/meta.yml | 4 ++-- modules/pairtools/select/meta.yml | 4 ++-- modules/pairtools/sort/meta.yml | 4 ++-- modules/pangolin/meta.yml | 4 ++-- modules/pbccs/meta.yml | 4 ++-- modules/picard/collectmultiplemetrics/meta.yml | 4 ++-- modules/picard/collectwgsmetrics/meta.yml | 4 ++-- modules/picard/filtersamreads/meta.yml | 4 ++-- modules/picard/markduplicates/meta.yml | 4 ++-- modules/picard/mergesamfiles/meta.yml | 4 ++-- modules/picard/sortsam/meta.yml | 4 ++-- modules/plasmidid/meta.yml | 4 ++-- modules/plink/vcf/meta.yml | 4 ++-- modules/preseq/lcextrap/meta.yml | 4 ++-- modules/prodigal/meta.yml | 4 ++-- modules/prokka/meta.yml | 4 ++-- modules/pycoqc/meta.yml | 4 ++-- modules/pydamage/analyze/meta.yml | 4 ++-- modules/pydamage/filter/meta.yml | 4 ++-- modules/qcat/meta.yml | 4 ++-- modules/qualimap/bamqc/meta.yml | 4 ++-- modules/quast/meta.yml | 4 ++-- modules/rapidnj/meta.yml | 4 ++-- modules/rasusa/meta.yml | 4 ++-- modules/raxmlng/meta.yml | 4 ++-- modules/rsem/calculateexpression/meta.yml | 4 ++-- modules/rsem/preparereference/meta.yml | 4 ++-- modules/rseqc/bamstat/meta.yml | 4 ++-- modules/rseqc/inferexperiment/meta.yml | 4 ++-- modules/rseqc/innerdistance/meta.yml | 4 ++-- modules/rseqc/junctionannotation/meta.yml | 4 ++-- modules/rseqc/junctionsaturation/meta.yml | 4 ++-- modules/rseqc/readdistribution/meta.yml | 4 ++-- modules/rseqc/readduplication/meta.yml | 4 ++-- modules/salmon/index/meta.yml | 4 ++-- modules/salmon/quant/meta.yml | 4 ++-- modules/samtools/ampliconclip/meta.yml | 4 ++-- modules/samtools/faidx/meta.yml | 4 ++-- modules/samtools/fastq/meta.yml | 4 ++-- modules/samtools/flagstat/meta.yml | 4 ++-- modules/samtools/idxstats/meta.yml | 4 ++-- modules/samtools/index/meta.yml | 4 ++-- modules/samtools/merge/meta.yml | 4 ++-- modules/samtools/mpileup/meta.yml | 4 ++-- modules/samtools/sort/meta.yml | 4 ++-- modules/samtools/stats/meta.yml | 4 ++-- modules/samtools/view/meta.yml | 4 ++-- modules/seacr/callpeak/meta.yml | 4 ++-- modules/seqkit/split2/meta.yml | 4 ++-- modules/seqtk/sample/meta.yml | 4 ++-- modules/seqtk/subseq/meta.yml | 4 ++-- modules/sequenzautils/bam2seqz/meta.yml | 4 ++-- modules/sequenzautils/gcwiggle/meta.yml | 4 ++-- modules/seqwish/induce/meta.yml | 4 ++-- modules/shovill/meta.yml | 4 ++-- modules/snpdists/meta.yml | 4 ++-- modules/snpeff/meta.yml | 4 ++-- modules/snpsites/meta.yml | 4 ++-- modules/spades/meta.yml | 4 ++-- modules/staphopiasccmec/meta.yml | 4 ++-- modules/star/align/meta.yml | 4 ++-- modules/star/genomegenerate/meta.yml | 4 ++-- modules/strelka/germline/meta.yml | 4 ++-- modules/stringtie/merge/meta.yml | 5 +++++ modules/stringtie/stringtie/meta.yml | 4 ++-- modules/subread/featurecounts/meta.yml | 4 ++-- modules/tabix/bgzip/meta.yml | 4 ++-- modules/tabix/bgziptabix/meta.yml | 4 ++-- modules/tabix/tabix/meta.yml | 4 ++-- modules/tiddit/sv/meta.yml | 4 ++-- modules/trimgalore/meta.yml | 4 ++-- modules/ucsc/bed12tobigbed/meta.yml | 4 ++-- modules/ucsc/bedclip/meta.yml | 4 ++-- modules/ucsc/bedgraphtobigwig/meta.yml | 4 ++-- modules/ucsc/bigwigaverageoverbed/meta.yml | 4 ++-- modules/ucsc/wigtobigwig/meta.yml | 4 ++-- modules/unicycler/meta.yml | 8 ++++---- modules/untar/meta.yml | 4 ++-- modules/unzip/meta.yml | 8 ++++---- modules/variantbam/meta.yml | 4 ++-- modules/vcftools/meta.yml | 4 ++-- modules/yara/index/meta.yml | 4 ++-- modules/yara/mapper/meta.yml | 4 ++-- 252 files changed, 517 insertions(+), 502 deletions(-) diff --git a/modules/abacas/meta.yml b/modules/abacas/meta.yml index d8c45628..039fb0be 100644 --- a/modules/abacas/meta.yml +++ b/modules/abacas/meta.yml @@ -48,9 +48,9 @@ output: 'test.abacas.MULTIFASTA.fa' ] pattern: "*.{abacas}*" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/adapterremoval/meta.yml b/modules/adapterremoval/meta.yml index 6282436a..05386fd8 100644 --- a/modules/adapterremoval/meta.yml +++ b/modules/adapterremoval/meta.yml @@ -41,9 +41,9 @@ output: type: file description: AdapterRemoval log file pattern: "*.log" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/agrvate/meta.yml b/modules/agrvate/meta.yml index bd27050a..a8ab5816 100644 --- a/modules/agrvate/meta.yml +++ b/modules/agrvate/meta.yml @@ -38,9 +38,9 @@ output: type: directory description: Results of the agrvate assessement pattern: "*-results" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/allelecounter/meta.yml b/modules/allelecounter/meta.yml index 67b398f3..a15f3eac 100644 --- a/modules/allelecounter/meta.yml +++ b/modules/allelecounter/meta.yml @@ -39,9 +39,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - alleleCount: type: file diff --git a/modules/amps/meta.yml b/modules/amps/meta.yml index 62844f6a..43d68599 100644 --- a/modules/amps/meta.yml +++ b/modules/amps/meta.yml @@ -41,9 +41,9 @@ input: pattern: "def_anc|default|scan|ancient|crawl" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - json: type: file diff --git a/modules/arriba/meta.yml b/modules/arriba/meta.yml index ddd2c75b..6ca16dab 100644 --- a/modules/arriba/meta.yml +++ b/modules/arriba/meta.yml @@ -37,9 +37,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - fusions: type: file diff --git a/modules/artic/guppyplex/meta.yml b/modules/artic/guppyplex/meta.yml index 45ec7138..5056f908 100644 --- a/modules/artic/guppyplex/meta.yml +++ b/modules/artic/guppyplex/meta.yml @@ -34,9 +34,9 @@ output: type: file description: Aggregated FastQ files pattern: "*.{fastq.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/artic/minion/meta.yml b/modules/artic/minion/meta.yml index 77f325e5..464e1dc7 100644 --- a/modules/artic/minion/meta.yml +++ b/modules/artic/minion/meta.yml @@ -103,9 +103,9 @@ output: type: file description: JSON file for MultiQC pattern: "*.json" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/bamaligncleaner/meta.yml b/modules/bamaligncleaner/meta.yml index c236c0ea..d1e171f7 100644 --- a/modules/bamaligncleaner/meta.yml +++ b/modules/bamaligncleaner/meta.yml @@ -27,9 +27,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/bandage/image/meta.yml b/modules/bandage/image/meta.yml index f655cae4..65f47664 100644 --- a/modules/bandage/image/meta.yml +++ b/modules/bandage/image/meta.yml @@ -35,9 +35,9 @@ output: type: file description: Bandage image in SVG format pattern: "*.svg" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/bbmap/align/meta.yml b/modules/bbmap/align/meta.yml index bb52f06e..fe4d4334 100644 --- a/modules/bbmap/align/meta.yml +++ b/modules/bbmap/align/meta.yml @@ -39,9 +39,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/bbmap/bbduk/meta.yml b/modules/bbmap/bbduk/meta.yml index a1ab789c..50ab6ed4 100644 --- a/modules/bbmap/bbduk/meta.yml +++ b/modules/bbmap/bbduk/meta.yml @@ -39,9 +39,9 @@ output: type: file description: The trimmed/modified fastq reads pattern: "*fastq.gz" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - log: type: file diff --git a/modules/bbmap/bbsplit/meta.yml b/modules/bbmap/bbsplit/meta.yml index 2eb3a6c9..2e3d07c0 100644 --- a/modules/bbmap/bbsplit/meta.yml +++ b/modules/bbmap/bbsplit/meta.yml @@ -49,9 +49,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - index: type: directory diff --git a/modules/bbmap/index/meta.yml b/modules/bbmap/index/meta.yml index 1df990b2..0b3e5778 100644 --- a/modules/bbmap/index/meta.yml +++ b/modules/bbmap/index/meta.yml @@ -20,9 +20,9 @@ input: pattern: "*.{fna,fa,fasta}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - db: type: directory diff --git a/modules/bcftools/concat/meta.yml b/modules/bcftools/concat/meta.yml index 81701288..e394d18d 100644 --- a/modules/bcftools/concat/meta.yml +++ b/modules/bcftools/concat/meta.yml @@ -34,9 +34,9 @@ output: type: file description: VCF concatenated output file pattern: "*.{vcf.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/bcftools/consensus/meta.yml b/modules/bcftools/consensus/meta.yml index 4241e441..30f4910a 100644 --- a/modules/bcftools/consensus/meta.yml +++ b/modules/bcftools/consensus/meta.yml @@ -39,9 +39,9 @@ output: type: file description: FASTA reference consensus file pattern: "*.{fasta,fa}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/bcftools/filter/meta.yml b/modules/bcftools/filter/meta.yml index 6842b1f8..433b203d 100644 --- a/modules/bcftools/filter/meta.yml +++ b/modules/bcftools/filter/meta.yml @@ -31,9 +31,9 @@ output: type: file description: VCF filtered output file pattern: "*.{vcf}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/bcftools/isec/meta.yml b/modules/bcftools/isec/meta.yml index 7a75a3af..6a482257 100644 --- a/modules/bcftools/isec/meta.yml +++ b/modules/bcftools/isec/meta.yml @@ -39,9 +39,9 @@ output: type: directory description: Folder containing the set operations results perform on the vcf files pattern: "${prefix}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/bcftools/merge/meta.yml b/modules/bcftools/merge/meta.yml index 262d883a..056ea37d 100644 --- a/modules/bcftools/merge/meta.yml +++ b/modules/bcftools/merge/meta.yml @@ -37,9 +37,9 @@ output: type: file description: VCF merged output file pattern: "*.{vcf.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/bcftools/mpileup/meta.yml b/modules/bcftools/mpileup/meta.yml index 44f2b81e..49f02a40 100644 --- a/modules/bcftools/mpileup/meta.yml +++ b/modules/bcftools/mpileup/meta.yml @@ -43,9 +43,9 @@ output: type: file description: Text output file containing stats pattern: "*{stats.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/bcftools/norm/meta.yml b/modules/bcftools/norm/meta.yml index f2534452..760186dc 100644 --- a/modules/bcftools/norm/meta.yml +++ b/modules/bcftools/norm/meta.yml @@ -37,9 +37,9 @@ output: type: file description: VCF normalized output file pattern: "*.{vcf.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/bcftools/query/meta.yml b/modules/bcftools/query/meta.yml index 57570c64..12b11216 100644 --- a/modules/bcftools/query/meta.yml +++ b/modules/bcftools/query/meta.yml @@ -53,9 +53,9 @@ output: type: file description: VCF query output file pattern: "*.{vcf.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/bcftools/reheader/meta.yml b/modules/bcftools/reheader/meta.yml index 823e3279..6d7c9f97 100644 --- a/modules/bcftools/reheader/meta.yml +++ b/modules/bcftools/reheader/meta.yml @@ -38,9 +38,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - vcf: type: file diff --git a/modules/bcftools/stats/meta.yml b/modules/bcftools/stats/meta.yml index 33675cb9..78294ff7 100644 --- a/modules/bcftools/stats/meta.yml +++ b/modules/bcftools/stats/meta.yml @@ -32,9 +32,9 @@ output: type: file description: Text output file containing stats pattern: "*_{stats.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/bcftools/view/meta.yml b/modules/bcftools/view/meta.yml index e37e41b5..638a4e4f 100644 --- a/modules/bcftools/view/meta.yml +++ b/modules/bcftools/view/meta.yml @@ -54,9 +54,9 @@ output: type: file description: VCF normalized output file pattern: "*.{vcf.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/bedtools/bamtobed/meta.yml b/modules/bedtools/bamtobed/meta.yml index 5d7889ea..0eaf3e2a 100644 --- a/modules/bedtools/bamtobed/meta.yml +++ b/modules/bedtools/bamtobed/meta.yml @@ -28,9 +28,9 @@ output: type: file description: Bed file containing genomic intervals. pattern: "*.{bed}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@yuukiiwa" diff --git a/modules/bedtools/complement/meta.yml b/modules/bedtools/complement/meta.yml index 183c9e8f..02ddca29 100644 --- a/modules/bedtools/complement/meta.yml +++ b/modules/bedtools/complement/meta.yml @@ -32,9 +32,9 @@ output: type: file description: Bed file with all genomic intervals that are not covered by at least one record from the input file. pattern: "*.{bed}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@Emiller88" diff --git a/modules/bedtools/genomecov/meta.yml b/modules/bedtools/genomecov/meta.yml index 7f28c185..bc49ab03 100644 --- a/modules/bedtools/genomecov/meta.yml +++ b/modules/bedtools/genomecov/meta.yml @@ -35,9 +35,9 @@ output: type: file description: Computed genome coverage file pattern: "*.${extension}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@Emiller88" diff --git a/modules/bedtools/getfasta/meta.yml b/modules/bedtools/getfasta/meta.yml index 1ddd4bbb..89fbea54 100644 --- a/modules/bedtools/getfasta/meta.yml +++ b/modules/bedtools/getfasta/meta.yml @@ -24,9 +24,9 @@ output: type: file description: Output fasta file with extracted sequences pattern: "*.{fa}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/bedtools/intersect/meta.yml b/modules/bedtools/intersect/meta.yml index 2c229884..a14bf515 100644 --- a/modules/bedtools/intersect/meta.yml +++ b/modules/bedtools/intersect/meta.yml @@ -35,9 +35,9 @@ output: type: file description: File containing the description of overlaps found between the two features pattern: "*.${extension}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@Emiller88" diff --git a/modules/bedtools/makewindows/meta.yml b/modules/bedtools/makewindows/meta.yml index dcddbc75..7d86e127 100644 --- a/modules/bedtools/makewindows/meta.yml +++ b/modules/bedtools/makewindows/meta.yml @@ -31,9 +31,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - tab: type: file diff --git a/modules/bedtools/maskfasta/meta.yml b/modules/bedtools/maskfasta/meta.yml index 0474118b..428d6f57 100644 --- a/modules/bedtools/maskfasta/meta.yml +++ b/modules/bedtools/maskfasta/meta.yml @@ -34,9 +34,9 @@ output: type: file description: Output masked fasta file pattern: "*.{fa}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/bedtools/merge/meta.yml b/modules/bedtools/merge/meta.yml index 0618c0ff..39e79cbd 100644 --- a/modules/bedtools/merge/meta.yml +++ b/modules/bedtools/merge/meta.yml @@ -28,9 +28,9 @@ output: type: file description: Overlapped bed file with combined features pattern: "*.{bed}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@Emiller88" diff --git a/modules/bedtools/slop/meta.yml b/modules/bedtools/slop/meta.yml index bdcdc1d2..709d88c3 100644 --- a/modules/bedtools/slop/meta.yml +++ b/modules/bedtools/slop/meta.yml @@ -28,9 +28,9 @@ output: type: file description: Slopped BED file pattern: "*.{bed}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@Emiller88" diff --git a/modules/bedtools/sort/meta.yml b/modules/bedtools/sort/meta.yml index d09886a5..a0332787 100644 --- a/modules/bedtools/sort/meta.yml +++ b/modules/bedtools/sort/meta.yml @@ -28,9 +28,9 @@ output: type: file description: Sorted BED file pattern: "*.{bed}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@Emiller88" diff --git a/modules/bedtools/subtract/meta.yml b/modules/bedtools/subtract/meta.yml index 8c99b80a..e13057bb 100644 --- a/modules/bedtools/subtract/meta.yml +++ b/modules/bedtools/subtract/meta.yml @@ -36,9 +36,9 @@ output: type: file description: File containing the difference between the two sets of features patters: "*.bed" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/bismark/align/meta.yml b/modules/bismark/align/meta.yml index d9bacf04..92a3b1ec 100644 --- a/modules/bismark/align/meta.yml +++ b/modules/bismark/align/meta.yml @@ -50,9 +50,9 @@ output: type: file description: Bismark alignment reports pattern: "*{report.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/deduplicate/meta.yml b/modules/bismark/deduplicate/meta.yml index 11d8797b..d19a915f 100644 --- a/modules/bismark/deduplicate/meta.yml +++ b/modules/bismark/deduplicate/meta.yml @@ -43,9 +43,9 @@ output: type: file description: Bismark deduplication reports pattern: "*.{deduplication_report.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/genomepreparation/meta.yml b/modules/bismark/genomepreparation/meta.yml index 6d267343..7712d7c2 100644 --- a/modules/bismark/genomepreparation/meta.yml +++ b/modules/bismark/genomepreparation/meta.yml @@ -28,9 +28,9 @@ output: type: dir description: Bismark genome index directory pattern: "BismarkIndex" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/methylationextractor/meta.yml b/modules/bismark/methylationextractor/meta.yml index 2ae7cf64..9fa0f4f4 100644 --- a/modules/bismark/methylationextractor/meta.yml +++ b/modules/bismark/methylationextractor/meta.yml @@ -58,9 +58,9 @@ output: type: file description: Text file containing methylation bias information pattern: "*.{M-bias.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/report/meta.yml b/modules/bismark/report/meta.yml index 57b8c746..889d1227 100644 --- a/modules/bismark/report/meta.yml +++ b/modules/bismark/report/meta.yml @@ -51,9 +51,9 @@ output: type: file description: Bismark reports pattern: "*.{html,txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/summary/meta.yml b/modules/bismark/summary/meta.yml index 37d8951b..10f71fe4 100644 --- a/modules/bismark/summary/meta.yml +++ b/modules/bismark/summary/meta.yml @@ -45,9 +45,9 @@ output: type: file description: Bismark summary pattern: "*.{html,txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@phue" diff --git a/modules/blast/blastn/meta.yml b/modules/blast/blastn/meta.yml index b4a832ea..d19d3df6 100644 --- a/modules/blast/blastn/meta.yml +++ b/modules/blast/blastn/meta.yml @@ -31,9 +31,9 @@ output: type: file description: File containing blastn hits pattern: "*.{blastn.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/blast/makeblastdb/meta.yml b/modules/blast/makeblastdb/meta.yml index 9a5957db..545cc2a0 100644 --- a/modules/blast/makeblastdb/meta.yml +++ b/modules/blast/makeblastdb/meta.yml @@ -21,9 +21,9 @@ output: type: directory description: Output directory containing blast database files pattern: "*" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/bowtie/align/meta.yml b/modules/bowtie/align/meta.yml index e5ada585..73c65631 100644 --- a/modules/bowtie/align/meta.yml +++ b/modules/bowtie/align/meta.yml @@ -33,9 +33,9 @@ output: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - fastq: type: file diff --git a/modules/bowtie/build/meta.yml b/modules/bowtie/build/meta.yml index e97068f6..aa39f32e 100644 --- a/modules/bowtie/build/meta.yml +++ b/modules/bowtie/build/meta.yml @@ -22,9 +22,9 @@ output: type: file description: Bowtie genome index files pattern: "*.ebwt" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/bowtie2/align/meta.yml b/modules/bowtie2/align/meta.yml index cba6eacf..f9d54d87 100644 --- a/modules/bowtie2/align/meta.yml +++ b/modules/bowtie2/align/meta.yml @@ -33,9 +33,9 @@ output: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - fastq: type: file diff --git a/modules/bowtie2/build/meta.yml b/modules/bowtie2/build/meta.yml index 70045f3c..4531d079 100644 --- a/modules/bowtie2/build/meta.yml +++ b/modules/bowtie2/build/meta.yml @@ -23,9 +23,9 @@ output: type: file description: Bowtie2 genome index files pattern: "*.bt2" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/bwa/aln/meta.yml b/modules/bwa/aln/meta.yml index b3797eac..d4a2b19d 100644 --- a/modules/bwa/aln/meta.yml +++ b/modules/bwa/aln/meta.yml @@ -41,9 +41,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - sai: type: file diff --git a/modules/bwa/index/meta.yml b/modules/bwa/index/meta.yml index 43ffd73d..c3c0a8d8 100644 --- a/modules/bwa/index/meta.yml +++ b/modules/bwa/index/meta.yml @@ -22,9 +22,9 @@ output: type: file description: BWA genome index files pattern: "*.{amb,ann,bwt,pac,sa}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/bwa/mem/meta.yml b/modules/bwa/mem/meta.yml index 618f20d5..66238507 100644 --- a/modules/bwa/mem/meta.yml +++ b/modules/bwa/mem/meta.yml @@ -36,9 +36,9 @@ output: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/bwa/sampe/meta.yml b/modules/bwa/sampe/meta.yml index aeb592f7..ec2dfff5 100644 --- a/modules/bwa/sampe/meta.yml +++ b/modules/bwa/sampe/meta.yml @@ -45,9 +45,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/bwa/samse/meta.yml b/modules/bwa/samse/meta.yml index 3c44741d..1e7ef335 100644 --- a/modules/bwa/samse/meta.yml +++ b/modules/bwa/samse/meta.yml @@ -46,9 +46,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/bwamem2/index/meta.yml b/modules/bwamem2/index/meta.yml index ee84ccfc..1b36be8d 100644 --- a/modules/bwamem2/index/meta.yml +++ b/modules/bwamem2/index/meta.yml @@ -21,9 +21,9 @@ output: type: file description: BWA genome index files pattern: "*.{0132,amb,ann,bwt.2bit.64,pac}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/bwamem2/mem/meta.yml b/modules/bwamem2/mem/meta.yml index 434fc7ca..2fb4449e 100644 --- a/modules/bwamem2/mem/meta.yml +++ b/modules/bwamem2/mem/meta.yml @@ -36,9 +36,9 @@ output: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/bwameth/align/meta.yml b/modules/bwameth/align/meta.yml index 03bd66f7..11fc9949 100644 --- a/modules/bwameth/align/meta.yml +++ b/modules/bwameth/align/meta.yml @@ -43,9 +43,9 @@ output: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bwameth/index/meta.yml b/modules/bwameth/index/meta.yml index b07dbde5..c96fbfbb 100644 --- a/modules/bwameth/index/meta.yml +++ b/modules/bwameth/index/meta.yml @@ -24,9 +24,9 @@ output: type: dir description: Directory containing bwameth genome index pattern: "index" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@phue" diff --git a/modules/cat/cat/meta.yml b/modules/cat/cat/meta.yml index d283107e..f1a46ca3 100644 --- a/modules/cat/cat/meta.yml +++ b/modules/cat/cat/meta.yml @@ -21,9 +21,9 @@ input: description: Full name of output file with or without .gz extension output: - - version: + - versions: type: file - description: File containing version of the pigz software + description: File containing software versions pattern: "versions.yml" - file_out: type: file diff --git a/modules/cat/fastq/meta.yml b/modules/cat/fastq/meta.yml index e7b8eebe..6c6c397e 100644 --- a/modules/cat/fastq/meta.yml +++ b/modules/cat/fastq/meta.yml @@ -28,6 +28,11 @@ output: type: file description: Merged fastq file pattern: "*.{merged.fastq.gz}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/chromap/chromap/meta.yml b/modules/chromap/chromap/meta.yml index d52e4202..57936c67 100644 --- a/modules/chromap/chromap/meta.yml +++ b/modules/chromap/chromap/meta.yml @@ -63,9 +63,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bed: type: file diff --git a/modules/chromap/index/meta.yml b/modules/chromap/index/meta.yml index 0b3aba75..a6a18fe9 100644 --- a/modules/chromap/index/meta.yml +++ b/modules/chromap/index/meta.yml @@ -20,9 +20,9 @@ input: description: Fasta reference file. output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - index: type: file diff --git a/modules/cnvkit/meta.yml b/modules/cnvkit/meta.yml index 5094308f..30c1b588 100755 --- a/modules/cnvkit/meta.yml +++ b/modules/cnvkit/meta.yml @@ -75,9 +75,9 @@ output: type: file description: File containing copy number segment information pattern: "*.{cns}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@kaurravneet4123" diff --git a/modules/cooler/digest/meta.yml b/modules/cooler/digest/meta.yml index f46fbaff..4fb85e4f 100644 --- a/modules/cooler/digest/meta.yml +++ b/modules/cooler/digest/meta.yml @@ -26,9 +26,9 @@ input: documentation: http://biopython.org/DIST/docs/cookbook/Restriction.html output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bed: type: file diff --git a/modules/cooler/dump/meta.yml b/modules/cooler/dump/meta.yml index ab2d0356..1d98a62e 100644 --- a/modules/cooler/dump/meta.yml +++ b/modules/cooler/dump/meta.yml @@ -28,9 +28,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bedpe: type: file diff --git a/modules/custom/dumpsoftwareversions/meta.yml b/modules/custom/dumpsoftwareversions/meta.yml index 1cf61615..8d4a6ed4 100644 --- a/modules/custom/dumpsoftwareversions/meta.yml +++ b/modules/custom/dumpsoftwareversions/meta.yml @@ -24,9 +24,9 @@ output: type: file description: MultiQC custom content YML file containing software versions pattern: "software_versions_mqc.yml" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/cutadapt/meta.yml b/modules/cutadapt/meta.yml index 87276306..62c2ccde 100644 --- a/modules/cutadapt/meta.yml +++ b/modules/cutadapt/meta.yml @@ -36,9 +36,9 @@ output: type: file description: cuatadapt log file pattern: "*cutadapt.log" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/damageprofiler/meta.yml b/modules/damageprofiler/meta.yml index 9451f1b2..ff82ba09 100644 --- a/modules/damageprofiler/meta.yml +++ b/modules/damageprofiler/meta.yml @@ -40,9 +40,9 @@ input: pattern: "*.{fai}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - results: type: dir diff --git a/modules/deeptools/computematrix/meta.yml b/modules/deeptools/computematrix/meta.yml index e3b0282d..584fade1 100644 --- a/modules/deeptools/computematrix/meta.yml +++ b/modules/deeptools/computematrix/meta.yml @@ -46,9 +46,9 @@ output: description: | tabular file containing the scores of the generated matrix pattern: "*.{computeMatrix.vals.mat.tab}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/deeptools/plotfingerprint/meta.yml b/modules/deeptools/plotfingerprint/meta.yml index 6ba88882..3acd1471 100644 --- a/modules/deeptools/plotfingerprint/meta.yml +++ b/modules/deeptools/plotfingerprint/meta.yml @@ -50,9 +50,9 @@ output: description: | file containing BAM file quality metrics pattern: "*.{qcmetrics.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/deeptools/plotheatmap/meta.yml b/modules/deeptools/plotheatmap/meta.yml index 97af67f6..34f2865b 100644 --- a/modules/deeptools/plotheatmap/meta.yml +++ b/modules/deeptools/plotheatmap/meta.yml @@ -44,9 +44,9 @@ output: File containing the matrix of values used to generate the heatmap pattern: "*.{plotHeatmap.mat.tab}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/deeptools/plotprofile/meta.yml b/modules/deeptools/plotprofile/meta.yml index 08fafa49..5b61aed4 100644 --- a/modules/deeptools/plotprofile/meta.yml +++ b/modules/deeptools/plotprofile/meta.yml @@ -44,9 +44,9 @@ output: File containing the matrix of values used to generate the profile pattern: "*.{plotProfile.mat.tab}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/delly/call/meta.yml b/modules/delly/call/meta.yml index 16d1a6f2..75e5c9c2 100644 --- a/modules/delly/call/meta.yml +++ b/modules/delly/call/meta.yml @@ -38,9 +38,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bcf: type: file diff --git a/modules/diamond/blastp/meta.yml b/modules/diamond/blastp/meta.yml index e92b1594..228c1a22 100644 --- a/modules/diamond/blastp/meta.yml +++ b/modules/diamond/blastp/meta.yml @@ -34,9 +34,9 @@ output: type: file description: File containing blastp hits pattern: "*.{blastp.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/diamond/blastx/meta.yml b/modules/diamond/blastx/meta.yml index 6e92a336..4a3ab9b6 100644 --- a/modules/diamond/blastx/meta.yml +++ b/modules/diamond/blastx/meta.yml @@ -34,9 +34,9 @@ output: type: file description: File containing blastx hits pattern: "*.{blastx.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/diamond/makedb/meta.yml b/modules/diamond/makedb/meta.yml index 4d8cb695..e378be7e 100644 --- a/modules/diamond/makedb/meta.yml +++ b/modules/diamond/makedb/meta.yml @@ -25,9 +25,9 @@ output: type: file description: File of the indexed DIAMOND database pattern: "*.{dmnd}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/dragonflye/meta.yml b/modules/dragonflye/meta.yml index 9affa2f3..773795db 100644 --- a/modules/dragonflye/meta.yml +++ b/modules/dragonflye/meta.yml @@ -28,9 +28,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - contigs: type: file diff --git a/modules/dshbio/exportsegments/meta.yml b/modules/dshbio/exportsegments/meta.yml index c57a6179..b9b145df 100644 --- a/modules/dshbio/exportsegments/meta.yml +++ b/modules/dshbio/exportsegments/meta.yml @@ -32,9 +32,9 @@ output: type: file description: Assembly segment sequences in FASTA format pattern: "*.{fa}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/dshbio/filterbed/meta.yml b/modules/dshbio/filterbed/meta.yml index 5545aac1..0e09b392 100644 --- a/modules/dshbio/filterbed/meta.yml +++ b/modules/dshbio/filterbed/meta.yml @@ -30,9 +30,9 @@ output: type: file description: Features in gzipped BED format pattern: "*.{bed.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/dshbio/filtergff3/meta.yml b/modules/dshbio/filtergff3/meta.yml index d1b7a509..2fd916fa 100644 --- a/modules/dshbio/filtergff3/meta.yml +++ b/modules/dshbio/filtergff3/meta.yml @@ -30,9 +30,9 @@ output: type: file description: Features in gzipped GFF3 format pattern: "*.{gff3.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/dshbio/splitbed/meta.yml b/modules/dshbio/splitbed/meta.yml index 0c4788a1..16aec66b 100644 --- a/modules/dshbio/splitbed/meta.yml +++ b/modules/dshbio/splitbed/meta.yml @@ -30,9 +30,9 @@ output: type: file description: Features in split gzipped BED formatted files pattern: "*.{bed.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/dshbio/splitgff3/meta.yml b/modules/dshbio/splitgff3/meta.yml index 1bdfa652..36e37862 100644 --- a/modules/dshbio/splitgff3/meta.yml +++ b/modules/dshbio/splitgff3/meta.yml @@ -30,9 +30,9 @@ output: type: file description: Features in split gzipped GFF3 formatted files pattern: "*.{gff3.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/ensemblvep/meta.yml b/modules/ensemblvep/meta.yml index e97c5609..9ec4f6a4 100644 --- a/modules/ensemblvep/meta.yml +++ b/modules/ensemblvep/meta.yml @@ -56,9 +56,9 @@ output: type: file description: VEP report file pattern: "*.html" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/expansionhunter/meta.yml b/modules/expansionhunter/meta.yml index a5733d93..54bb3293 100644 --- a/modules/expansionhunter/meta.yml +++ b/modules/expansionhunter/meta.yml @@ -37,9 +37,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', gender:'female' ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - vcf: type: file diff --git a/modules/fastani/meta.yml b/modules/fastani/meta.yml index 783ae068..dc62d485 100644 --- a/modules/fastani/meta.yml +++ b/modules/fastani/meta.yml @@ -35,9 +35,9 @@ output: type: file description: Results of the query pattern: "*.ani.txt" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/fastp/meta.yml b/modules/fastp/meta.yml index 72ddb7d7..cfef4a99 100644 --- a/modules/fastp/meta.yml +++ b/modules/fastp/meta.yml @@ -44,9 +44,9 @@ output: type: file description: fastq log file pattern: "*.log" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - reads_fail: type: file diff --git a/modules/fastqc/meta.yml b/modules/fastqc/meta.yml index 48031356..0ae08aee 100644 --- a/modules/fastqc/meta.yml +++ b/modules/fastqc/meta.yml @@ -40,9 +40,9 @@ output: type: file description: FastQC report archive pattern: "*_{fastqc.zip}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/fasttree/meta.yml b/modules/fasttree/meta.yml index 70000030..5906675b 100644 --- a/modules/fasttree/meta.yml +++ b/modules/fasttree/meta.yml @@ -19,9 +19,9 @@ input: pattern: "*.{fasta,fas,fa,mfa}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - phylogeny: type: file diff --git a/modules/fgbio/callmolecularconsensusreads/meta.yml b/modules/fgbio/callmolecularconsensusreads/meta.yml index 3e62c3a6..523f3214 100644 --- a/modules/fgbio/callmolecularconsensusreads/meta.yml +++ b/modules/fgbio/callmolecularconsensusreads/meta.yml @@ -36,9 +36,9 @@ output: description: | Output SAM or BAM file to write consensus reads. pattern: "*.{bam,sam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/fgbio/sortbam/meta.yml b/modules/fgbio/sortbam/meta.yml index def106c3..b8040dab 100644 --- a/modules/fgbio/sortbam/meta.yml +++ b/modules/fgbio/sortbam/meta.yml @@ -34,9 +34,9 @@ output: description: | Output SAM or BAM file. pattern: "*.{bam,sam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/flash/meta.yml b/modules/flash/meta.yml index 62d40e20..06807523 100644 --- a/modules/flash/meta.yml +++ b/modules/flash/meta.yml @@ -35,9 +35,9 @@ output: type: file description: The merged fastq reads pattern: "*fastq.gz" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/gatk4/applybqsr/meta.yml b/modules/gatk4/applybqsr/meta.yml index b0177c76..be815bd8 100644 --- a/modules/gatk4/applybqsr/meta.yml +++ b/modules/gatk4/applybqsr/meta.yml @@ -45,9 +45,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/gatk4/baserecalibrator/meta.yml b/modules/gatk4/baserecalibrator/meta.yml index a5bac064..068f8ef1 100644 --- a/modules/gatk4/baserecalibrator/meta.yml +++ b/modules/gatk4/baserecalibrator/meta.yml @@ -45,9 +45,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - table: type: file diff --git a/modules/gatk4/bedtointervallist/meta.yml b/modules/gatk4/bedtointervallist/meta.yml index 28fd5d22..aacca1a6 100644 --- a/modules/gatk4/bedtointervallist/meta.yml +++ b/modules/gatk4/bedtointervallist/meta.yml @@ -31,9 +31,9 @@ output: type: file description: gatk interval list file pattern: "*.interval_list" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/createsequencedictionary/meta.yml b/modules/gatk4/createsequencedictionary/meta.yml index 21bdc599..90f415a2 100644 --- a/modules/gatk4/createsequencedictionary/meta.yml +++ b/modules/gatk4/createsequencedictionary/meta.yml @@ -22,9 +22,9 @@ output: type: file description: gatk dictionary file pattern: "*.{dict}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/gatk4/fastqtosam/meta.yml b/modules/gatk4/fastqtosam/meta.yml index 4ae9eeaa..ab56ec53 100644 --- a/modules/gatk4/fastqtosam/meta.yml +++ b/modules/gatk4/fastqtosam/meta.yml @@ -34,9 +34,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/gatk4/getpileupsummaries/meta.yml b/modules/gatk4/getpileupsummaries/meta.yml index 5bb87e80..bda0ccb1 100644 --- a/modules/gatk4/getpileupsummaries/meta.yml +++ b/modules/gatk4/getpileupsummaries/meta.yml @@ -48,9 +48,9 @@ output: type: file description: File containing the pileup summary table. pattern: "*.pileups.table" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/gatk4/haplotypecaller/meta.yml b/modules/gatk4/haplotypecaller/meta.yml index 4b8e8387..73adc950 100644 --- a/modules/gatk4/haplotypecaller/meta.yml +++ b/modules/gatk4/haplotypecaller/meta.yml @@ -46,9 +46,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - vcf: type: file diff --git a/modules/gatk4/intervallisttools/meta.yml b/modules/gatk4/intervallisttools/meta.yml index 65adb7b6..14f7db35 100644 --- a/modules/gatk4/intervallisttools/meta.yml +++ b/modules/gatk4/intervallisttools/meta.yml @@ -33,9 +33,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - interval_list: type: file diff --git a/modules/gatk4/markduplicates/meta.yml b/modules/gatk4/markduplicates/meta.yml index 58e30910..bd5ed5e7 100644 --- a/modules/gatk4/markduplicates/meta.yml +++ b/modules/gatk4/markduplicates/meta.yml @@ -32,9 +32,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/gatk4/mergebamalignment/meta.yml b/modules/gatk4/mergebamalignment/meta.yml index e2e7b7ec..7823c458 100644 --- a/modules/gatk4/mergebamalignment/meta.yml +++ b/modules/gatk4/mergebamalignment/meta.yml @@ -37,9 +37,9 @@ output: type: file description: The merged bam file pattern: "*.bam" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/mergevcfs/meta.yml b/modules/gatk4/mergevcfs/meta.yml index d2679ab8..b20d7bb5 100644 --- a/modules/gatk4/mergevcfs/meta.yml +++ b/modules/gatk4/mergevcfs/meta.yml @@ -34,9 +34,9 @@ output: type: file description: merged vcf file pattern: "*.vcf.gz" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/mutect2/meta.yml b/modules/gatk4/mutect2/meta.yml index 75b38153..182b6712 100644 --- a/modules/gatk4/mutect2/meta.yml +++ b/modules/gatk4/mutect2/meta.yml @@ -84,9 +84,9 @@ output: type: file description: file containing information to be passed to LearnReadOrientationModel (only outputted when tumor_normal_pair mode is run) pattern: "*.f1r2.tar.gz" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/gatk4/revertsam/meta.yml b/modules/gatk4/revertsam/meta.yml index d6a1d7fa..619450d3 100644 --- a/modules/gatk4/revertsam/meta.yml +++ b/modules/gatk4/revertsam/meta.yml @@ -27,9 +27,9 @@ output: type: file description: The reverted bam/sam file pattern: "*.reverted.bam" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/samtofastq/meta.yml b/modules/gatk4/samtofastq/meta.yml index 956d2186..20033ec2 100644 --- a/modules/gatk4/samtofastq/meta.yml +++ b/modules/gatk4/samtofastq/meta.yml @@ -27,9 +27,9 @@ output: type: file description: converted fastq file pattern: "*.fastq" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/splitncigarreads/meta.yml b/modules/gatk4/splitncigarreads/meta.yml index c4266874..9eefb545 100644 --- a/modules/gatk4/splitncigarreads/meta.yml +++ b/modules/gatk4/splitncigarreads/meta.yml @@ -32,9 +32,9 @@ output: type: file description: Output file with split reads (BAM/SAM/CRAM) pattern: "*.{bam,sam,cram}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/variantfiltration/meta.yml b/modules/gatk4/variantfiltration/meta.yml index 6b0a9026..4dbd71fe 100644 --- a/modules/gatk4/variantfiltration/meta.yml +++ b/modules/gatk4/variantfiltration/meta.yml @@ -39,9 +39,9 @@ output: type: file description: filtered VCF file pattern: "*.filtered.{vcf}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/genmap/index/meta.yml b/modules/genmap/index/meta.yml index cd299da2..adecf3c0 100644 --- a/modules/genmap/index/meta.yml +++ b/modules/genmap/index/meta.yml @@ -18,9 +18,9 @@ input: pattern: "*.{fasta,fa}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - index: type: index diff --git a/modules/genmap/mappability/meta.yml b/modules/genmap/mappability/meta.yml index 90807077..c28cbd6d 100644 --- a/modules/genmap/mappability/meta.yml +++ b/modules/genmap/mappability/meta.yml @@ -21,9 +21,9 @@ input: description: index file output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - wig: type: file diff --git a/modules/gffread/meta.yml b/modules/gffread/meta.yml index 1cb7fc91..bf1a15cb 100644 --- a/modules/gffread/meta.yml +++ b/modules/gffread/meta.yml @@ -24,9 +24,9 @@ output: type: file description: GTF file resulting from the conversion of the GFF input file pattern: "*.{gtf}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/glnexus/meta.yml b/modules/glnexus/meta.yml index fd1a407d..aec25bb0 100644 --- a/modules/glnexus/meta.yml +++ b/modules/glnexus/meta.yml @@ -24,9 +24,9 @@ input: pattern: "*.{gvcf,gvcf.gz,g.vcf,g.vcf.gz}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bcf: type: file diff --git a/modules/graphmap2/align/meta.yml b/modules/graphmap2/align/meta.yml index a5b3cd6c..a4acb648 100644 --- a/modules/graphmap2/align/meta.yml +++ b/modules/graphmap2/align/meta.yml @@ -41,9 +41,9 @@ output: type: file description: Alignment in SAM format pattern: "*.sam" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@yuukiiwa" diff --git a/modules/graphmap2/index/meta.yml b/modules/graphmap2/index/meta.yml index 4ff63276..e7bd6cb6 100644 --- a/modules/graphmap2/index/meta.yml +++ b/modules/graphmap2/index/meta.yml @@ -20,9 +20,9 @@ output: type: file description: Graphmap2 fasta index in gmidx format pattern: "*.gmidx" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@yuukiiwa" diff --git a/modules/gubbins/meta.yml b/modules/gubbins/meta.yml index 1a49b335..84b930a2 100644 --- a/modules/gubbins/meta.yml +++ b/modules/gubbins/meta.yml @@ -16,9 +16,9 @@ input: description: fasta alignment file pattern: "*.{fasta,fas,fa,aln}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - fasta: type: file diff --git a/modules/gunzip/meta.yml b/modules/gunzip/meta.yml index 60911685..dbec5534 100644 --- a/modules/gunzip/meta.yml +++ b/modules/gunzip/meta.yml @@ -18,9 +18,9 @@ output: type: file description: Compressed/uncompressed file pattern: "*.*" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/hifiasm/meta.yml b/modules/hifiasm/meta.yml index c6d5a735..3d4c9548 100644 --- a/modules/hifiasm/meta.yml +++ b/modules/hifiasm/meta.yml @@ -42,9 +42,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - raw_unitigs: type: file diff --git a/modules/hisat2/align/meta.yml b/modules/hisat2/align/meta.yml index 799f1808..6011cc34 100644 --- a/modules/hisat2/align/meta.yml +++ b/modules/hisat2/align/meta.yml @@ -48,9 +48,9 @@ output: type: file description: Aligment log pattern: "*.log" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/hisat2/build/meta.yml b/modules/hisat2/build/meta.yml index 1d3fc7e6..c08b296d 100644 --- a/modules/hisat2/build/meta.yml +++ b/modules/hisat2/build/meta.yml @@ -29,9 +29,9 @@ input: pattern: "*.{txt}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - index: type: file diff --git a/modules/hisat2/extractsplicesites/meta.yml b/modules/hisat2/extractsplicesites/meta.yml index 3befc4dd..97227faf 100644 --- a/modules/hisat2/extractsplicesites/meta.yml +++ b/modules/hisat2/extractsplicesites/meta.yml @@ -21,9 +21,9 @@ input: pattern: "*.{gtf}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - splicesites: type: file diff --git a/modules/hmmer/hmmalign/meta.yml b/modules/hmmer/hmmalign/meta.yml index 60020b32..c9a50bc2 100644 --- a/modules/hmmer/hmmalign/meta.yml +++ b/modules/hmmer/hmmalign/meta.yml @@ -32,9 +32,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - sthlm: type: file diff --git a/modules/homer/annotatepeaks/meta.yml b/modules/homer/annotatepeaks/meta.yml index f311741b..39fe4197 100644 --- a/modules/homer/annotatepeaks/meta.yml +++ b/modules/homer/annotatepeaks/meta.yml @@ -38,9 +38,9 @@ output: type: file description: The annotated peaks pattern: "*annotatePeaks.txt" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/homer/findpeaks/meta.yml b/modules/homer/findpeaks/meta.yml index 51932688..d1450f3c 100644 --- a/modules/homer/findpeaks/meta.yml +++ b/modules/homer/findpeaks/meta.yml @@ -29,9 +29,9 @@ output: type: file description: The found peaks pattern: "*peaks.txt" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@EMiller88" diff --git a/modules/homer/maketagdirectory/meta.yml b/modules/homer/maketagdirectory/meta.yml index 7a35857b..9a88c2e1 100644 --- a/modules/homer/maketagdirectory/meta.yml +++ b/modules/homer/maketagdirectory/meta.yml @@ -33,9 +33,9 @@ output: type: directory description: The "Tag Directory" pattern: "tag_dir" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@EMiller88" diff --git a/modules/homer/makeucscfile/meta.yml b/modules/homer/makeucscfile/meta.yml index e63e979a..d9123c7e 100644 --- a/modules/homer/makeucscfile/meta.yml +++ b/modules/homer/makeucscfile/meta.yml @@ -30,9 +30,9 @@ output: type: file description: The UCSC bed graph pattern: "tag_dir/*ucsc.bedGraph.gz" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@EMiller88" diff --git a/modules/iqtree/meta.yml b/modules/iqtree/meta.yml index 426ad0cf..0a3b4e4c 100644 --- a/modules/iqtree/meta.yml +++ b/modules/iqtree/meta.yml @@ -20,9 +20,9 @@ input: pattern: "*.{fasta,fas,fa,mfa}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - phylogeny: type: file diff --git a/modules/ivar/consensus/meta.yml b/modules/ivar/consensus/meta.yml index 2a95c51c..389e5fe6 100644 --- a/modules/ivar/consensus/meta.yml +++ b/modules/ivar/consensus/meta.yml @@ -42,9 +42,9 @@ output: type: file description: mpileup output from samtools mpileup [OPTIONAL] pattern: "*.mpileup" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@andersgs" diff --git a/modules/ivar/trim/meta.yml b/modules/ivar/trim/meta.yml index 762a9fe9..4798c25f 100644 --- a/modules/ivar/trim/meta.yml +++ b/modules/ivar/trim/meta.yml @@ -42,9 +42,9 @@ output: type: file description: Log file generated by iVar for use with MultiQC pattern: "*.log" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@andersgs" diff --git a/modules/ivar/variants/meta.yml b/modules/ivar/variants/meta.yml index 37eb9133..a689ffeb 100644 --- a/modules/ivar/variants/meta.yml +++ b/modules/ivar/variants/meta.yml @@ -42,9 +42,9 @@ output: type: file description: mpileup output from samtools mpileup [OPTIONAL] pattern: "*.mpileup" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@andersgs" diff --git a/modules/kallisto/index/meta.yml b/modules/kallisto/index/meta.yml index 6080eb77..a4fb08c3 100644 --- a/modules/kallisto/index/meta.yml +++ b/modules/kallisto/index/meta.yml @@ -18,9 +18,9 @@ input: pattern: "*.{fasta}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - idx: type: index diff --git a/modules/kallistobustools/count/meta.yml b/modules/kallistobustools/count/meta.yml index 41cf91a0..bc2433bb 100644 --- a/modules/kallistobustools/count/meta.yml +++ b/modules/kallistobustools/count/meta.yml @@ -58,9 +58,9 @@ output: type: file description: kb count output folder pattern: "*.{count}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/kallistobustools/ref/meta.yml b/modules/kallistobustools/ref/meta.yml index b9f50f20..353b9c11 100644 --- a/modules/kallistobustools/ref/meta.yml +++ b/modules/kallistobustools/ref/meta.yml @@ -27,9 +27,9 @@ input: pattern: "{standard,lamanno,nucleus}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - kb_ref_idx: type: file diff --git a/modules/kleborate/meta.yml b/modules/kleborate/meta.yml index 0394a626..eaf837e7 100644 --- a/modules/kleborate/meta.yml +++ b/modules/kleborate/meta.yml @@ -29,9 +29,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - txt: type: file diff --git a/modules/kraken2/kraken2/meta.yml b/modules/kraken2/kraken2/meta.yml index 3996fbc0..5b849c3e 100644 --- a/modules/kraken2/kraken2/meta.yml +++ b/modules/kraken2/kraken2/meta.yml @@ -50,9 +50,9 @@ output: Kraken2 report containing stats about classified and not classifed reads. pattern: "*.{report.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/last/dotplot/meta.yml b/modules/last/dotplot/meta.yml index fa092b4c..2ec94f58 100644 --- a/modules/last/dotplot/meta.yml +++ b/modules/last/dotplot/meta.yml @@ -38,9 +38,9 @@ output: type: file description: Pairwise alignment dot plot image, in GIF format. pattern: "*.gif" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/last/lastal/meta.yml b/modules/last/lastal/meta.yml index 1f8fde9c..94e76878 100644 --- a/modules/last/lastal/meta.yml +++ b/modules/last/lastal/meta.yml @@ -39,9 +39,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - maf: type: file diff --git a/modules/last/lastdb/meta.yml b/modules/last/lastdb/meta.yml index cddbc29c..e576fa18 100644 --- a/modules/last/lastdb/meta.yml +++ b/modules/last/lastdb/meta.yml @@ -28,9 +28,9 @@ input: pattern: "*.{fasta,fasta.gz,fastq,fastq.gz}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - index: type: directory diff --git a/modules/last/mafconvert/meta.yml b/modules/last/mafconvert/meta.yml index f0912ccd..3336f315 100644 --- a/modules/last/mafconvert/meta.yml +++ b/modules/last/mafconvert/meta.yml @@ -34,9 +34,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - axt_gz: type: file diff --git a/modules/last/mafswap/meta.yml b/modules/last/mafswap/meta.yml index 8821ab47..ce97fe97 100644 --- a/modules/last/mafswap/meta.yml +++ b/modules/last/mafswap/meta.yml @@ -30,9 +30,9 @@ output: type: file description: Multiple Aligment Format (MAF) file, compressed with gzip pattern: "*.{maf.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/last/postmask/meta.yml b/modules/last/postmask/meta.yml index d3a184eb..02e602f6 100644 --- a/modules/last/postmask/meta.yml +++ b/modules/last/postmask/meta.yml @@ -30,9 +30,9 @@ output: type: file description: Multiple Aligment Format (MAF) file, compressed with gzip pattern: "*.{maf.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/last/split/meta.yml b/modules/last/split/meta.yml index 7b11bcd5..bc16fe9a 100644 --- a/modules/last/split/meta.yml +++ b/modules/last/split/meta.yml @@ -32,9 +32,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - maf: type: file diff --git a/modules/last/train/meta.yml b/modules/last/train/meta.yml index 820e4bc8..20c5780d 100644 --- a/modules/last/train/meta.yml +++ b/modules/last/train/meta.yml @@ -35,9 +35,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - param_file: type: file diff --git a/modules/lima/meta.yml b/modules/lima/meta.yml index 3bb861b5..d77246c6 100644 --- a/modules/lima/meta.yml +++ b/modules/lima/meta.yml @@ -68,10 +68,10 @@ output: type: file description: This file shows how many ZMWs have been filtered, how ZMWs many are same/different, and how many reads have been filtered. pattern: "*.summary" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@sguizard" diff --git a/modules/lofreq/call/meta.yml b/modules/lofreq/call/meta.yml index 16d23cd9..97607663 100644 --- a/modules/lofreq/call/meta.yml +++ b/modules/lofreq/call/meta.yml @@ -33,9 +33,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - vcf: type: file diff --git a/modules/lofreq/callparallel/meta.yml b/modules/lofreq/callparallel/meta.yml index 15257180..a7dbd637 100644 --- a/modules/lofreq/callparallel/meta.yml +++ b/modules/lofreq/callparallel/meta.yml @@ -40,9 +40,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - vcf: type: file diff --git a/modules/lofreq/filter/meta.yml b/modules/lofreq/filter/meta.yml index 9aa92da7..fceee6f5 100644 --- a/modules/lofreq/filter/meta.yml +++ b/modules/lofreq/filter/meta.yml @@ -31,9 +31,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - vcf: type: file diff --git a/modules/lofreq/indelqual/meta.yml b/modules/lofreq/indelqual/meta.yml index 34f296d7..a6ec7dc2 100644 --- a/modules/lofreq/indelqual/meta.yml +++ b/modules/lofreq/indelqual/meta.yml @@ -31,9 +31,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/malt/build/meta.yml b/modules/malt/build/meta.yml index f1668b94..9985d834 100644 --- a/modules/malt/build/meta.yml +++ b/modules/malt/build/meta.yml @@ -38,9 +38,9 @@ input: pattern: output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - index: type: directory diff --git a/modules/malt/run/meta.yml b/modules/malt/run/meta.yml index 3ad78622..740ab8a5 100644 --- a/modules/malt/run/meta.yml +++ b/modules/malt/run/meta.yml @@ -32,9 +32,9 @@ input: description: Index/database directory from malt-build pattern: '*/' output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - rma6: type: file diff --git a/modules/maltextract/meta.yml b/modules/maltextract/meta.yml index 29271753..8f257100 100644 --- a/modules/maltextract/meta.yml +++ b/modules/maltextract/meta.yml @@ -38,9 +38,9 @@ input: pattern: "${ncbi_dir}/" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - results: type: directory diff --git a/modules/mash/sketch/main.nf b/modules/mash/sketch/main.nf index 7a99cc50..f434a5f1 100644 --- a/modules/mash/sketch/main.nf +++ b/modules/mash/sketch/main.nf @@ -34,6 +34,7 @@ process MASH_SKETCH { -o ${prefix} \\ -r $reads \\ 2> ${prefix}.mash_stats + cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(mash --version 2>&1) diff --git a/modules/mash/sketch/meta.yml b/modules/mash/sketch/meta.yml index 3c8c714e..fba0e000 100644 --- a/modules/mash/sketch/meta.yml +++ b/modules/mash/sketch/meta.yml @@ -27,7 +27,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - mash: type: file description: Sketch output pattern: "*.{mash}" @@ -35,6 +35,10 @@ output: type: file description: Sketch statistics pattern: "*.{mash_stats}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@thanhleviet" diff --git a/modules/metaphlan3/meta.yml b/modules/metaphlan3/meta.yml index d9f9f520..0d3c6f85 100644 --- a/modules/metaphlan3/meta.yml +++ b/modules/metaphlan3/meta.yml @@ -31,9 +31,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - profile: type: file diff --git a/modules/methyldackel/extract/meta.yml b/modules/methyldackel/extract/meta.yml index 7219bb81..6c87f7c9 100644 --- a/modules/methyldackel/extract/meta.yml +++ b/modules/methyldackel/extract/meta.yml @@ -49,9 +49,9 @@ output: type: file description: bedGraph file containing per-base methylation metrics pattern: "*.{bedGraph}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@phue" diff --git a/modules/methyldackel/mbias/meta.yml b/modules/methyldackel/mbias/meta.yml index a6f58d09..4bc8f016 100644 --- a/modules/methyldackel/mbias/meta.yml +++ b/modules/methyldackel/mbias/meta.yml @@ -50,9 +50,9 @@ output: type: file description: Text file containing methylation bias pattern: "*.{txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@phue" diff --git a/modules/minia/meta.yml b/modules/minia/meta.yml index 638cc3ad..255bcc20 100644 --- a/modules/minia/meta.yml +++ b/modules/minia/meta.yml @@ -37,9 +37,9 @@ output: type: file description: Minia output h5 file pattern: "*{.h5}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/minimap2/align/meta.yml b/modules/minimap2/align/meta.yml index 1cb20473..35ed411b 100644 --- a/modules/minimap2/align/meta.yml +++ b/modules/minimap2/align/meta.yml @@ -38,9 +38,9 @@ output: type: file description: Alignment in PAF format pattern: "*.paf" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/minimap2/index/meta.yml b/modules/minimap2/index/meta.yml index c1c43c70..e8450add 100644 --- a/modules/minimap2/index/meta.yml +++ b/modules/minimap2/index/meta.yml @@ -20,9 +20,9 @@ output: type: file description: Minimap2 fasta index. pattern: "*.mmi" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@yuukiiwa" diff --git a/modules/mosdepth/meta.yml b/modules/mosdepth/meta.yml index 4c0be86c..5627c268 100644 --- a/modules/mosdepth/meta.yml +++ b/modules/mosdepth/meta.yml @@ -67,9 +67,9 @@ output: type: file description: Index file for BED file with per-region coverage pattern: "*.{regions.bed.gz.csi}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/msisensor/msi/meta.yml b/modules/msisensor/msi/meta.yml index c01f74e0..e3f13e2e 100644 --- a/modules/msisensor/msi/meta.yml +++ b/modules/msisensor/msi/meta.yml @@ -45,9 +45,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - txt: type: file diff --git a/modules/msisensor/scan/meta.yml b/modules/msisensor/scan/meta.yml index 940b53a5..4900f8cc 100644 --- a/modules/msisensor/scan/meta.yml +++ b/modules/msisensor/scan/meta.yml @@ -29,9 +29,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - txt: type: file diff --git a/modules/multiqc/meta.yml b/modules/multiqc/meta.yml index 2d99ec0d..a54f95ac 100644 --- a/modules/multiqc/meta.yml +++ b/modules/multiqc/meta.yml @@ -29,9 +29,9 @@ output: type: file description: Plots created by MultiQC pattern: "*_data" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/muscle/meta.yml b/modules/muscle/meta.yml index 845a8284..d28afa72 100644 --- a/modules/muscle/meta.yml +++ b/modules/muscle/meta.yml @@ -48,9 +48,9 @@ output: type: file description: Log file of MUSCLE run pattern: "*{.log}" - - version: + - versions: type: file - description: File containing MUSCLE software version + description: File containing software versions pattern: "versions.yml" authors: - "@MGordon" diff --git a/modules/nanolyse/meta.yml b/modules/nanolyse/meta.yml index 2411d33d..c59607fa 100644 --- a/modules/nanolyse/meta.yml +++ b/modules/nanolyse/meta.yml @@ -38,9 +38,9 @@ output: type: file description: Log of the Nanolyse run. pattern: "*.log" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@yuukiiwa" diff --git a/modules/nanoplot/meta.yml b/modules/nanoplot/meta.yml index cf897eb9..0527624f 100644 --- a/modules/nanoplot/meta.yml +++ b/modules/nanoplot/meta.yml @@ -49,9 +49,9 @@ output: type: file description: log file of NanoPlot run pattern: "*{.log}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/nextclade/meta.yml b/modules/nextclade/meta.yml index 730b0fa4..1b4a435a 100755 --- a/modules/nextclade/meta.yml +++ b/modules/nextclade/meta.yml @@ -30,9 +30,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - csv: type: file diff --git a/modules/optitype/meta.yml b/modules/optitype/meta.yml index 02e5cec1..15912125 100644 --- a/modules/optitype/meta.yml +++ b/modules/optitype/meta.yml @@ -29,9 +29,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', seq_type:'DNA' ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - output: type: file diff --git a/modules/pairix/meta.yml b/modules/pairix/meta.yml index 3c43541a..45577065 100644 --- a/modules/pairix/meta.yml +++ b/modules/pairix/meta.yml @@ -29,9 +29,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - index: type: file diff --git a/modules/pairtools/dedup/meta.yml b/modules/pairtools/dedup/meta.yml index d5a8ae87..288b421e 100644 --- a/modules/pairtools/dedup/meta.yml +++ b/modules/pairtools/dedup/meta.yml @@ -27,9 +27,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - pairs: type: file diff --git a/modules/pairtools/flip/meta.yml b/modules/pairtools/flip/meta.yml index 981e3828..0d7aa082 100644 --- a/modules/pairtools/flip/meta.yml +++ b/modules/pairtools/flip/meta.yml @@ -30,9 +30,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - flip: type: file diff --git a/modules/pairtools/parse/meta.yml b/modules/pairtools/parse/meta.yml index 940fe5d1..8c9c30dc 100644 --- a/modules/pairtools/parse/meta.yml +++ b/modules/pairtools/parse/meta.yml @@ -31,9 +31,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - pairsam: type: file diff --git a/modules/pairtools/restrict/meta.yml b/modules/pairtools/restrict/meta.yml index 9dfb8f76..0ab3b420 100644 --- a/modules/pairtools/restrict/meta.yml +++ b/modules/pairtools/restrict/meta.yml @@ -33,9 +33,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - restrict: type: file diff --git a/modules/pairtools/select/meta.yml b/modules/pairtools/select/meta.yml index 18e97e99..5e45129b 100644 --- a/modules/pairtools/select/meta.yml +++ b/modules/pairtools/select/meta.yml @@ -27,9 +27,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - selected: type: file diff --git a/modules/pairtools/sort/meta.yml b/modules/pairtools/sort/meta.yml index 6f36323c..6db2f9e2 100644 --- a/modules/pairtools/sort/meta.yml +++ b/modules/pairtools/sort/meta.yml @@ -27,9 +27,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - sorted: type: file diff --git a/modules/pangolin/meta.yml b/modules/pangolin/meta.yml index b1b583e9..29878ef0 100644 --- a/modules/pangolin/meta.yml +++ b/modules/pangolin/meta.yml @@ -24,9 +24,9 @@ output: type: file description: Pangolin lineage report pattern: "*.{csv}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/pbccs/meta.yml b/modules/pbccs/meta.yml index eb89d628..b476c829 100644 --- a/modules/pbccs/meta.yml +++ b/modules/pbccs/meta.yml @@ -38,9 +38,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - css: type: file diff --git a/modules/picard/collectmultiplemetrics/meta.yml b/modules/picard/collectmultiplemetrics/meta.yml index a588fd98..587983a1 100644 --- a/modules/picard/collectmultiplemetrics/meta.yml +++ b/modules/picard/collectmultiplemetrics/meta.yml @@ -41,9 +41,9 @@ output: type: file description: PDF plots of metrics pattern: "*.{pdf}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/picard/collectwgsmetrics/meta.yml b/modules/picard/collectwgsmetrics/meta.yml index ec828af5..7ae2d41d 100644 --- a/modules/picard/collectwgsmetrics/meta.yml +++ b/modules/picard/collectwgsmetrics/meta.yml @@ -36,9 +36,9 @@ output: type: file description: Alignment metrics files generated by picard pattern: "*_{metrics}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/picard/filtersamreads/meta.yml b/modules/picard/filtersamreads/meta.yml index 82f78065..d63ebcf0 100644 --- a/modules/picard/filtersamreads/meta.yml +++ b/modules/picard/filtersamreads/meta.yml @@ -42,9 +42,9 @@ output: type: file description: Filtered BAM file pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/picard/markduplicates/meta.yml b/modules/picard/markduplicates/meta.yml index db72b5c5..13f2d350 100644 --- a/modules/picard/markduplicates/meta.yml +++ b/modules/picard/markduplicates/meta.yml @@ -42,9 +42,9 @@ output: type: file description: Duplicate metrics file generated by picard pattern: "*.{metrics.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/picard/mergesamfiles/meta.yml b/modules/picard/mergesamfiles/meta.yml index 82ba2a43..f732daf4 100644 --- a/modules/picard/mergesamfiles/meta.yml +++ b/modules/picard/mergesamfiles/meta.yml @@ -32,9 +32,9 @@ output: type: file description: Merged BAM file pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/picard/sortsam/meta.yml b/modules/picard/sortsam/meta.yml index 37d12b91..3e0fb450 100644 --- a/modules/picard/sortsam/meta.yml +++ b/modules/picard/sortsam/meta.yml @@ -33,9 +33,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/plasmidid/meta.yml b/modules/plasmidid/meta.yml index a2689ddf..8cde23c5 100644 --- a/modules/plasmidid/meta.yml +++ b/modules/plasmidid/meta.yml @@ -66,9 +66,9 @@ output: type: directory description: Directory containing the kmer files produced by plasmidid pattern: "database" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/plink/vcf/meta.yml b/modules/plink/vcf/meta.yml index 146a0030..d39892b7 100644 --- a/modules/plink/vcf/meta.yml +++ b/modules/plink/vcf/meta.yml @@ -31,9 +31,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bed: type: file diff --git a/modules/preseq/lcextrap/meta.yml b/modules/preseq/lcextrap/meta.yml index 616d8243..bdc61228 100755 --- a/modules/preseq/lcextrap/meta.yml +++ b/modules/preseq/lcextrap/meta.yml @@ -30,9 +30,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - ccurve: type: file diff --git a/modules/prodigal/meta.yml b/modules/prodigal/meta.yml index c24ca4a3..5bcc4e77 100644 --- a/modules/prodigal/meta.yml +++ b/modules/prodigal/meta.yml @@ -28,9 +28,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/prokka/meta.yml b/modules/prokka/meta.yml index 26fb767a..87446694 100644 --- a/modules/prokka/meta.yml +++ b/modules/prokka/meta.yml @@ -34,9 +34,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - gff: type: file diff --git a/modules/pycoqc/meta.yml b/modules/pycoqc/meta.yml index 32012e83..33bd6b07 100644 --- a/modules/pycoqc/meta.yml +++ b/modules/pycoqc/meta.yml @@ -38,9 +38,9 @@ output: type: file description: Results in JSON format pattern: "*.{json}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/pydamage/analyze/meta.yml b/modules/pydamage/analyze/meta.yml index 7369a3a3..918fbce9 100644 --- a/modules/pydamage/analyze/meta.yml +++ b/modules/pydamage/analyze/meta.yml @@ -42,9 +42,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - csv: type: file diff --git a/modules/pydamage/filter/meta.yml b/modules/pydamage/filter/meta.yml index 29d4642b..706e38b0 100644 --- a/modules/pydamage/filter/meta.yml +++ b/modules/pydamage/filter/meta.yml @@ -38,9 +38,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - csv: type: file diff --git a/modules/qcat/meta.yml b/modules/qcat/meta.yml index 5946eaa8..938bc337 100644 --- a/modules/qcat/meta.yml +++ b/modules/qcat/meta.yml @@ -30,9 +30,9 @@ output: type: file description: Demultiplexed fastq samples pattern: "*.fastq.gz" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@yuukiiwa" diff --git a/modules/qualimap/bamqc/meta.yml b/modules/qualimap/bamqc/meta.yml index 74c3ffdf..cc0471fc 100644 --- a/modules/qualimap/bamqc/meta.yml +++ b/modules/qualimap/bamqc/meta.yml @@ -41,9 +41,9 @@ output: type: dir description: Qualimap results dir pattern: "*/*" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@phue" diff --git a/modules/quast/meta.yml b/modules/quast/meta.yml index 742dc8f0..8b692e9e 100644 --- a/modules/quast/meta.yml +++ b/modules/quast/meta.yml @@ -36,9 +36,9 @@ output: pattern: "{prefix}.lineage_report.csv" - report: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/rapidnj/meta.yml b/modules/rapidnj/meta.yml index 7f7da9b9..ead54e09 100644 --- a/modules/rapidnj/meta.yml +++ b/modules/rapidnj/meta.yml @@ -20,9 +20,9 @@ input: pattern: "*.{fasta,fas,fa,mfa}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - phylogeny: type: file diff --git a/modules/rasusa/meta.yml b/modules/rasusa/meta.yml index 61cdbe0c..610afd3f 100644 --- a/modules/rasusa/meta.yml +++ b/modules/rasusa/meta.yml @@ -35,9 +35,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - reads: type: file diff --git a/modules/raxmlng/meta.yml b/modules/raxmlng/meta.yml index d5f755c5..3cc558f4 100644 --- a/modules/raxmlng/meta.yml +++ b/modules/raxmlng/meta.yml @@ -20,9 +20,9 @@ input: pattern: "*.{fasta,fas,fa,mfa}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - phylogeny: type: file diff --git a/modules/rsem/calculateexpression/meta.yml b/modules/rsem/calculateexpression/meta.yml index 079751d3..e2fb8f6d 100644 --- a/modules/rsem/calculateexpression/meta.yml +++ b/modules/rsem/calculateexpression/meta.yml @@ -42,9 +42,9 @@ output: type: file description: RSEM logs pattern: "*.log" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam_star: type: file diff --git a/modules/rsem/preparereference/meta.yml b/modules/rsem/preparereference/meta.yml index 5ccca28a..94f7cc05 100644 --- a/modules/rsem/preparereference/meta.yml +++ b/modules/rsem/preparereference/meta.yml @@ -28,9 +28,9 @@ output: type: file description: Fasta file of transcripts pattern: "rsem/*transcripts.fa" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/rseqc/bamstat/meta.yml b/modules/rseqc/bamstat/meta.yml index adb81c1c..64a0b9e4 100644 --- a/modules/rseqc/bamstat/meta.yml +++ b/modules/rseqc/bamstat/meta.yml @@ -27,9 +27,9 @@ output: type: file description: bam statistics report pattern: "*.bam_stat.txt" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/rseqc/inferexperiment/meta.yml b/modules/rseqc/inferexperiment/meta.yml index f89f90d1..63710d7b 100644 --- a/modules/rseqc/inferexperiment/meta.yml +++ b/modules/rseqc/inferexperiment/meta.yml @@ -30,9 +30,9 @@ output: type: file description: infer_experiment results report pattern: "*.infer_experiment.txt" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/rseqc/innerdistance/meta.yml b/modules/rseqc/innerdistance/meta.yml index 5b2b5e79..7eea1350 100644 --- a/modules/rseqc/innerdistance/meta.yml +++ b/modules/rseqc/innerdistance/meta.yml @@ -46,9 +46,9 @@ output: type: file description: script to reproduce the plot pattern: "*.inner_distance_plot.R" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/rseqc/junctionannotation/meta.yml b/modules/rseqc/junctionannotation/meta.yml index d96e7756..5562b0b7 100644 --- a/modules/rseqc/junctionannotation/meta.yml +++ b/modules/rseqc/junctionannotation/meta.yml @@ -52,9 +52,9 @@ output: description: Rscript to reproduce the plots pattern: "*.r" - log: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/rseqc/junctionsaturation/meta.yml b/modules/rseqc/junctionsaturation/meta.yml index aaf44cdc..ffa359ab 100644 --- a/modules/rseqc/junctionsaturation/meta.yml +++ b/modules/rseqc/junctionsaturation/meta.yml @@ -35,9 +35,9 @@ output: type: file description: Junction saturation R-script pattern: "*.r" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/rseqc/readdistribution/meta.yml b/modules/rseqc/readdistribution/meta.yml index 7ffab04f..d12ad600 100644 --- a/modules/rseqc/readdistribution/meta.yml +++ b/modules/rseqc/readdistribution/meta.yml @@ -31,9 +31,9 @@ output: type: file description: the read distribution report pattern: "*.read_distribution.txt" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/rseqc/readduplication/meta.yml b/modules/rseqc/readduplication/meta.yml index efc48c0d..98d25ea4 100644 --- a/modules/rseqc/readduplication/meta.yml +++ b/modules/rseqc/readduplication/meta.yml @@ -42,9 +42,9 @@ output: type: file description: script to reproduce the plot pattern: "*.R" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/salmon/index/meta.yml b/modules/salmon/index/meta.yml index 4d16b359..c956f15c 100644 --- a/modules/salmon/index/meta.yml +++ b/modules/salmon/index/meta.yml @@ -25,9 +25,9 @@ output: type: directory description: Folder containing the star index files pattern: "salmon" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/salmon/quant/meta.yml b/modules/salmon/quant/meta.yml index 981df89e..47e81229 100644 --- a/modules/salmon/quant/meta.yml +++ b/modules/salmon/quant/meta.yml @@ -45,9 +45,9 @@ output: type: directory description: Folder containing the quantification results for a specific sample pattern: "${prefix}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/samtools/ampliconclip/meta.yml b/modules/samtools/ampliconclip/meta.yml index 2ecbf463..7aa8c6bd 100644 --- a/modules/samtools/ampliconclip/meta.yml +++ b/modules/samtools/ampliconclip/meta.yml @@ -43,9 +43,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/samtools/faidx/meta.yml b/modules/samtools/faidx/meta.yml index 77d21861..6e63b671 100644 --- a/modules/samtools/faidx/meta.yml +++ b/modules/samtools/faidx/meta.yml @@ -22,9 +22,9 @@ output: type: file description: FASTA index file pattern: "*.{fai}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/fastq/meta.yml b/modules/samtools/fastq/meta.yml index 7c4cc488..9a45886b 100644 --- a/modules/samtools/fastq/meta.yml +++ b/modules/samtools/fastq/meta.yml @@ -34,9 +34,9 @@ output: type: file description: compressed FASTQ file pattern: "*.fastq.gz" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@suzannejin" diff --git a/modules/samtools/flagstat/meta.yml b/modules/samtools/flagstat/meta.yml index d40e45b4..d408cb76 100644 --- a/modules/samtools/flagstat/meta.yml +++ b/modules/samtools/flagstat/meta.yml @@ -40,9 +40,9 @@ output: type: file description: File containing samtools flagstat output pattern: "*.{flagstat}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/idxstats/meta.yml b/modules/samtools/idxstats/meta.yml index 93e8f694..f4cb613f 100644 --- a/modules/samtools/idxstats/meta.yml +++ b/modules/samtools/idxstats/meta.yml @@ -41,9 +41,9 @@ output: type: file description: File containing samtools idxstats output pattern: "*.{idxstats}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/index/meta.yml b/modules/samtools/index/meta.yml index 6f7dc887..5f4dd3fb 100644 --- a/modules/samtools/index/meta.yml +++ b/modules/samtools/index/meta.yml @@ -38,9 +38,9 @@ output: type: file description: CSI index file pattern: "*.{csi}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/merge/meta.yml b/modules/samtools/merge/meta.yml index c5f15a14..1903cdaa 100644 --- a/modules/samtools/merge/meta.yml +++ b/modules/samtools/merge/meta.yml @@ -34,9 +34,9 @@ output: type: file description: BAM file pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/mpileup/meta.yml b/modules/samtools/mpileup/meta.yml index aa0ccc6d..ce55643a 100644 --- a/modules/samtools/mpileup/meta.yml +++ b/modules/samtools/mpileup/meta.yml @@ -38,9 +38,9 @@ output: type: file description: mpileup file pattern: "*.{mpileup}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/sort/meta.yml b/modules/samtools/sort/meta.yml index d4f70a8e..cd47c86d 100644 --- a/modules/samtools/sort/meta.yml +++ b/modules/samtools/sort/meta.yml @@ -34,9 +34,9 @@ output: type: file description: Sorted BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/stats/meta.yml b/modules/samtools/stats/meta.yml index 1c7dcc8b..d75d73e2 100644 --- a/modules/samtools/stats/meta.yml +++ b/modules/samtools/stats/meta.yml @@ -39,9 +39,9 @@ output: type: file description: File containing samtools stats output pattern: "*.{stats}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/view/meta.yml b/modules/samtools/view/meta.yml index 6388f9bc..2e66e7cd 100644 --- a/modules/samtools/view/meta.yml +++ b/modules/samtools/view/meta.yml @@ -34,9 +34,9 @@ output: type: file description: filtered/converted BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/seacr/callpeak/meta.yml b/modules/seacr/callpeak/meta.yml index 80da69e4..43044c2f 100644 --- a/modules/seacr/callpeak/meta.yml +++ b/modules/seacr/callpeak/meta.yml @@ -40,9 +40,9 @@ output: type: file description: Bed file containing the calculated peaks. pattern: "*.bed" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@chris-cheshire" diff --git a/modules/seqkit/split2/meta.yml b/modules/seqkit/split2/meta.yml index 5dfee7f9..beb676ea 100644 --- a/modules/seqkit/split2/meta.yml +++ b/modules/seqkit/split2/meta.yml @@ -30,9 +30,9 @@ output: type: file description: Split fastq files pattern: "*.{fq.gz/fastq.gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@FriederikeHanssen" diff --git a/modules/seqtk/sample/meta.yml b/modules/seqtk/sample/meta.yml index b9422433..6cc4d657 100644 --- a/modules/seqtk/sample/meta.yml +++ b/modules/seqtk/sample/meta.yml @@ -30,9 +30,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - reads: type: file diff --git a/modules/seqtk/subseq/meta.yml b/modules/seqtk/subseq/meta.yml index f7c6c624..0d9a802b 100644 --- a/modules/seqtk/subseq/meta.yml +++ b/modules/seqtk/subseq/meta.yml @@ -21,9 +21,9 @@ input: pattern: "*.{bed,lst}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - sequences: type: file diff --git a/modules/sequenzautils/bam2seqz/meta.yml b/modules/sequenzautils/bam2seqz/meta.yml index 2ce4ab7f..278f9750 100755 --- a/modules/sequenzautils/bam2seqz/meta.yml +++ b/modules/sequenzautils/bam2seqz/meta.yml @@ -37,9 +37,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - seqz: type: file diff --git a/modules/sequenzautils/gcwiggle/meta.yml b/modules/sequenzautils/gcwiggle/meta.yml index 35daa498..4ecba04a 100644 --- a/modules/sequenzautils/gcwiggle/meta.yml +++ b/modules/sequenzautils/gcwiggle/meta.yml @@ -25,9 +25,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - wig: type: file diff --git a/modules/seqwish/induce/meta.yml b/modules/seqwish/induce/meta.yml index c2836824..c5f9d4c7 100644 --- a/modules/seqwish/induce/meta.yml +++ b/modules/seqwish/induce/meta.yml @@ -38,9 +38,9 @@ output: type: file description: Variation graph in GFA 1.0 format pattern: "*.{gfa}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/shovill/meta.yml b/modules/shovill/meta.yml index b878f93d..1f3c3a8f 100644 --- a/modules/shovill/meta.yml +++ b/modules/shovill/meta.yml @@ -28,9 +28,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - contigs: type: file diff --git a/modules/snpdists/meta.yml b/modules/snpdists/meta.yml index e86e3092..bf4366ff 100644 --- a/modules/snpdists/meta.yml +++ b/modules/snpdists/meta.yml @@ -33,9 +33,9 @@ output: type: file description: The output TSV file containing SNP distance matrix pattern: "*.tsv" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@abhi18av" diff --git a/modules/snpeff/meta.yml b/modules/snpeff/meta.yml index aa21e2bc..ba049c0e 100644 --- a/modules/snpeff/meta.yml +++ b/modules/snpeff/meta.yml @@ -49,9 +49,9 @@ output: type: file description: snpEff report file pattern: "*.html" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/snpsites/meta.yml b/modules/snpsites/meta.yml index ae250e5f..5361aa3e 100644 --- a/modules/snpsites/meta.yml +++ b/modules/snpsites/meta.yml @@ -15,9 +15,9 @@ input: description: fasta alignment file pattern: "*.{fasta,fas,fa,aln}" output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - fasta: type: file diff --git a/modules/spades/meta.yml b/modules/spades/meta.yml index 38c5c2ae..3d5943ae 100644 --- a/modules/spades/meta.yml +++ b/modules/spades/meta.yml @@ -59,9 +59,9 @@ output: type: file description: | Spades log file - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/staphopiasccmec/meta.yml b/modules/staphopiasccmec/meta.yml index e1ce3a05..006e5389 100644 --- a/modules/staphopiasccmec/meta.yml +++ b/modules/staphopiasccmec/meta.yml @@ -31,9 +31,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - tsv: type: file diff --git a/modules/star/align/meta.yml b/modules/star/align/meta.yml index 7f0217ea..00f955dd 100644 --- a/modules/star/align/meta.yml +++ b/modules/star/align/meta.yml @@ -45,9 +45,9 @@ output: type: file description: STAR log progress file pattern: "*Log.progress.out" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam_sorted: type: file diff --git a/modules/star/genomegenerate/meta.yml b/modules/star/genomegenerate/meta.yml index 70525738..09728b58 100644 --- a/modules/star/genomegenerate/meta.yml +++ b/modules/star/genomegenerate/meta.yml @@ -26,9 +26,9 @@ output: type: directory description: Folder containing the star index files pattern: "star" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/strelka/germline/meta.yml b/modules/strelka/germline/meta.yml index 4423e437..3f86b045 100644 --- a/modules/strelka/germline/meta.yml +++ b/modules/strelka/germline/meta.yml @@ -55,9 +55,9 @@ output: type: file description: index file for the genome_vcf file pattern: "*_genome.vcf.gz.tbi" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@arontommi" diff --git a/modules/stringtie/merge/meta.yml b/modules/stringtie/merge/meta.yml index 5752c0a9..81eca6dc 100644 --- a/modules/stringtie/merge/meta.yml +++ b/modules/stringtie/merge/meta.yml @@ -27,5 +27,10 @@ output: description: | Merged gtf from annotation and stringtie output gtfs. pattern: "*.gtf" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + authors: - "@yuukiiwa" diff --git a/modules/stringtie/stringtie/meta.yml b/modules/stringtie/stringtie/meta.yml index f9363009..0074b90f 100644 --- a/modules/stringtie/stringtie/meta.yml +++ b/modules/stringtie/stringtie/meta.yml @@ -48,9 +48,9 @@ output: type: file description: for running ballgown pattern: "*.{ballgown}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/subread/featurecounts/meta.yml b/modules/subread/featurecounts/meta.yml index 504d2f48..1100a091 100644 --- a/modules/subread/featurecounts/meta.yml +++ b/modules/subread/featurecounts/meta.yml @@ -43,9 +43,9 @@ output: type: file description: Summary log file pattern: "*.featureCounts.txt.summary" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: diff --git a/modules/tabix/bgzip/meta.yml b/modules/tabix/bgzip/meta.yml index 801d98bc..0b0787bf 100644 --- a/modules/tabix/bgzip/meta.yml +++ b/modules/tabix/bgzip/meta.yml @@ -30,9 +30,9 @@ output: type: file description: Output compressed file pattern: "*.{gz}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/tabix/bgziptabix/meta.yml b/modules/tabix/bgziptabix/meta.yml index 92f62bf3..5b4cc4e8 100644 --- a/modules/tabix/bgziptabix/meta.yml +++ b/modules/tabix/bgziptabix/meta.yml @@ -36,9 +36,9 @@ output: type: file description: tabix index file pattern: "*.{gz.tbi}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/tabix/tabix/meta.yml b/modules/tabix/tabix/meta.yml index 1ca58bcf..15edf8c3 100644 --- a/modules/tabix/tabix/meta.yml +++ b/modules/tabix/tabix/meta.yml @@ -30,9 +30,9 @@ output: type: file description: tabix index file pattern: "*.{tbi}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/tiddit/sv/meta.yml b/modules/tiddit/sv/meta.yml index 2a351766..4060a450 100644 --- a/modules/tiddit/sv/meta.yml +++ b/modules/tiddit/sv/meta.yml @@ -42,9 +42,9 @@ output: type: file description: tab pattern: "*.{signals.tab}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/trimgalore/meta.yml b/modules/trimgalore/meta.yml index 0c9fc925..7c46bea9 100644 --- a/modules/trimgalore/meta.yml +++ b/modules/trimgalore/meta.yml @@ -48,9 +48,9 @@ output: type: file description: Trim Galore! trimming report pattern: "*_{report.txt}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/ucsc/bed12tobigbed/meta.yml b/modules/ucsc/bed12tobigbed/meta.yml index 9bd2dd46..f3e8a604 100755 --- a/modules/ucsc/bed12tobigbed/meta.yml +++ b/modules/ucsc/bed12tobigbed/meta.yml @@ -33,9 +33,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bigbed: type: file diff --git a/modules/ucsc/bedclip/meta.yml b/modules/ucsc/bedclip/meta.yml index b11d2083..c7372925 100755 --- a/modules/ucsc/bedclip/meta.yml +++ b/modules/ucsc/bedclip/meta.yml @@ -28,9 +28,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bedgraph: type: file diff --git a/modules/ucsc/bedgraphtobigwig/meta.yml b/modules/ucsc/bedgraphtobigwig/meta.yml index ea20604c..1be1a3b7 100755 --- a/modules/ucsc/bedgraphtobigwig/meta.yml +++ b/modules/ucsc/bedgraphtobigwig/meta.yml @@ -33,9 +33,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bigwig: type: file diff --git a/modules/ucsc/bigwigaverageoverbed/meta.yml b/modules/ucsc/bigwigaverageoverbed/meta.yml index 93328df0..c2b31f88 100644 --- a/modules/ucsc/bigwigaverageoverbed/meta.yml +++ b/modules/ucsc/bigwigaverageoverbed/meta.yml @@ -33,9 +33,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - tab: type: file diff --git a/modules/ucsc/wigtobigwig/meta.yml b/modules/ucsc/wigtobigwig/meta.yml index 102fd8ef..4723ff2b 100644 --- a/modules/ucsc/wigtobigwig/meta.yml +++ b/modules/ucsc/wigtobigwig/meta.yml @@ -24,9 +24,9 @@ input: description: chromosome sizes file output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bw: type: file diff --git a/modules/unicycler/meta.yml b/modules/unicycler/meta.yml index f6581919..e3b1aab9 100644 --- a/modules/unicycler/meta.yml +++ b/modules/unicycler/meta.yml @@ -30,9 +30,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - scaffolds: type: file @@ -46,9 +46,9 @@ output: type: file description: unicycler log file pattern: "*.{log}" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@JoseEspinosa" diff --git a/modules/untar/meta.yml b/modules/untar/meta.yml index 0dc38292..2b586c92 100644 --- a/modules/untar/meta.yml +++ b/modules/untar/meta.yml @@ -18,9 +18,9 @@ output: type: file description: pattern: "*.*" - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/unzip/meta.yml b/modules/unzip/meta.yml index 386ca8bb..57c07f00 100644 --- a/modules/unzip/meta.yml +++ b/modules/unzip/meta.yml @@ -18,14 +18,14 @@ input: pattern: "*.zip" output: - - version: - type: file - description: File or directory of decompressed archive - pattern: "versions.yml" - unzipped_archive: type: directory description: Directory contents of the unzipped archive pattern: '${archive.baseName}/' + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@jfy133" diff --git a/modules/variantbam/meta.yml b/modules/variantbam/meta.yml index 62ddb578..9394e418 100644 --- a/modules/variantbam/meta.yml +++ b/modules/variantbam/meta.yml @@ -33,9 +33,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file diff --git a/modules/vcftools/meta.yml b/modules/vcftools/meta.yml index e39a0347..a8f864a9 100644 --- a/modules/vcftools/meta.yml +++ b/modules/vcftools/meta.yml @@ -33,9 +33,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - vcf: type: file diff --git a/modules/yara/index/meta.yml b/modules/yara/index/meta.yml index acf70f2b..651a67ee 100644 --- a/modules/yara/index/meta.yml +++ b/modules/yara/index/meta.yml @@ -21,9 +21,9 @@ input: description: Input genome fasta file output: - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - index: type: file diff --git a/modules/yara/mapper/meta.yml b/modules/yara/mapper/meta.yml index 4beb0c78..d49823d2 100644 --- a/modules/yara/mapper/meta.yml +++ b/modules/yara/mapper/meta.yml @@ -34,9 +34,9 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" - bam: type: file From 515793c73e7f1d8a742aad0ab830ad9575318784 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Mon, 4 Oct 2021 12:37:21 +0100 Subject: [PATCH 25/61] Fix bug with SortMeRna not working on a single db file (#788) * Fix bug with SortMeRna not working on a single db file * Remove tag for instances when running just to create index --- modules/bbmap/bbsplit/main.nf | 1 - modules/sortmerna/main.nf | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/bbmap/bbsplit/main.nf b/modules/bbmap/bbsplit/main.nf index 7a24312b..b2249b17 100644 --- a/modules/bbmap/bbsplit/main.nf +++ b/modules/bbmap/bbsplit/main.nf @@ -5,7 +5,6 @@ params.options = [:] options = initOptions(params.options) process BBMAP_BBSPLIT { - tag "$meta.id" label 'process_high' publishDir "${params.outdir}", mode: params.publish_dir_mode, diff --git a/modules/sortmerna/main.nf b/modules/sortmerna/main.nf index f35b1468..96fd06aa 100644 --- a/modules/sortmerna/main.nf +++ b/modules/sortmerna/main.nf @@ -20,7 +20,7 @@ process SORTMERNA { input: tuple val(meta), path(reads) - path fasta + path fastas output: tuple val(meta), path("*.fastq.gz"), emit: reads @@ -28,14 +28,11 @@ process SORTMERNA { path "versions.yml" , emit: versions script: - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - - def Refs = "" - for (i=0; i Date: Tue, 5 Oct 2021 10:36:14 +0100 Subject: [PATCH 26/61] Update SortMeRNA to 4.3.4 (#790) --- modules/sortmerna/main.nf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/sortmerna/main.nf b/modules/sortmerna/main.nf index 96fd06aa..c571a654 100644 --- a/modules/sortmerna/main.nf +++ b/modules/sortmerna/main.nf @@ -11,11 +11,11 @@ process SORTMERNA { mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } - conda (params.enable_conda ? "bioconda::sortmerna=4.2.0" : null) + conda (params.enable_conda ? "bioconda::sortmerna=4.3.4" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/sortmerna:4.2.0--0" + container "https://depot.galaxyproject.org/singularity/sortmerna:4.3.4--h9ee0642_0" } else { - container "quay.io/biocontainers/sortmerna:4.2.0--0" + container "quay.io/biocontainers/sortmerna:sortmerna:4.3.4--h9ee0642_0" } input: @@ -40,12 +40,12 @@ process SORTMERNA { --other non_rRNA_reads \\ $options.args - gzip -f < non_rRNA_reads.fq > ${prefix}.fastq.gz + mv non_rRNA_reads.fq.gz ${prefix}.fastq.gz mv rRNA_reads.log ${prefix}.sortmerna.log cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(sortmerna --version 2>&1 | sed 's/^.*SortMeRNA version //; s/ Build Date.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(sortmerna --version 2>&1) | sed 's/^.*SortMeRNA version //; s/ Build Date.*\$//') END_VERSIONS """ } else { @@ -62,13 +62,13 @@ process SORTMERNA { --out2 \\ $options.args - gzip -f < non_rRNA_reads_fwd.fq > ${prefix}_1.fastq.gz - gzip -f < non_rRNA_reads_rev.fq > ${prefix}_2.fastq.gz + mv non_rRNA_reads_fwd.fq.gz ${prefix}_1.fastq.gz + mv non_rRNA_reads_rev.fq.gz ${prefix}_2.fastq.gz mv rRNA_reads.log ${prefix}.sortmerna.log cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - ${getSoftwareName(task.process)}: \$(sortmerna --version 2>&1 | sed 's/^.*SortMeRNA version //; s/ Build Date.*\$//') + ${getSoftwareName(task.process)}: \$(echo \$(sortmerna --version 2>&1) | sed 's/^.*SortMeRNA version //; s/ Build Date.*\$//') END_VERSIONS """ } From 714ec6823ea1cae96910e4976efa6f51d06c9d21 Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Tue, 5 Oct 2021 12:05:37 +0200 Subject: [PATCH 27/61] Fix sortmerna docker container pointer (#791) --- modules/sortmerna/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sortmerna/main.nf b/modules/sortmerna/main.nf index c571a654..9602bb53 100644 --- a/modules/sortmerna/main.nf +++ b/modules/sortmerna/main.nf @@ -15,7 +15,7 @@ process SORTMERNA { if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { container "https://depot.galaxyproject.org/singularity/sortmerna:4.3.4--h9ee0642_0" } else { - container "quay.io/biocontainers/sortmerna:sortmerna:4.3.4--h9ee0642_0" + container "quay.io/biocontainers/sortmerna:4.3.4--h9ee0642_0" } input: From f20c427339936fc95443802d246f3559472ec0c8 Mon Sep 17 00:00:00 2001 From: Lee Katz Date: Tue, 5 Oct 2021 15:49:46 -0400 Subject: [PATCH 28/61] added classic mlst module (#742) * added classic mlst module * removed nf-core TODO comments * included drpatelh suggestions * adjust version capture identation * update main to pass lint * follow output expected by test.yml * suggested prefix change from rpetit3 * Apply suggestions from code review Co-authored-by: Gregor Sturm Co-authored-by: Robert A. Petit III Co-authored-by: Harshil Patel --- modules/mlst/functions.nf | 78 +++++++++++++++++++++++++++++++++ modules/mlst/main.nf | 42 ++++++++++++++++++ modules/mlst/meta.yml | 42 ++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/mlst/main.nf | 13 ++++++ tests/modules/mlst/test.yml | 7 +++ 6 files changed, 186 insertions(+) create mode 100644 modules/mlst/functions.nf create mode 100644 modules/mlst/main.nf create mode 100644 modules/mlst/meta.yml create mode 100644 tests/modules/mlst/main.nf create mode 100644 tests/modules/mlst/test.yml diff --git a/modules/mlst/functions.nf b/modules/mlst/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/mlst/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/mlst/main.nf b/modules/mlst/main.nf new file mode 100644 index 00000000..faac9871 --- /dev/null +++ b/modules/mlst/main.nf @@ -0,0 +1,42 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process MLST { + tag "$meta.id" + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::mlst=2.19.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/mlst:2.19.0--hdfd78af_1" + } else { + container "quay.io/biocontainers/mlst:2.19.0--hdfd78af_1" + } + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*.tsv"), emit: tsv + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + """ + mlst \\ + --threads $task.cpus \\ + $fasta \\ + > ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$( echo \$(mlst --version 2>&1) | sed 's/mlst //' ) + END_VERSIONS + """ + +} diff --git a/modules/mlst/meta.yml b/modules/mlst/meta.yml new file mode 100644 index 00000000..e9d2a09f --- /dev/null +++ b/modules/mlst/meta.yml @@ -0,0 +1,42 @@ +name: mlst +description: Run Torsten Seemann's classic MLST on a genome assembly +keywords: + - mlst +tools: + - mlst: + description: Scan contig files against PubMLST typing schemes + homepage: None + documentation: None + tool_dev_url: None + doi: "" + licence: ['GPL v2'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Assembly fasta file + pattern: "*.{fasta,fa,fna}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - tsv: + type: file + description: MLST calls in tsv format + pattern: "*.{tsv}" + +authors: + - "@lskatz" + - "@tseemann" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 63152fe0..af3645df 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -634,6 +634,10 @@ minimap2/index: - modules/minimap2/index/** - tests/modules/minimap2/index/** +mlst: + - modules/mlst/** + - tests/modules/mlst/** + mosdepth: - modules/mosdepth/** - tests/modules/mosdepth/** diff --git a/tests/modules/mlst/main.nf b/tests/modules/mlst/main.nf new file mode 100644 index 00000000..4b7d44be --- /dev/null +++ b/tests/modules/mlst/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MLST } from '../../../modules/mlst/main.nf' addParams( options: [:] ) + +workflow test_mlst { + + input = [ [ id:'test', single_end:false ], // meta map + file("https://raw.githubusercontent.com/nf-core/test-datasets/bactmap/genome/NCTC13799.fna", checkIfExists: true) ] + + MLST ( input ) +} diff --git a/tests/modules/mlst/test.yml b/tests/modules/mlst/test.yml new file mode 100644 index 00000000..5a7c7a0e --- /dev/null +++ b/tests/modules/mlst/test.yml @@ -0,0 +1,7 @@ +- name: mlst test_mlst + command: nextflow run tests/modules/mlst -entry test_mlst -c tests/config/nextflow.config + tags: + - mlst + files: + - path: output/mlst/test.tsv + md5sum: b52df6178834a156c9402012718eb65e From 3868c3ab4bce121bde7f15b9137a0beef59e5d98 Mon Sep 17 00:00:00 2001 From: Abhinav Sharma Date: Tue, 5 Oct 2021 22:23:01 +0200 Subject: [PATCH 29/61] Add gtdbtk/classifywf module (#765) * initial commit [ci skip] * reuse the modules code from nf-core/mag [ci skip] * add contextual information for the module [ci skip] * add stubs to avoid downloading db [ci skip] * trigger test * iterate on tests [ci skip] * itereate tests [ci skip] * add bins [ci skip] * fix stubs [ci skip] * interation on tests with stubs [ci skip] * use the existing pattern and fasta for input * accomodate the new version file format * use variable for the stub [ci skip] * update the versions file in meta.yml * Accomodate code review regarding publishDir function [ci skip] Co-authored-by: Harshil Patel * remove extra newline * use bioconda channel * update the description for filtered file * Apply suggestions from code review * Update main.nf * Update main.nf * Update modules/gtdbtk/classifywf/meta.yml Co-authored-by: Harshil Patel Co-authored-by: Robert A. Petit III Co-authored-by: Harshil Patel --- modules/gtdbtk/classifywf/functions.nf | 78 ++++++++++++++++++++++ modules/gtdbtk/classifywf/main.nf | 83 ++++++++++++++++++++++++ modules/gtdbtk/classifywf/meta.yml | 78 ++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/gtdbtk/classifywf/main.nf | 32 +++++++++ tests/modules/gtdbtk/classifywf/test.yml | 8 +++ 6 files changed, 283 insertions(+) create mode 100644 modules/gtdbtk/classifywf/functions.nf create mode 100644 modules/gtdbtk/classifywf/main.nf create mode 100644 modules/gtdbtk/classifywf/meta.yml create mode 100644 tests/modules/gtdbtk/classifywf/main.nf create mode 100644 tests/modules/gtdbtk/classifywf/test.yml diff --git a/modules/gtdbtk/classifywf/functions.nf b/modules/gtdbtk/classifywf/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/gtdbtk/classifywf/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/gtdbtk/classifywf/main.nf b/modules/gtdbtk/classifywf/main.nf new file mode 100644 index 00000000..fdcef76a --- /dev/null +++ b/modules/gtdbtk/classifywf/main.nf @@ -0,0 +1,83 @@ +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +def VERSION = '1.5.0' // When using stubs for the GTDB database, the version info isn't printed. + +process GTDBTK_CLASSIFYWF { + tag "${meta.assembler}-${meta.id}" + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::gtdbtk=1.5.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/gtdbtk:1.5.0--pyhdfd78af_0" + } else { + container "quay.io/biocontainers/gtdbtk:1.5.0--pyhdfd78af_0" + } + + input: + tuple val(meta), path("bins/*") + tuple val(db_name), path("database/*") + + output: + path "gtdbtk.${meta.assembler}-${meta.id}.*.summary.tsv" , emit: summary + path "gtdbtk.${meta.assembler}-${meta.id}.*.classify.tree.gz" , emit: tree + path "gtdbtk.${meta.assembler}-${meta.id}.*.markers_summary.tsv", emit: markers + path "gtdbtk.${meta.assembler}-${meta.id}.*.msa.fasta.gz" , emit: msa + path "gtdbtk.${meta.assembler}-${meta.id}.*.user_msa.fasta" , emit: user_msa + path "gtdbtk.${meta.assembler}-${meta.id}.*.filtered.tsv" , emit: filtered + path "gtdbtk.${meta.assembler}-${meta.id}.log" , emit: log + path "gtdbtk.${meta.assembler}-${meta.id}.warnings.log" , emit: warnings + path "gtdbtk.${meta.assembler}-${meta.id}.failed_genomes.tsv" , emit: failed + path "versions.yml" , emit: versions + + script: + def pplacer_scratch = params.gtdbtk_pplacer_scratch ? "--scratch_dir pplacer_tmp" : "" + """ + export GTDBTK_DATA_PATH="\${PWD}/database" + if [ ${pplacer_scratch} != "" ] ; then + mkdir pplacer_tmp + fi + + gtdbtk classify_wf \\ + $options.args \\ + --genome_dir bins \\ + --prefix "gtdbtk.${meta.assembler}-${meta.id}" \\ + --out_dir "\${PWD}" \\ + --cpus $task.cpus \\ + --pplacer_cpus $params.gtdbtk_pplacer_cpus \\ + $pplacer_scratch \\ + --min_perc_aa $params.gtdbtk_min_perc_aa \\ + --min_af $params.gtdbtk_min_af + + gzip "gtdbtk.${meta.assembler}-${meta.id}".*.classify.tree "gtdbtk.${meta.assembler}-${meta.id}".*.msa.fasta + mv gtdbtk.log "gtdbtk.${meta.assembler}-${meta.id}.log" + mv gtdbtk.warnings.log "gtdbtk.${meta.assembler}-${meta.id}.warnings.log" + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(gtdbtk --version -v 2>&1) | sed "s/gtdbtk: version //; s/ Copyright.*//") + END_VERSIONS + """ + + stub: + """ + touch gtdbtk.${meta.assembler}-${meta.id}.stub.summary.tsv + touch gtdbtk.${meta.assembler}-${meta.id}.stub.classify.tree.gz + touch gtdbtk.${meta.assembler}-${meta.id}.stub.markers_summary.tsv + touch gtdbtk.${meta.assembler}-${meta.id}.stub.msa.fasta.gz + touch gtdbtk.${meta.assembler}-${meta.id}.stub.user_msa.fasta + touch gtdbtk.${meta.assembler}-${meta.id}.stub.filtered.tsv + touch gtdbtk.${meta.assembler}-${meta.id}.log + touch gtdbtk.${meta.assembler}-${meta.id}.warnings.log + touch gtdbtk.${meta.assembler}-${meta.id}.failed_genomes.tsv + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo "$VERSION") + END_VERSIONS + """ +} diff --git a/modules/gtdbtk/classifywf/meta.yml b/modules/gtdbtk/classifywf/meta.yml new file mode 100644 index 00000000..d70de362 --- /dev/null +++ b/modules/gtdbtk/classifywf/meta.yml @@ -0,0 +1,78 @@ +name: gtdbtk_classifywf +description: GTDB-Tk is a software toolkit for assigning objective taxonomic classifications to bacterial and archaeal genomes based on the Genome Database Taxonomy GTDB. +keywords: + - GTDB taxonomy + - taxonomic classification +tools: + - gtdbtk: + description: GTDB-Tk is a software toolkit for assigning objective taxonomic classifications to bacterial and archaeal genomes based on the Genome Database Taxonomy GTDB. + homepage: https://ecogenomics.github.io/GTDBTk/ + documentation: https://ecogenomics.github.io/GTDBTk/ + tool_dev_url: https://github.com/Ecogenomics/GTDBTk + doi: "10.1093/bioinformatics/btz848" + licence: ['GNU General Public v3 (GPL v3)'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false, assembler:'spades' ] + - bins: + type: The binned fasta files from the assembler + description: Fasta files + pattern: "*.{fasta,fa}" + - database: + type: The local copy of the taxonomic database used by GTDB-tk + description: The unzipped copy of the database + pattern: "*" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - summary: + type: file + description: A TSV summary file for the classification + pattern: "*.{summary.tsv}" + - tree: + type: file + description: NJ or UPGMA tree in Newick format produced from a multiple sequence alignment + pattern: "*.{classify.tree.gz}" + - markers: + type: file + description: A TSV summary file lineage markers used for the classification. + pattern: "*.{markers_summary.tsv}" + - msa: + type: file + description: Multiple sequence alignments file. + pattern: "*.{msa.fasta.gz}" + - user_msa: + type: file + description: Multiple sequence alignments file for the user-provided files. + pattern: "*.{user_msa.fasta.gz}" + - filtered: + type: file + description: A list of genomes with an insufficient number of amino acids in MSA.. + pattern: "*.{filtered.tsv}" + - log: + type: file + description: GTDB-tk log file + pattern: "*.{log}" + - warnings: + type: file + description: GTDB-tk warnings log file + pattern: "*.{warnings.log}" + - failed: + type: file + description: A TSV summary of the genomes which GTDB-tk failed to classify. + pattern: "*.{failed_genomes.tsv}" +authors: + - "@skrakau" + - "@abhi18av" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index af3645df..34a3889b 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -458,6 +458,10 @@ graphmap2/index: - modules/graphmap2/index/** - tests/modules/graphmap2/index/** +gtdbtk/classifywf: + - modules/gtdbtk/classifywf/** + - tests/modules/gtdbtk/classifywf/** + gubbins: - modules/gubbins/** - tests/modules/gubbins/** diff --git a/tests/modules/gtdbtk/classifywf/main.nf b/tests/modules/gtdbtk/classifywf/main.nf new file mode 100644 index 00000000..f52b0ccc --- /dev/null +++ b/tests/modules/gtdbtk/classifywf/main.nf @@ -0,0 +1,32 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GTDBTK_CLASSIFYWF } from '../../../../modules/gtdbtk/classifywf/main.nf' addParams( options: [:] ) + +process STUB_GTDBTK_DATABASE { + output: + tuple val("gtdbtk_r202_data"), path("database/*"), emit: database + + stub: + """ + mkdir database + touch database/gtdbtk_r202_data + """ +} + +workflow test_gtdbtk_classifywf { + + STUB_GTDBTK_DATABASE() + + input = [ + [ id:'test', single_end:false, assembler:'SPADES' ], + [ + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['scaffolds_fasta'], checkIfExists: true) + ] + ] + + GTDBTK_CLASSIFYWF ( input, STUB_GTDBTK_DATABASE.out.database ) +} diff --git a/tests/modules/gtdbtk/classifywf/test.yml b/tests/modules/gtdbtk/classifywf/test.yml new file mode 100644 index 00000000..6d0f055e --- /dev/null +++ b/tests/modules/gtdbtk/classifywf/test.yml @@ -0,0 +1,8 @@ +- name: gtdbtk classifywf + command: nextflow run ./tests/modules/gtdbtk/classifywf -entry test_gtdbtk_classifywf -c tests/config/nextflow.config -stub-run + tags: + - gtdbtk + - gtdbtk/classifywf + files: + - path: output/gtdbtk/gtdbtk.SPADES-test.stub.summary.tsv + md5sum: d41d8cd98f00b204e9800998ecf8427e From 7d98bf1d7dc67c8e578aab81c8ec5f7fb209cb56 Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Tue, 5 Oct 2021 14:27:30 -0600 Subject: [PATCH 30/61] add mashtree module (#767) * add mashtree module * remove todo * whitespace adjustment * remove un-reproducible md5sum * Update main.nf * Update main.nf * Update meta.yml * Apply suggestions from code review Co-authored-by: Harshil Patel --- modules/mashtree/functions.nf | 78 +++++++++++++++++++++++++++++++++ modules/mashtree/main.nf | 44 +++++++++++++++++++ modules/mashtree/meta.yml | 48 ++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/mashtree/main.nf | 16 +++++++ tests/modules/mashtree/test.yml | 8 ++++ 6 files changed, 198 insertions(+) create mode 100644 modules/mashtree/functions.nf create mode 100644 modules/mashtree/main.nf create mode 100644 modules/mashtree/meta.yml create mode 100644 tests/modules/mashtree/main.nf create mode 100644 tests/modules/mashtree/test.yml diff --git a/modules/mashtree/functions.nf b/modules/mashtree/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/mashtree/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/mashtree/main.nf b/modules/mashtree/main.nf new file mode 100644 index 00000000..db0b14f5 --- /dev/null +++ b/modules/mashtree/main.nf @@ -0,0 +1,44 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process MASHTREE { + tag "$meta.id" + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::mashtree=1.2.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/mashtree:1.2.0--pl526h516909a_0" + } else { + container "quay.io/biocontainers/mashtree:1.2.0--pl526h516909a_0" + } + + input: + tuple val(meta), path(seqs) + + output: + tuple val(meta), path("*.dnd"), emit: tree + tuple val(meta), path("*.tsv"), emit: matrix + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + """ + mashtree \\ + $options.args \\ + --numcpus $task.cpus \\ + --outmatrix ${prefix}.tsv \\ + --outtree ${prefix}.dnd \\ + $seqs + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$( echo \$( mashtree --version 2>&1 ) | sed 's/^.*Mashtree //' ) + END_VERSIONS + """ +} diff --git a/modules/mashtree/meta.yml b/modules/mashtree/meta.yml new file mode 100644 index 00000000..3cf74772 --- /dev/null +++ b/modules/mashtree/meta.yml @@ -0,0 +1,48 @@ +name: mashtree +description: Quickly create a tree using Mash distances +keywords: + - tree + - mash + - fasta + - fastq +tools: + - mashtree: + description: Create a tree using Mash distances + homepage: https://github.com/lskatz/mashtree + documentation: https://github.com/lskatz/mashtree + tool_dev_url: https://github.com/lskatz/mashtree + doi: "https://doi.org/10.21105/joss.01762" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - seqs: + type: file + description: FASTA, FASTQ, GenBank, or Mash sketch files + pattern: "*.{fna,fna.gz,fasta,fasta.gz,fa,fa.gz,gbk,gbk.gz,fastq.gz,msh}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - tree: + type: file + description: A Newick formatted tree file + pattern: "*.{dnd}" + - matrix: + type: file + description: A TSV matrix of pair-wise Mash distances + pattern: "*.{tsv}" + +authors: + - "@rpetit3" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 34a3889b..7b010097 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -614,6 +614,10 @@ mash/sketch: - modules/mash/sketch/** - tests/modules/mash/sketch/** +mashtree: + - modules/mashtree/** + - tests/modules/mashtree/** + metaphlan3: - modules/metaphlan3/** - tests/modules/metaphlan3/** diff --git a/tests/modules/mashtree/main.nf b/tests/modules/mashtree/main.nf new file mode 100644 index 00000000..47a7c12a --- /dev/null +++ b/tests/modules/mashtree/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MASHTREE } from '../../../modules/mashtree/main.nf' addParams( options: [:] ) + +workflow test_mashtree { + + input = [ + [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + + MASHTREE ( input ) +} diff --git a/tests/modules/mashtree/test.yml b/tests/modules/mashtree/test.yml new file mode 100644 index 00000000..83ff6272 --- /dev/null +++ b/tests/modules/mashtree/test.yml @@ -0,0 +1,8 @@ +- name: mashtree test_mashtree + command: nextflow run tests/modules/mashtree -entry test_mashtree -c tests/config/nextflow.config + tags: + - mashtree + files: + - path: output/mashtree/test.dnd + md5sum: 007b3949a9f0c991624791d2fb076824 + - path: output/mashtree/test.tsv From bb7beff49740a7b92e851208b7e25875a909fe5c Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Tue, 5 Oct 2021 14:42:09 -0600 Subject: [PATCH 31/61] add hicap module (#772) * add hicap module * add info on optional inputs * fix typo * Update meta.yml * Update main.nf * Update meta.yml * Update modules/hicap/main.nf Co-authored-by: Harshil Patel * Update modules/hicap/main.nf Co-authored-by: Harshil Patel Co-authored-by: Harshil Patel --- modules/hicap/functions.nf | 78 +++++++++++++++++++++++++++++++++ modules/hicap/main.nf | 56 +++++++++++++++++++++++ modules/hicap/meta.yml | 59 +++++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/hicap/main.nf | 16 +++++++ tests/modules/hicap/test.yml | 10 +++++ 6 files changed, 223 insertions(+) create mode 100644 modules/hicap/functions.nf create mode 100644 modules/hicap/main.nf create mode 100644 modules/hicap/meta.yml create mode 100644 tests/modules/hicap/main.nf create mode 100644 tests/modules/hicap/test.yml diff --git a/modules/hicap/functions.nf b/modules/hicap/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/hicap/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/hicap/main.nf b/modules/hicap/main.nf new file mode 100644 index 00000000..e2e70678 --- /dev/null +++ b/modules/hicap/main.nf @@ -0,0 +1,56 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process HICAP { + tag "$meta.id" + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::hicap=1.0.3" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/hicap:1.0.3--py_0" + } else { + container "quay.io/biocontainers/hicap:1.0.3--py_0" + } + + input: + tuple val(meta), path(fasta) + path database_dir + path model_fp + + output: + tuple val(meta), path("*.gbk"), emit: gbk + tuple val(meta), path("*.svg"), emit: svg + tuple val(meta), path("*.tsv"), emit: tsv + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def database_args = database_dir ? "--database_dir ${database_dir}" : "" + def model_args = model_fp ? "--model_fp ${model_fp}" : "" + def is_compressed = fasta.getName().endsWith(".gz") ? true : false + def fasta_name = fasta.getName().replace(".gz", "") + """ + if [ "$is_compressed" == "true" ]; then + gzip -c -d $fasta > $fasta_name + fi + + hicap \\ + --query_fp $fasta_name \\ + $database_args \\ + $model_args \\ + $options.args \\ + --threads $task.cpus \\ + -o ./ + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$( echo \$( hicap --version 2>&1 ) | sed 's/^.*hicap //' ) + END_VERSIONS + """ +} diff --git a/modules/hicap/meta.yml b/modules/hicap/meta.yml new file mode 100644 index 00000000..275df665 --- /dev/null +++ b/modules/hicap/meta.yml @@ -0,0 +1,59 @@ +name: hicap +description: Identify cap locus serotype and structure in your Haemophilus influenzae assemblies +keywords: + - fasta + - serotype + - Haemophilus influenzae +tools: + - hicap: + description: In silico typing of the H. influenzae capsule locus + homepage: https://github.com/scwatts/hicap + documentation: https://github.com/scwatts/hicap + tool_dev_url: https://github.com/scwatts/hicap + doi: "https://doi.org/10.1128/JCM.00190-19" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: FASTA formatted assembly file + pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz}" + - database_dir: + type: directory + description: Optional - Directory containing locus database + pattern: "*/*" + - model_fp: + type: file + description: Optional - Prodigal model to use for gene prediction + pattern: "*.{bin}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - gbk: + type: file + description: GenBank file and cap locus annotations + pattern: "*.gbk" + - svg: + type: file + description: Visualization of annotated cap locus + pattern: "*.svg" + - tsv: + type: file + description: Detailed summary of cap locus annotations + pattern: "*.tsv" + +authors: + - "@rpetit3" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 7b010097..1cd98564 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -470,6 +470,10 @@ gunzip: - modules/gunzip/** - tests/modules/gunzip/** +hicap: + - modules/hicap/** + - tests/modules/hicap/** + hifiasm: - modules/hifiasm/** - tests/modules/hifiasm/** diff --git a/tests/modules/hicap/main.nf b/tests/modules/hicap/main.nf new file mode 100644 index 00000000..77c309a5 --- /dev/null +++ b/tests/modules/hicap/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HICAP } from '../../../modules/hicap/main.nf' addParams( options: [:] ) + +workflow test_hicap { + + input = [ [ id:'test', single_end:false ], // meta map + file("https://github.com/bactopia/bactopia-tests/raw/main/data/species-specific/haemophilus-influenzae/GCF_900478275.fna.gz", checkIfExists: true) ] + + database_dir = [] + model_fp = [] + + HICAP ( input, database_dir, model_fp ) +} diff --git a/tests/modules/hicap/test.yml b/tests/modules/hicap/test.yml new file mode 100644 index 00000000..8c8420fd --- /dev/null +++ b/tests/modules/hicap/test.yml @@ -0,0 +1,10 @@ +- name: hicap test_hicap + command: nextflow run tests/modules/hicap -entry test_hicap -c tests/config/nextflow.config + tags: + - hicap + files: + - path: output/hicap/GCF_900478275.gbk + md5sum: 562d026956903354ac80721f501335d4 + - path: output/hicap/GCF_900478275.svg + md5sum: 4fb94871dd0fdd8b4496049668176631 + - path: output/hicap/GCF_900478275.tsv From 8179bab8194ad3974f9c25c5f18d5a3695895693 Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Tue, 5 Oct 2021 14:48:47 -0600 Subject: [PATCH 32/61] add csvtk/concat module (#785) * add csvtk/concat module * Update modules/csvtk/concat/main.nf Co-authored-by: Gregor Sturm * allow alternate delimiters * Update main.nf * Update modules/csvtk/concat/main.nf Co-authored-by: Harshil Patel * Update modules/csvtk/concat/main.nf Co-authored-by: Harshil Patel * Update modules/csvtk/concat/main.nf Co-authored-by: Harshil Patel * Update modules/csvtk/concat/main.nf Co-authored-by: Harshil Patel * Update modules/csvtk/concat/main.nf * Apply suggestions from code review Co-authored-by: Gregor Sturm Co-authored-by: Harshil Patel --- modules/csvtk/concat/functions.nf | 78 +++++++++++++++++++++++++++++ modules/csvtk/concat/main.nf | 49 ++++++++++++++++++ modules/csvtk/concat/meta.yml | 51 +++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/csvtk/concat/main.nf | 20 ++++++++ tests/modules/csvtk/concat/test.yml | 8 +++ 6 files changed, 210 insertions(+) create mode 100644 modules/csvtk/concat/functions.nf create mode 100644 modules/csvtk/concat/main.nf create mode 100644 modules/csvtk/concat/meta.yml create mode 100644 tests/modules/csvtk/concat/main.nf create mode 100644 tests/modules/csvtk/concat/test.yml diff --git a/modules/csvtk/concat/functions.nf b/modules/csvtk/concat/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/csvtk/concat/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/csvtk/concat/main.nf b/modules/csvtk/concat/main.nf new file mode 100644 index 00000000..afccf722 --- /dev/null +++ b/modules/csvtk/concat/main.nf @@ -0,0 +1,49 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process CSVTK_CONCAT { + tag "$meta.id" + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::csvtk=0.23.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/csvtk:0.23.0--h9ee0642_0" + } else { + container "quay.io/biocontainers/csvtk:0.23.0--h9ee0642_0" + } + + input: + tuple val(meta), path(csv) + val in_format + val out_format + + output: + tuple val(meta), path("*.${out_format}"), emit: csv + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def delimiter = in_format == "tsv" ? "\t" : (in_format == "csv" ? "," : in_format) + def out_delimiter = out_format == "tsv" ? "\t" : (out_format == "csv" ? "," : out_format) + """ + csvtk \\ + concat \\ + $options.args \\ + --num-cpus $task.cpus \\ + --delimiter "${delimiter}" \\ + --out-delimiter "${out_delimiter}" \\ + --out-file ${prefix}.${out_format} \\ + $csv + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + csvtk: \$(echo \$( csvtk version | sed -e "s/csvtk v//g" )) + END_VERSIONS + """ +} diff --git a/modules/csvtk/concat/meta.yml b/modules/csvtk/concat/meta.yml new file mode 100644 index 00000000..6c7f9f10 --- /dev/null +++ b/modules/csvtk/concat/meta.yml @@ -0,0 +1,51 @@ +name: csvtk_concat +description: Concatenate two or more CSV (or TSV) tables into a single table +keywords: + - concatenate + - tsv + - csv +tools: + - csvtk: + description: A cross-platform, efficient, practical CSV/TSV toolkit + homepage: http://bioinf.shenwei.me/csvtk + documentation: http://bioinf.shenwei.me/csvtk + tool_dev_url: https://github.com/shenwei356/csvtk + doi: "" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - csv: + type: file + description: CSV/TSV formatted files + pattern: "*.{csv,tsv}" + - in_format: + type: string + description: Input format (csv, tab, or a delimiting character) + pattern: "*" + - out_format: + type: string + description: Output format (csv, tab, or a delimiting character) + pattern: "*" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "version.yml" + - csv: + type: file + description: Concatenated CSV/TSV file + pattern: "*.{csv,tsv}" + +authors: + - "@rpetit3" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 1cd98564..914ed8f9 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -266,6 +266,10 @@ cooler/dump: - modules/cooler/dump/** - tests/modules/cooler/dump/** +csvtk/concat: + - modules/csvtk/concat/** + - tests/modules/csvtk/concat/** + custom/dumpsoftwareversions: - modules/custom/dumpsoftwareversions/** - tests/modules/custom/dumpsoftwareversions/** diff --git a/tests/modules/csvtk/concat/main.nf b/tests/modules/csvtk/concat/main.nf new file mode 100644 index 00000000..22b0205f --- /dev/null +++ b/tests/modules/csvtk/concat/main.nf @@ -0,0 +1,20 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CSVTK_CONCAT } from '../../../../modules/csvtk/concat/main.nf' addParams( options: [:] ) + +workflow test_csvtk_concat { + + input = [ + [ id:'test' ], // meta map + [ file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_hybrid.csv", checkIfExists: true), + file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_long.csv", checkIfExists: true), + file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_short.csv", checkIfExists: true) ] + ] + + in_format = "tsv" + out_format = "csv" + + CSVTK_CONCAT ( input, in_format, out_format ) +} diff --git a/tests/modules/csvtk/concat/test.yml b/tests/modules/csvtk/concat/test.yml new file mode 100644 index 00000000..0fe9c604 --- /dev/null +++ b/tests/modules/csvtk/concat/test.yml @@ -0,0 +1,8 @@ +- name: csvtk concat + command: nextflow run ./tests/modules/csvtk/concat -entry test_csvtk_concat -c tests/config/nextflow.config + tags: + - csvtk + - csvtk/concat + files: + - path: output/csvtk/test.csv + md5sum: 917fe5d857f04b58e0f49c384d167cec From 8d04c34934c371bd17eda052bfea403b95e26c7f Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Tue, 5 Oct 2021 14:55:41 -0600 Subject: [PATCH 33/61] add ismapper module (#773) * add ismapper module * Update main.nf * Update main.nf * Update meta.yml * Apply suggestions from code review Co-authored-by: Harshil Patel --- modules/ismapper/functions.nf | 78 +++++++++++++++++++++++++++++++++ modules/ismapper/main.nf | 44 +++++++++++++++++++ modules/ismapper/meta.yml | 50 +++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/ismapper/main.nf | 18 ++++++++ tests/modules/ismapper/test.yml | 27 ++++++++++++ 6 files changed, 221 insertions(+) create mode 100644 modules/ismapper/functions.nf create mode 100644 modules/ismapper/main.nf create mode 100644 modules/ismapper/meta.yml create mode 100644 tests/modules/ismapper/main.nf create mode 100644 tests/modules/ismapper/test.yml diff --git a/modules/ismapper/functions.nf b/modules/ismapper/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/ismapper/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/ismapper/main.nf b/modules/ismapper/main.nf new file mode 100644 index 00000000..20d3d5b7 --- /dev/null +++ b/modules/ismapper/main.nf @@ -0,0 +1,44 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process ISMAPPER { + tag "$meta.id" + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::ismapper=2.0.2" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/ismapper:2.0.2--pyhdfd78af_1" + } else { + container "quay.io/biocontainers/ismapper:2.0.2--pyhdfd78af_1" + } + + input: + tuple val(meta), path(reads), path(reference), path(query) + + output: + tuple val(meta), path("results/*"), emit: results + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + """ + ismap \\ + $options.args \\ + --t $task.cpus \\ + --output_dir results \\ + --queries $query \\ + --reference $reference \\ + --reads $reads + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$( echo \$( ismap --version 2>&1 ) | sed 's/^.*ismap //' ) + END_VERSIONS + """ +} diff --git a/modules/ismapper/meta.yml b/modules/ismapper/meta.yml new file mode 100644 index 00000000..4ca2450a --- /dev/null +++ b/modules/ismapper/meta.yml @@ -0,0 +1,50 @@ +name: ismapper +description: Identify insertion sites positions in bacterial genomes +keywords: + - fastq + - insertion sequences +tools: + - ismapper: + description: A mapping-based tool for identification of the site and orientation of IS insertions in bacterial genomes. + homepage: https://github.com/jhawkey/IS_mapper + documentation: https://github.com/jhawkey/IS_mapper + tool_dev_url: https://github.com/jhawkey/IS_mapper + doi: "https://doi.org/10.1186/s12864-015-1860-2" + licence: ['BSD'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: A set of paired-end FASTQ files + pattern: "*.{fastq.gz,fq.gz}" + - reference: + type: file + description: Reference genome in GenBank format + pattern: "*.{gbk}" + - query: + type: file + description: Insertion sequences to query in FASTA format + pattern: "*.{fasta,fa}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - results: + type: directory + description: Directory containing ISMapper result files + pattern: "*/*" + +authors: + - "@rpetit3" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 914ed8f9..8de7f7e2 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -521,6 +521,10 @@ iqtree: - modules/iqtree/** - tests/modules/iqtree/** +ismapper: + - modules/ismapper/** + - tests/modules/ismapper/** + ivar/consensus: - modules/ivar/consensus/** - tests/modules/ivar/consensus/** diff --git a/tests/modules/ismapper/main.nf b/tests/modules/ismapper/main.nf new file mode 100644 index 00000000..b28344dc --- /dev/null +++ b/tests/modules/ismapper/main.nf @@ -0,0 +1,18 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ISMAPPER } from '../../../modules/ismapper/main.nf' addParams( options: [:] ) + +workflow test_ismapper { + + input = [ + [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ], + file("https://github.com/jhawkey/IS_mapper/raw/master/test/inputs/S_suis_P17.gbk", checkIfExists: true), + file("https://github.com/jhawkey/IS_mapper/raw/master/test/inputs/ISSsu3.fasta", checkIfExists: true) + ] + + ISMAPPER ( input ) +} diff --git a/tests/modules/ismapper/test.yml b/tests/modules/ismapper/test.yml new file mode 100644 index 00000000..0574b855 --- /dev/null +++ b/tests/modules/ismapper/test.yml @@ -0,0 +1,27 @@ +- name: ismapper test_ismapper + command: nextflow run tests/modules/ismapper -entry test_ismapper -c tests/config/nextflow.config + tags: + - ismapper + files: + - path: output/ismapper/results/test/ISSsu3/test_ISSsu3_left_final.fastq + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/ismapper/results/test/ISSsu3/test_ISSsu3_right_final.fastq + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/ismapper/results/test/ISSsu3/test__AM946016.1_closest.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/ismapper/results/test/ISSsu3/test__AM946016.1_intersect.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/ismapper/results/test/ISSsu3/test__AM946016.1_table.txt + md5sum: 9e05cda3990cb841db2bfb6e6e04a1f5 + - path: output/ismapper/results/test/ISSsu3/test_left_AM946016.1_finalcov.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/ismapper/results/test/ISSsu3/test_left_AM946016.1_merged.sorted.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/ismapper/results/test/ISSsu3/test_left_AM946016.1_unpaired.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/ismapper/results/test/ISSsu3/test_right_AM946016.1_finalcov.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/ismapper/results/test/ISSsu3/test_right_AM946016.1_merged.sorted.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/ismapper/results/test/ISSsu3/test_right_AM946016.1_unpaired.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e From 0ba88fb8699ab1d94ca748ca1c5a903cbbc30602 Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Tue, 5 Oct 2021 15:08:47 -0600 Subject: [PATCH 34/61] add roary module (#776) * add module roary * Update meta.yml * Update meta.yml * Update meta.yml * Update meta.yml * Update main.nf * Update meta.yml * Apply suggestions from code review Co-authored-by: Harshil Patel --- modules/roary/functions.nf | 78 +++++++++++++++++++++++++++++++++ modules/roary/main.nf | 43 ++++++++++++++++++ modules/roary/meta.yml | 47 ++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/roary/main.nf | 16 +++++++ tests/modules/roary/test.yml | 39 +++++++++++++++++ 6 files changed, 227 insertions(+) create mode 100644 modules/roary/functions.nf create mode 100644 modules/roary/main.nf create mode 100644 modules/roary/meta.yml create mode 100644 tests/modules/roary/main.nf create mode 100644 tests/modules/roary/test.yml diff --git a/modules/roary/functions.nf b/modules/roary/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/roary/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/roary/main.nf b/modules/roary/main.nf new file mode 100644 index 00000000..9dc948fb --- /dev/null +++ b/modules/roary/main.nf @@ -0,0 +1,43 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process ROARY { + tag "$meta.id" + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::roary=3.13.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/roary:3.13.0--pl526h516909a_0" + } else { + container "quay.io/biocontainers/roary:3.13.0--pl526h516909a_0" + } + + input: + tuple val(meta), path(gff) + + output: + tuple val(meta), path("results/*") , emit: results + tuple val(meta), path("results/*.aln"), optional: true, emit: aln + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + """ + roary \\ + $options.args \\ + -p $task.cpus \\ + -f results/ \\ + $gff + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$( roary --version ) + END_VERSIONS + """ +} diff --git a/modules/roary/meta.yml b/modules/roary/meta.yml new file mode 100644 index 00000000..4cf42bdf --- /dev/null +++ b/modules/roary/meta.yml @@ -0,0 +1,47 @@ +name: roary +description: Calculate pan-genome from annotated bacterial assemblies in GFF3 format +keywords: + - gff + - pan-genome + - alignment +tools: + - roary: + description: Rapid large-scale prokaryote pan genome analysis + homepage: http://sanger-pathogens.github.io/Roary/ + documentation: http://sanger-pathogens.github.io/Roary/ + tool_dev_url: https://github.com/sanger-pathogens/Roary/ + doi: "http://dx.doi.org/10.1093/bioinformatics/btv421" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - gff: + type: file + description: A set of GFF3 formatted files + pattern: "*.{gff}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - results: + type: directory + description: Directory containing Roary result files + pattern: "*/*" + - aln: + type: file + description: Core-genome alignment produced by Roary (Optional) + pattern: "*.{aln}" + +authors: + - "@rpetit3" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 8de7f7e2..19c17f40 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -811,6 +811,10 @@ raxmlng: - modules/raxmlng/** - tests/modules/raxmlng/** +roary: + - modules/roary/** + - tests/modules/roary/** + rsem/calculateexpression: - modules/rsem/calculateexpression/** - tests/modules/rsem/calculateexpression/** diff --git a/tests/modules/roary/main.nf b/tests/modules/roary/main.nf new file mode 100644 index 00000000..a4a96d6e --- /dev/null +++ b/tests/modules/roary/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ROARY } from '../../../modules/roary/main.nf' addParams( options: [:] ) + +workflow test_roary { + + input = [ [ id:'test', single_end:false ], // meta map + [ file("https://github.com/bactopia/bactopia-tests/raw/main/data/reference/gff/GCF_000292685.gff", checkIfExists: true), + file("https://github.com/bactopia/bactopia-tests/raw/main/data/reference/gff/GCF_000298385.gff", checkIfExists: true), + file("https://github.com/bactopia/bactopia-tests/raw/main/data/reference/gff/GCF_002849995.gff", checkIfExists: true) ] + ] + + ROARY ( input ) +} diff --git a/tests/modules/roary/test.yml b/tests/modules/roary/test.yml new file mode 100644 index 00000000..c8e8c33d --- /dev/null +++ b/tests/modules/roary/test.yml @@ -0,0 +1,39 @@ +- name: roary test_roary + command: nextflow run tests/modules/roary -entry test_roary -c tests/config/nextflow.config + tags: + - roary + files: + - path: output/roary/results/accessory.header.embl + contains: ['ID Genome standard; DNA; PRO; 1234 BP.'] + - path: output/roary/results/accessory.tab + contains: ['FT'] + - path: output/roary/results/accessory_binary_genes.fa + md5sum: 0baeea4947bf17a2bf29d43a44f0278f + - path: output/roary/results/accessory_binary_genes.fa.newick + md5sum: b1f8c76ab231bd38b850c1f8d3c1584b + - path: output/roary/results/accessory_graph.dot + contains: ['/* list of nodes */'] + - path: output/roary/results/blast_identity_frequency.Rtab + md5sum: 829baa25c3fad94b1af207265452a692 + - path: output/roary/results/clustered_proteins + contains: ['JKHLNHAL_00087'] + - path: output/roary/results/core_accessory.header.embl + contains: ['ID Genome standard; DNA; PRO; 1234 BP.'] + - path: output/roary/results/core_accessory.tab + contains: ['FT /taxa="GCF_000292685 GCF_000298385 GCF_002849995"'] + - path: output/roary/results/core_accessory_graph.dot + contains: ['/* list of nodes */'] + - path: output/roary/results/gene_presence_absence.Rtab + contains: ['Gene'] + - path: output/roary/results/gene_presence_absence.csv + contains: ['"Gene","Non-unique Gene name","Annotation","No. isolates","No. sequences"'] + - path: output/roary/results/number_of_conserved_genes.Rtab + contains: ['279'] + - path: output/roary/results/number_of_genes_in_pan_genome.Rtab + contains: ['279'] + - path: output/roary/results/number_of_new_genes.Rtab + contains: ['279'] + - path: output/roary/results/number_of_unique_genes.Rtab + contains: ['279'] + - path: output/roary/results/summary_statistics.txt + md5sum: 3921b5445df6a7ed59408119b8860a58 From ad0f4d2e2431183881983460f616eb3af2f02606 Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Tue, 5 Oct 2021 15:15:08 -0600 Subject: [PATCH 35/61] patch output extension in csvtk/concat (#797) * patch output extension * Update main.nf * Update main.nf * Update main.nf * whitespace * Update main.nf * Update main.nf * Update modules/csvtk/concat/main.nf Co-authored-by: Harshil Patel --- modules/csvtk/concat/main.nf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/csvtk/concat/main.nf b/modules/csvtk/concat/main.nf index afccf722..194b1e14 100644 --- a/modules/csvtk/concat/main.nf +++ b/modules/csvtk/concat/main.nf @@ -24,13 +24,14 @@ process CSVTK_CONCAT { val out_format output: - tuple val(meta), path("*.${out_format}"), emit: csv - path "versions.yml" , emit: versions + tuple val(meta), path("${prefix}.${out_extension}"), emit: csv + path "versions.yml" , emit: versions script: - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def delimiter = in_format == "tsv" ? "\t" : (in_format == "csv" ? "," : in_format) def out_delimiter = out_format == "tsv" ? "\t" : (out_format == "csv" ? "," : out_format) + out_extension = out_format == "tsv" ? 'tsv' : 'csv' """ csvtk \\ concat \\ @@ -38,7 +39,7 @@ process CSVTK_CONCAT { --num-cpus $task.cpus \\ --delimiter "${delimiter}" \\ --out-delimiter "${out_delimiter}" \\ - --out-file ${prefix}.${out_format} \\ + --out-file ${prefix}.${out_extension} \\ $csv cat <<-END_VERSIONS > versions.yml From e77b3d72f3357462376695585e88a598809cf0ed Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Tue, 5 Oct 2021 15:21:35 -0600 Subject: [PATCH 36/61] add spatyper module (#784) * add spatyper module * lint fix * Apply suggestions from code review Co-authored-by: Harshil Patel --- modules/spatyper/functions.nf | 78 +++++++++++++++++++++++++++++++++ modules/spatyper/main.nf | 46 +++++++++++++++++++ modules/spatyper/meta.yml | 50 +++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/spatyper/main.nf | 26 +++++++++++ tests/modules/spatyper/test.yml | 15 +++++++ 6 files changed, 219 insertions(+) create mode 100644 modules/spatyper/functions.nf create mode 100644 modules/spatyper/main.nf create mode 100644 modules/spatyper/meta.yml create mode 100644 tests/modules/spatyper/main.nf create mode 100644 tests/modules/spatyper/test.yml diff --git a/modules/spatyper/functions.nf b/modules/spatyper/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/spatyper/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/spatyper/main.nf b/modules/spatyper/main.nf new file mode 100644 index 00000000..ce320bfc --- /dev/null +++ b/modules/spatyper/main.nf @@ -0,0 +1,46 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process SPATYPER { + tag "$meta.id" + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::spatyper=0.3.3" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/spatyper%3A0.3.3--pyhdfd78af_3" + } else { + container "quay.io/biocontainers/spatyper:0.3.3--pyhdfd78af_3" + } + + input: + tuple val(meta), path(fasta) + path repeats + path repeat_order + + output: + tuple val(meta), path("*.tsv"), emit: tsv + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def input_args = repeats && repeat_order ? "-r ${repeats} -o ${repeat_order}" : "" + """ + env + spaTyper \\ + $options.args \\ + $input_args \\ + --fasta $fasta \\ + --output ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$( echo \$(spaTyper --version 2>&1) | sed 's/^.*spaTyper //' ) + END_VERSIONS + """ +} diff --git a/modules/spatyper/meta.yml b/modules/spatyper/meta.yml new file mode 100644 index 00000000..94f17a69 --- /dev/null +++ b/modules/spatyper/meta.yml @@ -0,0 +1,50 @@ +name: spatyper +description: Computational method for finding spa types. +keywords: + - fasta + - spatype +tools: + - spatyper: + description: Computational method for finding spa types. + homepage: https://github.com/HCGB-IGTP/spaTyper + documentation: https://github.com/HCGB-IGTP/spaTyper + tool_dev_url: https://github.com/HCGB-IGTP/spaTyper + doi: https://doi.org/10.5281/zenodo.4063625 + licence: ['LGPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: FASTA assembly file + pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz}" + - repeats: + type: file + description: spa repeat sequences in FASTA format (Optional) + pattern: "*.{fasta}" + - repeat_order: + type: file + description: spa types and order of repeats (Optional) + pattern: "*.{txt}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - tsv: + type: file + description: Tab-delimited results + pattern: "*.{tsv}" + +authors: + - "@rpetit3" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 19c17f40..39a21981 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -951,6 +951,10 @@ spades: - modules/spades/** - tests/modules/spades/** +spatyper: + - modules/spatyper/** + - tests/modules/spatyper/** + staphopiasccmec: - modules/staphopiasccmec/** - tests/modules/staphopiasccmec/** diff --git a/tests/modules/spatyper/main.nf b/tests/modules/spatyper/main.nf new file mode 100644 index 00000000..65729cc0 --- /dev/null +++ b/tests/modules/spatyper/main.nf @@ -0,0 +1,26 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SPATYPER } from '../../../modules/spatyper/main.nf' addParams( options: [:] ) +include { SPATYPER as SPATYPER_ENRICH } from '../../../modules/spatyper/main.nf' addParams( options: [args: '--do_enrich'] ) + +workflow test_spatyper { + input = [ [ id:'test' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + repeats = [] + repeat_order = [] + + SPATYPER ( input, repeats, repeat_order ) +} + +workflow test_spatyper_enrich { + input = [ [ id:'test' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + repeats = [] + repeat_order = [] + + SPATYPER_ENRICH ( input, repeats, repeat_order ) +} diff --git a/tests/modules/spatyper/test.yml b/tests/modules/spatyper/test.yml new file mode 100644 index 00000000..49516812 --- /dev/null +++ b/tests/modules/spatyper/test.yml @@ -0,0 +1,15 @@ +- name: spatyper test_spatyper + command: nextflow run tests/modules/spatyper -entry test_spatyper -c tests/config/nextflow.config + tags: + - spatyper + files: + - path: output/spatyper/test.tsv + md5sum: a698352823875171696e5e7ed7015c13 + +- name: spatyper test_spatyper_enrich + command: nextflow run tests/modules/spatyper -entry test_spatyper_enrich -c tests/config/nextflow.config + tags: + - spatyper + files: + - path: output/spatyper/test.tsv + md5sum: a698352823875171696e5e7ed7015c13 From 053797510df35ec45a97f3cdafeb53d6fe39b225 Mon Sep 17 00:00:00 2001 From: "Robert A. Petit III" Date: Tue, 5 Oct 2021 15:28:25 -0600 Subject: [PATCH 37/61] add pirate module (#777) * new module pirate * remove md5 check for non reproducible binary files * get those to-dos out * Update main.nf * Update meta.yml * Apply suggestions from code review Co-authored-by: Harshil Patel --- modules/pirate/functions.nf | 78 ++++++++++++++++++++++++++ modules/pirate/main.nf | 43 +++++++++++++++ modules/pirate/meta.yml | 47 ++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/pirate/main.nf | 16 ++++++ tests/modules/pirate/test.yml | 98 +++++++++++++++++++++++++++++++++ 6 files changed, 286 insertions(+) create mode 100644 modules/pirate/functions.nf create mode 100644 modules/pirate/main.nf create mode 100644 modules/pirate/meta.yml create mode 100644 tests/modules/pirate/main.nf create mode 100644 tests/modules/pirate/test.yml diff --git a/modules/pirate/functions.nf b/modules/pirate/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/pirate/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/pirate/main.nf b/modules/pirate/main.nf new file mode 100644 index 00000000..01a950dd --- /dev/null +++ b/modules/pirate/main.nf @@ -0,0 +1,43 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process PIRATE { + tag "$meta.id" + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::pirate=1.0.4" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/pirate%3A1.0.4--hdfd78af_1" + } else { + container "quay.io/biocontainers/pirate:1.0.4--hdfd78af_1" + } + + input: + tuple val(meta), path(gff) + + output: + tuple val(meta), path("results/*") , emit: results + tuple val(meta), path("results/core_alignment.fasta"), optional: true, emit: aln + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + """ + PIRATE \\ + $options.args \\ + --threads $task.cpus \\ + --input ./ \\ + --output results/ + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$( echo \$( PIRATE --version 2>&1) | sed 's/PIRATE //' ) + END_VERSIONS + """ +} diff --git a/modules/pirate/meta.yml b/modules/pirate/meta.yml new file mode 100644 index 00000000..296dd11d --- /dev/null +++ b/modules/pirate/meta.yml @@ -0,0 +1,47 @@ +name: pirate +description: Pangenome toolbox for bacterial genomes +keywords: + - gff + - pan-genome + - alignment +tools: + - pirate: + description: Pangenome analysis and threshold evaluation toolbox + homepage: https://github.com/SionBayliss/PIRATE + documentation: https://github.com/SionBayliss/PIRATE/wiki + tool_dev_url: https://github.com/SionBayliss/PIRATE + doi: "https://doi.org/10.1093/gigascience/giz119" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - gff: + type: file + description: A set of GFF3 formatted files + pattern: "*.{gff}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - results: + type: directory + description: Directory containing PIRATE result files + pattern: "*/*" + - aln: + type: file + description: Core-genome alignment produced by PIRATE (Optional) + pattern: "*.{fasta}" + +authors: + - "@rpetit3" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 39a21981..ec3e8ed4 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -755,6 +755,10 @@ picard/sortsam: - modules/picard/sortsam/** - tests/modules/picard/sortsam/** +pirate: + - modules/pirate/** + - tests/modules/pirate/** + plasmidid: - modules/plasmidid/** - tests/modules/plasmidid/** diff --git a/tests/modules/pirate/main.nf b/tests/modules/pirate/main.nf new file mode 100644 index 00000000..5957b1e6 --- /dev/null +++ b/tests/modules/pirate/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PIRATE } from '../../../modules/pirate/main.nf' addParams( options: [:] ) + +workflow test_pirate { + + input = [ [ id:'test', single_end:false ], // meta map + [ file("https://github.com/bactopia/bactopia-tests/raw/main/data/reference/gff/GCF_000292685.gff", checkIfExists: true), + file("https://github.com/bactopia/bactopia-tests/raw/main/data/reference/gff/GCF_000298385.gff", checkIfExists: true), + file("https://github.com/bactopia/bactopia-tests/raw/main/data/reference/gff/GCF_002849995.gff", checkIfExists: true) ] + ] + + PIRATE ( input ) +} diff --git a/tests/modules/pirate/test.yml b/tests/modules/pirate/test.yml new file mode 100644 index 00000000..d8c4d0c4 --- /dev/null +++ b/tests/modules/pirate/test.yml @@ -0,0 +1,98 @@ +- name: pirate test_pirate + command: nextflow run tests/modules/pirate -entry test_pirate -c tests/config/nextflow.config + tags: + - pirate + files: + - path: output/pirate/results/PIRATE.gene_families.ordered.tsv + contains: ['allele_name'] + - path: output/pirate/results/PIRATE.gene_families.tsv + contains: ['allele_name'] + - path: output/pirate/results/PIRATE.genomes_per_allele.tsv + contains: ['g0197'] + - path: output/pirate/results/PIRATE.log + contains: ['PIRATE input options'] + - path: output/pirate/results/PIRATE.pangenome_summary.txt + md5sum: 4551c291bc06b21f984f25c09329ed7d + - path: output/pirate/results/PIRATE.unique_alleles.tsv + contains: ['allele_name'] + - path: output/pirate/results/binary_presence_absence.fasta + contains: ['GCF_000292685'] + - path: output/pirate/results/binary_presence_absence.nwk + md5sum: 5b5d86bf97d97de37bb9db514abb7762 + - path: output/pirate/results/cluster_alleles.tab + contains: ['g0001'] + - path: output/pirate/results/co-ords/GCF_000292685.co-ords.tab + md5sum: d5ca0f06ca7ea1f5486683d5859bc9b8 + - path: output/pirate/results/co-ords/GCF_000298385.co-ords.tab + md5sum: a24d6048b3074242bb558c7fa27a8b03 + - path: output/pirate/results/co-ords/GCF_002849995.co-ords.tab + md5sum: 0c08228585f4fa95686e9b025e0fe9c1 + - path: output/pirate/results/genome2loci.tab + md5sum: bbcea5bfcdcafe14a9aa7261c8e931b8 + - path: output/pirate/results/genome_list.txt + md5sum: 6534b1635c258ad92b829077addc1ff5 + - path: output/pirate/results/link_clusters.log + contains: ['parsing paralog file'] + - path: output/pirate/results/loci_list.tab + contains: ['GCF_000298385_00242'] + - path: output/pirate/results/loci_paralog_categories.tab + md5sum: 6404d2a32526a398f42d7da768a389bd + - path: output/pirate/results/modified_gffs/GCF_000292685.gff + md5sum: 2b73bda2f84dc634303dc90e641040ca + - path: output/pirate/results/modified_gffs/GCF_000298385.gff + md5sum: b1a9d6557d47e09249f08a7acdbbd618 + - path: output/pirate/results/modified_gffs/GCF_002849995.gff + md5sum: 68532fc9bb639e6d83c731a069f60cf8 + - path: output/pirate/results/pan_sequences.fasta + md5sum: ed835c77fdb20c36aa9d5208eb7ca0cb + - path: output/pirate/results/pangenome.connected_blocks.tsv + contains: ['block_number'] + - path: output/pirate/results/pangenome.edges + contains: ['g0259'] + - path: output/pirate/results/pangenome.gfa + contains: ['g0001'] + - path: output/pirate/results/pangenome.order.tsv + contains: ['g0172'] + - path: output/pirate/results/pangenome.reversed.tsv + md5sum: b2396ce09a6e4178761eca6dc7f4434f + - path: output/pirate/results/pangenome.syntenic_blocks.tsv + contains: ['g0091'] + - path: output/pirate/results/pangenome.temp + - path: output/pirate/results/pangenome_iterations/pan_sequences.50.reclustered.reinflated + contains: ['GCF_000298385_00242'] + - path: output/pirate/results/pangenome_iterations/pan_sequences.60.reclustered.reinflated + contains: ['GCF_000298385_00242'] + - path: output/pirate/results/pangenome_iterations/pan_sequences.70.reclustered.reinflated + contains: ['GCF_000298385_00242'] + - path: output/pirate/results/pangenome_iterations/pan_sequences.80.reclustered.reinflated + contains: ['GCF_000298385_00242'] + - path: output/pirate/results/pangenome_iterations/pan_sequences.90.reclustered.reinflated + contains: ['GCF_000298385_00242'] + - path: output/pirate/results/pangenome_iterations/pan_sequences.95.reclustered.reinflated + contains: ['GCF_000298385_00242'] + - path: output/pirate/results/pangenome_iterations/pan_sequences.98.reclustered.reinflated + contains: ['GCF_000298385_00242'] + - path: output/pirate/results/pangenome_iterations/pan_sequences.blast.output + md5sum: 9da25d27684bfcc5488987ab2d1fd3a1 + - path: output/pirate/results/pangenome_iterations/pan_sequences.cdhit_clusters + contains: ['GCF_000298385_00081'] + - path: output/pirate/results/pangenome_iterations/pan_sequences.core_clusters.tab + contains: ['GCF_000298385_00242'] + - path: output/pirate/results/pangenome_iterations/pan_sequences.mcl_log.txt + contains: ['chaos'] + - path: output/pirate/results/pangenome_iterations/pan_sequences.representative.fasta + md5sum: 84668b6c65b57026a17a50b0edd02541 + - path: output/pirate/results/pangenome_iterations/pan_sequences.representative.fasta.pdb + - path: output/pirate/results/pangenome_iterations/pan_sequences.representative.fasta.pot + - path: output/pirate/results/pangenome_iterations/pan_sequences.representative.fasta.ptf + - path: output/pirate/results/pangenome_iterations/pan_sequences.representative.fasta.pto + - path: output/pirate/results/pangenome_log.txt + contains: ['Creating pangenome on amino acid'] + - path: output/pirate/results/paralog_clusters.tab + contains: ['g0216'] + - path: output/pirate/results/representative_sequences.faa + contains: ['representative_genome'] + - path: output/pirate/results/representative_sequences.ffn + contains: ['representative_genome'] + - path: output/pirate/results/split_groups.log + contains: ['g0213'] From aa32a8a72eab0c0fb4c748678916be57126a4f61 Mon Sep 17 00:00:00 2001 From: GCJMackenzie <43276267+GCJMackenzie@users.noreply.github.com> Date: Tue, 5 Oct 2021 22:52:00 +0100 Subject: [PATCH 38/61] new module: gatk4/calculatecontamination (#778) * initiated files for calculate contamination * pushing local repo to remote * created script, filled in meta yml, created tests and test yml. local checks passing, needs repo side test data * added option and tests for outputting optional segmentation file * saving for test push * versions updated, test data added * Update main.nf * fixed versions info, should report correctly now * small update to main.nf outputs formatting * Apply suggestions from code review * Update test_data.config * Apply suggestions from code review Co-authored-by: GCJMackenzie Co-authored-by: Harshil Patel --- .../gatk4/calculatecontamination/functions.nf | 78 +++++++++++++++++++ modules/gatk4/calculatecontamination/main.nf | 47 +++++++++++ modules/gatk4/calculatecontamination/meta.yml | 53 +++++++++++++ tests/config/pytest_modules.yml | 4 + tests/config/test_data.config | 2 + .../gatk4/calculatecontamination/main.nf | 38 +++++++++ .../gatk4/calculatecontamination/test.yml | 28 +++++++ 7 files changed, 250 insertions(+) create mode 100644 modules/gatk4/calculatecontamination/functions.nf create mode 100644 modules/gatk4/calculatecontamination/main.nf create mode 100644 modules/gatk4/calculatecontamination/meta.yml create mode 100644 tests/modules/gatk4/calculatecontamination/main.nf create mode 100644 tests/modules/gatk4/calculatecontamination/test.yml diff --git a/modules/gatk4/calculatecontamination/functions.nf b/modules/gatk4/calculatecontamination/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/gatk4/calculatecontamination/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/gatk4/calculatecontamination/main.nf b/modules/gatk4/calculatecontamination/main.nf new file mode 100644 index 00000000..bfe9b8fd --- /dev/null +++ b/modules/gatk4/calculatecontamination/main.nf @@ -0,0 +1,47 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process GATK4_CALCULATECONTAMINATION { + tag "$meta.id" + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::gatk4=4.2.0.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/gatk4:4.2.0.0--0" + } else { + container "quay.io/biocontainers/gatk4:4.2.0.0--0" + } + + input: + tuple val(meta), path(pileup), path(matched) + val segmentout + + output: + tuple val(meta), path('*.contamination.table') , emit: contamination + tuple val(meta), path('*.segmentation.table') , optional:true, emit: segmentation + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def matched_command = matched ? " -matched ${matched} " : '' + def segment_command = segmentout ? " -segments ${prefix}.segmentation.table" : '' + """ + gatk CalculateContamination \\ + -I $pileup \\ + $matched_command \\ + -O ${prefix}.contamination.table \\ + $segment_command \\ + $options.args + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/calculatecontamination/meta.yml b/modules/gatk4/calculatecontamination/meta.yml new file mode 100644 index 00000000..0d1b9b85 --- /dev/null +++ b/modules/gatk4/calculatecontamination/meta.yml @@ -0,0 +1,53 @@ +name: gatk4_calculatecontamination +description: | + Calculates the fraction of reads from cross-sample contamination based on summary tables from getpileupsummaries. Output to be used with filtermutectcalls. +keywords: + - gatk4 + - calculatecontamination + - cross-samplecontamination + - getpileupsummaries + - filtermutectcalls +tools: + - gatk4: + description: | + Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools + with a primary focus on variant discovery and genotyping. Its powerful processing engine + and high-performance computing features make it capable of taking on projects of any size. + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s + doi: 10.1158/1538-7445.AM2017-3590 + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - pileup: + type: file + description: File containing the pileups summary table of a tumor sample to be used to calculate contamination. + pattern: "*.pileups.table" + - matched: + type: file + description: File containing the pileups summary table of a normal sample that matches with the tumor sample specified in pileup argument. This is an optional input. + pattern: "*.pileups.table" + - segmentout: + type: boolean + description: specifies whether to output the segmentation table. + +output: + - contamination: + type: file + description: File containing the contamination table. + pattern: "*.contamination.table" + - segmentation: + type: file + description: optional output table containing segmentation of tumor minor allele fractions. + pattern: "*.segmentation.table" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@GCJMackenzie" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index ec3e8ed4..340ea28d 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -386,6 +386,10 @@ gatk4/bedtointervallist: - modules/gatk4/bedtointervallist/** - tests/modules/gatk4/bedtointervallist/** +gatk4/calculatecontamination: + - modules/gatk4/calculatecontamination/** + - tests/modules/gatk4/calculatecontamination/** + gatk4/createsequencedictionary: - modules/gatk4/createsequencedictionary/** - tests/modules/gatk4/createsequencedictionary/** diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 8d5ecd92..8fcc3d0b 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -153,6 +153,8 @@ params { test_baserecalibrator_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test.baserecalibrator.table" test2_baserecalibrator_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test2.baserecalibrator.table" + test_pileups_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test.pileups.table" + test2_pileups_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test2.pileups.table" test_genome_vcf = "${test_data_dir}/genomics/homo_sapiens/illumina/gvcf/test.genome.vcf" test_genome_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz" diff --git a/tests/modules/gatk4/calculatecontamination/main.nf b/tests/modules/gatk4/calculatecontamination/main.nf new file mode 100644 index 00000000..f93f66fb --- /dev/null +++ b/tests/modules/gatk4/calculatecontamination/main.nf @@ -0,0 +1,38 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK4_CALCULATECONTAMINATION } from '../../../../modules/gatk4/calculatecontamination/main.nf' addParams( options: [:] ) + +workflow test_gatk4_calculatecontamination_tumor_only { + + input = [ [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_pileups_table'], checkIfExists: true), + [] ] + + segmentout = false + + GATK4_CALCULATECONTAMINATION ( input, segmentout ) +} + +workflow test_gatk4_calculatecontamination_matched_pair { + + input = [ [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_pileups_table'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_pileups_table'], checkIfExists: true) ] + + segmentout = false + + GATK4_CALCULATECONTAMINATION ( input, segmentout ) +} + +workflow test_gatk4_calculatecontamination_segmentation { + + input = [ [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_pileups_table'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_pileups_table'], checkIfExists: true) ] + + segmentout = true + + GATK4_CALCULATECONTAMINATION ( input, segmentout ) +} diff --git a/tests/modules/gatk4/calculatecontamination/test.yml b/tests/modules/gatk4/calculatecontamination/test.yml new file mode 100644 index 00000000..8736bc32 --- /dev/null +++ b/tests/modules/gatk4/calculatecontamination/test.yml @@ -0,0 +1,28 @@ +- name: gatk4 calculatecontamination test_gatk4_calculatecontamination_tumor_only + command: nextflow run tests/modules/gatk4/calculatecontamination -entry test_gatk4_calculatecontamination_tumor_only -c tests/config/nextflow.config + tags: + - gatk4/calculatecontamination + - gatk4 + files: + - path: output/gatk4/test.contamination.table + md5sum: ff348a26dd09404239a7ed0da7d98874 + +- name: gatk4 calculatecontamination test_gatk4_calculatecontamination_matched_pair + command: nextflow run tests/modules/gatk4/calculatecontamination -entry test_gatk4_calculatecontamination_matched_pair -c tests/config/nextflow.config + tags: + - gatk4/calculatecontamination + - gatk4 + files: + - path: output/gatk4/test.contamination.table + md5sum: ff348a26dd09404239a7ed0da7d98874 + +- name: gatk4 calculatecontamination test_gatk4_calculatecontamination_segmentation + command: nextflow run tests/modules/gatk4/calculatecontamination -entry test_gatk4_calculatecontamination_segmentation -c tests/config/nextflow.config + tags: + - gatk4/calculatecontamination + - gatk4 + files: + - path: output/gatk4/test.contamination.table + md5sum: ff348a26dd09404239a7ed0da7d98874 + - path: output/gatk4/test.segmentation.table + md5sum: 478cb4f69ec001944b9cd0e7e4de01ef From bcf2681b037ba971984a64181b660b6591335f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Guizard?= Date: Tue, 5 Oct 2021 23:16:45 +0100 Subject: [PATCH 39/61] New module: `pbbam/pbmerge` (#752) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ“¦ NEW: Add pbbam/pbmerge module * πŸ› FIX: Add optional arguments to command line * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Update test data config and test script * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ“¦ NEW: Add pbbam/pbmerge module * πŸ› FIX: Add optional arguments to command line * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Update test data config and test script * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Update and clean code * πŸ› FIX: Update module path in test * πŸ› FIX: Add missing () + correct module path in test * πŸ‘Œ IMPROVE: Update pbmerge from version 1.6.0 to 1.7.0 * πŸ‘Œ IMPROVE: Change output filename suffix for something more generic * πŸ› Update test.yml * Apply suggestions from code review * Update tests/modules/pbbam/pbmerge/test.yml * Update tests/modules/pbbam/pbmerge/main.nf Co-authored-by: Gregor Sturm Co-authored-by: Robert A. Petit III Co-authored-by: Harshil Patel --- modules/pbbam/pbmerge/functions.nf | 78 ++++++++++++++++++++++++++++ modules/pbbam/pbmerge/main.nf | 42 +++++++++++++++ modules/pbbam/pbmerge/meta.yml | 46 ++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/pbbam/pbmerge/main.nf | 18 +++++++ tests/modules/pbbam/pbmerge/test.yml | 10 ++++ 6 files changed, 198 insertions(+) create mode 100644 modules/pbbam/pbmerge/functions.nf create mode 100644 modules/pbbam/pbmerge/main.nf create mode 100644 modules/pbbam/pbmerge/meta.yml create mode 100644 tests/modules/pbbam/pbmerge/main.nf create mode 100644 tests/modules/pbbam/pbmerge/test.yml diff --git a/modules/pbbam/pbmerge/functions.nf b/modules/pbbam/pbmerge/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/pbbam/pbmerge/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/pbbam/pbmerge/main.nf b/modules/pbbam/pbmerge/main.nf new file mode 100644 index 00000000..63cd2ffe --- /dev/null +++ b/modules/pbbam/pbmerge/main.nf @@ -0,0 +1,42 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process PBBAM_PBMERGE { + tag "$meta.id" + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::pbbam=1.7.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/pbbam:1.7.0--h058f120_1" + } else { + container "quay.io/biocontainers/pbbam:1.7.0--h058f120_1" + } + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.bam"), emit: bam + tuple val(meta), path("*.pbi"), emit: pbi + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + """ + pbmerge \\ + -o ${prefix}.bam \\ + $options.args \\ + *.bam + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + pbbam/pbmerge: \$( pbmerge --version|sed 's/pbmerge //' ) + END_VERSIONS + """ +} diff --git a/modules/pbbam/pbmerge/meta.yml b/modules/pbbam/pbmerge/meta.yml new file mode 100644 index 00000000..c483ca40 --- /dev/null +++ b/modules/pbbam/pbmerge/meta.yml @@ -0,0 +1,46 @@ +name: pbbam_pbmerge +description: The pbbam software package provides components to create, query, & edit PacBio BAM files and associated indices. These components include a core C++ library, bindings for additional languages, and command-line utilities. +keywords: + - pbbam + - pbbam/pbmerge +tools: + - pbbam: + description: PacBio BAM C++ library + homepage: https://github.com/PacificBiosciences/pbbioconda + documentation: https://pbbam.readthedocs.io/en/latest/tools/pbmerge.html + tool_dev_url: https://github.com/pacificbiosciences/pbbam/ + doi: "" + licence: ['BSD-3-clause-Clear'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM files to merge + pattern: "*.bam" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bam: + type: file + description: The merged bam file + pattern: "*.bam" + - pbi: + type: file + description: BAM Pacbio index file + pattern: "*.bam.pbi" + +authors: + - "@sguizard" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 340ea28d..556f6483 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -731,6 +731,10 @@ pangolin: - modules/pangolin/** - tests/modules/pangolin/** +pbbam/pbmerge: + - modules/pbbam/pbmerge/** + - tests/modules/pbbam/pbmerge/** + pbccs: - modules/pbccs/** - tests/modules/pbccs/** diff --git a/tests/modules/pbbam/pbmerge/main.nf b/tests/modules/pbbam/pbmerge/main.nf new file mode 100644 index 00000000..9220af0c --- /dev/null +++ b/tests/modules/pbbam/pbmerge/main.nf @@ -0,0 +1,18 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PBBAM_PBMERGE } from '../../../../modules/pbbam/pbmerge/main.nf' addParams( options: [suffix: '.merged'] ) + +workflow test_pbbam_pbmerge { + + input = [ + [ id:'test' ], // meta map + [ + file(params.test_data['homo_sapiens']['pacbio']['cluster'] , checkIfExists: true), + file(params.test_data['homo_sapiens']['pacbio']['singletons'], checkIfExists: true) + ] + ] + + PBBAM_PBMERGE ( input ) +} diff --git a/tests/modules/pbbam/pbmerge/test.yml b/tests/modules/pbbam/pbmerge/test.yml new file mode 100644 index 00000000..4f334c0e --- /dev/null +++ b/tests/modules/pbbam/pbmerge/test.yml @@ -0,0 +1,10 @@ +- name: pbbam pbmerge test_pbbam_pbmerge + command: nextflow run tests/modules/pbbam/pbmerge -entry test_pbbam_pbmerge -c tests/config/nextflow.config + tags: + - pbbam/pbmerge + - pbbam + files: + - path: output/pbbam/test.merged.bam + md5sum: 727c7ba1289192085c06890dda70f973 + - path: output/pbbam/test.merged.bam.pbi + md5sum: edfadd3a81c598d1ee051899792db75d From 84f2302920078b0cf7716b2a2e5fcc0be5c4531d Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Wed, 6 Oct 2021 08:16:36 +0200 Subject: [PATCH 40/61] Correct parsing versions with trailing zeros (#795) * Correct parsing versions with trailing zeros * Fix test * Update modules/custom/dumpsoftwareversions/main.nf Co-authored-by: Harshil Patel * Fix tests and go back to output versions.yml * Update tests/test_versions_yml.py to use BaseLoader Co-authored-by: Harshil Patel Co-authored-by: Gregor Sturm --- modules/custom/dumpsoftwareversions/main.nf | 2 +- tests/modules/custom/dumpsoftwareversions/main.nf | 4 ++-- tests/test_versions_yml.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/custom/dumpsoftwareversions/main.nf b/modules/custom/dumpsoftwareversions/main.nf index cf10a8e0..faf2073f 100644 --- a/modules/custom/dumpsoftwareversions/main.nf +++ b/modules/custom/dumpsoftwareversions/main.nf @@ -79,7 +79,7 @@ process CUSTOM_DUMPSOFTWAREVERSIONS { } with open("$versions") as f: - workflow_versions = yaml.safe_load(f) | module_versions + workflow_versions = yaml.load(f, Loader=yaml.BaseLoader) | module_versions workflow_versions["Workflow"] = { "Nextflow": "$workflow.nextflow.version", diff --git a/tests/modules/custom/dumpsoftwareversions/main.nf b/tests/modules/custom/dumpsoftwareversions/main.nf index 94dbc5fb..020b19bd 100644 --- a/tests/modules/custom/dumpsoftwareversions/main.nf +++ b/tests/modules/custom/dumpsoftwareversions/main.nf @@ -17,8 +17,8 @@ workflow test_custom_dumpsoftwareversions { MULTIQC ( FASTQC.out.zip.collect { it[1] } ) ch_software_versions = Channel.empty() - ch_software_versions = ch_software_versions.mix(FASTQC.out.version) - ch_software_versions = ch_software_versions.mix(MULTIQC.out.version) + ch_software_versions = ch_software_versions.mix(FASTQC.out.versions) + ch_software_versions = ch_software_versions.mix(MULTIQC.out.versions) CUSTOM_DUMPSOFTWAREVERSIONS ( ch_software_versions.collectFile() ) } diff --git a/tests/test_versions_yml.py b/tests/test_versions_yml.py index b6392b87..759fc4d5 100644 --- a/tests/test_versions_yml.py +++ b/tests/test_versions_yml.py @@ -13,7 +13,8 @@ def _get_workflow_names(): here = Path(__file__).parent.resolve() pytest_workflow_files = here.glob("**/test.yml") for f in pytest_workflow_files: - test_config = yaml.safe_load(f.read_text()) + # test_config = yaml.safe_load(f.read_text()) + test_config = yaml.load(f.read_text(), Loader=yaml.BaseLoader) for workflow in test_config: yield workflow["name"] From 79d38a306bdaf07000e0d6f300684d3ed38c8919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Guizard?= Date: Wed, 6 Oct 2021 11:13:48 +0100 Subject: [PATCH 41/61] New module: `isoseq3/refine` (#748) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * πŸ“¦ NEW: Add isoseq3/refine module * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add parallelization * πŸ› FIX: Correct Typo * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The module accept one channel (primers moved into the first channel) * πŸ‘Œ IMPROVE: Assign a value channel to primers input Improve workflow code readability * πŸ‘Œ IMPROVE: Update to the version of templates * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ‘Œ IMPROVE: Update test file * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Fill contains args * πŸ“¦ NEW: Add isoseq3/refine module * πŸ‘Œ IMPROVE: Add parallelization * πŸ› FIX: Correct Typo * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The module accept one channel (primers moved into the first channel) * πŸ‘Œ IMPROVE: Assign a value channel to primers input Improve workflow code readability * πŸ‘Œ IMPROVE: Update to the version of templates * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ‘Œ IMPROVE: Update test file * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Fill contains args * πŸ‘Œ IMPROVE: Add one channel per output file * πŸ‘Œ IMPROVE: Minor updates * πŸ‘Œ IMPROVE: Minors Update - Remove TODO from test.yml - Remove useless piece of code * πŸ“¦ NEW: Add isoseq3/refine module * πŸ‘Œ IMPROVE: Add parallelization * πŸ› FIX: Correct Typo * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The module accept one channel (primers moved into the first channel) * πŸ‘Œ IMPROVE: Assign a value channel to primers input Improve workflow code readability * πŸ‘Œ IMPROVE: Update to the version of templates * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ‘Œ IMPROVE: Update test file * πŸ‘Œ IMPROVE: Fill contains args * πŸ“¦ NEW: Add isoseq3/refine module * πŸ‘Œ IMPROVE: Add parallelization * πŸ› FIX: Correct Typo * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The module accept one channel (primers moved into the first channel) * πŸ‘Œ IMPROVE: Assign a value channel to primers input Improve workflow code readability * πŸ‘Œ IMPROVE: Update to the version of templates * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ‘Œ IMPROVE: Update test file * πŸ‘Œ IMPROVE: Add one channel per output file * πŸ‘Œ IMPROVE: Minor updates * πŸ‘Œ IMPROVE: Minors Update - Remove TODO from test.yml - Remove useless piece of code * πŸ› FIX: Remove unwanted files * πŸ› FIX: Protect \ * πŸ› FIX: Remove test files * Apply suggestions from code review * Apply suggestions from code review * Update tests/modules/isoseq3/refine/test.yml Co-authored-by: Gregor Sturm Co-authored-by: Harshil Patel --- modules/isoseq3/refine/functions.nf | 78 +++++++++++++++++++++++++++ modules/isoseq3/refine/main.nf | 49 +++++++++++++++++ modules/isoseq3/refine/meta.yml | 62 +++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/isoseq3/refine/main.nf | 16 ++++++ tests/modules/isoseq3/refine/test.yml | 16 ++++++ 6 files changed, 225 insertions(+) create mode 100644 modules/isoseq3/refine/functions.nf create mode 100644 modules/isoseq3/refine/main.nf create mode 100644 modules/isoseq3/refine/meta.yml create mode 100644 tests/modules/isoseq3/refine/main.nf create mode 100644 tests/modules/isoseq3/refine/test.yml diff --git a/modules/isoseq3/refine/functions.nf b/modules/isoseq3/refine/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/isoseq3/refine/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/isoseq3/refine/main.nf b/modules/isoseq3/refine/main.nf new file mode 100644 index 00000000..5a45eb2d --- /dev/null +++ b/modules/isoseq3/refine/main.nf @@ -0,0 +1,49 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process ISOSEQ3_REFINE { + tag "$meta.id" + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::isoseq3=3.4.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/isoseq3:3.4.0--0" + } else { + container "quay.io/biocontainers/isoseq3:3.4.0--0" + } + + input: + tuple val(meta), path(bam) + path primers + + output: + tuple val(meta), path("*.bam") , emit: bam + tuple val(meta), path("*.bam.pbi") , emit: pbi + tuple val(meta), path("*.consensusreadset.xml"), emit: consensusreadset + tuple val(meta), path("*.filter_summary.json") , emit: summary + tuple val(meta), path("*.report.csv") , emit: report + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + """ + isoseq3 \\ + refine \\ + -j $task.cpus \\ + $options.args \\ + $bam \\ + $primers \\ + ${prefix}.bam + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$( isoseq3 refine --version|sed 's/isoseq refine //'|sed 's/ (commit.\\+//' ) + END_VERSIONS + """ +} diff --git a/modules/isoseq3/refine/meta.yml b/modules/isoseq3/refine/meta.yml new file mode 100644 index 00000000..81b57c7c --- /dev/null +++ b/modules/isoseq3/refine/meta.yml @@ -0,0 +1,62 @@ +name: isoseq3_refine +description: Generate transcripts by clustering HiFi reads +keywords: + - isoseq3 + - isoseq3/refine +tools: + - isoseq3: + description: IsoSeq3 - Scalable De Novo Isoform Discovery + homepage: https://github.com/PacificBiosciences/IsoSeq/blob/master/isoseq-clustering.md + documentation: https://github.com/PacificBiosciences/IsoSeq/blob/master/isoseq-clustering.md + tool_dev_url: https://github.com/PacificBiosciences/IsoSeq/blob/master/isoseq-clustering.md + doi: "" + licence: ['BSD-3-clause-Clear'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test ] + - bam: + type: file + description: BAM file, cleaned ccs generated by lima + pattern: "*.bam" + - primers: + type: file + description: fasta file of primers + pattern: "*.fasta" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - bam: + type: file + description: Set of complete reads (with polyA tail), where the polyA has been trimmed + pattern: "*.bam" + - pbi: + type: file + description: Pacbio index file from polyA trimmed reads + pattern: "*.pbi" + - consensusreadset: + type: file + description: Metadata about read library + pattern: "*.xml" + - summary: + type: file + description: json file describing number of full length reads, full length non chimeric reads and full length non chimeric polyA reads + pattern: "*.json" + - report: + type: file + description: Metadata about primer and polyA detection (primers/polyA/insert length, strand, primer name) + pattern: "*.csv" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@sguizard" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 556f6483..bf280360 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -525,6 +525,10 @@ iqtree: - modules/iqtree/** - tests/modules/iqtree/** +isoseq3/refine: + - modules/isoseq3/refine/** + - tests/modules/isoseq3/refine/** + ismapper: - modules/ismapper/** - tests/modules/ismapper/** diff --git a/tests/modules/isoseq3/refine/main.nf b/tests/modules/isoseq3/refine/main.nf new file mode 100644 index 00000000..13736604 --- /dev/null +++ b/tests/modules/isoseq3/refine/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ISOSEQ3_REFINE } from '../../../../modules/isoseq3/refine/main' addParams( options: [suffix:'.refine'] ) + +workflow test_isoseq3_refine { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['pacbio']['lima'], checkIfExists: true), + ] + primers = file(params.test_data['homo_sapiens']['pacbio']['primers'], checkIfExists: true) + + ISOSEQ3_REFINE ( input, primers ) +} diff --git a/tests/modules/isoseq3/refine/test.yml b/tests/modules/isoseq3/refine/test.yml new file mode 100644 index 00000000..2e7782d3 --- /dev/null +++ b/tests/modules/isoseq3/refine/test.yml @@ -0,0 +1,16 @@ +- name: isoseq3 refine test_isoseq3_refine + command: nextflow run tests/modules/isoseq3/refine -entry test_isoseq3_refine -c tests/config/nextflow.config + tags: + - isoseq3 + - isoseq3/refine + files: + - path: output/isoseq3/test.refine.bam + md5sum: e8387afd5f66a7f6a89f90a0dcf3b823 + - path: output/isoseq3/test.refine.bam.pbi + md5sum: 8097cad9e472f2f79de6de5fe3dcc822 + - path: output/isoseq3/test.refine.consensusreadset.xml + contains: [ 'pbds:ConsensusReadSet' ] + - path: output/isoseq3/test.refine.filter_summary.json + md5sum: 87f8bdd5c60741f47b8a991e002f7ef3 + - path: output/isoseq3/test.refine.report.csv + md5sum: d42a139e5d9b08396bdb087c01243ea9 From 5a49d2c1bfdaa1204b83b172c3ca95cf972402b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Guizard?= Date: Thu, 7 Oct 2021 10:06:02 +0100 Subject: [PATCH 42/61] New module: `isoseq3/cluster` (#801) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * πŸ“¦ NEW: Add isoseq3/cluster module * πŸ›FIX: Fix reports channel and add .pbi to it * πŸ›FIX: Fix report channel definition * πŸ‘ŒIMPROVE: Move .pbi file into reports channel * πŸ‘ŒIMPROVE: remove --use_qvs option from command line * πŸ‘Œ IMPROVE: Add in addParams removed options from command line * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The module accept one channel (primers moved into the first channel) * πŸ“¦ NEW: Add galgal6 chr30 test data * πŸ“¦ NEW: Add bamtools module * πŸ‘Œ IMPROVE: Ignore test data * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: add singletons parameter and improve outputs * πŸ› FIX: Update test with last module model * πŸ‘Œ IMPROVE: Add test tag * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Update test data config * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ‘Œ IMPROVE: Remove unused index * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Fill contains args * πŸ“¦ NEW: Add isoseq3/cluster module * πŸ›FIX: Fix reports channel and add .pbi to it * πŸ›FIX: Fix report channel definition * πŸ‘ŒIMPROVE: Move .pbi file into reports channel * πŸ‘ŒIMPROVE: remove --use_qvs option from command line * πŸ‘Œ IMPROVE: Add in addParams removed options from command line * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The module accept one channel (primers moved into the first channel) * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: add singletons parameter and improve outputs * πŸ› FIX: Update test with last module model * πŸ‘Œ IMPROVE: Add test tag * πŸ‘Œ IMPROVE: Update test data config * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ‘Œ IMPROVE: Remove unused index * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Fill contains args * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ“¦ NEW: Add galgal6 chr30 test data * πŸ“¦ NEW: Add bamtools module * πŸ‘Œ IMPROVE: Ignore test data * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Update code to new versions capture + better output channels * πŸ‘Œ IMPROVE: Update with new versions.yml file * πŸ› FIX: Update meta.yml + correct typos * πŸ‘Œ IMPROVE: Clean output file names + correct typo * πŸ› FIX: Remove bamtools/split module from isoseq3/cluster --- .gitignore | 4 +- modules/isoseq3/cluster/functions.nf | 78 +++++++++++++++++++++++++ modules/isoseq3/cluster/main.nf | 53 +++++++++++++++++ modules/isoseq3/cluster/meta.yml | 81 ++++++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/isoseq3/cluster/main.nf | 15 +++++ tests/modules/isoseq3/cluster/test.yml | 28 +++++++++ 7 files changed, 260 insertions(+), 3 deletions(-) create mode 100644 modules/isoseq3/cluster/functions.nf create mode 100644 modules/isoseq3/cluster/main.nf create mode 100644 modules/isoseq3/cluster/meta.yml create mode 100644 tests/modules/isoseq3/cluster/main.nf create mode 100644 tests/modules/isoseq3/cluster/test.yml diff --git a/.gitignore b/.gitignore index 06eae014..c773a2d0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,11 +5,9 @@ test_output/ output/ .DS_Store *.code-workspace +tests/data/ .screenrc .*.sw? __pycache__ *.pyo *.pyc -tests/data/ -modules/modtest/ -tests/modules/modtest/ diff --git a/modules/isoseq3/cluster/functions.nf b/modules/isoseq3/cluster/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/isoseq3/cluster/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/isoseq3/cluster/main.nf b/modules/isoseq3/cluster/main.nf new file mode 100644 index 00000000..f01af2bc --- /dev/null +++ b/modules/isoseq3/cluster/main.nf @@ -0,0 +1,53 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process ISOSEQ3_CLUSTER { + tag "$meta.id" + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::isoseq3=3.4.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/isoseq3:3.4.0--0" + } else { + container "quay.io/biocontainers/isoseq3:3.4.0--0" + } + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.bam") , emit: bam + tuple val(meta), path("*.bam.pbi") , emit: pbi + tuple val(meta), path("*.cluster") , emit: cluster + tuple val(meta), path("*.cluster_report.csv"), emit: cluster_report + tuple val(meta), path("*.transcriptset.xml") , emit: transcriptset + tuple val(meta), path("*.hq.bam") , emit: hq_bam + tuple val(meta), path("*.hq.bam.pbi") , emit: hq_pbi + tuple val(meta), path("*.lq.bam") , emit: lq_bam + tuple val(meta), path("*.lq.bam.pbi") , emit: lq_pbi + path "versions.yml" , emit: versions + + tuple val(meta), path("*.singletons.bam") , optional: true, emit: singletons_bam + tuple val(meta), path("*.singletons.bam.pbi"), optional: true, emit: singletons_pbi + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + """ + isoseq3 \\ + cluster \\ + $bam \\ + ${prefix}.bam \\ + $options.args + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + isoseq3 cluster: \$( isoseq3 cluster --version|sed 's/isoseq cluster //g'|sed 's/ (.*//g' ) + END_VERSIONS + """ +} diff --git a/modules/isoseq3/cluster/meta.yml b/modules/isoseq3/cluster/meta.yml new file mode 100644 index 00000000..6fadb9c4 --- /dev/null +++ b/modules/isoseq3/cluster/meta.yml @@ -0,0 +1,81 @@ +name: isoseq3_cluster +description: IsoSeq3 - Cluster - Cluster trimmed consensus sequences +keywords: + - cluster +tools: + - isoseq3: + description: IsoSeq3 - Cluster - Cluster trimmed consensus sequences + homepage: https://github.com/PacificBiosciences/IsoSeq/blob/master/isoseq-clustering.md + documentation: https://github.com/PacificBiosciences/IsoSeq/blob/master/isoseq-clustering.md + tool_dev_url: https://github.com/PacificBiosciences/IsoSeq/blob/master/isoseq-clustering.md + doi: "" + licence: ['BSD-3-clause-Clear'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - bam: + type: file + description: BAM file generated by isoseq3 refine + pattern: "*.bam" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - version: + type: file + description: File containing software version + pattern: "versions.yml" + - bam: + type: file + description: BAM file of clustered consensus + pattern: "*.bam" + - pbi: + type: file + description: Pacbio Index of consensus reads generated by clustering + pattern: "*.pbi" + - cluster: + type: file + description: A two columns (from, to) file describing original read name to new read name + pattern: "*.cluster" + - cluster_report: + type: file + description: A table files clusters (transcripts) members (read) + pattern: "*.cluster_report.csv" + - transcriptset: + type: file + description: A metadata xml file which contains full paths to data files + pattern: "*.clustered.transcriptset.xml" + - hq_bam: + type: file + description: High quality reads + pattern: "*.hq.bam" + - hq_pbi: + type: file + description: Pacbio index of high quality reads + pattern: "*.hq.bam.pbi" + - lq_bam: + type: file + description: Low quality reads + pattern: "*.lq.bam" + - lq_pbi: + type: file + description: Pacbio index of low quality reads + pattern: "*.lq.bam.pbi" + - singletons_bam: + type: file + description: Unclustered reads + pattern: "*.singletons.bam" + - singletons_pbi: + type: file + description: Pacbio index of unclustered reads + pattern: "*.singletons.bam.pbi" + +authors: + - "@sguizard" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index bf280360..6f0e491f 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -525,6 +525,10 @@ iqtree: - modules/iqtree/** - tests/modules/iqtree/** +isoseq3/cluster: + - modules/isoseq3/cluster/** + - tests/modules/isoseq3/cluster/** + isoseq3/refine: - modules/isoseq3/refine/** - tests/modules/isoseq3/refine/** diff --git a/tests/modules/isoseq3/cluster/main.nf b/tests/modules/isoseq3/cluster/main.nf new file mode 100644 index 00000000..90a24c11 --- /dev/null +++ b/tests/modules/isoseq3/cluster/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ISOSEQ3_CLUSTER } from '../../../../modules/isoseq3/cluster/main.nf' addParams( options: [args: '--singletons --use-qvs --verbose'] ) + +workflow test_isoseq3_cluster { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['pacbio']['refine'], checkIfExists: true), + ] + + ISOSEQ3_CLUSTER ( input ) +} diff --git a/tests/modules/isoseq3/cluster/test.yml b/tests/modules/isoseq3/cluster/test.yml new file mode 100644 index 00000000..cc6b6dac --- /dev/null +++ b/tests/modules/isoseq3/cluster/test.yml @@ -0,0 +1,28 @@ +- name: isoseq3 cluster test_isoseq3_cluster + command: nextflow run tests/modules/isoseq3/cluster -entry test_isoseq3_cluster -c tests/config/nextflow.config + tags: + - isoseq3 + - isoseq3/cluster + files: + - path: output/isoseq3/test.bam + md5sum: ca8277f4d8fe1bba68ba266c42b46dd1 + - path: output/isoseq3/test.bam.pbi + md5sum: cbc06657b4543faba7ff886b3b12b862 + - path: output/isoseq3/test.cluster + md5sum: d5059d856763fc5591332980bfc0d57b + - path: output/isoseq3/test.cluster_report.csv + md5sum: 342d97dc10aedf80a45977edcb491c62 + - path: output/isoseq3/test.hq.bam + md5sum: e93ea85776c35c246364d954032c2ea9 + - path: output/isoseq3/test.hq.bam.pbi + md5sum: 5a8ea7668e8f8e173478b28cbb6ab515 + - path: output/isoseq3/test.lq.bam + md5sum: 4ea0e4f4a6cc689dcc275adcdf688fad + - path: output/isoseq3/test.lq.bam.pbi + md5sum: f5edc24711b2c8d6474d60cb69022af0 + - path: output/isoseq3/test.singletons.bam + md5sum: 73d131920bd42e1fc5fca2e6cb71f4b2 + - path: output/isoseq3/test.singletons.bam.pbi + md5sum: 73980863be4b5bda2846325c737f0b5e + - path: output/isoseq3/test.transcriptset.xml + contains: [ 'PacBio.DataSet.TranscriptSet' ] From f479d4fb8d634b5ac5bd1c879917dc285abc076d Mon Sep 17 00:00:00 2001 From: GCJMackenzie <43276267+GCJMackenzie@users.noreply.github.com> Date: Thu, 7 Oct 2021 13:55:06 +0100 Subject: [PATCH 43/61] Learnreadorientationmodel (#794) * files for learnreadorientationmodel initialised for first commit * finished scripts and yml files. test working locally but needs an f1r2 test data on nf-core before it can be submitted * updated test data location * versions file updated, test data added * updated versions file, edited test file * small formatting update to main.nf * Update main.nf * Update test_data.config * updated tests main.nf * Update test_data.config * Apply suggestions from code review * Update modules/gatk4/learnreadorientationmodel/main.nf * Update modules/gatk4/learnreadorientationmodel/meta.yml * fixed tests failing Co-authored-by: GCJMackenzie Co-authored-by: Harshil Patel --- .../learnreadorientationmodel/functions.nf | 78 +++++++++++++++++++ .../gatk4/learnreadorientationmodel/main.nf | 44 +++++++++++ .../gatk4/learnreadorientationmodel/meta.yml | 41 ++++++++++ tests/config/pytest_modules.yml | 4 + tests/config/test_data.config | 8 ++ .../gatk4/learnreadorientationmodel/main.nf | 13 ++++ .../gatk4/learnreadorientationmodel/test.yml | 7 ++ 7 files changed, 195 insertions(+) create mode 100644 modules/gatk4/learnreadorientationmodel/functions.nf create mode 100644 modules/gatk4/learnreadorientationmodel/main.nf create mode 100644 modules/gatk4/learnreadorientationmodel/meta.yml create mode 100644 tests/modules/gatk4/learnreadorientationmodel/main.nf create mode 100644 tests/modules/gatk4/learnreadorientationmodel/test.yml diff --git a/modules/gatk4/learnreadorientationmodel/functions.nf b/modules/gatk4/learnreadorientationmodel/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/gatk4/learnreadorientationmodel/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/gatk4/learnreadorientationmodel/main.nf b/modules/gatk4/learnreadorientationmodel/main.nf new file mode 100644 index 00000000..0a499def --- /dev/null +++ b/modules/gatk4/learnreadorientationmodel/main.nf @@ -0,0 +1,44 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process GATK4_LEARNREADORIENTATIONMODEL { + tag "$meta.id" + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::gatk4=4.2.0.0" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/gatk4:4.2.0.0--0" + } else { + container "quay.io/biocontainers/gatk4:4.2.0.0--0" + } + + input: + tuple val(meta), path(f1r2) + + output: + tuple val(meta), path("*.tar.gz"), emit: artifactprior + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def inputs_list = [] + f1r2.each() { a -> inputs_list.add(" -I " + a) } + """ + gatk \\ + LearnReadOrientationModel \\ + ${inputs_list.join(' ')} \\ + -O ${prefix}.tar.gz \\ + $options.args + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/learnreadorientationmodel/meta.yml b/modules/gatk4/learnreadorientationmodel/meta.yml new file mode 100644 index 00000000..c15b48cb --- /dev/null +++ b/modules/gatk4/learnreadorientationmodel/meta.yml @@ -0,0 +1,41 @@ +name: gatk4_learnreadorientationmodel +description: | + Uses f1r2 counts collected during mutect2 to Learn the prior probability of read orientation artifacts +keywords: + - gatk4 + - learnreadorientationmodel + - readorientationartifacts + - mutect2 +tools: + - gatk4: + description: | + Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools + with a primary focus on variant discovery and genotyping. Its powerful processing engine + and high-performance computing features make it capable of taking on projects of any size. + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s + doi: 10.1158/1538-7445.AM2017-3590 + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - f1r2: + type: list + description: list of f1r2 files to be used as input. + pattern: "*.f1r2.tar.gz" + +output: + - artifactprior: + type: file + description: file containing artifact-priors to be used by filtermutectcalls + pattern: "*.tar.gz" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@GCJMackenzie" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 6f0e491f..45a4d62c 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -410,6 +410,10 @@ gatk4/intervallisttools: - modules/gatk4/intervallisttools/** - tests/modules/gatk4/intervallisttools/** +gatk4/learnreadorientationmodel: + - modules/gatk4/learnreadorientationmodel/** + - tests/modules/gatk4/learnreadorientationmodel/** + gatk4/markduplicates: - modules/gatk4/markduplicates/** - tests/modules/gatk4/markduplicates/** diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 8fcc3d0b..30e6f1ea 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -155,6 +155,14 @@ params { test2_baserecalibrator_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test2.baserecalibrator.table" test_pileups_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test.pileups.table" test2_pileups_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test2.pileups.table" + + test_test2_paired_mutect2_calls_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz" + test_test2_paired_mutect2_calls_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi" + test_test2_paired_mutect2_calls_vcf_gz_stats = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.stats" + test_test2_paired_mutect2_calls_f1r2_tar_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.f1r2.tar.gz" + test_test2_paired_mutect2_calls_artifact_prior_tar_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test_test2_paired_mutect2_calls.artifact-prior.tar.gz" + test_test2_paired_segmentation_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test_test2_paired.segmentation.table" + test_test2_paired_contamination_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test_test2_paired.contamination.table" test_genome_vcf = "${test_data_dir}/genomics/homo_sapiens/illumina/gvcf/test.genome.vcf" test_genome_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz" diff --git a/tests/modules/gatk4/learnreadorientationmodel/main.nf b/tests/modules/gatk4/learnreadorientationmodel/main.nf new file mode 100644 index 00000000..1a71873e --- /dev/null +++ b/tests/modules/gatk4/learnreadorientationmodel/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK4_LEARNREADORIENTATIONMODEL } from '../../../../modules/gatk4/learnreadorientationmodel/main.nf' addParams( options: [suffix:'.artifact-prior'] ) + +workflow test_gatk4_learnreadorientationmodel { + + input = [ [ id:'test' ], // meta map + [file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_f1r2_tar_gz'], checkIfExists: true)] ] + + GATK4_LEARNREADORIENTATIONMODEL ( input ) +} diff --git a/tests/modules/gatk4/learnreadorientationmodel/test.yml b/tests/modules/gatk4/learnreadorientationmodel/test.yml new file mode 100644 index 00000000..6e999fa6 --- /dev/null +++ b/tests/modules/gatk4/learnreadorientationmodel/test.yml @@ -0,0 +1,7 @@ +- name: gatk4 learnreadorientationmodel test_gatk4_learnreadorientationmodel + command: nextflow run tests/modules/gatk4/learnreadorientationmodel -entry test_gatk4_learnreadorientationmodel -c tests/config/nextflow.config + tags: + - gatk4 + - gatk4/learnreadorientationmodel + files: + - path: output/gatk4/test.artifact-prior.tar.gz From c19671dca974354978c9bc1711fca6fe681bdb0b Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Fri, 8 Oct 2021 15:02:42 +0000 Subject: [PATCH 44/61] Subworkflow Infrastructure (#662) * feat(subworkflows): Add align_bowtie2 subworkflow For testing CI setup * test(align_bowtie2): Add initial list of changes to test * test(align_bowtie2): Add initial test * refactor: Use tags to run subworkflows ci For every underlying module used by workflow and allow the modules pytest-modules definition be the source of truth. * refactor: Use individual directories for subworkflows * docs(align_bowtie2): Add initial meta.yml Copied most of it from the bowtie2/align module. * fix(align_bowtie2): Fix module include paths * test(bam_sort_samtools): Add initial test * ci(bam_sort_samtools): Add modules that trigger the tag * test(bam_stats_samtools): Add initial test * ci(bam_stats_samtools): Add keys to pick up changes * docs(bam_samtools): Add initial meta.yml * test(align_bowtie2): Fix path to subworkflow * test(align_bowtie2): Update entry point * fix(bam_sort_samtools): Update include paths * test(bam_sort_samtools): Fix path * style: Clean up addParams * test(samtools_sort): Add suffix for test * test(align_bowtie2): Add samtools_options for suffix * test(bam_stats_samtools): Update path * test(bam_stats_samtools): Use stats input Otherwise it's just an example of how it's used in the bam_sort_samtools subworkflow * ci(linting): Skip module linting of subworkflows * ci(linting): Clean up startsWith statement * test(bam_stats_samtools): Use single end test data for single end test * test(bam_stats_samtools): Add expected files * test(align_bowtie2): Add paired-end test * test(align_bowtie2): Sort order of output * test(align_bowtie2): Update hashes * docs(align_bowtie2): Fix typo * test(align_bowtie2): Update samtools output names * test(align_bowtie2): Remove md5sums for bam/bai * feat(subworkflows): Add nextflow.configs These can be used for default settings in the future. They can then be included in the conf/modules.config so that the params don't have to be duplicated in the root nextflow.config. * docs(subworkflows): Include modules instead of tools * fix: Update to versions * chore(align_bowtie2): Remove duplicate tag * style: Format yamls * test(subworkflows): Only check versions for modules * chore: Update subworkflows to match rnaseq dev * fix(subworkflows): Update paths * fix(bam_sort_samtools): Fix sort parameters for testing * Apply suggestions from code review Co-authored-by: Harshil Patel * docs: Update TODOs with a message * ci: Try using a matrix for strategy * ci: Try passing an array * Revert "ci: Try passing an array" This reverts commit d3611fcd8332bbb9a8501e8dd299d0a623aaecaa. Co-authored-by: Harshil Patel --- .github/workflows/nf-core-linting.yml | 2 + .github/workflows/pytest-workflow.yml | 7 +- subworkflows/nf-core/align_bowtie2/main.nf | 47 +++++++++++ subworkflows/nf-core/align_bowtie2/meta.yml | 50 ++++++++++++ .../nf-core/align_bowtie2/nextflow.config | 2 + .../nf-core/bam_sort_samtools/main.nf | 53 ++++++++++++ .../nf-core/bam_sort_samtools/meta.yml | 41 ++++++++++ .../nf-core/bam_sort_samtools/nextflow.config | 1 + .../nf-core/bam_stats_samtools/main.nf | 33 ++++++++ .../nf-core/bam_stats_samtools/meta.yml | 43 ++++++++++ .../bam_stats_samtools/nextflow.config | 1 + tests/config/pytest_subworkflows.yml | 11 +++ tests/modules/samtools/sort/main.nf | 2 +- tests/modules/samtools/sort/test.yml | 4 +- .../nf-core/align_bowtie2/main.nf | 27 +++++++ .../nf-core/align_bowtie2/test.yml | 81 +++++++++++++++++++ .../nf-core/bam_sort_samtools/main.nf | 21 +++++ .../nf-core/bam_sort_samtools/test.yml | 47 +++++++++++ .../nf-core/bam_stats_samtools/main.nf | 23 ++++++ .../nf-core/bam_stats_samtools/test.yml | 31 +++++++ tests/test_versions_yml.py | 2 +- 21 files changed, 524 insertions(+), 5 deletions(-) create mode 100644 subworkflows/nf-core/align_bowtie2/main.nf create mode 100644 subworkflows/nf-core/align_bowtie2/meta.yml create mode 100644 subworkflows/nf-core/align_bowtie2/nextflow.config create mode 100644 subworkflows/nf-core/bam_sort_samtools/main.nf create mode 100644 subworkflows/nf-core/bam_sort_samtools/meta.yml create mode 100644 subworkflows/nf-core/bam_sort_samtools/nextflow.config create mode 100644 subworkflows/nf-core/bam_stats_samtools/main.nf create mode 100644 subworkflows/nf-core/bam_stats_samtools/meta.yml create mode 100644 subworkflows/nf-core/bam_stats_samtools/nextflow.config create mode 100644 tests/config/pytest_subworkflows.yml create mode 100644 tests/subworkflows/nf-core/align_bowtie2/main.nf create mode 100644 tests/subworkflows/nf-core/align_bowtie2/test.yml create mode 100644 tests/subworkflows/nf-core/bam_sort_samtools/main.nf create mode 100644 tests/subworkflows/nf-core/bam_sort_samtools/test.yml create mode 100644 tests/subworkflows/nf-core/bam_stats_samtools/main.nf create mode 100644 tests/subworkflows/nf-core/bam_stats_samtools/test.yml diff --git a/.github/workflows/nf-core-linting.yml b/.github/workflows/nf-core-linting.yml index 263b36b3..55b8c296 100644 --- a/.github/workflows/nf-core-linting.yml +++ b/.github/workflows/nf-core-linting.yml @@ -71,6 +71,8 @@ jobs: - name: Lint ${{ matrix.tags }} run: nf-core modules lint ${{ matrix.tags }} + # HACK + if: startsWith( matrix.tags, 'subworkflow' ) != true - uses: actions/cache@v2 with: diff --git a/.github/workflows/pytest-workflow.yml b/.github/workflows/pytest-workflow.yml index 7cbb2689..6f395409 100644 --- a/.github/workflows/pytest-workflow.yml +++ b/.github/workflows/pytest-workflow.yml @@ -9,6 +9,11 @@ jobs: changes: name: Check for changes runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + filter: + ["tests/config/pytest_modules.yml", "tests/config/pytest_subworkflows.yml"] outputs: # Expose matched filters as job 'modules' output variable modules: ${{ steps.filter.outputs.changes }} @@ -18,7 +23,7 @@ jobs: - uses: dorny/paths-filter@v2 id: filter with: - filters: "tests/config/pytest_modules.yml" + filters: ${{ matrix.filter }} test: runs-on: ubuntu-20.04 diff --git a/subworkflows/nf-core/align_bowtie2/main.nf b/subworkflows/nf-core/align_bowtie2/main.nf new file mode 100644 index 00000000..ec453f8d --- /dev/null +++ b/subworkflows/nf-core/align_bowtie2/main.nf @@ -0,0 +1,47 @@ +// +// Alignment with Bowtie2 +// + +params.align_options = [:] +params.samtools_sort_options = [:] +params.samtools_index_options = [:] +params.samtools_stats_options = [:] + +include { BOWTIE2_ALIGN } from '../../../modules/bowtie2/align/main' addParams( options: params.align_options ) +include { BAM_SORT_SAMTOOLS } from '../bam_sort_samtools/main' addParams( sort_options: params.samtools_sort_options, index_options: params.samtools_index_options, stats_options: params.samtools_stats_options ) + +workflow ALIGN_BOWTIE2 { + take: + reads // channel: [ val(meta), [ reads ] ] + index // channel: /path/to/bowtie2/index/ + + main: + + ch_versions = Channel.empty() + + // + // Map reads with Bowtie2 + // + BOWTIE2_ALIGN ( reads, index ) + ch_versions = ch_versions.mix(BOWTIE2_ALIGN.out.versions.first()) + + // + // Sort, index BAM file and run samtools stats, flagstat and idxstats + // + BAM_SORT_SAMTOOLS ( BOWTIE2_ALIGN.out.bam ) + ch_versions = ch_versions.mix(BAM_SORT_SAMTOOLS.out.versions) + + emit: + bam_orig = BOWTIE2_ALIGN.out.bam // channel: [ val(meta), bam ] + log_out = BOWTIE2_ALIGN.out.log // channel: [ val(meta), log ] + fastq = BOWTIE2_ALIGN.out.fastq // channel: [ val(meta), fastq ] + + bam = BAM_SORT_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ] + bai = BAM_SORT_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ] + csi = BAM_SORT_SAMTOOLS.out.csi // channel: [ val(meta), [ csi ] ] + stats = BAM_SORT_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ] + flagstat = BAM_SORT_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ] + idxstats = BAM_SORT_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ] + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/align_bowtie2/meta.yml b/subworkflows/nf-core/align_bowtie2/meta.yml new file mode 100644 index 00000000..e149a212 --- /dev/null +++ b/subworkflows/nf-core/align_bowtie2/meta.yml @@ -0,0 +1,50 @@ +name: align_bowtie2 +description: Align reads to a reference genome using bowtie2 then sort with samtools +keywords: + - align + - fasta + - genome + - reference +modules: + - bowtie2/align + - samtools/sort + - samtools/index + - samtools/stats + - samtools/idxstats + - samtools/flagstat +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + - index: + type: file + description: Bowtie2 genome index files + pattern: '*.ebwt' +# TODO Update when we decide on a standard for subworkflow docs +output: + - bam: + type: file + description: Output BAM file containing read alignments + pattern: '*.{bam}' + - versions: + type: file + description: File containing software versions + pattern: 'versions.yml' + - fastq: + type: file + description: Unaligned FastQ files + pattern: '*.fastq.gz' + - log: + type: file + description: Alignment log + pattern: '*.log' + # TODO Add samtools outputs +authors: + - '@drpatelh' diff --git a/subworkflows/nf-core/align_bowtie2/nextflow.config b/subworkflows/nf-core/align_bowtie2/nextflow.config new file mode 100644 index 00000000..89994865 --- /dev/null +++ b/subworkflows/nf-core/align_bowtie2/nextflow.config @@ -0,0 +1,2 @@ +params.align_options = [:] +params.samtools_options = [:] diff --git a/subworkflows/nf-core/bam_sort_samtools/main.nf b/subworkflows/nf-core/bam_sort_samtools/main.nf new file mode 100644 index 00000000..c9be6a56 --- /dev/null +++ b/subworkflows/nf-core/bam_sort_samtools/main.nf @@ -0,0 +1,53 @@ +// +// Sort, index BAM file and run samtools stats, flagstat and idxstats +// + +params.sort_options = [:] +params.index_options = [:] +params.stats_options = [:] + +include { SAMTOOLS_SORT } from '../../../modules/samtools/sort/main' addParams( options: params.sort_options ) +include { SAMTOOLS_INDEX } from '../../../modules/samtools/index/main' addParams( options: params.index_options ) +include { BAM_STATS_SAMTOOLS } from '../bam_stats_samtools/main' addParams( options: params.stats_options ) + +workflow BAM_SORT_SAMTOOLS { + take: + ch_bam // channel: [ val(meta), [ bam ] ] + + main: + + ch_versions = Channel.empty() + + SAMTOOLS_SORT ( ch_bam ) + ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) + + SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ) + ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) + + SAMTOOLS_SORT.out.bam + .join(SAMTOOLS_INDEX.out.bai, by: [0], remainder: true) + .join(SAMTOOLS_INDEX.out.csi, by: [0], remainder: true) + .map { + meta, bam, bai, csi -> + if (bai) { + [ meta, bam, bai ] + } else { + [ meta, bam, csi ] + } + } + .set { ch_bam_bai } + + BAM_STATS_SAMTOOLS ( ch_bam_bai ) + ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) + + emit: + bam = SAMTOOLS_SORT.out.bam // channel: [ val(meta), [ bam ] ] + bai = SAMTOOLS_INDEX.out.bai // channel: [ val(meta), [ bai ] ] + csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), [ csi ] ] + + stats = BAM_STATS_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ] + flagstat = BAM_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ] + idxstats = BAM_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ] + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/bam_sort_samtools/meta.yml b/subworkflows/nf-core/bam_sort_samtools/meta.yml new file mode 100644 index 00000000..a0e3f30b --- /dev/null +++ b/subworkflows/nf-core/bam_sort_samtools/meta.yml @@ -0,0 +1,41 @@ +name: bam_sort_samtools +description: Sort SAM/BAM/CRAM file +keywords: + - sort + - bam + - sam + - cram +modules: + - samtools/sort + - samtools/index + - samtools/stats + - samtools/idxstats + - samtools/flagstat +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: '*.{bam,cram,sam}' +# TODO Update when we decide on a standard for subworkflow docs +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Sorted BAM/CRAM/SAM file + pattern: '*.{bam,cram,sam}' + - versions: + type: file + description: File containing software versions + pattern: 'versions.yml' +authors: + - '@drpatelh' + - '@ewels' diff --git a/subworkflows/nf-core/bam_sort_samtools/nextflow.config b/subworkflows/nf-core/bam_sort_samtools/nextflow.config new file mode 100644 index 00000000..2fd55747 --- /dev/null +++ b/subworkflows/nf-core/bam_sort_samtools/nextflow.config @@ -0,0 +1 @@ +params.options = [:] diff --git a/subworkflows/nf-core/bam_stats_samtools/main.nf b/subworkflows/nf-core/bam_stats_samtools/main.nf new file mode 100644 index 00000000..9276232c --- /dev/null +++ b/subworkflows/nf-core/bam_stats_samtools/main.nf @@ -0,0 +1,33 @@ +// +// Run SAMtools stats, flagstat and idxstats +// + +params.options = [:] + +include { SAMTOOLS_STATS } from '../../../modules/samtools/stats/main' addParams( options: params.options ) +include { SAMTOOLS_IDXSTATS } from '../../../modules/samtools/idxstats/main' addParams( options: params.options ) +include { SAMTOOLS_FLAGSTAT } from '../../../modules/samtools/flagstat/main' addParams( options: params.options ) + +workflow BAM_STATS_SAMTOOLS { + take: + ch_bam_bai // channel: [ val(meta), [ bam ], [bai/csi] ] + + main: + ch_versions = Channel.empty() + + SAMTOOLS_STATS ( ch_bam_bai ) + ch_versions = ch_versions.mix(SAMTOOLS_STATS.out.versions.first()) + + SAMTOOLS_FLAGSTAT ( ch_bam_bai ) + ch_versions = ch_versions.mix(SAMTOOLS_FLAGSTAT.out.versions.first()) + + SAMTOOLS_IDXSTATS ( ch_bam_bai ) + ch_versions = ch_versions.mix(SAMTOOLS_IDXSTATS.out.versions.first()) + + emit: + stats = SAMTOOLS_STATS.out.stats // channel: [ val(meta), [ stats ] ] + flagstat = SAMTOOLS_FLAGSTAT.out.flagstat // channel: [ val(meta), [ flagstat ] ] + idxstats = SAMTOOLS_IDXSTATS.out.idxstats // channel: [ val(meta), [ idxstats ] ] + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/bam_stats_samtools/meta.yml b/subworkflows/nf-core/bam_stats_samtools/meta.yml new file mode 100644 index 00000000..509c5c97 --- /dev/null +++ b/subworkflows/nf-core/bam_stats_samtools/meta.yml @@ -0,0 +1,43 @@ +name: samtools_stats +description: Produces comprehensive statistics from SAM/BAM/CRAM file +keywords: + - statistics + - counts + - bam + - sam + - cram +modules: + - samtools/stats + - samtools/idxstats + - samtools/flagstat +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: '*.{bam,cram,sam}' + - bai: + type: file + description: Index for BAM/CRAM/SAM file + pattern: '*.{bai,crai,sai}' +# TODO Update when we decide on a standard for subworkflow docs +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - stats: + type: file + description: File containing samtools stats output + pattern: '*.{stats}' + - versions: + type: file + description: File containing software versions + pattern: 'versions.yml' +authors: + - '@drpatelh' diff --git a/subworkflows/nf-core/bam_stats_samtools/nextflow.config b/subworkflows/nf-core/bam_stats_samtools/nextflow.config new file mode 100644 index 00000000..2fd55747 --- /dev/null +++ b/subworkflows/nf-core/bam_stats_samtools/nextflow.config @@ -0,0 +1 @@ +params.options = [:] diff --git a/tests/config/pytest_subworkflows.yml b/tests/config/pytest_subworkflows.yml new file mode 100644 index 00000000..a8ac84dc --- /dev/null +++ b/tests/config/pytest_subworkflows.yml @@ -0,0 +1,11 @@ +subworkflows/align_bowtie2: + - subworkflows/nf-core/align_bowtie2/** + - tests/subworkflows/nf-core/align_bowtie2/** + +subworkflows/bam_stats_samtools: + - subworkflows/nf-core/bam_stats_samtools/** + - tests/subworkflows/nf-core/bam_stats_samtools/** + +subworkflows/bam_sort_samtools: + - subworkflows/nf-core/bam_sort_samtools/** + - tests/subworkflows/nf-core/bam_sort_samtools/** diff --git a/tests/modules/samtools/sort/main.nf b/tests/modules/samtools/sort/main.nf index 91cd4d01..b76cdb1a 100644 --- a/tests/modules/samtools/sort/main.nf +++ b/tests/modules/samtools/sort/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_SORT } from '../../../../modules/samtools/sort/main.nf' addParams( options: [:] ) +include { SAMTOOLS_SORT } from '../../../../modules/samtools/sort/main.nf' addParams( options: ['suffix': '.sorted'] ) workflow test_samtools_sort { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/samtools/sort/test.yml b/tests/modules/samtools/sort/test.yml index 477574fe..12e6669f 100644 --- a/tests/modules/samtools/sort/test.yml +++ b/tests/modules/samtools/sort/test.yml @@ -4,5 +4,5 @@ - samtools - samtools/sort files: - - path: output/samtools/test.bam - md5sum: bdc2d9e3f579f84df1e242207b627f89 + - path: output/samtools/test.sorted.bam + md5sum: bbb2db225f140e69a4ac577f74ccc90f diff --git a/tests/subworkflows/nf-core/align_bowtie2/main.nf b/tests/subworkflows/nf-core/align_bowtie2/main.nf new file mode 100644 index 00000000..9870242d --- /dev/null +++ b/tests/subworkflows/nf-core/align_bowtie2/main.nf @@ -0,0 +1,27 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BOWTIE2_BUILD } from '../../../../modules/bowtie2/build/main.nf' addParams( options: [:] ) +include { ALIGN_BOWTIE2 } from '../../../../subworkflows/nf-core/align_bowtie2/main.nf' addParams( 'samtools_sort_options': ['suffix': '.sorted'] ) + +workflow test_align_bowtie2_single_end { + input = [ [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + BOWTIE2_BUILD ( fasta ) + ALIGN_BOWTIE2 ( input, BOWTIE2_BUILD.out.index ) +} + +workflow test_align_bowtie2_paired_end { + input = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + BOWTIE2_BUILD ( fasta ) + ALIGN_BOWTIE2 ( input, BOWTIE2_BUILD.out.index ) +} diff --git a/tests/subworkflows/nf-core/align_bowtie2/test.yml b/tests/subworkflows/nf-core/align_bowtie2/test.yml new file mode 100644 index 00000000..51261a14 --- /dev/null +++ b/tests/subworkflows/nf-core/align_bowtie2/test.yml @@ -0,0 +1,81 @@ +- name: align bowtie2 single-end + command: nextflow run ./tests/subworkflows/nf-core/align_bowtie2 -entry test_align_bowtie2_single_end -c tests/config/nextflow.config + tags: + - subworkflows/align_bowtie2 + - subworkflows/bam_sort_samtools + - subworkflows/bam_stats_samtools + # Modules + - bowtie2 + - bowtie2/align + - samtools + - samtools/index + - samtools/sort + - samtools/stats + - samtools/idxstats + - samtools/flagstat + files: + - path: ./output/bowtie2/test.bam + - path: ./output/bowtie2/test.bowtie2.log + - path: ./output/index/bowtie2/genome.1.bt2 + md5sum: cbe3d0bbea55bc57c99b4bfa25b5fbdf + - path: ./output/index/bowtie2/genome.2.bt2 + md5sum: 47b153cd1319abc88dda532462651fcf + - path: ./output/index/bowtie2/genome.3.bt2 + md5sum: 4ed93abba181d8dfab2e303e33114777 + - path: ./output/index/bowtie2/genome.4.bt2 + md5sum: c25be5f8b0378abf7a58c8a880b87626 + - path: ./output/index/bowtie2/genome.rev.1.bt2 + md5sum: 52be6950579598a990570fbcf5372184 + - path: ./output/index/bowtie2/genome.rev.2.bt2 + md5sum: e3b4ef343dea4dd571642010a7d09597 + # samtools sort + - path: ./output/samtools/test.sorted.bam + - path: ./output/samtools/test.sorted.bam.bai + # samtools stats + - path: ./output/samtools/test.sorted.bam.flagstat + md5sum: e9ce9093133116bc54fd335cfe698372 + - path: ./output/samtools/test.sorted.bam.idxstats + md5sum: e16eb632f7f462514b0873c7ac8ac905 + - path: ./output/samtools/test.sorted.bam.stats + md5sum: 2d837cd72432cd856fca70d33f02ffb5 + +- name: align bowtie2 paired-end + command: nextflow run ./tests/subworkflows/nf-core/align_bowtie2 -entry test_align_bowtie2_paired_end -c tests/config/nextflow.config + tags: + - subworkflows/align_bowtie2 + - subworkflows/bam_sort_samtools + - subworkflows/bam_stats_samtools + # Modules + - bowtie2 + - bowtie2/align + - samtools + - samtools/index + - samtools/sort + - samtools/stats + - samtools/idxstats + - samtools/flagstat + files: + - path: ./output/bowtie2/test.bam + - path: ./output/bowtie2/test.bowtie2.log + - path: ./output/index/bowtie2/genome.1.bt2 + md5sum: cbe3d0bbea55bc57c99b4bfa25b5fbdf + - path: ./output/index/bowtie2/genome.2.bt2 + md5sum: 47b153cd1319abc88dda532462651fcf + - path: ./output/index/bowtie2/genome.3.bt2 + md5sum: 4ed93abba181d8dfab2e303e33114777 + - path: ./output/index/bowtie2/genome.4.bt2 + md5sum: c25be5f8b0378abf7a58c8a880b87626 + - path: ./output/index/bowtie2/genome.rev.1.bt2 + md5sum: 52be6950579598a990570fbcf5372184 + - path: ./output/index/bowtie2/genome.rev.2.bt2 + md5sum: e3b4ef343dea4dd571642010a7d09597 + # samtools sort + - path: ./output/samtools/test.sorted.bam + - path: ./output/samtools/test.sorted.bam.bai + # samtools stats + - path: ./output/samtools/test.sorted.bam.flagstat + md5sum: 49f3d51a8804ce58fe9cecd2549d279b + - path: ./output/samtools/test.sorted.bam.idxstats + md5sum: 29ff2fa56d35b2a47625b8f517f1a947 + - path: ./output/samtools/test.sorted.bam.stats + md5sum: 98aa88a39d26244c89bd4e577953fb48 diff --git a/tests/subworkflows/nf-core/bam_sort_samtools/main.nf b/tests/subworkflows/nf-core/bam_sort_samtools/main.nf new file mode 100644 index 00000000..0dae6b2b --- /dev/null +++ b/tests/subworkflows/nf-core/bam_sort_samtools/main.nf @@ -0,0 +1,21 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BAM_SORT_SAMTOOLS } from '../../../../subworkflows/nf-core/bam_sort_samtools/main' addParams( sort_options: ['suffix': '.sorted'] ) + +workflow test_bam_sort_samtools_single_end { + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) + ] + + BAM_SORT_SAMTOOLS ( input ) +} + +workflow test_bam_sort_samtools_paired_end { + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + + BAM_SORT_SAMTOOLS ( input ) +} diff --git a/tests/subworkflows/nf-core/bam_sort_samtools/test.yml b/tests/subworkflows/nf-core/bam_sort_samtools/test.yml new file mode 100644 index 00000000..e2fc27d8 --- /dev/null +++ b/tests/subworkflows/nf-core/bam_sort_samtools/test.yml @@ -0,0 +1,47 @@ +- name: bam sort samtools single-end + command: nextflow run ./tests/subworkflows/nf-core/bam_sort_samtools -entry test_bam_sort_samtools_single_end -c tests/config/nextflow.config + tags: + - subworkflows/bam_sort_samtools + - subworkflows/bam_stats_samtools + # Modules + - samtools + - samtools/index + - samtools/sort + - samtools/stats + - samtools/idxstats + - samtools/flagstat + files: + - path: ./output/samtools/test.sorted.bam + md5sum: e4c77897d6824ce4df486d1b100618af + - path: ./output/samtools/test.sorted.bam.bai + md5sum: a70940ce9ba2e700ec2984e0a6526099 + # samtools stats + - path: ./output/samtools/test.sorted.bam.flagstat + md5sum: 2191911d72575a2358b08b1df64ccb53 + - path: ./output/samtools/test.sorted.bam.idxstats + md5sum: 613e048487662c694aa4a2f73ca96a20 + - path: ./output/samtools/test.sorted.bam.stats + +- name: bam sort samtools paired-end + command: nextflow run ./tests/subworkflows/nf-core/bam_sort_samtools -entry test_bam_sort_samtools_paired_end -c tests/config/nextflow.config + tags: + - subworkflows/bam_sort_samtools + - subworkflows/bam_stats_samtools + # Modules + - samtools + - samtools/index + - samtools/sort + - samtools/stats + - samtools/idxstats + - samtools/flagstat + files: + - path: ./output/samtools/test.sorted.bam + md5sum: bbb2db225f140e69a4ac577f74ccc90f + - path: ./output/samtools/test.sorted.bam.bai + md5sum: 20c91e3a0fd4661d7cb967f40d2486ba + # samtools stats + - path: ./output/samtools/test.sorted.bam.flagstat + md5sum: 4f7ffd1e6a5e85524d443209ac97d783 + - path: ./output/samtools/test.sorted.bam.idxstats + md5sum: df60a8c8d6621100d05178c93fb053a2 + - path: ./output/samtools/test.sorted.bam.stats diff --git a/tests/subworkflows/nf-core/bam_stats_samtools/main.nf b/tests/subworkflows/nf-core/bam_stats_samtools/main.nf new file mode 100644 index 00000000..a390c3eb --- /dev/null +++ b/tests/subworkflows/nf-core/bam_stats_samtools/main.nf @@ -0,0 +1,23 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BAM_STATS_SAMTOOLS } from '../../../../subworkflows/nf-core/bam_stats_samtools/main' addParams( options: [:] ) + +workflow test_bam_stats_samtools_single_end { + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam_bai'], checkIfExists: true) + ] + + BAM_STATS_SAMTOOLS ( input ) +} + +workflow test_bam_stats_samtools_paired_end { + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) + ] + + BAM_STATS_SAMTOOLS ( input ) +} diff --git a/tests/subworkflows/nf-core/bam_stats_samtools/test.yml b/tests/subworkflows/nf-core/bam_stats_samtools/test.yml new file mode 100644 index 00000000..d93c95a5 --- /dev/null +++ b/tests/subworkflows/nf-core/bam_stats_samtools/test.yml @@ -0,0 +1,31 @@ +- name: bam stats samtools single-end + command: nextflow run ./tests/subworkflows/nf-core/bam_stats_samtools -entry test_bam_stats_samtools_single_end -c tests/config/nextflow.config + tags: + - subworkflows/bam_stats_samtools + # Modules + - samtools + - samtools/stats + - samtools/idxstats + - samtools/flagstat + files: + - path: ./output/samtools/test.single_end.sorted.bam.flagstat + md5sum: 2191911d72575a2358b08b1df64ccb53 + - path: ./output/samtools/test.single_end.sorted.bam.idxstats + md5sum: 613e048487662c694aa4a2f73ca96a20 + - path: ./output/samtools/test.single_end.sorted.bam.stats + +- name: bam stats samtools paired-end + command: nextflow run ./tests/subworkflows/nf-core/bam_stats_samtools -entry test_bam_stats_samtools_paired_end -c tests/config/nextflow.config + tags: + - subworkflows/bam_stats_samtools + # Modules + - samtools + - samtools/stats + - samtools/idxstats + - samtools/flagstat + files: + - path: ./output/samtools/test.paired_end.sorted.bam.flagstat + md5sum: 4f7ffd1e6a5e85524d443209ac97d783 + - path: ./output/samtools/test.paired_end.sorted.bam.idxstats + md5sum: df60a8c8d6621100d05178c93fb053a2 + - path: ./output/samtools/test.paired_end.sorted.bam.stats diff --git a/tests/test_versions_yml.py b/tests/test_versions_yml.py index 759fc4d5..2f78ab2e 100644 --- a/tests/test_versions_yml.py +++ b/tests/test_versions_yml.py @@ -11,7 +11,7 @@ def _get_workflow_names(): To do so, recursively finds all test.yml files and parses their content. """ here = Path(__file__).parent.resolve() - pytest_workflow_files = here.glob("**/test.yml") + pytest_workflow_files = here.glob("modules/**/test.yml") for f in pytest_workflow_files: # test_config = yaml.safe_load(f.read_text()) test_config = yaml.load(f.read_text(), Loader=yaml.BaseLoader) From 07c0830057cc655de113d84499c7c1499460bb55 Mon Sep 17 00:00:00 2001 From: "Moritz E. Beber" Date: Mon, 11 Oct 2021 23:30:41 +0200 Subject: [PATCH 45/61] Add a module for sra-tools prefetch (#714) * chore: apply module template * refactor: add NCBI settings to options * docs: complete meta information * feat: add prefetch process * fix: correct bash commands * tests: define the right tests * style: move option definition to satisfy linting * fix: extract version correctly * fix: correct newline issues * refactor: address review comments * Apply suggestions from code review * chore: add retrying via nf-core label * refactor: validate download thoroughly * refactor: remove vdb-config input Co-authored-by: Harshil Patel --- modules/sratools/prefetch/functions.nf | 78 ++++++++++++++++++++++++ modules/sratools/prefetch/main.nf | 50 +++++++++++++++ modules/sratools/prefetch/meta.yml | 43 +++++++++++++ tests/config/pytest_modules.yml | 12 ++-- tests/modules/sratools/prefetch/main.nf | 15 +++++ tests/modules/sratools/prefetch/test.yml | 8 +++ 6 files changed, 202 insertions(+), 4 deletions(-) create mode 100644 modules/sratools/prefetch/functions.nf create mode 100644 modules/sratools/prefetch/main.nf create mode 100644 modules/sratools/prefetch/meta.yml create mode 100644 tests/modules/sratools/prefetch/main.nf create mode 100644 tests/modules/sratools/prefetch/test.yml diff --git a/modules/sratools/prefetch/functions.nf b/modules/sratools/prefetch/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/sratools/prefetch/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/sratools/prefetch/main.nf b/modules/sratools/prefetch/main.nf new file mode 100644 index 00000000..207d1e10 --- /dev/null +++ b/modules/sratools/prefetch/main.nf @@ -0,0 +1,50 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process SRATOOLS_PREFETCH { + tag "$id" + label 'process_low' + label 'error_retry' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? 'bioconda::sra-tools=2.11.0' : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container 'https://depot.galaxyproject.org/singularity/sra-tools:2.11.0--pl5262h314213e_0' + } else { + container 'quay.io/biocontainers/sra-tools:2.11.0--pl5262h314213e_0' + } + + input: + tuple val(meta), val(id) + + output: + tuple val(meta), path("$id"), emit: sra + path "versions.yml" , emit: versions + + script: + def config = "/LIBS/GUID = \"${UUID.randomUUID().toString()}\"\\n/libs/cloud/report_instance_identity = \"true\"\\n" + """ + eval "\$(vdb-config -o n NCBI_SETTINGS | sed 's/[" ]//g')" + if [[ ! -f "\${NCBI_SETTINGS}" ]]; then + mkdir -p "\$(dirname "\${NCBI_SETTINGS}")" + printf '${config}' > "\${NCBI_SETTINGS}" + fi + + prefetch \\ + $options.args \\ + --progress \\ + $id + + vdb-validate $id + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(prefetch --version 2>&1 | grep -Eo '[0-9.]+') + END_VERSIONS + """ +} diff --git a/modules/sratools/prefetch/meta.yml b/modules/sratools/prefetch/meta.yml new file mode 100644 index 00000000..ab0a5ce5 --- /dev/null +++ b/modules/sratools/prefetch/meta.yml @@ -0,0 +1,43 @@ +name: sratools_prefetch +description: Download sequencing data from the NCBI Sequence Read Archive (SRA). +keywords: + - sequencing + - fastq + - prefetch +tools: + - sratools: + description: SRA Toolkit and SDK from NCBI + homepage: https://github.com/ncbi/sra-tools + documentation: https://github.com/ncbi/sra-tools/wiki + tool_dev_url: https://github.com/ncbi/sra-tools + licence: ['Public Domain'] + +input: + - meta: + type: map + description: > + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - id: + type: val + description: > + A string denoting an SRA id. + +output: + - meta: + type: map + description: > + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - sra: + type: directory + description: > + Directory containing the ETL data for the given SRA id. + pattern: "*/*.sra" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@Midnighter" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 45a4d62c..34c37b0b 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -529,6 +529,10 @@ iqtree: - modules/iqtree/** - tests/modules/iqtree/** +ismapper: + - modules/ismapper/** + - tests/modules/ismapper/** + isoseq3/cluster: - modules/isoseq3/cluster/** - tests/modules/isoseq3/cluster/** @@ -537,10 +541,6 @@ isoseq3/refine: - modules/isoseq3/refine/** - tests/modules/isoseq3/refine/** -ismapper: - - modules/ismapper/** - - tests/modules/ismapper/** - ivar/consensus: - modules/ivar/consensus/** - tests/modules/ivar/consensus/** @@ -979,6 +979,10 @@ spatyper: - modules/spatyper/** - tests/modules/spatyper/** +sratools/prefetch: + - modules/sratools/prefetch/** + - tests/modules/sratools/prefetch/** + staphopiasccmec: - modules/staphopiasccmec/** - tests/modules/staphopiasccmec/** diff --git a/tests/modules/sratools/prefetch/main.nf b/tests/modules/sratools/prefetch/main.nf new file mode 100644 index 00000000..99439a7f --- /dev/null +++ b/tests/modules/sratools/prefetch/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SRATOOLS_PREFETCH } from '../../../../modules/sratools/prefetch/main.nf' addParams( options: [:] ) + +workflow test_sratools_prefetch { + + input = [ + [ id:'test', single_end:false ], // meta map + 'ERR2815334' + ] + + SRATOOLS_PREFETCH ( input ) +} diff --git a/tests/modules/sratools/prefetch/test.yml b/tests/modules/sratools/prefetch/test.yml new file mode 100644 index 00000000..c23db12a --- /dev/null +++ b/tests/modules/sratools/prefetch/test.yml @@ -0,0 +1,8 @@ +- name: sratools prefetch test_sratools_prefetch + command: nextflow run tests/modules/sratools/prefetch -entry test_sratools_prefetch -c tests/config/nextflow.config + tags: + - sratools/prefetch + - sratools + files: + - path: output/sratools/ERR2815334/ERR2815334.sra + md5sum: 9a98c7f6f4774b7ef94aa915b92a54ea From d0df4b03e35676d5a303027d813c94013c7e0286 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Tue, 12 Oct 2021 07:14:20 +0000 Subject: [PATCH 46/61] ci: Duplicate tests for subworkflows (#815) Causing an issue with only running the subworkflow tests and now the modules. Just for now, we can come back to this. --- .github/workflows/pytest-workflow.yml | 125 +++++++++++++++++++++++--- 1 file changed, 113 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pytest-workflow.yml b/.github/workflows/pytest-workflow.yml index 6f395409..5ece35b8 100644 --- a/.github/workflows/pytest-workflow.yml +++ b/.github/workflows/pytest-workflow.yml @@ -6,14 +6,12 @@ on: branches: [master] jobs: - changes: - name: Check for changes + ########### + # Modules # + ########### + module_changes: + name: Check for changes in the modules runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - filter: - ["tests/config/pytest_modules.yml", "tests/config/pytest_subworkflows.yml"] outputs: # Expose matched filters as job 'modules' output variable modules: ${{ steps.filter.outputs.changes }} @@ -23,19 +21,122 @@ jobs: - uses: dorny/paths-filter@v2 id: filter with: - filters: ${{ matrix.filter }} + filters: "tests/config/pytest_modules.yml" - test: + module_test: runs-on: ubuntu-20.04 name: ${{ matrix.tags }} ${{ matrix.profile }} ${{ matrix.nxf_version }} - needs: changes - if: needs.changes.outputs.modules != '[]' + needs: module_changes + if: needs.module_changes.outputs.modules != '[]' strategy: fail-fast: false matrix: nxf_version: ["21.04.0"] - tags: ["${{ fromJson(needs.changes.outputs.modules) }}"] + tags: ["${{ fromJson(needs.modules_changes.outputs.modules) }}"] + profile: ["docker", "singularity", "conda"] + env: + NXF_ANSI_LOG: false + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - name: Install Python dependencies + run: python -m pip install --upgrade pip pytest-workflow + + - uses: actions/cache@v2 + with: + path: /usr/local/bin/nextflow + key: ${{ runner.os }}-nextflow-${{ matrix.nxf_version }} + restore-keys: | + ${{ runner.os }}-nextflow- + + - name: Install Nextflow + env: + NXF_VER: ${{ matrix.nxf_version }} + CAPSULE_LOG: none + run: | + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ + + - name: Set up Singularity + if: matrix.profile == 'singularity' + uses: eWaterCycle/setup-singularity@v5 + with: + singularity-version: 3.7.1 + + - name: Setup miniconda + if: matrix.profile == 'conda' + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + channels: conda-forge,bioconda,defaults + python-version: ${{ matrix.python-version }} + + - name: Conda clean + if: matrix.profile == 'conda' + run: conda clean -a + + # Test the module + - name: Run pytest-workflow + # only use one thread for pytest-workflow to avoid race condition on conda cache. + run: NF_CORE_MODULES_TEST=1 TMPDIR=~ PROFILE=${{ matrix.profile }} pytest --tag ${{ matrix.tags }} --symlink --kwdof + + - name: Upload logs on failure + if: failure() + uses: actions/upload-artifact@v2 + with: + name: logs-${{ matrix.profile }}-${{ matrix.nxf_version }} + path: | + /home/runner/pytest_workflow_*/*/.nextflow.log + /home/runner/pytest_workflow_*/*/log.out + /home/runner/pytest_workflow_*/*/log.err + /home/runner/pytest_workflow_*/*/work + + ################ + # Subworkflows # + ################ + subworkflow_changes: + name: Check for changes in the subworkflows + runs-on: ubuntu-latest + outputs: + # Expose matched filters as job 'subworkflows' output variable + subworkflows: ${{ steps.filter.outputs.changes }} + steps: + - uses: actions/checkout@v2 + + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: "tests/config/pytest_subworkflows.yml" + + subworkflow_test: + runs-on: ubuntu-20.04 + + name: ${{ matrix.tags }} ${{ matrix.profile }} ${{ matrix.nxf_version }} + needs: subworkflow_changes + if: needs.subworkflow_changes.outputs.subworkflows != '[]' + strategy: + fail-fast: false + matrix: + nxf_version: ["21.04.0"] + tags: ["${{ fromJson(needs.subworkflow_changes.outputs.subworkflows) }}"] profile: ["docker", "singularity", "conda"] env: NXF_ANSI_LOG: false From 194e598a34bf8fc651be61f354c02e286d7f03a7 Mon Sep 17 00:00:00 2001 From: "Moritz E. Beber" Date: Tue, 12 Oct 2021 12:58:19 +0200 Subject: [PATCH 47/61] Fix workflow (#817) * tests: fix tags definition * fix: correct typo --- .github/workflows/pytest-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest-workflow.yml b/.github/workflows/pytest-workflow.yml index 5ece35b8..0b509527 100644 --- a/.github/workflows/pytest-workflow.yml +++ b/.github/workflows/pytest-workflow.yml @@ -33,7 +33,7 @@ jobs: fail-fast: false matrix: nxf_version: ["21.04.0"] - tags: ["${{ fromJson(needs.modules_changes.outputs.modules) }}"] + tags: ${{ fromJson(needs.module_changes.outputs.modules) }} profile: ["docker", "singularity", "conda"] env: NXF_ANSI_LOG: false @@ -136,7 +136,7 @@ jobs: fail-fast: false matrix: nxf_version: ["21.04.0"] - tags: ["${{ fromJson(needs.subworkflow_changes.outputs.subworkflows) }}"] + tags: ${{ fromJson(needs.subworkflow_changes.outputs.subworkflows) }} profile: ["docker", "singularity", "conda"] env: NXF_ANSI_LOG: false From 3a4935d21ba2301fb9f322a0497f663ba447c446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Guizard?= Date: Tue, 12 Oct 2021 13:43:08 +0100 Subject: [PATCH 48/61] New module: `bamtools/split` (#798) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ“¦ NEW: Add galgal6 chr30 test data * πŸ“¦ NEW: Add bamtools module * πŸ‘Œ IMPROVE: Ignore test data * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ“¦ NEW: Add galgal6 chr30 test data * πŸ“¦ NEW: Add bamtools module * πŸ‘Œ IMPROVE: Ignore test data * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Update with new versions.yml file * πŸ› FIX: Update meta.yml + correct typos * Update modules/bamtools/split/meta.yml Add bam, split, chunk tags Co-authored-by: James A. Fellows Yates * πŸ› FIX: Correct meta.yml Co-authored-by: James A. Fellows Yates --- modules/bamtools/split/functions.nf | 78 +++++++++++++++++++++++++++ modules/bamtools/split/main.nf | 41 ++++++++++++++ modules/bamtools/split/meta.yml | 45 ++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/bamtools/split/main.nf | 14 +++++ tests/modules/bamtools/split/test.yml | 10 ++++ 6 files changed, 192 insertions(+) create mode 100644 modules/bamtools/split/functions.nf create mode 100644 modules/bamtools/split/main.nf create mode 100644 modules/bamtools/split/meta.yml create mode 100644 tests/modules/bamtools/split/main.nf create mode 100644 tests/modules/bamtools/split/test.yml diff --git a/modules/bamtools/split/functions.nf b/modules/bamtools/split/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/bamtools/split/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/bamtools/split/main.nf b/modules/bamtools/split/main.nf new file mode 100644 index 00000000..506a957c --- /dev/null +++ b/modules/bamtools/split/main.nf @@ -0,0 +1,41 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process BAMTOOLS_SPLIT { + tag "$meta.id" + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::bamtools=2.5.1" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/bamtools:2.5.1--h9a82719_9" + } else { + container "quay.io/biocontainers/bamtools:2.5.1--h9a82719_9" + } + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.bam"), emit: bam + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + """ + bamtools \\ + split \\ + -in $bam \\ + $options.args + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + bamtools: \$( bamtools --version | grep -e 'bamtools' | sed 's/^.*bamtools //' ) + END_VERSIONS + """ +} diff --git a/modules/bamtools/split/meta.yml b/modules/bamtools/split/meta.yml new file mode 100644 index 00000000..b9b52f59 --- /dev/null +++ b/modules/bamtools/split/meta.yml @@ -0,0 +1,45 @@ +name: bamtools_split +description: BamTools provides both a programmer's API and an end-user's toolkit for handling BAM files. +keywords: + - bamtools + - bamtools/split + - bam + - split + - chunk +tools: + - bamtools: + description: C++ API & command-line toolkit for working with BAM data + homepage: http://github.com/pezmaster31/bamtools + documentation: https://github.com/pezmaster31/bamtools/wiki + tool_dev_url: http://github.com/pezmaster31/bamtools + doi: "" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: A BAM file to split + pattern: "*.bam" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bam: + type: file + description: Several Bam files + pattern: "*.bam" + +authors: + - "@sguizard" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 34c37b0b..cd51b86b 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -34,6 +34,10 @@ bamaligncleaner: - modules/bamaligncleaner/** - tests/modules/bamaligncleaner/** +bamtools/split: + - modules/bamtools/split/** + - tests/modules/bamtools/split/** + bandage/image: - modules/bandage/image/** - tests/modules/bandage/image/** diff --git a/tests/modules/bamtools/split/main.nf b/tests/modules/bamtools/split/main.nf new file mode 100644 index 00000000..5538c86f --- /dev/null +++ b/tests/modules/bamtools/split/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BAMTOOLS_SPLIT } from '../../../../modules/bamtools/split/main.nf' addParams( options: [args:"-reference"] ) + +workflow test_bamtools_split { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + + BAMTOOLS_SPLIT ( input ) +} diff --git a/tests/modules/bamtools/split/test.yml b/tests/modules/bamtools/split/test.yml new file mode 100644 index 00000000..f92f9345 --- /dev/null +++ b/tests/modules/bamtools/split/test.yml @@ -0,0 +1,10 @@ +- name: bamtools split test_bamtools_split + command: nextflow run tests/modules/bamtools/split -entry test_bamtools_split -c tests/config/nextflow.config + tags: + - bamtools + - bamtools/split + files: + - path: output/bamtools/test.paired_end.sorted.REF_chr22:16570000-16610000.bam + md5sum: 256535b9a3ab5864be0f7dea2218d159 + - path: output/bamtools/test.paired_end.sorted.REF_unmapped.bam + md5sum: 568e058d871d8bc319330360bcae4e43 From de997825de788fe2210db16d9426f10342a1ba1d Mon Sep 17 00:00:00 2001 From: "Moritz E. Beber" Date: Tue, 12 Oct 2021 15:20:58 +0200 Subject: [PATCH 49/61] Add a new module for fasterq-dump (#807) * chore: use template to create fasterq module * feat: add fasterq-dump process module * docs: provide input and output descriptions * docs: add comment on `--temp` * fix: use correct variable * tests: define test output * refactor: address review comments * refactor: remove vdb-config input * chore: add new test data to config * tests: define single-end and paired-end cases * refactor: choose specific output * tests: do not expect single FASTQ for paired-end * feat: add compression * Apply suggestions from code review Co-authored-by: Harshil Patel * tests: revert the test data name * Apply suggestions from code review Co-authored-by: Harshil Patel --- modules/sratools/fasterqdump/functions.nf | 78 +++++++++++++++++++++ modules/sratools/fasterqdump/main.nf | 58 +++++++++++++++ modules/sratools/fasterqdump/meta.yml | 42 +++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/config/test_data.config | 7 +- tests/modules/sratools/fasterqdump/main.nf | 28 ++++++++ tests/modules/sratools/fasterqdump/test.yml | 23 ++++++ 7 files changed, 238 insertions(+), 2 deletions(-) create mode 100644 modules/sratools/fasterqdump/functions.nf create mode 100644 modules/sratools/fasterqdump/main.nf create mode 100644 modules/sratools/fasterqdump/meta.yml create mode 100644 tests/modules/sratools/fasterqdump/main.nf create mode 100644 tests/modules/sratools/fasterqdump/test.yml diff --git a/modules/sratools/fasterqdump/functions.nf b/modules/sratools/fasterqdump/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/sratools/fasterqdump/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/sratools/fasterqdump/main.nf b/modules/sratools/fasterqdump/main.nf new file mode 100644 index 00000000..08ef9045 --- /dev/null +++ b/modules/sratools/fasterqdump/main.nf @@ -0,0 +1,58 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process SRATOOLS_FASTERQDUMP { + tag "$meta.id" + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? 'bioconda::sra-tools=2.11.0 conda-forge::pigz=2.6' : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container 'https://depot.galaxyproject.org/singularity/mulled-v2-5f89fe0cd045cb1d615630b9261a1d17943a9b6a:6a9ff0e76ec016c3d0d27e0c0d362339f2d787e6-0' + } else { + container 'quay.io/biocontainers/mulled-v2-5f89fe0cd045cb1d615630b9261a1d17943a9b6a:6a9ff0e76ec016c3d0d27e0c0d362339f2d787e6-0' + } + + input: + tuple val(meta), path(sra) + + output: + tuple val(meta), path(output), emit: reads + path "versions.yml" , emit: versions + + script: + def config = "/LIBS/GUID = \"${UUID.randomUUID().toString()}\"\\n/libs/cloud/report_instance_identity = \"true\"\\n" + // Paired-end data extracted by fasterq-dump (--split-3 the default) always creates + // *_1.fastq *_2.fastq files but sometimes also an additional *.fastq file + // for unpaired reads which we ignore here. + output = meta.single_end ? '*.fastq.gz' : '*_{1,2}.fastq.gz' + """ + eval "\$(vdb-config -o n NCBI_SETTINGS | sed 's/[" ]//g')" + if [[ ! -f "\${NCBI_SETTINGS}" ]]; then + mkdir -p "\$(dirname "\${NCBI_SETTINGS}")" + printf '${config}' > "\${NCBI_SETTINGS}" + fi + + fasterq-dump \\ + ${options.args} \\ + --threads $task.cpus \\ + ${sra.name} + + pigz \\ + ${options.args2} \\ + --no-name \\ + --processes $task.cpus \\ + *.fastq + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(fasterq-dump --version 2>&1 | grep -Eo '[0-9.]+') + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) + END_VERSIONS + """ +} diff --git a/modules/sratools/fasterqdump/meta.yml b/modules/sratools/fasterqdump/meta.yml new file mode 100644 index 00000000..ac61e71f --- /dev/null +++ b/modules/sratools/fasterqdump/meta.yml @@ -0,0 +1,42 @@ +name: sratools_fasterqdump +description: Extract sequencing reads in FASTQ format from a given NCBI Sequence Read Archive (SRA). +keywords: + - sequencing + - FASTQ + - dump +tools: + - sratools: + description: SRA Toolkit and SDK from NCBI + homepage: https://github.com/ncbi/sra-tools + documentation: https://github.com/ncbi/sra-tools/wiki + tool_dev_url: https://github.com/ncbi/sra-tools + licence: ['Public Domain'] + +input: + - meta: + type: map + description: > + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - sra: + type: directory + description: Directory containing ETL data for the given SRA. + pattern: "*/*.sra" + +output: + - meta: + type: map + description: > + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - reads: + type: file + description: Extracted FASTQ file or files if the sequencing reads are paired-end. + pattern: "*.fastq.gz" + +authors: + - "@Midnighter" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index cd51b86b..e1fba94c 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -987,6 +987,10 @@ sratools/prefetch: - modules/sratools/prefetch/** - tests/modules/sratools/prefetch/** +sratools/fasterqdump: + - modules/sratools/fasterqdump/** + - tests/modules/sratools/fasterqdump/** + staphopiasccmec: - modules/staphopiasccmec/** - tests/modules/staphopiasccmec/** diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 30e6f1ea..b4443e9f 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -80,6 +80,9 @@ params { assembly_gfa = "${test_data_dir}/genomics/sarscov2/illumina/gfa/assembly.gfa" test_single_end_bam_readlist_txt = "${test_data_dir}/genomics/sarscov2/illumina/picard/test.single_end.bam.readlist.txt" + + SRR13255544_tar_gz = "${test_data_dir}/genomics/sarscov2/illumina/sra/SRR13255544.tar.gz" + SRR11140744_tar_gz = "${test_data_dir}/genomics/sarscov2/illumina/sra/SRR11140744.tar.gz" } 'nanopore' { test_sorted_bam = "${test_data_dir}/genomics/sarscov2/nanopore/bam/test.sorted.bam" @@ -155,11 +158,11 @@ params { test2_baserecalibrator_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test2.baserecalibrator.table" test_pileups_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test.pileups.table" test2_pileups_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test2.pileups.table" - + test_test2_paired_mutect2_calls_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz" test_test2_paired_mutect2_calls_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi" test_test2_paired_mutect2_calls_vcf_gz_stats = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.stats" - test_test2_paired_mutect2_calls_f1r2_tar_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.f1r2.tar.gz" + test_test2_paired_mutect2_calls_f1r2_tar_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.f1r2.tar.gz" test_test2_paired_mutect2_calls_artifact_prior_tar_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test_test2_paired_mutect2_calls.artifact-prior.tar.gz" test_test2_paired_segmentation_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test_test2_paired.segmentation.table" test_test2_paired_contamination_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test_test2_paired.contamination.table" diff --git a/tests/modules/sratools/fasterqdump/main.nf b/tests/modules/sratools/fasterqdump/main.nf new file mode 100644 index 00000000..1a0e0c7a --- /dev/null +++ b/tests/modules/sratools/fasterqdump/main.nf @@ -0,0 +1,28 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UNTAR } from '../../../../modules/untar/main.nf' +include { SRATOOLS_FASTERQDUMP } from '../../../../modules/sratools/fasterqdump/main.nf' addParams( options: [:] ) + +workflow test_sratools_fasterqdump_single_end { + + archive = file(params.test_data['sarscov2']['illumina']['SRR13255544_tar_gz'], checkIfExists: true) + UNTAR ( archive ) + + def input = Channel.of([ id:'test_single_end', single_end:true ]) + .combine(UNTAR.out.untar) + + SRATOOLS_FASTERQDUMP ( input ) +} + +workflow test_sratools_fasterqdump_paired_end { + + archive = file(params.test_data['sarscov2']['illumina']['SRR11140744_tar_gz'], checkIfExists: true) + UNTAR ( archive ) + + def input = Channel.of([ id:'test_paired_end', single_end:false ]) + .combine(UNTAR.out.untar) + + SRATOOLS_FASTERQDUMP ( input ) +} diff --git a/tests/modules/sratools/fasterqdump/test.yml b/tests/modules/sratools/fasterqdump/test.yml new file mode 100644 index 00000000..94da4ed8 --- /dev/null +++ b/tests/modules/sratools/fasterqdump/test.yml @@ -0,0 +1,23 @@ +- name: sratools fasterqdump test_sratools_fasterqdump_single_end + command: nextflow run tests/modules/sratools/fasterqdump -entry test_sratools_fasterqdump_single_end -c tests/config/nextflow.config + tags: + - sratools + - sratools/fasterqdump + files: + - path: output/sratools/SRR13255544.fastq.gz + md5sum: 1054c7b71884acdb5eed8a378f18be82 + - path: output/untar/SRR13255544/SRR13255544.sra + md5sum: 466d05dafb2eec672150754168010b4d + +- name: sratools fasterqdump test_sratools_fasterqdump_paired_end + command: nextflow run tests/modules/sratools/fasterqdump -entry test_sratools_fasterqdump_paired_end -c tests/config/nextflow.config + tags: + - sratools + - sratools/fasterqdump + files: + - path: output/sratools/SRR11140744_1.fastq.gz + md5sum: 193809c784a4ea132ab2a253fa4f55b6 + - path: output/sratools/SRR11140744_2.fastq.gz + md5sum: 3e3b3af3413f50a1685fd7b3f1456d4e + - path: output/untar/SRR11140744/SRR11140744.sra + md5sum: 065666caf5b2d5dfb0cb25d5f3abe659 From 359f721cc957e484b62b6ce11e91456f4bbce084 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Tue, 12 Oct 2021 17:06:06 +0200 Subject: [PATCH 50/61] Add MEGAHIT (#810) * Specify more guidelines on input channels * Linting * Updates based on code review * Update README.md * Fix broken sentence * feat: add megahit module, currently decompressed output * Update main.nf * Update tests/modules/megahit/test.yml Co-authored-by: Maxime Borry * Apply suggestions from code review Co-authored-by: Harshil Patel * feat: compress all outputs, remove md5sums due to gz stochasicity * fix: wrong conda channel for pigz * fix: broken singleend tests and update meta.yml * Missed one * Apply suggestions from code review Co-authored-by: Harshil Patel * fix: pigz formatting * Apply suggestions from code review Co-authored-by: Harshil Patel * Apply suggestions from code review Co-authored-by: Harshil Patel Co-authored-by: Maxime Borry --- modules/megahit/functions.nf | 78 +++++++++++++++++++++++++++++++++ modules/megahit/main.nf | 76 ++++++++++++++++++++++++++++++++ modules/megahit/meta.yml | 62 ++++++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/megahit/main.nf | 28 ++++++++++++ tests/modules/megahit/test.yml | 71 ++++++++++++++++++++++++++++++ 6 files changed, 319 insertions(+) create mode 100644 modules/megahit/functions.nf create mode 100644 modules/megahit/main.nf create mode 100644 modules/megahit/meta.yml create mode 100644 tests/modules/megahit/main.nf create mode 100644 tests/modules/megahit/test.yml diff --git a/modules/megahit/functions.nf b/modules/megahit/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/megahit/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/megahit/main.nf b/modules/megahit/main.nf new file mode 100644 index 00000000..8c8a5555 --- /dev/null +++ b/modules/megahit/main.nf @@ -0,0 +1,76 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process MEGAHIT { + tag "$meta.id" + label 'process_high' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::megahit=1.2.9 conda-forge::pigz=2.6" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/mulled-v2-0f92c152b180c7cd39d9b0e6822f8c89ccb59c99:8ec213d21e5d03f9db54898a2baeaf8ec729b447-0" + } else { + container "quay.io/biocontainers/mulled-v2-0f92c152b180c7cd39d9b0e6822f8c89ccb59c99:8ec213d21e5d03f9db54898a2baeaf8ec729b447-0" + } + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("megahit_out/*.contigs.fa.gz") , emit: contigs + tuple val(meta), path("megahit_out/intermediate_contigs/k*.contigs.fa.gz") , emit: k_contigs + tuple val(meta), path("megahit_out/intermediate_contigs/k*.addi.fa.gz") , emit: addi_contigs + tuple val(meta), path("megahit_out/intermediate_contigs/k*.local.fa.gz") , emit: local_contigs + tuple val(meta), path("megahit_out/intermediate_contigs/k*.final.contigs.fa.gz"), emit: kfinal_contigs + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + if (meta.single_end) { + """ + megahit \\ + -r ${reads} \\ + -t $task.cpus \\ + $options.args \\ + --out-prefix $prefix + + pigz \\ + --no-name \\ + -p $task.cpus \\ + $options.args2 \\ + megahit_out/*.fa \\ + megahit_out/intermediate_contigs/*.fa + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(megahit -v 2>&1) | sed 's/MEGAHIT v//') + END_VERSIONS + """ + } else { + """ + megahit \\ + -1 ${reads[0]} \\ + -2 ${reads[1]} \\ + -t $task.cpus \\ + $options.args \\ + --out-prefix $prefix + + pigz \\ + --no-name \\ + -p $task.cpus \\ + $options.args2 \\ + megahit_out/*.fa \\ + megahit_out/intermediate_contigs/*.fa + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(megahit -v 2>&1) | sed 's/MEGAHIT v//') + END_VERSIONS + """ + } +} diff --git a/modules/megahit/meta.yml b/modules/megahit/meta.yml new file mode 100644 index 00000000..e4b2181b --- /dev/null +++ b/modules/megahit/meta.yml @@ -0,0 +1,62 @@ +name: megahit +description: An ultra-fast metagenomic assembler for large and complex metagenomics +keywords: + - megahit + - denovo + - assembly + - debruijn + - metagenomics +tools: + - megahit: + description: "An ultra-fast single-node solution for large and complex metagenomics assembly via succinct de Bruijn graph" + homepage: https://github.com/voutcn/megahit + documentation: https://github.com/voutcn/megahit + tool_dev_url: https://github.com/voutcn/megahit + doi: "10.1093/bioinformatics/btv033" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information and input single, or paired-end FASTA/FASTQ files (optionally decompressed) + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively in gzipped or uncompressed FASTQ or FASTA format. + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - contigs: + type: file + description: Final final contigs result of the assembly in FASTA format. + pattern: "*.contigs.fa.gz" + - k_contigs: + type: file + description: Contigs assembled from the de Bruijn graph of order-K + pattern: "k*.contigs.fa.gz" + - addi_contigs: + type: file + description: Contigs assembled after iteratively removing local low coverage unitigs in the de Bruijn graph of order-K + pattern: "k*.addi.fa.gz" + - local_contigs: + type: file + description: Contigs of the locally assembled contigs for k=K + pattern: "k*.local.fa.gz" + - kfinal_contigs: + type: file + description: Stand-alone contigs for k=K; if local assembly is turned on, the file will be empty + pattern: "k*.final.contigs.fa.gz" + +authors: + - "@jfy133" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index e1fba94c..decce4be 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -650,6 +650,10 @@ mashtree: - modules/mashtree/** - tests/modules/mashtree/** +megahit: + - modules/megahit/** + - tests/modules/megahit/** + metaphlan3: - modules/metaphlan3/** - tests/modules/metaphlan3/** diff --git a/tests/modules/megahit/main.nf b/tests/modules/megahit/main.nf new file mode 100644 index 00000000..dcf07cd6 --- /dev/null +++ b/tests/modules/megahit/main.nf @@ -0,0 +1,28 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MEGAHIT } from '../../../modules/megahit/main.nf' addParams( options: [:] ) + +workflow test_megahit { + + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + ] + ] + + MEGAHIT ( input ) +} + +workflow test_megahit_single { + + input = [ + [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + + MEGAHIT ( input ) +} diff --git a/tests/modules/megahit/test.yml b/tests/modules/megahit/test.yml new file mode 100644 index 00000000..c390891b --- /dev/null +++ b/tests/modules/megahit/test.yml @@ -0,0 +1,71 @@ +- name: megahit + command: nextflow run ./tests/modules/megahit -entry test_megahit -c tests/config/nextflow.config -process.cpus 1 + tags: + - megahit + files: + - path: output/megahit/megahit_out/test.contigs.fa.gz + md5sum: 8ed114f22130e16df3532d3f6b03e116 + - path: output/megahit/megahit_out/intermediate_contigs/k21.addi.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k21.contigs.fa.gz + md5sum: 4221d45f238045bbdb1eea04e4ce4261 + - path: output/megahit/megahit_out/intermediate_contigs/k21.final.contigs.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k21.local.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k29.addi.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k29.contigs.fa.gz + md5sum: c72aeb242788542af0260098b4d61204 + - path: output/megahit/megahit_out/intermediate_contigs/k29.final.contigs.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k29.local.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k39.addi.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k39.contigs.fa.gz + md5sum: aa188f4c92e69c1a4b396e8f2991236f + - path: output/megahit/megahit_out/intermediate_contigs/k39.final.contigs.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k39.local.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + +- name: megahit_single + command: nextflow run ./tests/modules/megahit -entry test_megahit_single -c tests/config/nextflow.config -process.cpus 1 + tags: + - megahit + files: + - path: output/megahit/megahit_out/test.contigs.fa.gz + md5sum: f50352838b778cc67824f631197a8346 + - path: output/megahit/megahit_out/intermediate_contigs/k21.addi.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k21.contigs.fa.gz + md5sum: 61554dc60ba8e95d9c1d9dca8d465bef + - path: output/megahit/megahit_out/intermediate_contigs/k21.final.contigs.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k21.local.fa.gz + md5sum: b916fc620fdf0d23ef33485352c168b3 + - path: output/megahit/megahit_out/intermediate_contigs/k29.addi.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k29.contigs.fa.gz + md5sum: d916bc564854aa0fabaa5234035aa47b + - path: output/megahit/megahit_out/intermediate_contigs/k29.final.contigs.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k29.local.fa.gz + md5sum: cccf44441e65913b02fb64eb0835dcc1 + - path: output/megahit/megahit_out/intermediate_contigs/k39.addi.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k39.contigs.fa.gz + md5sum: 4416a9e846ccbeb06b880ac2fdc02925 + - path: output/megahit/megahit_out/intermediate_contigs/k39.final.contigs.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k39.local.fa.gz + md5sum: 590d0a08285226d24f7f984f7b3b4f65 + - path: output/megahit/megahit_out/intermediate_contigs/k59.addi.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k59.contigs.fa.gz + md5sum: 51ef726b87a53b0cbdde762d7973a8a7 + - path: output/megahit/megahit_out/intermediate_contigs/k59.final.contigs.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/megahit/megahit_out/intermediate_contigs/k59.local.fa.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a From 7b1e84f7be7cd662c0e149f04f49c4cc49288c55 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Wed, 13 Oct 2021 10:40:04 +0200 Subject: [PATCH 51/61] Add bcftools/index (#812) * feat: add bcftools index * Extend tests to also test gen for TBI * Update meta.yml * Update meta.yml --- modules/bcftools/index/functions.nf | 78 +++++++++++++++++++++++++++ modules/bcftools/index/main.nf | 44 +++++++++++++++ modules/bcftools/index/meta.yml | 49 +++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/bcftools/index/main.nf | 23 ++++++++ tests/modules/bcftools/index/test.yml | 17 ++++++ 6 files changed, 215 insertions(+) create mode 100644 modules/bcftools/index/functions.nf create mode 100644 modules/bcftools/index/main.nf create mode 100644 modules/bcftools/index/meta.yml create mode 100644 tests/modules/bcftools/index/main.nf create mode 100644 tests/modules/bcftools/index/test.yml diff --git a/modules/bcftools/index/functions.nf b/modules/bcftools/index/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/bcftools/index/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/bcftools/index/main.nf b/modules/bcftools/index/main.nf new file mode 100644 index 00000000..d67614d8 --- /dev/null +++ b/modules/bcftools/index/main.nf @@ -0,0 +1,44 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process BCFTOOLS_INDEX { + tag "$meta.id" + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? 'bioconda::bcftools=1.13' : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0" + } else { + container "quay.io/biocontainers/bcftools:1.13--h3a49de5_0" + } + + input: + tuple val(meta), path(vcf) + + output: + tuple val(meta), path("*.csi"), optional:true, emit: csi + tuple val(meta), path("*.tbi"), optional:true, emit: tbi + path "versions.yml" , emit: version + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + + """ + bcftools \\ + index \\ + $options.args \\ + --threads $task.cpus \\ + $vcf + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/bcftools/index/meta.yml b/modules/bcftools/index/meta.yml new file mode 100644 index 00000000..6fc7df17 --- /dev/null +++ b/modules/bcftools/index/meta.yml @@ -0,0 +1,49 @@ +name: bcftools_index +description: Index VCF tools +keywords: + - vcf + - index + - bcftools + - csi + - tbi +tools: + - bcftools: + description: BCFtools is a set of utilities that manipulate variant calls in the Variant Call Format (VCF) and its binary counterpart BCF. All commands work transparently with both VCFs and BCFs, both uncompressed and BGZF-compressed. Most commands accept VCF, bgzipped VCF and BCF with filetype detected automatically even when streaming from a pipe. Indexed VCF and BCF will work in all situations. Un-indexed VCF and BCF and streams will work in most, but not all situations. + homepage: https://samtools.github.io/bcftools/ + documentation: https://samtools.github.io/bcftools/howtos/index.html + tool_dev_url: https://github.com/samtools/bcftools + doi: "10.1093/gigascience/giab008" + licence: ['GPL'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - VCF: + type: file + description: VCF file (optionally GZIPPED) + pattern: "*.{vcf,vcf.gz}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - version: + type: file + description: File containing software version + pattern: "versions.yml" + - csi: + type: file + description: Default VCF file index file + pattern: "*.csi" + - tbi: + type: file + description: Alternative VCF file index file for larger files (activated with -t parameter) + pattern: "*.tbi" + +authors: + - "@jfy133" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index decce4be..747efd3a 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -70,6 +70,10 @@ bcftools/filter: - modules/bcftools/filter/** - tests/modules/bcftools/filter/** +bcftools/index: + - modules/bcftools/index/** + - tests/modules/bcftools/index** + bcftools/isec: - modules/bcftools/isec/** - tests/modules/bcftools/isec/** diff --git a/tests/modules/bcftools/index/main.nf b/tests/modules/bcftools/index/main.nf new file mode 100644 index 00000000..73909d66 --- /dev/null +++ b/tests/modules/bcftools/index/main.nf @@ -0,0 +1,23 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BCFTOOLS_INDEX as BCFTOOLS_INDEX_CSI } from '../../../../modules/bcftools/index/main.nf' addParams( options: [:] ) +include { BCFTOOLS_INDEX as BCFTOOLS_INDEX_TBI } from '../../../../modules/bcftools/index/main.nf' addParams( options: [args: '-t'] ) + + +workflow test_bcftools_index_csi { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + + BCFTOOLS_INDEX_CSI ( input ) +} + +workflow test_bcftools_index_tbi { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + + BCFTOOLS_INDEX_TBI ( input ) +} diff --git a/tests/modules/bcftools/index/test.yml b/tests/modules/bcftools/index/test.yml new file mode 100644 index 00000000..36c5f3c0 --- /dev/null +++ b/tests/modules/bcftools/index/test.yml @@ -0,0 +1,17 @@ +- name: bcftools index + command: nextflow run ./tests/modules/bcftools/index -entry test_bcftools_index_csi -c tests/config/nextflow.config + tags: + - bcftools + - bcftools/index + files: + - path: output/bcftools/test.vcf.gz.csi + md5sum: 5f930522d2b9dcdba2807b7da4dfa3fd + +- name: bcftools index tbi + command: nextflow run ./tests/modules/bcftools/index -entry test_bcftools_index_tbi -c tests/config/nextflow.config + tags: + - bcftools + - bcftools/index + files: + - path: output/bcftools/test.vcf.gz.tbi + md5sum: 36e11bf96ed0af4a92caa91a68612d64 From d1794d19346dcbc0812e97c1e7b5516d19b88d12 Mon Sep 17 00:00:00 2001 From: Mei Wu Date: Wed, 13 Oct 2021 12:59:35 +0200 Subject: [PATCH 52/61] Add TIDDIT cov (#822) * added template for tiddit/cov * test finished * quick fix to meta info * Apply suggestions from code review Co-authored-by: James A. Fellows Yates * applying suggestions Co-authored-by: James A. Fellows Yates Co-authored-by: James A. Fellows Yates --- modules/tiddit/cov/functions.nf | 78 +++++++++++++++++++++++++++++++ modules/tiddit/cov/main.nf | 49 +++++++++++++++++++ modules/tiddit/cov/meta.yml | 52 +++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/tiddit/cov/main.nf | 23 +++++++++ tests/modules/tiddit/cov/test.yml | 17 +++++++ 6 files changed, 223 insertions(+) create mode 100644 modules/tiddit/cov/functions.nf create mode 100644 modules/tiddit/cov/main.nf create mode 100644 modules/tiddit/cov/meta.yml create mode 100644 tests/modules/tiddit/cov/main.nf create mode 100644 tests/modules/tiddit/cov/test.yml diff --git a/modules/tiddit/cov/functions.nf b/modules/tiddit/cov/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/tiddit/cov/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/tiddit/cov/main.nf b/modules/tiddit/cov/main.nf new file mode 100644 index 00000000..a3a8a171 --- /dev/null +++ b/modules/tiddit/cov/main.nf @@ -0,0 +1,49 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process TIDDIT_COV { + tag "$meta.id" + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::tiddit=2.12.1" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/tiddit:2.12.1--py38h1773678_0" + } else { + container "quay.io/biocontainers/tiddit:2.12.1--py38h1773678_0" + } + + input: + tuple val(meta), path(bam) + path fasta + + output: + tuple val(meta), path("*.tab"), optional: true, emit: cov + tuple val(meta), path("*.wig"), optional: true, emit: wig + + path "versions.yml" , emit: versions + + script: + def software = getSoftwareName(task.process) + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + + def reference = fasta ? "--ref $fasta" : "" + """ + tiddit \\ + --cov \\ + -o $prefix \\ + $options.args \\ + --bam $bam \\ + $reference + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(tiddit 2>&1) | sed 's/^.*TIDDIT-//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/tiddit/cov/meta.yml b/modules/tiddit/cov/meta.yml new file mode 100644 index 00000000..d925b783 --- /dev/null +++ b/modules/tiddit/cov/meta.yml @@ -0,0 +1,52 @@ +name: tiddit_cov +description: Computes the coverage of different regions from the bam file. +keywords: + - coverage + - bam + - statistics + - chromosomal rearrangements +tools: + - tiddit: + description: TIDDIT - structural variant calling. + homepage: https://github.com/SciLifeLab/TIDDIT + documentation: https://github.com/SciLifeLab/TIDDIT/blob/master/README.md + doi: "10.12688/f1000research.11168.1" + licence: ["GPL v3"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM file + pattern: "*.{bam,cram}" + - fasta: + type: file + description: | + Reference genome file. Only needed when passing in CRAM instead of BAM. + If not using CRAM, please pass an empty file instead. + pattern: "*.fasta" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cov: + type: file + description: The coverage of different regions. Optional. + pattern: "*.tab" + - wig: + type: file + description: The coverage of different regions in WIG format. Optional. + pattern: "*.wig" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@projectoriented" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 747efd3a..6bc07f92 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1039,6 +1039,10 @@ tabix/tabix: - modules/tabix/tabix/** - tests/modules/tabix/tabix/** +tiddit/cov: + - modules/tiddit/cov/** + - tests/modules/tiddit/cov/** + tiddit/sv: - modules/tiddit/sv/** - tests/modules/tiddit/sv/** diff --git a/tests/modules/tiddit/cov/main.nf b/tests/modules/tiddit/cov/main.nf new file mode 100644 index 00000000..aed3516c --- /dev/null +++ b/tests/modules/tiddit/cov/main.nf @@ -0,0 +1,23 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { TIDDIT_COV } from '../../../../modules/tiddit/cov/main.nf' addParams( options: [:] ) + +workflow test_tiddit_cov { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + TIDDIT_COV ( input, fasta ) +} + +workflow test_tiddit_cov_no_ref { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + + TIDDIT_COV ( input, [] ) +} diff --git a/tests/modules/tiddit/cov/test.yml b/tests/modules/tiddit/cov/test.yml new file mode 100644 index 00000000..c2aa6439 --- /dev/null +++ b/tests/modules/tiddit/cov/test.yml @@ -0,0 +1,17 @@ +- name: tiddit cov test_tiddit_cov + command: nextflow run tests/modules/tiddit/cov -entry test_tiddit_cov -c tests/config/nextflow.config + tags: + - tiddit + - tiddit/cov + files: + - path: output/tiddit/test.tab + md5sum: f7974948f809f94879d8a60b726194f5 + +- name: tiddit cov test_tiddit_cov_no_ref + command: nextflow run tests/modules/tiddit/cov -entry test_tiddit_cov_no_ref -c tests/config/nextflow.config + tags: + - tiddit + - tiddit/cov + files: + - path: output/tiddit/test.tab + md5sum: f7974948f809f94879d8a60b726194f5 From c912117972a8872b4d045e0bc1a16fb7c14806a6 Mon Sep 17 00:00:00 2001 From: "Moritz E. Beber" Date: Thu, 14 Oct 2021 11:50:31 +0200 Subject: [PATCH 53/61] feat: add sub-workflow for SRA (#836) * feat: add sub-workflow for SRA * Combine prefetch and fasterq-dump into one sub-workflow * tests: add sub-workflow to pytest config --- subworkflows/nf-core/sra_fastq/main.nf | 34 +++++++++++++++++ subworkflows/nf-core/sra_fastq/meta.yml | 37 +++++++++++++++++++ .../nf-core/sra_fastq/nextflow.config | 2 + tests/config/pytest_subworkflows.yml | 5 +++ tests/subworkflows/nf-core/sra_fastq/main.nf | 23 ++++++++++++ tests/subworkflows/nf-core/sra_fastq/test.yml | 25 +++++++++++++ 6 files changed, 126 insertions(+) create mode 100644 subworkflows/nf-core/sra_fastq/main.nf create mode 100644 subworkflows/nf-core/sra_fastq/meta.yml create mode 100644 subworkflows/nf-core/sra_fastq/nextflow.config create mode 100644 tests/subworkflows/nf-core/sra_fastq/main.nf create mode 100644 tests/subworkflows/nf-core/sra_fastq/test.yml diff --git a/subworkflows/nf-core/sra_fastq/main.nf b/subworkflows/nf-core/sra_fastq/main.nf new file mode 100644 index 00000000..ffa380d9 --- /dev/null +++ b/subworkflows/nf-core/sra_fastq/main.nf @@ -0,0 +1,34 @@ +// +// Download FASTQ sequencing reads from the NCBI's Sequence Read Archive (SRA). +// + +params.prefetch_options = [:] +params.fasterqdump_options = [:] + +include { SRATOOLS_PREFETCH } from '../../../modules/sratools/prefetch/main' addParams( options: params.prefetch_options ) +include { SRATOOLS_FASTERQDUMP } from '../../../modules/sratools/fasterqdump/main' addParams( options: params.fasterqdump_options ) + +workflow SRA_FASTQ { + take: + sra_ids // channel: [ val(meta), val(id) ] + + main: + + ch_versions = Channel.empty() + + // + // Prefetch sequencing reads in SRA format. + // + SRATOOLS_PREFETCH ( sra_ids ) + ch_versions = ch_versions.mix( SRATOOLS_PREFETCH.out.versions.first() ) + + // + // Convert the SRA format into one or more compressed FASTQ files. + // + SRATOOLS_FASTERQDUMP ( SRATOOLS_PREFETCH.out.sra ) + ch_versions = ch_versions.mix( SRATOOLS_FASTERQDUMP.out.versions.first() ) + + emit: + reads = SRATOOLS_FASTERQDUMP.out.reads // channel: [ val(meta), [ reads ] ] + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/sra_fastq/meta.yml b/subworkflows/nf-core/sra_fastq/meta.yml new file mode 100644 index 00000000..3db93257 --- /dev/null +++ b/subworkflows/nf-core/sra_fastq/meta.yml @@ -0,0 +1,37 @@ +name: sra_fastq +description: Download FASTQ sequencing reads from the NCBI's Sequence Read Archive (SRA). +keywords: + - sequencing + - FASTQ + - prefetch + - dump +modules: + - sratools/prefetch + - sratools/fasterqdump +input: + - meta: + type: map + description: > + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - id: + type: string + description: > + SRA identifier. +# TODO Update when we decide on a standard for subworkflow docs +output: + - meta: + type: map + description: > + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: Extracted FASTQ file or files if the sequencing reads are paired-end. + pattern: "*.fastq.gz" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - '@Midnighter' diff --git a/subworkflows/nf-core/sra_fastq/nextflow.config b/subworkflows/nf-core/sra_fastq/nextflow.config new file mode 100644 index 00000000..07448834 --- /dev/null +++ b/subworkflows/nf-core/sra_fastq/nextflow.config @@ -0,0 +1,2 @@ +params.prefetch_options = [:] +params.fasterqdump_options = [:] diff --git a/tests/config/pytest_subworkflows.yml b/tests/config/pytest_subworkflows.yml index a8ac84dc..84919be8 100644 --- a/tests/config/pytest_subworkflows.yml +++ b/tests/config/pytest_subworkflows.yml @@ -9,3 +9,8 @@ subworkflows/bam_stats_samtools: subworkflows/bam_sort_samtools: - subworkflows/nf-core/bam_sort_samtools/** - tests/subworkflows/nf-core/bam_sort_samtools/** + +subworkflows/sra_fastq: + - subworkflows/nf-core/sra_fastq/** + - tests/subworkflows/nf-core/sra_fastq/** + diff --git a/tests/subworkflows/nf-core/sra_fastq/main.nf b/tests/subworkflows/nf-core/sra_fastq/main.nf new file mode 100644 index 00000000..988758f3 --- /dev/null +++ b/tests/subworkflows/nf-core/sra_fastq/main.nf @@ -0,0 +1,23 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SRA_FASTQ } from '../../../../subworkflows/nf-core/sra_fastq/main.nf' addParams( [:] ) + +workflow test_sra_fastq_single_end { + input = [ + [ id:'test_single_end', single_end:true ], // meta map + 'SRR13255544' + ] + + SRA_FASTQ ( input ) +} + +workflow test_sra_fastq_paired_end { + input = [ + [ id:'test_paired_end', single_end:false ], // meta map + 'SRR11140744' + ] + + SRA_FASTQ ( input ) +} diff --git a/tests/subworkflows/nf-core/sra_fastq/test.yml b/tests/subworkflows/nf-core/sra_fastq/test.yml new file mode 100644 index 00000000..6f953ccf --- /dev/null +++ b/tests/subworkflows/nf-core/sra_fastq/test.yml @@ -0,0 +1,25 @@ +- name: sra fastq single-end + command: nextflow run ./tests/subworkflows/nf-core/sra_fastq -entry test_sra_fastq_single_end -c tests/config/nextflow.config + tags: + - subworkflows/sra_fastq + # Modules + - sratools + - sratools/prefetch + - sratools/fasterqdump + files: + - path: output/sratools/SRR13255544.fastq.gz + md5sum: 1054c7b71884acdb5eed8a378f18be82 + +- name: sra fastq paired-end + command: nextflow run ./tests/subworkflows/nf-core/sra_fastq -entry test_sra_fastq_paired_end -c tests/config/nextflow.config + tags: + - subworkflows/sra_fastq + # Modules + - sratools + - sratools/prefetch + - sratools/fasterqdump + files: + - path: output/sratools/SRR11140744_1.fastq.gz + md5sum: 193809c784a4ea132ab2a253fa4f55b6 + - path: output/sratools/SRR11140744_2.fastq.gz + md5sum: 3e3b3af3413f50a1685fd7b3f1456d4e From 1cf207a5b634223124ebe9dfa65e293019beda1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Guizard?= Date: Thu, 14 Oct 2021 11:07:53 +0100 Subject: [PATCH 54/61] Update `isoseq3/cluster` (#856) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * πŸ“¦ NEW: Add isoseq3/cluster module * πŸ›FIX: Fix reports channel and add .pbi to it * πŸ›FIX: Fix report channel definition * πŸ‘ŒIMPROVE: Move .pbi file into reports channel * πŸ‘ŒIMPROVE: remove --use_qvs option from command line * πŸ‘Œ IMPROVE: Add in addParams removed options from command line * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The module accept one channel (primers moved into the first channel) * πŸ“¦ NEW: Add galgal6 chr30 test data * πŸ“¦ NEW: Add bamtools module * πŸ‘Œ IMPROVE: Ignore test data * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: add singletons parameter and improve outputs * πŸ› FIX: Update test with last module model * πŸ‘Œ IMPROVE: Add test tag * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Update test data config * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ‘Œ IMPROVE: Remove unused index * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Fill contains args * πŸ“¦ NEW: Add isoseq3/cluster module * πŸ›FIX: Fix reports channel and add .pbi to it * πŸ›FIX: Fix report channel definition * πŸ‘ŒIMPROVE: Move .pbi file into reports channel * πŸ‘ŒIMPROVE: remove --use_qvs option from command line * πŸ‘Œ IMPROVE: Add in addParams removed options from command line * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ‘Œ IMPROVE: The module accept one channel (primers moved into the first channel) * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: add singletons parameter and improve outputs * πŸ› FIX: Update test with last module model * πŸ‘Œ IMPROVE: Add test tag * πŸ‘Œ IMPROVE: Update test data config * πŸ‘Œ IMPROVE: Remove pbi from input files * πŸ‘Œ IMPROVE: Remove unused index * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Fill contains args * πŸ‘Œ IMPROVE: Add some pacbio test files * πŸ› FIX: Add Pacbio index to test_data.config * πŸ‘Œ IMPROVE: Re add 10000 data test * πŸ‘Œ IMPROVE: Add some pbindex * πŸ› FIX: Add pbi extension to files * πŸ“¦ NEW: Add galgal6 chr30 test data * πŸ“¦ NEW: Add bamtools module * πŸ‘Œ IMPROVE: Ignore test data * πŸ‘Œ IMPROVE: Update to last templates version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Update module to last template version * πŸ‘Œ IMPROVE: Final version of test datasets config * πŸ‘Œ IMPROVE: Remove useless index + Fix Typos * πŸ‘Œ IMPROVE: Update code to new versions capture + better output channels * πŸ‘Œ IMPROVE: Update with new versions.yml file * πŸ› FIX: Update meta.yml + correct typos * πŸ‘Œ IMPROVE: Clean output file names + correct typo * πŸ› FIX: Remove bamtools/split module from isoseq3/cluster * πŸ› FIX: Update output filename pattern input filename and output filename were the same * πŸ‘Œ IMPROVE: Update meta.yml --- modules/isoseq3/cluster/main.nf | 27 +++++++++--------- modules/isoseq3/cluster/meta.yml | 34 +++++++++++------------ tests/modules/isoseq3/cluster/test.yml | 38 +++++++++++++------------- 3 files changed, 50 insertions(+), 49 deletions(-) diff --git a/modules/isoseq3/cluster/main.nf b/modules/isoseq3/cluster/main.nf index f01af2bc..df005706 100644 --- a/modules/isoseq3/cluster/main.nf +++ b/modules/isoseq3/cluster/main.nf @@ -22,19 +22,20 @@ process ISOSEQ3_CLUSTER { tuple val(meta), path(bam) output: - tuple val(meta), path("*.bam") , emit: bam - tuple val(meta), path("*.bam.pbi") , emit: pbi - tuple val(meta), path("*.cluster") , emit: cluster - tuple val(meta), path("*.cluster_report.csv"), emit: cluster_report - tuple val(meta), path("*.transcriptset.xml") , emit: transcriptset - tuple val(meta), path("*.hq.bam") , emit: hq_bam - tuple val(meta), path("*.hq.bam.pbi") , emit: hq_pbi - tuple val(meta), path("*.lq.bam") , emit: lq_bam - tuple val(meta), path("*.lq.bam.pbi") , emit: lq_pbi - path "versions.yml" , emit: versions + tuple val(meta), path("*.transcripts.bam") , emit: bam + tuple val(meta), path("*.transcripts.bam.pbi") , emit: pbi + tuple val(meta), path("*.transcripts.cluster") , emit: cluster + tuple val(meta), path("*.transcripts.cluster_report.csv"), emit: cluster_report + tuple val(meta), path("*.transcripts.transcriptset.xml") , emit: transcriptset + path "versions.yml" , emit: versions + + tuple val(meta), path("*.transcripts.hq.bam") , optional: true, emit: hq_bam + tuple val(meta), path("*.transcripts.hq.bam.pbi") , optional: true, emit: hq_pbi + tuple val(meta), path("*.transcripts.lq.bam") , optional: true, emit: lq_bam + tuple val(meta), path("*.transcripts.lq.bam.pbi") , optional: true, emit: lq_pbi + tuple val(meta), path("*.transcripts.singletons.bam") , optional: true, emit: singletons_bam + tuple val(meta), path("*.transcripts.singletons.bam.pbi"), optional: true, emit: singletons_pbi - tuple val(meta), path("*.singletons.bam") , optional: true, emit: singletons_bam - tuple val(meta), path("*.singletons.bam.pbi"), optional: true, emit: singletons_pbi script: def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" @@ -42,7 +43,7 @@ process ISOSEQ3_CLUSTER { isoseq3 \\ cluster \\ $bam \\ - ${prefix}.bam \\ + ${prefix}.transcripts.bam \\ $options.args cat <<-END_VERSIONS > versions.yml diff --git a/modules/isoseq3/cluster/meta.yml b/modules/isoseq3/cluster/meta.yml index 6fadb9c4..280e0150 100644 --- a/modules/isoseq3/cluster/meta.yml +++ b/modules/isoseq3/cluster/meta.yml @@ -35,47 +35,47 @@ output: - bam: type: file description: BAM file of clustered consensus - pattern: "*.bam" + pattern: "*.transcripts.bam" - pbi: type: file description: Pacbio Index of consensus reads generated by clustering - pattern: "*.pbi" + pattern: "*.transcripts.bam.pbi" - cluster: type: file description: A two columns (from, to) file describing original read name to new read name - pattern: "*.cluster" + pattern: "*.transcripts.cluster" - cluster_report: type: file description: A table files clusters (transcripts) members (read) - pattern: "*.cluster_report.csv" + pattern: "*.transcripts.cluster_report.csv" - transcriptset: type: file description: A metadata xml file which contains full paths to data files - pattern: "*.clustered.transcriptset.xml" + pattern: "*.transcripts.transcriptset.xml" - hq_bam: type: file - description: High quality reads - pattern: "*.hq.bam" + description: High quality reads (when --use-qvs is set) + pattern: "*.transcripts.hq.bam" - hq_pbi: type: file - description: Pacbio index of high quality reads - pattern: "*.hq.bam.pbi" + description: Pacbio index of high quality reads (when --use-qvs is set) + pattern: "*.transcripts.hq.bam.pbi" - lq_bam: type: file - description: Low quality reads - pattern: "*.lq.bam" + description: Low quality reads (when --use-qvs is set) + pattern: "*.transcripts.lq.bam" - lq_pbi: type: file - description: Pacbio index of low quality reads - pattern: "*.lq.bam.pbi" + description: Pacbio index of low quality reads (when --use-qvs is set) + pattern: "*.transcripts.lq.bam.pbi" - singletons_bam: type: file - description: Unclustered reads - pattern: "*.singletons.bam" + description: Unclustered reads (when --singletons is set) + pattern: "*.transcripts.singletons.bam" - singletons_pbi: type: file - description: Pacbio index of unclustered reads - pattern: "*.singletons.bam.pbi" + description: Pacbio index of unclustered reads (when --singletons is set) + pattern: "*.transcripts.singletons.bam.pbi" authors: - "@sguizard" diff --git a/tests/modules/isoseq3/cluster/test.yml b/tests/modules/isoseq3/cluster/test.yml index cc6b6dac..58b20ae2 100644 --- a/tests/modules/isoseq3/cluster/test.yml +++ b/tests/modules/isoseq3/cluster/test.yml @@ -4,25 +4,25 @@ - isoseq3 - isoseq3/cluster files: - - path: output/isoseq3/test.bam - md5sum: ca8277f4d8fe1bba68ba266c42b46dd1 - - path: output/isoseq3/test.bam.pbi - md5sum: cbc06657b4543faba7ff886b3b12b862 - - path: output/isoseq3/test.cluster + - path: output/isoseq3/test.transcripts.bam + md5sum: eb36697688099c757ef4196f54ad7d7a + - path: output/isoseq3/test.transcripts.bam.pbi + md5sum: db70cee03421822e9b8f9fb6b228f461 + - path: output/isoseq3/test.transcripts.cluster md5sum: d5059d856763fc5591332980bfc0d57b - - path: output/isoseq3/test.cluster_report.csv + - path: output/isoseq3/test.transcripts.cluster_report.csv md5sum: 342d97dc10aedf80a45977edcb491c62 - - path: output/isoseq3/test.hq.bam - md5sum: e93ea85776c35c246364d954032c2ea9 - - path: output/isoseq3/test.hq.bam.pbi - md5sum: 5a8ea7668e8f8e173478b28cbb6ab515 - - path: output/isoseq3/test.lq.bam - md5sum: 4ea0e4f4a6cc689dcc275adcdf688fad - - path: output/isoseq3/test.lq.bam.pbi - md5sum: f5edc24711b2c8d6474d60cb69022af0 - - path: output/isoseq3/test.singletons.bam - md5sum: 73d131920bd42e1fc5fca2e6cb71f4b2 - - path: output/isoseq3/test.singletons.bam.pbi - md5sum: 73980863be4b5bda2846325c737f0b5e - - path: output/isoseq3/test.transcriptset.xml + - path: output/isoseq3/test.transcripts.hq.bam + md5sum: 4c5f4ffb429107c9c9578419e07d6987 + - path: output/isoseq3/test.transcripts.hq.bam.pbi + md5sum: 39ac3e957c8d55b0ce3f425d63baa154 + - path: output/isoseq3/test.transcripts.lq.bam + md5sum: 710ca4bc58ac039d76775460e1c822a0 + - path: output/isoseq3/test.transcripts.lq.bam.pbi + md5sum: 9b32036553bf3dced3065e6d0f36aef9 + - path: output/isoseq3/test.transcripts.singletons.bam + md5sum: 0288577406b9d1e7356de9b4d7c2bb7c + - path: output/isoseq3/test.transcripts.singletons.bam.pbi + md5sum: 8e0e0681179c0c36209b49fa60783841 + - path: output/isoseq3/test.transcripts.transcriptset.xml contains: [ 'PacBio.DataSet.TranscriptSet' ] From d0e4ee3ccd5628e412ea0120eb28266e936c6b0e Mon Sep 17 00:00:00 2001 From: FriederikeHanssen Date: Fri, 15 Oct 2021 10:40:16 +0200 Subject: [PATCH 55/61] Add cram files to config (#862) * add cram files to config * Update tests/config/test_data.config Co-authored-by: Harshil Patel --- tests/config/test_data.config | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/config/test_data.config b/tests/config/test_data.config index b4443e9f..50fdb858 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -143,6 +143,20 @@ params { test2_paired_end_umi_unsorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test2.paired_end.umi_unsorted.bam" test2_paired_end_umi_unsorted_tagged_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test2.paired_end.unsorted_tagged.bam" + test_paired_end_sorted_cram = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram" + test_paired_end_sorted_cram_crai = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai" + test_paired_end_markduplicates_sorted_cram = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test.paired_end.markduplicates.sorted.cram" + test_paired_end_markduplicates_sorted_cram_crai = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test.paired_end.markduplicates.sorted.cram.crai" + test_paired_end_recalibrated_sorted_cram = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram" + test_paired_end_recalibrated_sorted_cram_crai = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai" + + test2_paired_end_sorted_cram = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test2.paired_end.sorted.cram" + test2_paired_end_sorted_cram_crai = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test2.paired_end.sorted.cram.crai" + test2_paired_end_markduplicates_sorted_cram = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test2.paired_end.markduplicates.sorted.cram" + test2_paired_end_markduplicates_sorted_cram_crai = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test2.paired_end.markduplicates.sorted.cram.crai" + test2_paired_end_recalibrated_sorted_cram = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram" + test2_paired_end_recalibrated_sorted_cram_crai = "${test_data_dir}/genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai" + test_1_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz" test_2_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz" test_umi_1_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/fastq/test.umi_1.fastq.gz" From b6486ef8b4355ae75c7ba7c608ee41d07aab23f6 Mon Sep 17 00:00:00 2001 From: FriederikeHanssen Date: Fri, 15 Oct 2021 11:10:53 +0200 Subject: [PATCH 56/61] Add compressed bed files (#864) * add cram files to config * Update tests/config/test_data.config * Add compressed bed file Co-authored-by: Harshil Patel --- tests/config/test_data.config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 50fdb858..5381a311 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -104,6 +104,8 @@ params { genome_gtf = "${test_data_dir}/genomics/homo_sapiens/genome/genome.gtf" genome_sizes = "${test_data_dir}/genomics/homo_sapiens/genome/genome.sizes" genome_bed = "${test_data_dir}/genomics/homo_sapiens/genome/genome.bed" + genome_bed_gz = "${test_data_dir}/genomics/homo_sapiens/genome/genome.bed.gz" + genome_bed_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/genome.bed.gz.tbi" transcriptome_fasta = "${test_data_dir}/genomics/homo_sapiens/genome/transcriptome.fasta" genome2_fasta = "${test_data_dir}/genomics/homo_sapiens/genome/genome2.fasta" From cbfc8eb46c67e539aa4e06015466f250f2070e5f Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Mon, 18 Oct 2021 15:24:49 +0200 Subject: [PATCH 57/61] Pydamage analyzer update (#863) * Specify more guidelines on input channels * Linting * Updates based on code review * Update README.md * Fix broken sentence * feat: add megahit module, currently decompressed output * Update main.nf * Update tests/modules/megahit/test.yml Co-authored-by: Maxime Borry * Apply suggestions from code review Co-authored-by: Harshil Patel * feat: compress all outputs, remove md5sums due to gz stochasicity * fix: wrong conda channel for pigz * fix: broken singleend tests and update meta.yml * Missed one * Apply suggestions from code review Co-authored-by: Harshil Patel * fix: pigz formatting * Apply suggestions from code review Co-authored-by: Harshil Patel * Apply suggestions from code review * Update md5sum due to test-dataset update Co-authored-by: Harshil Patel Co-authored-by: Maxime Borry --- tests/modules/pydamage/analyze/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/pydamage/analyze/test.yml b/tests/modules/pydamage/analyze/test.yml index e480c1b4..157e947f 100644 --- a/tests/modules/pydamage/analyze/test.yml +++ b/tests/modules/pydamage/analyze/test.yml @@ -5,4 +5,4 @@ - pydamage/analyze files: - path: output/pydamage/pydamage_results/pydamage_results.csv - md5sum: 6847e0d5aa6dba85bbd2dd509772b7a0 + md5sum: 37ee6b4dee6890fd2ec8550337f21ac9 From 4e9e732b76d2117bf9f6ff2afbd3950582429f07 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Mon, 18 Oct 2021 22:34:23 +0100 Subject: [PATCH 58/61] Add strelka/somatic module (#866) * Add strelka/somatic module * Fill out meta.yml properly --- modules/strelka/somatic/functions.nf | 78 +++++++++++++++++++++++ modules/strelka/somatic/main.nf | 59 ++++++++++++++++++ modules/strelka/somatic/meta.yml | 85 ++++++++++++++++++++++++++ tests/config/pytest_modules.yml | 12 ++-- tests/modules/strelka/somatic/main.nf | 23 +++++++ tests/modules/strelka/somatic/test.yml | 12 ++++ 6 files changed, 265 insertions(+), 4 deletions(-) create mode 100644 modules/strelka/somatic/functions.nf create mode 100644 modules/strelka/somatic/main.nf create mode 100644 modules/strelka/somatic/meta.yml create mode 100644 tests/modules/strelka/somatic/main.nf create mode 100644 tests/modules/strelka/somatic/test.yml diff --git a/modules/strelka/somatic/functions.nf b/modules/strelka/somatic/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/strelka/somatic/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/strelka/somatic/main.nf b/modules/strelka/somatic/main.nf new file mode 100644 index 00000000..35e7053f --- /dev/null +++ b/modules/strelka/somatic/main.nf @@ -0,0 +1,59 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process STRELKA_SOMATIC { + tag "$meta.id" + label 'process_high' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::strelka=2.9.10" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/strelka:2.9.10--h9ee0642_1" + } else { + container "quay.io/biocontainers/strelka:2.9.10--h9ee0642_1" + } + + input: + tuple val(meta), path(cram_normal), path(crai_normal), path(cram_tumor), path(crai_tumor) + path fasta + path fai + path target_bed + path target_bed_tbi + + output: + tuple val(meta), path("*.somatic_indels.vcf.gz") , emit: vcf_indels + tuple val(meta), path("*.somatic_indels.vcf.gz.tbi"), emit: vcf_indels_tbi + tuple val(meta), path("*.somatic_snvs.vcf.gz") , emit: vcf_snvs + tuple val(meta), path("*.somatic_snvs.vcf.gz.tbi") , emit: vcf_snvs_tbi + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def options_strelka = params.target_bed ? "--exome --callRegions ${target_bed}" : "" + """ + configureStrelkaSomaticWorkflow.py \\ + --tumor $cram_tumor \\ + --normal $cram_normal \\ + --referenceFasta $fasta \\ + $options_strelka \\ + $options.args \\ + --runDir strelka + + python strelka/runWorkflow.py -m local -j $task.cpus + + mv strelka/results/variants/somatic.indels.vcf.gz ${prefix}.somatic_indels.vcf.gz + mv strelka/results/variants/somatic.indels.vcf.gz.tbi ${prefix}.somatic_indels.vcf.gz.tbi + mv strelka/results/variants/somatic.snvs.vcf.gz ${prefix}.somatic_snvs.vcf.gz + mv strelka/results/variants/somatic.snvs.vcf.gz.tbi ${prefix}.somatic_snvs.vcf.gz.tbi + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$( configureStrelkaSomaticWorkflow.py --version ) + END_VERSIONS + """ +} diff --git a/modules/strelka/somatic/meta.yml b/modules/strelka/somatic/meta.yml new file mode 100644 index 00000000..d9bd993a --- /dev/null +++ b/modules/strelka/somatic/meta.yml @@ -0,0 +1,85 @@ +name: strelka_somatic +description: Strelka2 is a fast and accurate small variant caller optimized for analysis of germline variation in small cohorts and somatic variation in tumor/normal sample pairs +keywords: + - variant calling + - germline + - wgs + - vcf + - variants +tools: + - strelka: + description: Strelka calls somatic and germline small variants from mapped sequencing reads + homepage: https://github.com/Illumina/strelka + documentation: https://github.com/Illumina/strelka/blob/v2.9.x/docs/userGuide/README.md + tool_dev_url: https://github.com/Illumina/strelka + doi: 10.1038/s41592-018-0051-x + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cram_normal: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - crai_normal: + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" + - cram_tumor: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - crai_tumor: + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" + - fasta: + type: file + description: Genome reference FASTA file + pattern: "*.{fa,fasta}" + - fai: + type: file + description: Genome reference FASTA index file + pattern: "*.{fa.fai,fasta.fai}" + - target_bed: + type: file + description: BED file containing target regions for variant calling + pattern: "*.{bed}" + - target_bed_tbi: + type: file + description: Index for BED file containing target regions for variant calling + pattern: "*.{bed.tbi}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf_indels: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - vcf_indels_tbi: + type: file + description: Index for gzipped VCF file containing variants + pattern: "*.{vcf.gz.tbi}" + - vcf_snvs: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - vcf_snvs_tbi: + type: file + description: Index for gzipped VCF file containing variants + pattern: "*.{vcf.gz.tbi}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@drpatelh" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 6bc07f92..ed727e7c 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -991,14 +991,14 @@ spatyper: - modules/spatyper/** - tests/modules/spatyper/** -sratools/prefetch: - - modules/sratools/prefetch/** - - tests/modules/sratools/prefetch/** - sratools/fasterqdump: - modules/sratools/fasterqdump/** - tests/modules/sratools/fasterqdump/** +sratools/prefetch: + - modules/sratools/prefetch/** + - tests/modules/sratools/prefetch/** + staphopiasccmec: - modules/staphopiasccmec/** - tests/modules/staphopiasccmec/** @@ -1015,6 +1015,10 @@ strelka/germline: - modules/strelka/germline/** - tests/modules/strelka/germline/** +strelka/somatic: + - modules/strelka/somatic/** + - tests/modules/strelka/somatic/** + stringtie/merge: - modules/stringtie/merge/** - tests/modules/stringtie/merge/** diff --git a/tests/modules/strelka/somatic/main.nf b/tests/modules/strelka/somatic/main.nf new file mode 100644 index 00000000..8dec808e --- /dev/null +++ b/tests/modules/strelka/somatic/main.nf @@ -0,0 +1,23 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { STRELKA_SOMATIC } from '../../../../modules/strelka/somatic/main.nf' addParams( options: [:] ) + +workflow test_strelka_somatic { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram_crai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_cram_crai'], checkIfExists: true) + ] + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + bed = file(params.test_data['homo_sapiens']['genome']['genome_bed_gz'], checkIfExists: true) + bed_tbi = file(params.test_data['homo_sapiens']['genome']['genome_bed_gz_tbi'], checkIfExists: true) + + STRELKA_SOMATIC ( input, fasta, fai, bed, bed_tbi ) +} diff --git a/tests/modules/strelka/somatic/test.yml b/tests/modules/strelka/somatic/test.yml new file mode 100644 index 00000000..f98b7232 --- /dev/null +++ b/tests/modules/strelka/somatic/test.yml @@ -0,0 +1,12 @@ +- name: strelka somatic test_strelka_somatic + command: nextflow run tests/modules/strelka/somatic -entry test_strelka_somatic -c tests/config/nextflow.config + tags: + - strelka + - strelka/somatic + files: + - path: output/strelka/test.somatic_indels.vcf.gz + - path: output/strelka/test.somatic_indels.vcf.gz.tbi + md5sum: 4cb176febbc8c26d717a6c6e67b9c905 + - path: output/strelka/test.somatic_snvs.vcf.gz + - path: output/strelka/test.somatic_snvs.vcf.gz.tbi + md5sum: 4cb176febbc8c26d717a6c6e67b9c905 From 97fe899f792b2188737cb0f0075219feb22c2b2c Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Wed, 20 Oct 2021 10:02:30 +0200 Subject: [PATCH 59/61] fix: reduce number of required input files for damage profiler (#612) * Reduce number of required input files for damage profiler * Remove rebugging * Add optional species list file. * Working pending updated test-dataset update * Add genome header to config --- modules/damageprofiler/main.nf | 17 +++-- modules/damageprofiler/meta.yml | 8 ++- tests/config/test_data.config | 26 ++++---- tests/modules/damageprofiler/main.nf | 34 ++++++++-- tests/modules/damageprofiler/test.yml | 94 ++++++++++++++++++++++++--- 5 files changed, 144 insertions(+), 35 deletions(-) diff --git a/modules/damageprofiler/main.nf b/modules/damageprofiler/main.nf index 1537b019..3800a305 100644 --- a/modules/damageprofiler/main.nf +++ b/modules/damageprofiler/main.nf @@ -22,25 +22,30 @@ process DAMAGEPROFILER { tuple val(meta), path(bam) path fasta path fai + path specieslist output: tuple val(meta), path("${prefix}"), emit: results path "versions.yml" , emit: versions script: - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def software = getSoftwareName(task.process) + prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def reference = fasta ? "-r $fasta" : "" + def species_list = specieslist ? "-sf $specieslist" : "" """ damageprofiler \\ - -i $bam \\ - -r $fasta \\ - -o $prefix/ \\ - $options.args - + -i $bam \\ + -o $prefix/ \\ + $options.args \\ + $reference \\ + $species_list cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: ${getSoftwareName(task.process)}: \$(damageprofiler -v | sed 's/^DamageProfiler v//') END_VERSIONS """ + } diff --git a/modules/damageprofiler/meta.yml b/modules/damageprofiler/meta.yml index ff82ba09..19ba908f 100644 --- a/modules/damageprofiler/meta.yml +++ b/modules/damageprofiler/meta.yml @@ -32,12 +32,16 @@ input: pattern: "*.{bam,cram,sam}" - fasta: type: file - description: FASTA reference file + description: OPTIONAL FASTA reference file pattern: "*.{fasta,fna,fa}" - fai: type: file - description: FASTA index file from samtools faidx + description: OPTIONAL FASTA index file from samtools faidx pattern: "*.{fai}" + - specieslist: + type: file + description: OPTIONAL text file with list of target reference headers + pattern: "*.{txt}" output: - versions: diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 5381a311..6abfa4f8 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -104,6 +104,7 @@ params { genome_gtf = "${test_data_dir}/genomics/homo_sapiens/genome/genome.gtf" genome_sizes = "${test_data_dir}/genomics/homo_sapiens/genome/genome.sizes" genome_bed = "${test_data_dir}/genomics/homo_sapiens/genome/genome.bed" + genome_header = "${test_data_dir}/genomics/homo_sapiens/genome/genome.header" genome_bed_gz = "${test_data_dir}/genomics/homo_sapiens/genome/genome.bed.gz" genome_bed_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/genome.bed.gz.tbi" transcriptome_fasta = "${test_data_dir}/genomics/homo_sapiens/genome/transcriptome.fasta" @@ -119,18 +120,19 @@ params { repeat_expansions = "${test_data_dir}/genomics/homo_sapiens/genome/loci/repeat_expansions.json" } 'illumina' { - test_paired_end_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam" - test_paired_end_sorted_bam_bai = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai" - test_paired_end_markduplicates_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam" - test_paired_end_markduplicates_sorted_bam_bai = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam.bai" - test_paired_end_recalibrated_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam" - test_paired_end_recalibrated_sorted_bam_bai = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai" - test_paired_end_umi_consensus_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_consensus.bam" - test_paired_end_umi_converted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_converted.bam" - test_paired_end_umi_grouped_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_grouped.bam" - test_paired_end_umi_histogram_txt = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_histogram.txt" - test_paired_end_umi_unsorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_unsorted.bam" - test_paired_end_umi_unsorted_tagged_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.unsorted_tagged.bam" + test_paired_end_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam" + test_paired_end_sorted_bam_bai = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai" + test_paired_end_markduplicates_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam" + test_paired_end_markduplicates_sorted_bam_bai = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam.bai" + test_paired_end_markduplicates_sorted_referencesn_txt = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.referencesn.txt" + test_paired_end_recalibrated_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam" + test_paired_end_recalibrated_sorted_bam_bai = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai" + test_paired_end_umi_consensus_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_consensus.bam" + test_paired_end_umi_converted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_converted.bam" + test_paired_end_umi_grouped_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_grouped.bam" + test_paired_end_umi_histogram_txt = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_histogram.txt" + test_paired_end_umi_unsorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_unsorted.bam" + test_paired_end_umi_unsorted_tagged_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/umi/test.paired_end.unsorted_tagged.bam" test2_paired_end_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam" test2_paired_end_sorted_bam_bai = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam.bai" diff --git a/tests/modules/damageprofiler/main.nf b/tests/modules/damageprofiler/main.nf index 5b128770..36ae7b24 100644 --- a/tests/modules/damageprofiler/main.nf +++ b/tests/modules/damageprofiler/main.nf @@ -6,10 +6,34 @@ include { DAMAGEPROFILER } from '../../../modules/damageprofiler/main.nf' addPar workflow test_damageprofiler { - input = [ [ id:'test', single_end:false ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] ] - fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + input = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_markduplicates_sorted_bam'], checkIfExists: true) ] ] + fasta = [] + fai = [] + species_list = [] - DAMAGEPROFILER ( input, fasta, fai ) + + DAMAGEPROFILER ( input, fasta, fai, species_list ) +} + +workflow test_damageprofiler_reference { + + input = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_markduplicates_sorted_bam'], checkIfExists: true) ] ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + species_list = [] + + DAMAGEPROFILER ( input, fasta, fai, species_list ) +} + +workflow test_damageprofiler_specieslist { + + input = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_markduplicates_sorted_bam'], checkIfExists: true) ] ] + fasta = [] + fai = [] + species_list = file(params.test_data['homo_sapiens']['genome']['genome_header'], checkIfExists: true) + + DAMAGEPROFILER ( input, fasta, fai, species_list ) } diff --git a/tests/modules/damageprofiler/test.yml b/tests/modules/damageprofiler/test.yml index 357647be..9ef964dc 100644 --- a/tests/modules/damageprofiler/test.yml +++ b/tests/modules/damageprofiler/test.yml @@ -4,13 +4,13 @@ - damageprofiler files: - path: output/damageprofiler/test/3p_freq_misincorporations.txt - md5sum: da4cac90c78899a7cb6d72d415392b49 + md5sum: de3b84d946a6b63cdcfadf82bf6854c0 - path: output/damageprofiler/test/3pGtoA_freq.txt - md5sum: 8dab75d51a4b943b501d0995169c767f + md5sum: 61c903b1504ed7d7182570dfc75e4498 - path: output/damageprofiler/test/5pCtoT_freq.txt - md5sum: fcc48ee5f72edff930d627c8bfdd8a5b + md5sum: 15a75b60ee519b61ce04a83fe3afe855 - path: output/damageprofiler/test/5p_freq_misincorporations.txt - md5sum: 54665474f5ef17dcc268567e5eaa7d86 + md5sum: 3b3240d6c1a3491e461b39199a9fcfe3 - path: output/damageprofiler/test/DamagePlot_five_prime.svg - path: output/damageprofiler/test/DamagePlot.pdf - path: output/damageprofiler/test/DamagePlot_three_prime.svg @@ -18,19 +18,93 @@ contains: - "FINISHED SUCCESSFULLY" - path: output/damageprofiler/test/dmgprof.json - md5sum: 98499024c7e937896e481f2d3cfbdd3e + md5sum: 2e54e712d2ae9e32c4c298e5fd8f60fe - path: output/damageprofiler/test/DNA_comp_genome.txt - md5sum: f91e70760d91a1193a27e360aaddf2fd + md5sum: fea48af1ecf491b439d36d4a919473df - path: output/damageprofiler/test/DNA_composition_sample.txt - md5sum: 1257eb3eb42484647bfba2151f9ef04f + md5sum: 9e17a0b1e5ad4eb13201cd24ad8507dd - path: output/damageprofiler/test/edit_distance.pdf - path: output/damageprofiler/test/edit_distance.svg - path: output/damageprofiler/test/editDistance.txt - md5sum: af2d2f4a99058ec56eae88ec27779e38 + md5sum: 04d14b449a5afa8b5dbff0dfa762356b - path: output/damageprofiler/test/Length_plot_combined_data.svg - path: output/damageprofiler/test/Length_plot_forward_reverse_separated.svg - path: output/damageprofiler/test/Length_plot.pdf - path: output/damageprofiler/test/lgdistribution.txt - md5sum: c5d029bf3a92b613310ee23f47d94981 + md5sum: df2e19195185ea9ee05e8e84b2948f36 - path: output/damageprofiler/test/misincorporation.txt - md5sum: 3aa6dd749010a492d92a815a83c196a8 + md5sum: bec0c5fc2fa9c82b04949e2d8b6e979c + +- name: damageprofiler_reference + command: nextflow run ./tests/modules/damageprofiler -entry test_damageprofiler_reference -c tests/config/nextflow.config -dump-channels + tags: + - damageprofiler + files: + - path: output/damageprofiler/test/3p_freq_misincorporations.txt + md5sum: de3b84d946a6b63cdcfadf82bf6854c0 + - path: output/damageprofiler/test/3pGtoA_freq.txt + md5sum: 61c903b1504ed7d7182570dfc75e4498 + - path: output/damageprofiler/test/5pCtoT_freq.txt + md5sum: 15a75b60ee519b61ce04a83fe3afe855 + - path: output/damageprofiler/test/5p_freq_misincorporations.txt + md5sum: 3b3240d6c1a3491e461b39199a9fcfe3 + - path: output/damageprofiler/test/DamagePlot_five_prime.svg + - path: output/damageprofiler/test/DamagePlot.pdf + - path: output/damageprofiler/test/DamagePlot_three_prime.svg + - path: output/damageprofiler/test/DamageProfiler.log + contains: + - "FINISHED SUCCESSFULLY" + - path: output/damageprofiler/test/dmgprof.json + md5sum: 2e54e712d2ae9e32c4c298e5fd8f60fe + - path: output/damageprofiler/test/DNA_comp_genome.txt + md5sum: fea48af1ecf491b439d36d4a919473df + - path: output/damageprofiler/test/DNA_composition_sample.txt + md5sum: 9e17a0b1e5ad4eb13201cd24ad8507dd + - path: output/damageprofiler/test/edit_distance.pdf + - path: output/damageprofiler/test/edit_distance.svg + - path: output/damageprofiler/test/editDistance.txt + md5sum: 04d14b449a5afa8b5dbff0dfa762356b + - path: output/damageprofiler/test/Length_plot_combined_data.svg + - path: output/damageprofiler/test/Length_plot_forward_reverse_separated.svg + - path: output/damageprofiler/test/Length_plot.pdf + - path: output/damageprofiler/test/lgdistribution.txt + md5sum: df2e19195185ea9ee05e8e84b2948f36 + - path: output/damageprofiler/test/misincorporation.txt + md5sum: bec0c5fc2fa9c82b04949e2d8b6e979c + +- name: damageprofiler_specieslist + command: nextflow run ./tests/modules/damageprofiler -entry test_damageprofiler_specieslist -c tests/config/nextflow.config -dump-channels + tags: + - damageprofiler + files: + - path: output/damageprofiler/test/chr22/3p_freq_misincorporations.txt + md5sum: de3b84d946a6b63cdcfadf82bf6854c0 + - path: output/damageprofiler/test/chr22/3pGtoA_freq.txt + md5sum: 61c903b1504ed7d7182570dfc75e4498 + - path: output/damageprofiler/test/chr22/5pCtoT_freq.txt + md5sum: 15a75b60ee519b61ce04a83fe3afe855 + - path: output/damageprofiler/test/chr22/5p_freq_misincorporations.txt + md5sum: 3b3240d6c1a3491e461b39199a9fcfe3 + - path: output/damageprofiler/test/chr22/DamagePlot_five_prime.svg + - path: output/damageprofiler/test/chr22/DamagePlot.pdf + - path: output/damageprofiler/test/chr22/DamagePlot_three_prime.svg + - path: output/damageprofiler/test/DamageProfiler.log + contains: + - "FINISHED SUCCESSFULLY" + - path: output/damageprofiler/test/chr22/dmgprof.json + md5sum: 2e54e712d2ae9e32c4c298e5fd8f60fe + - path: output/damageprofiler/test/chr22/DNA_comp_genome.txt + md5sum: fea48af1ecf491b439d36d4a919473df + - path: output/damageprofiler/test/chr22/DNA_composition_sample.txt + md5sum: 9e17a0b1e5ad4eb13201cd24ad8507dd + - path: output/damageprofiler/test/chr22/edit_distance.pdf + - path: output/damageprofiler/test/chr22/edit_distance.svg + - path: output/damageprofiler/test/chr22/editDistance.txt + md5sum: 04d14b449a5afa8b5dbff0dfa762356b + - path: output/damageprofiler/test/chr22/Length_plot_combined_data.svg + - path: output/damageprofiler/test/chr22/Length_plot_forward_reverse_separated.svg + - path: output/damageprofiler/test/chr22/Length_plot.pdf + - path: output/damageprofiler/test/chr22/lgdistribution.txt + md5sum: df2e19195185ea9ee05e8e84b2948f36 + - path: output/damageprofiler/test/chr22/misincorporation.txt + md5sum: bec0c5fc2fa9c82b04949e2d8b6e979c From eb04a0f1f69a687b596109efb80f28c17b667eba Mon Sep 17 00:00:00 2001 From: Maxime Borry Date: Wed, 20 Oct 2021 15:19:31 +0200 Subject: [PATCH 60/61] New module: freebayes (#818) * add pydamage module Co-authored-by: James A. Fellows Yates --- modules/freebayes/functions.nf | 78 +++++++++++++++++++++++++++++++ modules/freebayes/main.nf | 79 ++++++++++++++++++++++++++++++++ modules/freebayes/meta.yml | 78 +++++++++++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/freebayes/main.nf | 35 ++++++++++++++ tests/modules/freebayes/test.yml | 15 ++++++ 6 files changed, 289 insertions(+) create mode 100644 modules/freebayes/functions.nf create mode 100644 modules/freebayes/main.nf create mode 100644 modules/freebayes/meta.yml create mode 100644 tests/modules/freebayes/main.nf create mode 100644 tests/modules/freebayes/test.yml diff --git a/modules/freebayes/functions.nf b/modules/freebayes/functions.nf new file mode 100644 index 00000000..85628ee0 --- /dev/null +++ b/modules/freebayes/functions.nf @@ -0,0 +1,78 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Extract name of module from process name using $task.process +// +def getProcessName(task_process) { + return task_process.tokenize(':')[-1] +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + + // Do not publish versions.yml unless running from pytest workflow + if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) { + return null + } + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } +} diff --git a/modules/freebayes/main.nf b/modules/freebayes/main.nf new file mode 100644 index 00000000..63235d8a --- /dev/null +++ b/modules/freebayes/main.nf @@ -0,0 +1,79 @@ +// Import generic module functions +include { initOptions; saveFiles; getProcessName; getSoftwareName } from './functions' + +params.options = [:] +options = initOptions(params.options) + +process FREEBAYES { + tag "$meta.id" + label 'process_low' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::freebayes=1.3.5" : null) + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/freebayes:1.3.5--py38ha193a2f_3" + } else { + container "quay.io/biocontainers/freebayes:1.3.5--py38ha193a2f_3" + } + + input: + tuple val(meta), path(bam), path(bai) + tuple path(fasta), path(fai) + path(targets) + path(samples) + path(populations) + path(cnv) + + + output: + tuple val(meta), path("*.vcf.gz") , emit: vcf + path "versions.yml" , emit: versions + + script: + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def targets_file = targets ? "--target ${targets}" : "" + def samples_file = samples ? "--samples ${samples}" : "" + def populations_file = populations ? "--populations ${populations}" : "" + def cnv_file = cnv ? "--cnv-map ${cnv}" : "" + if (task.cpus > 1) { + """ + freebayes-parallel \\ + <(fasta_generate_regions.py ${fasta}.fai 10000) ${task.cpus} \\ + -f $fasta \\ + $targets_file \\ + $samples_file \\ + $populations_file \\ + $cnv_file \\ + $options.args \\ + $bam > ${prefix}.vcf + + gzip --no-name ${prefix}.vcf + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(freebayes --version 2>&1) | sed 's/version:\s*v//g' ) + END_VERSIONS + """ + + } else { + """ + freebayes \\ + -f $fasta \\ + $targets_file \\ + $samples_file \\ + $populations_file \\ + $cnv_file \\ + $options.args \\ + $bam > ${prefix}.vcf + + gzip --no-name ${prefix}.vcf + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + ${getSoftwareName(task.process)}: \$(echo \$(freebayes --version 2>&1) | sed 's/version:\s*v//g' ) + END_VERSIONS + """ + } +} diff --git a/modules/freebayes/meta.yml b/modules/freebayes/meta.yml new file mode 100644 index 00000000..46eb5309 --- /dev/null +++ b/modules/freebayes/meta.yml @@ -0,0 +1,78 @@ +name: freebayes +description: A haplotype-based variant detector +keywords: + - variant caller + - SNP + - genotyping + - variant calling + - bayesian +tools: + - freebayes: + description: Bayesian haplotype-based polymorphism discovery and genotyping + homepage: https://github.com/freebayes/freebayes + documentation: https://github.com/freebayes/freebayes + tool_dev_url: https://github.com/freebayes/freebayes + doi: "" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - bai: + type: file + description: BAM/CRAM/SAM index file + pattern: "*.bam.bai" + - fasta: + type: file + description: reference fasta file + pattern: ".{fa,fa.gz,fasta,fasta.gz}" + - fai: + type: file + description: reference fasta file index + pattern: "*.fai" + - targets: + type: file + description: Optional - Limit analysis to targets listed in this BED-format FILE. + pattern: "*.bed" + - samples: + type: file + description: Optional - Limit analysis to samples listed (one per line) in the FILE. + pattern: "*.txt" + - populations: + type: file + description: Optional - Each line of FILE should list a sample and a population which it is part of. + pattern: "*.txt" + - cnv: + type: file + description: | + A copy number map BED file, which has + either a sample-level ploidy: + sample_name copy_number + or a region-specific format: + seq_name start end sample_name copy_number + pattern: "*.bed" + + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" + - vcf: + type: file + description: Compressed VCF file + pattern: "*.vcf.gz" +authors: + - "@maxibor" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index ed727e7c..8f030bd8 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -382,6 +382,10 @@ flash: - modules/flash/** - tests/modules/flash/** +freebayes: + - modules/freebayes/** + - tests/modules/freebayes/** + gatk4/applybqsr: - modules/gatk4/applybqsr/** - tests/modules/gatk4/applybqsr/** diff --git a/tests/modules/freebayes/main.nf b/tests/modules/freebayes/main.nf new file mode 100644 index 00000000..1c07b821 --- /dev/null +++ b/tests/modules/freebayes/main.nf @@ -0,0 +1,35 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { FREEBAYES } from '../../../modules/freebayes/main.nf' addParams( options: [:] ) + +workflow test_freebayes { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true)] + reference = [file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true)] + targets = [] + samples = [] + populations = [] + cnv = [] + + FREEBAYES ( input, reference, targets, samples, populations, cnv) +} + +workflow test_freebayes_bed { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true)] + reference = [file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true)] + targets = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + samples = [] + populations = [] + cnv = [] + + FREEBAYES ( input, reference, targets, samples, populations, cnv) +} diff --git a/tests/modules/freebayes/test.yml b/tests/modules/freebayes/test.yml new file mode 100644 index 00000000..fb5af1ea --- /dev/null +++ b/tests/modules/freebayes/test.yml @@ -0,0 +1,15 @@ +- name: freebayes test_freebayes + command: nextflow run tests/modules/freebayes -entry test_freebayes -c tests/config/nextflow.config + tags: + - freebayes + files: + - path: output/freebayes/test.vcf.gz + md5sum: e8de5fe0025e331b939c2a849290f325 + +- name: freebayes test_freebayes_bed + command: nextflow run tests/modules/freebayes -entry test_freebayes_bed -c tests/config/nextflow.config + tags: + - freebayes + files: + - path: output/freebayes/test.vcf.gz + md5sum: 1c41cbec0cfa15002ce91b869ce9d519 From b5fa91d0f75831ec9871b7a181b61e2c12dcaa68 Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Thu, 21 Oct 2021 11:32:05 +0200 Subject: [PATCH 61/61] Check only for file being generated (#879) --- tests/modules/freebayes/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/modules/freebayes/test.yml b/tests/modules/freebayes/test.yml index fb5af1ea..9ca54021 100644 --- a/tests/modules/freebayes/test.yml +++ b/tests/modules/freebayes/test.yml @@ -4,7 +4,6 @@ - freebayes files: - path: output/freebayes/test.vcf.gz - md5sum: e8de5fe0025e331b939c2a849290f325 - name: freebayes test_freebayes_bed command: nextflow run tests/modules/freebayes -entry test_freebayes_bed -c tests/config/nextflow.config @@ -12,4 +11,4 @@ - freebayes files: - path: output/freebayes/test.vcf.gz - md5sum: 1c41cbec0cfa15002ce91b869ce9d519 +