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/check_duplicate_md5s.py b/.github/check_duplicate_md5s.py new file mode 100644 index 00000000..60506ab5 --- /dev/null +++ b/.github/check_duplicate_md5s.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python + +from rich import print +from rich.table import Table +import click +import glob +import os +import yaml + + +@click.command() +@click.option( + "--min_dups", + default=5, + show_default=True, + help="Minimum number of duplicates to report", +) +@click.option( + "--search_dir", + default=f"{os.path.dirname(__file__)}/../tests/**/test.yml", + show_default=True, + help="Glob directory pattern used to find test YAML files", +) +def find_duplicate_md5s(min_dups, search_dir): + """ + Find duplicate file MD5 sums in test YAML files. + """ + md5_filenames = {} + md5_output_fn_counts = {} + module_counts = {} + + # Loop through all files in tests/ called test.yml + for test_yml in glob.glob(search_dir, recursive=True): + # Open file and parse YAML + with open(test_yml, "r") as fh: + test_config = yaml.safe_load(fh) + # Loop through tests and check for duplicate md5s + for test in test_config: + for test_file in test.get("files", []): + if "md5sum" in test_file: + md5 = test_file["md5sum"] + md5_filenames[md5] = md5_filenames.get(md5, []) + [ + os.path.basename(test_file.get("path")) + ] + md5_output_fn_counts[md5] = md5_output_fn_counts.get(md5, 0) + 1 + # Log the module that this md5 was in + modname = os.path.basename(os.path.dirname(test_yml)) + # If tool/subtool show the whole thing + # Ugly code but trying to stat os-agnostic + if os.path.basename( + os.path.dirname(os.path.dirname(test_yml)) + ) not in ["modules", "config", "subworkflows"]: + modname = "{}/{}".format( + os.path.basename( + os.path.dirname(os.path.dirname(test_yml)) + ), + os.path.basename(os.path.dirname(test_yml)), + ) + module_counts[md5] = module_counts.get(md5, []) + [modname] + + # Set up rich table + table = Table(title="Duplicate MD5s", row_styles=["dim", ""]) + table.add_column("MD5", style="cyan", no_wrap=True) + table.add_column("Count", style="magenta", justify="right") + table.add_column("Num modules", style="blue", justify="right") + table.add_column("Filenames", style="green") + + # Add rows - sort md5_output_fn_counts by value + for md5 in sorted(md5_output_fn_counts, key=md5_output_fn_counts.get): + if md5_output_fn_counts[md5] >= min_dups: + table.add_row( + md5, + str(md5_output_fn_counts[md5]), + str(len(set(module_counts[md5]))), + ", ".join(set(md5_filenames[md5])), + ) + + print(table) + + +if __name__ == "__main__": + find_duplicate_md5s() 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..121dd865 100644 --- a/.github/workflows/nf-core-linting.yml +++ b/.github/workflows/nf-core-linting.yml @@ -1,7 +1,11 @@ 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: @@ -20,9 +24,6 @@ jobs: lint: runs-on: ubuntu-20.04 - env: - NXF_VER: 21.04.0 - name: ${{ matrix.tags }} needs: changes if: needs.changes.outputs.modules != '[]' @@ -66,6 +67,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 75f0b174..cc7c9313 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: @@ -19,13 +23,12 @@ jobs: test: runs-on: ubuntu-20.04 - name: ${{ matrix.tags }} ${{ matrix.profile }} ${{ matrix.nxf_version }} + name: ${{ matrix.tags }} ${{ matrix.profile }} needs: changes if: needs.changes.outputs.modules != '[]' strategy: fail-fast: false matrix: - nxf_version: ["21.04.0"] tags: ["${{ fromJson(needs.changes.outputs.modules) }}"] profile: ["docker", "singularity", "conda"] env: @@ -56,13 +59,12 @@ jobs: - uses: actions/cache@v2 with: path: /usr/local/bin/nextflow - key: ${{ runner.os }}-nextflow-${{ matrix.nxf_version }} + key: ${{ runner.os }} restore-keys: | ${{ runner.os }}-nextflow- - name: Install Nextflow env: - NXF_VER: ${{ matrix.nxf_version }} CAPSULE_LOG: none run: | wget -qO- get.nextflow.io | bash @@ -95,9 +97,11 @@ jobs: if: failure() uses: actions/upload-artifact@v2 with: - name: logs-${{ matrix.tags }}-${{ matrix.profile }}-${{ matrix.nxf_version }} + name: logs-${{ matrix.profile }} path: | /home/runner/pytest_workflow_*/*/.nextflow.log /home/runner/pytest_workflow_*/*/log.out /home/runner/pytest_workflow_*/*/log.err /home/runner/pytest_workflow_*/*/work + !/home/runner/pytest_workflow_*/*/work/conda + !/home/runner/pytest_workflow_*/*/work/singularity diff --git a/.gitignore b/.gitignore index 2cbbac1a..c773a2d0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,9 @@ test_output/ output/ .DS_Store *.code-workspace +tests/data/ .screenrc .*.sw? +__pycache__ +*.pyo +*.pyc diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000..6fe79af6 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,10 @@ +# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/ +tasks: + - name: Install Nextflow + init: | + curl -s https://get.nextflow.io | bash + sudo mv nextflow /usr/local/bin + + - name: Install pytest-workflow + init: | + pip install pytest-workflow diff --git a/.nf-core.yml b/.nf-core.yml new file mode 100644 index 00000000..72971af8 --- /dev/null +++ b/.nf-core.yml @@ -0,0 +1,9 @@ +bump-versions: + rseqc/junctionannotation: False + rseqc/bamstat: False + rseqc/readduplication: False + rseqc/readdistribution: False + rseqc/junctionsaturation: False + rseqc/inferexperiment: False + rseqc/innerdistance: False + sortmerna: False diff --git a/README.md b/README.md index 59857849..beee42e7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ![nf-core/modules](docs/images/nfcore-modules_logo.png) -[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.04.0-23aa62.svg?labelColor=000000)](https://www.nextflow.io/) +[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.10.3-23aa62.svg?labelColor=000000)](https://www.nextflow.io/) [![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/) [![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/) [![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/) @@ -12,21 +12,13 @@ [![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core) > THIS REPOSITORY IS UNDER ACTIVE DEVELOPMENT. SYNTAX, ORGANISATION AND LAYOUT MAY CHANGE WITHOUT NOTICE! -> PLEASE BE KIND TO OUR CODE REVIEWERS AND SUBMIT ONE PULL REQUEST PER MODULE :) A repository for hosting [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) module files containing tool-specific process definitions and their associated documentation. ## Table of contents - [Using existing modules](#using-existing-modules) -- [Adding a new module file](#adding-a-new-module-file) - - [Checklist](#checklist) - - [nf-core modules create](#nf-core-modules-create) - - [Test data](#test-data) - - [Running tests manually](#running-tests-manually) - - [Uploading to `nf-core/modules`](#uploading-to-nf-coremodules) - - [Guidelines](#guidelines) -- [Terminology](#terminology) +- [Adding new modules](#adding-new-modules) - [Help](#help) - [Citation](#citation) @@ -40,7 +32,7 @@ We have written a helper command in the `nf-core/tools` package that uses the Gi 2. List the available modules: ```console - $ nf-core modules list + $ nf-core modules list remote ,--./,-. ___ __ __ __ ___ /,-._.--~\ @@ -65,7 +57,7 @@ We have written a helper command in the `nf-core/tools` package that uses the Gi 3. Install the module in your pipeline directory: ```console - $ nf-core modules install . --tool fastqc + $ nf-core modules install fastqc ,--./,-. ___ __ __ __ ___ /,-._.--~\ @@ -86,13 +78,13 @@ We have written a helper command in the `nf-core/tools` package that uses the Gi nextflow.enable.dsl = 2 - include { FASTQC } from './modules/nf-core/modules/fastqc/main' addParams( options: [:] ) + include { FASTQC } from './modules/nf-core/modules/fastqc/main' ``` 5. Remove the module from the pipeline repository if required: ```console - $ nf-core modules remove . --tool fastqc + $ nf-core modules remove fastqc ,--./,-. ___ __ __ __ ___ /,-._.--~\ @@ -109,7 +101,7 @@ We have written a helper command in the `nf-core/tools` package that uses the Gi 6. Check that a locally installed nf-core module is up-to-date compared to the one hosted in this repo: ```console - $ nf-core modules lint . --tool fastqc + $ nf-core modules lint fastqc ,--./,-. ___ __ __ __ ___ /,-._.--~\ @@ -139,394 +131,11 @@ We have written a helper command in the `nf-core/tools` package that uses the Gi ╰──────────────────────╯ ``` -We have plans to add other utility commands to help developers install and maintain modules downloaded from this repository so watch this space e.g. `nf-core modules update` command to automatically check and update modules installed within the pipeline. +## Adding new modules -## Adding a new module file +If you wish to contribute a new module, please see the documentation on the [nf-core website](https://nf-co.re/developers/adding_modules). -If you decide to upload a module to `nf-core/modules` then this will -ensure that it will become available to all nf-core pipelines, -and to everyone within the Nextflow community! See -[`modules/`](modules) -for examples. - -### Checklist - -Please check that the module you wish to add isn't already on [`nf-core/modules`](https://github.com/nf-core/modules/tree/master/modules): -- Use the [`nf-core modules list`](https://github.com/nf-core/tools#list-modules) command -- Check [open pull requests](https://github.com/nf-core/modules/pulls) -- Search [open issues](https://github.com/nf-core/modules/issues) - -If the module doesn't exist on `nf-core/modules`: -- Please create a [new issue](https://github.com/nf-core/modules/issues/new?assignees=&labels=new%20module&template=new_nodule.md&title=new%20module:) before adding it -- Set an appropriate subject for the issue e.g. `new module: fastqc` -- Add yourself to the `Assignees` so we can track who is working on the module - -### nf-core modules create - -We have implemented a number of commands in the `nf-core/tools` package to make it incredibly easy for you to create and contribute your own modules to nf-core/modules. - -1. Install the latest version of [`nf-core/tools`](https://github.com/nf-core/tools#installation) (`>=2.0`) -2. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=21.04.0`) -3. Install any of [`Docker`](https://docs.docker.com/engine/installation/), [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/) or [`Conda`](https://conda.io/miniconda.html) -4. [Fork and clone this repo locally](#uploading-to-nf-coremodules) -5. Set up git by adding a new remote of the nf-core git repo called `upstream` - - ```bash - git remote add upstream https://github.com/nf-core/modules.git - ``` - - Make a new branch for your module and check it out - - ```bash - git checkout -b fastqc - ``` - -6. Create a module using the [nf-core DSL2 module template](https://github.com/nf-core/tools/blob/master/nf_core/module-template/modules/main.nf): - - ```console - $ nf-core modules create . --tool fastqc --author @joebloggs --label process_low --meta - - ,--./,-. - ___ __ __ __ ___ /,-._.--~\ - |\ | |__ __ / ` / \ |__) |__ } { - | \| | \__, \__/ | \ |___ \`-._,-`-, - `._,._,' - - nf-core/tools version 2.0 - - INFO Using Bioconda package: 'bioconda::fastqc=0.11.9' create.py:130 - INFO Using Docker / Singularity container with tag: 'fastqc:0.11.9--0' create.py:140 - INFO Created / edited following files: create.py:218 - ./modules/fastqc/functions.nf - ./modules/fastqc/main.nf - ./modules/fastqc/meta.yml - ./tests/modules/fastqc/main.nf - ./tests/modules/fastqc/test.yml - ./tests/config/pytest_modules.yml - ``` - - All of the files required to add the module to `nf-core/modules` will be created/edited in the appropriate places. The 4 files you will need to change are: - - 1. [`./modules/fastqc/main.nf`](https://github.com/nf-core/modules/blob/master/modules/fastqc/main.nf) - - This is the main script containing the `process` definition for the module. You will see an extensive number of `TODO` statements to help guide you to fill in the appropriate sections and to ensure that you adhere to the guidelines we have set for module submissions. - - 2. [`./modules/fastqc/meta.yml`](https://github.com/nf-core/modules/blob/master/modules/fastqc/meta.yml) - - This file will be used to store general information about the module and author details - the majority of which will already be auto-filled. However, you will need to add a brief description of the files defined in the `input` and `output` section of the main script since these will be unique to each module. - - 3. [`./tests/modules/fastqc/main.nf`](https://github.com/nf-core/modules/blob/master/tests/modules/fastqc/main.nf) - - Every module MUST have a test workflow. This file will define one or more Nextflow `workflow` definitions that will be used to unit test the output files created by the module. By default, one `workflow` definition will be added but please feel free to add as many as possible so we can ensure that the module works on different data types / parameters e.g. separate `workflow` for single-end and paired-end data. - - Minimal test data required for your module may already exist within this repository, in which case you may just have to change a couple of paths in this file - see the [Test data](#test-data) section for more info and guidelines for adding new standardised data if required. - - 4. [`./tests/modules/fastqc/test.yml`](https://github.com/nf-core/modules/blob/master/tests/modules/fastqc/test.yml) - - This file will contain all of the details required to unit test the main script in the point above using [pytest-workflow](https://pytest-workflow.readthedocs.io/). If possible, any outputs produced by the test workflow(s) MUST be included and listed in this file along with an appropriate check e.g. md5sum. The different test options are listed in the [pytest-workflow docs](https://pytest-workflow.readthedocs.io/en/stable/#test-options). - - As highlighted in the next point, we have added a command to make it much easier to test the workflow(s) defined for the module and to automatically create the `test.yml` with the md5sum hashes for all of the outputs generated by the module. - - `md5sum` checks are the preferable choice of test to determine file changes, however, this may not be possible for all outputs generated by some tools e.g. if they include time stamps or command-related headers. Please do your best to avoid just checking for the file being present e.g. it may still be possible to check that the file contains the appropriate text snippets. - -7. Create a yaml file containing information required for module unit testing - - ```console - $ nf-core modules create-test-yml - - ,--./,-. - ___ __ __ __ ___ /,-._.--~\ - |\ | |__ __ / ` / \ |__) |__ } { - | \| | \__, \__/ | \ |___ \`-._,-`-, - `._,._,' - - nf-core/tools version 2.0 - - - INFO Press enter to use default values (shown in brackets) or type your own responses test_yml_builder.py:51 - ? Tool name: fastqc - Test YAML output path (- for stdout) (tests/modules/fastqc/test.yml): - INFO Looking for test workflow entry points: 'tests/modules/fastqc/main.nf' test_yml_builder.py:116 - INFO Building test meta for entry point 'test_fastqc_single_end' test_yml_builder.py:150 - Test name (fastqc test_fastqc_single_end): - Test command (nextflow run tests/modules/fastqc -entry test_fastqc_single_end -c tests/config/nextflow.config): - Test tags (comma separated) (fastqc,fastqc_single_end): - Test output folder with results (leave blank to run test): - ? Choose software profile Singularity - INFO Setting env var '$PROFILE' to 'singularity' test_yml_builder.py:258 - INFO Running 'fastqc' test with command: test_yml_builder.py:263 - nextflow run tests/modules/fastqc -entry test_fastqc_single_end -c tests/config/nextflow.config --outdir /tmp/tmpgbneftf5 - INFO Test workflow finished! test_yml_builder.py:276 - INFO Writing to 'tests/modules/fastqc/test.yml' test_yml_builder.py:293 - ``` - - > NB: See docs for [running tests manually](#running-tests-manually) if you would like to run the tests manually. - -8. Lint the module locally to check that it adheres to nf-core guidelines before submission - - ```console - $ nf-core modules lint . --tool fastqc - - ,--./,-. - ___ __ __ __ ___ /,-._.--~\ - |\ | |__ __ / ` / \ |__) |__ } { - | \| | \__, \__/ | \ |___ \`-._,-`-, - `._,._,' - - nf-core/tools version 2.0 - - INFO Linting modules repo: . lint.py:102 - INFO Linting module: fastqc lint.py:106 - - ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ - │ [!] 3 Test Warnings │ - ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ - ╭──────────────┬──────────────────────────────────────────────────────────────┬──────────────────────────────────╮ - │ Module name │ Test message │ File path │ - ├──────────────┼──────────────────────────────────────────────────────────────┼──────────────────────────────────┤ - │ fastqc │ TODO string in meta.yml: #Add a description of the module... │ modules/nf-core/modules/fastqc/ │ - │ fastqc │ TODO string in meta.yml: #Add a description and other det... │ modules/nf-core/modules/fastqc/ │ - │ fastqc │ TODO string in meta.yml: #Add a description of all of the... │ modules/nf-core/modules/fastqc/ │ - ╰──────────────┴──────────────────────────────────────────────────────────────┴──────────────────────────────────╯ - ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ - │ [!] 1 Test Failed │ - ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ - ╭──────────────┬──────────────────────────────────────────────────────────────┬──────────────────────────────────╮ - │ Module name │ Test message │ File path │ - ├──────────────┼──────────────────────────────────────────────────────────────┼──────────────────────────────────┤ - │ fastqc │ 'meta' map not emitted in output channel(s) │ modules/nf-core/modules/fastqc/ │ - ╰──────────────┴──────────────────────────────────────────────────────────────┴──────────────────────────────────╯ - ╭──────────────────────╮ - │ LINT RESULTS SUMMARY │ - ├──────────────────────┤ - │ [✔] 38 Tests Passed │ - │ [!] 3 Test Warning │ - │ [✗] 1 Test Failed │ - ╰──────────────────────╯ - ``` - -9. Once ready, the code can be pushed and a pull request (PR) created - - On a regular basis you can pull upstream changes into this branch and it is recommended to do so before pushing and creating a pull request - see below. Rather than merging changes directly from upstream the rebase strategy is recommended so that your changes are applied on top of the latest master branch from the nf-core repo. This can be performed as follows - - ```bash - git pull --rebase upstream master - ``` - - Once you are ready you can push the code and create a PR - - ```bash - git push -u origin fastqc - ``` - - Once the PR has been accepted you should delete the branch and checkout master again. - - ```bash - git checkout master - git branch -d fastqc - ``` - - In case there are commits on the local branch that didn't make it into the PR (usually commits made after the PR), git will warn about this and not delete the branch. If you are sure you want to delete, use the following command - - ```bash - git branch -D fastqc - ``` - -### Test data - -In order to test that each module added to `nf-core/modules` is actually working and to be able to track any changes to results files between module updates we have set-up a number of Github Actions CI tests to run each module on a minimal test dataset using Docker, Singularity and Conda. - -- All test data for `nf-core/modules` MUST be added to the `modules` branch of [`nf-core/test-datasets`](https://github.com/nf-core/test-datasets/tree/modules/data) and organised by filename extension. - -- In order to keep the size of this repository as minimal as possible, pre-existing files from [`nf-core/test-datasets`](https://github.com/nf-core/test-datasets/tree/modules/data) MUST be reused if at all possible. - -- Test files MUST be kept as tiny as possible. - -- If the appropriate test data doesn't exist in the `modules` branch of [`nf-core/test-datasets`](https://github.com/nf-core/test-datasets/tree/modules/data) please contact us on the [nf-core Slack `#modules` channel](https://nfcore.slack.com/channels/modules) (you can join with [this invite](https://nf-co.re/join/slack)) to discuss possible options. - -### Running tests manually - -As outlined in the [nf-core modules create](#nf-core-modules-create) section we have made it quite trivial to create an initial yaml file (via the `nf-core modules create-test-yml` command) containing a listing of all of the module output files and their associated md5sums. However, md5sum checks may not be appropriate for all output files if for example they contain timestamps. This is why it is a good idea to re-run the tests locally with `pytest-workflow` before you create your pull request adding the module. If your files do indeed have timestamps or other issues that prevent you from using the md5sum check, then you can edit the `test.yml` file to instead check that the file contains some specific content or as a last resort, if it exists. The different test options are listed in the [pytest-workflow docs](https://pytest-workflow.readthedocs.io/en/stable/#test-options). - -Please follow the steps below to run the tests locally: - -1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=21.04.0`) - -2. Install any of [`Docker`](https://docs.docker.com/engine/installation/), [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/) or [`Conda`](https://conda.io/miniconda.html) - -3. Install [`pytest-workflow`](https://pytest-workflow.readthedocs.io/en/stable/#installation) - -4. Start running your own tests using the appropriate [`tag`](https://github.com/nf-core/modules/blob/3d720a24fd3c766ba56edf3d4e108a1c45d353b2/tests/modules/fastqc/test.yml#L3-L5) defined in the `test.yml`: - - - Typical command with Docker: - - ```console - cd /path/to/git/clone/of/nf-core/modules/ - PROFILE=docker pytest --tag fastqc --symlink --keep-workflow-wd - ``` - - - Typical command with Singularity: - - ```console - cd /path/to/git/clone/of/nf-core/modules/ - TMPDIR=~ PROFILE=singularity pytest --tag fastqc --symlink --keep-workflow-wd - ``` - - - Typical command with Conda: - - ```console - cd /path/to/git/clone/of/nf-core/modules/ - PROFILE=conda pytest --tag fastqc --symlink --keep-workflow-wd - ``` - - - See [docs on running pytest-workflow](https://pytest-workflow.readthedocs.io/en/stable/#running-pytest-workflow) for more info. - -### Uploading to `nf-core/modules` - -[Fork](https://help.github.com/articles/fork-a-repo/) the `nf-core/modules` repository to your own GitHub account. Within the local clone of your fork add the module file to the [`modules/`](modules) directory. Please try and keep PRs as atomic as possible to aid the reviewing process - ideally, one module addition/update per PR. - -Commit and push these changes to your local clone on GitHub, and then [create a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) on the `nf-core/modules` GitHub repo with the appropriate information. - -We will be notified automatically when you have created your pull request, and providing that everything adheres to nf-core guidelines we will endeavour to approve your pull request as soon as possible. - -### Guidelines - -The key words "MUST", "MUST NOT", "SHOULD", etc. are to be interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119). - -#### General - -- Software that can be piped together SHOULD be added to separate module files -unless there is a run-time, storage advantage in implementing in this way. For example, -using a combination of `bwa` and `samtools` to output a BAM file instead of a SAM file: - - ```bash - bwa mem | samtools view -B -T ref.fasta - ``` - -- Where applicable, the usage and generation of compressed files SHOULD be enforced as input and output, respectively: - - `*.fastq.gz` and NOT `*.fastq` - - `*.bam` and NOT `*.sam` - -- Where applicable, each module command MUST emit a file `.version.txt` containing a single line with the software's version in the format `` or `0.7.17` e.g. - - ```bash - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt - ``` - - If the software is unable to output a version number on the command-line then a variable called `VERSION` can be manually specified to create this file e.g. [homer/annotatepeaks module](https://github.com/nf-core/modules/blob/master/modules/homer/annotatepeaks/main.nf). - -- The process definition MUST NOT contain a `when` statement. - -#### Naming conventions - -- The directory structure for the module name must be all lowercase e.g. [`modules/bwa/mem/`](modules/bwa/mem/). The name of the software (i.e. `bwa`) and tool (i.e. `mem`) MUST be all one word. - -- The process name in the module file MUST be all uppercase e.g. `process BWA_MEM {`. The name of the software (i.e. `BWA`) and tool (i.e. `MEM`) MUST be all one word separated by an underscore. - -- All parameter names MUST follow the `snake_case` convention. - -- All function names MUST follow the `camelCase` convention. - -#### Module parameters - -- A module file SHOULD only define input and output files as command-line parameters to be executed within the process. - -- All other parameters MUST be provided as a string i.e. `options.args` where `options` is a Groovy Map that MUST be provided via the Nextflow `addParams` option when including the module via `include` in the parent workflow. - -- If the tool supports multi-threading then you MUST provide the appropriate parameter using the Nextflow `task` variable e.g. `--threads $task.cpus`. - -- Any parameters that need to be evaluated in the context of a particular sample e.g. single-end/paired-end data MUST also be defined within the process. - -#### Input/output options - -- Named file extensions MUST be emitted for ALL output channels e.g. `path "*.txt", emit: txt`. - -- Optional inputs are not currently supported by Nextflow. However, "fake files" MAY be used to work around this issue. - -#### Resource requirements - -- An appropriate resource `label` MUST be provided for the module as listed in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/master/nf_core/pipeline-template/conf/base.config#L29-L46) e.g. `process_low`, `process_medium` or `process_high`. - -- If the tool supports multi-threading then you MUST provide the appropriate parameter using the Nextflow `task` variable e.g. `--threads $task.cpus`. - -#### Software requirements - -[BioContainers](https://biocontainers.pro/#/) is a registry of Docker and Singularity containers automatically created from all of the software packages on [Bioconda](https://bioconda.github.io/). Where possible we will use BioContainers to fetch pre-built software containers and Bioconda to install software using Conda. - -- Software requirements SHOULD be declared within the module file using the Nextflow `container` directive. For single-tool BioContainers, the `nf-core modules create` command will automatically fetch and fill-in the appropriate Conda / Docker / Singularity definitions by parsing the information provided in the first part of the module name: - - ```nextflow - conda (params.enable_conda ? "bioconda::bwa=0.7.17" : null) // Conda package - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bwa:0.7.17--hed695b0_7" // Singularity image - } else { - container "quay.io/biocontainers/bwa:0.7.17--hed695b0_7" // Docker image - } - ``` - -- If the software is available on Conda it MUST also be defined using the Nextflow `conda` directive. Using `bioconda::bwa=0.7.17` as an example, software MUST be pinned to the channel (i.e. `bioconda`) and version (i.e. `0.7.17`). Conda packages MUST not be pinned to a build because they can vary on different platforms. - -- If required, multi-tool containers may also be available on BioContainers e.g. [`bwa` and `samtools`](https://biocontainers.pro/#/tools/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40). You can install and use the [`galaxy-tool-util`](https://anaconda.org/bioconda/galaxy-tool-util) package to search for both single- and multi-tool containers available in Conda, Docker and Singularity format. e.g. to search for Docker (hosted on Quay.io) and Singularity multi-tool containers with both `bowtie` and `samtools` installed you can use the following command: - - ```console - mulled-search --destination quay singularity --channel bioconda --search bowtie samtools | grep "mulled" - ``` - - > NB: Build information for all tools within a multi-tool container can be obtained in the `/usr/local/conda-meta/history` file within the container. - -- It is also possible for a new multi-tool container to be built and added to BioContainers by submitting a pull request on their [`multi-package-containers`](https://github.com/BioContainers/multi-package-containers) repository. - - Fork the [multi-package-containers repository](https://github.com/BioContainers/multi-package-containers) - - Make a change to the `hash.tsv` file in the `combinations` directory see [here](https://github.com/aunderwo/multi-package-containers/blob/master/combinations/hash.tsv#L124) for an example where `pysam=0.16.0.1,biopython=1.78` was added. - - Commit the code and then make a pull request to the original repo, for [example](https://github.com/BioContainers/multi-package-containers/pull/1661) - - Once the PR has been accepted a container will get built and you can find it using a search tool in the `galaxy-tool-util conda` package - - ```console - mulled-search --destination quay singularity conda --search pysam biopython | grep "mulled" - quay mulled-v2-3a59640f3fe1ed11819984087d31d68600200c3f 185a25ca79923df85b58f42deb48f5ac4481e91f-0 docker pull quay.io/biocontainers/mulled-v2-3a59640f3fe1ed11819984087d31d68600200c3f:185a25ca79923df85b58f42deb48f5ac4481e91f-0 - singularity mulled-v2-3a59640f3fe1ed11819984087d31d68600200c3f 185a25ca79923df85b58f42deb48f5ac4481e91f-0 wget https://depot.galaxyproject.org/singularity/mulled-v2-3a59640f3fe1ed11819984087d31d68600200c3f:185a25ca79923df85b58f42deb48f5ac4481e91f-0 - ``` - - - You can copy and paste the `mulled-*` path into the relevant Docker and Singularity lines in the Nextflow `process` definition of your module - - To confirm that this is correct. Spin up a temporary Docker container - - ```console - docker run --rm -it quay.io/biocontainers/mulled-v2-3a59640f3fe1ed11819984087d31d68600200c3f:185a25ca79923df85b58f42deb48f5ac4481e91f-0 /bin/sh - ``` - - And in the command prompt type - - ```console - $ grep specs /usr/local/conda-meta/history - # update specs: ['biopython=1.78', 'pysam=0.16.0.1'] - ``` - - The packages should reflect those added to the multi-package-containers repo `hash.tsv` file - -- If the software is not available on Bioconda a `Dockerfile` MUST be provided within the module directory. We will use GitHub Actions to auto-build the containers on the [GitHub Packages registry](https://github.com/features/packages). - -#### Publishing results - -The [Nextflow `publishDir`](https://www.nextflow.io/docs/latest/process.html#publishdir) definition is currently quite limited in terms of parameter/option evaluation. To overcome this, the publishing logic we have implemented for use with DSL2 modules attempts to minimise changing the `publishDir` directive (default: `params.outdir`) in favour of constructing and appending the appropriate output directory paths via the `saveAs:` statement e.g. - -```nextflow -publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } -``` - -The `saveFiles` function can be found in the [`functions.nf`](modules/fastqc/functions.nf) file of utility functions that will be copied into all module directories. It uses the various publishing `options` specified as input to the module to construct and append the relevant output path to `params.outdir`. - -We also use a standardised parameter called `params.publish_dir_mode` that can be used to alter the file publishing method (default: `copy`). - -## Terminology - -The features offered by Nextflow DSL2 can be used in various ways depending on the granularity with which you would like to write pipelines. Please see the listing below for the hierarchy and associated terminology we have decided to use when referring to DSL2 components: - -- *Module*: A `process` that can be used within different pipelines and is as atomic as possible i.e. cannot be split into another module. An example of this would be a module file containing the process definition for a single tool such as `FastQC`. At present, this repository has been created to only host atomic module files that should be added to the [`modules/`](modules/) directory along with the required documentation and tests. - -- *Sub-workflow*: A chain of multiple modules that offer a higher-level of functionality within the context of a pipeline. For example, a sub-workflow to run multiple QC tools with FastQ files as input. Sub-workflows should be shipped with the pipeline implementation and if required they should be shared amongst different pipelines directly from there. As it stands, this repository will not host sub-workflows although this may change in the future since well-written sub-workflows will be the most powerful aspect of DSL2. - -- *Workflow*: What DSL1 users would consider an end-to-end pipeline. For example, from one or more inputs to a series of outputs. This can either be implemented using a large monolithic script as with DSL1, or by using a combination of DSL2 individual modules and sub-workflows. +> Please be kind to our code reviewers and submit one pull request per module :) ## Help diff --git a/main.nf b/main.nf new file mode 100644 index 00000000..de12f619 --- /dev/null +++ b/main.nf @@ -0,0 +1,3 @@ +/* + * not actually used - just a placeholder + */ diff --git a/modules/abacas/functions.nf b/modules/abacas/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/abacas/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..49040214 100644 --- a/modules/abacas/main.nf +++ b/modules/abacas/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process ABACAS { 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::abacas=1.3.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/abacas:1.3.1--pl526_0" - } else { - container "quay.io/biocontainers/abacas:1.3.1--pl526_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/abacas:1.3.1--pl526_0' : + 'quay.io/biocontainers/abacas:1.3.1--pl526_0' }" input: tuple val(meta), path(scaffold) @@ -24,22 +13,25 @@ process ABACAS { output: tuple val(meta), path('*.abacas*'), emit: results - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ abacas.pl \\ -r $fasta \\ -q $scaffold \\ - $options.args \\ + $args \\ -o ${prefix}.abacas mv nucmer.delta ${prefix}.abacas.nucmer.delta 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 + "${task.process}": + abacas: \$(echo \$(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..039fb0be 100644 --- a/modules/abacas/meta.yml +++ b/modules/abacas/meta.yml @@ -48,10 +48,10 @@ output: 'test.abacas.MULTIFASTA.fa' ] pattern: "*.{abacas}*" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/adapterremoval/functions.nf b/modules/adapterremoval/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/adapterremoval/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..0cf257ff 100644 --- a/modules/adapterremoval/main.nf +++ b/modules/adapterremoval/main.nf @@ -1,21 +1,11 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process ADAPTERREMOVAL { 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::adapterremoval=2.3.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/adapterremoval:2.3.2--hb7ba0dd_0" - } else { - container "quay.io/biocontainers/adapterremoval:2.3.2--hb7ba0dd_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/adapterremoval:2.3.2--hb7ba0dd_0' : + 'quay.io/biocontainers/adapterremoval:2.3.2--hb7ba0dd_0' }" input: tuple val(meta), path(reads) @@ -23,17 +13,17 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" if (meta.single_end) { """ AdapterRemoval \\ --file1 $reads \\ - $options.args \\ + $args \\ --basename $prefix \\ --threads $task.cpus \\ --settings ${prefix}.log \\ @@ -41,14 +31,17 @@ process ADAPTERREMOVAL { --seed 42 \\ --gzip \\ - AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + adapterremoval: \$(AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g") + END_VERSIONS """ } else if (!meta.single_end && !meta.collapse) { """ AdapterRemoval \\ --file1 ${reads[0]} \\ - --file2 ${reads[0]} \\ - $options.args \\ + --file2 ${reads[1]} \\ + $args \\ --basename $prefix \\ --threads $task.cpus \\ --settings ${prefix}.log \\ @@ -57,15 +50,18 @@ process ADAPTERREMOVAL { --seed 42 \\ --gzip \\ - AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + adapterremoval: \$(AdapterRemoval --version 2>&1 | sed -e "s/AdapterRemoval ver. //g") + END_VERSIONS """ } else { """ AdapterRemoval \\ --file1 ${reads[0]} \\ - --file2 ${reads[0]} \\ + --file2 ${reads[1]} \\ --collapse \\ - $options.args \\ + $args \\ --basename $prefix \\ --threads $task.cpus \\ --settings ${prefix}.log \\ @@ -73,7 +69,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 + "${task.process}": + adapterremoval: \$(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..05386fd8 100644 --- a/modules/adapterremoval/meta.yml +++ b/modules/adapterremoval/meta.yml @@ -41,10 +41,10 @@ output: type: file description: AdapterRemoval log file pattern: "*.log" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@maxibor" diff --git a/modules/agrvate/main.nf b/modules/agrvate/main.nf new file mode 100644 index 00000000..aff72abc --- /dev/null +++ b/modules/agrvate/main.nf @@ -0,0 +1,31 @@ +process AGRVATE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::agrvate=1.0.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/agrvate:1.0.2--hdfd78af_0' : + 'quay.io/biocontainers/agrvate:1.0.2--hdfd78af_0' }" + + input: + tuple val(meta), path(fasta) + + 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: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + agrvate \\ + $args \\ + -i $fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + agrvate: \$(echo \$(agrvate -v 2>&1) | sed 's/agrvate v//;') + END_VERSIONS + """ +} diff --git a/modules/agrvate/meta.yml b/modules/agrvate/meta.yml new file mode 100644 index 00000000..a8ab5816 --- /dev/null +++ b/modules/agrvate/meta.yml @@ -0,0 +1,46 @@ +name: agrvate +description: Rapid identification of Staphylococcus aureus agr locus type and agr operon variants +keywords: + - fasta + - virulence + - Staphylococcus aureus +tools: + - agrvate: + description: Rapid identification of Staphylococcus aureus agr locus type and agr operon variants. + homepage: https://github.com/VishnuRaghuram94/AgrVATE + documentation: https://github.com/VishnuRaghuram94/AgrVATE + tool_dev_url: https://github.com/VishnuRaghuram94/AgrVATE + doi: "" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: A Staphylococcus aureus fasta file. + pattern: "*.fasta" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - summary: + type: file + description: A summary of the agrvate assessement + pattern: "*-summary.tab" + - results_dir: + type: directory + description: Results of the agrvate assessement + pattern: "*-results" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@abhi18av" diff --git a/modules/allelecounter/functions.nf b/modules/allelecounter/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/allelecounter/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 8f090566..850a018f 100644 --- a/modules/allelecounter/main.nf +++ b/modules/allelecounter/main.nf @@ -1,41 +1,37 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process ALLELECOUNTER { 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::cancerit-allelecount=4.2.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/cancerit-allelecount:4.2.1--h3ecb661_0" - } else { - container "quay.io/biocontainers/cancerit-allelecount:4.2.1--h3ecb661_0" - } + conda (params.enable_conda ? 'bioconda::cancerit-allelecount=4.3.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cancerit-allelecount:4.3.0--h41abebc_0' : + 'quay.io/biocontainers/cancerit-allelecount:4.3.0--h41abebc_0' }" input: - tuple val(meta), path(bam), path(bai) + tuple val(meta), path(input), path(input_index) path loci + path fasta output: tuple val(meta), path("*.alleleCount"), emit: allelecount - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def reference_options = fasta ? "-r $fasta": "" + """ alleleCounter \\ - $options.args \\ + $args \\ -l $loci \\ - -b $bam \\ + -b $input \\ + $reference_options \\ -o ${prefix}.alleleCount - alleleCounter --version > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + allelecounter: \$(alleleCounter --version) + END_VERSIONS """ } diff --git a/modules/allelecounter/meta.yml b/modules/allelecounter/meta.yml index 28f96836..7d921e12 100644 --- a/modules/allelecounter/meta.yml +++ b/modules/allelecounter/meta.yml @@ -19,11 +19,11 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bam: + - input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" - - bai: + - input_index: type: file description: BAM/CRAM/SAM index file pattern: "*.{bai,crai,sai}" @@ -31,7 +31,9 @@ input: type: file description: loci file pattern: "*.{tsv}" - + - fasta: + type: file + description: Input genome fasta file. Required when passing CRAM files. output: - meta: @@ -39,10 +41,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - alleleCount: type: file description: Allele count file @@ -50,3 +52,4 @@ output: authors: - "@fullama" + - "@fbdtemme" diff --git a/modules/amps/main.nf b/modules/amps/main.nf new file mode 100644 index 00000000..871b57c6 --- /dev/null +++ b/modules/amps/main.nf @@ -0,0 +1,37 @@ +process AMPS { + label 'process_low' + + conda (params.enable_conda ? "bioconda::hops=0.35" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hops:0.35--hdfd78af_1' : + '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: versions + + script: + def args = task.ext.args ?: '' + """ + postprocessing.AMPS.r \\ + -r $maltextract_results \\ + -n $taxon_list \\ + -m $filter \\ + -t $task.cpus \\ + -j \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${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..43d68599 --- /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: + - versions: + type: file + description: File containing software versions + 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/modules/arriba/main.nf b/modules/arriba/main.nf new file mode 100644 index 00000000..0fcb6ba7 --- /dev/null +++ b/modules/arriba/main.nf @@ -0,0 +1,39 @@ +process ARRIBA { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::arriba=2.1.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/arriba:2.1.0--h3198e80_1' : + 'quay.io/biocontainers/arriba:2.1.0--h3198e80_1' }" + + input: + tuple val(meta), path(bam) + path fasta + path gtf + + output: + tuple val(meta), path("*.fusions.tsv") , emit: fusions + tuple val(meta), path("*.fusions.discarded.tsv"), emit: fusions_fail + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def blacklist = (args.contains('-b')) ? '' : '-f blacklist' + """ + arriba \\ + -x $bam \\ + -a $fasta \\ + -g $gtf \\ + -o ${prefix}.fusions.tsv \\ + -O ${prefix}.fusions.discarded.tsv \\ + $blacklist \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + arriba: \$(arriba -h | grep 'Version:' 2>&1 | sed 's/Version:\s//') + END_VERSIONS + """ +} diff --git a/modules/arriba/meta.yml b/modules/arriba/meta.yml new file mode 100644 index 00000000..6ca16dab --- /dev/null +++ b/modules/arriba/meta.yml @@ -0,0 +1,54 @@ +name: arriba +description: Arriba is a command-line tool for the detection of gene fusions from RNA-Seq data. +keywords: + - fusion + - arriba +tools: + - arriba: + description: Fast and accurate gene fusion detection from RNA-Seq data + homepage: https://github.com/suhrig/arriba + documentation: https://arriba.readthedocs.io/en/latest/ + tool_dev_url: https://github.com/suhrig/arriba + doi: "10.1101/gr.257246.119" + 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}" + - fasta: + type: file + description: Assembly FASTA file + pattern: "*.{fasta}" + - gtf: + type: file + description: Annotation GTF file + pattern: "*.{gtf}" + +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" + - fusions: + type: file + description: File contains fusions which pass all of Arriba's filters. + pattern: "*.{fusions.tsv}" + - fusions_fail: + type: file + description: File contains fusions that Arriba classified as an artifact or that are also observed in healthy tissue. + pattern: "*.{fusions.discarded.tsv}" + +authors: + - "@praveenraj2018" diff --git a/modules/artic/guppyplex/functions.nf b/modules/artic/guppyplex/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/artic/guppyplex/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..780f5111 100644 --- a/modules/artic/guppyplex/main.nf +++ b/modules/artic/guppyplex/main.nf @@ -1,41 +1,33 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process ARTIC_GUPPYPLEX { 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::artic=1.2.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/artic:1.2.1--py_0" - } else { - container "quay.io/biocontainers/artic:1.2.1--py_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/artic:1.2.1--py_0' : + 'quay.io/biocontainers/artic:1.2.1--py_0' }" input: tuple val(meta), path(fastq_dir) output: tuple val(meta), path("*.fastq.gz"), emit: fastq - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ artic \\ guppyplex \\ - $options.args \\ + $args \\ --directory $fastq_dir \\ --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 + "${task.process}": + artic: \$(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..5056f908 100644 --- a/modules/artic/guppyplex/meta.yml +++ b/modules/artic/guppyplex/meta.yml @@ -34,10 +34,10 @@ output: type: file description: Aggregated FastQ files pattern: "*.{fastq.gz}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/artic/minion/functions.nf b/modules/artic/minion/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/artic/minion/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..ce04fcc8 100644 --- a/modules/artic/minion/main.nf +++ b/modules/artic/minion/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process ARTIC_MINION { 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::artic=1.2.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/artic:1.2.1--py_0" - } else { - container "quay.io/biocontainers/artic:1.2.1--py_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/artic:1.2.1--py_0' : + 'quay.io/biocontainers/artic:1.2.1--py_0' }" input: tuple val(meta), path(fastq) @@ -40,24 +29,24 @@ 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: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" def version = scheme_version.toString().toLowerCase().replaceAll('v','') - def fast5 = params.fast5_dir ? "--fast5-directory $fast5_dir" : "" - def summary = params.sequencing_summary ? "--sequencing-summary $sequencing_summary" : "" + def fast5 = fast5_dir ? "--fast5-directory $fast5_dir" : "" + def summary = sequencing_summary ? "--sequencing-summary $sequencing_summary" : "" def model = "" - if (options.args.tokenize().contains('--medaka')) { + if (args.tokenize().contains('--medaka')) { fast5 = "" summary = "" - model = file(params.artic_minion_medaka_model).exists() ? "--medaka-model ./$medaka_model" : "--medaka-model $params.artic_minion_medaka_model" + model = file(medaka_model).exists() ? "--medaka-model ./$medaka_model" : "--medaka-model $medaka_model" } """ artic \\ minion \\ - $options.args \\ + $args \\ --threads $task.cpus \\ --read-file $fastq \\ --scheme-directory ./primer-schemes \\ @@ -68,6 +57,9 @@ process ARTIC_MINION { $scheme \\ $prefix - echo \$(artic --version 2>&1) | sed 's/^.*artic //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + artic: \$(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..464e1dc7 100644 --- a/modules/artic/minion/meta.yml +++ b/modules/artic/minion/meta.yml @@ -103,10 +103,10 @@ output: type: file description: JSON file for MultiQC pattern: "*.json" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/assemblyscan/main.nf b/modules/assemblyscan/main.nf new file mode 100644 index 00000000..56541222 --- /dev/null +++ b/modules/assemblyscan/main.nf @@ -0,0 +1,28 @@ +process ASSEMBLYSCAN { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::assembly-scan=0.4.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/assembly-scan:0.4.1--pyhdfd78af_0' : + 'quay.io/biocontainers/assembly-scan:0.4.1--pyhdfd78af_0' }" + + input: + tuple val(meta), path(assembly) + + output: + tuple val(meta), path("*.json"), emit: json + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + assembly-scan $assembly > ${prefix}.json + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + assemblyscan: \$( assembly-scan --version 2>&1 | sed 's/^.*assembly-scan //; s/Using.*\$//' ) + END_VERSIONS + """ +} diff --git a/modules/assemblyscan/meta.yml b/modules/assemblyscan/meta.yml new file mode 100644 index 00000000..40ea98b9 --- /dev/null +++ b/modules/assemblyscan/meta.yml @@ -0,0 +1,43 @@ +name: assemblyscan +description: Assembly summary statistics in JSON format +keywords: + - assembly + - statistics +tools: + - assemblyscan: + description: Assembly summary statistics in JSON format + homepage: https://github.com/rpetit3/assembly-scan + documentation: https://github.com/rpetit3/assembly-scan + tool_dev_url: https://github.com/rpetit3/assembly-scan + doi: "" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - assembly: + type: file + description: FASTA file for a given assembly + pattern: "*.fasta" + +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" + - json: + type: file + description: Assembly statistics in JSON format + pattern: "*.json" + +authors: + - "@sateeshperi" + - "@mjcipriano" diff --git a/modules/ataqv/ataqv/main.nf b/modules/ataqv/ataqv/main.nf new file mode 100644 index 00000000..20525e85 --- /dev/null +++ b/modules/ataqv/ataqv/main.nf @@ -0,0 +1,47 @@ +process ATAQV_ATAQV { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::ataqv=1.2.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ataqv:1.2.1--py39ha23c084_2' : + 'quay.io/biocontainers/ataqv:1.2.1--py36hfdecbe1_2' }" + + input: + tuple val(meta), path(bam), path(bai), path(peak_file) + val organism + path tss_file + path excl_regs_file + path autosom_ref_file + + output: + tuple val(meta), path("*.ataqv.json"), emit: json + tuple val(meta), path("*.problems") , emit: problems, optional: true + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def peak = peak_file ? "--peak-file $peak_file" : '' + def tss = tss_file ? "--tss-file $tss_file" : '' + def excl_regs = excl_regs_file ? "--excluded-region-file $excl_regs_file" : '' + def autosom_ref = autosom_ref_file ? "--autosomal-reference-file $autosom_ref_file" : '' + """ + ataqv \\ + $args \\ + $peak \\ + $tss \\ + $excl_regs \\ + $autosom_ref \\ + --metrics-file "${prefix}.ataqv.json" \\ + --threads $task.cpus \\ + --name $prefix \\ + $organism \\ + $bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ataqv: \$( ataqv --version ) + END_VERSIONS + """ +} diff --git a/modules/ataqv/ataqv/meta.yml b/modules/ataqv/ataqv/meta.yml new file mode 100644 index 00000000..760bf95f --- /dev/null +++ b/modules/ataqv/ataqv/meta.yml @@ -0,0 +1,66 @@ +name: ataqv_ataqv +description: ataqv function of a corresponding ataqv tool +keywords: + - ataqv +tools: + - ataqv: + description: ataqv is a toolkit for measuring and comparing ATAC-seq results. It was written to help understand how well ATAC-seq assays have worked, and to make it easier to spot differences that might be caused by library prep or sequencing. + homepage: https://github.com/ParkerLab/ataqv/blob/master/README.rst + documentation: https://github.com/ParkerLab/ataqv/blob/master/README.rst + tool_dev_url: https://github.com/ParkerLab/ataqv + doi: "https://doi.org/10.1016/j.cels.2020.02.009" + 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 file + pattern: "*.bam" + - bai: + type: file + description: BAM index file with the same prefix as bam file. Required if tss_file input is provided. + pattern: "*.bam.bai" + - peak_file: + type: file + description: A BED file of peaks called for alignments in the BAM file + pattern: "*.bed" + - organism: + type: string + description: The subject of the experiment, which determines the list of autosomes (see "Reference Genome Configuration" section at https://github.com/ParkerLab/ataqv). + - tss_file: + type: file + description: A BED file of transcription start sites for the experiment organism. If supplied, a TSS enrichment score will be calculated according to the ENCODE data standards. This calculation requires that the BAM file of alignments be indexed. + pattern: "*.bed" + - excl_regs_file: + type: file + description: A BED file containing excluded regions. Peaks or TSS overlapping these will be ignored. + pattern: "*.bed" + - autosom_ref_file: + type: file + description: A file containing autosomal reference names, one per line. The names must match the reference names in the alignment file exactly, or the metrics based on counts of autosomal alignments will be wrong. + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - json: + type: file + description: The JSON file to which metrics will be written. + - problems: + type: file + description: If given, problematic reads will be logged to a file per read group, with names derived from the read group IDs, with ".problems" appended. If no read groups are found, the reads will be written to one file named after the BAM file. + pattern: "*.problems" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@i-pletenev" diff --git a/modules/bakta/main.nf b/modules/bakta/main.nf new file mode 100644 index 00000000..2582dac2 --- /dev/null +++ b/modules/bakta/main.nf @@ -0,0 +1,67 @@ +process BAKTA { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bakta=1.2.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bakta:1.2.2--pyhdfd78af_0' : + 'quay.io/biocontainers/bakta:1.2.2--pyhdfd78af_0' }" + + input: + tuple val(meta), path(fasta) + path db + path proteins + path prodigal_tf + + output: + tuple val(meta), path("${prefix}.embl") , emit: embl + tuple val(meta), path("${prefix}.faa") , emit: faa + tuple val(meta), path("${prefix}.ffn") , emit: ffn + tuple val(meta), path("${prefix}.fna") , emit: fna + tuple val(meta), path("${prefix}.gbff") , emit: gbff + tuple val(meta), path("${prefix}.gff3") , emit: gff + tuple val(meta), path("${prefix}.hypotheticals.tsv"), emit: hypotheticals_tsv + tuple val(meta), path("${prefix}.hypotheticals.faa"), emit: hypotheticals_faa + tuple val(meta), path("${prefix}.tsv") , emit: tsv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def proteins_opt = proteins ? "--proteins ${proteins[0]}" : "" + def prodigal_opt = prodigal_tf ? "--prodigal-tf ${prodigal_tf[0]}" : "" + """ + bakta \\ + $args \\ + --threads $task.cpus \\ + --prefix $prefix \\ + --db $db \\ + $proteins_opt \\ + $prodigal_tf \\ + $fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bakta: \$( echo \$(bakta --version 2>&1) | sed 's/^.*bakta //' ) + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.embl + touch ${prefix}.faa + touch ${prefix}.ffn + touch ${prefix}.fna + touch ${prefix}.gbff + touch ${prefix}.gff3 + touch ${prefix}.hypotheticals.tsv + touch ${prefix}.hypotheticals.faa + touch ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bakta: \$( echo \$(bakta --version 2>&1) | sed 's/^.*bakta //' ) + END_VERSIONS + """ +} diff --git a/modules/bakta/meta.yml b/modules/bakta/meta.yml new file mode 100644 index 00000000..29e6edbe --- /dev/null +++ b/modules/bakta/meta.yml @@ -0,0 +1,85 @@ +name: bakta +description: Rapid annotation of bacterial genomes & plasmids. +keywords: + - annotation + - fasta + - prokaryote +tools: + - bakta: + description: Rapid & standardized annotation of bacterial genomes & plasmids. + homepage: https://github.com/oschwengers/bakta + documentation: https://github.com/oschwengers/bakta + tool_dev_url: https://github.com/oschwengers/bakta + doi: "10.1099/mgen.0.000685" + 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 file to be annotated. Has to contain at least a non-empty string dummy value. + - db: + type: file + description: | + Path to the Bakta database + - proteins: + type: file + description: FASTA file of trusted proteins to first annotate from (optional) + - prodigal_tf: + type: file + description: Training file to use for Prodigal (optional) + +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: annotations as simple human readble tab separated values + pattern: "*.tsv" + - gff: + type: file + description: annotations & sequences in GFF3 format + pattern: "*.gff3" + - gbff: + type: file + description: annotations & sequences in (multi) GenBank format + pattern: "*.gbff" + - embl: + type: file + description: annotations & sequences in (multi) EMBL format + pattern: "*.embl" + - fna: + type: file + description: replicon/contig DNA sequences as FASTA + pattern: "*.fna" + - faa: + type: file + description: CDS/sORF amino acid sequences as FASTA + pattern: "*.faa" + - ffn: + type: file + description: feature nucleotide sequences as FASTA + pattern: "*.ffn" + - hypotheticals_tsv: + type: file + description: further information on hypothetical protein CDS as simple human readble tab separated values + pattern: "*.hypotheticals.tsv" + - hypotheticals_faa: + type: file + description: hypothetical protein CDS amino acid sequences as FASTA + pattern: "*.hypotheticals.faa" + +authors: + - "@rpetit3" diff --git a/modules/bamaligncleaner/main.nf b/modules/bamaligncleaner/main.nf new file mode 100644 index 00000000..88fe21aa --- /dev/null +++ b/modules/bamaligncleaner/main.nf @@ -0,0 +1,32 @@ +process BAMALIGNCLEANER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::bamaligncleaner=0.2.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bamaligncleaner:0.2.1--pyhdfd78af_0' : + 'quay.io/biocontainers/bamaligncleaner:0.2.1--pyhdfd78af_0' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.bam"), emit: bam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + bamAlignCleaner \\ + $args \\ + -o ${prefix}.bam \\ + ${bam} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bamaligncleaner: \$(bamAlignCleaner --version | sed 's/.*version //') + END_VERSIONS + """ +} diff --git a/modules/bamaligncleaner/meta.yml b/modules/bamaligncleaner/meta.yml new file mode 100644 index 00000000..d1e171f7 --- /dev/null +++ b/modules/bamaligncleaner/meta.yml @@ -0,0 +1,40 @@ +name: bamaligncleaner +description: removes unused references from header of sorted BAM/CRAM files. +keywords: + - bam +tools: + - bamaligncleaner: + description: Removes unaligned references in aligned BAM alignment file + homepage: https://github.com/maxibor/bamAlignCleaner + documentation: https://github.com/maxibor/bamAlignCleaner + tool_dev_url: https://github.com/maxibor/bamAlignCleaner + 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}" + +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: Sorted BAM/CRAM file + pattern: "*.{bam,cram}" + +authors: + - "@jfy133" diff --git a/modules/bamtools/split/main.nf b/modules/bamtools/split/main.nf new file mode 100644 index 00000000..8d5e5690 --- /dev/null +++ b/modules/bamtools/split/main.nf @@ -0,0 +1,31 @@ +process BAMTOOLS_SPLIT { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::bamtools=2.5.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bamtools:2.5.1--h9a82719_9' : + '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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + bamtools \\ + split \\ + -in $bam \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${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/modules/bamutil/trimbam/main.nf b/modules/bamutil/trimbam/main.nf new file mode 100644 index 00000000..9ceb2b65 --- /dev/null +++ b/modules/bamutil/trimbam/main.nf @@ -0,0 +1,34 @@ +process BAMUTIL_TRIMBAM { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::bamutil=1.0.15" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bamutil:1.0.15--h2e03b76_1' : + 'quay.io/biocontainers/bamutil:1.0.15--h2e03b76_1' }" + + input: + tuple val(meta), path(bam), val(trim_left), val(trim_right) + + output: + tuple val(meta), path("*.bam"), emit: bam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + bam \\ + trimBam \\ + $bam \\ + ${prefix}.bam \\ + $args \\ + -L $trim_left \\ + -R $trim_right + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bamutil: \$( echo \$( bam trimBam 2>&1 ) | sed 's/^Version: //;s/;.*//' ) + END_VERSIONS + """ +} diff --git a/modules/bamutil/trimbam/meta.yml b/modules/bamutil/trimbam/meta.yml new file mode 100644 index 00000000..a91ba0e1 --- /dev/null +++ b/modules/bamutil/trimbam/meta.yml @@ -0,0 +1,51 @@ +name: bamutil_trimbam +description: trims the end of reads in a SAM/BAM file, changing read ends to ‘N’ and quality to ‘!’, or by soft clipping +keywords: + - bam + - trim + - clipping + - bamUtil + - trimBam +tools: + - bamutil: + description: Programs that perform operations on SAM/BAM files, all built into a single executable, bam. + homepage: https://genome.sph.umich.edu/wiki/BamUtil + documentation: https://genome.sph.umich.edu/wiki/BamUtil:_trimBam + tool_dev_url: https://github.com/statgen/bamUtil + doi: "10.1101/gr.176552.114" + 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 file + pattern: "*.bam" + - trim_left: + type: integer + description: Number of bases to trim off the right-hand side of a read. Reverse strands are reversed before trimming. + - trim_right: + type: integer + description: Number of bases to trim off the right-hand side of a read. Reverse strands are reversed before trimming. + +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: Trimmed but unsorted BAM file + pattern: "*.bam" + +authors: + - "@jfy133" diff --git a/modules/bandage/image/functions.nf b/modules/bandage/image/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bandage/image/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..bc2a9495 100644 --- a/modules/bandage/image/main.nf +++ b/modules/bandage/image/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BANDAGE_IMAGE { 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::bandage=0.8.1' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bandage:0.8.1--hc9558a2_2" - } else { - container "quay.io/biocontainers/bandage:0.8.1--hc9558a2_2" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bandage:0.8.1--hc9558a2_2' : + 'quay.io/biocontainers/bandage:0.8.1--hc9558a2_2' }" input: tuple val(meta), path(gfa) @@ -24,15 +13,18 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ - Bandage image $gfa ${prefix}.png $options.args - Bandage image $gfa ${prefix}.svg $options.args + Bandage image $gfa ${prefix}.png $args + Bandage image $gfa ${prefix}.svg $args - echo \$(Bandage --version 2>&1) | sed 's/^.*Version: //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bandage: \$(echo \$(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..1c2b9840 100644 --- a/modules/bandage/image/meta.yml +++ b/modules/bandage/image/meta.yml @@ -11,6 +11,7 @@ tools: Bandage - a Bioinformatics Application for Navigating De novo Assembly Graphs Easily homepage: https://github.com/rrwick/Bandage documentation: https://github.com/rrwick/Bandage + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -35,9 +36,9 @@ output: type: file description: Bandage image in SVG format pattern: "*.svg" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/bbmap/align/main.nf b/modules/bbmap/align/main.nf new file mode 100644 index 00000000..ac839497 --- /dev/null +++ b/modules/bbmap/align/main.nf @@ -0,0 +1,55 @@ +process BBMAP_ALIGN { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bbmap=38.92 bioconda::samtools=1.13 pigz=2.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-008daec56b7aaf3f162d7866758142b9f889d690:f5f55fc5623bb7b3f725e8d2f86bedacfd879510-0' : + 'quay.io/biocontainers/mulled-v2-008daec56b7aaf3f162d7866758142b9f889d690:f5f55fc5623bb7b3f725e8d2f86bedacfd879510-0' }" + + input: + tuple val(meta), path(fastq) + path ref + + output: + tuple val(meta), path("*.bam"), emit: bam + tuple val(meta), path("*.log"), emit: log + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + input = meta.single_end ? "in=${fastq}" : "in=${fastq[0]} in2=${fastq[1]}" + + // Set the db variable to reflect the three possible types of reference input: 1) directory + // named 'ref', 2) directory named something else (containg a 'ref' subdir) or 3) a sequence + // file in fasta format + if ( ref.isDirectory() ) { + if ( ref ==~ /(.\/)?ref\/?/ ) { + db = '' + } else { + db = "path=${ref}" + } + } else { + db = "ref=${ref}" + } + + """ + bbmap.sh \\ + $db \\ + $input \\ + out=${prefix}.bam \\ + $args \\ + threads=$task.cpus \\ + -Xmx${task.memory.toGiga()}g \\ + &> ${prefix}.bbmap.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bbmap: \$(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/bbmap/align/meta.yml b/modules/bbmap/align/meta.yml new file mode 100644 index 00000000..fe4d4334 --- /dev/null +++ b/modules/bbmap/align/meta.yml @@ -0,0 +1,52 @@ +name: bbmap_align +description: write your description here +keywords: + - align + - map + - fasta + - 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 ] + - fastq: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + - ref: + type: file + description: | + Either "ref" a directory containing an index, the name of another directory + with a "ref" subdirectory containing an index or the name of a fasta formatted + nucleotide file containg the reference to map to. + +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: BAM file + pattern: "*.{bam}" + +authors: + - "@erikrikarddaniel" diff --git a/modules/bbmap/bbduk/functions.nf b/modules/bbmap/bbduk/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bbmap/bbduk/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..79c3c306 100644 --- a/modules/bbmap/bbduk/main.nf +++ b/modules/bbmap/bbduk/main.nf @@ -1,21 +1,11 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BBMAP_BBDUK { 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::bbmap=38.90" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bbmap:38.90--he522d1c_1" - } else { - container "quay.io/biocontainers/bbmap:38.90--he522d1c_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bbmap:38.90--he522d1c_1' : + 'quay.io/biocontainers/bbmap:38.90--he522d1c_1' }" input: tuple val(meta), path(reads) @@ -24,11 +14,11 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${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" def contaminants_fa = contaminants ? "ref=$contaminants" : '' @@ -39,9 +29,12 @@ process BBMAP_BBDUK { $raw \\ $trimmed \\ threads=$task.cpus \\ - $options.args \\ + $args \\ $contaminants_fa \\ &> ${prefix}.bbduk.log - echo \$(bbversion.sh) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bbmap: \$(bbversion.sh) + END_VERSIONS """ } diff --git a/modules/bbmap/bbduk/meta.yml b/modules/bbmap/bbduk/meta.yml index ee2eea2c..50ab6ed4 100644 --- a/modules/bbmap/bbduk/meta.yml +++ b/modules/bbmap/bbduk/meta.yml @@ -39,10 +39,10 @@ output: type: file description: The trimmed/modified fastq reads pattern: "*fastq.gz" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - log: type: file description: Bbduk log file diff --git a/modules/bbmap/bbsplit/main.nf b/modules/bbmap/bbsplit/main.nf new file mode 100644 index 00000000..0c916dfe --- /dev/null +++ b/modules/bbmap/bbsplit/main.nf @@ -0,0 +1,84 @@ +process BBMAP_BBSPLIT { + label 'process_high' + + conda (params.enable_conda ? "bioconda::bbmap=38.93" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bbmap:38.93--he522d1c_0' : + '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: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${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 \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bbmap: \$(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 \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bbmap: \$(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..2e3d07c0 --- /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 ] + - versions: + type: file + description: File containing software versions + 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/modules/bbmap/index/main.nf b/modules/bbmap/index/main.nf new file mode 100644 index 00000000..4c02f84e --- /dev/null +++ b/modules/bbmap/index/main.nf @@ -0,0 +1,31 @@ +process BBMAP_INDEX { + tag "$fasta" + label 'process_long' + + conda (params.enable_conda ? "bioconda::bbmap=38.92" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bbmap:38.92--he522d1c_0' : + 'quay.io/biocontainers/bbmap:38.92--he522d1c_0' }" + + input: + path fasta + + output: + path 'ref' , emit: index + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + """ + bbmap.sh \\ + ref=${fasta} \\ + $args \\ + threads=$task.cpus \\ + -Xmx${task.memory.toGiga()}g + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bbmap: \$(bbversion.sh) + END_VERSIONS + """ +} diff --git a/modules/bbmap/index/meta.yml b/modules/bbmap/index/meta.yml new file mode 100644 index 00000000..0b3e5778 --- /dev/null +++ b/modules/bbmap/index/meta.yml @@ -0,0 +1,33 @@ +name: bbmap_index +description: This module calls bbmap.sh to create an index from a fasta file, ready to be used by bbmap.sh in mapping mode. +keywords: + - mapping + - index + - fasta +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: + - fasta: + type: fasta + description: fasta formatted file with nucleotide sequences + pattern: "*.{fna,fa,fasta}" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - db: + type: directory + description: Directory with index files + pattern: "ref" + +authors: + - "@daniellundin" diff --git a/modules/bcftools/concat/main.nf b/modules/bcftools/concat/main.nf new file mode 100644 index 00000000..cebd2443 --- /dev/null +++ b/modules/bcftools/concat/main.nf @@ -0,0 +1,32 @@ +process BCFTOOLS_CONCAT { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bcftools=1.11" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0' : + 'quay.io/biocontainers/bcftools:1.11--h7c999a4_0' }" + + input: + tuple val(meta), path(vcfs) + + output: + tuple val(meta), path("*.gz"), emit: vcf + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + bcftools concat \\ + --output ${prefix}.vcf.gz \\ + $args \\ + --threads $task.cpus \\ + ${vcfs} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(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 new file mode 100644 index 00000000..b2848595 --- /dev/null +++ b/modules/bcftools/concat/meta.yml @@ -0,0 +1,43 @@ +name: bcftools_concat +description: Concatenate VCF files +keywords: + - variant calling + - concat + - bcftools + - VCF + +tools: + - concat: + description: | + Concatenate VCF files. + homepage: http://samtools.github.io/bcftools/bcftools.html + documentation: http://www.htslib.org/doc/bcftools.html + doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcfs: + type: files + description: | + List containing 2 or more vcf files + e.g. [ 'file1.vcf', 'file2.vcf' ] +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF concatenated output file + pattern: "*.{vcf.gz}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@abhi18av" diff --git a/modules/bcftools/consensus/functions.nf b/modules/bcftools/consensus/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bcftools/consensus/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 67321fc2..4633790e 100644 --- a/modules/bcftools/consensus/main.nf +++ b/modules/bcftools/consensus/main.nf @@ -1,38 +1,30 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BCFTOOLS_CONSENSUS { 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::bcftools=1.11' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0' - } else { - container 'quay.io/biocontainers/bcftools:1.11--h7c999a4_0' - } + conda (params.enable_conda ? 'bioconda::bcftools=1.13' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0' : + 'quay.io/biocontainers/bcftools:1.13--h3a49de5_0' }" input: tuple val(meta), path(vcf), path(tbi), path(fasta) output: tuple val(meta), path('*.fa'), emit: fasta - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ - cat $fasta | bcftools consensus $vcf $options.args > ${prefix}.fa + cat $fasta | bcftools consensus $vcf $args > ${prefix}.fa 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 + "${task.process}": + bcftools: \$(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..761115a6 100644 --- a/modules/bcftools/consensus/meta.yml +++ b/modules/bcftools/consensus/meta.yml @@ -11,6 +11,7 @@ tools: homepage: http://samtools.github.io/bcftools/bcftools.html documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -39,10 +40,10 @@ output: type: file description: FASTA reference consensus file pattern: "*.{fasta,fa}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/filter/functions.nf b/modules/bcftools/filter/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bcftools/filter/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 d7ec0d2b..95e0249a 100644 --- a/modules/bcftools/filter/main.nf +++ b/modules/bcftools/filter/main.nf @@ -1,39 +1,31 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BCFTOOLS_FILTER { 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::bcftools=1.11" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" - } else { - container "quay.io/biocontainers/bcftools:1.11--h7c999a4_0" - } + conda (params.enable_conda ? 'bioconda::bcftools=1.13' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0' : + 'quay.io/biocontainers/bcftools:1.13--h3a49de5_0' }" input: tuple val(meta), path(vcf) output: tuple val(meta), path("*.gz"), emit: vcf - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bcftools filter \\ --output ${prefix}.vcf.gz \\ - $options.args \\ + $args \\ $vcf - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(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..72d28bf0 100644 --- a/modules/bcftools/filter/meta.yml +++ b/modules/bcftools/filter/meta.yml @@ -11,6 +11,7 @@ tools: homepage: http://samtools.github.io/bcftools/bcftools.html documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -31,10 +32,10 @@ output: type: file description: VCF filtered output file pattern: "*.{vcf}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/index/main.nf b/modules/bcftools/index/main.nf new file mode 100644 index 00000000..0cdebf31 --- /dev/null +++ b/modules/bcftools/index/main.nf @@ -0,0 +1,34 @@ +process BCFTOOLS_INDEX { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? 'bioconda::bcftools=1.13' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0' : + '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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + bcftools \\ + index \\ + $args \\ + --threads $task.cpus \\ + $vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(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..0d5dd3ef --- /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: ['MIT', 'GPL-3.0-or-later'] + +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/modules/bcftools/isec/functions.nf b/modules/bcftools/isec/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bcftools/isec/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 b0bde522..08323f28 100644 --- a/modules/bcftools/isec/main.nf +++ b/modules/bcftools/isec/main.nf @@ -1,38 +1,30 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BCFTOOLS_ISEC { 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::bcftools=1.11" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" - } else { - container "quay.io/biocontainers/bcftools:1.11--h7c999a4_0" - } + conda (params.enable_conda ? 'bioconda::bcftools=1.13' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0' : + 'quay.io/biocontainers/bcftools:1.13--h3a49de5_0' }" input: tuple val(meta), path(vcfs), path(tbis) output: tuple val(meta), path("${prefix}"), emit: results - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" """ bcftools isec \\ - $options.args \\ + $args \\ -p $prefix \\ *.vcf.gz - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(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..d0be6dce 100644 --- a/modules/bcftools/isec/meta.yml +++ b/modules/bcftools/isec/meta.yml @@ -13,6 +13,7 @@ tools: homepage: http://samtools.github.io/bcftools/bcftools.html documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -39,10 +40,10 @@ 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 - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/merge/functions.nf b/modules/bcftools/merge/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bcftools/merge/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 09bc2e7d..bfb0f162 100644 --- a/modules/bcftools/merge/main.nf +++ b/modules/bcftools/merge/main.nf @@ -1,38 +1,30 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BCFTOOLS_MERGE { 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::bcftools=1.11" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" - } else { - container "quay.io/biocontainers/bcftools:1.11--h7c999a4_0" - } + conda (params.enable_conda ? 'bioconda::bcftools=1.13' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0' : + 'quay.io/biocontainers/bcftools:1.13--h3a49de5_0' }" input: tuple val(meta), path(vcfs), path(tbis) output: tuple val(meta), path("*.gz"), emit: vcf - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" """ bcftools merge -Oz \\ --output ${prefix}.vcf.gz \\ - $options.args \\ + $args \\ *.vcf.gz - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(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..c7e3a280 100644 --- a/modules/bcftools/merge/meta.yml +++ b/modules/bcftools/merge/meta.yml @@ -11,6 +11,7 @@ tools: homepage: http://samtools.github.io/bcftools/bcftools.html documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -37,10 +38,10 @@ output: type: file description: VCF merged output file pattern: "*.{vcf.gz}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/mpileup/functions.nf b/modules/bcftools/mpileup/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bcftools/mpileup/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 287a0c9d..8a209a66 100644 --- a/modules/bcftools/mpileup/main.nf +++ b/modules/bcftools/mpileup/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BCFTOOLS_MPILEUP { 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::bcftools=1.11" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" - } else { - container "quay.io/biocontainers/bcftools:1.11--h7c999a4_0" - } + conda (params.enable_conda ? 'bioconda::bcftools=1.13' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0' : + 'quay.io/biocontainers/bcftools:1.13--h3a49de5_0' }" input: tuple val(meta), path(bam) @@ -26,22 +15,31 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def args3 = task.ext.args3 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ echo "${meta.id}" > sample_name.list + bcftools mpileup \\ --fasta-ref $fasta \\ - $options.args \\ + $args \\ $bam \\ - | bcftools call --output-type v $options.args2 \\ + | bcftools call --output-type v $args2 \\ | bcftools reheader --samples sample_name.list \\ - | bcftools view --output-file ${prefix}.vcf.gz --output-type z $options.args3 + | bcftools view --output-file ${prefix}.vcf.gz --output-type z $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 + "${task.process}": + bcftools: \$(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..c31180ee 100644 --- a/modules/bcftools/mpileup/meta.yml +++ b/modules/bcftools/mpileup/meta.yml @@ -11,6 +11,7 @@ tools: homepage: http://samtools.github.io/bcftools/bcftools.html documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -43,10 +44,10 @@ output: type: file description: Text output file containing stats pattern: "*{stats.txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/norm/main.nf b/modules/bcftools/norm/main.nf new file mode 100644 index 00000000..95da56db --- /dev/null +++ b/modules/bcftools/norm/main.nf @@ -0,0 +1,34 @@ +process BCFTOOLS_NORM { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bcftools=1.13" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0' : + 'quay.io/biocontainers/bcftools:1.13--h3a49de5_0' }" + + input: + tuple val(meta), path(vcf) + path(fasta) + + output: + tuple val(meta), path("*.gz") , emit: vcf + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + bcftools norm \\ + --fasta-ref ${fasta} \\ + --output ${prefix}.vcf.gz \\ + $args \\ + --threads $task.cpus \\ + ${vcf} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(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 new file mode 100644 index 00000000..27978a53 --- /dev/null +++ b/modules/bcftools/norm/meta.yml @@ -0,0 +1,46 @@ +name: bcftools_norm +description: Normalize VCF file +keywords: + - normalize + - norm + - variant calling + - VCF +tools: + - norm: + description: | + Normalize VCF files. + homepage: http://samtools.github.io/bcftools/bcftools.html + documentation: http://www.htslib.org/doc/bcftools.html + doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: | + The vcf file to be normalized + e.g. 'file1.vcf' + - fasta: + type: file + description: FASTA reference file + pattern: "*.{fasta,fa}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF normalized output file + pattern: "*.{vcf.gz}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@abhi18av" diff --git a/modules/bcftools/query/main.nf b/modules/bcftools/query/main.nf new file mode 100644 index 00000000..d1098f99 --- /dev/null +++ b/modules/bcftools/query/main.nf @@ -0,0 +1,41 @@ +process BCFTOOLS_QUERY { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bcftools=1.13" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0' : + 'quay.io/biocontainers/bcftools:1.13--h3a49de5_0' }" + + input: + tuple val(meta), path(vcf), path(index) + path(regions) + path(targets) + path(samples) + + output: + tuple val(meta), path("*.gz") , emit: vcf + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def regions_file = regions ? "--regions-file ${regions}" : "" + def targets_file = targets ? "--targets-file ${targets}" : "" + def samples_file = samples ? "--samples-file ${samples}" : "" + + """ + bcftools query \\ + --output ${prefix}.vcf.gz \\ + ${regions_file} \\ + ${targets_file} \\ + ${samples_file} \\ + $args \\ + ${vcf} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(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 new file mode 100644 index 00000000..e450f73e --- /dev/null +++ b/modules/bcftools/query/meta.yml @@ -0,0 +1,62 @@ +name: bcftools_query +description: Extracts fields from VCF or BCF files and outputs them in user-defined format. +keywords: + - query + - variant calling + - bcftools + - VCF +tools: + - query: + description: | + Extracts fields from VCF or BCF files and outputs them in user-defined format. + homepage: http://samtools.github.io/bcftools/bcftools.html + documentation: http://www.htslib.org/doc/bcftools.html + doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: | + The vcf file to be qeuried. + e.g. 'file.vcf' + - index: + type: file + description: | + The tab index for the VCF file to be inspected. + e.g. 'file.tbi' + - regions: + type: file + description: | + Optionally, restrict the operation to regions listed in this file. + e.g. 'file.vcf' + - targets: + type: file + description: | + Optionally, restrict the operation to regions listed in this file (doesn't rely upon index files) + e.g. 'file.vcf' + - samples: + type: file + description: | + Optional, file of sample names to be included or excluded. + e.g. 'file.tsv' +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF query output file + pattern: "*.{vcf.gz}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@abhi18av" diff --git a/modules/bcftools/reheader/main.nf b/modules/bcftools/reheader/main.nf new file mode 100644 index 00000000..018431a9 --- /dev/null +++ b/modules/bcftools/reheader/main.nf @@ -0,0 +1,39 @@ +process BCFTOOLS_REHEADER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::bcftools=1.13" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0' : + 'quay.io/biocontainers/bcftools:1.13--h3a49de5_0' }" + + input: + tuple val(meta), path(vcf) + path fai + path header + + output: + tuple val(meta), path("*.vcf.gz"), emit: vcf + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def update_sequences = fai ? "-f $fai" : "" + def new_header = header ? "-h $header" : "" + """ + bcftools \\ + reheader \\ + $update_sequences \\ + $new_header \\ + $args \\ + --threads $task.cpus \\ + -o ${prefix}.vcf.gz \\ + $vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(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 new file mode 100644 index 00000000..ee8cba32 --- /dev/null +++ b/modules/bcftools/reheader/meta.yml @@ -0,0 +1,51 @@ +name: bcftools_reheader +description: Reheader a VCF file +keywords: + - reheader + - vcf + - update header +tools: + - reheader: + description: | + Modify header of VCF/BCF files, change sample names. + homepage: http://samtools.github.io/bcftools/bcftools.html + documentation: http://samtools.github.io/bcftools/bcftools.html#reheader + doi: 10.1093/gigascience/giab008 + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF/BCF file + pattern: "*.{vcf.gz,vcf,bcf}" + - fai: + type: file + description: Fasta index to update header sequences with + pattern: "*.{fai}" + - header: + type: file + description: New header to add to the VCF + pattern: "*.{header.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" + - vcf: + type: file + description: VCF with updated header + pattern: "*.{vcf.gz}" + +authors: + - "@bjohnnyd" diff --git a/modules/bcftools/stats/functions.nf b/modules/bcftools/stats/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bcftools/stats/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 84e48c05..67e8dca7 100644 --- a/modules/bcftools/stats/main.nf +++ b/modules/bcftools/stats/main.nf @@ -1,35 +1,27 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BCFTOOLS_STATS { 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::bcftools=1.11" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" - } else { - container "quay.io/biocontainers/bcftools:1.11--h7c999a4_0" - } + conda (params.enable_conda ? 'bioconda::bcftools=1.13' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0' : + 'quay.io/biocontainers/bcftools:1.13--h3a49de5_0' }" input: tuple val(meta), path(vcf) output: tuple val(meta), path("*stats.txt"), emit: stats - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ - bcftools stats $options.args $vcf > ${prefix}.bcftools_stats.txt - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + bcftools stats $args $vcf > ${prefix}.bcftools_stats.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(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..505bf729 100644 --- a/modules/bcftools/stats/meta.yml +++ b/modules/bcftools/stats/meta.yml @@ -12,6 +12,7 @@ tools: homepage: http://samtools.github.io/bcftools/bcftools.html documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -32,10 +33,10 @@ output: type: file description: Text output file containing stats pattern: "*_{stats.txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bcftools/view/main.nf b/modules/bcftools/view/main.nf new file mode 100644 index 00000000..f37c1ab9 --- /dev/null +++ b/modules/bcftools/view/main.nf @@ -0,0 +1,41 @@ +process BCFTOOLS_VIEW { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bcftools=1.13" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.13--h3a49de5_0' : + 'quay.io/biocontainers/bcftools:1.13--h3a49de5_0' }" + + input: + tuple val(meta), path(vcf), path(index) + path(regions) + path(targets) + path(samples) + + output: + tuple val(meta), path("*.gz") , emit: vcf + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def regions_file = regions ? "--regions-file ${regions}" : "" + def targets_file = targets ? "--targets-file ${targets}" : "" + def samples_file = samples ? "--samples-file ${samples}" : "" + """ + bcftools view \\ + --output ${prefix}.vcf.gz \\ + ${regions_file} \\ + ${targets_file} \\ + ${samples_file} \\ + $args \\ + --threads $task.cpus \\ + ${vcf} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(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 new file mode 100644 index 00000000..df5b0f8f --- /dev/null +++ b/modules/bcftools/view/meta.yml @@ -0,0 +1,63 @@ +name: bcftools_view +description: View, subset and filter VCF or BCF files by position and filtering expression. Convert between VCF and BCF +keywords: + - variant calling + - view + - bcftools + - VCF + +tools: + - view: + description: | + View, subset and filter VCF or BCF files by position and filtering expression. Convert between VCF and BCF + homepage: http://samtools.github.io/bcftools/bcftools.html + documentation: http://www.htslib.org/doc/bcftools.html + doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: | + The vcf file to be inspected. + e.g. 'file.vcf' + - index: + type: file + description: | + The tab index for the VCF file to be inspected. + e.g. 'file.tbi' + - regions: + type: file + description: | + Optionally, restrict the operation to regions listed in this file. + e.g. 'file.vcf' + - targets: + type: file + description: | + Optionally, restrict the operation to regions listed in this file (doesn't rely upon index files) + e.g. 'file.vcf' + - samples: + type: file + description: | + Optional, file of sample names to be included or excluded. + e.g. 'file.tsv' +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF normalized output file + pattern: "*.{vcf.gz}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@abhi18av" diff --git a/modules/bedtools/bamtobed/functions.nf b/modules/bedtools/bamtobed/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bedtools/bamtobed/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..98d9ea2f 100644 --- a/modules/bedtools/bamtobed/main.nf +++ b/modules/bedtools/bamtobed/main.nf @@ -1,40 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BEDTOOLS_BAMTOBED { 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::bedtools=2.30.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" - } else { - container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0' : + 'quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0' }" input: tuple val(meta), path(bam) output: tuple val(meta), path("*.bed"), emit: bed - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bedtools \\ bamtobed \\ - $options.args \\ + $args \\ -i $bam \\ | bedtools sort > ${prefix}.bed - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(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..e8c67047 100644 --- a/modules/bedtools/bamtobed/meta.yml +++ b/modules/bedtools/bamtobed/meta.yml @@ -8,6 +8,7 @@ tools: description: | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. documentation: https://bedtools.readthedocs.io/en/latest/content/tools/complement.html + licence: ['MIT'] input: - meta: type: map @@ -28,10 +29,10 @@ output: type: file description: Bed file containing genomic intervals. pattern: "*.{bed}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@yuukiiwa" - "@drpatelh" diff --git a/modules/bedtools/complement/functions.nf b/modules/bedtools/complement/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bedtools/complement/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..3146827c 100644 --- a/modules/bedtools/complement/main.nf +++ b/modules/bedtools/complement/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BEDTOOLS_COMPLEMENT { 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::bedtools=2.30.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" - } else { - container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0' : + 'quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0' }" input: tuple val(meta), path(bed) @@ -24,19 +13,22 @@ process BEDTOOLS_COMPLEMENT { output: tuple val(meta), path('*.bed'), emit: bed - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bedtools \\ complement \\ -i $bed \\ -g $sizes \\ - $options.args \\ + $args \\ > ${prefix}.bed - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(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..2ad8749c 100644 --- a/modules/bedtools/complement/meta.yml +++ b/modules/bedtools/complement/meta.yml @@ -8,6 +8,7 @@ tools: description: | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. documentation: https://bedtools.readthedocs.io/en/latest/content/tools/complement.html + licence: ['MIT'] input: - meta: type: map @@ -32,10 +33,10 @@ 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 - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" diff --git a/modules/bedtools/genomecov/functions.nf b/modules/bedtools/genomecov/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bedtools/genomecov/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..ca491e75 100644 --- a/modules/bedtools/genomecov/main.nf +++ b/modules/bedtools/genomecov/main.nf @@ -1,44 +1,42 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BEDTOOLS_GENOMECOV { 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::bedtools=2.30.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" - } else { - container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0' : + 'quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0' }" input: - tuple val(meta), path(intervals) + tuple val(meta), path(intervals), val(scale) path sizes val extension output: tuple val(meta), path("*.${extension}"), emit: genomecov - path "*.version.txt" , 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 = task.ext.args ?: '' + def args_list = args.tokenize() + args += (scale > 0 && scale != 1) ? " -scale $scale" : "" + if (!args_list.contains('-bg') && (scale > 0 && scale != 1)) { + args += " -bg" + } + + def prefix = task.ext.prefix ?: "${meta.id}" if (intervals.name =~ /\.bam/) { """ bedtools \\ genomecov \\ -ibam $intervals \\ - $options.args \\ + $args \\ > ${prefix}.${extension} - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS """ } else { """ @@ -46,10 +44,13 @@ process BEDTOOLS_GENOMECOV { genomecov \\ -i $intervals \\ -g $sizes \\ - $options.args \\ + $args \\ > ${prefix}.${extension} - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(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..0713e95b 100644 --- a/modules/bedtools/genomecov/meta.yml +++ b/modules/bedtools/genomecov/meta.yml @@ -9,6 +9,7 @@ tools: description: | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. documentation: https://bedtools.readthedocs.io/en/latest/content/tools/genomecov.html + licence: ['MIT'] input: - meta: type: map @@ -19,6 +20,9 @@ input: type: file description: BAM/BED/GFF/VCF pattern: "*.{bam|bed|gff|vcf}" + - scale: + type: value + description: Number containing the scale factor for the output. Set to 1 to disable. Setting to a value other than 1 will also get the -bg bedgraph output format as this is required for this command switch - sizes: type: file description: Tab-delimited table of chromosome names in the first column and chromosome sizes in the second column @@ -35,12 +39,13 @@ output: type: file description: Computed genome coverage file pattern: "*.${extension}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" - "@drpatelh" - "@sidorov-si" + - "@chris-cheshire" diff --git a/modules/bedtools/getfasta/functions.nf b/modules/bedtools/getfasta/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bedtools/getfasta/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..5a283e94 100644 --- a/modules/bedtools/getfasta/main.nf +++ b/modules/bedtools/getfasta/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BEDTOOLS_GETFASTA { tag "$bed" 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:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" - } else { - container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0' : + 'quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0' }" input: path bed @@ -24,19 +13,22 @@ process BEDTOOLS_GETFASTA { output: path "*.fa" , emit: fasta - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${bed.baseName}${options.suffix}" : "${bed.baseName}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${bed.baseName}" """ bedtools \\ getfasta \\ - $options.args \\ + $args \\ -fi $fasta \\ -bed $bed \\ -fo ${prefix}.fa - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(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..38715c3d 100644 --- a/modules/bedtools/getfasta/meta.yml +++ b/modules/bedtools/getfasta/meta.yml @@ -9,6 +9,7 @@ tools: description: | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. documentation: https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html + licence: ['MIT'] input: - bed: type: file @@ -24,10 +25,10 @@ output: type: file description: Output fasta file with extracted sequences pattern: "*.{fa}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bedtools/intersect/functions.nf b/modules/bedtools/intersect/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bedtools/intersect/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..afb0d056 100644 --- a/modules/bedtools/intersect/main.nf +++ b/modules/bedtools/intersect/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BEDTOOLS_INTERSECT { 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::bedtools=2.30.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" - } else { - container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0' : + 'quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0' }" input: tuple val(meta), path(intervals1), path(intervals2) @@ -24,19 +13,22 @@ process BEDTOOLS_INTERSECT { output: tuple val(meta), path("*.${extension}"), emit: intersect - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bedtools \\ intersect \\ -a $intervals1 \\ -b $intervals2 \\ - $options.args \\ + $args \\ > ${prefix}.${extension} - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(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..3bcb6ece 100644 --- a/modules/bedtools/intersect/meta.yml +++ b/modules/bedtools/intersect/meta.yml @@ -8,6 +8,7 @@ tools: description: | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. documentation: https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html + licence: ['MIT'] input: - meta: type: map @@ -35,10 +36,10 @@ 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 - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" diff --git a/modules/bedtools/makewindows/main.nf b/modules/bedtools/makewindows/main.nf new file mode 100644 index 00000000..2414393c --- /dev/null +++ b/modules/bedtools/makewindows/main.nf @@ -0,0 +1,34 @@ +process BEDTOOLS_MAKEWINDOWS { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--h7d7f7ad_1' : + 'quay.io/biocontainers/bedtools:2.30.0--h7d7f7ad_1' }" + + input: + tuple val(meta), path(regions) + val(use_bed) + + output: + tuple val(meta), path("*.tab"), emit: tab + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def arg_input = use_bed ? "-b $regions" : "-g $regions" + """ + bedtools \\ + makewindows \\ + ${arg_input} \\ + $args \\ + > ${prefix}.tab + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") + END_VERSIONS + """ +} diff --git a/modules/bedtools/makewindows/meta.yml b/modules/bedtools/makewindows/meta.yml new file mode 100644 index 00000000..a536d75f --- /dev/null +++ b/modules/bedtools/makewindows/meta.yml @@ -0,0 +1,43 @@ +name: bedtools_makewindows + +description: Makes adjacent or sliding windows across a genome or BED file. +keywords: + - bed + - windows +tools: + - bedtools: + description: A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. + homepage: https://bedtools.readthedocs.io + documentation: https://bedtools.readthedocs.io/en/latest/content/tools/makewindows.html + tool_dev_url: None + doi: "10.1093/bioinformatics/btq033" + licence: ['MIT'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - regions: + type: file + description: BED file OR Genome details file () + pattern: "*.{bed,fai,tab}" + - use_bed: + type: boolean + description: true = input is a BED file; false = input is a genome details file +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" + - tab: + type: file + description: Windows TAB file (BED or BED-like format) + pattern: "*.tab" +authors: + - "@kevbrick" diff --git a/modules/bedtools/maskfasta/functions.nf b/modules/bedtools/maskfasta/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bedtools/maskfasta/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..7eeb4c7d 100644 --- a/modules/bedtools/maskfasta/main.nf +++ b/modules/bedtools/maskfasta/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BEDTOOLS_MASKFASTA { 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::bedtools=2.30.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" - } else { - container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0' : + 'quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0' }" input: tuple val(meta), path(bed) @@ -24,18 +13,21 @@ process BEDTOOLS_MASKFASTA { output: tuple val(meta), path("*.fa"), emit: fasta - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bedtools \\ maskfasta \\ - $options.args \\ + $args \\ -fi $fasta \\ -bed $bed \\ -fo ${prefix}.fa - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(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..0b7aa3ed 100644 --- a/modules/bedtools/maskfasta/meta.yml +++ b/modules/bedtools/maskfasta/meta.yml @@ -9,6 +9,7 @@ tools: description: | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. documentation: https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html + licence: ['MIT'] input: - meta: type: map @@ -34,10 +35,10 @@ output: type: file description: Output masked fasta file pattern: "*.{fa}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bedtools/merge/functions.nf b/modules/bedtools/merge/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bedtools/merge/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..5f1da95b 100644 --- a/modules/bedtools/merge/main.nf +++ b/modules/bedtools/merge/main.nf @@ -1,40 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BEDTOOLS_MERGE { 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::bedtools=2.30.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" - } else { - container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0' : + 'quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0' }" input: tuple val(meta), path(bed) output: tuple val(meta), path('*.bed'), emit: bed - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bedtools \\ merge \\ -i $bed \\ - $options.args \\ + $args \\ > ${prefix}.bed - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(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..40a42b7b 100644 --- a/modules/bedtools/merge/meta.yml +++ b/modules/bedtools/merge/meta.yml @@ -8,6 +8,7 @@ tools: description: | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. documentation: https://bedtools.readthedocs.io/en/latest/content/tools/merge.html + licence: ['MIT'] input: - meta: type: map @@ -28,10 +29,10 @@ output: type: file description: Overlapped bed file with combined features pattern: "*.{bed}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" diff --git a/modules/bedtools/slop/functions.nf b/modules/bedtools/slop/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bedtools/slop/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..9d8633ec 100644 --- a/modules/bedtools/slop/main.nf +++ b/modules/bedtools/slop/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BEDTOOLS_SLOP { 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::bedtools=2.30.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" - } else { - container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0' : + 'quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0' }" input: tuple val(meta), path(bed) @@ -24,20 +13,23 @@ process BEDTOOLS_SLOP { output: tuple val(meta), path("*.bed"), emit: bed - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bedtools \\ slop \\ -i $bed \\ -g $sizes \\ - $options.args \\ + $args \\ > ${prefix}.bed - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(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..a4713936 100644 --- a/modules/bedtools/slop/meta.yml +++ b/modules/bedtools/slop/meta.yml @@ -8,6 +8,7 @@ tools: description: | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. documentation: https://bedtools.readthedocs.io/en/latest/content/tools/slop.html + licence: ['MIT'] input: - meta: type: map @@ -28,10 +29,10 @@ output: type: file description: Slopped BED file pattern: "*.{bed}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" diff --git a/modules/bedtools/sort/functions.nf b/modules/bedtools/sort/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bedtools/sort/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..1ed95a57 100644 --- a/modules/bedtools/sort/main.nf +++ b/modules/bedtools/sort/main.nf @@ -1,40 +1,33 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BEDTOOLS_SORT { 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::bedtools=2.30.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" - } else { - container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0' : + 'quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0' }" input: - tuple val(meta), path(bed) + tuple val(meta), path(intervals) + val extension output: - tuple val(meta), path('*.bed'), emit: bed - path '*.version.txt' , emit: version + tuple val(meta), path("*.${extension}"), emit: sorted + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bedtools \\ sort \\ - -i $bed \\ - $options.args \\ - > ${prefix}.bed + -i $intervals \\ + $args \\ + > ${prefix}.${extension} - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(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..c7b1b098 100644 --- a/modules/bedtools/sort/meta.yml +++ b/modules/bedtools/sort/meta.yml @@ -8,31 +8,39 @@ tools: description: | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. documentation: https://bedtools.readthedocs.io/en/latest/content/tools/sort.html + licence: ['MIT'] input: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bed: + - intervals: type: file - description: Input BED file - pattern: "*.{bed}" + description: BED/BEDGRAPH + pattern: "*.{bed|bedGraph}" + + - extension: + type: string + description: Extension of the output file (e. g., ".bg", ".bedgraph", ".txt", ".tab", etc.) It is set arbitrarily by the user and corresponds to the file format which depends on arguments. output: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bed: + + - sorted: type: file - description: Sorted BED file - pattern: "*.{bed}" - - version: + description: Sorted output file + pattern: "*.${extension}" + + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@Emiller88" - "@sruthipsuresh" - "@drpatelh" + - "@chris-cheshire" diff --git a/modules/bedtools/subtract/functions.nf b/modules/bedtools/subtract/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bedtools/subtract/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..b2efefe5 100644 --- a/modules/bedtools/subtract/main.nf +++ b/modules/bedtools/subtract/main.nf @@ -1,41 +1,33 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BEDTOOLS_SUBTRACT { 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::bedtools=2.30.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" - } else { - container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0' : + 'quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0' }" input: tuple val(meta), path(intervals1), path(intervals2) output: tuple val(meta), path("*.bed"), emit: bed - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bedtools \\ subtract \\ -a $intervals1 \\ -b $intervals2 \\ - $options.args \\ + $args \\ > ${prefix}.bed - bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bedtools: \$(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..b9245a55 100644 --- a/modules/bedtools/subtract/meta.yml +++ b/modules/bedtools/subtract/meta.yml @@ -10,6 +10,7 @@ tools: description: | A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. documentation: https://bedtools.readthedocs.io/en/latest/content/tools/subtract.html + licence: ['MIT'] input: - meta: @@ -36,10 +37,10 @@ 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 - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@sidorov-si" diff --git a/modules/bismark/align/functions.nf b/modules/bismark/align/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bismark/align/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..e490b48c 100644 --- a/modules/bismark/align/main.nf +++ b/modules/bismark/align/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BISMARK_ALIGN { 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::bismark=0.23.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bismark:0.23.0--0" - } else { - container "quay.io/biocontainers/bismark:0.23.0--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bismark:0.23.0--0' : + 'quay.io/biocontainers/bismark:0.23.0--0' }" input: tuple val(meta), path(reads) @@ -26,19 +15,22 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def fastq = meta.single_end ? reads : "-1 ${reads[0]} -2 ${reads[1]}" """ bismark \\ $fastq \\ - $options.args \\ + $args \\ --genome $index \\ --bam - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bismark: \$(echo \$(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..79948e1c 100644 --- a/modules/bismark/align/meta.yml +++ b/modules/bismark/align/meta.yml @@ -17,6 +17,7 @@ tools: homepage: https://github.com/FelixKrueger/Bismark documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs doi: 10.1093/bioinformatics/btr167 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -50,9 +51,9 @@ output: type: file description: Bismark alignment reports pattern: "*{report.txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/deduplicate/functions.nf b/modules/bismark/deduplicate/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bismark/deduplicate/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..16c624f1 100644 --- a/modules/bismark/deduplicate/main.nf +++ b/modules/bismark/deduplicate/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BISMARK_DEDUPLICATE { 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::bismark=0.23.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bismark:0.23.0--0" - } else { - container "quay.io/biocontainers/bismark:0.23.0--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bismark:0.23.0--0' : + 'quay.io/biocontainers/bismark:0.23.0--0' }" input: tuple val(meta), path(bam) @@ -24,18 +13,21 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def seqtype = meta.single_end ? '-s' : '-p' """ deduplicate_bismark \\ - $options.args \\ + $args \\ $seqtype \\ --bam $bam - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bismark: \$(echo \$(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..9e28cd22 100644 --- a/modules/bismark/deduplicate/meta.yml +++ b/modules/bismark/deduplicate/meta.yml @@ -19,6 +19,7 @@ tools: homepage: https://github.com/FelixKrueger/Bismark documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs doi: 10.1093/bioinformatics/btr167 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -43,9 +44,9 @@ output: type: file description: Bismark deduplication reports pattern: "*.{deduplication_report.txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/genomepreparation/functions.nf b/modules/bismark/genomepreparation/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bismark/genomepreparation/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..e096b2b8 100644 --- a/modules/bismark/genomepreparation/main.nf +++ b/modules/bismark/genomepreparation/main.nf @@ -1,37 +1,29 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BISMARK_GENOMEPREPARATION { tag "$fasta" 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:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::bismark=0.23.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bismark:0.23.0--0" - } else { - container "quay.io/biocontainers/bismark:0.23.0--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bismark:0.23.0--0' : + 'quay.io/biocontainers/bismark:0.23.0--0' }" input: path fasta, stageAs: "BismarkIndex/*" output: path "BismarkIndex" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ bismark_genome_preparation \\ - $options.args \\ + $args \\ BismarkIndex - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bismark: \$(echo \$(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..2a17f1fb 100644 --- a/modules/bismark/genomepreparation/meta.yml +++ b/modules/bismark/genomepreparation/meta.yml @@ -19,6 +19,7 @@ tools: homepage: https://github.com/FelixKrueger/Bismark documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs doi: 10.1093/bioinformatics/btr167 + licence: ['GPL-3.0-or-later'] input: - fasta: type: file @@ -28,9 +29,9 @@ output: type: dir description: Bismark genome index directory pattern: "BismarkIndex" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/methylationextractor/functions.nf b/modules/bismark/methylationextractor/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bismark/methylationextractor/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..d99c2b5e 100644 --- a/modules/bismark/methylationextractor/main.nf +++ b/modules/bismark/methylationextractor/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BISMARK_METHYLATIONEXTRACTOR { 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::bismark=0.23.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bismark:0.23.0--0" - } else { - container "quay.io/biocontainers/bismark:0.23.0--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bismark:0.23.0--0' : + 'quay.io/biocontainers/bismark:0.23.0--0' }" input: tuple val(meta), path(bam) @@ -28,11 +17,11 @@ 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: versions script: + def args = task.ext.args ?: '' def seqtype = meta.single_end ? '-s' : '-p' - def software = getSoftwareName(task.process) """ bismark_methylation_extractor \\ --bedGraph \\ @@ -40,9 +29,12 @@ process BISMARK_METHYLATIONEXTRACTOR { --gzip \\ --report \\ $seqtype \\ - $options.args \\ + $args \\ $bam - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bismark: \$(echo \$(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..602fc06d 100644 --- a/modules/bismark/methylationextractor/meta.yml +++ b/modules/bismark/methylationextractor/meta.yml @@ -18,6 +18,7 @@ tools: homepage: https://github.com/FelixKrueger/Bismark documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs doi: 10.1093/bioinformatics/btr167 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -58,9 +59,9 @@ output: type: file description: Text file containing methylation bias information pattern: "*.{M-bias.txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/report/functions.nf b/modules/bismark/report/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bismark/report/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..f828ecd8 100644 --- a/modules/bismark/report/main.nf +++ b/modules/bismark/report/main.nf @@ -1,35 +1,27 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BISMARK_REPORT { 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::bismark=0.23.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bismark:0.23.0--0" - } else { - container "quay.io/biocontainers/bismark:0.23.0--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bismark:0.23.0--0' : + 'quay.io/biocontainers/bismark:0.23.0--0' }" input: tuple val(meta), path(align_report), path(dedup_report), path(splitting_report), path(mbias) output: tuple val(meta), path("*report.{html,txt}"), emit: report - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ - bismark2report $options.args + bismark2report $args - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bismark: \$(echo \$(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..e849e109 100644 --- a/modules/bismark/report/meta.yml +++ b/modules/bismark/report/meta.yml @@ -16,6 +16,7 @@ tools: homepage: https://github.com/FelixKrueger/Bismark documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs doi: 10.1093/bioinformatics/btr167 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -51,9 +52,9 @@ output: type: file description: Bismark reports pattern: "*.{html,txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bismark/summary/functions.nf b/modules/bismark/summary/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bismark/summary/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..72dba72e 100644 --- a/modules/bismark/summary/main.nf +++ b/modules/bismark/summary/main.nf @@ -1,21 +1,10 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BISMARK_SUMMARY { 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::bismark=0.23.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bismark:0.23.0--0" - } else { - container "quay.io/biocontainers/bismark:0.23.0--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bismark:0.23.0--0' : + 'quay.io/biocontainers/bismark:0.23.0--0' }" input: path(bam) @@ -26,13 +15,16 @@ process BISMARK_SUMMARY { output: path "*report.{html,txt}", emit: summary - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ bismark2summary - echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bismark: \$(echo \$(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..0494bb8e 100644 --- a/modules/bismark/summary/meta.yml +++ b/modules/bismark/summary/meta.yml @@ -19,6 +19,7 @@ tools: homepage: https://github.com/FelixKrueger/Bismark documentation: https://github.com/FelixKrueger/Bismark/tree/master/Docs doi: 10.1093/bioinformatics/btr167 + licence: ['GPL-3.0-or-later'] input: - bam: type: file @@ -45,9 +46,9 @@ output: type: file description: Bismark summary pattern: "*.{html,txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/blast/blastn/functions.nf b/modules/blast/blastn/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/blast/blastn/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 8d519613..3a0bafe0 100644 --- a/modules/blast/blastn/main.nf +++ b/modules/blast/blastn/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BLAST_BLASTN { 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::blast=2.10.1' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/blast:2.10.1--pl526he19e7b1_3' - } else { - container 'quay.io/biocontainers/blast:2.10.1--pl526he19e7b1_3' - } + conda (params.enable_conda ? 'bioconda::blast=2.12.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/blast:2.12.0--pl5262h3289130_0' : + 'quay.io/biocontainers/blast:2.12.0--pl5262h3289130_0' }" input: tuple val(meta), path(fasta) @@ -24,19 +13,22 @@ process BLAST_BLASTN { output: tuple val(meta), path('*.blastn.txt'), emit: txt - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ DB=`find -L ./ -name "*.ndb" | sed 's/.ndb//'` blastn \\ -num_threads $task.cpus \\ -db \$DB \\ -query $fasta \\ - $options.args \\ + $args \\ -out ${prefix}.blastn.txt - echo \$(blastn -version 2>&1) | sed 's/^.*blastn: //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + blast: \$(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..39acb663 100644 --- a/modules/blast/blastn/meta.yml +++ b/modules/blast/blastn/meta.yml @@ -12,6 +12,7 @@ tools: homepage: https://blast.ncbi.nlm.nih.gov/Blast.cgi documentation: https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=Blastdocs doi: 10.1016/S0022-2836(05)80360-2 + licence: ['US-Government-Work'] input: - meta: type: map @@ -31,10 +32,10 @@ output: type: file description: File containing blastn hits pattern: "*.{blastn.txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/blast/makeblastdb/functions.nf b/modules/blast/makeblastdb/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/blast/makeblastdb/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 3e3b74c2..b4c426a4 100644 --- a/modules/blast/makeblastdb/main.nf +++ b/modules/blast/makeblastdb/main.nf @@ -1,38 +1,30 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BLAST_MAKEBLASTDB { tag "$fasta" 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:[:], publish_by_meta:[]) } - conda (params.enable_conda ? 'bioconda::blast=2.10.1' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/blast:2.10.1--pl526he19e7b1_3' - } else { - container 'quay.io/biocontainers/blast:2.10.1--pl526he19e7b1_3' - } + conda (params.enable_conda ? 'bioconda::blast=2.12.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/blast:2.12.0--pl5262h3289130_0' : + 'quay.io/biocontainers/blast:2.12.0--pl5262h3289130_0' }" input: path fasta output: path 'blast_db' , emit: db - path '*.version.txt', emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ makeblastdb \\ -in $fasta \\ - $options.args + $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 + "${task.process}": + blast: \$(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..c9d18cba 100644 --- a/modules/blast/makeblastdb/meta.yml +++ b/modules/blast/makeblastdb/meta.yml @@ -11,6 +11,7 @@ tools: homepage: https://blast.ncbi.nlm.nih.gov/Blast.cgi documentation: https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=Blastdocs doi: 10.1016/S0022-2836(05)80360-2 + licence: ['US-Government-Work'] input: - fasta: type: file @@ -21,10 +22,10 @@ output: type: directory description: Output directory containing blast database files pattern: "*" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bowtie/align/functions.nf b/modules/bowtie/align/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bowtie/align/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..b25b5e21 100644 --- a/modules/bowtie/align/main.nf +++ b/modules/bowtie/align/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BOWTIE_ALIGN { 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::bowtie=1.3.0 bioconda::samtools=1.11' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0' - } else { - container 'quay.io/biocontainers/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0' - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0' : + 'quay.io/biocontainers/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0' }" input: tuple val(meta), path(reads) @@ -25,27 +14,27 @@ 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: versions 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 args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped.fastq" : '' def endedness = meta.single_end ? "$reads" : "-1 ${reads[0]} -2 ${reads[1]}" """ INDEX=`find -L ./ -name "*.3.ebwt" | sed 's/.3.ebwt//'` bowtie \\ - --threads ${split_cpus} \\ + --threads $task.cpus \\ --sam \\ -x \$INDEX \\ -q \\ $unaligned \\ - $options.args \\ + $args \\ $endedness \\ 2> ${prefix}.out \\ - | samtools view $options.args2 -@ ${split_cpus} -bS -o ${prefix}.bam - + | samtools view $args2 -@ $task.cpus -bS -o ${prefix}.bam - if [ -f ${prefix}.unmapped.fastq ]; then gzip ${prefix}.unmapped.fastq @@ -55,6 +44,10 @@ 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 + "${task.process}": + bowtie: \$(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/bowtie/align/meta.yml b/modules/bowtie/align/meta.yml index bea8b4dd..07d480be 100644 --- a/modules/bowtie/align/meta.yml +++ b/modules/bowtie/align/meta.yml @@ -13,6 +13,7 @@ tools: homepage: http://bowtie-bio.sourceforge.net/index.shtml documentation: http://bowtie-bio.sourceforge.net/manual.shtml arxiv: arXiv:1303.3997 + licence: ['Artistic-2.0'] input: - meta: type: map @@ -33,10 +34,10 @@ output: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - fastq: type: file description: Unaligned FastQ files diff --git a/modules/bowtie/build/functions.nf b/modules/bowtie/build/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bowtie/build/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..dbbc8efa 100644 --- a/modules/bowtie/build/main.nf +++ b/modules/bowtie/build/main.nf @@ -1,35 +1,27 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BOWTIE_BUILD { tag "$fasta" label 'process_high' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) } conda (params.enable_conda ? 'bioconda::bowtie=1.3.0' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/bowtie:1.3.0--py38hed8969a_1' - } else { - container 'quay.io/biocontainers/bowtie:1.3.0--py38hed8969a_1' - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bowtie:1.3.0--py38hed8969a_1' : + 'quay.io/biocontainers/bowtie:1.3.0--py38hed8969a_1' }" input: path fasta output: path 'bowtie' , emit: index - path '*.version.txt', emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ 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 + "${task.process}": + bowtie: \$(echo \$(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..016adcfe 100644 --- a/modules/bowtie/build/meta.yml +++ b/modules/bowtie/build/meta.yml @@ -13,6 +13,7 @@ tools: homepage: http://bowtie-bio.sourceforge.net/index.shtml documentation: http://bowtie-bio.sourceforge.net/manual.shtml arxiv: arXiv:1303.3997 + licence: ['Artistic-2.0'] input: - fasta: type: file @@ -22,10 +23,10 @@ output: type: file description: Bowtie genome index files pattern: "*.ebwt" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" - "@drpatelh" diff --git a/modules/bowtie2/align/functions.nf b/modules/bowtie2/align/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bowtie2/align/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..41c8a6bf 100644 --- a/modules/bowtie2/align/main.nf +++ b/modules/bowtie2/align/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BOWTIE2_ALIGN { 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::bowtie2=2.4.2 bioconda::samtools=1.11 conda-forge::pigz=2.3.4' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:577a697be67b5ae9b16f637fd723b8263a3898b3-0" - } else { - container "quay.io/biocontainers/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:577a697be67b5ae9b16f637fd723b8263a3898b3-0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:577a697be67b5ae9b16f637fd723b8263a3898b3-0' : + 'quay.io/biocontainers/mulled-v2-ac74a7f02cebcfcc07d8e8d1d750af9c83b4d45a:577a697be67b5ae9b16f637fd723b8263a3898b3-0' }" input: tuple val(meta), path(reads) @@ -25,13 +14,13 @@ 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: versions 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 args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" if (meta.single_end) { def unaligned = params.save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : '' """ @@ -39,13 +28,18 @@ process BOWTIE2_ALIGN { bowtie2 \\ -x \$INDEX \\ -U $reads \\ - --threads ${split_cpus} \\ + --threads $task.cpus \\ $unaligned \\ - $options.args \\ + $args \\ 2> ${prefix}.bowtie2.log \\ - | samtools view -@ ${split_cpus} $options.args2 -bhS -o ${prefix}.bam - + | samtools view -@ $task.cpus $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 + "${task.process}": + bowtie2: \$(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 { def unaligned = params.save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' @@ -55,11 +49,11 @@ process BOWTIE2_ALIGN { -x \$INDEX \\ -1 ${reads[0]} \\ -2 ${reads[1]} \\ - --threads ${split_cpus} \\ + --threads $task.cpus \\ $unaligned \\ - $options.args \\ + $args \\ 2> ${prefix}.bowtie2.log \\ - | samtools view -@ ${split_cpus} $options.args2 -bhS -o ${prefix}.bam - + | samtools view -@ $task.cpus $args2 -bhS -o ${prefix}.bam - if [ -f ${prefix}.unmapped.fastq.1.gz ]; then mv ${prefix}.unmapped.fastq.1.gz ${prefix}.unmapped_1.fastq.gz @@ -67,7 +61,13 @@ 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 + "${task.process}": + bowtie2: \$(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/bowtie2/align/meta.yml b/modules/bowtie2/align/meta.yml index 9d9cd004..77c9e397 100644 --- a/modules/bowtie2/align/meta.yml +++ b/modules/bowtie2/align/meta.yml @@ -13,6 +13,7 @@ tools: homepage: http://bowtie-bio.sourceforge.net/bowtie2/index.shtml documentation: http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml doi: 10.1038/nmeth.1923 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -33,10 +34,10 @@ output: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - fastq: type: file description: Unaligned FastQ files diff --git a/modules/bowtie2/build/functions.nf b/modules/bowtie2/build/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bowtie2/build/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 42ff1d20..c0cbcd79 100644 --- a/modules/bowtie2/build/main.nf +++ b/modules/bowtie2/build/main.nf @@ -1,35 +1,27 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BOWTIE2_BUILD { tag "$fasta" label 'process_high' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) } - conda (params.enable_conda ? 'bioconda::bowtie2=2.4.2' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/bowtie2:2.4.2--py38h1c8e9b9_1' - } else { - container 'quay.io/biocontainers/bowtie2:2.4.2--py38h1c8e9b9_1' - } + conda (params.enable_conda ? 'bioconda::bowtie2=2.4.4' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bowtie2:2.4.4--py39hbb4e92a_0' : + 'quay.io/biocontainers/bowtie2:2.4.4--py36hd4290be_0' }" input: path fasta output: path 'bowtie2' , emit: index - path '*.version.txt', emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ 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 + bowtie2-build $args --threads $task.cpus $fasta bowtie2/${fasta.baseName} + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bowtie2: \$(echo \$(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..ecc54e9b 100644 --- a/modules/bowtie2/build/meta.yml +++ b/modules/bowtie2/build/meta.yml @@ -14,6 +14,7 @@ tools: homepage: http://bowtie-bio.sourceforge.net/bowtie2/index.shtml documentation: http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml doi: 10.1038/nmeth.1923 + licence: ['GPL-3.0-or-later'] input: - fasta: type: file @@ -23,10 +24,10 @@ output: type: file description: Bowtie2 genome index files pattern: "*.bt2" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/bwa/aln/main.nf b/modules/bwa/aln/main.nf new file mode 100644 index 00000000..992e25de --- /dev/null +++ b/modules/bwa/aln/main.nf @@ -0,0 +1,62 @@ +process BWA_ALN { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bwa=0.7.17" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bwa:0.7.17--h5bf99c6_8' : + 'quay.io/biocontainers/bwa:0.7.17--h5bf99c6_8' }" + + input: + tuple val(meta), path(reads) + path index + + output: + tuple val(meta), path("*.sai"), emit: sai + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + if (meta.single_end) { + """ + INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` + + bwa aln \\ + $args \\ + -t $task.cpus \\ + -f ${prefix}.sai \\ + \$INDEX \\ + ${reads} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') + END_VERSIONS + """ + } else { + """ + INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` + + bwa aln \\ + $args \\ + -t $task.cpus \\ + -f ${prefix}.1.sai \\ + \$INDEX \\ + ${reads[0]} + + bwa aln \\ + $args \\ + -t $task.cpus \\ + -f ${prefix}.2.sai \\ + \$INDEX \\ + ${reads[1]} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') + END_VERSIONS + """ + } +} diff --git a/modules/bwa/aln/meta.yml b/modules/bwa/aln/meta.yml new file mode 100644 index 00000000..d2424a5f --- /dev/null +++ b/modules/bwa/aln/meta.yml @@ -0,0 +1,54 @@ +name: bwa_aln +description: Find SA coordinates of the input reads for bwa short-read mapping +keywords: + - bwa + - aln + - short-read + - align + - reference + - fasta + - map + - fastq +tools: + - bwa: + description: | + BWA is a software package for mapping DNA sequences against + a large reference genome, such as the human genome. + homepage: http://bio-bwa.sourceforge.net/ + documentation: http://bio-bwa.sourceforge.net/ + doi: "10.1093/bioinformatics/btp324" + licence: ['GPL-3.0-or-later'] + +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: BWA genome index files + pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" + +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" + - sai: + type: file + description: Single or paired SA coordinate files + pattern: "*.sai" + +authors: + - "@jfy133" diff --git a/modules/bwa/index/functions.nf b/modules/bwa/index/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bwa/index/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..89102737 100644 --- a/modules/bwa/index/main.nf +++ b/modules/bwa/index/main.nf @@ -1,35 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BWA_INDEX { tag "$fasta" label 'process_high' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::bwa=0.7.17" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bwa:0.7.17--hed695b0_7" - } else { - container "quay.io/biocontainers/bwa:0.7.17--hed695b0_7" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bwa:0.7.17--hed695b0_7' : + 'quay.io/biocontainers/bwa:0.7.17--hed695b0_7' }" input: path fasta output: - path "bwa" , emit: index - path "*.version.txt", emit: version + path "bwa" , emit: index + path "versions.yml", emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ mkdir bwa - bwa index $options.args $fasta -p bwa/${fasta.baseName} - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt + bwa \\ + index \\ + $args \\ + -p bwa/${fasta.baseName} \\ + $fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwa: \$(echo \$(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..11d62df3 100644 --- a/modules/bwa/index/meta.yml +++ b/modules/bwa/index/meta.yml @@ -13,6 +13,7 @@ tools: homepage: http://bio-bwa.sourceforge.net/ documentation: http://www.htslib.org/doc/samtools.html arxiv: arXiv:1303.3997 + licence: ['GPL-3.0-or-later'] input: - fasta: type: file @@ -22,10 +23,10 @@ output: type: file description: BWA genome index files pattern: "*.{amb,ann,bwt,pac,sa}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@maxulysse" diff --git a/modules/bwa/mem/functions.nf b/modules/bwa/mem/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bwa/mem/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..9695bd2d 100644 --- a/modules/bwa/mem/main.nf +++ b/modules/bwa/mem/main.nf @@ -1,47 +1,42 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BWA_MEM { 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::bwa=0.7.17 bioconda::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:66ed1b38d280722529bb8a0167b0cf02f8a0b488-0" - } else { - container "quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:66ed1b38d280722529bb8a0167b0cf02f8a0b488-0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:66ed1b38d280722529bb8a0167b0cf02f8a0b488-0' : + 'quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:66ed1b38d280722529bb8a0167b0cf02f8a0b488-0' }" input: tuple val(meta), path(reads) path index + val sort_bam output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions 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 args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def read_group = meta.read_group ? "-R ${meta.read_group}" : "" + def samtools_command = sort_bam ? 'sort' : 'view' """ INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` bwa mem \\ - $options.args \\ + $args \\ $read_group \\ - -t ${split_cpus} \\ + -t $task.cpus \\ \$INDEX \\ $reads \\ - | samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - + | samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam - - echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwa: \$(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/mem/meta.yml b/modules/bwa/mem/meta.yml index 693c5450..c7c28f19 100644 --- a/modules/bwa/mem/meta.yml +++ b/modules/bwa/mem/meta.yml @@ -16,6 +16,7 @@ tools: homepage: http://bio-bwa.sourceforge.net/ documentation: http://www.htslib.org/doc/samtools.html arxiv: arXiv:1303.3997 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -31,15 +32,19 @@ input: type: file description: BWA genome index files pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" + - sort_bam: + type: boolean + description: use samtools sort (true) or samtools view (false) + pattern: "true or false" output: - bam: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@jeremy1805" diff --git a/modules/bwa/sampe/main.nf b/modules/bwa/sampe/main.nf new file mode 100644 index 00000000..0b5ec255 --- /dev/null +++ b/modules/bwa/sampe/main.nf @@ -0,0 +1,39 @@ +process BWA_SAMPE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.12" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:66ed1b38d280722529bb8a0167b0cf02f8a0b488-0' : + 'quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:66ed1b38d280722529bb8a0167b0cf02f8a0b488-0' }" + + input: + tuple val(meta), path(reads), path(sai) + path index + + output: + tuple val(meta), path("*.bam"), emit: bam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def read_group = meta.read_group ? "-r ${meta.read_group}" : "" + + """ + INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` + + bwa sampe \\ + $args \\ + $read_group \\ + \$INDEX \\ + $sai \\ + $reads | samtools sort -@ ${task.cpus - 1} -O bam - > ${prefix}.bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwa: \$(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/meta.yml b/modules/bwa/sampe/meta.yml new file mode 100644 index 00000000..7b530a03 --- /dev/null +++ b/modules/bwa/sampe/meta.yml @@ -0,0 +1,58 @@ +name: bwa_sampe +description: Convert paired-end bwa SA coordinate files to SAM format +keywords: + - bwa + - aln + - short-read + - align + - reference + - fasta + - map + - sam + - bam +tools: + - bwa: + description: | + BWA is a software package for mapping DNA sequences against + a large reference genome, such as the human genome. + homepage: http://bio-bwa.sourceforge.net/ + documentation: http://bio-bwa.sourceforge.net/ + doi: "10.1093/bioinformatics/btp324" + licence: ['GPL-3.0-or-later'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information. + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: FASTQ files specified alongside meta in input channel. + pattern: "*.{fastq,fq}.gz" + - sai: + type: file + description: SAI file specified alongside meta and reads in input channel. + pattern: "*.sai" + - index: + type: directory + description: Directory containing BWA index files (amb,ann,bwt,pac,sa) from BWA_INDEX + pattern: "bwa/" + +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: BAM file + pattern: "*.bam" + +authors: + - "@jfy133" diff --git a/modules/bwa/samse/main.nf b/modules/bwa/samse/main.nf new file mode 100644 index 00000000..bee06bc8 --- /dev/null +++ b/modules/bwa/samse/main.nf @@ -0,0 +1,39 @@ +process BWA_SAMSE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.12" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:66ed1b38d280722529bb8a0167b0cf02f8a0b488-0' : + 'quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:66ed1b38d280722529bb8a0167b0cf02f8a0b488-0' }" + + input: + tuple val(meta), path(reads), path(sai) + path index + + output: + tuple val(meta), path("*.bam"), emit: bam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def read_group = meta.read_group ? "-r ${meta.read_group}" : "" + + """ + INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` + + bwa samse \\ + $args \\ + $read_group \\ + \$INDEX \\ + $sai \\ + $reads | samtools sort -@ ${task.cpus - 1} -O bam - > ${prefix}.bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwa: \$(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/meta.yml b/modules/bwa/samse/meta.yml new file mode 100644 index 00000000..9a9ecb39 --- /dev/null +++ b/modules/bwa/samse/meta.yml @@ -0,0 +1,59 @@ +name: bwa_samse +description: Convert bwa SA coordinate file to SAM format +keywords: + - bwa + - aln + - short-read + - align + - reference + - fasta + - map + - sam + - bam + +tools: + - bwa: + description: | + BWA is a software package for mapping DNA sequences against + a large reference genome, such as the human genome. + homepage: http://bio-bwa.sourceforge.net/ + documentation: http://bio-bwa.sourceforge.net/ + doi: "10.1093/bioinformatics/btp324" + licence: ['GPL-3.0-or-later'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information. + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: FASTQ files specified alongside meta in input channel. + pattern: "*.{fastq,fq}.gz" + - sai: + type: file + description: SAI file specified alongside meta and reads in input channel. + pattern: "*.sai" + - index: + type: directory + description: Directory containing BWA index files (amb,ann,bwt,pac,sa) from BWA_INDEX + pattern: "bwa/" + +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: BAM file + pattern: "*.bam" + +authors: + - "@jfy133" diff --git a/modules/bwamem2/index/functions.nf b/modules/bwamem2/index/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bwamem2/index/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..e00538c9 100644 --- a/modules/bwamem2/index/main.nf +++ b/modules/bwamem2/index/main.nf @@ -1,35 +1,31 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BWAMEM2_INDEX { tag "$fasta" label 'process_high' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::bwa-mem2=2.2.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bwa-mem2:2.2.1--he513fc3_0" - } else { - container "quay.io/biocontainers/bwa-mem2:2.2.1--he513fc3_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bwa-mem2:2.2.1--he513fc3_0' : + 'quay.io/biocontainers/bwa-mem2:2.2.1--he513fc3_0' }" input: path fasta output: path "bwamem2" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ mkdir bwamem2 - bwa-mem2 index $options.args $fasta -p bwamem2/${fasta} - echo \$(bwa-mem2 version 2>&1) > ${software}.version.txt + bwa-mem2 \\ + index \\ + $args \\ + $fasta -p bwamem2/${fasta} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') + END_VERSIONS """ } diff --git a/modules/bwamem2/index/meta.yml b/modules/bwamem2/index/meta.yml index 9d717f73..e0f6014c 100644 --- a/modules/bwamem2/index/meta.yml +++ b/modules/bwamem2/index/meta.yml @@ -12,6 +12,7 @@ tools: a large reference genome, such as the human genome. homepage: https://github.com/bwa-mem2/bwa-mem2 documentation: https://github.com/bwa-mem2/bwa-mem2#usage + licence: ['MIT'] input: - fasta: type: file @@ -21,9 +22,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 - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/bwamem2/mem/functions.nf b/modules/bwamem2/mem/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bwamem2/mem/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..6d4d8028 100644 --- a/modules/bwamem2/mem/main.nf +++ b/modules/bwamem2/mem/main.nf @@ -1,47 +1,43 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BWAMEM2_MEM { 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::bwa-mem2=2.2.1 bioconda::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:cf603b12db30ec91daa04ba45a8ee0f35bbcd1e2-0" - } else { - container "quay.io/biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:cf603b12db30ec91daa04ba45a8ee0f35bbcd1e2-0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:cf603b12db30ec91daa04ba45a8ee0f35bbcd1e2-0' : + 'quay.io/biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:cf603b12db30ec91daa04ba45a8ee0f35bbcd1e2-0' }" input: tuple val(meta), path(reads) path index + val sort_bam output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions 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 args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def read_group = meta.read_group ? "-R ${meta.read_group}" : "" + def samtools_command = sort_bam ? 'sort' : 'view' """ INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` - bwa-mem2 mem \\ - $options.args \\ + bwa-mem2 \\ + mem \\ + $args \\ $read_group \\ - -t ${split_cpus} \\ + -t $task.cpus \\ \$INDEX \\ $reads \\ - | samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - + | samtools $samtools_command $args2 -@ $task.cpus -o ${prefix}.bam - - echo \$(bwa-mem2 version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwamem2: \$(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/bwamem2/mem/meta.yml b/modules/bwamem2/mem/meta.yml index 2fc7713d..71e83759 100644 --- a/modules/bwamem2/mem/meta.yml +++ b/modules/bwamem2/mem/meta.yml @@ -11,11 +11,12 @@ keywords: tools: - bwa: description: | - BWA is a software package for mapping DNA sequences against + BWA-mem2 is a software package for mapping DNA sequences against a large reference genome, such as the human genome. - homepage: http://bio-bwa.sourceforge.net/ + homepage: https://github.com/bwa-mem2/bwa-mem2 documentation: http://www.htslib.org/doc/samtools.html arxiv: arXiv:1303.3997 + licence: ['MIT'] input: - meta: type: map @@ -30,15 +31,19 @@ input: - index: type: file description: BWA genome index files - pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" + pattern: "Directory containing BWA index *.{0132,amb,ann,bwt.2bit.64,pac}" + - sort_bam: + type: boolean + description: use samtools sort (true) or samtools view (false) + pattern: "true or false" output: - bam: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/bwameth/align/functions.nf b/modules/bwameth/align/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bwameth/align/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..0bcd9bac 100644 --- a/modules/bwameth/align/main.nf +++ b/modules/bwameth/align/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BWAMETH_ALIGN { 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::bwameth=0.2.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bwameth:0.2.2--py_1" - } else { - container "quay.io/biocontainers/bwameth:0.2.2--py_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bwameth:0.2.2--py_1' : + 'quay.io/biocontainers/bwameth:0.2.2--py_1' }" input: tuple val(meta), path(reads) @@ -24,24 +13,31 @@ process BWAMETH_ALIGN { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions 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 args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def read_group = meta.read_group ? "-R ${meta.read_group}" : "" """ INDEX=`find -L ${index} -name "*.bwameth.c2t" | sed 's/.bwameth.c2t//'` + # Modify the timestamps so that bwameth doesn't complain about building the index + # See https://github.com/nf-core/methylseq/pull/217 + touch -c -- * + bwameth.py \\ - $options.args \\ + $args \\ $read_group \\ - -t ${split_cpus} \\ + -t $task.cpus \\ --reference \$INDEX \\ $reads \\ - | samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - + | samtools view $args2 -@ $task.cpus -bhS -o ${prefix}.bam - - echo \$(bwameth.py --version 2>&1) | cut -f2 -d" " > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwameth: \$(echo \$(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..1cd66237 100644 --- a/modules/bwameth/align/meta.yml +++ b/modules/bwameth/align/meta.yml @@ -19,6 +19,7 @@ tools: homepage: https://github.com/brentp/bwa-meth documentation: https://github.com/brentp/bwa-meth arxiv: arXiv:1401.1129 + licence: ['MIT'] input: - meta: type: map @@ -43,9 +44,9 @@ output: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/bwameth/index/functions.nf b/modules/bwameth/index/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/bwameth/index/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..f5b8ff59 100644 --- a/modules/bwameth/index/main.nf +++ b/modules/bwameth/index/main.nf @@ -1,35 +1,27 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process BWAMETH_INDEX { tag "$fasta" label 'process_high' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::bwameth=0.2.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bwameth:0.2.2--py_1" - } else { - container "quay.io/biocontainers/bwameth:0.2.2--py_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bwameth:0.2.2--py_1' : + 'quay.io/biocontainers/bwameth:0.2.2--py_1' }" input: path fasta, stageAs: "bwameth/*" output: path "bwameth" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ bwameth.py index $fasta - echo \$(bwameth.py --version 2>&1) | cut -f2 -d" " > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bwameth: \$(echo \$(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..352dfd0f 100644 --- a/modules/bwameth/index/meta.yml +++ b/modules/bwameth/index/meta.yml @@ -15,6 +15,7 @@ tools: homepage: https://github.com/brentp/bwa-meth documentation: https://github.com/brentp/bwa-meth arxiv: arXiv:1401.1129 + licence: ['MIT'] input: - fasta: type: file @@ -24,9 +25,9 @@ output: type: dir description: Directory containing bwameth genome index pattern: "index" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/cat/cat/main.nf b/modules/cat/cat/main.nf new file mode 100644 index 00000000..0c087270 --- /dev/null +++ b/modules/cat/cat/main.nf @@ -0,0 +1,47 @@ +process CAT_CAT { + label 'process_low' + + conda (params.enable_conda ? "conda-forge::pigz=2.3.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pigz:2.3.4' : + 'quay.io/biocontainers/pigz:2.3.4' }" + + input: + path files_in + val file_out + + output: + path "${file_out}*" , emit: file_out + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def file_list = files_in.collect { it.toString() } + if (file_list.size > 1) { + + // | input | output | command1 | command2 | + // |-----------|------------|----------|----------| + // | gzipped | gzipped | cat | | + // | ungzipped | ungzipped | cat | | + // | gzipped | ungzipped | zcat | | + // | ungzipped | gzipped | cat | pigz | + + def in_zip = file_list[0].endsWith('.gz') + def out_zip = file_out.endsWith('.gz') + def command1 = (in_zip && !out_zip) ? 'zcat' : 'cat' + def command2 = (!in_zip && out_zip) ? "| pigz -c -p $task.cpus $args2" : '' + """ + $command1 \\ + $args \\ + ${file_list.join(' ')} \\ + $command2 \\ + > $file_out + + cat <<-END_VERSIONS > versions.yml + "${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 new file mode 100644 index 00000000..b3f370ee --- /dev/null +++ b/modules/cat/cat/meta.yml @@ -0,0 +1,34 @@ +name: cat_cat +description: A module for concatenation of gzipped or uncompressed files +keywords: + - concatenate + - gzip + - cat +tools: + - cat: + description: Just concatenation + homepage: None + documentation: https://man7.org/linux/man-pages/man1/cat.1.html + tool_dev_url: None + licence: ['GPL-3.0-or-later'] +input: + - files_in: + type: file + description: List of compressed / uncompressed files + pattern: "*" + - file_out: + type: value + description: Full name of output file with or without .gz extension + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - file_out: + type: file + description: Concatenated file. Will be gzipped if file_out ends with ".gz" + pattern: "${file_out}" + +authors: + - "@erikrikarddaniel" diff --git a/modules/cat/fastq/functions.nf b/modules/cat/fastq/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/cat/fastq/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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/fastq/main.nf b/modules/cat/fastq/main.nf index 55ccca90..d02598e1 100644 --- a/modules/cat/fastq/main.nf +++ b/modules/cat/fastq/main.nf @@ -1,36 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles } from './functions' - -params.options = [:] -options = initOptions(params.options) - process CAT_FASTQ { tag "$meta.id" label 'process_low' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'merged_fastq', meta:meta, publish_by_meta:['id']) } conda (params.enable_conda ? "conda-forge::sed=4.7" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img" - } else { - container "biocontainers/biocontainers:v1.2.0_cv1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : + 'biocontainers/biocontainers:v1.2.0_cv1' }" input: - tuple val(meta), path(reads) + tuple val(meta), path(reads, stageAs: "input*/*") output: tuple val(meta), path("*.merged.fastq.gz"), emit: reads + path "versions.yml" , emit: versions script: - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def readList = reads.collect{ it.toString() } if (meta.single_end) { if (readList.size > 1) { """ - cat ${readList.sort().join(' ')} > ${prefix}.merged.fastq.gz + cat ${readList.join(' ')} > ${prefix}.merged.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//') + END_VERSIONS """ } } else { @@ -39,8 +35,13 @@ process CAT_FASTQ { def read2 = [] readList.eachWithIndex{ v, ix -> ( ix & 1 ? read2 : read1 ) << v } """ - cat ${read1.sort().join(' ')} > ${prefix}_1.merged.fastq.gz - cat ${read2.sort().join(' ')} > ${prefix}_2.merged.fastq.gz + cat ${read1.join(' ')} > ${prefix}_1.merged.fastq.gz + cat ${read2.join(' ')} > ${prefix}_2.merged.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//') + END_VERSIONS """ } } diff --git a/modules/cat/fastq/meta.yml b/modules/cat/fastq/meta.yml index e7b8eebe..1992fa34 100644 --- a/modules/cat/fastq/meta.yml +++ b/modules/cat/fastq/meta.yml @@ -8,6 +8,7 @@ tools: description: | The cat utility reads files sequentially, writing them to the standard output. documentation: https://www.gnu.org/software/coreutils/manual/html_node/cat-invocation.html + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -28,6 +29,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/cellranger/.gitignore b/modules/cellranger/.gitignore new file mode 100644 index 00000000..9f8cb0f5 --- /dev/null +++ b/modules/cellranger/.gitignore @@ -0,0 +1 @@ +cellranger-*.tar.gz diff --git a/modules/cellranger/Dockerfile b/modules/cellranger/Dockerfile new file mode 100644 index 00000000..e9437bf6 --- /dev/null +++ b/modules/cellranger/Dockerfile @@ -0,0 +1,21 @@ +FROM continuumio/miniconda3:4.8.2 +LABEL authors="Gisela Gabernet " \ + description="Docker image containing Cell Ranger" +# Disclaimer: this container is not provided nor supported by 10x Genomics. + +# Install procps and clean apt cache +RUN apt-get update --allow-releaseinfo-change \ + && apt-get install -y procps \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/* + +# Copy pre-downloaded cellranger file +ENV CELLRANGER_VER 6.0.2 +COPY cellranger-$CELLRANGER_VER.tar.gz /opt/cellranger-$CELLRANGER_VER.tar.gz + +# Install cellranger +RUN \ + cd /opt && \ + tar -xzvf cellranger-$CELLRANGER_VER.tar.gz && \ + export PATH=/opt/cellranger-$CELLRANGER_VER:$PATH && \ + ln -s /opt/cellranger-$CELLRANGER_VER/cellranger /usr/bin/cellranger && \ + rm -rf /opt/cellranger-$CELLRANGER_VER.tar.gz diff --git a/modules/cellranger/README.md b/modules/cellranger/README.md new file mode 100644 index 00000000..ed8ccb73 --- /dev/null +++ b/modules/cellranger/README.md @@ -0,0 +1,18 @@ +# Updating the docker container and making a new module release + +Cell Ranger is a commercial tool by 10X Genomics. The container provided for the cellranger nf-core module is not provided nor supported by 10x Genomics. Updating the Cell Ranger version in the container and pushing the update to Dockerhub needs to be done manually. + +1. Navigate to the [Cell Ranger download page](https://support.10xgenomics.com/single-cell-gene-expression/software/downloads/latest) and download the tar ball of the desired Cell Ranger version with `curl` or `wget`. Place this file in the same folder where the Dockerfile lies. + +2. Edit the Dockerfile: update the Cell Ranger version in this line: + + ```bash + ENV CELLRANGER_VER + ``` + +3. Create the container: + + ```bash + docker build . -t nfcore/cellranger: + docker push nfcore/cellranger: + ``` diff --git a/modules/cellranger/count/main.nf b/modules/cellranger/count/main.nf new file mode 100644 index 00000000..be3f512a --- /dev/null +++ b/modules/cellranger/count/main.nf @@ -0,0 +1,49 @@ +process CELLRANGER_COUNT { + tag "$meta.gem" + label 'process_high' + + if (params.enable_conda) { + exit 1, "Conda environments cannot be used when using the Cell Ranger tool. Please use docker or singularity containers." + } + container "nfcore/cellranger:6.0.2" + + input: + tuple val(meta), path(reads) + path reference + + output: + path("sample-${meta.gem}/outs/*"), emit: outs + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def sample_arg = meta.samples.unique().join(",") + def reference_name = reference.name + """ + cellranger \\ + count \\ + --id='sample-${meta.gem}' \\ + --fastqs=. \\ + --transcriptome=$reference_name \\ + --sample=$sample_arg \\ + --localcores=$task.cpus \\ + --localmem=${task.memory.toGiga()} \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cellranger: \$(echo \$( cellranger --version 2>&1) | sed 's/^.*[^0-9]\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*\$/\\1/' ) + END_VERSIONS + """ + + stub: + """ + mkdir -p "sample-${meta.gem}/outs/" + touch sample-${meta.gem}/outs/fake_file.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cellranger: \$(echo \$( cellranger --version 2>&1) | sed 's/^.*[^0-9]\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*\$/\\1/' ) + END_VERSIONS + """ +} diff --git a/modules/cellranger/count/meta.yml b/modules/cellranger/count/meta.yml new file mode 100644 index 00000000..e4647c98 --- /dev/null +++ b/modules/cellranger/count/meta.yml @@ -0,0 +1,40 @@ +name: cellranger_count +description: Module to use Cell Ranger's pipelines analyze sequencing data produced from Chromium Single Cell Gene Expression. +keywords: + - align + - count + - reference +tools: + - cellranger: + description: Cell Ranger by 10x Genomics is a set of analysis pipelines that process Chromium single-cell data to align reads, generate feature-barcode matrices, perform clustering and other secondary analysis, and more. + homepage: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/what-is-cell-ranger + documentation: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ov + tool_dev_url: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ov + doi: "" + licence: 10x Genomics EULA +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. + - reference: + type: folder + description: Folder containing all the reference indices needed by Cell Ranger +output: + - outs: + type: file + description: Files containing the outputs of Cell Ranger + pattern: "sample-${meta.gem}/outs/*" + - versions: + type: file + description: File containing software version + pattern: "versions.yml" +authors: + - "@ggabernet" + - "@Emiller88" diff --git a/modules/cellranger/mkfastq/main.nf b/modules/cellranger/mkfastq/main.nf new file mode 100644 index 00000000..14d68665 --- /dev/null +++ b/modules/cellranger/mkfastq/main.nf @@ -0,0 +1,31 @@ +process CELLRANGER_MKFASTQ { + tag "mkfastq" + label 'process_medium' + + if (params.enable_conda) { + exit 1, "Conda environments cannot be used when using the Cell Ranger tool. Please use docker or singularity containers." + } + container "litd/docker-cellranger:v6.1.1" // FIXME Add bcl2fastq to nf-core docker image + + input: + path bcl + path csv + + output: + path "versions.yml", emit: versions + path "*.fastq.gz" , emit: fastq + + script: + def args = task.ext.args ?: '' + """ + cellranger mkfastq --id=${bcl.getSimpleName()} \ + --run=$bcl \ + --csv=$csv + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cellranger: \$(echo \$( cellranger --version 2>&1) | sed 's/^.*[^0-9]\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*\$/\\1/' ) + END_VERSIONS + """ +} diff --git a/modules/cellranger/mkfastq/meta.yml b/modules/cellranger/mkfastq/meta.yml new file mode 100644 index 00000000..e288fb8c --- /dev/null +++ b/modules/cellranger/mkfastq/meta.yml @@ -0,0 +1,38 @@ +name: cellranger_mkfastq +description: Module to create fastqs needed by the 10x Genomics Cell Ranger tool. Uses the cellranger mkfastq command. +keywords: + - reference + - mkfastq + - fastq + - illumina + - bcl2fastq +tools: + - cellranger: + description: Cell Ranger by 10x Genomics is a set of analysis pipelines that process Chromium single-cell data to align reads, generate feature-barcode matrices, perform clustering and other secondary analysis, and more. + homepage: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/what-is-cell-ranger + documentation: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ov + tool_dev_url: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ov + doi: "" + licence: 10x Genomics EULA +input: + - bcl: + type: file + description: Base call files + pattern: "*.bcl.bgzf" + - csv: + type: file + description: Sample sheet + pattern: "*.csv" +output: + - fastq: + type: file + description: Unaligned FastQ files + pattern: "*.fastq.gz" + - versions: + type: file + description: File containing software version + pattern: "versions.yml" +authors: + - "@ggabernet" + - "@Emiller88" + - "@RHReynolds" diff --git a/modules/cellranger/mkgtf/main.nf b/modules/cellranger/mkgtf/main.nf new file mode 100644 index 00000000..4db274d7 --- /dev/null +++ b/modules/cellranger/mkgtf/main.nf @@ -0,0 +1,31 @@ +process CELLRANGER_MKGTF { + tag "$gtf" + label 'process_low' + + if (params.enable_conda) { + exit 1, "Conda environments cannot be used when using the Cell Ranger tool. Please use docker or singularity containers." + } + container "nfcore/cellranger:6.0.2" + + input: + path gtf + + output: + path "*.filtered.gtf", emit: gtf + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + """ + cellranger \\ + mkgtf \\ + $gtf \\ + ${gtf.baseName}.filtered.gtf \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cellranger: \$(echo \$( cellranger --version 2>&1) | sed 's/^.*[^0-9]\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*\$/\\1/' ) + END_VERSIONS + """ +} diff --git a/modules/cellranger/mkgtf/meta.yml b/modules/cellranger/mkgtf/meta.yml new file mode 100644 index 00000000..c160072f --- /dev/null +++ b/modules/cellranger/mkgtf/meta.yml @@ -0,0 +1,31 @@ +name: cellranger_mkgtf +description: Module to build a filtered gtf needed by the 10x Genomics Cell Ranger tool. Uses the cellranger mkgtf command. +keywords: + - reference + - mkref + - index +tools: + - cellranger: + description: Cell Ranger by 10x Genomics is a set of analysis pipelines that process Chromium single-cell data to align reads, generate feature-barcode matrices, perform clustering and other secondary analysis, and more. + homepage: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/what-is-cell-ranger + documentation: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ov + tool_dev_url: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ov + doi: "" + licence: 10x Genomics EULA +input: + - gtf: + type: file + description: + pattern: "*.gtf" +output: + - gtf: + type: folder + description: gtf transcriptome file + pattern: "*.filtered.gtf" + - versions: + type: file + description: File containing software version + pattern: "versions.yml" +authors: + - "@ggabernet" + - "@Emiller88" diff --git a/modules/cellranger/mkref/main.nf b/modules/cellranger/mkref/main.nf new file mode 100644 index 00000000..c5d83ac9 --- /dev/null +++ b/modules/cellranger/mkref/main.nf @@ -0,0 +1,33 @@ +process CELLRANGER_MKREF { + tag 'mkref' + label 'process_high' + + if (params.enable_conda) { + exit 1, "Conda environments cannot be used when using the Cell Ranger tool. Please use docker or singularity containers." + } + container "nfcore/cellranger:6.0.2" + + input: + path fasta + path gtf + val reference_name + + output: + path "${reference_name}", emit: reference + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + """ + cellranger \\ + mkref \\ + --genome=$reference_name \\ + --fasta=$fasta \\ + --genes=$gtf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cellranger: \$(echo \$( cellranger --version 2>&1) | sed 's/^.*[^0-9]\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*\$/\\1/' ) + END_VERSIONS + """ +} diff --git a/modules/cellranger/mkref/meta.yml b/modules/cellranger/mkref/meta.yml new file mode 100644 index 00000000..06bf5b93 --- /dev/null +++ b/modules/cellranger/mkref/meta.yml @@ -0,0 +1,37 @@ +name: cellranger_mkref +description: Module to build the reference needed by the 10x Genomics Cell Ranger tool. Uses the cellranger mkref command. +keywords: + - reference + - mkref + - index +tools: + - cellranger: + description: Cell Ranger by 10x Genomics is a set of analysis pipelines that process Chromium single-cell data to align reads, generate feature-barcode matrices, perform clustering and other secondary analysis, and more. + homepage: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/what-is-cell-ranger + documentation: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ov + tool_dev_url: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ov + doi: "" + licence: 10x Genomics EULA +input: + - fasta: + type: file + description: fasta genome file + pattern: "*.{fasta,fa}" + - gtf: + type: file + description: gtf transcriptome file + pattern: "*.gtf" + - reference_name: + type: val + description: name to give the reference folder + pattern: str +output: + - reference: + type: folder + description: Folder containing all the reference indices needed by Cell Ranger + - versions: + type: file + description: File containing software version + pattern: "versions.yml" +authors: + - "@ggabernet" diff --git a/modules/checkm/lineagewf/main.nf b/modules/checkm/lineagewf/main.nf new file mode 100644 index 00000000..992b165e --- /dev/null +++ b/modules/checkm/lineagewf/main.nf @@ -0,0 +1,39 @@ +process CHECKM_LINEAGEWF { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::checkm-genome=1.1.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/checkm-genome:1.1.3--py_1' : + 'quay.io/biocontainers/checkm-genome:1.1.3--py_1' }" + + input: + tuple val(meta), path(fasta) + val fasta_ext + + output: + tuple val(meta), path("${prefix}") , emit: checkm_output + tuple val(meta), path("${prefix}.tsv"), emit: checkm_tsv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + checkm \\ + lineage_wf \\ + -t $task.cpus \\ + -f ${prefix}.tsv \\ + --tab_table \\ + --pplacer_threads $task.cpus \\ + -x $fasta_ext \\ + $args \\ + . \\ + $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + checkm: \$( checkm 2>&1 | grep '...:::' | sed 's/.*CheckM v//;s/ .*//' ) + END_VERSIONS + """ +} diff --git a/modules/checkm/lineagewf/meta.yml b/modules/checkm/lineagewf/meta.yml new file mode 100644 index 00000000..29c6096e --- /dev/null +++ b/modules/checkm/lineagewf/meta.yml @@ -0,0 +1,58 @@ +name: checkm_lineagewf +description: CheckM provides a set of tools for assessing the quality of genomes recovered from isolates, single cells, or metagenomes. +keywords: + - checkm + - mag + - metagenome + - quality + - isolates + - microbes + - single cells + - completeness + - contamination + - bins + - genome bins +tools: + - checkm: + description: Assess the quality of microbial genomes recovered from isolates, single cells, and metagenomes. + homepage: https://ecogenomics.github.io/CheckM/ + documentation: https://github.com/Ecogenomics/CheckM/wiki + tool_dev_url: https://github.com/Ecogenomics/CheckM + doi: "10.1101/gr.186072.114" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: One or a list of multiple FASTA files of each bin, with extension defined with the fasta_ext value + pattern: "*.{$fasta_ext}" + - fasta_ext: + type: value + description: The file-type extension suffix of the input FASTA files (e.g., fasta, fna, fa, fas) + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample', bin:'1' ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - checkm_output: + type: directory + description: CheckM output directory + pattern: "*/" + - checkm_tsv: + type: file + description: CheckM summary completeness statistics table + pattern: "*.tsv" + +authors: + - "@jfy133" diff --git a/modules/chromap/chromap/main.nf b/modules/chromap/chromap/main.nf new file mode 100644 index 00000000..4a7f0097 --- /dev/null +++ b/modules/chromap/chromap/main.nf @@ -0,0 +1,92 @@ +def VERSION = '0.1' // Version information not provided by tool on CLI + +process CHROMAP_CHROMAP { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::chromap=0.1 bioconda::samtools=1.13" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:2cad7c5aa775241887eff8714259714a39baf016-0' : + 'quay.io/biocontainers/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:2cad7c5aa775241887eff8714259714a39baf016-0' }" + + input: + tuple val(meta), path(reads) + path fasta + path index + path barcodes + path whitelist + path chr_order + path pairs_chr_order + + output: + tuple val(meta), path("*.bed.gz") , optional:true, emit: bed + 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: versions + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def args_list = args.tokenize() + + def file_extension = args.contains("--SAM") ? 'sam' : args.contains("--TagAlign")? 'tagAlign' : args.contains("--pairs")? 'pairs' : 'bed' + if (barcodes) { + args_list << "-b ${barcodes.join(',')}" + if (whitelist) { + args_list << "--barcode-whitelist $whitelist" + } + } + if (chr_order) { + args_list << "--chr-order $chr_order" + } + if (pairs_chr_order){ + args_list << "--pairs-natural-chr-order $pairs_chr_order" + } + def final_args = args_list.join(' ') + def compression_cmds = "gzip ${prefix}.${file_extension}" + if (args.contains("--SAM")) { + compression_cmds = """ + samtools view $args2 -@ $task.cpus -bh \\ + -o ${prefix}.bam ${prefix}.${file_extension} + rm ${prefix}.${file_extension} + """ + } + if (meta.single_end) { + """ + chromap \\ + $final_args \\ + -t $task.cpus \\ + -x $index \\ + -r $fasta \\ + -1 ${reads.join(',')} \\ + -o ${prefix}.${file_extension} + + $compression_cmds + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + chromap: $VERSION + END_VERSIONS + """ + } else { + """ + chromap \\ + $final_args \\ + -t $task.cpus \\ + -x $index \\ + -r $fasta \\ + -1 ${reads[0]} \\ + -2 ${reads[1]} \\ + -o ${prefix}.${file_extension} + + $compression_cmds + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + chromap: $VERSION + END_VERSIONS + """ + } +} diff --git a/modules/chromap/chromap/meta.yml b/modules/chromap/chromap/meta.yml new file mode 100644 index 00000000..57936c67 --- /dev/null +++ b/modules/chromap/chromap/meta.yml @@ -0,0 +1,88 @@ +name: chromap_chromap +description: | + Performs preprocessing and alignment of chromatin fastq files to + fasta reference files using chromap. +keywords: + - chromap + - alignment + - map + - fastq + - bam + - sam + - hi-c + - atac-seq + - chip-seq + - trimming + - duplicate removal +tools: + - chromap: + description: Fast alignment and preprocessing of chromatin profiles + homepage: https://github.com/haowenz/chromap + documentation: https://github.com/haowenz/chromap + tool_dev_url: https://github.com/haowenz/chromap + doi: "" + licence: ['GPL v3'] +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. + - fasta: + type: file + description: | + The fasta reference file. + - index: + type: file + description: | + Chromap genome index files (*.index) + - barcodes: + type: file + description: | + Cell barcode files + - whitelist: + type: file + description: | + Cell barcode whitelist file + - chr_order: + type: file + description: | + Custom chromosome order + - pairs_chr_order: + type: file + description: | + Natural chromosome order for pairs flipping +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" + - bed: + type: file + description: BED file + pattern: "*.bed.gz" + - bam: + type: file + description: BAM file + pattern: "*.bam" + - tagAlign: + type: file + description: tagAlign file + pattern: "*.tagAlign.gz" + - pairs: + type: file + description: pairs file + pattern: "*.pairs.gz" + +authors: + - "@mahesh-panchal" diff --git a/modules/chromap/index/main.nf b/modules/chromap/index/main.nf new file mode 100644 index 00000000..cafeca2f --- /dev/null +++ b/modules/chromap/index/main.nf @@ -0,0 +1,36 @@ +def VERSION = '0.1' // Version information not provided by tool on CLI + +process CHROMAP_INDEX { + tag '$fasta' + label 'process_medium' + + conda (params.enable_conda ? "bioconda::chromap=0.1 bioconda::samtools=1.13" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:2cad7c5aa775241887eff8714259714a39baf016-0' : + 'quay.io/biocontainers/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:2cad7c5aa775241887eff8714259714a39baf016-0' }" + + input: + path fasta + + output: + path "*.index" , emit: index + path "versions.yml", emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = fasta.baseName + """ + chromap \\ + -i \\ + $args \\ + -t $task.cpus \\ + -r $fasta \\ + -o ${prefix}.index + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + chromap: $VERSION + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ +} diff --git a/modules/chromap/index/meta.yml b/modules/chromap/index/meta.yml new file mode 100644 index 00000000..a6a18fe9 --- /dev/null +++ b/modules/chromap/index/meta.yml @@ -0,0 +1,33 @@ +name: chromap_index +description: Indexes a fasta reference genome ready for chromatin profiling. +keywords: + - index + - fasta + - genome + - reference +tools: + - chromap: + description: Fast alignment and preprocessing of chromatin profiles + homepage: https://github.com/haowenz/chromap + documentation: https://github.com/haowenz/chromap + tool_dev_url: https://github.com/haowenz/chromap + doi: "" + licence: ['GPL v3'] + +input: + - fasta: + type: file + description: Fasta reference file. + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - index: + type: file + description: Index file of the reference genome + pattern: "*.{index}" + +authors: + - "@mahesh-panchal" diff --git a/modules/clonalframeml/main.nf b/modules/clonalframeml/main.nf new file mode 100644 index 00000000..db647a38 --- /dev/null +++ b/modules/clonalframeml/main.nf @@ -0,0 +1,37 @@ +process CLONALFRAMEML { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::clonalframeml=1.12" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/clonalframeml:1.12--h7d875b9_1' : + 'quay.io/biocontainers/clonalframeml:1.12--h7d875b9_1' }" + + input: + tuple val(meta), path(newick), path(msa) + + output: + tuple val(meta), path("*.emsim.txt") , emit: emsim, optional: true + tuple val(meta), path("*.em.txt") , emit: em + tuple val(meta), path("*.importation_status.txt") , emit: status + tuple val(meta), path("*.labelled_tree.newick") , emit: newick + tuple val(meta), path("*.ML_sequence.fasta") , emit: fasta + tuple val(meta), path("*.position_cross_reference.txt"), emit: pos_ref + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + ClonalFrameML \\ + $newick \\ + <(gzip -cdf $msa) \\ + $prefix \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + clonalframeml: \$( echo \$(ClonalFrameML -version 2>&1) | sed 's/^.*ClonalFrameML v//' ) + END_VERSIONS + """ +} diff --git a/modules/clonalframeml/meta.yml b/modules/clonalframeml/meta.yml new file mode 100644 index 00000000..874a04be --- /dev/null +++ b/modules/clonalframeml/meta.yml @@ -0,0 +1,67 @@ +name: clonalframeml +description: Predict recomination events in bacterial genomes +keywords: + - fasta + - multiple sequence alignment + - recombination +tools: + - clonalframeml: + description: Efficient inferencing of recombination in bacterial genomes + homepage: https://github.com/xavierdidelot/ClonalFrameML + documentation: https://github.com/xavierdidelot/clonalframeml/wiki + tool_dev_url: https://github.com/xavierdidelot/ClonalFrameML + doi: "10.1371/journal.pcbi.1004041" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - msa: + type: file + description: A multiple seqeunce alignmnet in FASTA format + pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz}" + - newick: + type: file + description: A Newick formated tree based on multiple sequence alignment + pattern: "*.{newick,treefile,dnd}" + +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" + - emsim: + type: file + description: Bootstrapped values for the three parameters R/theta, nu and delta + pattern: "*.emsim.txt" + - em: + type: file + description: Point estimates for R/theta, nu, delta and the branch lengths + pattern: "*.em.txt" + - fasta: + type: file + description: Sequence reconstructed by maximum likelihood + pattern: "*.ML_sequence.fasta" + - newick: + type: file + description: Tree with all nodes labelled + pattern: "*.labelled_tree.newick" + - pos_ref: + type: file + description: CSV mapping input sequence files to the sequences in the *.ML_sequence.fasta + pattern: "*.position_cross_reference.txt" + - status: + type: file + description: List of reconstructed recombination events + pattern: "*.importation_status.txt" + +authors: + - "@rpetit3" diff --git a/modules/cmseq/polymut/main.nf b/modules/cmseq/polymut/main.nf new file mode 100644 index 00000000..47e86f0c --- /dev/null +++ b/modules/cmseq/polymut/main.nf @@ -0,0 +1,37 @@ +def VERSION = '1.0.4' // Version information not provided by tool on CLI + +process CMSEQ_POLYMUT { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::cmseq=1.0.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cmseq:1.0.4--pyhb7b1952_0' : + 'quay.io/biocontainers/cmseq:1.0.4--pyhb7b1952_0' }" + + input: + tuple val(meta), path(bam), path(bai), path(gff), path(fasta) + + output: + tuple val(meta), path("*.txt"), emit: polymut + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def fasta_refid = fasta ? "-c $fasta" : "" + def sortindex = bai ? "" : "--sortindex" + """ + polymut.py \\ + $args \\ + $sortindex \\ + $fasta_refid \\ + --gff_file $gff \\ + $bam > ${prefix}.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cmseq: $VERSION + END_VERSIONS + """ +} diff --git a/modules/cmseq/polymut/meta.yml b/modules/cmseq/polymut/meta.yml new file mode 100644 index 00000000..49e6b519 --- /dev/null +++ b/modules/cmseq/polymut/meta.yml @@ -0,0 +1,61 @@ +name: cmseq_polymut +description: Calculates polymorphic site rates over protein coding genes +keywords: + - polymut + - polymorphic + - mags + - assembly + - polymorphic sites + - estimation + - protein coding genes + - cmseq + - bam + - coverage +tools: + - cmseq: + description: Set of utilities on sequences and BAM files + homepage: https://github.com/SegataLab/cmseq + documentation: https://github.com/SegataLab/cmseq + tool_dev_url: https://github.com/SegataLab/cmseq + licence: ['MIT License'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM file + pattern: "*.bam" + - bai: + type: file + description: BAM index file + pattern: "*.bai" + - gff: + type: file + description: GFF file used to extract protein-coding genes + pattern: "*.gff" + - fasta: + type: file + description: Optional fasta file to run on a subset of references in the BAM file. + pattern: .{fa,fasta,fas,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" + - polymut: + type: file + description: Polymut report in `.txt` format. + pattern: "*.txt" + +authors: + - "@maxibor" diff --git a/modules/cnvkit/batch/main.nf b/modules/cnvkit/batch/main.nf new file mode 100644 index 00000000..811cb409 --- /dev/null +++ b/modules/cnvkit/batch/main.nf @@ -0,0 +1,52 @@ +process CNVKIT_BATCH { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? 'bioconda::cnvkit=0.9.9' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cnvkit:0.9.9--pyhdfd78af_0' : + 'quay.io/biocontainers/cnvkit:0.9.9--pyhdfd78af_0' }" + + input: + tuple val(meta), path(tumor), path(normal) + path fasta + path targets + path reference + + output: + tuple val(meta), path("*.bed"), emit: bed + tuple val(meta), path("*.cnn"), emit: cnn, optional: true + tuple val(meta), path("*.cnr"), emit: cnr, optional: true + tuple val(meta), path("*.cns"), emit: cns, optional: true + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def normal_args = normal ? "--normal $normal" : "" + def fasta_args = fasta ? "--fasta $fasta" : "" + def reference_args = reference ? "--reference $reference" : "" + + def target_args = "" + if (args.contains("--method wgs") || args.contains("-m wgs")) { + target_args = targets ? "--targets $targets" : "" + } + else { + target_args = "--targets $targets" + } + """ + cnvkit.py \\ + batch \\ + $tumor \\ + $normal_args \\ + $fasta_args \\ + $reference_args \\ + $target_args \\ + --processes $task.cpus \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cnvkit: \$(cnvkit.py version | sed -e "s/cnvkit v//g") + END_VERSIONS + """ +} diff --git a/modules/cnvkit/meta.yml b/modules/cnvkit/batch/meta.yml old mode 100755 new mode 100644 similarity index 85% rename from modules/cnvkit/meta.yml rename to modules/cnvkit/batch/meta.yml index d3d81ecc..0d263041 --- a/modules/cnvkit/meta.yml +++ b/modules/cnvkit/batch/meta.yml @@ -1,4 +1,4 @@ -name: cnvkit +name: cnvkit_batch description: Copy number variant detection from high-throughput sequencing data keywords: - bam @@ -10,6 +10,7 @@ tools: CNVkit is a Python library and command-line software toolkit to infer and visualize copy number from high-throughput DNA sequencing data. It is designed for use with hybrid capture, including both whole-exome and custom target panels, and short-read sequencing platforms such as Illumina and Ion Torrent. homepage: https://cnvkit.readthedocs.io/en/stable/index.html documentation: https://cnvkit.readthedocs.io/en/stable/index.html + licence: ['Apache-2.0'] params: - outdir: type: string @@ -37,14 +38,14 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - tumourbam: + - tumour: type: file description: | - Input tumour sample bam file - - normalbam: + Input tumour sample bam file (or cram) + - normal: type: file description: | - Input normal sample bam file + Input normal sample bam file (or cram) - fasta: type: file description: | @@ -53,6 +54,10 @@ input: type: file description: | Input target bed file + - reference: + type: file + description: | + Input reference cnn-file (only for germline and tumor-only running) output: - meta: type: map @@ -75,13 +80,14 @@ output: type: file description: File containing copy number segment information pattern: "*.{cns}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@kaurravneet4123" - "@KevinMenden" - "@MaxUlysse" - "@drpatelh" - + - "@fbdtemme" + - "@lassefolkersen" diff --git a/modules/cnvkit/functions.nf b/modules/cnvkit/functions.nf deleted file mode 100755 index da9da093..00000000 --- a/modules/cnvkit/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 deleted file mode 100755 index dee6051d..00000000 --- a/modules/cnvkit/main.nf +++ /dev/null @@ -1,46 +0,0 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -process CNVKIT { - 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::cnvkit=0.9.8" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/cnvkit:0.9.8--py_0" - } else { - container "quay.io/biocontainers/cnvkit:0.9.8--py_0" - } - - input: - tuple val(meta), path(tumourbam), path(normalbam) - path fasta - path targetfile - - output: - tuple val(meta), path("*.bed"), emit: bed - 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 - - script: - def software = getSoftwareName(task.process) - """ - cnvkit.py \\ - batch \\ - $tumourbam \\ - --normal $normalbam\\ - --fasta $fasta \\ - --targets $targetfile \\ - $options.args - - echo \$(cnvkit.py version) | sed -e "s/cnvkit v//g" > ${software}.version.txt - """ -} diff --git a/modules/cooler/cload/main.nf b/modules/cooler/cload/main.nf new file mode 100644 index 00000000..d8bdc031 --- /dev/null +++ b/modules/cooler/cload/main.nf @@ -0,0 +1,37 @@ +process COOLER_CLOAD { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::cooler=0.8.11" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cooler:0.8.11--pyh3252c3a_0' : + 'quay.io/biocontainers/cooler:0.8.11--pyh3252c3a_0' }" + + input: + tuple val(meta), path(pairs), path(index) + val cool_bin + path chromsizes + + output: + tuple val(meta), val(cool_bin), path("*.cool"), emit: cool + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def nproc = args.contains('pairix') || args.contains('tabix')? "--nproc $task.cpus" : '' + + """ + cooler cload \\ + $args \\ + $nproc \\ + ${chromsizes}:${cool_bin} \\ + $pairs \\ + ${prefix}.${cool_bin}.cool + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cooler: \$(cooler --version 2>&1 | sed 's/cooler, version //') + END_VERSIONS + """ +} diff --git a/modules/cooler/cload/meta.yml b/modules/cooler/cload/meta.yml new file mode 100644 index 00000000..8ac75911 --- /dev/null +++ b/modules/cooler/cload/meta.yml @@ -0,0 +1,52 @@ +name: cooler_cload +description: Create a cooler from genomic pairs and bins +keywords: + - cool +tools: + - cooler: + description: Sparse binary format for genomic interaction matrices + homepage: https://cooler.readthedocs.io/en/latest/index.html + documentation: https://cooler.readthedocs.io/en/latest/index.html + tool_dev_url: https://github.com/open2c/cooler + doi: "10.1093/bioinformatics/btz540" + licence: ['BSD-3-clause'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - pairs: + type: file + description: Path to contacts (i.e. read pairs) file. + - index: + type: file + description: Path to index file of the contacts. + - cool_bin: + type: value + description: Bins size in bp + - chromsizes: + type: file + description: Path to a chromsizes file. + +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" + - cool: + type: file + description: Output COOL file path + pattern: "*.cool" + - cool_bin: + type: value + description: Bins size in bp + +authors: + - "@jianhong" diff --git a/modules/cooler/digest/functions.nf b/modules/cooler/digest/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/cooler/digest/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 399541d9..9658ec31 100644 --- a/modules/cooler/digest/main.nf +++ b/modules/cooler/digest/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process COOLER_DIGEST { - tag '$fasta' + tag "$fasta" 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:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::cooler=0.8.11" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/cooler:0.8.11--pyh3252c3a_0" - } else { - container "quay.io/biocontainers/cooler:0.8.11--pyh3252c3a_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cooler:0.8.11--pyh3252c3a_0' : + 'quay.io/biocontainers/cooler:0.8.11--pyh3252c3a_0' }" input: path fasta @@ -25,18 +14,21 @@ process COOLER_DIGEST { output: path "*.bed" , emit: bed - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ cooler digest \\ - $options.args \\ - -o "${fasta.baseName}_${enzyme.replaceAll(/[^0-9a-zA-Z]+/, "_")}.bed" \\ + $args \\ + -o "${fasta.baseName}_${enzyme.replaceAll(/[^0-9a-zA-Z]+/, '_')}.bed" \\ $chromsizes \\ $fasta \\ $enzyme - echo \$(cooler --version 2>&1) | sed 's/cooler, version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cooler: \$(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..6ce95ad7 100644 --- a/modules/cooler/digest/meta.yml +++ b/modules/cooler/digest/meta.yml @@ -10,7 +10,7 @@ tools: documentation: https://cooler.readthedocs.io/en/latest/index.html tool_dev_url: https://github.com/open2c/cooler doi: "10.1093/bioinformatics/btz540" - licence: ['BSD-3-clause'] + licence: ['BSD-3-Clause'] input: - fasta: @@ -26,10 +26,10 @@ input: documentation: http://biopython.org/DIST/docs/cookbook/Restriction.html output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/cooler/dump/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..a438acc8 100644 --- a/modules/cooler/dump/main.nf +++ b/modules/cooler/dump/main.nf @@ -1,39 +1,33 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process COOLER_DUMP { 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::cooler=0.8.11" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/cooler:0.8.11--pyh3252c3a_0" - } else { - container "quay.io/biocontainers/cooler:0.8.11--pyh3252c3a_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cooler:0.8.11--pyh3252c3a_0' : + 'quay.io/biocontainers/cooler:0.8.11--pyh3252c3a_0' }" input: tuple val(meta), path(cool) + val resolution output: tuple val(meta), path("*.bedpe"), emit: bedpe - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = resolution ? "::$resolution" : "" """ cooler dump \\ - $options.args \\ + $args \\ -o ${prefix}.bedpe \\ - $cool + $cool$suffix - echo \$(cooler --version 2>&1) | sed 's/cooler, version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cooler: \$(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..a9d1afd5 100644 --- a/modules/cooler/dump/meta.yml +++ b/modules/cooler/dump/meta.yml @@ -9,7 +9,7 @@ tools: documentation: https://cooler.readthedocs.io/en/latest/index.html tool_dev_url: https://github.com/open2c/cooler doi: "10.1093/bioinformatics/btz540" - licence: ['BSD-3-clause'] + licence: ['BSD-3-Clause'] input: - meta: @@ -21,6 +21,9 @@ input: type: file description: Path to COOL file pattern: "*.{cool,mcool}" + - resolution: + type: value + description: Resolution output: - meta: @@ -28,10 +31,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bedpe: type: file description: Output text file diff --git a/modules/cooler/merge/main.nf b/modules/cooler/merge/main.nf new file mode 100644 index 00000000..b1814b68 --- /dev/null +++ b/modules/cooler/merge/main.nf @@ -0,0 +1,31 @@ +process COOLER_MERGE { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::cooler=0.8.11" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cooler:0.8.11--pyh3252c3a_0' : + 'quay.io/biocontainers/cooler:0.8.11--pyh3252c3a_0' }" + + input: + tuple val(meta), path(cool) + + output: + tuple val(meta), path("*.cool"), emit: cool + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + cooler merge \\ + $args \\ + ${prefix}.cool \\ + ${cool} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cooler: \$(cooler --version 2>&1 | sed 's/cooler, version //') + END_VERSIONS + """ +} diff --git a/modules/cooler/merge/meta.yml b/modules/cooler/merge/meta.yml new file mode 100644 index 00000000..f5c0a733 --- /dev/null +++ b/modules/cooler/merge/meta.yml @@ -0,0 +1,41 @@ +name: cooler_merge +description: Merge multiple coolers with identical axes +keywords: + - merge +tools: + - cooler: + description: Sparse binary format for genomic interaction matrices + homepage: https://cooler.readthedocs.io/en/latest/index.html + documentation: https://cooler.readthedocs.io/en/latest/index.html + tool_dev_url: https://github.com/open2c/cooler + doi: "10.1093/bioinformatics/btz540" + licence: ['BSD-3-clause'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cool: + type: file + description: Path to COOL file + pattern: "*.{cool,mcool}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software version + pattern: "versions.yml" + - cool: + type: file + description: Path to COOL file + pattern: "*.cool" + +authors: + - "@jianhong" diff --git a/modules/cooler/zoomify/main.nf b/modules/cooler/zoomify/main.nf new file mode 100644 index 00000000..226d4114 --- /dev/null +++ b/modules/cooler/zoomify/main.nf @@ -0,0 +1,32 @@ +process COOLER_ZOOMIFY { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::cooler=0.8.11" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cooler:0.8.11--pyh3252c3a_0' : + 'quay.io/biocontainers/cooler:0.8.11--pyh3252c3a_0' }" + + input: + tuple val(meta), path(cool) + + output: + tuple val(meta), path("*.mcool"), emit: mcool + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + cooler zoomify \\ + $args \\ + -n $task.cpus \\ + -o ${prefix}.mcool \\ + $cool + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cooler: \$(cooler --version 2>&1 | sed 's/cooler, version //') + END_VERSIONS + """ +} diff --git a/modules/cooler/zoomify/meta.yml b/modules/cooler/zoomify/meta.yml new file mode 100644 index 00000000..74bdbf44 --- /dev/null +++ b/modules/cooler/zoomify/meta.yml @@ -0,0 +1,41 @@ +name: cooler_zoomify +description: Generate a multi-resolution cooler file by coarsening +keywords: + - mcool +tools: + - cooler: + description: Sparse binary format for genomic interaction matrices + homepage: https://cooler.readthedocs.io/en/latest/index.html + documentation: https://cooler.readthedocs.io/en/latest/index.html + tool_dev_url: https://github.com/open2c/cooler + doi: "10.1093/bioinformatics/btz540" + licence: ['BSD-3-clause'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cool: + type: file + description: Path to COOL file + pattern: "*.{cool,mcool}" + +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" + - mcool: + type: file + description: Output mcool file + pattern: "*.mcool" + +authors: + - "@jianhong" diff --git a/modules/csvtk/concat/main.nf b/modules/csvtk/concat/main.nf new file mode 100644 index 00000000..94b1925a --- /dev/null +++ b/modules/csvtk/concat/main.nf @@ -0,0 +1,40 @@ +process CSVTK_CONCAT { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::csvtk=0.23.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/csvtk:0.23.0--h9ee0642_0' : + '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("${prefix}.${out_extension}"), emit: csv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${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 \\ + $args \\ + --num-cpus $task.cpus \\ + --delimiter "${delimiter}" \\ + --out-delimiter "${out_delimiter}" \\ + --out-file ${prefix}.${out_extension} \\ + $csv + + cat <<-END_VERSIONS > versions.yml + "${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/modules/csvtk/split/main.nf b/modules/csvtk/split/main.nf new file mode 100644 index 00000000..52ab7ec7 --- /dev/null +++ b/modules/csvtk/split/main.nf @@ -0,0 +1,40 @@ +process CSVTK_SPLIT { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::csvtk=0.23.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/csvtk:0.23.0--h9ee0642_0' : + '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_extension}"), emit: split_csv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def delimiter = in_format == "tsv" ? "--tabs" : (in_format == "csv" ? "--delimiter ',' " : in_format) + def out_delimiter = out_format == "tsv" ? "--out-tabs" : (out_format == "csv" ? "--out-delimiter ',' " : out_format) + out_extension = out_format == "tsv" ? 'tsv' : 'csv' + """ + sed -i.bak '/^##/d' $csv + csvtk \\ + split \\ + $args \\ + --num-cpus $task.cpus \\ + $delimiter \\ + $out_delimiter \\ + $csv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + csvtk: \$(echo \$( csvtk version | sed -e 's/csvtk v//g' )) + END_VERSIONS + """ +} diff --git a/modules/csvtk/split/meta.yml b/modules/csvtk/split/meta.yml new file mode 100644 index 00000000..45b71d14 --- /dev/null +++ b/modules/csvtk/split/meta.yml @@ -0,0 +1,52 @@ +name: csvtk_split +description: Splits CSV/TSV into multiple files according to column values +keywords: + - split + - csv + - tsv +tools: + - csvtk: + description: + CSVTK is a cross-platform, efficient and practical CSV/TSV toolkit + that allows rapid data investigation and manipulation. + homepage: https://bioinf.shenwei.me/csvtk/ + documentation: https://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 file + 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: "versions.yml" + - split_csv: + type: file + description: Split CSV/TSV file + pattern: "*.{csv,tsv}" + +authors: + - "@SusiJo" diff --git a/modules/custom/dumpsoftwareversions/main.nf b/modules/custom/dumpsoftwareversions/main.nf new file mode 100644 index 00000000..934bb467 --- /dev/null +++ b/modules/custom/dumpsoftwareversions/main.nf @@ -0,0 +1,21 @@ +process CUSTOM_DUMPSOFTWAREVERSIONS { + label 'process_low' + + // Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container + conda (params.enable_conda ? "bioconda::multiqc=1.11" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/multiqc:1.11--pyhdfd78af_0' : + '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_yml + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + template 'dumpsoftwareversions.py' +} diff --git a/modules/custom/dumpsoftwareversions/meta.yml b/modules/custom/dumpsoftwareversions/meta.yml new file mode 100644 index 00000000..5b5b8a60 --- /dev/null +++ b/modules/custom/dumpsoftwareversions/meta.yml @@ -0,0 +1,34 @@ +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 + licence: ['MIT'] +input: + - versions: + type: file + description: YML file containing software versions + pattern: "*.yml" + +output: + - yml: + type: file + description: Standard YML file containing software versions + pattern: "software_versions.yml" + - mqc_yml: + type: file + description: MultiQC custom content YML file containing software versions + pattern: "software_versions_mqc.yml" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@drpatelh" + - "@grst" diff --git a/modules/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py b/modules/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py new file mode 100644 index 00000000..d1390392 --- /dev/null +++ b/modules/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py @@ -0,0 +1,89 @@ +#!/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) + + +versions_this_module = {} +versions_this_module["${task.process}"] = { + "python": platform.python_version(), + "yaml": yaml.__version__, +} + +with open("$versions") as f: + versions_by_process = yaml.load(f, Loader=yaml.BaseLoader) | versions_this_module + +# aggregate versions by the module name (derived from fully-qualified process name) +versions_by_module = {} +for process, process_versions in versions_by_process.items(): + module = process.split(":")[-1] + try: + assert versions_by_module[module] == process_versions, ( + "We assume that software versions are the same between all modules. " + "If you see this error-message it means you discovered an edge-case " + "and should open an issue in nf-core/tools. " + ) + except KeyError: + versions_by_module[module] = process_versions + +versions_by_module["Workflow"] = { + "Nextflow": "$workflow.nextflow.version", + "$workflow.manifest.name": "$workflow.manifest.version", +} + +versions_mqc = { + "id": "software_versions", + "section_name": "${workflow.manifest.name} Software Versions", + "section_href": "https://github.com/${workflow.manifest.name}", + "plot_type": "html", + "description": "are collected at run time from the software output.", + "data": _make_versions_html(versions_by_module), +} + +with open("software_versions.yml", "w") as f: + yaml.dump(versions_by_module, f, default_flow_style=False) +with open("software_versions_mqc.yml", "w") as f: + yaml.dump(versions_mqc, f, default_flow_style=False) + +with open("versions.yml", "w") as f: + yaml.dump(versions_this_module, f, default_flow_style=False) diff --git a/modules/custom/getchromsizes/main.nf b/modules/custom/getchromsizes/main.nf new file mode 100644 index 00000000..270b3f48 --- /dev/null +++ b/modules/custom/getchromsizes/main.nf @@ -0,0 +1,29 @@ +process CUSTOM_GETCHROMSIZES { + tag "$fasta" + label 'process_low' + + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + + input: + path fasta + + output: + path '*.sizes' , emit: sizes + path '*.fai' , emit: fai + path "versions.yml", emit: versions + + script: + def args = task.ext.args ?: '' + """ + samtools faidx $fasta + cut -f 1,2 ${fasta}.fai > ${fasta}.sizes + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + custom: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ +} diff --git a/modules/custom/getchromsizes/meta.yml b/modules/custom/getchromsizes/meta.yml new file mode 100644 index 00000000..eb1db4bb --- /dev/null +++ b/modules/custom/getchromsizes/meta.yml @@ -0,0 +1,39 @@ +name: custom_getchromsizes +description: Generates a FASTA file of chromosome sizes and a fasta index file +keywords: + - fasta + - chromosome + - indexing +tools: + - samtools: + description: Tools for dealing with SAM, BAM and CRAM files + homepage: http://www.htslib.org/ + documentation: http://www.htslib.org/doc/samtools.html + tool_dev_url: https://github.com/samtools/samtools + doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] + +input: + - fasta: + type: file + description: FASTA file + pattern: "*.{fasta}" + +output: + - sizes: + type: file + description: File containing chromosome lengths + pattern: "*.{sizes}" + - fai: + type: file + description: FASTA index file + pattern: "*.{fai}" + - versions: + type: file + description: File containing software version + pattern: "versions.yml" + + +authors: + - "@tamara-hodgetts" + - "@chris-cheshire" diff --git a/modules/cutadapt/functions.nf b/modules/cutadapt/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/cutadapt/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 c392367e..89105715 100644 --- a/modules/cutadapt/main.nf +++ b/modules/cutadapt/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process CUTADAPT { 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::cutadapt=3.2' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/cutadapt:3.2--py38h0213d0e_0' - } else { - container 'quay.io/biocontainers/cutadapt:3.2--py38h0213d0e_0' - } + conda (params.enable_conda ? 'bioconda::cutadapt=3.4' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cutadapt:3.4--py39h38f01e4_1' : + 'quay.io/biocontainers/cutadapt:3.4--py37h73a75cf_1' }" input: tuple val(meta), path(reads) @@ -24,19 +13,22 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def trimmed = meta.single_end ? "-o ${prefix}.trim.fastq.gz" : "-o ${prefix}_1.trim.fastq.gz -p ${prefix}_2.trim.fastq.gz" """ cutadapt \\ --cores $task.cpus \\ - $options.args \\ + $args \\ $trimmed \\ $reads \\ > ${prefix}.cutadapt.log - echo \$(cutadapt --version) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cutadapt: \$(cutadapt --version) + END_VERSIONS """ } diff --git a/modules/cutadapt/meta.yml b/modules/cutadapt/meta.yml index 14652343..b4e6f6e7 100644 --- a/modules/cutadapt/meta.yml +++ b/modules/cutadapt/meta.yml @@ -11,6 +11,7 @@ tools: Cutadapt finds and removes adapter sequences, primers, poly-A tails and other types of unwanted sequence from your high-throughput sequencing reads. documentation: https://cutadapt.readthedocs.io/en/stable/index.html doi: DOI:10.14806/ej.17.1.200 + licence: ['MIT'] input: - meta: type: map @@ -36,10 +37,10 @@ output: type: file description: cuatadapt log file pattern: "*cutadapt.log" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/damageprofiler/functions.nf b/modules/damageprofiler/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/damageprofiler/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..23eb9397 100644 --- a/modules/damageprofiler/main.nf +++ b/modules/damageprofiler/main.nf @@ -1,44 +1,38 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process DAMAGEPROFILER { 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::damageprofiler=1.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/damageprofiler:1.1--hdfd78af_2" - } else { - container "quay.io/biocontainers/damageprofiler:1.1--hdfd78af_2" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/damageprofiler:1.1--hdfd78af_2' : + 'quay.io/biocontainers/damageprofiler:1.1--hdfd78af_2' }" input: tuple val(meta), path(bam) path fasta path fai + path specieslist output: tuple val(meta), path("${prefix}"), emit: results - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def reference = fasta ? "-r $fasta" : "" + def species_list = specieslist ? "-sf $specieslist" : "" """ damageprofiler \\ -i $bam \\ - -r $fasta \\ -o $prefix/ \\ - $options.args + $args \\ + $reference \\ + $species_list - - echo \$(damageprofiler -v) | sed 's/^DamageProfiler v//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + damageprofiler: \$(damageprofiler -v | sed 's/^DamageProfiler v//') + END_VERSIONS """ } diff --git a/modules/damageprofiler/meta.yml b/modules/damageprofiler/meta.yml index b32b9bff..19ba908f 100644 --- a/modules/damageprofiler/meta.yml +++ b/modules/damageprofiler/meta.yml @@ -32,18 +32,22 @@ 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: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - results: type: dir description: DamageProfiler results directory diff --git a/modules/dastool/dastool/main.nf b/modules/dastool/dastool/main.nf new file mode 100644 index 00000000..722f6c55 --- /dev/null +++ b/modules/dastool/dastool/main.nf @@ -0,0 +1,64 @@ +process DASTOOL_DASTOOL { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::das_tool=1.1.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/das_tool:1.1.3--r41hdfd78af_0' : + 'quay.io/biocontainers/das_tool:1.1.3--r41hdfd78af_0' }" + + input: + tuple val(meta), path(contigs), path(bins) + path(proteins) + path(db_directory) + val(search_engine) + + output: + tuple val(meta), path("*.log") , emit: log + tuple val(meta), path("*_summary.txt") , emit: summary + tuple val(meta), path("*_DASTool_scaffolds2bin.txt") , emit: scaffolds2bin + tuple val(meta), path("*.eval") , optional: true, emit: eval + tuple val(meta), path("*_DASTool_bins/*.fa") , optional: true, emit: bins + tuple val(meta), path("*.pdf") , optional: true, emit: pdfs + tuple val(meta), path("*.proteins.faa") , optional: true, emit: fasta_proteins + tuple val(meta), path("*.archaea.scg") , optional: true, emit: fasta_archaea_scg + tuple val(meta), path("*.bacteria.scg") , optional: true, emit: fasta_bacteria_scg + tuple val(meta), path("*.seqlength") , optional: true, emit: seqlength + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def bin_list = bins instanceof List ? bins.join(",") : "$bins" + def engine = search_engine ? "--search_engine $search_engine" : "--search_engine diamond" + def db_dir = db_directory ? "--db_directory $db_directory" : "" + def clean_contigs = contigs.toString() - ".gz" + def decompress_contigs = contigs.toString() == clean_contigs ? "" : "gunzip -q -f $contigs" + def decompress_proteins = proteins ? "gunzip -f $proteins" : "" + def clean_proteins = proteins ? proteins.toString() - ".gz" : "" + def proteins_pred = proteins ? "--proteins $clean_proteins" : "" + + if (! search_engine) { + log.info('[DAS_Tool] Default search engine (USEARCH) is proprietary software and not available in bioconda. Using DIAMOND as alternative.') + } + + """ + $decompress_proteins + $decompress_contigs + + DAS_Tool \\ + $args \\ + $proteins_pred \\ + $db_dir \\ + $engine \\ + -t $task.cpus \\ + --bins $bin_list \\ + -c $clean_contigs \\ + -o $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + dastool: \$( DAS_Tool --version 2>&1 | grep "DAS Tool" | sed 's/DAS Tool version //' ) + END_VERSIONS + """ +} diff --git a/modules/dastool/dastool/meta.yml b/modules/dastool/dastool/meta.yml new file mode 100644 index 00000000..12d31e9f --- /dev/null +++ b/modules/dastool/dastool/meta.yml @@ -0,0 +1,100 @@ +name: dastool_dastool +description: DAS Tool binning step. +keywords: + - binning + - das tool + - table + - de novo + - bins + - contigs + - assembly + - das_tool +tools: + - dastool: + description: | + DAS Tool is an automated method that integrates the results + of a flexible number of binning algorithms to calculate an optimized, non-redundant + set of bins from a single assembly. + + homepage: https://github.com/cmks/DAS_Tool + documentation: https://github.com/cmks/DAS_Tool + tool_dev_url: https://github.com/cmks/DAS_Tool + doi: "10.1038/s41564-018-0171-1" + licence: ['BSD'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - contigs: + type: file + description: fasta file + pattern: "*.{fa.gz,fas.gz,fasta.gz}" + - bins: + type: file + description: "Scaffolds2bin tabular file generated with dastool/scaffolds2bin" + pattern: "*.scaffolds2bin.tsv" + - proteins: + type: file + description: Predicted proteins in prodigal fasta format (>scaffoldID_geneNo) + pattern: "*.{fa.gz,fas.gz,fasta.gz}" + - db_directory: + type: file + description: (optional) Directory of single copy gene database. + - search_engine: + type: val + description: Engine used for single copy gene identification. USEARCH is not supported due to it being proprietary [blast/diamond] + + +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" + - log: + type: file + description: Log file of the run + pattern: "*.log" + - summary: + type: file + description: Summary of output bins including quality and completeness estimates + pattern: "*summary.txt" + - scaffolds2bin: + type: file + description: Scaffolds to bin file of output bins + pattern: "*.scaffolds2bin.txt" + - eval: + type: file + description: Quality and completeness estimates of input bin sets + pattern: "*.eval" + - pdfs: + type: file + description: Plots showing the amount of high quality bins and score distribution of bins per method + pattern: "*.pdf" + - fasta_proteins: + type: file + description: Output from prodigal if not already supplied + pattern: "*.proteins.faa" + - fasta_archaea_scg: + type: file + description: Results of archaeal single-copy-gene prediction + pattern: "*.archaea.scg" + - fasta_bacteria_scg: + type: file + description: Results of bacterial single-copy-gene prediction + pattern: "*.bacteria.scg" + - seqlength: + type: file + description: Summary of contig lengths + pattern: "*.seqlength" + +authors: + - "@maxibor" + - "@jfy133" diff --git a/modules/dastool/scaffolds2bin/main.nf b/modules/dastool/scaffolds2bin/main.nf new file mode 100644 index 00000000..09f800bb --- /dev/null +++ b/modules/dastool/scaffolds2bin/main.nf @@ -0,0 +1,37 @@ +process DASTOOL_SCAFFOLDS2BIN { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::das_tool=1.1.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/das_tool:1.1.3--r41hdfd78af_0' : + 'quay.io/biocontainers/das_tool:1.1.3--r41hdfd78af_0' }" + + input: + tuple val(meta), path(fasta) + val(extension) + + output: + tuple val(meta), path("*.tsv"), emit: scaffolds2bin + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def file_extension = extension ? extension : "fasta" + + """ + gunzip -f *.${file_extension}.gz + + Fasta_to_Scaffolds2Bin.sh \\ + $args \\ + -i . \\ + -e $file_extension \\ + > ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + dastool: \$( DAS_Tool --version 2>&1 | grep "DAS Tool" | sed 's/DAS Tool version //' ) + END_VERSIONS + """ +} diff --git a/modules/dastool/scaffolds2bin/meta.yml b/modules/dastool/scaffolds2bin/meta.yml new file mode 100644 index 00000000..f41a3cf2 --- /dev/null +++ b/modules/dastool/scaffolds2bin/meta.yml @@ -0,0 +1,58 @@ +name: dastool_scaffolds2bin +description: Helper script to convert a set of bins in fasta format to tabular scaffolds2bin format +keywords: + - binning + - das tool + - table + - de novo + - bins + - contigs + - assembly + - das_tool +tools: + - dastool: + description: | + DAS Tool is an automated method that integrates the results + of a flexible number of binning algorithms to calculate an optimized, non-redundant + set of bins from a single assembly. + + homepage: https://github.com/cmks/DAS_Tool + documentation: https://github.com/cmks/DAS_Tool + tool_dev_url: https://github.com/cmks/DAS_Tool + doi: "10.1038/s41564-018-0171-1" + licence: ['BSD'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Fasta of list of fasta files recommended to be gathered via with .collect() of bins + pattern: "*.{fa,fas,fasta}" + - binner: + type: val + description: Name of the binning software (optional) + - extension: + type: val + description: Fasta file extension (fa | fas | fasta | ...) + +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" + - scaffolds2bin: + type: file + description: tabular scaffolds2bin file for DAS tool input + pattern: "*.scaffolds2bin.tsv" + +authors: + - "@maxibor" diff --git a/modules/dedup/main.nf b/modules/dedup/main.nf new file mode 100644 index 00000000..8b4bdc37 --- /dev/null +++ b/modules/dedup/main.nf @@ -0,0 +1,37 @@ +process DEDUP { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::dedup=0.12.8" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/dedup:0.12.8--hdfd78af_1' : + 'quay.io/biocontainers/dedup:0.12.8--hdfd78af_1' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*_rmdup.bam"), emit: bam // _rmdup is hardcoded output from dedup + tuple val(meta), path("*.json") , emit: json + tuple val(meta), path("*.hist") , emit: hist + tuple val(meta), path("*log") , emit: log + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + + """ + dedup \\ + -Xmx${task.memory.toGiga()}g \\ + -i $bam \\ + -o . \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + dedup: \$( echo \$(dedup --version 2>&1) | tail -n 1 | sed 's/.* v//') + + END_VERSIONS + """ +} diff --git a/modules/dedup/meta.yml b/modules/dedup/meta.yml new file mode 100644 index 00000000..0ddd648f --- /dev/null +++ b/modules/dedup/meta.yml @@ -0,0 +1,60 @@ +name: dedup +description: DeDup is a tool for read deduplication in paired-end read merging (e.g. for ancient DNA experiments). +keywords: + - dedup + - deduplication + - pcr duplicates + - ancient DNA + - paired-end + - bam +tools: + - dedup: + description: DeDup is a tool for read deduplication in paired-end read merging (e.g. for ancient DNA experiments). + homepage: https://github.com/apeltzer/DeDup + documentation: https://dedup.readthedocs.io/en/latest/ + tool_dev_url: https://github.com/apeltzer/DeDup + doi: "10.1186/s13059-016-0918-z" + 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/SAM file + pattern: "*.{bam,sam}" + +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: Deduplicated BAM file + pattern: "*_rmdup.bam" + - json: + type: file + description: JSON file for MultiQC + pattern: "*.json" + - hist: + type: file + description: Histogram data of amount of deduplication + pattern: "*.hist" + - log: + type: file + description: Dedup log information + pattern: "*log" + + + +authors: + - "@jfy133" diff --git a/modules/deeptools/computematrix/functions.nf b/modules/deeptools/computematrix/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/deeptools/computematrix/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 bee16d3c..70be934b 100644 --- a/modules/deeptools/computematrix/main.nf +++ b/modules/deeptools/computematrix/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process DEEPTOOLS_COMPUTEMATRIX { 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::deeptools=3.5.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/deeptools:3.5.0--py_0" - } else { - container "quay.io/biocontainers/deeptools:3.5.0--py_0" - } + conda (params.enable_conda ? 'bioconda::deeptools=3.5.1' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : + 'quay.io/biocontainers/deeptools:3.5.1--py_0' }" input: tuple val(meta), path(bigwig) @@ -25,20 +14,23 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ computeMatrix \\ - $options.args \\ + $args \\ --regionsFileName $bed \\ --scoreFileName $bigwig \\ --outFileName ${prefix}.computeMatrix.mat.gz \\ --outFileNameMatrix ${prefix}.computeMatrix.vals.mat.tab \\ --numberOfProcessors $task.cpus - computeMatrix --version | sed -e "s/computeMatrix //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deeptools: \$(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..584fade1 100644 --- a/modules/deeptools/computematrix/meta.yml +++ b/modules/deeptools/computematrix/meta.yml @@ -46,10 +46,10 @@ 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 - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@jeremy1805" diff --git a/modules/deeptools/plotfingerprint/functions.nf b/modules/deeptools/plotfingerprint/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/deeptools/plotfingerprint/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 42d5e6a2..7925c9a9 100644 --- a/modules/deeptools/plotfingerprint/main.nf +++ b/modules/deeptools/plotfingerprint/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process DEEPTOOLS_PLOTFINGERPRINT { 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::deeptools=3.5.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/deeptools:3.5.0--py_0" - } else { - container "quay.io/biocontainers/deeptools:3.5.0--py_0" - } + conda (params.enable_conda ? 'bioconda::deeptools=3.5.1' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : + 'quay.io/biocontainers/deeptools:3.5.1--py_0' }" input: tuple val(meta), path(bams), path(bais) @@ -25,15 +14,15 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def extend = (meta.single_end && params.fragment_size > 0) ? "--extendReads ${params.fragment_size}" : '' """ plotFingerprint \\ - $options.args \\ + $args \\ $extend \\ --bamfiles ${bams.join(' ')} \\ --plotFile ${prefix}.plotFingerprint.pdf \\ @@ -41,6 +30,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 + "${task.process}": + deeptools: \$(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..3acd1471 100644 --- a/modules/deeptools/plotfingerprint/meta.yml +++ b/modules/deeptools/plotfingerprint/meta.yml @@ -50,10 +50,10 @@ output: description: | file containing BAM file quality metrics pattern: "*.{qcmetrics.txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@emiller88" diff --git a/modules/deeptools/plotheatmap/functions.nf b/modules/deeptools/plotheatmap/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/deeptools/plotheatmap/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 552dc117..992c9058 100644 --- a/modules/deeptools/plotheatmap/main.nf +++ b/modules/deeptools/plotheatmap/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process DEEPTOOLS_PLOTHEATMAP { 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::deeptools=3.5.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/deeptools:3.5.0--py_0" - } else { - container "quay.io/biocontainers/deeptools:3.5.0--py_0" - } + conda (params.enable_conda ? 'bioconda::deeptools=3.5.1' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : + 'quay.io/biocontainers/deeptools:3.5.1--py_0' }" input: tuple val(meta), path(matrix) @@ -24,18 +13,21 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ plotHeatmap \\ - $options.args \\ + $args \\ --matrixFile $matrix \\ --outFileName ${prefix}.plotHeatmap.pdf \\ --outFileNameMatrix ${prefix}.plotHeatmap.mat.tab - plotHeatmap --version | sed -e "s/plotHeatmap //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deeptools: \$(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..34f2865b 100644 --- a/modules/deeptools/plotheatmap/meta.yml +++ b/modules/deeptools/plotheatmap/meta.yml @@ -44,10 +44,10 @@ 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 - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@emiller88" diff --git a/modules/deeptools/plotprofile/functions.nf b/modules/deeptools/plotprofile/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/deeptools/plotprofile/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 59bfacd3..60184fa6 100644 --- a/modules/deeptools/plotprofile/main.nf +++ b/modules/deeptools/plotprofile/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process DEEPTOOLS_PLOTPROFILE { 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::deeptools=3.5.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/deeptools:3.5.0--py_0" - } else { - container "quay.io/biocontainers/deeptools:3.5.0--py_0" - } + conda (params.enable_conda ? 'bioconda::deeptools=3.5.1' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : + 'quay.io/biocontainers/deeptools:3.5.1--py_0' }" input: tuple val(meta), path(matrix) @@ -24,18 +13,21 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ plotProfile \\ - $options.args \\ + $args \\ --matrixFile $matrix \\ --outFileName ${prefix}.plotProfile.pdf \\ --outFileNameData ${prefix}.plotProfile.tab - plotProfile --version | sed -e "s/plotProfile //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deeptools: \$(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..5b61aed4 100644 --- a/modules/deeptools/plotprofile/meta.yml +++ b/modules/deeptools/plotprofile/meta.yml @@ -44,10 +44,10 @@ 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 - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@emiller88" diff --git a/modules/delly/call/functions.nf b/modules/delly/call/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/delly/call/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..fc04cda7 100644 --- a/modules/delly/call/main.nf +++ b/modules/delly/call/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process DELLY_CALL { 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::delly=0.8.7" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/delly:0.8.7--he03298f_1" - } else { - container "quay.io/biocontainers/delly:0.8.7--he03298f_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/delly:0.8.7--he03298f_1' : + 'quay.io/biocontainers/delly:0.8.7--he03298f_1' }" input: tuple val(meta), path(bam), path(bai) @@ -26,19 +15,22 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ delly \\ call \\ - $options.args \\ + $args \\ -o ${prefix}.bcf \\ -g $fasta \\ $bam \\ - echo \$(delly --version 2>&1) | sed 's/^.*Delly //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + delly: \$( echo \$(delly --version 2>&1) | sed 's/^.*Delly version: v//; s/ using.*\$//') + END_VERSIONS """ } diff --git a/modules/delly/call/meta.yml b/modules/delly/call/meta.yml index 9fb79959..56539188 100644 --- a/modules/delly/call/meta.yml +++ b/modules/delly/call/meta.yml @@ -13,7 +13,7 @@ tools: documentation: https://github.com/dellytools/delly/blob/master/README.md tool_dev_url: None doi: "DOI:10.1093/bioinformatics/bts378" - licence: ["BSD-3-clause"] + licence: ['BSD-3-Clause'] input: - meta: @@ -38,10 +38,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bcf: type: file description: BCF format diff --git a/modules/diamond/blastp/main.nf b/modules/diamond/blastp/main.nf new file mode 100644 index 00000000..c7342767 --- /dev/null +++ b/modules/diamond/blastp/main.nf @@ -0,0 +1,39 @@ +process DIAMOND_BLASTP { + tag "$meta.id" + label 'process_medium' + + // Dimaond is limited to v2.0.9 because there is not a + // singularity version higher than this at the current time. + conda (params.enable_conda ? "bioconda::diamond=2.0.9" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/diamond:2.0.9--hdcc8f71_0' : + 'quay.io/biocontainers/diamond:2.0.9--hdcc8f71_0' }" + + input: + tuple val(meta), path(fasta) + path db + + output: + tuple val(meta), path('*.txt'), emit: txt + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + DB=`find -L ./ -name "*.dmnd" | sed 's/.dmnd//'` + + diamond \\ + blastp \\ + --threads $task.cpus \\ + --db \$DB \\ + --query $fasta \\ + $args \\ + --out ${prefix}.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + diamond: \$(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 new file mode 100644 index 00000000..228c1a22 --- /dev/null +++ b/modules/diamond/blastp/meta.yml @@ -0,0 +1,43 @@ +name: diamond_blastp +description: Queries a DIAMOND database using blastp mode +keywords: + - fasta + - diamond + - blastp + - DNA sequence +tools: + - diamond: + description: Accelerated BLAST compatible local sequence aligner + homepage: https://github.com/bbuchfink/diamond + documentation: https://github.com/bbuchfink/diamond/wiki + tool_dev_url: https://github.com/bbuchfink/diamond + doi: "doi:10.1038/s41592-021-01101-x" + licence: ['GPL v3.0'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Input fasta file containing query sequences + pattern: "*.{fa,fasta}" + - db: + type: directory + description: Directory containing the protein blast database + pattern: "*" + +output: + - txt: + type: file + description: File containing blastp hits + pattern: "*.{blastp.txt}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@spficklin" diff --git a/modules/diamond/blastx/main.nf b/modules/diamond/blastx/main.nf new file mode 100644 index 00000000..bd7d1dd9 --- /dev/null +++ b/modules/diamond/blastx/main.nf @@ -0,0 +1,39 @@ +process DIAMOND_BLASTX { + tag "$meta.id" + label 'process_medium' + + // Dimaond is limited to v2.0.9 because there is not a + // singularity version higher than this at the current time. + conda (params.enable_conda ? "bioconda::diamond=2.0.9" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/diamond:2.0.9--hdcc8f71_0' : + 'quay.io/biocontainers/diamond:2.0.9--hdcc8f71_0' }" + + input: + tuple val(meta), path(fasta) + path db + + output: + tuple val(meta), path('*.txt'), emit: txt + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + DB=`find -L ./ -name "*.dmnd" | sed 's/.dmnd//'` + + diamond \\ + blastx \\ + --threads $task.cpus \\ + --db \$DB \\ + --query $fasta \\ + $args \\ + --out ${prefix}.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + diamond: \$(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 new file mode 100644 index 00000000..4a3ab9b6 --- /dev/null +++ b/modules/diamond/blastx/meta.yml @@ -0,0 +1,43 @@ +name: diamond_blastx +description: Queries a DIAMOND database using blastx mode +keywords: + - fasta + - diamond + - blastx + - DNA sequence +tools: + - diamond: + description: Accelerated BLAST compatible local sequence aligner + homepage: https://github.com/bbuchfink/diamond + documentation: https://github.com/bbuchfink/diamond/wiki + tool_dev_url: https://github.com/bbuchfink/diamond + doi: "doi:10.1038/s41592-021-01101-x" + licence: ['GPL v3.0'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Input fasta file containing query sequences + pattern: "*.{fa,fasta}" + - db: + type: directory + description: Directory containing the nucelotide blast database + pattern: "*" + +output: + - txt: + type: file + description: File containing blastx hits + pattern: "*.{blastx.txt}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@spficklin" diff --git a/modules/diamond/makedb/main.nf b/modules/diamond/makedb/main.nf new file mode 100644 index 00000000..cccfcce9 --- /dev/null +++ b/modules/diamond/makedb/main.nf @@ -0,0 +1,34 @@ +process DIAMOND_MAKEDB { + tag "$fasta" + label 'process_medium' + + // Dimaond is limited to v2.0.9 because there is not a + // singularity version higher than this at the current time. + conda (params.enable_conda ? 'bioconda::diamond=2.0.9' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/diamond:2.0.9--hdcc8f71_0' : + 'quay.io/biocontainers/diamond:2.0.9--hdcc8f71_0' }" + + input: + path fasta + + output: + path "${fasta}.dmnd", emit: db + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + """ + diamond \\ + makedb \\ + --threads $task.cpus \\ + --in $fasta \\ + -d $fasta \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + diamond: \$(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 new file mode 100644 index 00000000..e378be7e --- /dev/null +++ b/modules/diamond/makedb/meta.yml @@ -0,0 +1,34 @@ +name: diamond_makedb +description: Builds a DIAMOND database +keywords: + - fasta + - diamond + - index + - database +tools: + - diamond: + description: Accelerated BLAST compatible local sequence aligner + homepage: https://github.com/bbuchfink/diamond + documentation: https://github.com/bbuchfink/diamond/wiki + tool_dev_url: https://github.com/bbuchfink/diamond + doi: "doi:10.1038/s41592-021-01101-x" + licence: ['GPL v3.0'] + +input: + - fasta: + type: file + description: Input fasta file + pattern: "*.{fa,fasta}" + +output: + - db: + type: file + description: File of the indexed DIAMOND database + pattern: "*.{dmnd}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@spficklin" diff --git a/modules/dragmap/align/main.nf b/modules/dragmap/align/main.nf new file mode 100644 index 00000000..8a6f082a --- /dev/null +++ b/modules/dragmap/align/main.nf @@ -0,0 +1,61 @@ +process DRAGMAP_ALIGN { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::dragmap=1.2.1 bioconda::samtools=1.14 conda-forge::pigz=2.3.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:f7aad9060cde739c95685fc5ff6d6f7e3ec629c8-0': + 'quay.io/biocontainers/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:f7aad9060cde739c95685fc5ff6d6f7e3ec629c8-0' }" + + input: + tuple val(meta), path(reads) + path hashmap + val sort_bam + + output: + tuple val(meta), path("*.bam"), emit: bam + tuple val(meta), path('*.log'), emit: log + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def samtools_command = sort_bam ? 'sort' : 'view' + if (meta.single_end) { + """ + dragen-os \\ + -r $hashmap \\ + -1 $reads \\ + --num-threads $task.cpus \\ + $args \\ + 2> ${prefix}.dragmap.log \\ + | samtools $samtools_command -@ $task.cpus $args2 -o ${prefix}.bam - + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + dragmap: \$(echo \$(dragen-os --version 2>&1)) + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) + END_VERSIONS + """ + } else { + """ + dragen-os \\ + -r $hashmap \\ + -1 ${reads[0]} \\ + -2 ${reads[1]} \\ + --num-threads $task.cpus \\ + $args \\ + 2> ${prefix}.dragmap.log \\ + | samtools $samtools_command -@ $task.cpus $args2 -o ${prefix}.bam - + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + dragmap: \$(echo \$(dragen-os --version 2>&1)) + 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/dragmap/align/meta.yml b/modules/dragmap/align/meta.yml new file mode 100644 index 00000000..e943ccf8 --- /dev/null +++ b/modules/dragmap/align/meta.yml @@ -0,0 +1,42 @@ +name: dragmap_align +description: Performs fastq alignment to a reference using DRAGMAP +keywords: + - alignment + - map + - fastq + - bam + - sam +tools: + - dragmap: + description: Dragmap is the Dragen mapper/aligner Open Source Software. + homepage: https://github.com/Illumina/dragmap + documentation: https://github.com/Illumina/dragmap + tool_dev_url: https://github.com/Illumina/dragmap#basic-command-line-usage + doi: "" + licence: ['GPL v3'] +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. + - hashmap: + type: file + description: DRAGMAP hash table + pattern: "Directory containing DRAGMAP hash table *.{cmp,.bin,.txt}" +output: + - bam: + type: file + description: Output BAM file containing read alignments + pattern: "*.{bam}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@Emiller88" diff --git a/modules/dragmap/hashtable/main.nf b/modules/dragmap/hashtable/main.nf new file mode 100644 index 00000000..ab55364b --- /dev/null +++ b/modules/dragmap/hashtable/main.nf @@ -0,0 +1,33 @@ +process DRAGMAP_HASHTABLE { + tag "$fasta" + label 'process_high' + + conda (params.enable_conda ? "bioconda::dragmap=1.2.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/dragmap:1.2.1--hd4ca14e_0': + 'quay.io/biocontainers/dragmap:1.2.1--hd4ca14e_0' }" + + input: + path fasta + + output: + path "dragmap" , emit: hashmap + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + """ + mkdir dragmap + dragen-os \\ + --build-hash-table true \\ + --ht-reference $fasta \\ + --output-directory dragmap \\ + $args \\ + --ht-num-threads $task.cpus + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + dragmap: \$(echo \$(dragen-os --version 2>&1)) + END_VERSIONS + """ +} diff --git a/modules/dragmap/hashtable/meta.yml b/modules/dragmap/hashtable/meta.yml new file mode 100644 index 00000000..86e58789 --- /dev/null +++ b/modules/dragmap/hashtable/meta.yml @@ -0,0 +1,30 @@ +name: dragmap_hashtable +description: Create DRAGEN hashtable for reference genome +keywords: + - index + - fasta + - genome + - reference +tools: + - dragmap: + description: Dragmap is the Dragen mapper/aligner Open Source Software. + homepage: https://github.com/Illumina/dragmap + documentation: https://github.com/Illumina/dragmap + tool_dev_url: https://github.com/Illumina/dragmap#basic-command-line-usage + doi: "" + licence: ['GPL v3'] +input: + - fasta: + type: file + description: Input genome fasta file +output: + - hashmap: + type: file + description: DRAGMAP hash table + pattern: "*.{cmp,.bin,.txt}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@Emiller88" diff --git a/modules/dragonflye/main.nf b/modules/dragonflye/main.nf new file mode 100644 index 00000000..8ca98832 --- /dev/null +++ b/modules/dragonflye/main.nf @@ -0,0 +1,37 @@ +process DRAGONFLYE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::dragonflye=1.0.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/dragonflye:1.0.4--hdfd78af_0' : + 'quay.io/biocontainers/dragonflye:1.0.4--hdfd78af_0' }" + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("contigs.fa") , emit: contigs + tuple val(meta), path("dragonflye.log") , emit: log + 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: versions + + script: + def args = task.ext.args ?: '' + def memory = task.memory.toGiga() + """ + dragonflye \\ + --reads ${reads} \\ + $args \\ + --cpus $task.cpus \\ + --ram $memory \\ + --outdir ./ \\ + --force + cat <<-END_VERSIONS > versions.yml + "${task.process}": + dragonflye: \$(dragonflye --version 2>&1 | sed 's/^.*dragonflye //' ) + END_VERSIONS + """ +} diff --git a/modules/dragonflye/meta.yml b/modules/dragonflye/meta.yml new file mode 100644 index 00000000..773795db --- /dev/null +++ b/modules/dragonflye/meta.yml @@ -0,0 +1,57 @@ +name: dragonflye +description: Assemble bacterial isolate genomes from Nanopore reads +keywords: + - bacterial + - assembly + - nanopore + +tools: + - dragonflye: + description: Microbial assembly pipeline for Nanopore reads + homepage: https://github.com/rpetit3/dragonflye + documentation: https://github.com/rpetit3/dragonflye/blob/main/README.md + licence: ['GPL v2'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: Input Nanopore FASTQ file + pattern: "*.fastq.gz" +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: The final assembly produced by Dragonflye + pattern: "contigs.fa" + - log: + type: file + description: Full log file for bug reporting + pattern: "dragonflye.log" + - raw_contigs: + type: file + description: Raw assembly produced by the assembler (Flye, Miniasm, or Raven) + pattern: "{flye,miniasm,raven}.fasta" + - txt: + type: file + description: Assembly information output by Flye + pattern: "flye-info.txt" + - gfa: + type: file + description: Assembly graph produced by Miniasm, or Raven + pattern: "{miniasm,raven}-unpolished.gfa" + +authors: + - "@rpetit3" diff --git a/modules/dshbio/exportsegments/main.nf b/modules/dshbio/exportsegments/main.nf new file mode 100644 index 00000000..d506a4b6 --- /dev/null +++ b/modules/dshbio/exportsegments/main.nf @@ -0,0 +1,32 @@ +process DSHBIO_EXPORTSEGMENTS { + tag "${meta.id}" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::dsh-bio=2.0.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/dsh-bio:2.0.6--hdfd78af_0' : + 'quay.io/biocontainers/dsh-bio:2.0.6--hdfd78af_0' }" + + input: + tuple val(meta), path(gfa) + + output: + tuple val(meta), path("*.fa"), emit: fasta + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + dsh-bio \\ + export-segments \\ + $args \\ + -i $gfa \\ + -o ${prefix}.fa + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + dshbio: \$(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 new file mode 100644 index 00000000..da5455c7 --- /dev/null +++ b/modules/dshbio/exportsegments/meta.yml @@ -0,0 +1,41 @@ +name: dshbio_exportsegments +description: Export assembly segment sequences in GFA 1.0 format to FASTA format +keywords: + - gfa + - assembly + - segment +tools: + - dshbio: + description: | + Reads, features, variants, assemblies, alignments, genomic range trees, pangenome + graphs, and a bunch of random command line tools for bioinformatics. LGPL version 3 + or later. + homepage: https://github.com/heuermh/dishevelled-bio + documentation: https://github.com/heuermh/dishevelled-bio + licence: ['LGPL-3.0-or-later'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - gfa: + type: file + description: Assembly segments in GFA 1.0 format + pattern: "*.{gfa}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Assembly segment sequences in FASTA format + pattern: "*.{fa}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@heuermh" diff --git a/modules/dshbio/filterbed/functions.nf b/modules/dshbio/filterbed/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/dshbio/filterbed/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 92aadc41..6480f4a4 100644 --- a/modules/dshbio/filterbed/main.nf +++ b/modules/dshbio/filterbed/main.nf @@ -1,40 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process DSHBIO_FILTERBED { 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::dsh-bio=2.0.4" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/dsh-bio:2.0.4--hdfd78af_0" - } else { - container "quay.io/biocontainers/dsh-bio:2.0.4--hdfd78af_0" - } + conda (params.enable_conda ? "bioconda::dsh-bio=2.0.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/dsh-bio:2.0.6--hdfd78af_0' : + 'quay.io/biocontainers/dsh-bio:2.0.6--hdfd78af_0' }" input: tuple val(meta), path(bed) output: tuple val(meta), path("*.bed.gz"), emit: bed - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ dsh-bio \\ filter-bed \\ - $options.args \\ + $args \\ -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 + "${task.process}": + dshbio: \$(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..77054be4 100644 --- a/modules/dshbio/filterbed/meta.yml +++ b/modules/dshbio/filterbed/meta.yml @@ -10,6 +10,7 @@ tools: or later. homepage: https://github.com/heuermh/dishevelled-bio documentation: https://github.com/heuermh/dishevelled-bio + licence: ['LGPL-3.0-or-later'] input: - meta: type: map @@ -30,9 +31,9 @@ output: type: file description: Features in gzipped BED format pattern: "*.{bed.gz}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/dshbio/filtergff3/functions.nf b/modules/dshbio/filtergff3/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/dshbio/filtergff3/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 bb3a4abd..a0bbf3af 100644 --- a/modules/dshbio/filtergff3/main.nf +++ b/modules/dshbio/filtergff3/main.nf @@ -1,40 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process DSHBIO_FILTERGFF3 { 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::dsh-bio=2.0.4" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/dsh-bio:2.0.4--hdfd78af_0" - } else { - container "quay.io/biocontainers/dsh-bio:2.0.4--hdfd78af_0" - } + conda (params.enable_conda ? "bioconda::dsh-bio=2.0.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/dsh-bio:2.0.6--hdfd78af_0' : + 'quay.io/biocontainers/dsh-bio:2.0.6--hdfd78af_0' }" input: tuple val(meta), path(gff3) output: tuple val(meta), path("*.gff3.gz"), emit: gff3 - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ dsh-bio \\ filter-gff3 \\ - $options.args \\ + $args \\ -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 + "${task.process}": + dshbio: \$(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..aa1bce43 100644 --- a/modules/dshbio/filtergff3/meta.yml +++ b/modules/dshbio/filtergff3/meta.yml @@ -10,6 +10,7 @@ tools: or later. homepage: https://github.com/heuermh/dishevelled-bio documentation: https://github.com/heuermh/dishevelled-bio + licence: ['LGPL-3.0-or-later'] input: - meta: type: map @@ -30,9 +31,9 @@ output: type: file description: Features in gzipped GFF3 format pattern: "*.{gff3.gz}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/dshbio/splitbed/functions.nf b/modules/dshbio/splitbed/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/dshbio/splitbed/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 233b5319..8dbf1104 100644 --- a/modules/dshbio/splitbed/main.nf +++ b/modules/dshbio/splitbed/main.nf @@ -1,41 +1,33 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process DSHBIO_SPLITBED { 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::dsh-bio=2.0.4" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/dsh-bio:2.0.4--hdfd78af_0" - } else { - container "quay.io/biocontainers/dsh-bio:2.0.4--hdfd78af_0" - } + conda (params.enable_conda ? "bioconda::dsh-bio=2.0.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/dsh-bio:2.0.6--hdfd78af_0' : + 'quay.io/biocontainers/dsh-bio:2.0.6--hdfd78af_0' }" input: tuple val(meta), path(bed) output: tuple val(meta), path("*.bed.gz"), emit: bed - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ dsh-bio \\ split-bed \\ - $options.args \\ + $args \\ -p $prefix \\ -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 + "${task.process}": + dshbio: \$(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..a35ea25f 100644 --- a/modules/dshbio/splitbed/meta.yml +++ b/modules/dshbio/splitbed/meta.yml @@ -10,6 +10,7 @@ tools: or later. homepage: https://github.com/heuermh/dishevelled-bio documentation: https://github.com/heuermh/dishevelled-bio + licence: ['LGPL-3.0-or-later'] input: - meta: type: map @@ -30,9 +31,9 @@ output: type: file description: Features in split gzipped BED formatted files pattern: "*.{bed.gz}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/dshbio/splitgff3/functions.nf b/modules/dshbio/splitgff3/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/dshbio/splitgff3/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 62f72241..fc868a39 100644 --- a/modules/dshbio/splitgff3/main.nf +++ b/modules/dshbio/splitgff3/main.nf @@ -1,41 +1,33 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process DSHBIO_SPLITGFF3 { 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::dsh-bio=2.0.4" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/dsh-bio:2.0.4--hdfd78af_0" - } else { - container "quay.io/biocontainers/dsh-bio:2.0.4--hdfd78af_0" - } + conda (params.enable_conda ? "bioconda::dsh-bio=2.0.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/dsh-bio:2.0.6--hdfd78af_0' : + 'quay.io/biocontainers/dsh-bio:2.0.6--hdfd78af_0' }" input: tuple val(meta), path(gff3) output: tuple val(meta), path("*.gff3.gz"), emit: gff3 - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ dsh-bio \\ split-gff3 \\ - $options.args \\ + $args \\ -p $prefix \\ -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 + "${task.process}": + dshbio: \$(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..fdbbe16a 100644 --- a/modules/dshbio/splitgff3/meta.yml +++ b/modules/dshbio/splitgff3/meta.yml @@ -10,6 +10,7 @@ tools: or later. homepage: https://github.com/heuermh/dishevelled-bio documentation: https://github.com/heuermh/dishevelled-bio + licence: ['LGPL-3.0-or-later'] input: - meta: type: map @@ -30,9 +31,9 @@ output: type: file description: Features in split gzipped GFF3 formatted files pattern: "*.{gff3.gz}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/ectyper/main.nf b/modules/ectyper/main.nf new file mode 100644 index 00000000..0e040958 --- /dev/null +++ b/modules/ectyper/main.nf @@ -0,0 +1,42 @@ +process ECTYPER { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::ectyper=1.0.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ectyper:1.0.0--pyhdfd78af_1' : + 'quay.io/biocontainers/ectyper:1.0.0--pyhdfd78af_1' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*.log"), emit: log + tuple val(meta), path("*.tsv"), emit: tsv + tuple val(meta), path("*.txt"), emit: txt + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + 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 + + ectyper \\ + $args \\ + --cores $task.cpus \\ + --output ./ \\ + --input $fasta_name + + mv output.tsv ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ectyper: \$(echo \$(ectyper --version 2>&1) | sed 's/.*ectyper //; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/ectyper/meta.yml b/modules/ectyper/meta.yml new file mode 100644 index 00000000..a6beca29 --- /dev/null +++ b/modules/ectyper/meta.yml @@ -0,0 +1,51 @@ +name: ectyper +description: In silico prediction of E. coli serotype +keywords: + - escherichia coli + - fasta + - serotype +tools: + - ectyper: + description: ECtyper is a python program for serotyping E. coli genomes + homepage: https://github.com/phac-nml/ecoli_serotyping + documentation: https://github.com/phac-nml/ecoli_serotyping + tool_dev_url: https://github.com/phac-nml/ecoli_serotyping + doi: "" + licence: ['Apache 2'] + +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}" + +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" + - log: + type: file + description: ectyper log output + pattern: "*.log" + - tsv: + type: file + description: ectyper serotyping results in TSV format + pattern: "*.tsv" + - txt: + type: file + description: Allele report generated from BLAST results + pattern: "*.tst" + +authors: + - "@rpetit3" diff --git a/modules/emmtyper/main.nf b/modules/emmtyper/main.nf new file mode 100644 index 00000000..70dabfb7 --- /dev/null +++ b/modules/emmtyper/main.nf @@ -0,0 +1,31 @@ +process EMMTYPER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::emmtyper=0.2.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/emmtyper:0.2.0--py_0' : + 'quay.io/biocontainers/emmtyper:0.2.0--py_0' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*.tsv"), emit: tsv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + emmtyper \\ + $args \\ + $fasta \\ + > ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + emmtyper: \$( echo \$(emmtyper --version 2>&1) | sed 's/^.*emmtyper v//' ) + END_VERSIONS + """ +} diff --git a/modules/emmtyper/meta.yml b/modules/emmtyper/meta.yml new file mode 100644 index 00000000..019a8e4c --- /dev/null +++ b/modules/emmtyper/meta.yml @@ -0,0 +1,43 @@ +name: emmtyper +description: EMM typing of Streptococcus pyogenes assemblies +keywords: + - fasta + - Streptococcus pyogenes + - typing +tools: + - emmtyper: + description: Streptococcus pyogenes in silico EMM typer + homepage: https://github.com/MDU-PHL/emmtyper + documentation: https://github.com/MDU-PHL/emmtyper + tool_dev_url: https://github.com/MDU-PHL/emmtyper + doi: "" + licence: ['GNU General Public v3 (GPL 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}" + +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 result file + pattern: "*.tsv" + +authors: + - "@rpetit3" diff --git a/modules/ensemblvep/functions.nf b/modules/ensemblvep/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/ensemblvep/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..e3d0c286 100644 --- a/modules/ensemblvep/main.nf +++ b/modules/ensemblvep/main.nf @@ -1,27 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) -params.use_cache = false -params.vep_tag = "" - process ENSEMBLVEP { + 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::ensembl-vep=104.3" : null) - if (params.use_cache) { - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/ensembl-vep:104.3--pl5262h4a94de4_0" - } else { - container "quay.io/biocontainers/ensembl-vep:104.3--pl5262h4a94de4_0" - } - } else { - container "nfcore/vep:${params.vep_tag}" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ensembl-vep:104.3--pl5262h4a94de4_0' : + 'quay.io/biocontainers/ensembl-vep:104.3--pl5262h4a94de4_0' }" input: tuple val(meta), path(vcf) @@ -33,30 +17,33 @@ 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: 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" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def dir_cache = cache ? "\${PWD}/${cache}" : "/.vep" """ mkdir $prefix vep \\ -i $vcf \\ -o ${prefix}.ann.vcf \\ - $options.args \\ + $args \\ --assembly $genome \\ --species $species \\ --cache \\ --cache_version $cache_version \\ --dir_cache $dir_cache \\ --fork $task.cpus \\ - --format vcf \\ + --vcf \\ --stats_file ${prefix}.summary.html rm -rf $prefix - echo \$(vep --help 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ensemblvep: \$( echo \$(vep --help 2>&1) | sed 's/^.*Versions:.*ensembl-vep : //;s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/ensemblvep/meta.yml b/modules/ensemblvep/meta.yml index 5eb111e9..1b819227 100644 --- a/modules/ensemblvep/meta.yml +++ b/modules/ensemblvep/meta.yml @@ -9,6 +9,7 @@ tools: or structural variants) on genes, transcripts, and protein sequence, as well as regulatory regions. homepage: https://www.ensembl.org/info/docs/tools/vep/index.html documentation: https://www.ensembl.org/info/docs/tools/vep/script/index.html + licence: ['Apache-2.0'] params: - use_cache: type: boolean @@ -56,9 +57,9 @@ output: type: file description: VEP report file pattern: "*.html" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/expansionhunter/main.nf b/modules/expansionhunter/main.nf new file mode 100644 index 00000000..4db78230 --- /dev/null +++ b/modules/expansionhunter/main.nf @@ -0,0 +1,37 @@ +process EXPANSIONHUNTER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::expansionhunter=4.0.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/expansionhunter:4.0.2--he785bd8_0' : + 'quay.io/biocontainers/expansionhunter:4.0.2--he785bd8_0' }" + + input: + tuple val(meta), path(bam), path(bai) + path fasta + path variant_catalog + + output: + tuple val(meta), path("*.vcf"), emit: vcf + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def gender = (meta.gender == 'male' || meta.gender == 1 || meta.gender == 'XY') ? "male" : "female" + """ + ExpansionHunter \\ + $args \\ + --reads $bam \\ + --output-prefix $prefix \\ + --reference $fasta \\ + --variant-catalog $variant_catalog \\ + --sex $gender + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + expansionhunter: \$( echo \$(ExpansionHunter --version 2>&1) | sed 's/^.*ExpansionHunter v//') + END_VERSIONS + """ +} diff --git a/modules/expansionhunter/meta.yml b/modules/expansionhunter/meta.yml new file mode 100644 index 00000000..17d72bb4 --- /dev/null +++ b/modules/expansionhunter/meta.yml @@ -0,0 +1,50 @@ +name: expansionhunter +description: write your description here +keywords: + - STR + - repeat_expansions +tools: + - expansionhunter: + description: A tool for estimating repeat sizes + homepage: https://github.com/Illumina/ExpansionHunter + documentation: https://github.com/Illumina/ExpansionHunter/blob/master/docs/01_Introduction.md + tool_dev_url: None + doi: "10.1093/bioinformatics/btz431" + licence: ['Apache-2.0'] + +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 + pattern: "*.{fa,fasta}" + - variant_catalog: + type: file + description: json file with repeat expansion sites to genotype + pattern: "*.{json}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', gender:'female' ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - vcf: + type: file + description: VCF with repeat expansions + pattern: "*.{vcf}" + +authors: + - "@jemten" diff --git a/modules/fargene/main.nf b/modules/fargene/main.nf new file mode 100644 index 00000000..73bdd411 --- /dev/null +++ b/modules/fargene/main.nf @@ -0,0 +1,50 @@ +def VERSION = '0.1' // Version information not provided by tool on CLI + +process FARGENE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::fargene=0.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fargene:0.1--py27h21c881e_4' : + 'quay.io/biocontainers/fargene:0.1--py27h21c881e_4' }" + + input: + // input may be fasta (for genomes or longer contigs) or paired-end fastq (for metagenome), the latter in addition with --meta flag + tuple val(meta), path(input) + val hmm_model + + output: + path "*.log" , emit: log + path "${prefix}/results_summary.txt" , emit: txt + tuple val(meta), path("${prefix}/hmmsearchresults/*.out") , optional: true, emit: hmm + tuple val(meta), path("${prefix}/predictedGenes/predicted-orfs.fasta") , optional: true, emit: orfs + tuple val(meta), path("${prefix}/predictedGenes/predicted-orfs-amino.fasta") , optional: true, emit: orfs_amino + tuple val(meta), path("${prefix}/predictedGenes/retrieved-contigs.fasta") , optional: true, emit: contigs + tuple val(meta), path("${prefix}/predictedGenes/retrieved-contigs-peptides.fasta") , optional: true, emit: contigs_pept + tuple val(meta), path("${prefix}/predictedGenes/*filtered.fasta") , optional: true, emit: filtered + tuple val(meta), path("${prefix}/predictedGenes/*filtered-peptides.fasta") , optional: true, emit: filtered_pept + tuple val(meta), path("${prefix}/retrievedFragments/all_retrieved_*.fastq") , optional: true, emit: fragments + tuple val(meta), path("${prefix}/retrievedFragments/retrievedFragments/trimmedReads/*.fasta"), optional: true, emit: trimmed + tuple val(meta), path("${prefix}/spades_assembly/*") , optional: true, emit: spades + tuple val(meta), path("${prefix}/tmpdir/*.fasta") , optional: true, emit: metagenome + tuple val(meta), path("${prefix}/tmpdir/*.out") , optional: true, emit: tmp + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + fargene \\ + $args \\ + -p $task.cpus \\ + -i $input \\ + --hmm-model $hmm_model \\ + -o $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fargene: $VERSION + END_VERSIONS + """ +} diff --git a/modules/fargene/meta.yml b/modules/fargene/meta.yml new file mode 100644 index 00000000..35e98008 --- /dev/null +++ b/modules/fargene/meta.yml @@ -0,0 +1,101 @@ +name: fargene +description: tool that takes either fragmented metagenomic data or longer sequences as input and predicts and delivers full-length antiobiotic resistance genes as output. +keywords: + - antibiotic resistance genes + - ARGs + - identifier + - metagenomic + - contigs +tools: + - fargene: + description: Fragmented Antibiotic Resistance Gene Identifier takes either fragmented metagenomic data or longer sequences as input and predicts and delivers full-length antiobiotic resistance genes as output + homepage: https://github.com/fannyhb/fargene + documentation: https://github.com/fannyhb/fargene + tool_dev_url: https://github.com/fannyhb/fargene + doi: "" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: uncompressed fasta file or paired-end fastq files containing either genomes or longer contigs as nucleotide or protein sequences (fasta) or fragmented metagenomic reads (fastq) + pattern: "*.{fasta}" + - hmm_model: + type: string + description: name of custom hidden markov model to be used [pre-defined class_a, class_b_1_2, class_b_3, class_c, class_d_1, class_d_2, qnr, tet_efflux, tet_rpg, tet_enzyme] + +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" + - log: + type: file + description: log file + pattern: "*.{log}" + - txt: + type: file + description: analysis summary text file + pattern: "*.{txt}" + - hmm: + type: file + description: output from hmmsearch + pattern: "*.{out}" + - orfs: + type: file + description: open reading frames (ORFs) + pattern: "*.{fasta}" + - orfs_amino: + type: file + description: protein translation of open reading frames (ORFs) + pattern: "*.{fasta}" + - contigs: + type: file + description: (complete) contigs that passed the final full-length classification + pattern: "*.{fasta}" + - contigs_pept: + type: file + description: parts of the contigs that passed the final classification step that aligned with the HMM, as amino acid sequences + pattern: "*.{fasta}" + - filtered: + type: file + description: sequences that passed the final classification step, but only the parts that where predicted by the HMM to be part of the gene + pattern: "*.{fasta}" + - filtered_pept: + type: file + description: sequences from filtered.fasta, translated in the same frame as the gene is predicted to be located + pattern: "*.{fasta}" + - fragments: + type: file + description: All quality controlled retrieved fragments that were classified as positive, together with its read-pair, gathered in two files + pattern: "*.{fastq}" + - trimmed: + type: file + description: The quality controlled retrieved fragments from each input file. + pattern: "*.{fasta}" + - spades: + type: directory + description: The output from the SPAdes assembly + pattern: "spades_assembly" + - metagenome: + type: file + description: The FASTQ to FASTA converted input files from metagenomic reads. + pattern: "*.{fasta}" + - tmp: + type: file + description: The from FASTQ to FASTA converted input files and their translated input sequences. Are only saved if option --store-peptides is used. + pattern: "*.{fasta}" + + +authors: + - "@louperelo" diff --git a/modules/fastani/main.nf b/modules/fastani/main.nf new file mode 100644 index 00000000..cc1c4902 --- /dev/null +++ b/modules/fastani/main.nf @@ -0,0 +1,47 @@ +process FASTANI { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::fastani=1.32" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fastani:1.32--he1c1bb9_0' : + 'quay.io/biocontainers/fastani:1.32--he1c1bb9_0' }" + + input: + tuple val(meta), path(query) + path reference + + output: + tuple val(meta), path("*.ani.txt"), emit: ani + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + if (meta.batch_input) { + """ + fastANI \\ + -ql $query \\ + -rl $reference \\ + -o ${prefix}.ani.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastani: \$(fastANI --version 2>&1 | sed 's/version//;') + END_VERSIONS + """ + } else { + """ + fastANI \\ + -q $query \\ + -r $reference \\ + -o ${prefix}.ani.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastani: \$(fastANI --version 2>&1 | sed 's/version//;') + END_VERSIONS + """ + } +} diff --git a/modules/fastani/meta.yml b/modules/fastani/meta.yml new file mode 100644 index 00000000..dc62d485 --- /dev/null +++ b/modules/fastani/meta.yml @@ -0,0 +1,43 @@ +name: fastani +description: write your description here +keywords: + - fastani +tools: + - fastani: + description: FastANI is developed for fast alignment-free computation of whole-genome Average Nucleotide Identity (ANI). + homepage: https://github.com/ParBLiSS/FastANI + documentation: https://github.com/ParBLiSS/FastANI + tool_dev_url: https://github.com/ParBLiSS/FastANI + doi: 10.1038/s41467-018-07641-9 + licence: ['Apache-2.0'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - query: + type: file + description: Fasta file(s) to be queried + pattern: "*.fasta" + - reference: + type: file + description: Fasta file(s) to be used as reference for the query + pattern: "*.fasta" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ani: + type: file + description: Results of the query + pattern: "*.ani.txt" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@abhi18av" diff --git a/modules/fastp/functions.nf b/modules/fastp/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/fastp/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 6d703615..33603842 100644 --- a/modules/fastp/main.nf +++ b/modules/fastp/main.nf @@ -1,40 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process FASTP { 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::fastp=0.20.1' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/fastp:0.20.1--h8b12597_0' - } else { - container 'quay.io/biocontainers/fastp:0.20.1--h8b12597_0' - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fastp:0.20.1--h8b12597_0' : + 'quay.io/biocontainers/fastp:0.20.1--h8b12597_0' }" input: tuple val(meta), path(reads) + val save_trimmed_fail + val save_merged output: - tuple val(meta), path('*.trim.fastq.gz'), emit: reads - 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 - tuple val(meta), path('*.fail.fastq.gz'), optional:true, emit: reads_fail + tuple val(meta), path('*.trim.fastq.gz') , emit: reads + 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: 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: + def args = task.ext.args ?: '' // 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}" + def prefix = task.ext.prefix ?: "${meta.id}" if (meta.single_end) { - def fail_fastq = params.save_trimmed_fail ? "--failed_out ${prefix}.fail.fastq.gz" : '' + def fail_fastq = save_trimmed_fail ? "--failed_out ${prefix}.fail.fastq.gz" : '' """ [ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz fastp \\ @@ -44,12 +36,16 @@ process FASTP { --json ${prefix}.fastp.json \\ --html ${prefix}.fastp.html \\ $fail_fastq \\ - $options.args \\ + $args \\ 2> ${prefix}.fastp.log - echo \$(fastp --version 2>&1) | sed -e "s/fastp //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastp: \$(fastp --version 2>&1 | sed -e "s/fastp //g") + END_VERSIONS """ } else { - def fail_fastq = params.save_trimmed_fail ? "--unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : '' + def fail_fastq = save_trimmed_fail ? "--unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : '' + def merge_fastq = save_merged ? "-m --merged_out ${prefix}.merged.fastq.gz" : '' """ [ ! -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 @@ -61,12 +57,16 @@ process FASTP { --json ${prefix}.fastp.json \\ --html ${prefix}.fastp.html \\ $fail_fastq \\ + $merge_fastq \\ --thread $task.cpus \\ --detect_adapter_for_pe \\ - $options.args \\ + $args \\ 2> ${prefix}.fastp.log - echo \$(fastp --version 2>&1) | sed -e "s/fastp //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastp: \$(fastp --version 2>&1 | sed -e "s/fastp //g") + END_VERSIONS """ } } diff --git a/modules/fastp/meta.yml b/modules/fastp/meta.yml index 1fc3dfb6..a1875faf 100644 --- a/modules/fastp/meta.yml +++ b/modules/fastp/meta.yml @@ -10,6 +10,7 @@ tools: A tool designed to provide fast all-in-one preprocessing for FastQ files. This tool is developed in C++ with multithreading supported to afford high performance. documentation: https://github.com/OpenGene/fastp doi: https://doi.org/10.1093/bioinformatics/bty560 + licence: ['MIT'] input: - meta: type: map @@ -30,7 +31,7 @@ output: e.g. [ id:'test', single_end:false ] - reads: type: file - description: The trimmed/modified fastq reads + description: The trimmed/modified/unmerged fastq reads pattern: "*trim.fastq.gz" - json: type: file @@ -39,19 +40,23 @@ output: - html: type: file description: Results in HTML format - pattern: "*.thml" + pattern: "*.html" - log: type: file description: fastq log file pattern: "*.log" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - reads_fail: type: file description: Reads the failed the preprocessing pattern: "*fail.fastq.gz" + - reads_merged: + type: file + description: Reads that were successfully merged + pattern: "*.{merged.fastq.gz}" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/fastqc/functions.nf b/modules/fastqc/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/fastqc/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..d250eca0 100644 --- a/modules/fastqc/main.nf +++ b/modules/fastqc/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process FASTQC { 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::fastqc=0.11.9" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0" - } else { - container "quay.io/biocontainers/fastqc:0.11.9--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0' : + 'quay.io/biocontainers/fastqc:0.11.9--0' }" input: tuple val(meta), path(reads) @@ -24,24 +13,32 @@ 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: versions script: + def args = task.ext.args ?: '' // 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}" + def prefix = task.ext.prefix ?: "${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 + fastqc $args --threads $task.cpus ${prefix}.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${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 + fastqc $args --threads $task.cpus ${prefix}_1.fastq.gz ${prefix}_2.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${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..b09553a3 100644 --- a/modules/fastqc/meta.yml +++ b/modules/fastqc/meta.yml @@ -15,6 +15,7 @@ tools: overrepresented sequences. homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/ documentation: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/ + licence: ['GPL-2.0-only'] input: - meta: type: map @@ -40,10 +41,10 @@ output: type: file description: FastQC report archive pattern: "*_{fastqc.zip}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@grst" diff --git a/modules/fastqscan/main.nf b/modules/fastqscan/main.nf new file mode 100644 index 00000000..a0dcc46a --- /dev/null +++ b/modules/fastqscan/main.nf @@ -0,0 +1,30 @@ +process FASTQSCAN { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::fastq-scan=0.4.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fastq-scan:0.4.4--h7d875b9_0' : + 'quay.io/biocontainers/fastq-scan:0.4.4--h7d875b9_0' }" + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("*.json"), emit: json + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + zcat $reads | \\ + fastq-scan \\ + $args > ${prefix}.json + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastqscan: \$( echo \$(fastq-scan -v 2>&1) | sed 's/^.*fastq-scan //' ) + END_VERSIONS + """ +} diff --git a/modules/fastqscan/meta.yml b/modules/fastqscan/meta.yml new file mode 100644 index 00000000..99538b5a --- /dev/null +++ b/modules/fastqscan/meta.yml @@ -0,0 +1,43 @@ +name: fastqscan +description: FASTQ summary statistics in JSON format +keywords: + - fastq + - summary + - statistics +tools: + - fastqscan: + description: FASTQ summary statistics in JSON format + homepage: https://github.com/rpetit3/fastq-scan + documentation: https://github.com/rpetit3/fastq-scan + tool_dev_url: https://github.com/rpetit3/fastq-scan + doi: "" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: FASTQ file + pattern: "*.{fastq.gz,fq.gz}" + +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" + - json: + type: file + description: JSON formatted file of summary statistics + pattern: "*.json" + +authors: + - "@rpetit3" diff --git a/modules/fasttree/functions.nf b/modules/fasttree/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/fasttree/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..5e57aae9 100644 --- a/modules/fasttree/main.nf +++ b/modules/fasttree/main.nf @@ -1,38 +1,30 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process FASTTREE { 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:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::fasttree=2.1.10" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/fasttree:2.1.10--h516909a_4" - } else { - container "quay.io/biocontainers/fasttree:2.1.10--h516909a_4" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fasttree:2.1.10--h516909a_4' : + 'quay.io/biocontainers/fasttree:2.1.10--h516909a_4' }" input: path alignment output: path "*.tre", emit: phylogeny - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ fasttree \\ - $options.args \\ + $args \\ -log fasttree_phylogeny.tre.log \\ -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 + "${task.process}": + fasttree: \$(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..5906675b 100644 --- a/modules/fasttree/meta.yml +++ b/modules/fasttree/meta.yml @@ -19,10 +19,10 @@ input: pattern: "*.{fasta,fas,fa,mfa}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/fgbio/callmolecularconsensusreads/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..3aab935b 100644 --- a/modules/fgbio/callmolecularconsensusreads/main.nf +++ b/modules/fgbio/callmolecularconsensusreads/main.nf @@ -1,38 +1,32 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process FGBIO_CALLMOLECULARCONSENSUSREADS { 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::fgbio=1.3.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/fgbio:1.3.0--0" - } else { - container "quay.io/biocontainers/fgbio:1.3.0--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fgbio:1.3.0--0' : + 'quay.io/biocontainers/fgbio:1.3.0--0' }" input: tuple val(meta), path(bam) output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ fgbio \\ CallMolecularConsensusReads \\ -i $bam \\ - $options.args \\ + $args \\ -o ${prefix}.bam - fgbio --version | sed -e "s/fgbio v//g" > ${software}.version.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fgbio: \$( echo \$(fgbio --version 2>&1 | tr -d '[:cntrl:]' ) | sed -e 's/^.*Version: //;s/\\[.*\$//') + END_VERSIONS """ } diff --git a/modules/fgbio/callmolecularconsensusreads/meta.yml b/modules/fgbio/callmolecularconsensusreads/meta.yml index 5f80bce9..523f3214 100644 --- a/modules/fgbio/callmolecularconsensusreads/meta.yml +++ b/modules/fgbio/callmolecularconsensusreads/meta.yml @@ -36,10 +36,10 @@ output: description: | Output SAM or BAM file to write consensus reads. pattern: "*.{bam,sam}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@sruthipsuresh" diff --git a/modules/fgbio/fastqtobam/main.nf b/modules/fgbio/fastqtobam/main.nf new file mode 100644 index 00000000..126c3dd8 --- /dev/null +++ b/modules/fgbio/fastqtobam/main.nf @@ -0,0 +1,39 @@ +process FGBIO_FASTQTOBAM { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::fgbio=1.4.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fgbio:1.4.0--hdfd78af_0' : + 'quay.io/biocontainers/fgbio:1.4.0--hdfd78af_0' }" + + input: + tuple val(meta), path(reads) + val read_structure + + output: + tuple val(meta), path("*_umi_converted.bam"), emit: umibam + path "versions.yml" , emit: version + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + mkdir tmp + + fgbio \\ + --tmp-dir=${PWD}/tmp \\ + FastqToBam \\ + -i $reads \\ + -o "${prefix}_umi_converted.bam" \\ + --read-structures $read_structure \\ + --sample $meta.id \\ + --library $meta.id \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fgbio: \$( echo \$(fgbio --version 2>&1 | tr -d '[:cntrl:]' ) | sed -e 's/^.*Version: //;s/\\[.*\$//') + END_VERSIONS + """ +} diff --git a/modules/fgbio/fastqtobam/meta.yml b/modules/fgbio/fastqtobam/meta.yml new file mode 100644 index 00000000..e356d315 --- /dev/null +++ b/modules/fgbio/fastqtobam/meta.yml @@ -0,0 +1,47 @@ +name: fgbio_fastqtobam +description: | + Using the FGBIO tools, converts FASTQ files sequenced with UMIs into BAM files, moving the UMI barcode into the RX field of the BAM file +keywords: + - fastqtobam + - fgbio +tools: + - fgbio: + description: A set of tools for working with genomic and high throughput sequencing data, including UMIs + homepage: http://fulcrumgenomics.github.io/fgbio/ + documentation: http://fulcrumgenomics.github.io/fgbio/tools/latest/ + tool_dev_url: https://github.com/fulcrumgenomics/fgbio + doi: "" + licence: ['MIT'] + +input: + - reads: + type: file + description: pair of reads to be converted into BAM file + pattern: "*.{fastq.gz}" + + - read_structure: + type: string + description: | + A read structure should always be provided for each of the fastq files. + If single end, the string will contain only one structure (i.e. "2M11S+T"), if paired-end the string + will contain two structures separated by a blank space (i.e. "2M11S+T 2M11S+T"). + If the read does not contain any UMI, the structure will be +T (i.e. only template of any length). + https://github.com/fulcrumgenomics/fgbio/wiki/Read-Structures + +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.yml}" + - umibam: + type: file + description: Converted, unsorted BAM file with RX tag reporting UMI sequence (if any) + pattern: "*.{bam}" + +authors: + - "@lescai" diff --git a/modules/fgbio/groupreadsbyumi/main.nf b/modules/fgbio/groupreadsbyumi/main.nf new file mode 100644 index 00000000..47f000a5 --- /dev/null +++ b/modules/fgbio/groupreadsbyumi/main.nf @@ -0,0 +1,40 @@ +process FGBIO_GROUPREADSBYUMI { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::fgbio=1.4.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fgbio:1.4.0--hdfd78af_0' : + 'quay.io/biocontainers/fgbio:1.4.0--hdfd78af_0' }" + + input: + tuple val(meta), path(taggedbam) + val(strategy) + + output: + tuple val(meta), path("*_umi-grouped.bam") , emit: bam + tuple val(meta), path("*_umi_histogram.txt"), emit: histogram + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + mkdir tmp + + fgbio \\ + --tmp-dir=${PWD}/tmp \\ + GroupReadsByUmi \\ + -s $strategy \\ + $args \\ + -i $taggedbam \\ + -o ${prefix}_umi-grouped.bam \\ + -f ${prefix}_umi_histogram.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fgbio: \$( echo \$(fgbio --version 2>&1 | tr -d '[:cntrl:]' ) | sed -e 's/^.*Version: //;s/\\[.*\$//') + END_VERSIONS + """ +} diff --git a/modules/fgbio/groupreadsbyumi/meta.yml b/modules/fgbio/groupreadsbyumi/meta.yml new file mode 100644 index 00000000..18ce149e --- /dev/null +++ b/modules/fgbio/groupreadsbyumi/meta.yml @@ -0,0 +1,59 @@ +name: fgbio_groupreadsbyumi +description: | + Groups reads together that appear to have come from the same original molecule. + Reads are grouped by template, and then templates are sorted by the 5’ mapping positions + of the reads from the template, used from earliest mapping position to latest. + Reads that have the same end positions are then sub-grouped by UMI sequence. + (!) Note: the MQ tag is required on reads with mapped mates (!) + This can be added using samblaster with the optional argument --addMateTags. +keywords: + - UMI + - groupreads + - fgbio +tools: + - fgbio: + description: A set of tools for working with genomic and high throughput sequencing data, including UMIs + homepage: http://fulcrumgenomics.github.io/fgbio/ + documentation: http://fulcrumgenomics.github.io/fgbio/tools/latest/ + tool_dev_url: https://github.com/fulcrumgenomics/fgbio + 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 file. Note: the MQ tag is required on reads with mapped mates (!) + pattern: "*.bam" + - strategy: + type: value + description: | + Reguired argument: defines the UMI assignment strategy. + Must be chosen among: Identity, Edit, Adjacency, Paired. + +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: UMI-grouped BAM + pattern: "*.bam" + - histogram: + type: file + description: A text file containing the tag family size counts + pattern: "*.txt" + +authors: + - "@lescai" diff --git a/modules/fgbio/sortbam/functions.nf b/modules/fgbio/sortbam/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/fgbio/sortbam/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..c542f3df 100644 --- a/modules/fgbio/sortbam/main.nf +++ b/modules/fgbio/sortbam/main.nf @@ -1,39 +1,32 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process FGBIO_SORTBAM { 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::fgbio=1.3.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/fgbio:1.3.0--0" - } else { - container "quay.io/biocontainers/fgbio:1.3.0--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fgbio:1.3.0--0' : + 'quay.io/biocontainers/fgbio:1.3.0--0' }" input: tuple val(meta), path(bam) output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ fgbio \\ SortBam \\ -i $bam \\ - $options.args \\ + $args \\ -o ${prefix}.bam - fgbio --version | sed -e "s/fgbio v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fgbio: \$( echo \$(fgbio --version 2>&1 | tr -d '[:cntrl:]' ) | sed -e 's/^.*Version: //;s/\\[.*\$//') + END_VERSIONS """ } diff --git a/modules/fgbio/sortbam/meta.yml b/modules/fgbio/sortbam/meta.yml index 9e68dac4..b8040dab 100644 --- a/modules/fgbio/sortbam/meta.yml +++ b/modules/fgbio/sortbam/meta.yml @@ -34,10 +34,10 @@ output: description: | Output SAM or BAM file. pattern: "*.{bam,sam}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@sruthipsuresh" diff --git a/modules/filtlong/main.nf b/modules/filtlong/main.nf new file mode 100644 index 00000000..bb1c1eb3 --- /dev/null +++ b/modules/filtlong/main.nf @@ -0,0 +1,33 @@ +process FILTLONG { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::filtlong=0.2.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/filtlong:0.2.1--h9a82719_0' : + 'quay.io/biocontainers/filtlong:0.2.1--h9a82719_0' }" + + input: + tuple val(meta), path(shortreads), path(longreads) + + output: + tuple val(meta), path("${meta.id}_lr_filtlong.fastq.gz"), emit: reads + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def short_reads = meta.single_end ? "-1 $shortreads" : "-1 ${shortreads[0]} -2 ${shortreads[1]}" + """ + filtlong \\ + $short_reads \\ + $args \\ + $longreads \\ + | gzip -n > ${prefix}_lr_filtlong.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + filtlong: \$( filtlong --version | sed -e "s/Filtlong v//g" ) + END_VERSIONS + """ +} diff --git a/modules/filtlong/meta.yml b/modules/filtlong/meta.yml new file mode 100644 index 00000000..7616a176 --- /dev/null +++ b/modules/filtlong/meta.yml @@ -0,0 +1,50 @@ +name: filtlong +description: Filtlong filters long reads based on quality measures or short read data. +keywords: + - nanopore + - quality control + - QC + - filtering + - long reads + - short reads +tools: + - filtlong: + description: Filtlong is a tool for filtering long reads. It can take a set of long reads and produce a smaller, better subset. It uses both read length (longer is better) and read identity (higher is better) when choosing which reads pass the filter. + homepage: https://anaconda.org/bioconda/filtlong + documentation: None + tool_dev_url: https://github.com/rrwick/Filtlong + doi: "" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - shortreads: + type: file + description: fastq file + pattern: "*.{fq,fastq,fq.gz,fastq.gz}" + - longreads: + type: file + description: fastq file + pattern: "*.{fq,fastq,fq.gz,fastq.gz}" + +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: Filtered (compressed) fastq file + pattern: "*.fastq.gz" + +authors: + - "@d4straub" diff --git a/modules/flash/functions.nf b/modules/flash/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/flash/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..7bc38c97 100644 --- a/modules/flash/main.nf +++ b/modules/flash/main.nf @@ -1,40 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process FLASH { 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::flash=1.2.11" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/flash:1.2.11--hed695b0_5" - } else { - container "quay.io/biocontainers/flash:1.2.11--hed695b0_5" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/flash:1.2.11--hed695b0_5' : + 'quay.io/biocontainers/flash:1.2.11--hed695b0_5' }" input: tuple val(meta), path(reads) output: - tuple val(meta), path("*.merged.*.fastq.gz"), emit: reads - path "*.version.txt" , emit: version + tuple val(meta), path("*.fastq.gz"), emit: reads + path "versions.yml" , emit: versions 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]}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ flash \\ - $options.args \\ - $merged \\ + $args \\ + -o ${prefix} \\ -z \\ - $input_reads - echo \$(flash --version) > ${software}.version.txt + ${reads[0]} \\ + ${reads[1]} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + flash: \$(echo \$(flash --version 2>&1) | sed 's/^.*FLASH v//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/flash/meta.yml b/modules/flash/meta.yml index ff747912..06807523 100644 --- a/modules/flash/meta.yml +++ b/modules/flash/meta.yml @@ -35,10 +35,10 @@ output: type: file description: The merged fastq reads pattern: "*fastq.gz" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@Erkison" diff --git a/modules/freebayes/main.nf b/modules/freebayes/main.nf new file mode 100644 index 00000000..1dd91fef --- /dev/null +++ b/modules/freebayes/main.nf @@ -0,0 +1,71 @@ +process FREEBAYES { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::freebayes=1.3.5" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/freebayes:1.3.5--py38ha193a2f_3' : + 'quay.io/biocontainers/freebayes:1.3.5--py38ha193a2f_3' }" + + input: + tuple val(meta), path(input_1), path(input_1_index), path(input_2), path(input_2_index) + path fasta + path fasta_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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def input = input_2 ? "${input_1} ${input_2}" : "${input_1}" + 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 \\ + $args \\ + $input > ${prefix}.vcf + + gzip --no-name ${prefix}.vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + freebayes: \$(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 \\ + $args \\ + $input > ${prefix}.vcf + + gzip --no-name ${prefix}.vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + freebayes: \$(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..abba1daa --- /dev/null +++ b/modules/freebayes/meta.yml @@ -0,0 +1,82 @@ +name: freebayes +description: A haplotype-based variant detector +keywords: + - variant caller + - SNP + - genotyping + - somatic variant calling + - germline variant calling + - bacterial 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: "arXiv:1207.3907" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - input_index: + 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}" + - fasta_fai: + type: file + description: reference fasta file index + pattern: "*.{fa,fasta}.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" + - "@FriederikeHanssen" + - "@maxulysse" diff --git a/modules/gatk4/applybqsr/functions.nf b/modules/gatk4/applybqsr/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/applybqsr/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..3cc69ddf 100644 --- a/modules/gatk4/applybqsr/main.nf +++ b/modules/gatk4/applybqsr/main.nf @@ -1,47 +1,46 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_APPLYBQSR { 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" - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: - tuple val(meta), path(bam), path(bai), path(bqsr_table) + tuple val(meta), path(input), path(input_index), path(bqsr_table) path fasta - path fastaidx + path fai path dict path intervals output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def interval = intervals ? "-L ${intervals}" : "" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK ApplyBQSR] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } """ - gatk ApplyBQSR \\ + gatk --java-options "-Xmx${avail_mem}g" ApplyBQSR \\ -R $fasta \\ - -I $bam \\ + -I $input \\ --bqsr-recal-file $bqsr_table \\ $interval \\ + --tmp-dir . \\ -O ${prefix}.bam \\ - $options.args + $args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..4e3b2f9a 100644 --- a/modules/gatk4/applybqsr/meta.yml +++ b/modules/gatk4/applybqsr/meta.yml @@ -12,6 +12,7 @@ tools: 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 + licence: ['Apache-2.0'] input: - meta: @@ -19,22 +20,29 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bam: + - input: type: file - description: BAM file from alignment - pattern: "*.{bam}" + description: BAM/CRAM file from alignment + pattern: "*.{bam,cram}" + - input_index: + type: file + description: BAI/CRAI file from alignment + pattern: "*.{bai,crai}" - bqsr_table: type: file description: Recalibration table from gatk4_baserecalibrator - fasta: type: file description: The reference fasta file - - fastaidx: + pattern: "*.fasta" + - fai: type: file description: Index of reference fasta file + pattern: "*.fasta.fai" - dict: type: file description: GATK sequence dictionary + pattern: "*.dict" - intervalsBed: type: file description: Bed file with the genomic regions included in the library (optional) @@ -45,10 +53,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bam: type: file description: Recalibrated BAM file @@ -56,3 +64,4 @@ output: authors: - "@yocra3" + - "@FriederikeHanssen" diff --git a/modules/gatk4/applyvqsr/main.nf b/modules/gatk4/applyvqsr/main.nf new file mode 100644 index 00000000..89f79f42 --- /dev/null +++ b/modules/gatk4/applyvqsr/main.nf @@ -0,0 +1,55 @@ +process GATK4_APPLYVQSR { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" + + input: + tuple val(meta), path(vcf), path(tbi), path(recal), path(recalidx), path(tranches) + path fasta + path fai + path dict + val allelespecific + val truthsensitivity + val mode + + output: + tuple val(meta), path("*.vcf.gz") , emit: vcf + tuple val(meta), path("*.tbi") , emit: tbi + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + refCommand = fasta ? "-R ${fasta} " : '' + alleleSpecificCommand = allelespecific ? '-AS' : '' + truthSensitivityCommand = truthsensitivity ? "--truth-sensitivity-filter-level ${truthsensitivity}" : '' + modeCommand = mode ? "--mode ${mode} " : 'SNP' + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK ApplyVQSR] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" ApplyVQSR \\ + ${refCommand} \\ + -V ${vcf} \\ + -O ${prefix}.vcf.gz \\ + ${alleleSpecificCommand} \\ + ${truthSensitivityCommand} \\ + --tranches-file $tranches \\ + --recal-file $recal \\ + ${modeCommand} \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/applyvqsr/meta.yml b/modules/gatk4/applyvqsr/meta.yml new file mode 100644 index 00000000..b757f3e9 --- /dev/null +++ b/modules/gatk4/applyvqsr/meta.yml @@ -0,0 +1,88 @@ +name: gatk4_applyvqsr +description: | + Apply a score cutoff to filter variants based on a recalibration table. + AplyVQSR performs the second pass in a two-stage process called Variant Quality Score Recalibration (VQSR). + Specifically, it applies filtering to the input variants based on the recalibration table produced + in the first step by VariantRecalibrator and a target sensitivity value. +keywords: + - gatk4 + - applyvqsr + - VQSR +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 + licence: ['Apache-2.0'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test'] + - vcf: + type: file + description: VCF file to be recalibrated, this should be the same file as used for the first stage VariantRecalibrator. + pattern: "*.vcf" + - tbi: + type: file + description: Tbi index for the input vcf file. + pattern: "*.vcf.tbi" + - recal: + type: file + description: Recalibration file produced when the input vcf was run through VariantRecalibrator in stage 1. + pattern: "*.recal" + - recalidx: + type: file + description: Index file for the recalibration file. + pattern: ".recal.idx" + - tranches: + type: boolean + description: Tranches file produced when the input vcf was run through VariantRecalibrator in stage 1. + pattern: ".tranches" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "*.fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" + - allelespecific: + type: boolean + description: Whether or not to run ApplyVQSR in allele specific mode, this should be kept the same as the stage 1 VariantRecalibrator run. + pattern: "{true,false}" + - truthsensitivity: + type: double + description: Value to be used as the truth sensitivity cutoff score. + pattern: "99.0" + - mode: + type: String + description: Specifies which recalibration mode to employ, should be the same as the stage 1 VariantRecalibrator run. (SNP is default, BOTH is intended for testing only) + pattern: "{SNP,INDEL,BOTH}" + +output: + - vcf: + type: file + description: compressed vcf file containing the recalibrated variants. + pattern: "*.vcf.gz" + - tbi: + type: file + description: Index of recalibrated vcf file. + pattern: "*vcf.gz.tbi" + - versions: + type: file + description: File containing software versions. + pattern: "versions.yml" + +authors: + - "@GCJMackenzie" diff --git a/modules/gatk4/baserecalibrator/functions.nf b/modules/gatk4/baserecalibrator/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/baserecalibrator/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..17b37943 100644 --- a/modules/gatk4/baserecalibrator/main.nf +++ b/modules/gatk4/baserecalibrator/main.nf @@ -1,27 +1,16 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_BASERECALIBRATOR { 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" - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: - tuple val(meta), path(bam), path(bai) + tuple val(meta), path(input), path(input_index) path fasta - path fastaidx + path fai path dict path intervalsBed path knownSites @@ -29,22 +18,32 @@ process GATK4_BASERECALIBRATOR { output: tuple val(meta), path("*.table"), emit: table - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def intervalsCommand = intervalsBed ? "-L ${intervalsBed}" : "" def sitesCommand = knownSites.collect{"--known-sites ${it}"}.join(' ') + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK BaseRecalibrator] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } """ - gatk BaseRecalibrator \ + gatk --java-options "-Xmx${avail_mem}g" BaseRecalibrator \ -R $fasta \ - -I $bam \ + -I $input \ $sitesCommand \ $intervalsCommand \ - $options.args \ + --tmp-dir . \ + $args \ -O ${prefix}.table - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..188340b4 100644 --- a/modules/gatk4/baserecalibrator/meta.yml +++ b/modules/gatk4/baserecalibrator/meta.yml @@ -11,6 +11,7 @@ tools: 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 + licence: ['Apache-2.0'] input: @@ -19,19 +20,26 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bam: + - input: type: file - description: BAM file from alignment - pattern: "*.{bam}" + description: BAM/CRAM file from alignment + pattern: "*.{bam,cram}" + - input_index: + type: file + description: BAI/CRAI file from alignment + pattern: "*.{bai,crai}" - fasta: type: file description: The reference fasta file - - fastaidx: + pattern: "*.fasta" + - fai: type: file description: Index of reference fasta file + pattern: "*.fasta.fai" - dict: type: file description: GATK sequence dictionary + pattern: "*.dict" - intervalsBed: type: file description: Bed file with the genomic regions included in the library (optional) @@ -45,10 +53,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - table: type: file description: Recalibration table from BaseRecalibrator @@ -56,3 +64,4 @@ output: authors: - "@yocra3" + - "@FriederikeHanssen" diff --git a/modules/gatk4/bedtointervallist/functions.nf b/modules/gatk4/bedtointervallist/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/bedtointervallist/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 6d98e1d6..2f6266b9 100644 --- a/modules/gatk4/bedtointervallist/main.nf +++ b/modules/gatk4/bedtointervallist/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_BEDTOINTERVALLIST { 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::gatk4=4.1.9.0' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/gatk4:4.1.9.0--py39_0' - } else { - container 'quay.io/biocontainers/gatk4:4.1.9.0--py39_0' - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: tuple val(meta), path(bed) @@ -24,18 +13,27 @@ process GATK4_BEDTOINTERVALLIST { output: tuple val(meta), path('*.interval_list'), emit: interval_list - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK BedToIntervalList] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } """ - gatk BedToIntervalList \\ + gatk --java-options "-Xmx${avail_mem}g" BedToIntervalList \\ -I $bed \\ -SD $sequence_dict \\ -O ${prefix}.interval_list \\ - $options.args + $args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..910f9552 100644 --- a/modules/gatk4/bedtointervallist/meta.yml +++ b/modules/gatk4/bedtointervallist/meta.yml @@ -12,6 +12,7 @@ tools: 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 + licence: ['Apache-2.0'] input: - meta: type: map @@ -31,9 +32,9 @@ output: type: file description: gatk interval list file pattern: "*.interval_list" - - version: + - versions: type: file - description: File containing software version - pattern: "*.version.txt" + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/calculatecontamination/main.nf b/modules/gatk4/calculatecontamination/main.nf new file mode 100644 index 00000000..8840356a --- /dev/null +++ b/modules/gatk4/calculatecontamination/main.nf @@ -0,0 +1,43 @@ +process GATK4_CALCULATECONTAMINATION { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def matched_command = matched ? " -matched ${matched} " : '' + def segment_command = segmentout ? " -segments ${prefix}.segmentation.table" : '' + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK CalculateContamination] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" CalculateContamination \\ + -I $pileup \\ + $matched_command \\ + -O ${prefix}.contamination.table \\ + $segment_command \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(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..8c843732 --- /dev/null +++ b/modules/gatk4/calculatecontamination/meta.yml @@ -0,0 +1,54 @@ +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 + licence: ['Apache-2.0'] + +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/modules/gatk4/createsequencedictionary/functions.nf b/modules/gatk4/createsequencedictionary/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/createsequencedictionary/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 3cf5543a..e8f32106 100644 --- a/modules/gatk4/createsequencedictionary/main.nf +++ b/modules/gatk4/createsequencedictionary/main.nf @@ -1,35 +1,24 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_CREATESEQUENCEDICTIONARY { tag "$fasta" 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:[:], publish_by_meta:[]) } - conda (params.enable_conda ? "bioconda::gatk4=4.1.9.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/gatk4:4.1.9.0--py39_0" - } else { - container "quay.io/biocontainers/gatk4:4.1.9.0--py39_0" - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: path fasta output: path "*.dict" , emit: dict - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' def avail_mem = 6 if (!task.memory) { - log.info '[GATK] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.' + log.info '[GATK CreateSequenceDictionary] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.' } else { avail_mem = task.memory.giga } @@ -38,8 +27,11 @@ process GATK4_CREATESEQUENCEDICTIONARY { CreateSequenceDictionary \\ --REFERENCE $fasta \\ --URI $fasta \\ - $options.args + $args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..54f479b3 100644 --- a/modules/gatk4/createsequencedictionary/meta.yml +++ b/modules/gatk4/createsequencedictionary/meta.yml @@ -12,6 +12,8 @@ tools: 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 + licence: ['Apache-2.0'] + input: - fasta: type: file @@ -22,9 +24,9 @@ output: type: file description: gatk dictionary file pattern: "*.{dict}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/gatk4/createsomaticpanelofnormals/main.nf b/modules/gatk4/createsomaticpanelofnormals/main.nf new file mode 100644 index 00000000..ff345f75 --- /dev/null +++ b/modules/gatk4/createsomaticpanelofnormals/main.nf @@ -0,0 +1,43 @@ +process GATK4_CREATESOMATICPANELOFNORMALS { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" + + input: + tuple val(meta), path(genomicsdb) + path fasta + path fai + path dict + + output: + tuple val(meta), path("*.vcf.gz"), emit: vcf + tuple val(meta), path("*.tbi") , emit: tbi + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK CreateSomaticPanelOfNormals] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" \\ + CreateSomaticPanelOfNormals \\ + -R $fasta \\ + -V gendb://$genomicsdb \\ + -O ${prefix}.vcf.gz \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/createsomaticpanelofnormals/meta.yml b/modules/gatk4/createsomaticpanelofnormals/meta.yml new file mode 100644 index 00000000..e450c68a --- /dev/null +++ b/modules/gatk4/createsomaticpanelofnormals/meta.yml @@ -0,0 +1,55 @@ +name: gatk4_createsomaticpanelofnormals +description: Create a panel of normals contraining germline and artifactual sites for use with mutect2. +keywords: + - gatk4 + - createsomaticpanelofnormals + - panelofnormals +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'] + - genoomicsdb: + type: directory + description: genomicsDB workspace that contains the samples to create the somatic panel of normals with. + pattern: "*_genomicsDBworkspace" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "*.fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" + +output: + - vcf: + type: file + description: panel of normal as compressed vcf file + pattern: "*.vcf.gz" + - tbi: + type: file + description: Index of vcf file + pattern: "*vcf.gz.tbi" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@GCJMackenzie" diff --git a/modules/gatk4/estimatelibrarycomplexity/main.nf b/modules/gatk4/estimatelibrarycomplexity/main.nf new file mode 100644 index 00000000..c17dba09 --- /dev/null +++ b/modules/gatk4/estimatelibrarycomplexity/main.nf @@ -0,0 +1,44 @@ +process GATK4_ESTIMATELIBRARYCOMPLEXITY { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" + + input: + tuple val(meta), path(cram) + path(fasta) + path(fai) + path(dict) + + output: + tuple val(meta), path('*.metrics'), emit: metrics + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def crams = cram.collect(){ x -> "-I ".concat(x.toString()) }.join(" ") + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK EstimateLibraryComplexity] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" EstimateLibraryComplexity \ + ${crams} \ + -O ${prefix}.metrics \ + --REFERENCE_SEQUENCE ${fasta} \ + --VALIDATION_STRINGENCY SILENT \ + --TMP_DIR . $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/estimatelibrarycomplexity/meta.yml b/modules/gatk4/estimatelibrarycomplexity/meta.yml new file mode 100644 index 00000000..94c1817d --- /dev/null +++ b/modules/gatk4/estimatelibrarycomplexity/meta.yml @@ -0,0 +1,56 @@ +name: gatk4_estimatelibrarycomplexity +description: Estimates the numbers of unique molecules in a sequencing library. +keywords: + - gatk4 + - gatk4_estimatelibrarycomplexity + - duplication_metrics + - reporting +tools: + - gatk4: + description: Genome Analysis Toolkit (GATK4) + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us + tool_dev_url: https://github.com/broadinstitute/gatk + doi: "10.1158/1538-7445.AM2017-3590" + licence: ['Apache-2.0'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cram: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" + +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" + - metrics: + type: file + description: File containing metrics on the input files + pattern: "*.{metrics}" + +authors: + - "@FriederikeHanssen" diff --git a/modules/gatk4/fastqtosam/functions.nf b/modules/gatk4/fastqtosam/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/fastqtosam/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..a55ba709 100644 --- a/modules/gatk4/fastqtosam/main.nf +++ b/modules/gatk4/fastqtosam/main.nf @@ -1,41 +1,39 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_FASTQTOSAM { 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::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" - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: tuple val(meta), path(reads) output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def read_files = meta.single_end ? "-F1 $reads" : "-F1 ${reads[0]} -F2 ${reads[1]}" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK FastqToSam] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } """ - gatk FastqToSam \\ + gatk --java-options "-Xmx${avail_mem}g" FastqToSam \\ $read_files \\ -O ${prefix}.bam \\ -SM $prefix \\ - $options.args + $args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..8bd9eed5 100644 --- a/modules/gatk4/fastqtosam/meta.yml +++ b/modules/gatk4/fastqtosam/meta.yml @@ -1,5 +1,5 @@ name: gatk4_fastqtosam -description: Converts FastQ file to BAM format +description: Converts FastQ file to SAM/BAM format keywords: - bam - fastq @@ -14,7 +14,7 @@ tools: documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s tool_dev_url: https://github.com/broadinstitute/gatk doi: "10.1158/1538-7445.AM2017-3590" - licence: ['BSD-3-clause'] + licence: ['MIT'] input: - meta: @@ -34,10 +34,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bam: type: file description: Converted BAM file diff --git a/modules/gatk4/filtermutectcalls/main.nf b/modules/gatk4/filtermutectcalls/main.nf new file mode 100644 index 00000000..6a1d9b3a --- /dev/null +++ b/modules/gatk4/filtermutectcalls/main.nf @@ -0,0 +1,61 @@ +process GATK4_FILTERMUTECTCALLS { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" + + input: + tuple val(meta), path(vcf), path(tbi), path(stats), path(orientationbias), path(segmentation), path(contaminationfile), val(contaminationest) + path fasta + path fai + path dict + + output: + tuple val(meta), path("*.vcf.gz") , emit: vcf + tuple val(meta), path("*.vcf.gz.tbi") , emit: tbi + tuple val(meta), path("*.filteringStats.tsv"), emit: stats + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + def orientationbias_options = '' + if (orientationbias) { + orientationbias_options = '--orientation-bias-artifact-priors ' + orientationbias.join(' --orientation-bias-artifact-priors ') + } + + def segmentation_options = '' + if (segmentation) { + segmentation_options = '--tumor-segmentation ' + segmentation.join(' --tumor-segmentation ') + } + + def contamination_options = contaminationest ? " --contamination-estimate ${contaminationest} " : '' + if (contaminationfile) { + contamination_options = '--contamination-table ' + contaminationfile.join(' --contamination-table ') + } + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK FilterMutectCalls] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" FilterMutectCalls \\ + -R $fasta \\ + -V $vcf \\ + $orientationbias_options \\ + $segmentation_options \\ + $contamination_options \\ + -O ${prefix}.vcf.gz \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/filtermutectcalls/meta.yml b/modules/gatk4/filtermutectcalls/meta.yml new file mode 100644 index 00000000..7d85e2b9 --- /dev/null +++ b/modules/gatk4/filtermutectcalls/meta.yml @@ -0,0 +1,84 @@ +name: gatk4_filtermutectcalls +description: | + Filters the raw output of mutect2, can optionally use outputs of calculatecontamination and learnreadorientationmodel to improve filtering. +keywords: + - filtermutectcalls + - mutect2 + - gatk4 + - filtervcf +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' ] + - vcf: + type: file + description: compressed vcf file of mutect2calls + pattern: "*.vcf.gz" + - tbi: + type: file + description: Index of vcf file + pattern: "*vcf.gz.tbi" + - stats: + type: file + description: Stats file that pairs with output vcf file + pattern: "*vcf.gz.stats" + - orientationbias: + type: list + description: files containing artifact priors for input vcf. Optional input. + pattern: "*.artifact-prior.tar.gz" + - segmentation: + type: list + description: tables containing segmentation information for input vcf. Optional input. + pattern: "*.segmentation.table" + - contaminationfile: + type: list + description: table(s) containing contamination contamination data for input vcf. Optional input, takes priority over contaminationest. + pattern: "*.contamination.table" + - contaminationest: + type: val + description: estimation of contamination value as a double. Optional input, will only be used if contaminationfile is not specified. + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "*.fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" + +output: + - vcf: + type: file + description: file containing filtered mutect2 calls. + pattern: "*.vcf.gz" + - tbi: + type: file + description: tbi file that pairs with vcf. + pattern: "*.vcf.gz.tbi" + - stats: + type: file + description: file containing statistics of the filtermutectcalls run. + pattern: "*.filteringStats.tsv" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@GCJMackenzie" diff --git a/modules/gatk4/gatherbqsrreports/main.nf b/modules/gatk4/gatherbqsrreports/main.nf new file mode 100644 index 00000000..1567f9aa --- /dev/null +++ b/modules/gatk4/gatherbqsrreports/main.nf @@ -0,0 +1,41 @@ +process GATK4_GATHERBQSRREPORTS { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_1': + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_1' }" + + input: + tuple val(meta), path(recal_table) + + output: + tuple val(meta), path("*.table"), emit: table + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def input = recal_table.collect{"-I ${it}"}.join(' ') + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK GatherBQSRReports] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" \\ + GatherBQSRReports \ + ${input} \ + --tmp-dir . \ + $args \ + --output ${prefix}.table + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/gatherbqsrreports/meta.yml b/modules/gatk4/gatherbqsrreports/meta.yml new file mode 100644 index 00000000..f71afd69 --- /dev/null +++ b/modules/gatk4/gatherbqsrreports/meta.yml @@ -0,0 +1,43 @@ +name: gatk4_gatherbqsrreports +description: write your description here +keywords: + - gatk4 + - gatk4_gatherbqsrreports + - base_recalibration +tools: + - gatk4: + description: Genome Analysis Toolkit (GATK4) + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us + tool_dev_url: https://github.com/broadinstitute/gatk + doi: "10.1158/1538-7445.AM2017-3590" + licence: ['BSD-3-clause'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - recal_table: + type: file + description: File(s) containing BQSR table(s) + pattern: "*.table" + +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" + - recal_table: + type: file + description: File containing joined BQSR table + pattern: "*.table" + +authors: + - "@FriederikeHanssen" diff --git a/modules/gatk4/genomicsdbimport/main.nf b/modules/gatk4/genomicsdbimport/main.nf new file mode 100644 index 00000000..2751173b --- /dev/null +++ b/modules/gatk4/genomicsdbimport/main.nf @@ -0,0 +1,63 @@ +process GATK4_GENOMICSDBIMPORT { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" + + input: + tuple val(meta), path(vcf), path(tbi), path(intervalfile), val(intervalval), path(wspace) + val run_intlist + val run_updatewspace + val input_map + + output: + tuple val(meta), path("${prefix}") , optional:true, emit: genomicsdb + tuple val(meta), path("$updated_db") , optional:true, emit: updatedb + tuple val(meta), path("*.interval_list"), optional:true, emit: intervallist + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + + // settings for running default create gendb mode + inputs_command = input_map ? "--sample-name-map ${vcf[0]}" : "${'-V ' + vcf.join(' -V ')}" + dir_command = "--genomicsdb-workspace-path ${prefix}" + intervals_command = intervalfile ? " -L ${intervalfile} " : " -L ${intervalval} " + + // settings changed for running get intervals list mode if run_intlist is true + if (run_intlist) { + inputs_command = '' + dir_command = "--genomicsdb-update-workspace-path ${wspace}" + intervals_command = "--output-interval-list-to-file ${prefix}.interval_list" + } + + // settings changed for running update gendb mode. inputs_command same as default, update_db forces module to emit the updated gendb + if (run_updatewspace) { + dir_command = "--genomicsdb-update-workspace-path ${wspace}" + intervals_command = '' + updated_db = wspace.toString() + } + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK GenomicsDBImport] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" GenomicsDBImport \\ + $inputs_command \\ + $dir_command \\ + $intervals_command \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/genomicsdbimport/meta.yml b/modules/gatk4/genomicsdbimport/meta.yml new file mode 100644 index 00000000..af626cb1 --- /dev/null +++ b/modules/gatk4/genomicsdbimport/meta.yml @@ -0,0 +1,84 @@ +name: gatk4_genomicsdbimport +description: merge GVCFs from multiple samples. For use in joint genotyping or somatic panel of normal creation. +keywords: + - gatk4 + - genomicsdbimport + - genomicsdb + - panelofnormalscreation + - jointgenotyping +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'] + - vcf: + type: list + description: either a list of vcf files to be used to create or update a genomicsdb, or a file that contains a map to vcf files to be used. + pattern: "*.vcf.gz" + + - tbi: + type: list + description: list of tbi files that match with the input vcf files + pattern: "*.vcf.gz_tbi" + + - wspace: + type: path + description: path to an existing genomicsdb to be used in update db mode or get intervals mode. This WILL NOT specify name of a new genomicsdb in create db mode. + pattern: "/path/to/existing/gendb" + + - intervalfile: + type: file + description: file containing the intervals to be used when creating the genomicsdb + pattern: "*.interval_list" + + - intervalval: + type: string + description: if an intervals file has not been spcified, the value enetered here will be used as an interval via the "-L" argument + pattern: "example: chr1:1000-10000" + + - run_intlist: + type: boolean + description: Specify whether to run get interval list mode, this option cannot be specified at the same time as run_updatewspace. + pattern: "true/false" + + - run_updatewspace: + type: boolean + description: Specify whether to run update genomicsdb mode, this option takes priority over run_intlist. + pattern: "true/false" + + - input_map: + type: boolean + description: Specify whether the vcf input is providing a list of vcf file(s) or a single file containing a map of paths to vcf files to be used to create or update a genomicsdb. + pattern: "*.sample_map" + +output: + - genomicsdb: + type: directory + description: Directory containing the files that compose the genomicsdb workspace, this is only output for create mode, as update changes an existing db + pattern: "*/$prefix" + - updatedb: + type: directory + description: Directory containing the files that compose the updated genomicsdb workspace, this is only output for update mode, and should be the same path as the input wspace. + pattern: "same/path/as/wspace" + - intervallist: + type: file + description: File containing the intervals used to generate the genomicsdb, only created by get intervals mode. + pattern: "*.interval_list" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@GCJMackenzie" diff --git a/modules/gatk4/genotypegvcfs/main.nf b/modules/gatk4/genotypegvcfs/main.nf new file mode 100644 index 00000000..50a6e188 --- /dev/null +++ b/modules/gatk4/genotypegvcfs/main.nf @@ -0,0 +1,51 @@ +process GATK4_GENOTYPEGVCFS { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" + + input: + tuple val(meta), path(gvcf), path(gvcf_index) + path fasta + path fasta_index + path fasta_dict + path dbsnp + path dbsnp_index + path intervals_bed + + output: + tuple val(meta), path("*.vcf.gz"), emit: vcf + tuple val(meta), path("*.tbi") , emit: tbi + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def dbsnp_options = dbsnp ? "-D ${dbsnp}" : "" + def interval_options = intervals_bed ? "-L ${intervals_bed}" : "" + def gvcf_options = gvcf.name.endsWith(".vcf") || gvcf.name.endsWith(".vcf.gz") ? "$gvcf" : "gendb://$gvcf" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK GenotypeGVCFs] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" \\ + GenotypeGVCFs \\ + $args \\ + $interval_options \\ + $dbsnp_options \\ + -R $fasta \\ + -V $gvcf_options \\ + -O ${prefix}.vcf.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/genotypegvcfs/meta.yml b/modules/gatk4/genotypegvcfs/meta.yml new file mode 100644 index 00000000..e6b38863 --- /dev/null +++ b/modules/gatk4/genotypegvcfs/meta.yml @@ -0,0 +1,73 @@ +name: gatk4_genotypegvcfs +description: | + Perform joint genotyping on one or more samples pre-called with HaplotypeCaller. +keywords: + - joint genotyping + - genotype + - gvcf +tools: + - gatk4: + description: Genome Analysis Toolkit (GATK4) + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s + tool_dev_url: https://github.com/broadinstitute/gatk + doi: "10.1158/1538-7445.AM2017-3590" + licence: ['BSD-3-clause'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - gvcf: + type: tuple of files + description: | + Tuple of gVCF(.gz) file (first) and its index (second) or the path to a GenomicsDB (and empty) + pattern: ["*.{vcf,vcf.gz}", "*.{idx,tbi}"] + - fasta: + type: file + description: Reference fasta file + pattern: "*.fasta" + - fasta_index: + type: file + description: Reference fasta index file + pattern: "*.fai" + - fasta_dict: + type: file + description: Reference fasta sequence dict file + pattern: "*.dict" + - dbsnp: + type: file + description: dbSNP VCF file + pattern: "*.vcf.gz" + - dbsnp_index: + type: tuple of files + description: dbSNP VCF index file + pattern: "*.tbi" + - intervals_bed: + type: file + description: An intevals BED file + pattern: "*.bed" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: Genotyped VCF file + pattern: "*.vcf.gz" + - tbi: + type: file + description: Tbi index for VCF file + pattern: "*.vcf.gz" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@santiagorevale" diff --git a/modules/gatk4/getpileupsummaries/main.nf b/modules/gatk4/getpileupsummaries/main.nf new file mode 100644 index 00000000..361974e8 --- /dev/null +++ b/modules/gatk4/getpileupsummaries/main.nf @@ -0,0 +1,46 @@ +process GATK4_GETPILEUPSUMMARIES { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" + + input: + tuple val(meta), path(bam), path(bai) + path variants + path variants_tbi + path sites + + output: + tuple val(meta), path('*.pileups.table'), emit: table + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def sitesCommand = '' + + sitesCommand = sites ? " -L ${sites} " : " -L ${variants} " + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK GetPileupSummaries] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" GetPileupSummaries \\ + -I $bam \\ + -V $variants \\ + $sitesCommand \\ + -O ${prefix}.pileups.table \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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 new file mode 100644 index 00000000..0add299b --- /dev/null +++ b/modules/gatk4/getpileupsummaries/meta.yml @@ -0,0 +1,58 @@ +name: gatk4_getpileupsummaries +description: | + Summarizes counts of reads that support reference, alternate and other alleles for given sites. Results can be used with CalculateContamination. Requires a common germline variant sites file, such as from gnomAD. +keywords: + - gatk4 + - getpileupsumaries + - readcountssummary + - germlinevariantsites +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 + licence: ['Apache-2.0'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - bam: + type: file + description: BAM file to be summarised. + pattern: "*.bam" + - bai: + type: file + description: BAM file index. + pattern: "*.bam.bai" + - variants: + type: file + description: Population vcf of germline sequencing, containing allele fractions. Is also used as sites file if no separate sites file is specified. + pattern: "*.vcf.gz" + - variants_tbi: + type: file + description: Index file for the germline resource. + pattern: "*.vcf.gz.tbi" + - sites: + type: file + description: File containing specified sites to be used for the summary. If this option is not specified, variants file is used instead automatically. + pattern: "*.interval_list" + +output: + - pileup: + type: file + description: File containing the pileup summary table. + pattern: "*.pileups.table" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@GCJMackenzie" diff --git a/modules/gatk4/haplotypecaller/functions.nf b/modules/gatk4/haplotypecaller/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/haplotypecaller/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..e00f1e58 100644 --- a/modules/gatk4/haplotypecaller/main.nf +++ b/modules/gatk4/haplotypecaller/main.nf @@ -1,38 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_HAPLOTYPECALLER { 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::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" - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: - tuple val(meta), path(bam), path(bai) + tuple val(meta), path(input), path(input_index) path fasta path fai path dict + path dbsnp + path dbsnp_tbi + path interval 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def avail_mem = 3 + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def interval_option = interval ? "-L ${interval}" : "" + def dbsnp_option = dbsnp ? "-D ${dbsnp}" : "" + def avail_mem = 3 if (!task.memory) { log.info '[GATK HaplotypeCaller] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' } else { @@ -43,10 +37,16 @@ process GATK4_HAPLOTYPECALLER { --java-options "-Xmx${avail_mem}g" \\ HaplotypeCaller \\ -R $fasta \\ - -I $bam \\ + -I $input \\ + ${dbsnp_option} \\ + ${interval_option} \\ -O ${prefix}.vcf.gz \\ - $options.args + $args \\ + --tmp-dir . - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..6c9d0891 100644 --- a/modules/gatk4/haplotypecaller/meta.yml +++ b/modules/gatk4/haplotypecaller/meta.yml @@ -13,6 +13,7 @@ tools: 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 + licence: ['Apache-2.0'] input: - meta: @@ -20,14 +21,14 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bam: + - input: type: file - description: BAM file - pattern: "*.bam" - - bai: + description: BAM/CRAM file from alignment + pattern: "*.{bam,cram}" + - input_index: type: file - description: Index of BAM file - pattern: "*.bam.bai" + description: BAI/CRAI file from alignment + pattern: "*.{bai,crai}" - fasta: type: file description: The reference fasta file @@ -40,16 +41,26 @@ input: type: file description: GATK sequence dictionary pattern: "*.dict" + - dbsnp: + type: file + description: VCF file containing known sites (optional) + - dbsnp_tbi: + type: file + description: VCF index of dbsnp (optional) + - interval: + type: file + description: Bed file with the genomic regions included in the library (optional) + output: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - vcf: type: file description: Compressed VCF file @@ -61,3 +72,4 @@ output: authors: - "@suzannejin" + - "@FriederikeHanssen" diff --git a/modules/gatk4/indexfeaturefile/main.nf b/modules/gatk4/indexfeaturefile/main.nf new file mode 100644 index 00000000..cc6c663e --- /dev/null +++ b/modules/gatk4/indexfeaturefile/main.nf @@ -0,0 +1,36 @@ +process GATK4_INDEXFEATUREFILE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.0.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.0.0--0' : + 'quay.io/biocontainers/gatk4:4.2.0.0--0' }" + + input: + tuple val(meta), path(feature_file) + + output: + tuple val(meta), path("*.{tbi,idx}"), emit: index + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK IndexFeatureFile] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" \\ + IndexFeatureFile \\ + $args \\ + -I $feature_file + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/indexfeaturefile/meta.yml b/modules/gatk4/indexfeaturefile/meta.yml new file mode 100644 index 00000000..eebe6b85 --- /dev/null +++ b/modules/gatk4/indexfeaturefile/meta.yml @@ -0,0 +1,42 @@ +name: gatk4_indexfeaturefile +description: Creates an index for a feature file, e.g. VCF or BED file. +keywords: + - index + - feature +tools: + - gatk4: + description: Genome Analysis Toolkit (GATK4) + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s + tool_dev_url: https://github.com/broadinstitute/gatk + doi: "10.1158/1538-7445.AM2017-3590" + licence: ['BSD-3-clause'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - feature_file: + type: file + description: VCF/BED file + pattern: "*.{vcf,vcf.gz,bed,bed.gz}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - index: + type: file + description: Index for VCF/BED file + pattern: "*.{tbi,idx}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@santiagorevale" diff --git a/modules/gatk4/intervallisttools/functions.nf b/modules/gatk4/intervallisttools/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/intervallisttools/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..b813d844 100644 --- a/modules/gatk4/intervallisttools/main.nf +++ b/modules/gatk4/intervallisttools/main.nf @@ -1,42 +1,37 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_INTERVALLISTTOOLS { 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::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--hdfd78af_1" - } else { - container "quay.io/biocontainers/gatk4:4.2.0.0--hdfd78af_1" - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: tuple val(meta), path(interval_list) output: tuple val(meta), path("*_split/*/*.interval_list"), emit: interval_list - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK IntervalListTools] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } """ mkdir ${prefix}_split - gatk \\ + gatk --java-options "-Xmx${avail_mem}g" \\ IntervalListTools \\ -I ${interval_list} \\ -O ${prefix}_split \\ - $options.args + $args python3 <&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..9e2d994f 100644 --- a/modules/gatk4/intervallisttools/meta.yml +++ b/modules/gatk4/intervallisttools/meta.yml @@ -14,6 +14,7 @@ tools: 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 + licence: ['Apache-2.0'] input: - meta: @@ -33,10 +34,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - interval_list: type: file description: Interval list files diff --git a/modules/gatk4/learnreadorientationmodel/main.nf b/modules/gatk4/learnreadorientationmodel/main.nf new file mode 100644 index 00000000..0c2f09d2 --- /dev/null +++ b/modules/gatk4/learnreadorientationmodel/main.nf @@ -0,0 +1,40 @@ +process GATK4_LEARNREADORIENTATIONMODEL { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" + + input: + tuple val(meta), path(f1r2) + + output: + tuple val(meta), path("*.tar.gz"), emit: artifactprior + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def inputs_list = [] + f1r2.each() { a -> inputs_list.add(" -I " + a) } + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK LearnReadOrientationModel] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" \\ + LearnReadOrientationModel \\ + ${inputs_list.join(' ')} \\ + -O ${prefix}.tar.gz \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(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..4eff6939 --- /dev/null +++ b/modules/gatk4/learnreadorientationmodel/meta.yml @@ -0,0 +1,42 @@ +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 + licence: ['Apache-2.0'] + +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/modules/gatk4/markduplicates/functions.nf b/modules/gatk4/markduplicates/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/markduplicates/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..8bdb2c0a 100644 --- a/modules/gatk4/markduplicates/main.nf +++ b/modules/gatk4/markduplicates/main.nf @@ -1,44 +1,43 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_MARKDUPLICATES { 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" - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: - tuple val(meta), path(bam) + tuple val(meta), path(bams) output: tuple val(meta), path("*.bam") , emit: bam + tuple val(meta), path("*.bai") , emit: bai tuple val(meta), path("*.metrics"), emit: metrics - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def bam_list = bams.collect(){ bam -> "--INPUT ".concat(bam.toString()) }.join(" ") + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } """ - gatk MarkDuplicates \\ - --INPUT $bam \\ + gatk --java-options "-Xmx${avail_mem}g" MarkDuplicates \\ + $bam_list \\ --METRICS_FILE ${prefix}.metrics \\ --TMP_DIR . \\ - --ASSUME_SORT_ORDER coordinate \\ --CREATE_INDEX true \\ --OUTPUT ${prefix}.bam \\ - $options.args + $args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..5777067a 100644 --- a/modules/gatk4/markduplicates/meta.yml +++ b/modules/gatk4/markduplicates/meta.yml @@ -13,7 +13,7 @@ tools: documentation: https://gatk.broadinstitute.org/hc/en-us/articles/360037052812-MarkDuplicates-Picard- tool_dev_url: https://github.com/broadinstitute/gatk doi: 10.1158/1538-7445.AM2017-3590 - licence: ['BSD-3-clause'] + licence: ['MIT'] input: - meta: @@ -32,10 +32,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bam: type: file description: Marked duplicates BAM file @@ -47,3 +47,4 @@ output: authors: - "@ajodeh-juma" + - "@FriederikeHanssen" diff --git a/modules/gatk4/mergebamalignment/functions.nf b/modules/gatk4/mergebamalignment/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/mergebamalignment/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..a0f54976 100644 --- a/modules/gatk4/mergebamalignment/main.nf +++ b/modules/gatk4/mergebamalignment/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_MERGEBAMALIGNMENT { 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" - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: tuple val(meta), path(aligned) @@ -26,19 +15,28 @@ process GATK4_MERGEBAMALIGNMENT { output: tuple val(meta), path('*.bam'), emit: bam - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK MergeBamAlignment] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } """ - gatk MergeBamAlignment \\ + gatk --java-options "-Xmx${avail_mem}g" MergeBamAlignment \\ ALIGNED=$aligned \\ UNMAPPED=$unmapped \\ R=$fasta \\ O=${prefix}.bam \\ - $options.args + $args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..c66c78db 100644 --- a/modules/gatk4/mergebamalignment/meta.yml +++ b/modules/gatk4/mergebamalignment/meta.yml @@ -12,6 +12,7 @@ tools: 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 + licence: ['Apache-2.0'] input: - meta: type: map @@ -37,9 +38,9 @@ output: type: file description: The merged bam file pattern: "*.bam" - - version: + - versions: type: file - description: File containing software version - pattern: "*.version.txt" + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/mergevcfs/functions.nf b/modules/gatk4/mergevcfs/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/mergevcfs/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 9feb8187..1fcce485 100644 --- a/modules/gatk4/mergevcfs/main.nf +++ b/modules/gatk4/mergevcfs/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_MERGEVCFS { 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::gatk4=4.1.9.0' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/gatk4:4.1.9.0--py39_0' - } else { - container 'quay.io/biocontainers/gatk4:4.1.9.0--py39_0' - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: tuple val(meta), path(vcfs) @@ -25,11 +14,11 @@ process GATK4_MERGEVCFS { output: tuple val(meta), path('*.vcf.gz'), emit: vcf - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" // Make list of VCFs to merge def input = "" @@ -37,13 +26,22 @@ process GATK4_MERGEVCFS { input += " I=${vcf}" } def ref = use_ref_dict ? "D=${ref_dict}" : "" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK MergeVcfs] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } """ - gatk MergeVcfs \\ + gatk --java-options "-Xmx${avail_mem}g" MergeVcfs \\ $input \\ O=${prefix}.vcf.gz \\ $ref \\ - $options.args + $args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..597f9ec6 100644 --- a/modules/gatk4/mergevcfs/meta.yml +++ b/modules/gatk4/mergevcfs/meta.yml @@ -12,6 +12,7 @@ tools: 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 + licence: ['Apache-2.0'] input: - meta: type: map @@ -34,9 +35,9 @@ output: type: file description: merged vcf file pattern: "*.vcf.gz" - - version: + - versions: type: file - description: File containing software version - pattern: "*.version.txt" + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/mutect2/main.nf b/modules/gatk4/mutect2/main.nf new file mode 100644 index 00000000..414c7705 --- /dev/null +++ b/modules/gatk4/mutect2/main.nf @@ -0,0 +1,76 @@ +process GATK4_MUTECT2 { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" + + input: + tuple val(meta) , path(input) , path(input_index) , val(which_norm) + val run_single + val run_pon + val run_mito + val interval_label + path fasta + path fai + path dict + path germline_resource + path germline_resource_tbi + path panel_of_normals + path panel_of_normals_tbi + + output: + tuple val(meta), path("*.vcf.gz") , emit: vcf + 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: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def panels_command = '' + def normals_command = '' + + def inputs_command = '-I ' + input.join( ' -I ') + + if(run_pon) { + panels_command = '' + normals_command = '' + + } else if(run_single) { + panels_command = " --germline-resource $germline_resource --panel-of-normals $panel_of_normals" + normals_command = '' + + } else if(run_mito){ + panels_command = "-L ${interval_label} --mitochondria-mode" + normals_command = '' + + } else { + panels_command = " --germline-resource $germline_resource --panel-of-normals $panel_of_normals --f1r2-tar-gz ${prefix}.f1r2.tar.gz" + normals_command = '-normal ' + which_norm.join( ' -normal ') + } + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK Mutect2] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" Mutect2 \\ + -R ${fasta} \\ + ${inputs_command} \\ + ${normals_command} \\ + ${panels_command} \\ + -O ${prefix}.vcf.gz \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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 new file mode 100644 index 00000000..83f6cb7c --- /dev/null +++ b/modules/gatk4/mutect2/meta.yml @@ -0,0 +1,105 @@ +name: gatk4_mutect2 +description: Call somatic SNVs and indels via local assembly of haplotypes. +keywords: + - gatk4 + - mutect2 + - haplotype + - somatic +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 + licence: ['Apache-2.0'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test'] + - input: + type: list + description: list of BAM files, also able to take CRAM as an input + pattern: "*.{bam/cram}" + - input_index: + type: list + description: list of BAM file indexes, also able to take CRAM indexes as an input + pattern: "*.{bam.bai/cram.crai}" + - which_norm: + type: list + description: optional list of sample headers contained in the normal sample bam files (these are required for tumor_normal_pair mode) + pattern: "testN" + - run_single: + type: boolean + description: Specify whether or not to run in tumor_single mode instead of tumor_normal_pair mode (will be ignored if run_pon is also true) + pattern: "true/false" + - run_pon: + type: boolean + description: Specify whether or not to run in panel_of_normal mode instead of tumor_normal_pair mode + pattern: "true/false" + - run_mito: + type: boolean + description: Specify whether or not to run in mitochondria-mode instead of tumor_normal_pair mode + pattern: "true/false" + - interval_label: + type: string + description: Specify the label used for mitochondrial chromosome when mutect2 is run in mitochondria mode. + pattern: "chrM" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "*.fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" + - germline_resource: + type: file + description: Population vcf of germline sequencing, containing allele fractions. + pattern: "*.vcf.gz" + - germline_resource_tbi: + type: file + description: Index file for the germline resource. + pattern: "*.vcf.gz.tbi" + - panel_of_normals: + type: file + description: vcf file to be used as a panel of normals. + pattern: "*.vcf.gz" + - panel_of_normals_tbi: + type: file + description: Index for the panel of normals. + pattern: "*.vcf.gz.tbi" + +output: + - vcf: + type: file + description: compressed vcf file + pattern: "*.vcf.gz" + - tbi: + type: file + description: Index of vcf file + pattern: "*vcf.gz.tbi" + - stats: + type: file + description: Stats file that pairs with output vcf file + pattern: "*vcf.gz.stats" + - f1r2: + type: file + description: file containing information to be passed to LearnReadOrientationModel (only outputted when tumor_normal_pair mode is run) + pattern: "*.f1r2.tar.gz" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@GCJMackenzie" diff --git a/modules/gatk4/revertsam/functions.nf b/modules/gatk4/revertsam/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/revertsam/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 a3bf3004..0713d7ca 100644 --- a/modules/gatk4/revertsam/main.nf +++ b/modules/gatk4/revertsam/main.nf @@ -1,39 +1,37 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_REVERTSAM { 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::gatk4=4.1.9.0' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/gatk4:4.1.9.0--py39_0' - } else { - container 'quay.io/biocontainers/gatk4:4.1.9.0--py39_0' - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: tuple val(meta), path(bam) output: tuple val(meta), path('*.bam'), emit: bam - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK RevertSam] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } """ - gatk RevertSam \\ + gatk --java-options "-Xmx${avail_mem}g" RevertSam \\ I=$bam \\ O=${prefix}.reverted.bam \\ - $options.args + $args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..b52dcb36 100644 --- a/modules/gatk4/revertsam/meta.yml +++ b/modules/gatk4/revertsam/meta.yml @@ -12,6 +12,7 @@ tools: 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 + licence: ['Apache-2.0'] input: - meta: type: map @@ -27,9 +28,9 @@ output: type: file description: The reverted bam/sam file pattern: "*.reverted.bam" - - version: + - versions: type: file - description: File containing software version - pattern: "*.version.txt" + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/samtofastq/functions.nf b/modules/gatk4/samtofastq/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/samtofastq/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 00d5d359..0afb7ef3 100644 --- a/modules/gatk4/samtofastq/main.nf +++ b/modules/gatk4/samtofastq/main.nf @@ -1,40 +1,38 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_SAMTOFASTQ { 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::gatk4=4.1.9.0' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/gatk4:4.1.9.0--py39_0' - } else { - container 'quay.io/biocontainers/gatk4:4.1.9.0--py39_0' - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: tuple val(meta), path(bam) output: tuple val(meta), path('*.fastq.gz'), emit: fastq - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def output = meta.single_end ? "FASTQ=${prefix}.fastq.gz" : "FASTQ=${prefix}_1.fastq.gz SECOND_END_FASTQ=${prefix}_2.fastq.gz" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK SamToFastq] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } """ - gatk SamToFastq \\ + gatk --java-options "-Xmx${avail_mem}g" SamToFastq \\ I=$bam \\ $output \\ - $options.args + $args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..de4624b5 100644 --- a/modules/gatk4/samtofastq/meta.yml +++ b/modules/gatk4/samtofastq/meta.yml @@ -12,6 +12,7 @@ tools: 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 + licence: ['Apache-2.0'] input: - meta: type: map @@ -27,9 +28,9 @@ output: type: file description: converted fastq file pattern: "*.fastq" - - version: + - versions: type: file - description: File containing software version - pattern: "*.version.txt" + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/splitncigarreads/functions.nf b/modules/gatk4/splitncigarreads/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/splitncigarreads/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 5c7a6ca8..6daed954 100644 --- a/modules/gatk4/splitncigarreads/main.nf +++ b/modules/gatk4/splitncigarreads/main.nf @@ -1,41 +1,41 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_SPLITNCIGARREADS { 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::gatk4=4.1.9.0' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/gatk4:4.1.9.0--py39_0' - } else { - container 'quay.io/biocontainers/gatk4:4.1.9.0--py39_0' - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: tuple val(meta), path(bam) - tuple path(fasta), path(fai), path(dict) + path fasta + path fai + path dict output: tuple val(meta), path('*.bam'), emit: bam - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK SplitNCigarReads] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } """ - gatk SplitNCigarReads \\ + gatk --java-options "-Xmx${avail_mem}g" SplitNCigarReads \\ -R $fasta \\ -I $bam \\ -O ${prefix}.bam \\ - $options.args + $args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..fd6edda0 100644 --- a/modules/gatk4/splitncigarreads/meta.yml +++ b/modules/gatk4/splitncigarreads/meta.yml @@ -12,6 +12,7 @@ tools: 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 + licence: ['Apache-2.0'] input: - meta: type: map @@ -23,18 +24,25 @@ input: description: BAM/SAM/CRAM file containing reads pattern: "*.{bam,sam,cram}" - fasta: - type: tuple of files - description: | - Tuple of fasta file (first), sequence dict (second) and fasta index (third) - pattern: ["*.fasta", "*.dict", "*.fai"] + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "*.fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" output: - bam: type: file description: Output file with split reads (BAM/SAM/CRAM) pattern: "*.{bam,sam,cram}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.version.txt" + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/variantfiltration/functions.nf b/modules/gatk4/variantfiltration/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gatk4/variantfiltration/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..efe245cc 100644 --- a/modules/gatk4/variantfiltration/main.nf +++ b/modules/gatk4/variantfiltration/main.nf @@ -1,44 +1,42 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GATK4_VARIANTFILTRATION { 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::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" - } + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" input: - tuple val(meta), path(vcf) + tuple val(meta), path(vcf), path(vcf_tbi) path fasta path fai path dict output: - tuple val(meta), path("*.vcf"), emit: vcf - path "*.version.txt" , emit: version - + tuple val(meta), path("*.vcf.gz"), emit: vcf + tuple val(meta), path("*.tbi") , emit: tbi + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK VariantFiltration] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.toGiga() + } """ - gatk VariantFiltration \\ + gatk --java-options "-Xmx${avail_mem}G" VariantFiltration \\ -R $fasta \\ -V $vcf \\ - -O ${prefix}.vcf \\ - $options.args + -O ${prefix}.vcf.gz \\ + $args - echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(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..71f0b8b2 100644 --- a/modules/gatk4/variantfiltration/meta.yml +++ b/modules/gatk4/variantfiltration/meta.yml @@ -12,6 +12,7 @@ tools: 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 + licence: ['Apache-2.0'] input: - meta: type: map @@ -20,8 +21,12 @@ input: e.g. [ id:'test'] - vcf: type: list - description: Input VCF file - pattern: "*.{vcf}" + description: List of VCF(.gz) files + pattern: "*.{vcf,vcf.gz}" + - vcf_tbi: + type: list + description: List of VCF file indexes + pattern: "*.{idx,tbi}" - fasta: type: file description: Fasta file of reference genome @@ -37,11 +42,15 @@ input: output: - vcf: type: file - description: filtered VCF file - pattern: "*.filtered.{vcf}" - - version: + description: Compressed VCF file + pattern: "*.vcf.gz" + - tbi: type: file - description: File containing software version - pattern: "*.version.txt" + description: Index of VCF file + pattern: "*.vcf.gz.tbi" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/gatk4/variantrecalibrator/main.nf b/modules/gatk4/variantrecalibrator/main.nf new file mode 100644 index 00000000..5641d6de --- /dev/null +++ b/modules/gatk4/variantrecalibrator/main.nf @@ -0,0 +1,62 @@ +process GATK4_VARIANTRECALIBRATOR { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.3.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.3.0--hdfd78af_0' }" + + input: + tuple val(meta), path(vcf) , path(tbi) + path fasta + path fai + path dict + val allelespecific + tuple path(resvcfs), path(restbis), val(reslabels) + val annotation + val mode + val create_rscript + + output: + tuple val(meta), path("*.recal") , emit: recal + tuple val(meta), path("*.idx") , emit: idx + tuple val(meta), path("*.tranches"), emit: tranches + tuple val(meta), path("*plots.R") , emit: plots, optional:true + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + refCommand = fasta ? "-R ${fasta} " : '' + alleleSpecificCommand = allelespecific ? '-AS' : '' + resourceCommand = '--resource:' + reslabels.join( ' --resource:') + annotationCommand = '-an ' + annotation.join( ' -an ') + modeCommand = mode ? "--mode ${mode} " : 'SNP' + rscriptCommand = create_rscript ? "--rscript-file ${prefix}.plots.R" : '' + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK VariantRecalibrator] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" VariantRecalibrator \\ + ${refCommand} \\ + -V ${vcf} \\ + ${alleleSpecificCommand} \\ + ${resourceCommand} \\ + ${annotationCommand} \\ + ${modeCommand} \\ + -O ${prefix}.recal \\ + --tranches-file ${prefix}.tranches \\ + ${rscriptCommand}\\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/gatk4/variantrecalibrator/meta.yml b/modules/gatk4/variantrecalibrator/meta.yml new file mode 100644 index 00000000..92416a58 --- /dev/null +++ b/modules/gatk4/variantrecalibrator/meta.yml @@ -0,0 +1,98 @@ +name: gatk4_variantrecalibrator +description: | + Build a recalibration model to score variant quality for filtering purposes. + It is highly recommended to follow GATK best practices when using this module, + the gaussian mixture model requires a large number of samples to be used for the + tool to produce optimal results. For example, 30 samples for exome data. For more details see + https://gatk.broadinstitute.org/hc/en-us/articles/4402736812443-Which-training-sets-arguments-should-I-use-for-running-VQSR- +keywords: + - VariantRecalibrator + - gatk4 + - recalibration_model +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' ] + - vcf: + type: file + description: input vcf file containing the variants to be recalibrated + pattern: "*.vcf.gz" + - tbi: + type: file + description: tbi file matching with -vcf + pattern: "*.vcf.gz.tbi" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" + - allelespecific: + type: boolean + description: specify whether to use allele specific annotations + pattern: "{true,false}" + - resvcfs: + type: list + description: resource files to be used as truth, training and known sites resources, this imports the files into the module, file names are specified again in the resource_labels to be called via the command. + pattern: '*/hapmap_3.3.hg38_chr21.vcf.gz' + - restbis: + type: list + description: tbis for the corresponding vcfs files to be used as truth, training and known resources. + pattern: '*/hapmap_3.3.hg38_chr21.vcf.gz.tbi' + - reslabels: + type: list + description: labels for the resource files to be used as truth, training and known sites resources, label should include an identifier,which kind of resource(s) it is, prior value and name of the file. + pattern: "hapmap,known=false,training=true,truth=true,prior=15.0 hapmap_3.3.hg38_chr21.vcf.gz" + - annotation: + type: list + description: specify which annotations should be used for calculations. + pattern: "['QD', 'MQ', 'FS', 'SOR']" + - mode: + type: string + description: specifies which recalibration mode to employ (SNP is default, BOTH is intended for testing only) + pattern: "{SNP,INDEL,BOTH}" + - rscript: + type: boolean + description: specify whether to generate rscript.plot output file + pattern: "{true,false}" +output: + - recal: + type: file + description: Output recal file used by ApplyVQSR + pattern: "*.recal" + - idx: + type: file + description: Index file for the recal output file + pattern: "*.idx" + - tranches: + type: file + description: Output tranches file used by ApplyVQSR + pattern: "*.tranches" + - plots: + type: file + description: Optional output rscript file to aid in visualization of the input data and learned model. + pattern: "*plots.R" + - version: + type: file + description: File containing software versions + pattern: "*.versions.yml" +authors: + - "@GCJMackenzie" diff --git a/modules/genmap/index/functions.nf b/modules/genmap/index/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/genmap/index/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..943f1a31 100644 --- a/modules/genmap/index/main.nf +++ b/modules/genmap/index/main.nf @@ -1,38 +1,30 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GENMAP_INDEX { tag '$fasta' label 'process_high' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::genmap=1.3.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/genmap:1.3.0--h1b792b2_1" - } else { - container "quay.io/biocontainers/genmap:1.3.0--h1b792b2_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/genmap:1.3.0--h1b792b2_1' : + 'quay.io/biocontainers/genmap:1.3.0--h1b792b2_1' }" input: path fasta output: path "genmap" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ 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 + "${task.process}": + genmap: \$(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..2ab0910d 100644 --- a/modules/genmap/index/meta.yml +++ b/modules/genmap/index/meta.yml @@ -9,7 +9,7 @@ tools: documentation: https://github.com/cpockrandt/genmap tool_dev_url: https://github.com/cpockrandt/genmap doi: "10.1093/bioinformatics/btaa222" - licence: ['BSD'] + licence: ['BSD-3-Clause'] input: - fasta: @@ -18,10 +18,10 @@ input: pattern: "*.{fasta,fa}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - index: type: index description: Genmap index file diff --git a/modules/genmap/mappability/functions.nf b/modules/genmap/mappability/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/genmap/mappability/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..94083f14 100644 --- a/modules/genmap/mappability/main.nf +++ b/modules/genmap/mappability/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GENMAP_MAPPABILITY { tag '$fasta' 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:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::genmap=1.3.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/genmap:1.3.0--h1b792b2_1" - } else { - container "quay.io/biocontainers/genmap:1.3.0--h1b792b2_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/genmap:1.3.0--h1b792b2_1' : + 'quay.io/biocontainers/genmap:1.3.0--h1b792b2_1' }" input: path index @@ -25,17 +14,20 @@ 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: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ genmap \\ map \\ - $options.args \\ + $args \\ -I $index \\ -O mappability - echo \$(genmap --version 2>&1) | sed 's/GenMap version: //; s/SeqAn.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + genmap: \$(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..d2835d92 100644 --- a/modules/genmap/mappability/meta.yml +++ b/modules/genmap/mappability/meta.yml @@ -9,7 +9,7 @@ tools: documentation: https://github.com/cpockrandt/genmap tool_dev_url: https://github.com/cpockrandt/genmap doi: "10.1093/bioinformatics/btaa222" - licence: ['BSD'] + licence: ['BSD-3-Clause'] input: - fasta: @@ -21,10 +21,10 @@ input: description: index file output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - wig: type: file description: genmap wig mappability file diff --git a/modules/genrich/main.nf b/modules/genrich/main.nf new file mode 100644 index 00000000..d9deea3c --- /dev/null +++ b/modules/genrich/main.nf @@ -0,0 +1,62 @@ +process GENRICH { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::genrich=0.6.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/genrich:0.6.1--h5bf99c6_1' : + 'quay.io/biocontainers/genrich:0.6.1--h5bf99c6_1' }" + + input: + tuple val(meta), path(treatment_bam) + path control_bam + path blacklist_bed + val save_pvalues + val save_pileup + val save_bed + val save_duplicates + + output: + tuple val(meta), path("*narrowPeak") , emit: peaks + tuple val(meta), path("*pvalues.bedGraph"), optional:true, emit: bedgraph_pvalues + tuple val(meta), path("*pileup.bedGraph") , optional:true, emit: bedgraph_pileup + tuple val(meta), path("*intervals.bed") , optional:true, emit: bed_intervals + tuple val(meta), path("*duplicates.txt") , optional:true, emit: duplicates + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def control = control_bam ? "-c $control_bam" : '' + def blacklist = blacklist_bed ? "-E $blacklist_bed" : "" + def pvalues = save_pvalues ? "-f ${prefix}.pvalues.bedGraph" : "" + def pileup = save_pileup ? "-k ${prefix}.pileup.bedGraph" : "" + def bed = save_bed ? "-b ${prefix}.intervals.bed" : "" + def duplicates = "" + if (save_duplicates) { + if (args.contains('-r')) { + duplicates = "-R ${prefix}.duplicates.txt" + } else { + log.info '[Genrich] Duplicates can only be saved if they are filtered, defaulting to -r option (Remove PCR duplicates).' + duplicates = "-r -R ${prefix}.duplicates.txt" + } + } + """ + Genrich \\ + -t $treatment_bam \\ + $args \\ + $control \\ + $blacklist \\ + -o ${prefix}.narrowPeak \\ + $pvalues \\ + $pileup \\ + $bed \\ + $duplicates \\ + $control + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + genrich: \$(echo \$(Genrich --version 2>&1) | sed 's/^Genrich, version //; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/genrich/meta.yml b/modules/genrich/meta.yml new file mode 100644 index 00000000..37184190 --- /dev/null +++ b/modules/genrich/meta.yml @@ -0,0 +1,80 @@ +name: genrich +description: Peak-calling for ChIP-seq and ATAC-seq enrichment experiments +keywords: + - peak-calling + - ChIP-seq + - ATAC-seq +tools: + - genrich: + description: | + Genrich is a peak-caller for genomic enrichment assays (e.g. ChIP-seq, ATAC-seq). + It analyzes alignment files generated following the assay and produces a file + detailing peaks of significant enrichment. + homepage: https://github.com/jsh58/Genrich + documentation: https://github.com/jsh58/Genrich#readme + tool_dev_url: https://github.com/jsh58/Genrich + doi: "" + licence: ['MIT'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - treatment_bam: + type: file + description: Coordinate sorted BAM/SAM file from treatment sample + pattern: "*.{bam,sam}" + - control_bam: + type: file + description: Coordinate sorted BAM/SAM file from control sample + pattern: "*.{bam,sam}" + - blacklist_bed: + type: file + description: Bed file containing genomic intervals to exclude from the analysis + pattern: "*.{bed}" + - save_pvalues: + type: boolean + description: Create bedgraph-ish file for p/q-values file + - save_pileup: + type: boolean + description: Create bedgraph-ish file for pileups and p-values + - save_bed: + type: boolean + description: Create BED file for reads/fragments/intervals + - save_duplicates: + type: boolean + description: Create PCR duplicates file (only works if -r option is set) +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - peaks: + type: file + description: Output file is in ENCODE narrowPeak format + pattern: "*.{narrowPeak}" + - bedgraph_pvalues: + type: file + description: bedGraph file containing p/q values + pattern: "*.{pvalues.bedGraph}" + - bedgraph_pileup: + type: file + description: bedGraph file containing pileups and p-values + pattern: "*.{pileup.bedGraph}" + - bed_intervals: + type: file + description: Bed file containing annotated intervals + pattern: "*.{intervals.bed}" + - duplicates: + type: file + description: Text output file containing intervals corresponding to PCR duplicates + pattern: "*.{intervals.txt}" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@JoseEspinosa" + diff --git a/modules/gffread/functions.nf b/modules/gffread/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gffread/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 6c5aecbc..e7893f8b 100644 --- a/modules/gffread/main.nf +++ b/modules/gffread/main.nf @@ -1,34 +1,30 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GFFREAD { tag "$gff" 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::gffread=0.12.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/gffread:0.12.1--h8b12597_0" - } else { - container "quay.io/biocontainers/gffread:0.12.1--h8b12597_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gffread:0.12.1--h8b12597_0' : + 'quay.io/biocontainers/gffread:0.12.1--h8b12597_0' }" input: path gff output: path "*.gtf" , emit: gtf - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${gff.baseName}" """ - gffread $gff $options.args -o ${gff.baseName}.gtf - echo \$(gffread --version 2>&1) > ${software}.version.txt + gffread \\ + $gff \\ + $args \\ + -o ${prefix}.gtf + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gffread: \$(gffread --version 2>&1) + END_VERSIONS """ } diff --git a/modules/gffread/meta.yml b/modules/gffread/meta.yml index 63d281f5..bf1a15cb 100644 --- a/modules/gffread/meta.yml +++ b/modules/gffread/meta.yml @@ -14,30 +14,20 @@ tools: licence: ['MIT'] input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - gff: type: file - description: A GFF file in either the GFF3 or GFF2 format. - patter: "*.gff" + description: A reference file in either the GFF3, GFF2 or GTF format. + pattern: "*.{gff, gtf}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - gtf: type: file description: GTF file resulting from the conversion of the GFF input file - pattern: "*.gtf" - - version: + pattern: "*.{gtf}" + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@emiller88" diff --git a/modules/glnexus/main.nf b/modules/glnexus/main.nf new file mode 100644 index 00000000..b8afca22 --- /dev/null +++ b/modules/glnexus/main.nf @@ -0,0 +1,42 @@ +process GLNEXUS { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::glnexus=1.4.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/glnexus:1.4.1--h40d77a6_0' : + 'quay.io/biocontainers/glnexus:1.4.1--h40d77a6_0' }" + + input: + tuple val(meta), path(gvcfs) + + output: + tuple val(meta), path("*.bcf"), emit: bcf + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + // Make list of GVCFs to merge + def input = gvcfs.collect { it.toString() } + def avail_mem = 3 + if (!task.memory) { + log.info '[Glnexus] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + glnexus_cli \\ + --threads $task.cpus \\ + --mem-gbytes $avail_mem \\ + $args \\ + ${input.join(' ')} \\ + > ${prefix}.bcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + glnexus: \$( echo \$(glnexus_cli 2>&1) | head -n 1 | sed 's/^.*release v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/glnexus/meta.yml b/modules/glnexus/meta.yml new file mode 100644 index 00000000..5ba17cae --- /dev/null +++ b/modules/glnexus/meta.yml @@ -0,0 +1,36 @@ +name: glnexus +description: merge gVCF files and perform joint variant calling +keywords: + - merge + - gvcf +tools: + - glnexus: + description: scalable gVCF merging and joint variant calling for population sequencing projects. + homepage: https://github.com/dnanexus-rnd/GLnexus + documentation: https://github.com/dnanexus-rnd/GLnexus/wiki/Getting-Started + tool_dev_url: None + doi: https://doi.org/10.1101/343970 + licence: ['Apache-2.0'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - gvcfs: + type: list + description: Input genomic vcf files + pattern: "*.{gvcf,gvcf.gz,g.vcf,g.vcf.gz}" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bcf: + type: file + description: merged BCF file + pattern: "*.bcf" +authors: + - "@ramprasadn" diff --git a/modules/graphmap2/align/functions.nf b/modules/graphmap2/align/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/graphmap2/align/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..554e585b 100644 --- a/modules/graphmap2/align/main.nf +++ b/modules/graphmap2/align/main.nf @@ -1,23 +1,12 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GRAPHMAP2_ALIGN { tag "$meta.id" label 'process_medium' tag "$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::graphmap=0.6.3" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/graphmap:0.6.3--he513fc3_0" - } else { - container "quay.io/biocontainers/graphmap:0.6.3--he513fc3_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/graphmap:0.6.3--he513fc3_0' : + 'quay.io/biocontainers/graphmap:0.6.3--he513fc3_0' }" input: tuple val(meta), path(reads) @@ -26,11 +15,11 @@ process GRAPHMAP2_ALIGN { output: tuple val(meta), path("*.sam"), emit: sam - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ graphmap2 \\ align \\ @@ -39,8 +28,11 @@ process GRAPHMAP2_ALIGN { -i $index \\ -d $reads \\ -o ${prefix}.sam \\ - $options.args + $args - echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + graphmap2: \$(echo \$(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..9fb1507a 100644 --- a/modules/graphmap2/align/meta.yml +++ b/modules/graphmap2/align/meta.yml @@ -12,6 +12,7 @@ tools: A versatile pairwise aligner for genomic and spliced nucleotide sequences. homepage: https://github.com/lbcb-sci/graphmap2 documentation: https://github.com/lbcb-sci/graphmap2#graphmap2---a-highly-sensitive-and-accurate-mapper-for-long-error-prone-reads + licence: ['MIT'] input: - meta: type: map @@ -41,10 +42,10 @@ output: type: file description: Alignment in SAM format pattern: "*.sam" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@yuukiiwa" - "@drpatelh" diff --git a/modules/graphmap2/index/functions.nf b/modules/graphmap2/index/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/graphmap2/index/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..fffc7bcb 100644 --- a/modules/graphmap2/index/main.nf +++ b/modules/graphmap2/index/main.nf @@ -1,39 +1,31 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GRAPHMAP2_INDEX { 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:[:], publish_by_meta:['']) } conda (params.enable_conda ? "bioconda::graphmap=0.6.3" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/graphmap:0.6.3--he513fc3_0" - } else { - container "quay.io/biocontainers/graphmap:0.6.3--he513fc3_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/graphmap:0.6.3--he513fc3_0' : + 'quay.io/biocontainers/graphmap:0.6.3--he513fc3_0' }" input: path fasta output: path "*.gmidx" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ graphmap2 \\ align \\ -t $task.cpus \\ -I \\ - $options.args \\ + $args \\ -r $fasta - echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + graphmap2: \$(echo \$(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..92a0a3d7 100644 --- a/modules/graphmap2/index/meta.yml +++ b/modules/graphmap2/index/meta.yml @@ -10,6 +10,7 @@ tools: A versatile pairwise aligner for genomic and spliced nucleotide sequences. homepage: https://github.com/lbcb-sci/graphmap2 documentation: https://github.com/lbcb-sci/graphmap2#graphmap2---a-highly-sensitive-and-accurate-mapper-for-long-error-prone-reads + licence: ['MIT'] input: - fasta: type: file @@ -20,10 +21,10 @@ output: type: file description: Graphmap2 fasta index in gmidx format pattern: "*.gmidx" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@yuukiiwa" - "@drpatelh" diff --git a/modules/gstama/collapse/main.nf b/modules/gstama/collapse/main.nf new file mode 100644 index 00000000..1c06692d --- /dev/null +++ b/modules/gstama/collapse/main.nf @@ -0,0 +1,42 @@ +process GSTAMA_COLLAPSE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::gs-tama=1.0.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gs-tama:1.0.3--hdfd78af_0' : + 'quay.io/biocontainers/gs-tama:1.0.3--hdfd78af_0' }" + + input: + tuple val(meta), path(bam) + path fasta + + output: + tuple val(meta), path("*_collapsed.bed") , emit: bed + tuple val(meta), path("*_trans_read.bed") , emit: bed_trans_reads + tuple val(meta), path("*_local_density_error.txt"), emit: local_density_error + tuple val(meta), path("*_polya.txt") , emit: polya + tuple val(meta), path("*_read.txt") , emit: read + tuple val(meta), path("*_strand_check.txt") , emit: strand_check + tuple val(meta), path("*_trans_report.txt") , emit: trans_report + path "versions.yml" , emit: versions + + tuple val(meta), path("*_varcov.txt") , emit: varcov , optional: true + tuple val(meta), path("*_variants.txt") , emit: variants, optional: true + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + tama_collapse.py \\ + -s $bam \\ + -f $fasta \\ + -p ${prefix} \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gstama: \$( tama_collapse.py -version | grep 'tc_version_date_'|sed 's/tc_version_date_//g' ) + END_VERSIONS + """ +} diff --git a/modules/gstama/collapse/meta.yml b/modules/gstama/collapse/meta.yml new file mode 100644 index 00000000..0b26191f --- /dev/null +++ b/modules/gstama/collapse/meta.yml @@ -0,0 +1,83 @@ +name: GSTAMA_COLLAPSE +description: Collapse redundant transcript models in Iso-Seq data. +keywords: + - tama_collapse.py + - isoseq + - nanopore + - long-read + - transcriptome + - gene model + - TAMA +tools: + - tama_collapse.py: + description: Collapse similar gene model + homepage: https://github.com/sguizard/gs-tama + documentation: https://github.com/GenomeRIK/tama/wiki + tool_dev_url: https://github.com/sguizard/gs-tama + doi: 10.1186/s12864-020-07123-7 + licence: GNU GPL3 + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - bam: + type: file + description: A sorted BAM or sam file of aligned reads + pattern: "*.{bam,sam}" + - fasta: + type: file + description: A fasta file of the genome used for the mapping + pattern: "*.{fasta,fa}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bed: + type: file + description: a bed12 format file containing the final collapsed version of your transcriptome + pattern: "*.bed" + - bed_trans_reads: + type: file + description: This file uses bed12 format to show the transcript model for each read based on the mapping prior to collapsing. This only contains the reads which were accepted according to the defined thresholds. You can use this file to see if there were any strange occurrences during collapsing. It also contains the relationships between reads and collapsed transcript models. The 1st subfield in the 4th column shows the final transcript ID and the 2nd subfield in the 4th column shows the read ID. If you used no_cap mode for collapsing there may be multiple lines for a single read. This happens when a 5' degraded read can match to multiple 5' longer transcript models. + pattern: "*_trans_read.bed" + - local_density_error: + type: file + description: This file contains the log of filtering for local density error around the splice junctions ("-lde") + pattern: "*_local_density_error.txt" + - polya: + type: file + description: This file contains the reads with potential poly A truncation. + pattern: "*_polya.txt" + - read: + type: file + description: This file contains information for all mapped reads from the input SAM/BAM file. It shows both accepted and discarded reads and should match the number of mapped reads in your SAM/BAM file + pattern: "*_read.txt" + - strand_check: + type: file + description: This file shows instances where the sam flag strand information contrasted the GMAP strand information. + pattern: "*_strand_check.txt" + - trans_report: + type: file + description: This file contains collapsing information for each transcript. + pattern: "*_trans_report.txt" + - varcov: + type: file + description: This file contains the coverage information for each variant detected. + pattern: "*_varcov.txt" + - variants: + type: file + description: This file contains the variants called. Variants are only called if 5 or more reads show the variant at a specific locus. If you would like to change the threshold, please make an issue about this in the Github repo. + pattern: "*_variants.txt" + +authors: + - "@sguizard" diff --git a/modules/gstama/merge/main.nf b/modules/gstama/merge/main.nf new file mode 100644 index 00000000..53ff93e4 --- /dev/null +++ b/modules/gstama/merge/main.nf @@ -0,0 +1,36 @@ +process GSTAMA_MERGE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::gs-tama=1.0.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gs-tama:1.0.2--hdfd78af_0' : + 'quay.io/biocontainers/gs-tama:1.0.2--hdfd78af_0' }" + + input: + tuple val(meta), path(bed) + path filelist + + output: + tuple val(meta), path("*.bed") , emit: bed + tuple val(meta), path("*_gene_report.txt") , emit: gene_report + tuple val(meta), path("*_merge.txt") , emit: merge + tuple val(meta), path("*_trans_report.txt"), emit: trans_report + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + tama_merge.py \\ + -f $filelist \\ + -d merge_dup \\ + -p ${prefix} \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gstama: \$( tama_merge.py -version | head -n1 ) + END_VERSIONS + """ +} diff --git a/modules/gstama/merge/meta.yml b/modules/gstama/merge/meta.yml new file mode 100644 index 00000000..1351b864 --- /dev/null +++ b/modules/gstama/merge/meta.yml @@ -0,0 +1,60 @@ +name: gstama_merge +description: Merge multiple transcriptomes while maintaining source information. +keywords: + - gstama + - gstama/merge + - long-read + - isoseq + - nanopore + - tama + - trancriptome + - annotation +tools: + - gstama: + description: Gene-Switch Transcriptome Annotation by Modular Algorithms + homepage: https://github.com/sguizard/gs-tama + documentation: https://github.com/GenomeRIK/tama/wiki + tool_dev_url: https://github.com/sguizard/gs-tama + doi: "https://doi.org/10.1186/s12864-020-07123-7" + licence: ['GPL v3 License'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: bed12 file generated by TAMA collapse + pattern: "*.bed" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - bed: + type: file + description: This is the main merged annotation file. Transcripts are coloured according to the source support for each model. Sources are numbered based on the order supplied in the input filelist file. For example the first file named in the filelist file would have its transcripts coloured in red. If a transcript has multiple sources the colour is shown as magenta. + pattern: "*.bed" + - gene_report: + type: file + description: This contains a report of the genes from the merged file. "num_clusters" refers to the number of source transcripts that were used to make this gene model. "num_final_trans" refers to the number of transcripts in the final gene model. + pattern: "*_gene_report.txt" + - merge: + type: file + description: This contains a bed12 format file which shows the coordinates of each input transcript matched to the merged transcript ID. I used the "txt" extension even though it is a bed file just to avoid confusion with the main bed file. You can use this file to map the final merged transcript models to their pre-merged supporting transcripts. The 1st subfield in the 4th column shows the final merged transcript ID while the 2nd subfield shows the pre-merged transcript ID with source prefix. + pattern: "*_merge.txt" + - trans_report: + type: file + description: This contains the source information for each merged transcript. + pattern: "*_trans_report.txt" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@sguizard" diff --git a/modules/gtdbtk/classifywf/main.nf b/modules/gtdbtk/classifywf/main.nf new file mode 100644 index 00000000..4a4b3a01 --- /dev/null +++ b/modules/gtdbtk/classifywf/main.nf @@ -0,0 +1,74 @@ +def VERSION = '1.5.0' // Version information not provided by tool on CLI + +process GTDBTK_CLASSIFYWF { + tag "${meta.assembler}-${meta.id}" + + conda (params.enable_conda ? "bioconda::gtdbtk=1.5.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gtdbtk:1.5.0--pyhdfd78af_0' : + '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 args = task.ext.args ?: '' + 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 \\ + $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 + "${task.process}": + gtdbtk: \$(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 + "${task.process}": + gtdbtk: $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/modules/gubbins/functions.nf b/modules/gubbins/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gubbins/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 9129d14b..b4c6dc23 100644 --- a/modules/gubbins/main.nf +++ b/modules/gubbins/main.nf @@ -1,21 +1,10 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GUBBINS { 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:[:], publish_by_meta:[]) } - conda (params.enable_conda ? "bioconda::gubbins=2.4.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/gubbins:2.4.1--py38h197edbe_1" - } else { - container "quay.io/biocontainers/gubbins:2.4.1--py38h197edbe_1" - } + conda (params.enable_conda ? 'bioconda::gubbins=3.0.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gubbins:3.0.0--py39h5bf99c6_0' : + 'quay.io/biocontainers/gubbins:3.0.0--py39h5bf99c6_0' }" input: path alignment @@ -30,15 +19,18 @@ 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: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ run_gubbins.py \\ --threads $task.cpus \\ - $options.args \\ + $args \\ $alignment - echo \$(run_gubbins.py --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gubbins: \$(run_gubbins.py --version 2>&1) + END_VERSIONS """ } diff --git a/modules/gubbins/meta.yml b/modules/gubbins/meta.yml index d1410afb..f73e2bb0 100644 --- a/modules/gubbins/meta.yml +++ b/modules/gubbins/meta.yml @@ -2,6 +2,7 @@ name: gubbins description: Gubbins (Genealogies Unbiased By recomBinations In Nucleotide Sequences) is an algorithm that iteratively identifies loci containing elevated densities of base substitutions while concurrently constructing a phylogeny based on the putative point mutations outside of these regions. +licence: ['GPL-2.0-only'] keywords: - recombination - alignment @@ -16,10 +17,10 @@ input: description: fasta alignment file pattern: "*.{fasta,fas,fa,aln}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - fasta: type: file description: Filtered variant alignment in fasta format diff --git a/modules/gunc/downloaddb/main.nf b/modules/gunc/downloaddb/main.nf new file mode 100644 index 00000000..430b862b --- /dev/null +++ b/modules/gunc/downloaddb/main.nf @@ -0,0 +1,27 @@ +process GUNC_DOWNLOADDB { + tag '$db_name' + label 'process_low' + + conda (params.enable_conda ? "bioconda::gunc=1.0.5" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gunc:1.0.5--pyhdfd78af_0' : + 'quay.io/biocontainers/gunc:1.0.5--pyhdfd78af_0' }" + + input: + val db_name + + output: + path "*.dmnd" , emit: db + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + """ + gunc download_db . -db $db_name $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gunc: \$( gunc --version ) + END_VERSIONS + """ +} diff --git a/modules/gunc/downloaddb/meta.yml b/modules/gunc/downloaddb/meta.yml new file mode 100644 index 00000000..cb486da0 --- /dev/null +++ b/modules/gunc/downloaddb/meta.yml @@ -0,0 +1,36 @@ +name: gunc_downloaddb +description: Download database for GUNC detection of Chimerism and Contamination in Prokaryotic Genomes +keywords: + - download + - prokaryote + - assembly + - genome + - quality control + - chimeras +tools: + - gunc: + description: Python package for detection of chimerism and contamination in prokaryotic genomes. + homepage: https://grp-bork.embl-community.io/gunc/ + documentation: https://grp-bork.embl-community.io/gunc/ + tool_dev_url: https://github.com/grp-bork/gunc + doi: "10.1186/s13059-021-02393-0" + licence: ['GNU General Public v3 or later (GPL v3+)'] + +input: + - db_name: + type: string + description: "Which database to download. Options: progenomes or gtdb" + pattern: "progenomes|gtdb" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - db: + type: file + description: GUNC database file + pattern: "*.dmnd" + +authors: + - "@jfy133" diff --git a/modules/gunc/run/main.nf b/modules/gunc/run/main.nf new file mode 100644 index 00000000..8508c9f0 --- /dev/null +++ b/modules/gunc/run/main.nf @@ -0,0 +1,35 @@ +process GUNC_RUN { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::gunc=1.0.5" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gunc:1.0.5--pyhdfd78af_0' : + 'quay.io/biocontainers/gunc:1.0.5--pyhdfd78af_0' }" + + input: + tuple val(meta), path(fasta) + path(db) + + output: + tuple val(meta), path("*maxCSS_level.tsv") , emit: maxcss_level_tsv + tuple val(meta), path("*all_levels.tsv") , optional: true, emit: all_levels_tsv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + gunc \\ + run \\ + --input_fasta $fasta \\ + --db_file $db \\ + --threads $task.cpus \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gunc: \$( gunc --version ) + END_VERSIONS + """ +} diff --git a/modules/gunc/run/meta.yml b/modules/gunc/run/meta.yml new file mode 100644 index 00000000..1dd4a8ae --- /dev/null +++ b/modules/gunc/run/meta.yml @@ -0,0 +1,53 @@ +name: gunc_run +description: Detection of Chimerism and Contamination in Prokaryotic Genomes +keywords: + - prokaryote + - assembly + - genome + - quality control + - chimeras +tools: + - gunc: + description: Python package for detection of chimerism and contamination in prokaryotic genomes. + homepage: https://grp-bork.embl-community.io/gunc/ + documentation: https://grp-bork.embl-community.io/gunc/ + tool_dev_url: https://github.com/grp-bork/gunc + doi: "10.1186/s13059-021-02393-0" + licence: ['GNU General Public v3 or later (GPL v3+)'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: FASTA file containing contig (bins) + pattern: "*.fa" + - db: + type: file + description: GUNC database file + pattern: "*.dmnd" + +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" + - maxcss_levels_tsv: + type: file + description: Output file with scores for a taxonomic level with the highest CSS score + pattern: "*.tsv" + - all_levels_tsv: + type: file + description: Optional output file with results for each taxonomic level + pattern: "*.tsv" + +authors: + - "@jfy133" diff --git a/modules/gunzip/functions.nf b/modules/gunzip/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/gunzip/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..77a4e546 100644 --- a/modules/gunzip/main.nf +++ b/modules/gunzip/main.nf @@ -1,35 +1,31 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process GUNZIP { tag "$archive" 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 ? "conda-forge::sed=4.7" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img" - } else { - container "biocontainers/biocontainers:v1.2.0_cv1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : + 'biocontainers/biocontainers:v1.2.0_cv1' }" input: - path archive + tuple val(meta), path(archive) output: - path "$gunzip", emit: gunzip - path "*.version.txt", emit: version + tuple val(meta), path("$gunzip"), emit: gunzip + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - gunzip = archive.toString() - '.gz' + def args = task.ext.args ?: '' + gunzip = archive.toString() - '.gz' """ - gunzip -f $options.args $archive - echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//' > ${software}.version.txt + gunzip \\ + -f \\ + $args \\ + $archive + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gunzip: \$(echo \$(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..ea1f1546 100644 --- a/modules/gunzip/meta.yml +++ b/modules/gunzip/meta.yml @@ -8,7 +8,13 @@ tools: description: | gzip is a file format and a software application used for file compression and decompression. documentation: https://www.gnu.org/software/gzip/manual/gzip.html + licence: ['GPL-3.0-or-later'] input: + - meta: + type: map + description: | + Optional groovy Map containing meta information + e.g. [ id:'test', single_end:false ] - archive: type: file description: File to be compressed/uncompressed @@ -18,10 +24,11 @@ output: type: file description: Compressed/uncompressed file pattern: "*.*" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" + - "@jfy133" diff --git a/modules/hicap/main.nf b/modules/hicap/main.nf new file mode 100644 index 00000000..a96343f6 --- /dev/null +++ b/modules/hicap/main.nf @@ -0,0 +1,45 @@ +process HICAP { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::hicap=1.0.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hicap:1.0.3--py_0' : + '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, optional: true + tuple val(meta), path("*.svg"), emit: svg, optional: true + tuple val(meta), path("*.tsv"), emit: tsv, optional: true + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${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 \\ + $args \\ + --threads $task.cpus \\ + -o ./ + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hicap: \$( 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/modules/hifiasm/main.nf b/modules/hifiasm/main.nf new file mode 100644 index 00000000..208554d6 --- /dev/null +++ b/modules/hifiasm/main.nf @@ -0,0 +1,60 @@ +process HIFIASM { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::hifiasm=0.15.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hifiasm:0.15.4--h2e03b76_0' : + 'quay.io/biocontainers/hifiasm:0.15.4--h2e03b76_0' }" + + input: + tuple val(meta), path(reads) + path paternal_kmer_dump + path maternal_kmer_dump + val use_parental_kmers + + output: + tuple val(meta), path("*.r_utg.gfa") , emit: raw_unitigs + tuple val(meta), path("*.ec.bin") , emit: corrected_reads + tuple val(meta), path("*.ovlp.source.bin") , emit: source_overlaps + tuple val(meta), path("*.ovlp.reverse.bin"), emit: reverse_overlaps + tuple val(meta), path("*.p_utg.gfa") , emit: processed_unitigs, optional: true + tuple val(meta), path("*.asm.p_ctg.gfa") , emit: primary_contigs , optional: true + 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: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + if (use_parental_kmers) { + """ + hifiasm \\ + $args \\ + -o ${prefix}.asm \\ + -t $task.cpus \\ + -1 $paternal_kmer_dump \\ + -2 $maternal_kmer_dump \\ + $reads + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hifiasm: \$(hifiasm --version 2>&1) + END_VERSIONS + """ + } else { // Phasing with Hi-C data is not supported yet + """ + hifiasm \\ + $args \\ + -o ${prefix}.asm \\ + -t $task.cpus \\ + $reads + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hifiasm: \$(hifiasm --version 2>&1) + END_VERSIONS + """ + } +} diff --git a/modules/hifiasm/meta.yml b/modules/hifiasm/meta.yml new file mode 100644 index 00000000..3d4c9548 --- /dev/null +++ b/modules/hifiasm/meta.yml @@ -0,0 +1,87 @@ +name: hifiasm +description: Whole-genome assembly using PacBio HiFi reads +keywords: + - genome assembly + - haplotype resolution + - phasing + - PacBio + - HiFi + - long reads +tools: + - hifiasm: + description: Haplotype-resolved assembler for accurate HiFi reads + homepage: https://github.com/chhylp123/hifiasm + documentation: https://github.com/chhylp123/hifiasm + tool_dev_url: https://github.com/chhylp123/hifiasm + doi: "10.1038/s41592-020-01056-5" + licence: ["MIT"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: FASTQ file with PacBio HiFi reads + pattern: "*.{fastq}" + - paternal_kmer_dump: + type: file + description: Yak kmer dump file for paternal reads (can be used for haplotype resolution). It can have an arbitrary extension. + - maternal_kmer_dump: + type: file + description: Yak kmer dump file for maternal reads (can be used for haplotype resolution). It can have an arbitrary extension. + - use_parental_kmers: + type: logical + description: A flag (true or false) signalling if the module should use the paternal and maternal kmer dumps. + +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" + - raw_unitigs: + type: file + description: Raw unitigs + pattern: "*.r_utg.gfa" + - processed_unitigs: + type: file + description: Processed unitigs + pattern: "*.p_utg.gfa" + - primary_contigs: + type: file + description: Primary contigs + pattern: "*.asm.p_ctg.gfa" + - alternate_contigs: + type: file + description: Alternative contigs + pattern: "*.asm.a_ctg.gfa" + - paternal_contigs: + type: file + description: Paternal contigs + pattern: "*.hap1.p_ctg.gfa" + - maternal_contigs: + type: file + description: Maternal contigs + pattern: "*.hap2.p_ctg.gfa" + - corrected_reads: + type: file + description: Corrected reads + pattern: "*.ec.bin" + - source_overlaps: + type: file + description: Source overlaps + pattern: "*.ovlp.source.bin" + - reverse_overlaps: + type: file + description: Reverse overlaps + pattern: "*.ovlp.reverse.bin" + +authors: + - "@sidorov-si" diff --git a/modules/hisat2/align/functions.nf b/modules/hisat2/align/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/hisat2/align/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..ae888616 100644 --- a/modules/hisat2/align/main.nf +++ b/modules/hisat2/align/main.nf @@ -1,24 +1,13 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '2.2.0' +def VERSION = '2.2.0' // Version information not provided by tool on CLI process HISAT2_ALIGN { 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::hisat2=2.2.0 bioconda::samtools=1.10" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0" - } else { - container "quay.io/biocontainers/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0' : + 'quay.io/biocontainers/mulled-v2-a97e90b3b802d1da3d6958e0867610c718cb5eb1:2880dd9d8ad0a7b221d4eacda9a818e92983128d-0' }" input: tuple val(meta), path(reads) @@ -26,15 +15,14 @@ process HISAT2_ALIGN { path splicesites output: - tuple val(meta), path("*.bam"), emit: bam - tuple val(meta), path("*.log"), emit: summary - path "*.version.txt" , emit: version - + tuple val(meta), path("*.bam") , emit: bam + tuple val(meta), path("*.log") , emit: summary tuple val(meta), path("*fastq.gz"), optional:true, emit: fastq + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def strandedness = '' if (meta.strandedness == 'forward') { @@ -56,10 +44,14 @@ process HISAT2_ALIGN { --threads $task.cpus \\ $seq_center \\ $unaligned \\ - $options.args \\ + $args \\ | samtools view -bS -F 4 -F 256 - > ${prefix}.bam - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hisat2: $VERSION + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } else { def unaligned = params.save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' @@ -77,7 +69,7 @@ process HISAT2_ALIGN { $unaligned \\ --no-mixed \\ --no-discordant \\ - $options.args \\ + $args \\ | samtools view -bS -F 4 -F 8 -F 256 - > ${prefix}.bam if [ -f ${prefix}.unmapped.fastq.1.gz ]; then @@ -87,7 +79,11 @@ 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 + "${task.process}": + hisat2: $VERSION + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS """ } } diff --git a/modules/hisat2/align/meta.yml b/modules/hisat2/align/meta.yml index bf5570fd..6011cc34 100644 --- a/modules/hisat2/align/meta.yml +++ b/modules/hisat2/align/meta.yml @@ -48,10 +48,10 @@ output: type: file description: Aligment log pattern: "*.log" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@ntoda03" diff --git a/modules/hisat2/build/functions.nf b/modules/hisat2/build/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/hisat2/build/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 ce8bfb26..4e8cd02b 100644 --- a/modules/hisat2/build/main.nf +++ b/modules/hisat2/build/main.nf @@ -1,25 +1,14 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '2.2.0' +def VERSION = '2.2.0' // Version information not provided by tool on CLI process HISAT2_BUILD { tag "$fasta" label 'process_high' label 'process_high_memory' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) } - conda (params.enable_conda ? "bioconda::hisat2=2.2.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4" - } else { - container "quay.io/biocontainers/hisat2:2.2.0--py37hfa133b6_4" - } + conda (params.enable_conda ? 'bioconda::hisat2=2.2.1' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hisat2:2.2.1--h1b792b2_3' : + 'quay.io/biocontainers/hisat2:2.2.1--h1b792b2_3' }" input: path fasta @@ -28,9 +17,10 @@ process HISAT2_BUILD { output: path "hisat2" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: + def args = task.ext.args ?: '' def avail_mem = 0 if (!task.memory) { log.info "[HISAT2 index build] Available memory not known - defaulting to 0. Specify process memory requirements to change this." @@ -52,8 +42,6 @@ process HISAT2_BUILD { log.info "[HISAT2 index build] Less than ${hisat2_build_memory} GB available, so NOT using splice sites and exons to build HISAT2 index." log.info "[HISAT2 index build] Use --hisat2_build_memory [small number] to skip this check." } - - def software = getSoftwareName(task.process) """ mkdir hisat2 $extract_exons @@ -61,10 +49,13 @@ process HISAT2_BUILD { -p $task.cpus \\ $ss \\ $exon \\ - $options.args \\ + $args \\ $fasta \\ hisat2/${fasta.baseName} - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hisat2: $VERSION + END_VERSIONS """ } diff --git a/modules/hisat2/build/meta.yml b/modules/hisat2/build/meta.yml index 2f34d9d8..c08b296d 100644 --- a/modules/hisat2/build/meta.yml +++ b/modules/hisat2/build/meta.yml @@ -29,10 +29,10 @@ input: pattern: "*.{txt}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/hisat2/extractsplicesites/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 57f4dedb..302c35f1 100644 --- a/modules/hisat2/extractsplicesites/main.nf +++ b/modules/hisat2/extractsplicesites/main.nf @@ -1,36 +1,28 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '2.2.0' +def VERSION = '2.2.0' // Version information not provided by tool on CLI process HISAT2_EXTRACTSPLICESITES { tag "$gtf" 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:[:], publish_by_meta:[]) } - conda (params.enable_conda ? "bioconda::hisat2=2.2.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/hisat2:2.2.0--py37hfa133b6_4" - } else { - container "quay.io/biocontainers/hisat2:2.2.0--py37hfa133b6_4" - } + conda (params.enable_conda ? 'bioconda::hisat2=2.2.1' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hisat2:2.2.1--h1b792b2_3' : + 'quay.io/biocontainers/hisat2:2.2.1--h1b792b2_3' }" input: path gtf output: path "*.splice_sites.txt", emit: txt - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ hisat2_extract_splice_sites.py $gtf > ${gtf.baseName}.splice_sites.txt - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hisat2: $VERSION + END_VERSIONS """ } diff --git a/modules/hisat2/extractsplicesites/meta.yml b/modules/hisat2/extractsplicesites/meta.yml index 228138a8..97227faf 100644 --- a/modules/hisat2/extractsplicesites/meta.yml +++ b/modules/hisat2/extractsplicesites/meta.yml @@ -21,10 +21,10 @@ input: pattern: "*.{gtf}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - splicesites: type: file description: Splices sites in gtf file diff --git a/modules/hmmcopy/gccounter/main.nf b/modules/hmmcopy/gccounter/main.nf new file mode 100644 index 00000000..a1de8b97 --- /dev/null +++ b/modules/hmmcopy/gccounter/main.nf @@ -0,0 +1,30 @@ +def VERSION = '0.1.1' // Version information not provided by tool on CLI + +process HMMCOPY_GCCOUNTER { + label 'process_low' + + conda (params.enable_conda ? "bioconda::hmmcopy=0.1.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hmmcopy:0.1.1--h2e03b76_7' : + 'quay.io/biocontainers/hmmcopy:0.1.1--h2e03b76_7' }" + + input: + path fasta + + output: + path "*.gc.wig" , emit: wig + path "versions.yml", emit: versions + + script: + def args = task.ext.args ?: '' + """ + gcCounter \\ + $args \\ + ${fasta} > ${fasta.baseName}.gc.wig + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hmmcopy: $VERSION + END_VERSIONS + """ +} diff --git a/modules/hmmcopy/gccounter/meta.yml b/modules/hmmcopy/gccounter/meta.yml new file mode 100644 index 00000000..71727af2 --- /dev/null +++ b/modules/hmmcopy/gccounter/meta.yml @@ -0,0 +1,33 @@ +name: hmmcopy_gccounter +description: gcCounter function from HMMcopy utilities, used to generate GC content in non-overlapping windows from a fasta reference +keywords: + - hmmcopy + - gccounter + - cnv +tools: + - hmmcopy: + description: C++ based programs for analyzing BAM files and preparing read counts -- used with bioconductor-hmmcopy + homepage: https://github.com/shahcompbio/hmmcopy_utils + documentation: https://github.com/shahcompbio/hmmcopy_utils + tool_dev_url: https://github.com/shahcompbio/hmmcopy_utils + doi: "" + licence: ['GPL v3'] + +input: + - fasta: + type: file + description: Input genome fasta file + + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - wig: + type: file + description: wig file containing gc content of each window of the genome + pattern: "*.{gc.wig}" + +authors: + - "@sppearce" diff --git a/modules/hmmcopy/generatemap/main.nf b/modules/hmmcopy/generatemap/main.nf new file mode 100644 index 00000000..1d248853 --- /dev/null +++ b/modules/hmmcopy/generatemap/main.nf @@ -0,0 +1,38 @@ +def VERSION = '0.1.1' + +process HMMCOPY_GENERATEMAP { + tag '$bam' + label 'process_long' + + conda (params.enable_conda ? "bioconda::hmmcopy=0.1.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hmmcopy:0.1.1--h2e03b76_7': + 'quay.io/biocontainers/hmmcopy:0.1.1--h2e03b76_7' }" + + input: + path fasta + + output: + path "*.map.bw" , emit: bigwig + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + + """ + # build required indexes + generateMap.pl -b \\ + $args \\ + $fasta + + # run + generateMap.pl \\ + $args \\ + $fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hmmcopy: \$(echo $VERSION) + END_VERSIONS + """ +} diff --git a/modules/hmmcopy/generatemap/meta.yml b/modules/hmmcopy/generatemap/meta.yml new file mode 100644 index 00000000..ca43c6ce --- /dev/null +++ b/modules/hmmcopy/generatemap/meta.yml @@ -0,0 +1,32 @@ +name: hmmcopy_generatemap +description: Perl script (generateMap.pl) generates the mappability of a genome given a certain size of reads, for input to hmmcopy mapcounter. Takes a very long time on large genomes, is not parallelised at all. +keywords: + - hmmcopy + - mapcounter + - mappability +tools: + - hmmcopy: + description: C++ based programs for analyzing BAM files and preparing read counts -- used with bioconductor-hmmcopy + homepage: https://github.com/shahcompbio/hmmcopy_utils + documentation: https://github.com/shahcompbio/hmmcopy_utils + tool_dev_url: https://github.com/shahcompbio/hmmcopy_utils + doi: "" + licence: ['GPL v3'] + +input: + - fasta: + type: file + description: Input genome fasta file + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bigwig: + type: file + description: bigwig file containing the mappability of the genome + pattern: "*.{map.bw}" + +authors: + - "@sppearce" diff --git a/modules/hmmcopy/mapcounter/main.nf b/modules/hmmcopy/mapcounter/main.nf new file mode 100644 index 00000000..ab20868e --- /dev/null +++ b/modules/hmmcopy/mapcounter/main.nf @@ -0,0 +1,31 @@ +def VERSION = '0.1.1' // Version information not provided by tool on CLI + +process HMMCOPY_MAPCOUNTER { + label 'process_medium' + + conda (params.enable_conda ? "bioconda::hmmcopy=0.1.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hmmcopy:0.1.1--h2e03b76_7': + 'quay.io/biocontainers/hmmcopy:0.1.1--h2e03b76_7' }" + + input: + path bigwig + + output: + path "*.map.wig" , emit: wig + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + + """ + mapCounter \\ + $args \\ + $bigwig > ${bigwig.baseName}.map.wig + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hmmcopy: \$(echo $VERSION) + END_VERSIONS + """ +} diff --git a/modules/hmmcopy/mapcounter/meta.yml b/modules/hmmcopy/mapcounter/meta.yml new file mode 100644 index 00000000..8f8b9aae --- /dev/null +++ b/modules/hmmcopy/mapcounter/meta.yml @@ -0,0 +1,34 @@ +name: hmmcopy_mapcounter +description: mapCounter function from HMMcopy utilities, used to generate mappability in non-overlapping windows from a bigwig file +keywords: + - hmmcopy + - mapcounter + - cnv +tools: + - hmmcopy: + description: C++ based programs for analyzing BAM files and preparing read counts -- used with bioconductor-hmmcopy + homepage: https://github.com/shahcompbio/hmmcopy_utils + documentation: https://github.com/shahcompbio/hmmcopy_utils + tool_dev_url: https://github.com/shahcompbio/hmmcopy_utils + doi: "" + licence: ['GPL v3'] + +input: + - bigwig: + type: file + description: BigWig file with the mappability score of the genome, for instance made with generateMap function. + pattern: "*.wig" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + + - wig: + type: file + description: wig file containing mappability of each window of the genome + pattern: "*.map.wig" + +authors: + - "@sppearce" diff --git a/modules/hmmcopy/readcounter/main.nf b/modules/hmmcopy/readcounter/main.nf new file mode 100644 index 00000000..a6e89f91 --- /dev/null +++ b/modules/hmmcopy/readcounter/main.nf @@ -0,0 +1,32 @@ +def VERSION = '0.1.1' // Version information not provided by tool on CLI + +process HMMCOPY_READCOUNTER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::hmmcopy=0.1.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hmmcopy:0.1.1--h2e03b76_7' : + 'quay.io/biocontainers/hmmcopy:0.1.1--h2e03b76_7' }" + + input: + tuple val(meta), path(bam), path(bai) + + output: + tuple val(meta), path("*.wig"), emit: wig + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + readCounter \\ + $args \\ + ${bam} > ${prefix}.wig + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + hmmcopy: $VERSION + END_VERSIONS + """ +} diff --git a/modules/hmmcopy/readcounter/meta.yml b/modules/hmmcopy/readcounter/meta.yml new file mode 100644 index 00000000..9b09a55c --- /dev/null +++ b/modules/hmmcopy/readcounter/meta.yml @@ -0,0 +1,43 @@ +name: hmmcopy_readcounter +description: readCounter function from HMMcopy utilities, used to generate read in windows +keywords: + - hmmcopy + - readcounter + - cnv +tools: + - hmmcopy: + description: C++ based programs for analyzing BAM files and preparing read counts -- used with bioconductor-hmmcopy + homepage: https://github.com/shahcompbio/hmmcopy_utils + documentation: https://github.com/shahcompbio/hmmcopy_utils + tool_dev_url: https://github.com/shahcompbio/hmmcopy_utils + doi: "" + 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/SAM file + pattern: "*.{bam,cram,sam}" + +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" + - wig: + type: file + description: A wig file with the number of reads lying within each window in each chromosome + pattern: "*.wig" + +authors: + - "@sppearce" diff --git a/modules/hmmer/hmmalign/functions.nf b/modules/hmmer/hmmalign/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/hmmer/hmmalign/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..e6d04044 100644 --- a/modules/hmmer/hmmalign/main.nf +++ b/modules/hmmer/hmmalign/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process HMMER_HMMALIGN { 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::hmmer=3.3.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/hmmer:3.3.2--h1b792b2_1" - } else { - container "quay.io/biocontainers/hmmer:3.3.2--h1b792b2_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hmmer:3.3.2--h1b792b2_1' : + 'quay.io/biocontainers/hmmer:3.3.2--h1b792b2_1' }" input: tuple val(meta), path(fasta) @@ -24,19 +13,22 @@ process HMMER_HMMALIGN { output: tuple val(meta), path("*.sthlm.gz"), emit: sthlm - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def fastacmd = fasta.getExtension() == 'gz' ? "gunzip -c $fasta" : "cat $fasta" """ $fastacmd | \\ hmmalign \\ - $options.args \\ + $args \\ $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 + "${task.process}": + hmmer: \$(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..58dc6b92 100644 --- a/modules/hmmer/hmmalign/meta.yml +++ b/modules/hmmer/hmmalign/meta.yml @@ -9,7 +9,7 @@ tools: documentation: http://hmmer.org/documentation.html tool_dev_url: None doi: "http://dx.doi.org/10.1371/journal.pcbi.1002195" - licence: ['BSD'] + licence: ['BSD-3-Clause'] input: - meta: @@ -32,10 +32,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/homer/annotatepeaks/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..84e0241a 100644 --- a/modules/homer/annotatepeaks/main.nf +++ b/modules/homer/annotatepeaks/main.nf @@ -1,24 +1,13 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '4.11' +def VERSION = '4.11' // Version information not provided by tool on CLI process HOMER_ANNOTATEPEAKS { 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::homer=4.11" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/homer:4.11--pl526hc9558a2_3" - } else { - container "quay.io/biocontainers/homer:4.11--pl526hc9558a2_3" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/homer:4.11--pl526hc9558a2_3' : + 'quay.io/biocontainers/homer:4.11--pl526hc9558a2_3' }" input: tuple val(meta), path(peak) @@ -27,20 +16,23 @@ process HOMER_ANNOTATEPEAKS { output: tuple val(meta), path("*annotatePeaks.txt"), emit: txt - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ annotatePeaks.pl \\ $peak \\ $fasta \\ - $options.args \\ + $args \\ -gtf $gtf \\ -cpu $task.cpus \\ > ${prefix}.annotatePeaks.txt - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + homer: $VERSION + END_VERSIONS """ } diff --git a/modules/homer/annotatepeaks/meta.yml b/modules/homer/annotatepeaks/meta.yml index d620e875..c3ab9460 100644 --- a/modules/homer/annotatepeaks/meta.yml +++ b/modules/homer/annotatepeaks/meta.yml @@ -1,15 +1,16 @@ name: homer_annotatepeaks -description: Annotate peaks with homer +description: Annotate peaks with HOMER suite keywords: - annotations - peaks - bed tools: - - cuatadapt: + - homer: description: | HOMER (Hypergeometric Optimization of Motif EnRichment) is a suite of tools for Motif Discovery and next-gen sequencing analysis. documentation: http://homer.ucsd.edu/homer/ doi: 10.1016/j.molcel.2010.05.004. + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -38,10 +39,10 @@ output: type: file description: The annotated peaks pattern: "*annotatePeaks.txt" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/homer/findpeaks/main.nf b/modules/homer/findpeaks/main.nf new file mode 100644 index 00000000..66de06b6 --- /dev/null +++ b/modules/homer/findpeaks/main.nf @@ -0,0 +1,34 @@ +def VERSION = '4.11' // Version information not provided by tool on CLI + +process HOMER_FINDPEAKS { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::homer=4.11=pl526hc9558a2_3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/homer:4.11--pl526hc9558a2_3' : + 'quay.io/biocontainers/homer:4.11--pl526hc9558a2_3' }" + + input: + tuple val(meta), path(tagDir) + + output: + tuple val(meta), path("*peaks.txt"), emit: txt + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + + findPeaks \\ + $tagDir \\ + $args \\ + -o ${prefix}.peaks.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + homer: $VERSION + END_VERSIONS + """ +} diff --git a/modules/homer/findpeaks/meta.yml b/modules/homer/findpeaks/meta.yml new file mode 100644 index 00000000..2aa8db26 --- /dev/null +++ b/modules/homer/findpeaks/meta.yml @@ -0,0 +1,38 @@ +name: homer_findpeaks +description: Find peaks with HOMER suite +keywords: + - annotations + - peaks +tools: + - homer: + description: | + HOMER (Hypergeometric Optimization of Motif EnRichment) is a suite of tools for Motif Discovery and next-gen sequencing analysis. + documentation: http://homer.ucsd.edu/homer/ + doi: 10.1016/j.molcel.2010.05.004. + licence: ['GPL-3.0-or-later'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - tagDir: + type: directory + description: "The 'Tag Directory'" + pattern: "tagDir" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - peaks: + type: file + description: The found peaks + pattern: "*peaks.txt" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@EMiller88" diff --git a/modules/homer/maketagdirectory/main.nf b/modules/homer/maketagdirectory/main.nf new file mode 100644 index 00000000..72e2091f --- /dev/null +++ b/modules/homer/maketagdirectory/main.nf @@ -0,0 +1,35 @@ +def VERSION = '4.11' // Version information not provided by tool on CLI + +process HOMER_MAKETAGDIRECTORY { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::homer=4.11=pl526hc9558a2_3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/homer:4.11--pl526hc9558a2_3' : + 'quay.io/biocontainers/homer:4.11--pl526hc9558a2_3' }" + + input: + tuple val(meta), path(bed) + path fasta + + output: + tuple val(meta), path("tag_dir"), emit: tagdir + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + makeTagDirectory \\ + tag_dir \\ + $args \\ + $bed \\ + -genome $fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + homer: $VERSION + END_VERSIONS + """ +} diff --git a/modules/homer/maketagdirectory/meta.yml b/modules/homer/maketagdirectory/meta.yml new file mode 100644 index 00000000..802320f9 --- /dev/null +++ b/modules/homer/maketagdirectory/meta.yml @@ -0,0 +1,42 @@ +name: homer_maketagdirectory +description: Create a tag directory with the HOMER suite +keywords: + - peaks + - bed +tools: + - homer: + description: | + HOMER (Hypergeometric Optimization of Motif EnRichment) is a suite of tools for Motif Discovery and next-gen sequencing analysis. + documentation: http://homer.ucsd.edu/homer/ + doi: 10.1016/j.molcel.2010.05.004. + licence: ['GPL-3.0-or-later'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: The peak files in bed format + pattern: "*.bed" + - fasta: + type: file + description: Fasta file of reference genome + pattern: "*.fasta" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - tag_dir: + type: directory + description: The "Tag Directory" + pattern: "tag_dir" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@EMiller88" diff --git a/modules/homer/makeucscfile/main.nf b/modules/homer/makeucscfile/main.nf new file mode 100644 index 00000000..17e86947 --- /dev/null +++ b/modules/homer/makeucscfile/main.nf @@ -0,0 +1,33 @@ +def VERSION = '4.11' // Version information not provided by tool on CLI + +process HOMER_MAKEUCSCFILE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::homer=4.11=pl526hc9558a2_3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/homer:4.11--pl526hc9558a2_3' : + 'quay.io/biocontainers/homer:4.11--pl526hc9558a2_3' }" + + input: + tuple val(meta), path(tagDir) + + output: + tuple val(meta), path("tag_dir/*ucsc.bedGraph.gz"), emit: bedGraph + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + makeUCSCfile \\ + $tagDir \\ + -o auto \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + homer: $VERSION + END_VERSIONS + """ +} diff --git a/modules/homer/makeucscfile/meta.yml b/modules/homer/makeucscfile/meta.yml new file mode 100644 index 00000000..68d5fcd4 --- /dev/null +++ b/modules/homer/makeucscfile/meta.yml @@ -0,0 +1,39 @@ +name: homer_makeucscfile +description: Create a UCSC bed graph with the HOMER suite +keywords: + - peaks + - bed + - bedGraph +tools: + - homer: + description: | + HOMER (Hypergeometric Optimization of Motif EnRichment) is a suite of tools for Motif Discovery and next-gen sequencing analysis. + documentation: http://homer.ucsd.edu/homer/ + doi: 10.1016/j.molcel.2010.05.004. + licence: ['GPL-3.0-or-later'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - tagDir: + type: directory + description: "The 'Tag Directory'" + pattern: "tagDir" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bedGraph: + type: file + description: The UCSC bed graph + pattern: "tag_dir/*ucsc.bedGraph.gz" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@EMiller88" diff --git a/modules/idr/main.nf b/modules/idr/main.nf new file mode 100644 index 00000000..44b07be4 --- /dev/null +++ b/modules/idr/main.nf @@ -0,0 +1,46 @@ +process IDR { + tag "$prefix" + label 'process_low' + + conda (params.enable_conda ? "bioconda::idr=2.0.4.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/idr:2.0.4.2--py39hcbe4a3b_5' : + 'quay.io/biocontainers/idr:2.0.4.2--py38h9af456f_5' }" + + input: + path peaks + val peak_type + val prefix + + output: + path "*idrValues.txt", emit: idr + path "*log.txt" , emit: log + path "*.png" , emit: png + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + if (peaks.toList().size < 2) { + log.error "[ERROR] idr needs at least two replicates only one provided." + } + def peak_types = ['narrowPeak', 'broadPeak', 'bed'] + if (!peak_types.contains(peak_type)) { + log.error "[ERROR] Invalid option: '${peak_type}'. Valid options for 'peak_type': ${peak_types.join(', ')}." + } + def idr_vals = prefix ? "${prefix}.idrValues.txt" : "idrValues.txt" + def log_file = prefix ? "${prefix}.log.txt" : "log.txt" + """ + idr \\ + --samples $peaks \\ + --input-file-type $peak_type \\ + --output-file $idr_vals \\ + --log-output-file $log_file \\ + --plot \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + idr: \$(echo \$(idr --version 2>&1) | sed 's/^.*IDR //; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/idr/meta.yml b/modules/idr/meta.yml new file mode 100644 index 00000000..c89e72a4 --- /dev/null +++ b/modules/idr/meta.yml @@ -0,0 +1,53 @@ +name: idr +description: | + Measures reproducibility of ChIP-seq, ATAC-seq peaks using IDR (Irreproducible + Discovery Rate) +keywords: + - IDR + - peaks + - ChIP-seq + - ATAC-seq +tools: + - idr: + description: | + The IDR (Irreproducible Discovery Rate) framework is a unified approach + to measure the reproducibility of findings identified from replicate + experiments and provide highly stable thresholds based on reproducibility. + homepage: None + documentation: None + tool_dev_url: https://github.com/kundajelab/idr + doi: "" + licence: ['GPL v2'] +input: + - peaks: + type: tuple of two files + description: BED, narrowPeak or broadPeak files of replicates + pattern: "*" + - peak_type: + type: value + description: Type of peak file + pattern: "{narrowPeak,broadPeak,bed}" + - prefix: + type: value + description: Prefix for output files +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - idr: + type: file + description: Text file containing IDR values + pattern: "*.{txt}" + - log: + type: file + description: Log file + pattern: "*.{txt}" + - png: + type: file + description: Plot generated by idr + pattern: "*{.png}" + +authors: + - "@drpatelh" + - "@joseespinosa" diff --git a/modules/imputeme/vcftoprs/main.nf b/modules/imputeme/vcftoprs/main.nf new file mode 100644 index 00000000..5fee90c2 --- /dev/null +++ b/modules/imputeme/vcftoprs/main.nf @@ -0,0 +1,49 @@ +process IMPUTEME_VCFTOPRS { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "YOUR-TOOL-HERE" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://containers.biocontainers.pro/s3/SingImgsRepo/imputeme/vv1.0.7_cv1/imputeme_vv1.0.7_cv1.img' : + 'biocontainers/imputeme:vv1.0.7_cv1' }" + + input: + tuple val(meta), path(vcf) + + output: + tuple val(meta), path("*.json"), emit: json + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + #!/usr/bin/env Rscript + + #Set configuration - either from args or from defaults + source("/imputeme/code/impute-me/functions.R") + if(file.exists('$args')){ + set_conf("set_from_file",'$args') + }else{ + set_conf("set_from_file", "/imputeme/code/impute-me/template/nextflow_default_configuration.R") + } + + #main run + return_message <- prepare_individual_genome('$vcf',overrule_vcf_checks=T) + uniqueID <- sub(' .+\$','',sub('^.+this run is ','',return_message)) + convert_vcfs_to_simple_format(uniqueID=uniqueID) + crawl_for_snps_to_analyze(uniqueIDs=uniqueID) + run_export_script(uniqueIDs=uniqueID) + file.copy(paste0("./",uniqueID,"/",uniqueID,"_data.json"),"output.json") + + #version export. Have to hardcode process name and software name because + #won't run inside an R-block + version_file_path="versions.yml" + f <- file(version_file_path,"w") + writeLines("IMPUTEME_VCFTOPRS:", f) + writeLines(paste0(" imputeme: ", sub("^v","",get_conf("version"))),f) + close(f) + + """ + +} diff --git a/modules/imputeme/vcftoprs/meta.yml b/modules/imputeme/vcftoprs/meta.yml new file mode 100644 index 00000000..8ba5dfe1 --- /dev/null +++ b/modules/imputeme/vcftoprs/meta.yml @@ -0,0 +1,41 @@ +name: imputeme_vcftoprs +description: inputs a VCF-file with whole genome DNA sequencing. Outputs a JSON with polygenic risk scores. +keywords: + - PRS, VCF +tools: + - imputeme: + description: + homepage: www.impute.me + documentation: https://hub.docker.com/repository/docker/lassefolkersen/impute-me + tool_dev_url: https://github.com/lassefolkersen/impute-me + doi: "https://doi.org/10.3389/fgene.2020.00578" + licence: LGPL3 + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ vcf:'test', single_end:false ] + - vcf: + type: file + description: vcf file + pattern: "*.{vcf}" + +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" + - json: + type: file + description: json containing Z-scores for all calculated PRS + pattern: "*.{json}" + +authors: + - "@lassefolkersen" diff --git a/modules/iqtree/functions.nf b/modules/iqtree/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/iqtree/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 1eeb3a2a..54a6486d 100644 --- a/modules/iqtree/main.nf +++ b/modules/iqtree/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process IQTREE { tag "$alignment" 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:[:], publish_by_meta:[]) } - conda (params.enable_conda ? "bioconda::iqtree=2.1.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/iqtree:2.1.2--h56fc30b_0" - } else { - container "quay.io/biocontainers/iqtree:2.1.2--h56fc30b_0" - } + conda (params.enable_conda ? 'bioconda::iqtree=2.1.4_beta' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/iqtree:2.1.4_beta--hdcc8f71_0' : + 'quay.io/biocontainers/iqtree:2.1.4_beta--hdcc8f71_0' }" input: path alignment @@ -24,21 +13,24 @@ process IQTREE { output: path "*.treefile", emit: phylogeny - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' def fconst_args = constant_sites ? "-fconst $constant_sites" : '' def memory = task.memory.toString().replaceAll(' ', '') """ iqtree \\ $fconst_args \\ - $options.args \\ + $args \\ -s $alignment \\ -nt AUTO \\ -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 + "${task.process}": + iqtree: \$(echo \$(iqtree -version 2>&1) | sed 's/^IQ-TREE multicore version //;s/ .*//') + END_VERSIONS """ } diff --git a/modules/iqtree/meta.yml b/modules/iqtree/meta.yml index 19f81b15..0a3b4e4c 100644 --- a/modules/iqtree/meta.yml +++ b/modules/iqtree/meta.yml @@ -20,10 +20,10 @@ input: pattern: "*.{fasta,fas,fa,mfa}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - phylogeny: type: file description: A phylogeny in Newick format diff --git a/modules/ismapper/main.nf b/modules/ismapper/main.nf new file mode 100644 index 00000000..a51cc01e --- /dev/null +++ b/modules/ismapper/main.nf @@ -0,0 +1,34 @@ +process ISMAPPER { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::ismapper=2.0.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ismapper:2.0.2--pyhdfd78af_1' : + '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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + ismap \\ + $args \\ + --t $task.cpus \\ + --output_dir results \\ + --queries $query \\ + --reference $reference \\ + --reads $reads + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ismapper: \$( 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..810c1674 --- /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-3-Clause'] + +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/modules/isoseq3/cluster/main.nf b/modules/isoseq3/cluster/main.nf new file mode 100644 index 00000000..fdd47971 --- /dev/null +++ b/modules/isoseq3/cluster/main.nf @@ -0,0 +1,42 @@ +process ISOSEQ3_CLUSTER { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::isoseq3=3.4.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/isoseq3:3.4.0--0' : + 'quay.io/biocontainers/isoseq3:3.4.0--0' }" + + input: + tuple val(meta), path(bam) + + output: + 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 + 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 + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + isoseq3 \\ + cluster \\ + $bam \\ + ${prefix}.transcripts.bam \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + isoseq3: \$( 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..4086ab05 --- /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: "*.transcripts.bam" + - pbi: + type: file + description: Pacbio Index of consensus reads generated by clustering + pattern: "*.transcripts.bam.pbi" + - cluster: + type: file + description: A two columns (from, to) file describing original read name to new read name + pattern: "*.transcripts.cluster" + - cluster_report: + type: file + description: A table files clusters (transcripts) members (read) + pattern: "*.transcripts.cluster_report.csv" + - transcriptset: + type: file + description: A metadata xml file which contains full paths to data files + pattern: "*.transcripts.transcriptset.xml" + - hq_bam: + type: file + description: High quality reads (when --use-qvs is set) + pattern: "*.transcripts.hq.bam" + - hq_pbi: + type: file + 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 (when --use-qvs is set) + pattern: "*.transcripts.lq.bam" + - lq_pbi: + type: file + description: Pacbio index of low quality reads (when --use-qvs is set) + pattern: "*.transcripts.lq.bam.pbi" + - singletons_bam: + type: file + description: Unclustered reads (when --singletons is set) + pattern: "*.transcripts.singletons.bam" + - singletons_pbi: + type: file + description: Pacbio index of unclustered reads (when --singletons is set) + pattern: "*.transcripts.singletons.bam.pbi" + +authors: + - "@sguizard" diff --git a/modules/isoseq3/refine/main.nf b/modules/isoseq3/refine/main.nf new file mode 100644 index 00000000..5044cba2 --- /dev/null +++ b/modules/isoseq3/refine/main.nf @@ -0,0 +1,39 @@ +process ISOSEQ3_REFINE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::isoseq3=3.4.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/isoseq3:3.4.0--0' : + '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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + isoseq3 \\ + refine \\ + -j $task.cpus \\ + $args \\ + $bam \\ + $primers \\ + ${prefix}.bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + isoseq3: \$( 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..eefd015b --- /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/modules/ivar/consensus/functions.nf b/modules/ivar/consensus/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/ivar/consensus/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..58d97c8c 100644 --- a/modules/ivar/consensus/main.nf +++ b/modules/ivar/consensus/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process IVAR_CONSENSUS { 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::ivar=1.3.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/ivar:1.3.1--h089eab3_0" - } else { - container "quay.io/biocontainers/ivar:1.3.1--h089eab3_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ivar:1.3.1--h089eab3_0' : + 'quay.io/biocontainers/ivar:1.3.1--h089eab3_0' }" input: tuple val(meta), path(bam) @@ -26,22 +15,26 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def save_mpileup = params.save_mpileup ? "tee ${prefix}.mpileup |" : "" """ samtools mpileup \\ --reference $fasta \\ - $options.args2 \\ + $args2 \\ $bam | \\ $save_mpileup \\ ivar consensus \\ - $options.args \\ + $args \\ -p $prefix - echo \$(ivar version 2>&1) | sed 's/^.*iVar version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ivar: \$(echo \$(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..2ee5f2c6 100644 --- a/modules/ivar/consensus/meta.yml +++ b/modules/ivar/consensus/meta.yml @@ -10,6 +10,7 @@ tools: iVar - a computational package that contains functions broadly useful for viral amplicon-based sequencing. homepage: https://github.com/andersen-lab/ivar documentation: https://andersen-lab.github.io/ivar/html/manualpage.html + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -42,10 +43,10 @@ output: type: file description: mpileup output from samtools mpileup [OPTIONAL] pattern: "*.mpileup" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@andersgs" - "@drpatelh" diff --git a/modules/ivar/trim/functions.nf b/modules/ivar/trim/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/ivar/trim/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..4d0c70a2 100644 --- a/modules/ivar/trim/main.nf +++ b/modules/ivar/trim/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process IVAR_TRIM { 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::ivar=1.3.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/ivar:1.3.1--h089eab3_0" - } else { - container "quay.io/biocontainers/ivar:1.3.1--h089eab3_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ivar:1.3.1--h089eab3_0' : + 'quay.io/biocontainers/ivar:1.3.1--h089eab3_0' }" input: tuple val(meta), path(bam), path(bai) @@ -25,19 +14,22 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ ivar trim \\ - $options.args \\ + $args \\ -i $bam \\ -b $bed \\ -p $prefix \\ > ${prefix}.ivar.log - echo \$(ivar version 2>&1) | sed 's/^.*iVar version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ivar: \$(echo \$(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..44bc742e 100644 --- a/modules/ivar/trim/meta.yml +++ b/modules/ivar/trim/meta.yml @@ -10,6 +10,7 @@ tools: iVar - a computational package that contains functions broadly useful for viral amplicon-based sequencing. homepage: https://github.com/andersen-lab/ivar documentation: https://andersen-lab.github.io/ivar/html/manualpage.html + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -42,10 +43,10 @@ output: type: file description: Log file generated by iVar for use with MultiQC pattern: "*.log" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@andersgs" - "@drpatelh" diff --git a/modules/ivar/variants/functions.nf b/modules/ivar/variants/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/ivar/variants/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..ce4abd4d 100644 --- a/modules/ivar/variants/main.nf +++ b/modules/ivar/variants/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process IVAR_VARIANTS { 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::ivar=1.3.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/ivar:1.3.1--h089eab3_0" - } else { - container "quay.io/biocontainers/ivar:1.3.1--h089eab3_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ivar:1.3.1--h089eab3_0' : + 'quay.io/biocontainers/ivar:1.3.1--h089eab3_0' }" input: tuple val(meta), path(bam) @@ -26,25 +15,29 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def save_mpileup = params.save_mpileup ? "tee ${prefix}.mpileup |" : "" def features = params.gff ? "-g $gff" : "" """ samtools mpileup \\ - $options.args2 \\ + $args2 \\ --reference $fasta \\ $bam | \\ $save_mpileup \\ ivar variants \\ - $options.args \\ + $args \\ $features \\ -r $fasta \\ -p $prefix - echo \$(ivar version 2>&1) | sed 's/^.*iVar version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ivar: \$(echo \$(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..fd3fce9e 100644 --- a/modules/ivar/variants/meta.yml +++ b/modules/ivar/variants/meta.yml @@ -10,6 +10,7 @@ tools: iVar - a computational package that contains functions broadly useful for viral amplicon-based sequencing. homepage: https://github.com/andersen-lab/ivar documentation: https://andersen-lab.github.io/ivar/html/manualpage.html + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -42,10 +43,10 @@ output: type: file description: mpileup output from samtools mpileup [OPTIONAL] pattern: "*.mpileup" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@andersgs" - "@drpatelh" diff --git a/modules/jupyternotebook/main.nf b/modules/jupyternotebook/main.nf new file mode 100644 index 00000000..e4bdf98b --- /dev/null +++ b/modules/jupyternotebook/main.nf @@ -0,0 +1,83 @@ +include { dump_params_yml; indent_code_block } from "./parametrize" + +process JUPYTERNOTEBOOK { + tag "$meta.id" + label 'process_low' + + //NB: You likely want to override this with a container containing all required + //dependencies for your analysis. The container at least needs to contain the + //ipykernel, jupytext, papermill and nbconvert Python packages. + conda (params.enable_conda ? "ipykernel=6.0.3 jupytext=1.11.4 nbconvert=6.1.0 papermill=2.3.3 matplotlib=3.4.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-514b1a5d280c7043110b2a8d0a87b57ba392a963%3A879972fc8bdc81ee92f2bce3b4805d89a772bf84-0' : + 'quay.io/biocontainers/mulled-v2-514b1a5d280c7043110b2a8d0a87b57ba392a963:879972fc8bdc81ee92f2bce3b4805d89a772bf84-0' }" + + input: + tuple val(meta), path(notebook) + val parameters + path input_files + + output: + tuple val(meta), path("*.html"), emit: report + tuple val(meta), path("artifacts/"), emit: artifacts, optional: true + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def parametrize = (task.ext.parametrize == null) ? true : task.ext.parametrize + def implicit_params = (task.ext.implicit_params == null) ? true : task.ext.implicit_params + def meta_params = (task.ext.meta_params == null) ? true : task.ext.meta_params + + // Dump parameters to yaml file. + // Using a yaml file over using the CLI params because + // * no issue with escaping + // * allows to pass nested maps instead of just single values + def params_cmd = "" + def render_cmd = "" + if (parametrize) { + nb_params = [:] + if (implicit_params) { + nb_params["cpus"] = task.cpus + nb_params["artifact_dir"] = "artifacts" + nb_params["input_dir"] = "./" + } + if (meta_params) { + nb_params["meta"] = meta + } + nb_params += parameters + params_cmd = dump_params_yml(nb_params) + render_cmd = "papermill -f .params.yml" + } else { + render_cmd = "papermill" + } + + """ + set -o pipefail + + # Dump .params.yml heredoc (section will be empty if parametrization is disabled) + ${indent_code_block(params_cmd, 4)} + + # Create output directory + mkdir artifacts + + # Set parallelism for BLAS/MKL etc. to avoid over-booking of resources + export MKL_NUM_THREADS="$task.cpus" + export OPENBLAS_NUM_THREADS="$task.cpus" + export OMP_NUM_THREADS="$task.cpus" + export NUMBA_NUM_THREADS="$task.cpus" + + # Convert notebook to ipynb using jupytext, execute using papermill, convert using nbconvert + jupytext --to notebook --output - --set-kernel - ${notebook} \\ + | ${render_cmd} \\ + | jupyter nbconvert --stdin --to html --output ${prefix}.html + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + jupytext: \$(jupytext --version) + ipykernel: \$(python -c "import ipykernel; print(ipykernel.__version__)") + nbconvert: \$(jupyter nbconvert --version) + papermill: \$(papermill --version | cut -f1 -d' ') + END_VERSIONS + """ +} diff --git a/modules/jupyternotebook/meta.yml b/modules/jupyternotebook/meta.yml new file mode 100644 index 00000000..3a1b61e1 --- /dev/null +++ b/modules/jupyternotebook/meta.yml @@ -0,0 +1,68 @@ +name: jupyternotebook +description: | + Render jupyter (or jupytext) notebooks to HTML reports. Supports parametrization + through papermill. +keywords: + - Python + - Jupyter + - jupytext + - papermill + - notebook + - reports +tools: + - jupytext: + description: Jupyter notebooks as plain text scripts or markdown documents + homepage: https://github.com/mwouts/jupytext/ + documentation: https://jupyter.org/documentation + tool_dev_url: https://github.com/mwouts/jupytext/ + licence: "MIT" + - papermill: + description: Parameterize, execute, and analyze notebooks + homepage: https://github.com/nteract/papermill + documentation: http://papermill.readthedocs.io/en/latest/ + tool_dev_url: https://github.com/nteract/papermill + licence: "BSD 3-clause" + - nbconvert: + description: Parameterize, execute, and analyze notebooks + homepage: https://nbconvert.readthedocs.io/en/latest/ + documentation: https://nbconvert.readthedocs.io/en/latest/ + tool_dev_url: https://github.com/jupyter/nbconvert + licence: "BSD 3-clause" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - notebook: + type: file + description: Jupyter notebook or jupytext representation thereof + pattern: "*.{ipynb,py,md,Rmd,myst}" + - parameters: + type: map + description: | + Groovy map with notebook parameters which will be passed + to papermill in order to create parametrized reports. + - input_files: + type: path + description: One or multiple files serving as input data for the notebook. + pattern: "*" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - report: + type: file + description: HTML report generated from Jupyter notebook + pattern: "*.html" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@grst" diff --git a/modules/jupyternotebook/parametrize.nf b/modules/jupyternotebook/parametrize.nf new file mode 100644 index 00000000..bd74af27 --- /dev/null +++ b/modules/jupyternotebook/parametrize.nf @@ -0,0 +1,44 @@ +import org.yaml.snakeyaml.Yaml +import org.yaml.snakeyaml.representer.Representer +import org.yaml.snakeyaml.DumperOptions + + +/** + * Multiline code blocks need to have the same indentation level + * as the `script:` section. This function re-indents code to the specified level. + */ +def indent_code_block(code, n_spaces) { + def indent_str = " ".multiply(n_spaces) + return code.stripIndent().split("\n").join("\n" + indent_str) +} + +/** + * Create a config YAML file from a groovy map + * + * @params task The process' `task` variable + * @returns a line to be inserted in the bash script. + */ +def dump_params_yml(params) { + DumperOptions options = new DumperOptions(); + options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); + + // Properly handle Groovy GStrings + // see https://stackoverflow.com/a/35108062/2340703 + def representer = new Representer() {{ + this.multiRepresenters.put(GString, this.representers.get(String)) + }} + + def yaml = new Yaml(representer, options) + def yaml_str = yaml.dump(params) + + // Writing the .params.yml file directly as follows does not work. + // It only works in 'exec:', but not if there is a `script:` section: + // task.workDir.resolve('.params.yml').text = yaml_str + + // Therefore, we inject it into the bash script: + return """\ + cat <<"END_PARAMS_SECTION" > ./.params.yml + ${indent_code_block(yaml_str, 8)} + END_PARAMS_SECTION + """ +} diff --git a/modules/kallisto/index/functions.nf b/modules/kallisto/index/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/kallisto/index/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..4dc9c6d0 100644 --- a/modules/kallisto/index/main.nf +++ b/modules/kallisto/index/main.nf @@ -1,39 +1,31 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process KALLISTO_INDEX { tag "$fasta" 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:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::kallisto=0.46.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/kallisto:0.46.2--h4f7b962_1" - } else { - container "quay.io/biocontainers/kallisto:0.46.2--h4f7b962_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/kallisto:0.46.2--h4f7b962_1' : + 'quay.io/biocontainers/kallisto:0.46.2--h4f7b962_1' }" input: path fasta output: path "kallisto" , emit: idx - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ kallisto \\ index \\ - $options.args \\ + $args \\ -i kallisto \\ $fasta - echo \$(kallisto 2>&1) | sed 's/^kallisto //; s/Usage.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + kallisto: \$(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 24b44b0b..dd952e33 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. @@ -9,7 +9,7 @@ tools: documentation: https://pachterlab.github.io/kallisto/manual tool_dev_url: https://github.com/pachterlab/kallisto doi: "" - licence: ['BSD_2_clause'] + licence: ['BSD-2-Clause'] input: - fasta: @@ -18,10 +18,10 @@ input: pattern: "*.{fasta}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - idx: type: index description: Kallisto genome index diff --git a/modules/kallistobustools/count/functions.nf b/modules/kallistobustools/count/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/kallistobustools/count/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 5b7416ea..d67eba31 100644 --- a/modules/kallistobustools/count/main.nf +++ b/modules/kallistobustools/count/main.nf @@ -1,58 +1,48 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process KALLISTOBUSTOOLS_COUNT { 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::kb-python=0.26.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/kb-python:0.26.0--pyhdfd78af_0" - } else { - container "quay.io/biocontainers/kb-python:0.26.0--pyhdfd78af_0" - } + conda (params.enable_conda ? 'bioconda::kb-python=0.26.3' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/kb-python:0.26.3--pyhdfd78af_0' : + 'quay.io/biocontainers/kb-python:0.26.3--pyhdfd78af_0' }" input: - tuple val(meta), path(reads) - path index - path t2g - path t1c - path t2c - val use_t1c - val use_t2c - val workflow - val technology + tuple val(meta), path(reads) + path index + path t2g + path t1c + path t2c + val workflow_mode + val technology output: - tuple val(meta), path ("*_kallistobustools_count") , emit: kallistobustools_count - path "*.version.txt" , emit: version + tuple val(meta), path ("*.count"), emit: count + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def cdna = use_t1c ? "-c1 $t1c" : '' - def introns = use_t2c ? "-c2 $t2c" : '' + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def cdna = t1c ? "-c1 $t1c" : '' + def introns = t2c ? "-c2 $t2c" : '' """ kb \\ - count \\ - -t $task.cpus \\ - -i $index \\ - -g $t2g \\ - $cdna \\ - $introns \\ - --workflow $workflow \\ - -x $technology \\ - $options.args \\ - -o ${prefix}_kallistobustools_count \\ - ${reads[0]} \\ - ${reads[1]} + count \\ + -t $task.cpus \\ + -i $index \\ + -g $t2g \\ + $cdna \\ + $introns \\ + --workflow $workflow_mode \\ + -x $technology \\ + $args \\ + -o ${prefix}.count \\ + ${reads[0]} \\ + ${reads[1]} - echo \$(kb 2>&1) | sed 's/^kb_python //; s/Usage.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + kallistobustools: \$(echo \$(kb --version 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 9e6fa720..911697d2 100644 --- a/modules/kallistobustools/count/meta.yml +++ b/modules/kallistobustools/count/meta.yml @@ -18,14 +18,11 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - fastq1: - type: file - description: Read 1 fastq file - pattern: "*.{fastq,fastq.gz}" - - fastq2: - type: file - description: Read 2 fastq file - pattern: "*.{fastq,fastq.gz}" + - 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: kb-ref index file (.idx) @@ -38,40 +35,33 @@ input: type: file description: kb ref's c1 spliced_t2c file pattern: "*.{cdna_t2c.txt}" - - use_t1c: - type: boolean - description: Whether to use the c1 txt file for RNA velocity and nucleus workflows - t2c: type: file description: kb ref's c2 unspliced_t2c file pattern: "*.{introns_t2c.txt}" - - use_t2c: - type: boolean - description: Whether to use the c2 txt file for RNA velocity and nucleus workflows - - kb_workflow: + - workflow_mode: type: value - description: String value defining worfklow to use, can be one of "standard", "lamanno", "nucleus" + description: String value defining workflow to use, can be one of "standard", "lamanno", "nucleus" pattern: "{standard,lamanno,nucleus,kite}" - technology: type: value description: String value defining the sequencing technology used. pattern: "{10XV1,10XV2,10XV3,CELSEQ,CELSEQ2,DROPSEQ,INDROPSV1,INDROPSV2,INDROPSV3,SCRUBSEQ,SURECELL,SMARTSEQ}" - output: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test'] - - kallistobustools_count: + - count: type: file description: kb count output folder - pattern: "*_{kallistobustools_count}" - - version: + pattern: "*.{count}" + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@flowuenne" diff --git a/modules/kallistobustools/ref/functions.nf b/modules/kallistobustools/ref/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/kallistobustools/ref/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 427251cc..1e496f67 100644 --- a/modules/kallistobustools/ref/main.nf +++ b/modules/kallistobustools/ref/main.nf @@ -1,30 +1,19 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process KALLISTOBUSTOOLS_REF { tag "$fasta" 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:[:], publish_by_meta:[]) } - conda (params.enable_conda ? "bioconda::kb-python=0.26.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/kb-python:0.26.0--pyhdfd78af_0" - } else { - container "quay.io/biocontainers/kb-python:0.26.0--pyhdfd78af_0" - } + conda (params.enable_conda ? 'bioconda::kb-python=0.26.3' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/kb-python:0.26.3--pyhdfd78af_0' : + 'quay.io/biocontainers/kb-python:0.26.3--pyhdfd78af_0' }" input: path fasta path gtf - val workflow + val workflow_mode output: - path "*.version.txt" , 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,19 +22,22 @@ process KALLISTOBUSTOOLS_REF { path "intron_t2c.txt" , optional:true, emit: intron_t2c script: - def software = getSoftwareName(task.process) - if (workflow == "standard") { + def args = task.ext.args ?: '' + if (workflow_mode == "standard") { """ kb \\ ref \\ -i kb_ref_out.idx \\ -g t2g.txt \\ -f1 cdna.fa \\ - --workflow $workflow \\ + --workflow $workflow_mode \\ $fasta \\ $gtf - echo \$(kb 2>&1) | sed 's/^kb_python //; s/Usage.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + kallistobustools: \$(echo \$(kb --version 2>&1) | sed 's/^.*kb_python //;s/positional arguments.*\$//') + END_VERSIONS """ } else { """ @@ -57,11 +49,14 @@ process KALLISTOBUSTOOLS_REF { -f2 intron.fa \\ -c1 cdna_t2c.txt \\ -c2 intron_t2c.txt \\ - --workflow $workflow \\ + --workflow $workflow_mode \\ $fasta \\ $gtf - echo \$(kb 2>&1) | sed 's/^kb_python //; s/Usage.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + kallistobustools: \$(echo \$(kb --version 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..dcc78c66 100644 --- a/modules/kallistobustools/ref/meta.yml +++ b/modules/kallistobustools/ref/meta.yml @@ -21,16 +21,16 @@ input: type: file description: Genomic gtf file pattern: "*.{gtf,gtf.gz}" - - workflow: + - workflow_mode: type: value - description: String value defining worfklow to use, can be one of "standard", "lamanno", "nucleus" + description: String value defining workflow to use, can be one of "standard", "lamanno", "nucleus" pattern: "{standard,lamanno,nucleus}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - kb_ref_idx: type: file description: Index file from kb ref. diff --git a/modules/khmer/normalizebymedian/main.nf b/modules/khmer/normalizebymedian/main.nf new file mode 100644 index 00000000..50b3d603 --- /dev/null +++ b/modules/khmer/normalizebymedian/main.nf @@ -0,0 +1,38 @@ +process KHMER_NORMALIZEBYMEDIAN { + tag "${name}" + label 'process_long' + + conda (params.enable_conda ? "bioconda::khmer=3.0.0a3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/khmer:3.0.0a3--py37haa7609a_2' : + 'quay.io/biocontainers/khmer:3.0.0a3--py37haa7609a_2' }" + + input: + path pe_reads + path se_reads + val name + + output: + path "${name}.fastq.gz", emit: reads + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + pe_args = pe_reads ? "--paired" : "" + se_args = se_reads ? "--unpaired-reads ${se_reads}" : "" + files = pe_reads ? pe_reads : se_reads + """ + normalize-by-median.py \\ + -M ${task.memory.toGiga()}e9 \\ + --gzip $args \\ + -o ${name}.fastq.gz \\ + $pe_args \\ + $se_args \\ + $files + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + khmer: \$( normalize-by-median.py --version 2>&1 | grep ^khmer | sed 's/^khmer //' ) + END_VERSIONS + """ +} diff --git a/modules/khmer/normalizebymedian/meta.yml b/modules/khmer/normalizebymedian/meta.yml new file mode 100644 index 00000000..2227750f --- /dev/null +++ b/modules/khmer/normalizebymedian/meta.yml @@ -0,0 +1,39 @@ +name: khmer_normalizebymedian +description: Module that calls normalize-by-median.py from khmer. The module can take a mix of paired end (interleaved) and single end reads. If both types are provided, only a single file with single ends is possible. +keywords: + - digital normalization + - khmer +tools: + - khmer: + description: khmer k-mer counting library + homepage: https://github.com/dib-lab/khmer + documentation: https://khmer.readthedocs.io/en/latest/ + tool_dev_url: https://github.com/dib-lab/khmer + doi: "https://doi.org/10.12688/f1000research.6924.1" + licence: ['BSD License'] + +input: + - pe_reads: + type: files + description: Paired-end interleaved fastq files + pattern: "*.{fq,fastq}.gz" + - se_reads: + type: files + description: Single-end fastq files + pattern: "*.{fq,fastq}.gz" + - name: + type: string + description: filename for output file(s); ".fastq.gz" will be appended + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - reads: + type: file + description: Interleaved fastq files + pattern: "*.{fq,fastq}.gz" + +authors: + - "@erikrikarddaniel" diff --git a/modules/kleborate/main.nf b/modules/kleborate/main.nf new file mode 100644 index 00000000..998eced1 --- /dev/null +++ b/modules/kleborate/main.nf @@ -0,0 +1,31 @@ +process KLEBORATE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::kleborate=2.1.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/kleborate:2.1.0--pyhdfd78af_1' : + 'quay.io/biocontainers/kleborate:2.1.0--pyhdfd78af_1' }" + + input: + tuple val(meta), path(fastas) + + output: + tuple val(meta), path("*.txt"), emit: txt + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + kleborate \\ + $args \\ + --outfile ${prefix}.results.txt \\ + --assemblies *.fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + kleborate: \$( echo \$(kleborate --version | sed 's/Kleborate v//;')) + END_VERSIONS + """ +} diff --git a/modules/kleborate/meta.yml b/modules/kleborate/meta.yml new file mode 100644 index 00000000..eaf837e7 --- /dev/null +++ b/modules/kleborate/meta.yml @@ -0,0 +1,43 @@ +name: kleborate +description: Kleborate is a tool to screen genome assemblies of Klebsiella pneumoniae and the Klebsiella pneumoniae species complex (KpSC). +keywords: + - screening assemblies + - Klebsiella pneumoniae +tools: + - kleborate: + description: Screening Klebsiella genome assemblies for MLST, sub-species, and other Klebsiella related genes of interest + homepage: https://github.com/katholt/Kleborate + documentation: https://github.com/katholt/Kleborate/wiki + tool_dev_url: https://github.com/katholt/Kleborate + doi: 10.1038/s41467-021-24448-3 + licence: ['GPL v3 or later (GPL v3+)'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fastas: + type: files + description: Klebsiella genome assemblies to be screened + pattern: "*.fasta" + +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" + - txt: + type: file + description: Result file generated after screening + pattern: "*.txt" + +authors: + - "@abhi18av" + - "@rpetit3" diff --git a/modules/kraken2/kraken2/functions.nf b/modules/kraken2/kraken2/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/kraken2/kraken2/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..3c4d1caf 100644 --- a/modules/kraken2/kraken2/main.nf +++ b/modules/kraken2/kraken2/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process KRAKEN2_KRAKEN2 { 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::kraken2=2.1.1 conda-forge::pigz=2.6' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/mulled-v2-5799ab18b5fc681e75923b2450abaa969907ec98:941789bd7fe00db16531c26de8bf3c5c985242a5-0' - } else { - container 'quay.io/biocontainers/mulled-v2-5799ab18b5fc681e75923b2450abaa969907ec98:941789bd7fe00db16531c26de8bf3c5c985242a5-0' - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-5799ab18b5fc681e75923b2450abaa969907ec98:941789bd7fe00db16531c26de8bf3c5c985242a5-0' : + 'quay.io/biocontainers/mulled-v2-5799ab18b5fc681e75923b2450abaa969907ec98:941789bd7fe00db16531c26de8bf3c5c985242a5-0' }" input: tuple val(meta), path(reads) @@ -26,11 +15,11 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def paired = meta.single_end ? "" : "--paired" def classified = meta.single_end ? "${prefix}.classified.fastq" : "${prefix}.classified#.fastq" def unclassified = meta.single_end ? "${prefix}.unclassified.fastq" : "${prefix}.unclassified#.fastq" @@ -43,11 +32,15 @@ process KRAKEN2_KRAKEN2 { --report ${prefix}.kraken2.report.txt \\ --gzip-compressed \\ $paired \\ - $options.args \\ + $args \\ $reads pigz -p $task.cpus *.fastq - echo \$(kraken2 --version 2>&1) | sed 's/^.*Kraken version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + kraken2: \$(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/kraken2/kraken2/meta.yml b/modules/kraken2/kraken2/meta.yml index cb1ec0de..4b894705 100644 --- a/modules/kraken2/kraken2/meta.yml +++ b/modules/kraken2/kraken2/meta.yml @@ -12,6 +12,7 @@ tools: homepage: https://ccb.jhu.edu/software/kraken2/ documentation: https://github.com/DerrickWood/kraken2/wiki/Manual doi: 10.1186/s13059-019-1891-0 + licence: ['MIT'] input: - meta: type: map @@ -50,10 +51,10 @@ output: Kraken2 report containing stats about classified and not classifed reads. pattern: "*.{report.txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/krona/kronadb/main.nf b/modules/krona/kronadb/main.nf new file mode 100644 index 00000000..ca7fc3d3 --- /dev/null +++ b/modules/krona/kronadb/main.nf @@ -0,0 +1,27 @@ +def VERSION='2.7.1' // Version information not provided by tool on CLI + +process KRONA_KRONADB { + label 'process_low' + + conda (params.enable_conda ? "bioconda::krona=2.7.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/krona:2.7.1--pl526_5' : + 'quay.io/biocontainers/krona:2.7.1--pl526_5' }" + + input: + + output: + path 'taxonomy/taxonomy.tab', emit: db + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + """ + ktUpdateTaxonomy.sh taxonomy + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + krona: $VERSION + END_VERSIONS + """ +} diff --git a/modules/krona/kronadb/meta.yml b/modules/krona/kronadb/meta.yml new file mode 100644 index 00000000..2a12aaaf --- /dev/null +++ b/modules/krona/kronadb/meta.yml @@ -0,0 +1,30 @@ +name: krona_kronadb +description: KronaTools Update Taxonomy downloads a taxonomy database +keywords: + - database + - taxonomy + - krona +tools: + - krona: + description: Krona Tools is a set of scripts to create Krona charts from several Bioinformatics tools as well as from text and XML files. + homepage: https://github.com/marbl/Krona/wiki/KronaTools + documentation: https://github.com/marbl/Krona/wiki/Installing + tool_dev_url: + doi: https://doi.org/10.1186/1471-2105-12-385 + licence: + +input: + - none: There is no input. This module downloads a pre-built taxonomy database for use with Krona Tools. + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - db: + type: file + description: A TAB separated file that contains a taxonomy database. + pattern: "*.{tab}" + +authors: + - "@mjakobs" diff --git a/modules/krona/ktimporttaxonomy/main.nf b/modules/krona/ktimporttaxonomy/main.nf new file mode 100644 index 00000000..bc79c98c --- /dev/null +++ b/modules/krona/ktimporttaxonomy/main.nf @@ -0,0 +1,30 @@ +def VERSION = '2.8' // Version information not provided by tool on CLI + +process KRONA_KTIMPORTTAXONOMY { + tag "${meta.id}" + label 'process_high' + + conda (params.enable_conda ? "bioconda::krona=2.8" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/krona:2.8--pl5262hdfd78af_2' : + 'quay.io/biocontainers/krona:2.8--pl5262hdfd78af_2' }" + + input: + tuple val(meta), path(report) + path "taxonomy/taxonomy.tab" + + output: + tuple val(meta), path ('*.html'), emit: html + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + """ + ktImportTaxonomy "$report" -tax taxonomy + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + krona: $VERSION + END_VERSIONS + """ +} diff --git a/modules/krona/ktimporttaxonomy/meta.yml b/modules/krona/ktimporttaxonomy/meta.yml new file mode 100644 index 00000000..b65919f8 --- /dev/null +++ b/modules/krona/ktimporttaxonomy/meta.yml @@ -0,0 +1,44 @@ +name: krona_ktimporttaxonomy +description: KronaTools Import Taxonomy imports taxonomy classifications and produces an interactive Krona plot. +keywords: + - plot + - taxonomy + - interactive + - html + - visualisation + - krona chart +tools: + - krona: + description: Krona Tools is a set of scripts to create Krona charts from several Bioinformatics tools as well as from text and XML files. + homepage: https://github.com/marbl/Krona/wiki/KronaTools + documentation: http://manpages.ubuntu.com/manpages/impish/man1/ktImportTaxonomy.1.html + tool_dev_url: + doi: https://doi.org/10.1186/1471-2105-12-385 + licence: + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test'] + - database: + type: path + description: "Path to the taxonomy database downloaded by krona/kronadb" + - report: + type: file + description: "A tab-delimited file with taxonomy IDs and (optionally) query IDs, magnitudes, and scores. Query IDs are taken from column 1, taxonomy IDs from column 2, and scores from column 3. Lines beginning with # will be ignored." + pattern: "*.{tsv}" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - html: + type: file + description: A html file containing an interactive krona plot. + pattern: "*.{html}" + +authors: + - "@mjakobs" diff --git a/modules/last/dotplot/functions.nf b/modules/last/dotplot/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/last/dotplot/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 4771aa4c..e8857403 100644 --- a/modules/last/dotplot/main.nf +++ b/modules/last/dotplot/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LAST_DOTPLOT { 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::last=1238" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/last:1238--h2e03b76_0" - } else { - container "quay.io/biocontainers/last:1238--h2e03b76_0" - } + conda (params.enable_conda ? 'bioconda::last=1250' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/last:1250--h2e03b76_0' : + 'quay.io/biocontainers/last:1250--h2e03b76_0' }" input: tuple val(meta), path(maf) @@ -25,18 +14,21 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ last-dotplot \\ - $options.args \\ + $args \\ $maf \\ $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 + "${task.process}": + last: \$(lastal --version | sed 's/lastal //') + END_VERSIONS """ } diff --git a/modules/last/dotplot/meta.yml b/modules/last/dotplot/meta.yml index ab57dab7..2ec94f58 100644 --- a/modules/last/dotplot/meta.yml +++ b/modules/last/dotplot/meta.yml @@ -38,10 +38,10 @@ output: type: file description: Pairwise alignment dot plot image, in GIF format. pattern: "*.gif" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@charles-plessy" diff --git a/modules/last/lastal/functions.nf b/modules/last/lastal/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/last/lastal/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 4d1cb9c7..b5ac8bfe 100644 --- a/modules/last/lastal/main.nf +++ b/modules/last/lastal/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LAST_LASTAL { 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::last=1238" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/last:1238--h2e03b76_0" - } else { - container "quay.io/biocontainers/last:1238--h2e03b76_0" - } + conda (params.enable_conda ? 'bioconda::last=1250' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/last:1250--h2e03b76_0' : + 'quay.io/biocontainers/last:1250--h2e03b76_0' }" input: tuple val(meta), path(fastx), path (param_file) @@ -24,17 +13,17 @@ process LAST_LASTAL { output: tuple val(meta), path("*.maf.gz"), emit: maf - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def trained_params = param_file ? "-p ${param_file}" : '' """ INDEX_NAME=\$(basename \$(ls $index/*.des) .des) lastal \\ $trained_params \\ - $options.args \\ + $args \\ -P $task.cpus \\ ${index}/\$INDEX_NAME \\ $fastx \\ @@ -42,6 +31,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 + "${task.process}": + last: \$(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..94e76878 100644 --- a/modules/last/lastal/meta.yml +++ b/modules/last/lastal/meta.yml @@ -39,10 +39,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/last/lastdb/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 ca376f67..e9895c5c 100644 --- a/modules/last/lastdb/main.nf +++ b/modules/last/lastdb/main.nf @@ -1,41 +1,33 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LAST_LASTDB { 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::last=1238" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/last:1238--h2e03b76_0" - } else { - container "quay.io/biocontainers/last:1238--h2e03b76_0" - } + conda (params.enable_conda ? 'bioconda::last=1250' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/last:1250--h2e03b76_0' : + 'quay.io/biocontainers/last:1250--h2e03b76_0' }" input: tuple val(meta), path(fastx) output: tuple val(meta), path("lastdb"), emit: index - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ mkdir lastdb lastdb \\ - $options.args \\ + $args \\ -P $task.cpus \\ lastdb/${prefix} \\ $fastx - echo \$(lastdb --version 2>&1) | sed 's/lastdb //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + last: \$(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..e576fa18 100644 --- a/modules/last/lastdb/meta.yml +++ b/modules/last/lastdb/meta.yml @@ -28,10 +28,10 @@ input: pattern: "*.{fasta,fasta.gz,fastq,fastq.gz}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/last/mafconvert/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 89c7d818..ca60e7fe 100644 --- a/modules/last/mafconvert/main.nf +++ b/modules/last/mafconvert/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LAST_MAFCONVERT { 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::last=1238" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/last:1238--h2e03b76_0" - } else { - container "quay.io/biocontainers/last:1238--h2e03b76_0" - } + conda (params.enable_conda ? 'bioconda::last=1250' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/last:1250--h2e03b76_0' : + 'quay.io/biocontainers/last:1250--h2e03b76_0' }" input: tuple val(meta), path(maf) @@ -32,16 +21,19 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ - maf-convert $options.args $format $maf | gzip --no-name \\ + maf-convert $args $format $maf | gzip --no-name \\ > ${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 + "${task.process}": + last: \$(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..3336f315 100644 --- a/modules/last/mafconvert/meta.yml +++ b/modules/last/mafconvert/meta.yml @@ -34,10 +34,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/last/mafswap/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 e0a697f4..0a58b027 100644 --- a/modules/last/mafswap/main.nf +++ b/modules/last/mafswap/main.nf @@ -1,37 +1,29 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LAST_MAFSWAP { 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::last=1238" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/last:1238--h2e03b76_0" - } else { - container "quay.io/biocontainers/last:1238--h2e03b76_0" - } + conda (params.enable_conda ? 'bioconda::last=1250' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/last:1250--h2e03b76_0' : + 'quay.io/biocontainers/last:1250--h2e03b76_0' }" input: tuple val(meta), path(maf) output: tuple val(meta), path("*.maf.gz"), emit: maf - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ - maf-swap $options.args $maf | gzip --no-name > ${prefix}.swapped.maf.gz + maf-swap $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 + "${task.process}": + last: \$(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..ce97fe97 100644 --- a/modules/last/mafswap/meta.yml +++ b/modules/last/mafswap/meta.yml @@ -30,10 +30,10 @@ output: type: file description: Multiple Aligment Format (MAF) file, compressed with gzip pattern: "*.{maf.gz}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@charles-plessy" diff --git a/modules/last/postmask/functions.nf b/modules/last/postmask/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/last/postmask/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 72584b3e..fb097a11 100644 --- a/modules/last/postmask/main.nf +++ b/modules/last/postmask/main.nf @@ -1,38 +1,30 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LAST_POSTMASK { 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::last=1238" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/last:1238--h2e03b76_0" - } else { - container "quay.io/biocontainers/last:1238--h2e03b76_0" - } + conda (params.enable_conda ? 'bioconda::last=1250' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/last:1250--h2e03b76_0' : + 'quay.io/biocontainers/last:1250--h2e03b76_0' }" input: tuple val(meta), path(maf) output: tuple val(meta), path("*.maf.gz"), emit: maf - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" if( "$maf" == "${prefix}.maf.gz" ) error "Input and output names are the same, use the suffix option to disambiguate" """ - last-postmask $options.args $maf | gzip --no-name > ${prefix}.maf.gz + last-postmask $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 + "${task.process}": + last: \$(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..02e602f6 100644 --- a/modules/last/postmask/meta.yml +++ b/modules/last/postmask/meta.yml @@ -30,10 +30,10 @@ output: type: file description: Multiple Aligment Format (MAF) file, compressed with gzip pattern: "*.{maf.gz}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@charles-plessy" diff --git a/modules/last/split/functions.nf b/modules/last/split/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/last/split/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 021b1bbf..60ed135b 100644 --- a/modules/last/split/main.nf +++ b/modules/last/split/main.nf @@ -1,36 +1,28 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LAST_SPLIT { 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::last=1238" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/last:1238--h2e03b76_0" - } else { - container "quay.io/biocontainers/last:1238--h2e03b76_0" - } + conda (params.enable_conda ? 'bioconda::last=1250' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/last:1250--h2e03b76_0' : + 'quay.io/biocontainers/last:1250--h2e03b76_0' }" input: tuple val(meta), path(maf) output: tuple val(meta), path("*.maf.gz"), emit: maf - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ - zcat < $maf | last-split $options.args | gzip --no-name > ${prefix}.maf.gz + zcat < $maf | last-split $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 + "${task.process}": + last: \$(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..bc16fe9a 100644 --- a/modules/last/split/meta.yml +++ b/modules/last/split/meta.yml @@ -32,10 +32,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/last/train/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 d6fd4007..471db7c1 100644 --- a/modules/last/train/main.nf +++ b/modules/last/train/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LAST_TRAIN { 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::last=1238" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/last:1238--h2e03b76_0" - } else { - container "quay.io/biocontainers/last:1238--h2e03b76_0" - } + conda (params.enable_conda ? 'bioconda::last=1250' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/last:1250--h2e03b76_0' : + 'quay.io/biocontainers/last:1250--h2e03b76_0' }" input: tuple val(meta), path(fastx) @@ -24,21 +13,24 @@ process LAST_TRAIN { output: tuple val(meta), path("*.par"), emit: param_file - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ INDEX_NAME=\$(basename \$(ls $index/*.des) .des) last-train \\ - $options.args \\ + $args \\ -P $task.cpus \\ ${index}/\$INDEX_NAME \\ $fastx \\ > ${prefix}.\$INDEX_NAME.par - lastdb --version | sed 's/lastdb //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + last: \$(lastdb --version | sed 's/lastdb //') + END_VERSIONS """ } diff --git a/modules/last/train/meta.yml b/modules/last/train/meta.yml index 5796b764..20c5780d 100644 --- a/modules/last/train/meta.yml +++ b/modules/last/train/meta.yml @@ -35,10 +35,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - param_file: type: file description: Trained parameter file diff --git a/modules/leehom/main.nf b/modules/leehom/main.nf new file mode 100644 index 00000000..b5cb2dcb --- /dev/null +++ b/modules/leehom/main.nf @@ -0,0 +1,74 @@ +def VERSION = '1.2.15' // Version information not provided by tool on CLI + +process LEEHOM { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::leehom=1.2.15" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/leehom:1.2.15--h29e30f7_1' : + 'quay.io/biocontainers/leehom:1.2.15--h29e30f7_1' }" + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("${prefix}.bam") , optional: true, emit: bam + tuple val(meta), path("${prefix}.fq.gz") , optional: true, emit: fq_pass + tuple val(meta), path("${prefix}.fail.fq.gz") , optional: true, emit: fq_fail + tuple val(meta), path("${prefix}_r1.fq.gz") , optional: true, emit: unmerged_r1_fq_pass + tuple val(meta), path("${prefix}_r1.fail.fq.gz"), optional: true, emit: unmerged_r1_fq_fail + tuple val(meta), path("${prefix}_r2.fq.gz") , optional: true, emit: unmerged_r2_fq_pass + tuple val(meta), path("${prefix}_r2.fail.fq.gz"), optional: true, emit: unmerged_r2_fq_fail + tuple val(meta), path("*.log") , emit: log + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + + if (reads.toString().endsWith('.bam')) { + """ + leeHom \\ + $args \\ + -t $task.cpus \\ + -o ${prefix}.bam \\ + --log ${prefix}.log \\ + $reads + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + leehom: $VERSION + END_VERSIONS + """ + } else if (meta.single_end) { + """ + leeHom \\ + $args \\ + -t $task.cpus \\ + -fq1 $reads \\ + -fqo $prefix \\ + --log ${prefix}.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + leehom: $VERSION + END_VERSIONS + """ + } else { + """ + leeHom \\ + $args \\ + -t $task.cpus \\ + -fq1 ${reads[0]} \\ + -fq2 ${reads[1]} \\ + -fqo $prefix \\ + --log ${prefix}.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + leehom: $VERSION + END_VERSIONS + """ + } +} diff --git a/modules/leehom/meta.yml b/modules/leehom/meta.yml new file mode 100644 index 00000000..b0d6092a --- /dev/null +++ b/modules/leehom/meta.yml @@ -0,0 +1,77 @@ +name: leehom +description: Bayesian reconstruction of ancient DNA fragments +keywords: + - ancient DNA + - adapter removal + - clipping + - trimming + - merging + - collapsing + - preprocessing + - bayesian +tools: + - leehom: + description: Bayesian reconstruction of ancient DNA fragments + homepage: "https://grenaud.github.io/leeHom/" + documentation: "https://github.com/grenaud/leeHom" + tool_dev_url: "https://github.com/grenaud/leeHom" + doi: "10.1093/nar/gku699" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: Unaligned BAM or one or two gzipped FASTQ file(s) + pattern: "*.{bam,fq.gz,fastq.gz}" + +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: BAM file + pattern: "*.bam" + - fq_pass: + type: file + description: Trimmed and merged FASTQ + pattern: "*.fq.gz" + - fq_fail: + type: file + description: Failed trimmed and merged FASTQs + pattern: "*.fail.fq.gz" + - unmerged_r1_fq_pass: + type: file + description: Passed unmerged R1 FASTQs + pattern: "*.r1.fq.gz" + - unmerged_r1_fq_fail: + type: file + description: Failed unmerged R1 FASTQs + pattern: "*.r1.fail.fq.gz" + - unmerged_r2_fq_pass: + type: file + description: Passed unmerged R1 FASTQs + pattern: "*.r2.fq.gz" + - unmerged_r2_fq_pass: + type: file + description: Failed unmerged R1 FASTQs + pattern: "*.r2.fail.fq.gz" + - log: + type: file + description: Log file of command + pattern: "*.log" + + +authors: + - "@jfy133" diff --git a/modules/lib/functions.nf b/modules/lib/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/lib/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..a662a7bb --- /dev/null +++ b/modules/lima/main.nf @@ -0,0 +1,62 @@ +process LIMA { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::lima=2.2.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/lima:2.2.0--h9ee0642_0' : + '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: versions + + 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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${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 \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${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..567632df --- /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" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@sguizard" diff --git a/modules/lissero/main.nf b/modules/lissero/main.nf new file mode 100644 index 00000000..667697ef --- /dev/null +++ b/modules/lissero/main.nf @@ -0,0 +1,31 @@ +process LISSERO { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::lissero=0.4.9" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/lissero:0.4.9--py_0' : + 'quay.io/biocontainers/lissero:0.4.9--py_0' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*.tsv"), emit: tsv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + lissero \\ + $args \\ + $fasta \\ + > ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + lissero: \$( echo \$(lissero --version 2>&1) | sed 's/^.*LisSero //' ) + END_VERSIONS + """ +} diff --git a/modules/lissero/meta.yml b/modules/lissero/meta.yml new file mode 100644 index 00000000..d4fb38df --- /dev/null +++ b/modules/lissero/meta.yml @@ -0,0 +1,44 @@ +name: lissero +description: Serogrouping Listeria monocytogenes assemblies +keywords: + - fasta + - Listeria monocytogenes + - serogroup +tools: + - lissero: + description: In silico serotyping of Listeria monocytogenes + homepage: https://github.com/MDU-PHL/LisSero/blob/master/README.md + documentation: https://github.com/MDU-PHL/LisSero/blob/master/README.md + tool_dev_url: https://github.com/MDU-PHL/lissero + doi: "" + 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 assembly file + pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz}" + +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 result file + pattern: "*.tsv" + +authors: + - "@rpetit3" + diff --git a/modules/lofreq/call/functions.nf b/modules/lofreq/call/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/lofreq/call/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..d7fd078b 100644 --- a/modules/lofreq/call/main.nf +++ b/modules/lofreq/call/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LOFREQ_CALL { 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::lofreq=2.1.5" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/lofreq:2.1.5--py38h588ecb2_4" - } else { - container "quay.io/biocontainers/lofreq:2.1.5--py38h588ecb2_4" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/lofreq:2.1.5--py38h588ecb2_4' : + 'quay.io/biocontainers/lofreq:2.1.5--py38h588ecb2_4' }" input: tuple val(meta), path(bam) @@ -24,19 +13,22 @@ process LOFREQ_CALL { output: tuple val(meta), path("*.vcf.gz"), emit: vcf - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ lofreq \\ call \\ - $options.args \\ + $args \\ -f $fasta \\ -o ${prefix}.vcf.gz \\ $bam - echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + lofreq: \$(echo \$(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..97607663 100644 --- a/modules/lofreq/call/meta.yml +++ b/modules/lofreq/call/meta.yml @@ -33,10 +33,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - vcf: type: file description: VCF output file diff --git a/modules/lofreq/callparallel/functions.nf b/modules/lofreq/callparallel/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/lofreq/callparallel/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 9ebb2805..764efcc5 100644 --- a/modules/lofreq/callparallel/main.nf +++ b/modules/lofreq/callparallel/main.nf @@ -1,43 +1,36 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LOFREQ_CALLPARALLEL { 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::lofreq=2.1.5" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/lofreq:2.1.5--py38h588ecb2_4" - } else { - container "quay.io/biocontainers/lofreq:2.1.5--py38h588ecb2_4" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/lofreq:2.1.5--py38h588ecb2_4' : + 'quay.io/biocontainers/lofreq:2.1.5--py38h588ecb2_4' }" input: tuple val(meta), path(bam), path(bai) - file fasta - file fai + path fasta + path fai output: - tuple val(meta), path("*.vcf"), emit: vcf - path "*.version.txt" , emit: version + tuple val(meta), path("*.vcf.gz"), emit: vcf + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ lofreq \\ call-parallel \\ --pp-threads $task.cpus \\ + $args \\ -f $fasta \\ - -o ${prefix}.vcf \\ + -o ${prefix}.vcf.gz \\ $bam - echo \$(lofreq version 2>&1) | sed 's/^.*lofreq //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + lofreq: \$(echo \$(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 43756e2b..a7dbd637 100644 --- a/modules/lofreq/callparallel/meta.yml +++ b/modules/lofreq/callparallel/meta.yml @@ -40,10 +40,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - vcf: type: file description: Predicted variants file @@ -51,3 +51,4 @@ output: authors: - "@kaurravneet4123" + - "@bjohnnyd" diff --git a/modules/lofreq/filter/functions.nf b/modules/lofreq/filter/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/lofreq/filter/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..34a5aef8 100644 --- a/modules/lofreq/filter/main.nf +++ b/modules/lofreq/filter/main.nf @@ -1,40 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LOFREQ_FILTER { 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::lofreq=2.1.5" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/lofreq:2.1.5--py38h588ecb2_4" - } else { - container "quay.io/biocontainers/lofreq:2.1.5--py38h588ecb2_4" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/lofreq:2.1.5--py38h588ecb2_4' : + 'quay.io/biocontainers/lofreq:2.1.5--py38h588ecb2_4' }" input: tuple val(meta), path(vcf) output: tuple val(meta), path("*.gz"), emit: vcf - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ lofreq \\ filter \\ - $options.args \\ + $args \\ -i $vcf \\ -o ${prefix}.vcf.gz - echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + lofreq: \$(echo \$(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..fceee6f5 100644 --- a/modules/lofreq/filter/meta.yml +++ b/modules/lofreq/filter/meta.yml @@ -31,10 +31,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/lofreq/indelqual/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..5e5b8f44 100644 --- a/modules/lofreq/indelqual/main.nf +++ b/modules/lofreq/indelqual/main.nf @@ -1,21 +1,11 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process LOFREQ_INDELQUAL { 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::lofreq=2.1.5" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/lofreq:2.1.5--py38h588ecb2_4" - } else { - container "quay.io/biocontainers/lofreq:2.1.5--py38h588ecb2_4" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/lofreq:2.1.5--py38h588ecb2_4' : + 'quay.io/biocontainers/lofreq:2.1.5--py38h588ecb2_4' }" input: tuple val(meta), path(bam) @@ -23,18 +13,21 @@ process LOFREQ_INDELQUAL { output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ lofreq indelqual \\ - $options.args \\ + $args \\ -f $fasta \\ -o ${prefix}.bam \\ $bam - echo \$(lofreq version 2>&1) | sed 's/^.*lofreq //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + lofreq: \$(echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//') + END_VERSIONS """ } diff --git a/modules/lofreq/indelqual/meta.yml b/modules/lofreq/indelqual/meta.yml index 294cf17d..a6ec7dc2 100644 --- a/modules/lofreq/indelqual/meta.yml +++ b/modules/lofreq/indelqual/meta.yml @@ -31,10 +31,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bam: type: file description: BAM file with indel qualities inserted into it diff --git a/modules/macrel/contigs/main.nf b/modules/macrel/contigs/main.nf new file mode 100644 index 00000000..558ef6e8 --- /dev/null +++ b/modules/macrel/contigs/main.nf @@ -0,0 +1,40 @@ +process MACREL_CONTIGS { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::macrel=1.1.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/macrel:1.1.0--py36hc5360cc_0': + 'quay.io/biocontainers/macrel:1.1.0--py36hc5360cc_0' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*/*.smorfs.faa.gz") , emit: smorfs + tuple val(meta), path("*/*.all_orfs.faa.gz") , emit: all_orfs + tuple val(meta), path("*/*.prediction.gz") , emit: amp_prediction + tuple val(meta), path("*/*.md") , emit: readme_file + tuple val(meta), path("*/*_log.txt") , emit: log_file + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + macrel contigs \\ + $args \\ + --fasta $fasta \\ + --output ${prefix}/ \\ + --tag ${prefix} \\ + --log-file ${prefix}/${prefix}_log.txt \\ + --threads $task.cpus + + gzip --no-name ${prefix}/*.faa + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + macrel: \$(echo \$(macrel --version | sed 's/macrel //g')) + END_VERSIONS + """ +} diff --git a/modules/macrel/contigs/meta.yml b/modules/macrel/contigs/meta.yml new file mode 100644 index 00000000..e0b2fabd --- /dev/null +++ b/modules/macrel/contigs/meta.yml @@ -0,0 +1,61 @@ +name: macrel_contigs +description: A tool that mines antimicrobial peptides (AMPs) from (meta)genomes by predicting peptides from genomes (provided as contigs) and outputs all the predicted anti-microbial peptides found. +keywords: + - AMP + - antimicrobial peptides + - genome mining + - metagenomes + - peptide prediction +tools: + - macrel: + description: A pipeline for AMP (antimicrobial peptide) prediction + homepage: https://macrel.readthedocs.io/en/latest/ + documentation: https://macrel.readthedocs.io/en/latest/ + tool_dev_url: https://github.com/BigDataBiology/macrel + doi: "10.7717/peerj.10555" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: A fasta file with nucleotide sequences. + pattern: "*.{fasta,fa,fna,fasta.gz,fa.gz,fna.gz}" + +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" + - amp_prediction: + type: file + description: A zipped file, with all predicted amps in a table format. + pattern: "*.prediction.gz" + - smorfs: + type: file + description: A zipped fasta file containing aminoacid sequences showing the general gene prediction information in the contigs. + pattern: "*.smorfs.faa.gz" + - all_orfs: + type: file + description: A zipped fasta file containing amino acid sequences showing the general gene prediction information in the contigs. + pattern: "*.all_orfs.faa.gz" + - readme_file: + type: file + description: A readme file containing tool specific information (e.g. citations, details about the output, etc.). + pattern: "*.md" + - log_file: + type: file + description: A log file containing the information pertaining to the run. + pattern: "*_log.txt" + +authors: + - "@darcy220606" diff --git a/modules/macs2/callpeak/functions.nf b/modules/macs2/callpeak/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/macs2/callpeak/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..c5c88f8e 100644 --- a/modules/macs2/callpeak/main.nf +++ b/modules/macs2/callpeak/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process MACS2_CALLPEAK { 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::macs2=2.2.7.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py38h0213d0e_1" - } else { - container "quay.io/biocontainers/macs2:2.2.7.1--py38h0213d0e_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py38h4a8c8d9_3' : + 'quay.io/biocontainers/macs2:2.2.7.1--py38h4a8c8d9_3' }" input: tuple val(meta), path(ipbam), path(controlbam) @@ -25,27 +14,37 @@ 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: 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" : '' + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def args_list = args.tokenize() + def format = meta.single_end ? 'BAM' : 'BAMPE' + def control = controlbam ? "--control $controlbam" : '' + if(args_list.contains('--format')){ + def id = args_list.findIndexOf{it=='--format'} + format = args_list[id+1] + args_list.remove(id+1) + args_list.remove(id) + } """ macs2 \\ callpeak \\ - $options.args \\ + ${args_list.join(' ')} \\ --gsize $macs2_gsize \\ --format $format \\ --name $prefix \\ --treatment $ipbam \\ $control - macs2 --version | sed -e "s/macs2 //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + macs2: \$(macs2 --version | sed -e "s/macs2 //g") + END_VERSIONS """ } diff --git a/modules/macs2/callpeak/meta.yml b/modules/macs2/callpeak/meta.yml new file mode 100644 index 00000000..afb949ec --- /dev/null +++ b/modules/macs2/callpeak/meta.yml @@ -0,0 +1,63 @@ +name: macs2_callpeak +description: Peak calling of enriched genomic regions of ChIP-seq and ATAC-seq experiments +keywords: + - alignment + - atac-seq + - chip-seq + - peak-calling +tools: + - macs2: + description: Model Based Analysis for ChIP-Seq data + homepage: None + documentation: https://docs.csc.fi/apps/macs2/ + tool_dev_url: https://github.com/macs3-project/MACS + doi: "https://doi.org/10.1101/496521" + licence: ['BSD'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ipbam: + type: file + description: The ChIP-seq treatment file + - controlbam: + type: file + description: The control file + - macs2_gsize: + type: string + description: Effective genome size. It can be 1.0e+9 or 1000000000, or shortcuts:'hs' for human (2.7e9), + 'mm' for mouse (1.87e9), 'ce' for C. elegans (9e7) and 'dm' for fruitfly (1.2e8) + +output: + - versions: + type: file + description: File containing software version + pattern: "versions.yml" + - peak: + type: file + description: BED file containing annotated peaks + pattern: "*.gappedPeak,*.narrowPeak}" + - xls: + type: file + description: xls file containing annotated peaks + pattern: "*.xls" + - gapped: + type: file + description: Optional BED file containing gapped peak + pattern: "*.gappedPeak" + - bed: + type: file + description: Optional BED file containing peak summits locations for every peak + pattern: "*.bed" + - bdg: + type: file + description: Optional bedGraph files for input and treatment input samples + pattern: "*.bdg" + +authors: + - "@ntoda03" + - "@JoseEspinosa" + - "@jianhong" diff --git a/modules/malt/build/main.nf b/modules/malt/build/main.nf new file mode 100644 index 00000000..d1b0c427 --- /dev/null +++ b/modules/malt/build/main.nf @@ -0,0 +1,48 @@ +process MALT_BUILD { + + label 'process_high' + + conda (params.enable_conda ? "bioconda::malt=0.53" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/malt:0.53--hdfd78af_0' : + 'quay.io/biocontainers/malt:0.53--hdfd78af_0' }" + + input: + path fastas + val seq_type + path gff + path map_db + + output: + path "malt_index/" , emit: index + path "versions.yml" , emit: versions + path "malt-build.log", emit: log + + script: + def args = task.ext.args ?: '' + 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.' + } else { + avail_mem = task.memory.giga + } + def igff = gff ? "-igff ${gff}" : "" + + """ + malt-build \\ + -J-Xmx${avail_mem}g \\ + -v \\ + --input ${fastas.join(' ')} \\ + -s $seq_type \\ + $igff \\ + -d 'malt_index/' \\ + -t $task.cpus \\ + $args \\ + -mdb ${map_db}/*.db |&tee malt-build.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + malt: \$(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 new file mode 100644 index 00000000..9985d834 --- /dev/null +++ b/modules/malt/build/meta.yml @@ -0,0 +1,55 @@ +name: malt_build +description: MALT, an acronym for MEGAN alignment tool, is a sequence alignment and analysis tool designed for processing high-throughput sequencing data, especially in the context of metagenomics. +keywords: + - malt + - alignment + - metagenomics + - ancient DNA + - aDNA + - palaeogenomics + - archaeogenomics + - microbiome + - database +tools: + - malt: + description: A tool for mapping metagenomic data + homepage: https://www.wsi.uni-tuebingen.de/lehrstuehle/algorithms-in-bioinformatics/software/malt/ + documentation: https://software-ab.informatik.uni-tuebingen.de/download/malt/manual.pdf + tool_dev_url: None + doi: "10.1038/s41559-017-0446-6" + licence: ['GPL v3'] + +input: + - fastas: + type: file + description: Directory of, or FASTA reference files for indexing + pattern: "*/|*.fasta" + - seq_type: + type: string + description: Type of input data + pattern: "DNA|Protein" + - gff: + type: file + description: Directory of, or GFF3 files of input FASTA files + pattern: "*/|*.gff|*.gff3" + - map_db: + type: file + description: MEGAN .db file from https://software-ab.informatik.uni-tuebingen.de/download/megan6/welcome.html + pattern: + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - index: + type: directory + description: Directory containing MALT database index directory + pattern: "malt_index/" + - log: + type: file + description: Log file from STD out of malt-build + pattern: "malt-build.log" + +authors: + - "@jfy133" diff --git a/modules/malt/run/main.nf b/modules/malt/run/main.nf new file mode 100644 index 00000000..8b8f05cc --- /dev/null +++ b/modules/malt/run/main.nf @@ -0,0 +1,46 @@ +process MALT_RUN { + + label 'process_high_memory' + + conda (params.enable_conda ? "bioconda::malt=0.53" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/malt:0.53--hdfd78af_0' : + 'quay.io/biocontainers/malt:0.53--hdfd78af_0' }" + + input: + path fastqs + val mode + path index + + output: + path "*.rma6" , emit: rma6 + path "*.{tab,text,sam}", optional:true, emit: alignments + path "*.log" , emit: log + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + 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.' + } else { + avail_mem = task.memory.giga + } + + """ + malt-run \\ + -J-Xmx${avail_mem}g \\ + -t $task.cpus \\ + -v \\ + -o . \\ + $args \\ + --inFile ${fastqs.join(' ')} \\ + -m $mode \\ + --index $index/ |&tee malt-run.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + malt: \$(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 new file mode 100644 index 00000000..740ab8a5 --- /dev/null +++ b/modules/malt/run/meta.yml @@ -0,0 +1,53 @@ +name: malt_run +description: MALT, an acronym for MEGAN alignment tool, is a sequence alignment and analysis tool designed for processing high-throughput sequencing data, especially in the context of metagenomics. +keywords: + - malt + - alignment + - metagenomics + - ancient DNA + - aDNA + - palaeogenomics + - archaeogenomics + - microbiome +tools: + - malt: + description: A tool for mapping metagenomic data + homepage: https://www.wsi.uni-tuebingen.de/lehrstuehle/algorithms-in-bioinformatics/software/malt/ + documentation: https://software-ab.informatik.uni-tuebingen.de/download/malt/manual.pdf + tool_dev_url: None + doi: "10.1038/s41559-017-0446-6" + licence: ['GPL v3'] + +input: + - fastqs: + type: file + description: Input FASTQ files + pattern: "*.{fastq.gz,fq.gz}" + - mode: + type: string + description: Program mode + pattern: 'Unknown|BlastN|BlastP|BlastX|Classifier' + - index: + type: directory + description: Index/database directory from malt-build + pattern: '*/' +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - rma6: + type: file + description: MEGAN6 RMA6 file + pattern: "*.rma6" + - sam: + type: file + description: Alignment files in Tab, Text or MEGAN-compatible SAM format + pattern: "*.{tab,txt,sam}" + - log: + type: file + description: Log of verbose MALT stdout + pattern: "malt-run.log" + +authors: + - "@jfy133" diff --git a/modules/maltextract/main.nf b/modules/maltextract/main.nf new file mode 100644 index 00000000..e3a42016 --- /dev/null +++ b/modules/maltextract/main.nf @@ -0,0 +1,36 @@ +process MALTEXTRACT { + + label 'process_medium' + + conda (params.enable_conda ? "bioconda::hops=0.35" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/hops:0.35--hdfd78af_1' : + 'quay.io/biocontainers/hops:0.35--hdfd78af_1' }" + + input: + path rma6 + path taxon_list + path ncbi_dir + + output: + path "results" , emit: results + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + """ + MaltExtract \\ + -Xmx${task.memory.toGiga()}g \\ + -p $task.cpus \\ + -i ${rma6.join(' ')} \\ + -t $taxon_list \\ + -r $ncbi_dir \\ + -o results/ \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + maltextract: \$(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 new file mode 100644 index 00000000..8f257100 --- /dev/null +++ b/modules/maltextract/meta.yml @@ -0,0 +1,51 @@ +name: maltextract +description: Tool for evaluation of MALT results for true positives of ancient metagenomic taxonomic screening +keywords: + - malt + - MaltExtract + - HOPS + - alignment + - metagenomics + - ancient DNA + - aDNA + - palaeogenomics + - archaeogenomics + - microbiome + - authentication + - damage + - edit distance +tools: + - maltextract: + description: Java tool to work with ancient metagenomics + homepage: https://github.com/rhuebler/hops + documentation: https://github.com/rhuebler/hops + tool_dev_url: https://github.com/rhuebler/hops + doi: "https://doi.org/10.1186/s13059-019-1903-0" + licence: ['GPL 3'] + +input: + - rma6: + type: file + description: RMA6 files from MALT + pattern: "*.rma6" + - taxon_list: + type: file + description: List of target taxa to evaluate + pattern: "*.txt" + - ncbi_dir: + type: directory + description: Directory containing NCBI taxonomy map and tre files + pattern: "${ncbi_dir}/" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - results: + type: directory + description: Directory containing MaltExtract text results files + pattern: "*.rma6" + +authors: + - "@jfy133" diff --git a/modules/manta/germline/main.nf b/modules/manta/germline/main.nf new file mode 100644 index 00000000..2a8c0acc --- /dev/null +++ b/modules/manta/germline/main.nf @@ -0,0 +1,57 @@ +process MANTA_GERMLINE { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::manta=1.6.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/manta:1.6.0--h9ee0642_1' : + 'quay.io/biocontainers/manta:1.6.0--h9ee0642_1' }" + + input: + tuple val(meta), path(input), path(input_index) + path fasta + path fai + path target_bed + path target_bed_tbi + + output: + tuple val(meta), path("*candidate_small_indels.vcf.gz") , emit: candidate_small_indels_vcf + tuple val(meta), path("*candidate_small_indels.vcf.gz.tbi"), emit: candidate_small_indels_vcf_tbi + tuple val(meta), path("*candidate_sv.vcf.gz") , emit: candidate_sv_vcf + tuple val(meta), path("*candidate_sv.vcf.gz.tbi") , emit: candidate_sv_vcf_tbi + tuple val(meta), path("*diploid_sv.vcf.gz") , emit: diploid_sv_vcf + tuple val(meta), path("*diploid_sv.vcf.gz.tbi") , emit: diploid_sv_vcf_tbi + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def options_manta = target_bed ? "--exome --callRegions $target_bed" : "" + """ + configManta.py \ + --bam $input \ + --reference $fasta \ + $options_manta \ + --runDir manta + + python manta/runWorkflow.py -m local -j $task.cpus + + mv manta/results/variants/candidateSmallIndels.vcf.gz \ + ${prefix}.candidate_small_indels.vcf.gz + mv manta/results/variants/candidateSmallIndels.vcf.gz.tbi \ + ${prefix}.candidate_small_indels.vcf.gz.tbi + mv manta/results/variants/candidateSV.vcf.gz \ + ${prefix}.candidate_sv.vcf.gz + mv manta/results/variants/candidateSV.vcf.gz.tbi \ + ${prefix}.candidate_sv.vcf.gz.tbi + mv manta/results/variants/diploidSV.vcf.gz \ + ${prefix}.diploid_sv.vcf.gz + mv manta/results/variants/diploidSV.vcf.gz.tbi \ + ${prefix}.diploid_sv.vcf.gz.tbi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + manta: \$( configManta.py --version ) + END_VERSIONS + """ +} diff --git a/modules/manta/germline/meta.yml b/modules/manta/germline/meta.yml new file mode 100644 index 00000000..3bdb8264 --- /dev/null +++ b/modules/manta/germline/meta.yml @@ -0,0 +1,87 @@ +name: manta_germline +description: Manta calls structural variants (SVs) and indels from mapped paired-end sequencing reads. It is optimized for analysis of germline variation in small sets of individuals and somatic variation in tumor/normal sample pairs. +keywords: + - somatic + - wgs + - wxs + - panel + - vcf + - structural variants + - small indels +tools: + - manta: + description: Structural variant and indel caller for mapped sequencing data + homepage: https://github.com/Illumina/manta + documentation: https://github.com/Illumina/manta/blob/v1.6.0/docs/userGuide/README.md + tool_dev_url: https://github.com/Illumina/manta + doi: "10.1093/bioinformatics/btv710" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - input_index: + 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 ] + - candidate_small_indels_vcf: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - candidate_small_indels_vcf_tbi: + type: file + description: Index for gzipped VCF file containing variants + pattern: "*.{vcf.gz.tbi}" + - candidate_sv_vcf: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - candidate_sv_vcf_tbi: + type: file + description: Index for gzipped VCF file containing variants + pattern: "*.{vcf.gz.tbi}" + - diploid_sv_vcf: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - diploid_sv_vcf_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: + - "@maxulysse" diff --git a/modules/manta/somatic/main.nf b/modules/manta/somatic/main.nf new file mode 100644 index 00000000..1d62635b --- /dev/null +++ b/modules/manta/somatic/main.nf @@ -0,0 +1,57 @@ +process MANTA_SOMATIC { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::manta=1.6.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/manta:1.6.0--h9ee0642_1' : + 'quay.io/biocontainers/manta:1.6.0--h9ee0642_1' }" + + input: + tuple val(meta), path(input_normal), path(input_index_normal), path(input_tumor), path(input_index_tumor) + path fasta + path fai + path target_bed + path target_bed_tbi + + output: + tuple val(meta), path("*.candidate_small_indels.vcf.gz") , emit: candidate_small_indels_vcf + tuple val(meta), path("*.candidate_small_indels.vcf.gz.tbi") , emit: candidate_small_indels_vcf_tbi + tuple val(meta), path("*.candidate_sv.vcf.gz") , emit: candidate_sv_vcf + tuple val(meta), path("*.candidate_sv.vcf.gz.tbi") , emit: candidate_sv_vcf_tbi + tuple val(meta), path("*.diploid_sv.vcf.gz") , emit: diploid_sv_vcf + tuple val(meta), path("*.diploid_sv.vcf.gz.tbi") , emit: diploid_sv_vcf_tbi + tuple val(meta), path("*.somatic_sv.vcf.gz") , emit: somatic_sv_vcf + tuple val(meta), path("*.somatic_sv.vcf.gz.tbi") , emit: somatic_sv_vcf_tbi + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def options_manta = target_bed ? "--exome --callRegions $target_bed" : "" + + """ + configManta.py \ + --tumorBam $input_tumor \ + --normalBam $input_normal \ + --reference $fasta \ + $options_manta \ + --runDir manta + + python manta/runWorkflow.py -m local -j $task.cpus + + mv manta/results/variants/candidateSmallIndels.vcf.gz ${prefix}.candidate_small_indels.vcf.gz + mv manta/results/variants/candidateSmallIndels.vcf.gz.tbi ${prefix}.candidate_small_indels.vcf.gz.tbi + mv manta/results/variants/candidateSV.vcf.gz ${prefix}.candidate_sv.vcf.gz + mv manta/results/variants/candidateSV.vcf.gz.tbi ${prefix}.candidate_sv.vcf.gz.tbi + mv manta/results/variants/diploidSV.vcf.gz ${prefix}.diploid_sv.vcf.gz + mv manta/results/variants/diploidSV.vcf.gz.tbi ${prefix}.diploid_sv.vcf.gz.tbi + mv manta/results/variants/somaticSV.vcf.gz ${prefix}.somatic_sv.vcf.gz + mv manta/results/variants/somaticSV.vcf.gz.tbi ${prefix}.somatic_sv.vcf.gz.tbi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + manta: \$( configManta.py --version ) + END_VERSIONS + """ +} diff --git a/modules/manta/somatic/meta.yml b/modules/manta/somatic/meta.yml new file mode 100644 index 00000000..ddd0eafe --- /dev/null +++ b/modules/manta/somatic/meta.yml @@ -0,0 +1,103 @@ +name: manta_somatic +description: Manta calls structural variants (SVs) and indels from mapped paired-end sequencing reads. It is optimized for analysis of germline variation in small sets of individuals and somatic variation in tumor/normal sample pairs. +keywords: + - somatic + - wgs + - wxs + - panel + - vcf + - structural variants + - small indels +tools: + - manta: + description: Structural variant and indel caller for mapped sequencing data + homepage: https://github.com/Illumina/manta + documentation: https://github.com/Illumina/manta/blob/v1.6.0/docs/userGuide/README.md + tool_dev_url: https://github.com/Illumina/manta + doi: "10.1093/bioinformatics/btv710" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input_normal: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - input_index_normal: + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" + - input_tumor: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - input_index_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 ] + - candidate_small_indels_vcf: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - candidate_small_indels_vcf_tbi: + type: file + description: Index for gzipped VCF file containing variants + pattern: "*.{vcf.gz.tbi}" + - candidate_sv_vcf: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - candidate_sv_vcf_tbi: + type: file + description: Index for gzipped VCF file containing variants + pattern: "*.{vcf.gz.tbi}" + - diploid_sv_vcf: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - diploid_sv_vcf_tbi: + type: file + description: Index for gzipped VCF file containing variants + pattern: "*.{vcf.gz.tbi}" + - somatic_sv_vcf: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - somatic_sv_vcf_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: + - "@FriederikeHanssen" diff --git a/modules/manta/tumoronly/main.nf b/modules/manta/tumoronly/main.nf new file mode 100644 index 00000000..63f7a840 --- /dev/null +++ b/modules/manta/tumoronly/main.nf @@ -0,0 +1,57 @@ +process MANTA_TUMORONLY { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::manta=1.6.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/manta:1.6.0--h9ee0642_1' : + 'quay.io/biocontainers/manta:1.6.0--h9ee0642_1' }" + + input: + tuple val(meta), path(input), path(input_index) + path fasta + path fai + path target_bed + path target_bed_tbi + + output: + tuple val(meta), path("*candidate_small_indels.vcf.gz") , emit: candidate_small_indels_vcf + tuple val(meta), path("*candidate_small_indels.vcf.gz.tbi"), emit: candidate_small_indels_vcf_tbi + tuple val(meta), path("*candidate_sv.vcf.gz") , emit: candidate_sv_vcf + tuple val(meta), path("*candidate_sv.vcf.gz.tbi") , emit: candidate_sv_vcf_tbi + tuple val(meta), path("*tumor_sv.vcf.gz") , emit: tumor_sv_vcf + tuple val(meta), path("*tumor_sv.vcf.gz.tbi") , emit: tumor_sv_vcf_tbi + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def options_manta = target_bed ? "--exome --callRegions $target_bed" : "" + """ + configManta.py \ + --tumorBam $input \ + --reference $fasta \ + $options_manta \ + --runDir manta + + python manta/runWorkflow.py -m local -j $task.cpus + + mv manta/results/variants/candidateSmallIndels.vcf.gz \ + ${prefix}.candidate_small_indels.vcf.gz + mv manta/results/variants/candidateSmallIndels.vcf.gz.tbi \ + ${prefix}.candidate_small_indels.vcf.gz.tbi + mv manta/results/variants/candidateSV.vcf.gz \ + ${prefix}.candidate_sv.vcf.gz + mv manta/results/variants/candidateSV.vcf.gz.tbi \ + ${prefix}.candidate_sv.vcf.gz.tbi + mv manta/results/variants/tumorSV.vcf.gz \ + ${prefix}.tumor_sv.vcf.gz + mv manta/results/variants/tumorSV.vcf.gz.tbi \ + ${prefix}.tumor_sv.vcf.gz.tbi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + manta: \$( configManta.py --version ) + END_VERSIONS + """ +} diff --git a/modules/manta/tumoronly/meta.yml b/modules/manta/tumoronly/meta.yml new file mode 100644 index 00000000..86d1c6c0 --- /dev/null +++ b/modules/manta/tumoronly/meta.yml @@ -0,0 +1,87 @@ +name: manta_tumoronly +description: Manta calls structural variants (SVs) and indels from mapped paired-end sequencing reads. It is optimized for analysis of germline variation in small sets of individuals and somatic variation in tumor/normal sample pairs. +keywords: + - somatic + - wgs + - wxs + - panel + - vcf + - structural variants + - small indels +tools: + - manta: + description: Structural variant and indel caller for mapped sequencing data + homepage: https://github.com/Illumina/manta + documentation: https://github.com/Illumina/manta/blob/v1.6.0/docs/userGuide/README.md + tool_dev_url: https://github.com/Illumina/manta + doi: "10.1093/bioinformatics/btv710" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - input_index: + 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 ] + - candidate_small_indels_vcf: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - candidate_small_indels_vcf_tbi: + type: file + description: Index for gzipped VCF file containing variants + pattern: "*.{vcf.gz.tbi}" + - candidate_sv_vcf: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - candidate_sv_vcf_tbi: + type: file + description: Index for gzipped VCF file containing variants + pattern: "*.{vcf.gz.tbi}" + - tumor_sv_vcf: + type: file + description: Gzipped VCF file containing variants + pattern: "*.{vcf.gz}" + - tumor_sv_vcf_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: + - "@maxulysse" diff --git a/modules/mapdamage2/main.nf b/modules/mapdamage2/main.nf new file mode 100644 index 00000000..e3668fda --- /dev/null +++ b/modules/mapdamage2/main.nf @@ -0,0 +1,49 @@ +process MAPDAMAGE2 { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::mapdamage2=2.2.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mapdamage2:2.2.1--pyr40_0' : + 'quay.io/biocontainers/mapdamage2:2.2.1--pyr40_0' }" + + input: + tuple val(meta), path(bam) + path(fasta) + + output: + tuple val(meta), path("results_*/Runtime_log.txt") ,emit: runtime_log + tuple val(meta), path("results_*/Fragmisincorporation_plot.pdf"), optional: true ,emit: fragmisincorporation_plot + tuple val(meta), path("results_*/Length_plot.pdf"), optional: true ,emit: length_plot + tuple val(meta), path("results_*/misincorporation.txt"), optional: true ,emit: misincorporation + tuple val(meta), path("results_*/lgdistribution.txt"), optional: true ,emit: lgdistribution + tuple val(meta), path("results_*/dnacomp.txt"), optional: true ,emit: dnacomp + tuple val(meta), path("results_*/Stats_out_MCMC_hist.pdf"), optional: true ,emit: stats_out_mcmc_hist + tuple val(meta), path("results_*/Stats_out_MCMC_iter.csv"), optional: true ,emit: stats_out_mcmc_iter + tuple val(meta), path("results_*/Stats_out_MCMC_trace.pdf"), optional: true ,emit: stats_out_mcmc_trace + tuple val(meta), path("results_*/Stats_out_MCMC_iter_summ_stat.csv"), optional: true ,emit: stats_out_mcmc_iter_summ_stat + tuple val(meta), path("results_*/Stats_out_MCMC_post_pred.pdf"), optional: true ,emit: stats_out_mcmc_post_pred + tuple val(meta), path("results_*/Stats_out_MCMC_correct_prob.csv"), optional: true ,emit: stats_out_mcmc_correct_prob + tuple val(meta), path("results_*/dnacomp_genome.csv"), optional: true ,emit: dnacomp_genome + tuple val(meta), path("results_*/rescaled.bam"), optional: true ,emit: rescaled + tuple val(meta), path("results_*/5pCtoT_freq.txt"), optional: true ,emit: pctot_freq + tuple val(meta), path("results_*/3pGtoA_freq.txt"), optional: true ,emit: pgtoa_freq + tuple val(meta), path("results_*/*.fasta"), optional: true ,emit: fasta + tuple val(meta), path("*/"), optional: true ,emit: folder + path "versions.yml",emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + mapDamage \\ + $args \\ + -i $bam \\ + -r $fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mapdamage2: \$(echo \$(mapDamage --version)) + END_VERSIONS + """ +} diff --git a/modules/mapdamage2/meta.yml b/modules/mapdamage2/meta.yml new file mode 100644 index 00000000..e511a0a6 --- /dev/null +++ b/modules/mapdamage2/meta.yml @@ -0,0 +1,114 @@ +name: mapdamage2 + +description: Computational framework for tracking and quantifying DNA damage patterns among ancient DNA sequencing reads generated by Next-Generation Sequencing platforms. +keywords: + - ancient DNA + - DNA damage + - NGS + - damage patterns + - bam +tools: + - mapdamage2: + description: Tracking and quantifying damage patterns in ancient DNA sequences + homepage: http://ginolhac.github.io/mapDamage/ + documentation: https://ginolhac.github.io/mapDamage/ + tool_dev_url: https://github.com/ginolhac/mapDamage + doi: "10.1093/bioinformatics/btt193" + licence: ['MIT'] + +input: + - meta: + type: map + description: Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM file + pattern: "*.{bam}" + - fasta: + type: file + description: Fasta file, the reference the input BAM was mapped against + pattern: "*.{fasta}" + +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" + - runtime_log: + type: file + description: Log file with a summary of command lines used and timestamps. + pattern: "Runtime_log.txt" + - fragmisincorporation_plot: + type: file + description: A pdf file that displays both fragmentation and misincorporation patterns. + pattern: "Fragmisincorporation_plot.pdf" + - length_plot: + type: file + description: A pdf file that displays length distribution of singleton reads per strand and cumulative frequencies of C->T at 5'-end and G->A at 3'-end are also displayed per strand. + pattern: "Length_plot.pdf" + - misincorporation: + type: file + description: Contains a table with occurrences for each type of mutations and relative positions from the reads ends. + pattern: "misincorporation.txt" + - pctot_freq: + type: file + description: Contains frequencies of Cytosine to Thymine mutations per position from the 5'-ends. + pattern: "5pCtoT_freq.txt" + - pgtoa_freq: + type: file + description: Contains frequencies of Guanine to Adenine mutations per position from the 3'-ends. + pattern: "3pGtoA_freq.txt" + - dnacomp: + type: file + description: Contains a table of the reference genome base composition per position, inside reads and adjacent regions. + pattern: "dnacomp.txt" + - lgdistribution: + type: file + description: Contains a table with read length distributions per strand. + pattern: "lgdistribution.txt" + - stats_out_mcmc_hist: + type: file + description: A MCMC histogram for the damage parameters and log likelihood. + pattern: "Stats_out_MCMC_hist.pdf" + - stats_out_mcmc_iter: + type: file + description: Values for the damage parameters and log likelihood in each MCMC iteration. + pattern: "Stats_out_MCMC_iter.csv" + - stats_out_mcmc_trace: + type: file + description: A MCMC trace plot for the damage parameters and log likelihood. + pattern: "Stats_out_MCMC_trace.pdf" + - stats_out_mcmc_iter_summ_stat: + type: file + description: Summary statistics for the damage parameters estimated posterior distributions. + pattern: "Stats_out_MCMC_iter_summ_stat.csv" + - stats_out_mcmc_post_pred: + type: file + description: Empirical misincorporation frequency and posterior predictive intervals from the fitted model. + pattern: "Stats_out_MCMC_post_pred.pdf" + - stats_out_mcmc_correct_prob: + type: file + description: Position specific probability of a C->T and G->A misincorporation is due to damage. + pattern: "Stats_out_MCMC_correct_prob.csv" + - dnacomp_genome: + type: file + description: Contains the global reference genome base composition (computed by seqtk). + pattern: "dnacomp_genome.csv" + - rescaled: + type: file + description: Rescaled BAM file, where likely post-mortem damaged bases have downscaled quality scores. + pattern: "*.{bam}" + - fasta: + type: file + description: Allignments in a FASTA file, only if flagged by -d. + pattern: "*.{fasta}" + - folder: + type: folder + description: Folder created when --plot-only, --rescale and --stats-only flags are passed. + pattern: "*/" + +authors: +- "@darcy220606" diff --git a/modules/mash/sketch/functions.nf b/modules/mash/sketch/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/mash/sketch/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..d93641f7 100644 --- a/modules/mash/sketch/main.nf +++ b/modules/mash/sketch/main.nf @@ -1,20 +1,10 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process MASH_SKETCH { 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::mash=2.3" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mash:2.3--he348c14_1" - } else { - container "quay.io/biocontainers/mash:2.3--he348c14_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mash:2.3--he348c14_1' : + 'quay.io/biocontainers/mash:2.3--he348c14_1' }" input: tuple val(meta), path(reads) @@ -22,19 +12,23 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ mash \\ sketch \\ - $options.args \\ + $args \\ -p $task.cpus \\ -o ${prefix} \\ -r $reads \\ 2> ${prefix}.mash_stats - echo \$(mash --version 2>&1) > ${software}.version.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mash: \$(mash --version 2>&1) + END_VERSIONS """ } 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/mashtree/main.nf b/modules/mashtree/main.nf new file mode 100644 index 00000000..5da2f805 --- /dev/null +++ b/modules/mashtree/main.nf @@ -0,0 +1,34 @@ +process MASHTREE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::mashtree=1.2.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mashtree:1.2.0--pl526h516909a_0' : + '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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + mashtree \\ + $args \\ + --numcpus $task.cpus \\ + --outmatrix ${prefix}.tsv \\ + --outtree ${prefix}.dnd \\ + $seqs + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mashtree: \$( 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/modules/maxbin2/main.nf b/modules/maxbin2/main.nf new file mode 100644 index 00000000..4d384391 --- /dev/null +++ b/modules/maxbin2/main.nf @@ -0,0 +1,43 @@ +process MAXBIN2 { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::maxbin2=2.2.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/maxbin2:2.2.7--he1b5a44_2' : + 'quay.io/biocontainers/maxbin2:2.2.7--he1b5a44_2' }" + + input: + tuple val(meta), path(contigs), path(reads), path(abund) + + output: + tuple val(meta), path("*.fasta.gz") , emit: binned_fastas + tuple val(meta), path("*.summary") , emit: summary + tuple val(meta), path("*.log.gz") , emit: log + tuple val(meta), path("*.marker.gz") , emit: marker_counts + tuple val(meta), path("*.noclass.gz") , emit: unbinned_fasta + tuple val(meta), path("*.tooshort.gz"), emit: tooshort_fasta + tuple val(meta), path("*_bin.tar.gz") , emit: marker_bins , optional: true + tuple val(meta), path("*_gene.tar.gz"), emit: marker_genes, optional: true + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def associate_files = reads ? "-reads $reads" : "-abund $abund" + """ + run_MaxBin.pl \\ + -contig $contigs \\ + $associate_files \\ + -thread $task.cpus \\ + $args \\ + -out $prefix + + gzip *.fasta *.noclass *.tooshort *log *.marker + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + maxbin2: \$( run_MaxBin.pl -v | head -n 1 | sed 's/MaxBin //' ) + END_VERSIONS + """ +} diff --git a/modules/maxbin2/meta.yml b/modules/maxbin2/meta.yml new file mode 100644 index 00000000..358f8323 --- /dev/null +++ b/modules/maxbin2/meta.yml @@ -0,0 +1,79 @@ +name: maxbin2 +description: MaxBin is a software that is capable of clustering metagenomic contigs +keywords: + - metagenomics + - assembly + - binning + - maxbin2 + - de novo assembly + - mags + - metagenome-assembled genomes + - contigs +tools: + - maxbin2: + description: MaxBin is software for binning assembled metagenomic sequences based on an Expectation-Maximization algorithm. + homepage: https://sourceforge.net/projects/maxbin/ + documentation: https://sourceforge.net/projects/maxbin/ + tool_dev_url: https://sourceforge.net/projects/maxbin/ + doi: "10.1093/bioinformatics/btv638" + licence: ['BSD 3-clause'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - contigs: + type: file + description: Multi FASTA file containing assembled contigs of a given sample + pattern: "*.fasta" + - reads: + type: file + description: Reads used to assemble contigs in FASTA or FASTQ format. Do not supply at the same time as abundance files. + pattern: "*.fasta" + - abund: + type: file + description: Contig abundance files, i.e. reads against each contig. See MaxBin2 README for details. Do not supply at the same time as read files. + +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" + - binned_fastas: + type: file + description: Binned contigs, one per bin designated with numeric IDs + pattern: "*.fasta.gz" + - summary: + type: file + description: Summary file describing which contigs are being classified into which bin + pattern: "*.summary" + - log: + type: file + description: Log file recording the core steps of MaxBin algorithm + pattern: "*.log.gz" + - marker: + type: file + description: Marker gene presence numbers for each bin + pattern: "*.marker.gz" + - unbinned_fasta: + type: file + description: All sequences that pass the minimum length threshold but are not classified successfully. + pattern: "*.noclass.gz" + - tooshort_fasta: + type: file + description: All sequences that do not meet the minimum length threshold. + pattern: "*.tooshort.gz" + - marker_genes: + type: file + description: All sequences that do not meet the minimum length threshold. + pattern: "*.marker_of_each_gene.tar.gz" + +authors: + - "@jfy133" diff --git a/modules/medaka/main.nf b/modules/medaka/main.nf new file mode 100644 index 00000000..761b1c34 --- /dev/null +++ b/modules/medaka/main.nf @@ -0,0 +1,37 @@ +process MEDAKA { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::medaka=1.4.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/medaka:1.4.4--py38h130def0_0' : + 'quay.io/biocontainers/medaka:1.4.4--py38h130def0_0' }" + + input: + tuple val(meta), path(reads), path(assembly) + + output: + tuple val(meta), path("*.fa.gz"), emit: assembly + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + medaka_consensus \\ + -t $task.cpus \\ + $args \\ + -i $reads \\ + -d $assembly \\ + -o ./ + + mv consensus.fasta ${prefix}.fa + + gzip -n ${prefix}.fa + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + medaka: \$( medaka --version 2>&1 | sed 's/medaka //g' ) + END_VERSIONS + """ +} diff --git a/modules/medaka/meta.yml b/modules/medaka/meta.yml new file mode 100644 index 00000000..d194464f --- /dev/null +++ b/modules/medaka/meta.yml @@ -0,0 +1,47 @@ +name: medaka +description: A tool to create consensus sequences and variant calls from nanopore sequencing data +keywords: + - assembly + - polishing + - nanopore +tools: + - medaka: + description: Neural network sequence error correction. + homepage: https://nanoporetech.github.io/medaka/index.html + documentation: https://nanoporetech.github.io/medaka/index.html + tool_dev_url: https://github.com/nanoporetech/medaka + doi: "" + licence: ['Mozilla Public License 2.0'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: List of input nanopore fasta/FastQ files + pattern: "*.{fasta,fa,fastq,fastq.gz,fq,fq.gz}" + - assembly: + type: file + description: Genome assembly + 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" + - assembly: + type: file + description: Polished genome assembly + pattern: "*.fa.gz" + +authors: + - "@avantonder" diff --git a/modules/megahit/main.nf b/modules/megahit/main.nf new file mode 100644 index 00000000..7b511883 --- /dev/null +++ b/modules/megahit/main.nf @@ -0,0 +1,67 @@ +process MEGAHIT { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::megahit=1.2.9 conda-forge::pigz=2.6" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-0f92c152b180c7cd39d9b0e6822f8c89ccb59c99:8ec213d21e5d03f9db54898a2baeaf8ec729b447-0' : + '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 args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + """ + megahit \\ + -r ${reads} \\ + -t $task.cpus \\ + $args \\ + --out-prefix $prefix + + pigz \\ + --no-name \\ + -p $task.cpus \\ + $args2 \\ + megahit_out/*.fa \\ + megahit_out/intermediate_contigs/*.fa + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + megahit: \$(echo \$(megahit -v 2>&1) | sed 's/MEGAHIT v//') + END_VERSIONS + """ + } else { + """ + megahit \\ + -1 ${reads[0]} \\ + -2 ${reads[1]} \\ + -t $task.cpus \\ + $args \\ + --out-prefix $prefix + + pigz \\ + --no-name \\ + -p $task.cpus \\ + $args2 \\ + megahit_out/*.fa \\ + megahit_out/intermediate_contigs/*.fa + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + megahit: \$(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/modules/meningotype/main.nf b/modules/meningotype/main.nf new file mode 100644 index 00000000..c3b65b9d --- /dev/null +++ b/modules/meningotype/main.nf @@ -0,0 +1,31 @@ +process MENINGOTYPE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::meningotype=0.8.5" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/meningotype:0.8.5--pyhdfd78af_0' : + 'quay.io/biocontainers/meningotype:0.8.5--pyhdfd78af_0' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*.tsv"), emit: tsv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + meningotype \\ + $args \\ + $fasta \\ + > ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + meningotype: \$( echo \$(meningotype --version 2>&1) | sed 's/^.*meningotype v//' ) + END_VERSIONS + """ +} diff --git a/modules/meningotype/meta.yml b/modules/meningotype/meta.yml new file mode 100644 index 00000000..07c2ff5e --- /dev/null +++ b/modules/meningotype/meta.yml @@ -0,0 +1,43 @@ +name: meningotype +description: Serotyping of Neisseria meningitidis assemblies +keywords: + - fasta + - Neisseria meningitidis + - serotype +tools: + - meningotype: + description: In silico serotyping and finetyping (porA and fetA) of Neisseria meningitidis + homepage: https://github.com/MDU-PHL/meningotype + documentation: https://github.com/MDU-PHL/meningotype + tool_dev_url: https://github.com/MDU-PHL/meningotype + doi: "" + 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 assembly file + pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz}" + +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 result file + pattern: "*.tsv" + +authors: + - "@rpetit3" diff --git a/modules/metabat2/jgisummarizebamcontigdepths/main.nf b/modules/metabat2/jgisummarizebamcontigdepths/main.nf new file mode 100644 index 00000000..4a5869b6 --- /dev/null +++ b/modules/metabat2/jgisummarizebamcontigdepths/main.nf @@ -0,0 +1,35 @@ +process METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::metabat2=2.15" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/metabat2:2.15--h986a166_1' : + 'quay.io/biocontainers/metabat2:2.15--h986a166_1' }" + + input: + tuple val(meta), path(bam), path(bai) + + output: + tuple val(meta), path("*.txt.gz"), emit: depth + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + export OMP_NUM_THREADS=$task.cpus + + jgi_summarize_bam_contig_depths \\ + --outputDepth ${prefix}.txt \\ + $args \\ + $bam + + bgzip --threads $task.cpus ${prefix}.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + metabat2: \$( metabat2 --help 2>&1 | head -n 2 | tail -n 1| sed 's/.*\\:\\([0-9]*\\.[0-9]*\\).*/\\1/' ) + END_VERSIONS + """ +} diff --git a/modules/metabat2/jgisummarizebamcontigdepths/meta.yml b/modules/metabat2/jgisummarizebamcontigdepths/meta.yml new file mode 100644 index 00000000..351a4701 --- /dev/null +++ b/modules/metabat2/jgisummarizebamcontigdepths/meta.yml @@ -0,0 +1,50 @@ +name: metabat2_jgisummarizebamcontigdepths +description: Depth computation per contig step of metabat2 +keywords: + - sort + - binning + - depth + - bam + - coverage + - de novo assembly +tools: + - metabat2: + description: Metagenome binning + homepage: https://bitbucket.org/berkeleylab/metabat/src/master/ + documentation: https://bitbucket.org/berkeleylab/metabat/src/master/ + tool_dev_url: https://bitbucket.org/berkeleylab/metabat/src/master/ + doi: "10.7717/peerj.7359" + licence: ['BSD-3-clause-LBNL'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Sorted BAM file of reads aligned on the assembled contigs + pattern: "*.bam" + - bai: + type: file + description: BAM index file + pattern: "*.bam.bai" + +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" + - depth: + type: file + description: Text file listing the coverage per contig + pattern: ".txt.gz" + +authors: + - "@maxibor" diff --git a/modules/metabat2/metabat2/main.nf b/modules/metabat2/metabat2/main.nf new file mode 100644 index 00000000..a8af0ae9 --- /dev/null +++ b/modules/metabat2/metabat2/main.nf @@ -0,0 +1,49 @@ +process METABAT2_METABAT2 { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::metabat2=2.15" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/metabat2:2.15--h986a166_1' : + 'quay.io/biocontainers/metabat2:2.15--h986a166_1' }" + + input: + tuple val(meta), path(fasta), path(depth) + + output: + tuple val(meta), path("*.tooShort.fa.gz") , optional:true , emit: tooshort + tuple val(meta), path("*.lowDepth.fa.gz") , optional:true , emit: lowdepth + tuple val(meta), path("*.unbinned.fa.gz") , optional:true , emit: unbinned + tuple val(meta), path("*.tsv.gz") , optional:true , emit: membership + tuple val(meta), path("bins/*.fa.gz") , optional:true , emit: fasta + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def decompress_depth = depth ? "gzip -d -f $depth" : "" + def depth_file = depth ? "-a ${depth.baseName}" : "" + """ + $decompress_depth + + metabat2 \\ + $args \\ + -i $fasta \\ + $depth_file \\ + -t $task.cpus \\ + --saveCls \\ + -o metabat2/${prefix} + + mv metabat2/${prefix} ${prefix}.tsv + mv metabat2 bins + + gzip ${prefix}.tsv + find ./bins/ -name "*.fa" -type f | xargs -t -n 1 bgzip -@ ${task.cpus} + find ./bins/ -name "*[lowDepth,tooShort,unbinned].fa.gz" -type f -exec mv {} . \\; + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + metabat2: \$( metabat2 --help 2>&1 | head -n 2 | tail -n 1| sed 's/.*\\:\\([0-9]*\\.[0-9]*\\).*/\\1/' ) + END_VERSIONS + """ +} diff --git a/modules/metabat2/metabat2/meta.yml b/modules/metabat2/metabat2/meta.yml new file mode 100644 index 00000000..0ec07b02 --- /dev/null +++ b/modules/metabat2/metabat2/meta.yml @@ -0,0 +1,69 @@ +name: metabat2_metabat2 +keywords: + - sort + - binning + - depth + - bam + - coverage + - de novo assembly +tools: + - metabat2: + description: Metagenome binning + homepage: https://bitbucket.org/berkeleylab/metabat/src/master/ + documentation: https://bitbucket.org/berkeleylab/metabat/src/master/ + tool_dev_url: https://bitbucket.org/berkeleylab/metabat/src/master/ + doi: "10.7717/peerj.7359" + licence: ['BSD-3-clause-LBNL'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Fasta file of the assembled contigs + pattern: "*.{fa,fas,fasta,fna,fa.gz,fas.gz,fasta.gz,fna.gz}" + - depth: + type: file + description: | + Optional text file listing the coverage per contig pre-generated + by metabat2_jgisummarizebamcontigdepths + 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" + - fasta: + type: file + description: Bins created from assembled contigs in fasta file + pattern: "*.fa.gz" + - tooshort: + type: file + description: Contigs that did not pass length filtering + pattern: "*.tooShort.fa.gz" + - lowdepth: + type: file + description: Contigs that did not have sufficient depth for binning + pattern: "*.lowDepth.fa.gz" + - unbinned: + type: file + description: Contigs that pass length and depth filtering but could not be binned + pattern: "*.unbinned.fa.gz" + - membership: + type: file + description: cluster memberships as a matrix format. + pattern: "*.tsv.gz" + + +authors: + - "@maxibor" + - "@jfy133" diff --git a/modules/metaphlan3/functions.nf b/modules/metaphlan3/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/metaphlan3/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 83bb9883..64965af3 100644 --- a/modules/metaphlan3/main.nf +++ b/modules/metaphlan3/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process METAPHLAN3 { 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::metaphlan=3.0.10" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/metaphlan:3.0.10--pyhb7b1952_0" - } else { - container "quay.io/biocontainers/metaphlan:3.0.10--pyhb7b1952_0" - } + conda (params.enable_conda ? 'bioconda::metaphlan=3.0.12' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/metaphlan:3.0.12--pyhb7b1952_0' : + 'quay.io/biocontainers/metaphlan:3.0.12--pyhb7b1952_0' }" input: tuple val(meta), path(input) @@ -26,11 +15,11 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${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" def bowtie2_out = "$input_type" == "--input_type bowtie2out" || "$input_type" == "--input_type sam" ? '' : "--bowtie2out ${prefix}.bowtie2out.txt" @@ -40,11 +29,14 @@ process METAPHLAN3 { --nproc $task.cpus \\ $input_type \\ $input_data \\ - $options.args \\ + $args \\ $bowtie2_out \\ --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 + "${task.process}": + metaphlan3: \$(metaphlan --version 2>&1 | awk '{print \$3}') + END_VERSIONS """ } diff --git a/modules/metaphlan3/meta.yml b/modules/metaphlan3/meta.yml index e0d54d88..0d3c6f85 100644 --- a/modules/metaphlan3/meta.yml +++ b/modules/metaphlan3/meta.yml @@ -31,10 +31,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/methyldackel/extract/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 d0a0b58d..a39c0305 100644 --- a/modules/methyldackel/extract/main.nf +++ b/modules/methyldackel/extract/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process METHYLDACKEL_EXTRACT { 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::methyldackel=0.5.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/methyldackel:0.5.2--h7435645_0" - } else { - container "quay.io/biocontainers/methyldackel:0.5.2--h7435645_0" - } + conda (params.enable_conda ? 'bioconda::methyldackel=0.6.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/methyldackel:0.6.0--h22771d5_0' : + 'quay.io/biocontainers/methyldackel:0.6.0--h22771d5_0' }" input: tuple val(meta), path(bam), path(bai) @@ -25,16 +14,19 @@ process METHYLDACKEL_EXTRACT { output: tuple val(meta), path("*.bedGraph"), emit: bedgraph - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ MethylDackel extract \\ - $options.args \\ + $args \\ $fasta \\ $bam - echo \$(MethylDackel --version 2>&1) | cut -f1 -d" " > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + methyldackel: \$(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..3c1dfb2a 100644 --- a/modules/methyldackel/extract/meta.yml +++ b/modules/methyldackel/extract/meta.yml @@ -17,6 +17,7 @@ tools: homepage: https://github.com/brentp/bwa-meth documentation: https://github.com/brentp/bwa-meth arxiv: arXiv:1401.1129 + licence: ['MIT'] input: - meta: type: map @@ -49,9 +50,9 @@ output: type: file description: bedGraph file containing per-base methylation metrics pattern: "*.{bedGraph}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/methyldackel/mbias/functions.nf b/modules/methyldackel/mbias/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/methyldackel/mbias/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 dcff677e..021f76f1 100644 --- a/modules/methyldackel/mbias/main.nf +++ b/modules/methyldackel/mbias/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process METHYLDACKEL_MBIAS { 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::methyldackel=0.5.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/methyldackel:0.5.2--h7435645_0" - } else { - container "quay.io/biocontainers/methyldackel:0.5.2--h7435645_0" - } + conda (params.enable_conda ? 'bioconda::methyldackel=0.6.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/methyldackel:0.6.0--h22771d5_0' : + 'quay.io/biocontainers/methyldackel:0.6.0--h22771d5_0' }" input: tuple val(meta), path(bam), path(bai) @@ -25,20 +14,23 @@ process METHYLDACKEL_MBIAS { output: tuple val(meta), path("*.mbias.txt"), emit: txt - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ MethylDackel mbias \\ - $options.args \\ + $args \\ $fasta \\ $bam \\ $prefix \\ --txt \\ > ${prefix}.mbias.txt - echo \$(MethylDackel --version 2>&1) | cut -f1 -d" " > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + methyldackel: \$(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..e66cde50 100644 --- a/modules/methyldackel/mbias/meta.yml +++ b/modules/methyldackel/mbias/meta.yml @@ -18,6 +18,7 @@ tools: homepage: https://github.com/brentp/bwa-meth documentation: https://github.com/brentp/bwa-meth arxiv: arXiv:1401.1129 + licence: ['MIT'] input: - meta: type: map @@ -50,9 +51,9 @@ output: type: file description: Text file containing methylation bias pattern: "*.{txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/minia/functions.nf b/modules/minia/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/minia/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..ceff67c5 100644 --- a/modules/minia/main.nf +++ b/modules/minia/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process MINIA { 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::minia=3.2.4" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/minia:3.2.4--he513fc3_0" - } else { - container "quay.io/biocontainers/minia:3.2.4--he513fc3_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/minia:3.2.4--he513fc3_0' : + 'quay.io/biocontainers/minia:3.2.4--he513fc3_0' }" input: tuple val(meta), path(reads) @@ -25,19 +14,23 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${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 \\ + $args \\ -nb-cores $task.cpus \\ -in input_files.txt \\ -out $prefix - echo \$(minia --version 2>&1) | sed 's/^.*Minia version //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + minia: \$(echo \$(minia --version 2>&1 | grep Minia) | sed 's/^.*Minia version //;') + END_VERSIONS """ } diff --git a/modules/minia/meta.yml b/modules/minia/meta.yml index d3a76be8..397a1d49 100644 --- a/modules/minia/meta.yml +++ b/modules/minia/meta.yml @@ -9,6 +9,7 @@ tools: a human genome on a desktop computer in a day. The output of Minia is a set of contigs. homepage: https://github.com/GATB/minia documentation: https://github.com/GATB/minia + licence: ['AGPL-3.0-or-later'] input: - meta: type: map @@ -37,10 +38,10 @@ output: type: file description: Minia output h5 file pattern: "*{.h5}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/miniasm/main.nf b/modules/miniasm/main.nf new file mode 100644 index 00000000..b0db6925 --- /dev/null +++ b/modules/miniasm/main.nf @@ -0,0 +1,38 @@ +process MINIASM { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::miniasm=0.3_r179" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/miniasm:0.3_r179--h5bf99c6_2' : + 'quay.io/biocontainers/miniasm:0.3_r179--h5bf99c6_2' }" + + input: + tuple val(meta), path(reads), path(paf) + + output: + tuple val(meta), path("*.gfa.gz") , emit: gfa + tuple val(meta), path("*.fasta.gz"), emit: assembly + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + miniasm \\ + $args \\ + -f $reads \\ + $paf > \\ + ${prefix}.gfa + + awk '/^S/{print ">"\$2"\\n"\$3}' "${prefix}.gfa" | fold > ${prefix}.fasta + + gzip -n ${prefix}.gfa + gzip -n ${prefix}.fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + miniasm: \$( miniasm -V 2>&1 ) + END_VERSIONS + """ +} diff --git a/modules/miniasm/meta.yml b/modules/miniasm/meta.yml new file mode 100644 index 00000000..e8aedb9a --- /dev/null +++ b/modules/miniasm/meta.yml @@ -0,0 +1,51 @@ +name: miniasm +description: A very fast OLC-based de novo assembler for noisy long reads +keywords: + - assembly + - pacbio + - nanopore +tools: + - miniasm: + description: Ultrafast de novo assembly for long noisy reads (though having no consensus step) + homepage: https://github.com/lh3/miniasm + documentation: https://github.com/lh3/miniasm + tool_dev_url: https://github.com/lh3/miniasm + doi: "10.1093/bioinformatics/btw152" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: List of input PacBio/ONT FastQ files. + pattern: "*.{fastq,fastq.gz,fq,fq.gz}" + - paf: + type: file + description: Alignment in PAF format + pattern: "*{.paf,.paf.gz}" + +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" + - gfa: + type: file + description: Assembly graph + pattern: "*.gfa.gz" + - assembly: + type: file + description: Genome assembly + pattern: "*.fasta.gz" + +authors: + - "@avantonder" diff --git a/modules/minimap2/align/functions.nf b/modules/minimap2/align/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/minimap2/align/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 71b745a3..500250e9 100644 --- a/modules/minimap2/align/main.nf +++ b/modules/minimap2/align/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process MINIMAP2_ALIGN { 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::minimap2=2.17" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/minimap2:2.17--hed695b0_3" - } else { - container "quay.io/biocontainers/minimap2:2.17--hed695b0_3" - } + conda (params.enable_conda ? 'bioconda::minimap2=2.21' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/minimap2:2.21--h5bf99c6_0' : + 'quay.io/biocontainers/minimap2:2.21--h5bf99c6_0' }" input: tuple val(meta), path(reads) @@ -24,20 +13,23 @@ process MINIMAP2_ALIGN { output: tuple val(meta), path("*.paf"), emit: paf - path "*.version.txt", 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def input_reads = meta.single_end ? "$reads" : "${reads[0]} ${reads[1]}" """ minimap2 \\ - $options.args \\ + $args \\ -t $task.cpus \\ $reference \\ $input_reads \\ > ${prefix}.paf - echo \$(minimap2 --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + minimap2: \$(minimap2 --version 2>&1) + END_VERSIONS """ } diff --git a/modules/minimap2/align/meta.yml b/modules/minimap2/align/meta.yml index 3c741b16..9994fb05 100644 --- a/modules/minimap2/align/meta.yml +++ b/modules/minimap2/align/meta.yml @@ -13,6 +13,7 @@ tools: A versatile pairwise aligner for genomic and spliced nucleotide sequences. homepage: https://github.com/lh3/minimap2 documentation: https://github.com/lh3/minimap2#uguide + licence: ['MIT'] input: - meta: type: map @@ -38,9 +39,9 @@ output: type: file description: Alignment in PAF format pattern: "*.paf" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/minimap2/index/functions.nf b/modules/minimap2/index/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/minimap2/index/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 ee0c1b36..10cdd142 100644 --- a/modules/minimap2/index/main.nf +++ b/modules/minimap2/index/main.nf @@ -1,38 +1,30 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process MINIMAP2_INDEX { 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:[:], publish_by_meta:['']) } - conda (params.enable_conda ? "bioconda::minimap2=2.17" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/minimap2:2.17--hed695b0_3" - } else { - container "quay.io/biocontainers/minimap2:2.17--hed695b0_3" - } + conda (params.enable_conda ? 'bioconda::minimap2=2.21' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/minimap2:2.21--h5bf99c6_0' : + 'quay.io/biocontainers/minimap2:2.21--h5bf99c6_0' }" input: path fasta output: path "*.mmi" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ minimap2 \\ -t $task.cpus \\ -d ${fasta.baseName}.mmi \\ - $options.args \\ + $args \\ $fasta - echo \$(minimap2 --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + minimap2: \$(minimap2 --version 2>&1) + END_VERSIONS """ } diff --git a/modules/minimap2/index/meta.yml b/modules/minimap2/index/meta.yml index 065e5c32..78a39bdd 100644 --- a/modules/minimap2/index/meta.yml +++ b/modules/minimap2/index/meta.yml @@ -10,6 +10,7 @@ tools: A versatile pairwise aligner for genomic and spliced nucleotide sequences. homepage: https://github.com/lh3/minimap2 documentation: https://github.com/lh3/minimap2#uguide + licence: ['MIT'] input: - fasta: type: file @@ -20,10 +21,10 @@ output: type: file description: Minimap2 fasta index. pattern: "*.mmi" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@yuukiiwa" - "@drpatelh" diff --git a/modules/mlst/main.nf b/modules/mlst/main.nf new file mode 100644 index 00000000..b2983b82 --- /dev/null +++ b/modules/mlst/main.nf @@ -0,0 +1,32 @@ +process MLST { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::mlst=2.19.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mlst:2.19.0--hdfd78af_1' : + '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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + mlst \\ + --threads $task.cpus \\ + $fasta \\ + > ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mlst: \$( 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/modules/mosdepth/functions.nf b/modules/mosdepth/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/mosdepth/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 618efd79..d2669b7e 100644 --- a/modules/mosdepth/main.nf +++ b/modules/mosdepth/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process MOSDEPTH { 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::mosdepth=0.3.1' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mosdepth:0.3.1--ha7ba039_0" - } else { - container "quay.io/biocontainers/mosdepth:0.3.1--ha7ba039_0" - } + conda (params.enable_conda ? 'bioconda::mosdepth=0.3.2' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mosdepth:0.3.2--h01d7912_0' : + 'quay.io/biocontainers/mosdepth:0.3.2--h01d7912_0' }" input: tuple val(meta), path(bam), path(bai) @@ -31,18 +20,21 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def interval = window_size ? "--by ${window_size}" : "--by ${bed}" """ mosdepth \\ $interval \\ - $options.args \\ + $args \\ $prefix \\ $bam - echo \$(mosdepth --version 2>&1) | sed 's/^.*mosdepth //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mosdepth: \$(mosdepth --version 2>&1 | sed 's/^.*mosdepth //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/mosdepth/meta.yml b/modules/mosdepth/meta.yml index d96e474f..be568aa6 100644 --- a/modules/mosdepth/meta.yml +++ b/modules/mosdepth/meta.yml @@ -11,6 +11,7 @@ tools: Fast BAM/CRAM depth calculation for WGS, exome, or targeted sequencing. documentation: https://github.com/brentp/mosdepth doi: 10.1093/bioinformatics/btx699 + licence: ['MIT'] input: - meta: type: map @@ -67,10 +68,10 @@ 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 - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/msisensor/msi/functions.nf b/modules/msisensor/msi/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/msisensor/msi/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..398b34a6 100644 --- a/modules/msisensor/msi/main.nf +++ b/modules/msisensor/msi/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process MSISENSOR_MSI { 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::msisensor=0.5" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/msisensor:0.5--hb3646a4_2" - } else { - container "quay.io/biocontainers/msisensor:0.5--hb3646a4_2" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/msisensor:0.5--hb3646a4_2' : + 'quay.io/biocontainers/msisensor:0.5--hb3646a4_2' }" input: tuple val(meta), path(normal_bam), path(normal_bai), path(tumor_bam), path(tumor_bai), val(metascan), path(homopolymers) @@ -26,11 +15,11 @@ 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: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" """ msisensor \\ msi \\ @@ -38,8 +27,11 @@ process MSISENSOR_MSI { -n $normal_bam \\ -t $tumor_bam \\ -o $prefix \\ - $options.args + $args - echo \$(msisensor 2>&1) | sed -nE 's/Version:\\sv([0-9]\\.[0-9])/\\1/ p' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + msisensor: \$(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..e3f13e2e 100644 --- a/modules/msisensor/msi/meta.yml +++ b/modules/msisensor/msi/meta.yml @@ -45,10 +45,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/msisensor/scan/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..223b4f44 100644 --- a/modules/msisensor/scan/main.nf +++ b/modules/msisensor/scan/main.nf @@ -1,40 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process MSISENSOR_SCAN { 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::msisensor=0.5" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/msisensor:0.5--hb3646a4_2" - } else { - container "quay.io/biocontainers/msisensor:0.5--hb3646a4_2" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/msisensor:0.5--hb3646a4_2' : + 'quay.io/biocontainers/msisensor:0.5--hb3646a4_2' }" input: tuple val(meta), path(fasta) output: - tuple (val(meta), path("*.tab"), emit: txt) - path ("*.version.txt" , 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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ msisensor \\ scan \\ -d $fasta \\ -o ${prefix}.msisensor_scan.tab \\ - $options.args + $args - echo \$(msisensor 2>&1) | sed -nE 's/Version:\\sv([0-9]\\.[0-9])/\\1/ p' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + msisensor: \$(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..4900f8cc 100644 --- a/modules/msisensor/scan/meta.yml +++ b/modules/msisensor/scan/meta.yml @@ -29,10 +29,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - txt: type: file description: MSIsensor scan output file of homopolymers & minisatellites diff --git a/modules/mtnucratio/main.nf b/modules/mtnucratio/main.nf new file mode 100644 index 00000000..83d6ea2b --- /dev/null +++ b/modules/mtnucratio/main.nf @@ -0,0 +1,34 @@ +process MTNUCRATIO { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::mtnucratio=0.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mtnucratio:0.7--hdfd78af_2' : + 'quay.io/biocontainers/mtnucratio:0.7--hdfd78af_2' }" + + input: + tuple val(meta), path(bam) + val(mt_id) + + output: + tuple val(meta), path("*.mtnucratio"), emit: mtnucratio + tuple val(meta), path("*.json") , emit: json + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + mtnucratio \\ + $args \\ + $bam \\ + $mt_id + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mtnucratio: \$(echo \$(mtnucratio --version 2>&1) | head -n1 | sed 's/Version: //') + END_VERSIONS + """ +} diff --git a/modules/mtnucratio/meta.yml b/modules/mtnucratio/meta.yml new file mode 100644 index 00000000..824af397 --- /dev/null +++ b/modules/mtnucratio/meta.yml @@ -0,0 +1,54 @@ +name: mtnucratio +description: A small Java tool to calculate ratios between MT and nuclear sequencing reads in a given BAM file. +keywords: + - mtnucratio + - ratio + - reads + - bam + - mitochondrial to nuclear ratio + - mitochondria + - statistics +tools: + - mtnucratio: + description: A small tool to determine MT to Nuclear ratios for NGS data. + homepage: https://github.com/apeltzer/MTNucRatioCalculator + documentation: https://github.com/apeltzer/MTNucRatioCalculator + tool_dev_url: https://github.com/apeltzer/MTNucRatioCalculator + doi: "10.1186/s13059-016-0918-z" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: (coordinate) sorted BAM/SAM file + pattern: "*.{bam,sam}" + - mt_id: + type: string + description: Identifier of the contig/chromosome of interest (e.g. chromosome, contig) as in the aligned against reference FASTA file, e.g. mt or chrMT for mitochondria + +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" + - mtnucratio: + type: file + description: Text file containing metrics (mtreads, mt_cov_avg, nucreads, nuc_cov_avg, mt_nuc_ratio) + pattern: "*.mtnucratio" + - json: + type: file + description: JSON file, containing metadata map with sample name, tool name and version, and metrics as in txt file + pattern: "*.json" + +authors: + - "@louperelo" diff --git a/modules/multiqc/functions.nf b/modules/multiqc/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/multiqc/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 da780800..3dceb162 100644 --- a/modules/multiqc/main.nf +++ b/modules/multiqc/main.nf @@ -1,21 +1,10 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process MULTIQC { 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:[:], publish_by_meta:[]) } - conda (params.enable_conda ? "bioconda::multiqc=1.10.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/multiqc:1.10.1--py_0" - } else { - container "quay.io/biocontainers/multiqc:1.10.1--py_0" - } + conda (params.enable_conda ? 'bioconda::multiqc=1.11' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/multiqc:1.11--pyhdfd78af_0' : + 'quay.io/biocontainers/multiqc:1.11--pyhdfd78af_0' }" input: path multiqc_files @@ -24,12 +13,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: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ - multiqc -f $options.args . - multiqc --version | sed -e "s/multiqc, version //g" > ${software}.version.txt + multiqc -f $args . + + cat <<-END_VERSIONS > versions.yml + "${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..63c75a45 100644 --- a/modules/multiqc/meta.yml +++ b/modules/multiqc/meta.yml @@ -11,6 +11,7 @@ tools: It's a general use tool, perfect for summarising the output from numerous bioinformatics tools. homepage: https://multiqc.info/ documentation: https://multiqc.info/docs/ + licence: ['GPL-3.0-or-later'] input: - multiqc_files: type: file @@ -29,10 +30,10 @@ output: type: file description: Plots created by MultiQC pattern: "*_data" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@abhi18av" - "@bunop" diff --git a/modules/mummer/main.nf b/modules/mummer/main.nf new file mode 100644 index 00000000..39ad3e8b --- /dev/null +++ b/modules/mummer/main.nf @@ -0,0 +1,45 @@ +def VERSION = '3.23' // Version information not provided by tool on CLI + +process MUMMER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::mummer=3.23" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mummer:3.23--pl5262h1b792b2_12' : + 'quay.io/biocontainers/mummer:3.23--pl5262h1b792b2_12' }" + + input: + tuple val(meta), path(ref), path(query) + + output: + tuple val(meta), path("*.coords"), emit: coords + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def is_compressed_ref = ref.getName().endsWith(".gz") ? true : false + def fasta_name_ref = ref.getName().replace(".gz", "") + + def is_compressed_query = query.getName().endsWith(".gz") ? true : false + def fasta_name_query = query.getName().replace(".gz", "") + """ + if [ "$is_compressed_ref" == "true" ]; then + gzip -c -d $ref > $fasta_name_ref + fi + if [ "$is_compressed_query" == "true" ]; then + gzip -c -d $query > $fasta_name_query + fi + mummer \\ + $args \\ + $fasta_name_ref \\ + $fasta_name_query \\ + > ${prefix}.coords + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + mummer: $VERSION + END_VERSIONS + """ +} diff --git a/modules/mummer/meta.yml b/modules/mummer/meta.yml new file mode 100644 index 00000000..5f7a983c --- /dev/null +++ b/modules/mummer/meta.yml @@ -0,0 +1,48 @@ +name: mummer +description: MUMmer is a system for rapidly aligning entire genomes +keywords: + - align + - genome + - fasta +tools: + - mummer: + description: MUMmer is a system for rapidly aligning entire genomes + homepage: http://mummer.sourceforge.net/ + documentation: http://mummer.sourceforge.net/ + tool_dev_url: http://mummer.sourceforge.net/ + doi: https://doi.org/10.1186/gb-2004-5-2-r12 + licence: ['The Artistic License'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ref: + type: file + description: FASTA file of the reference sequence + pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz}" + - query: + type: file + description: FASTA file of the query sequence + pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz}" + +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" + - coords: + type: file + description: File containing coordinates of matches between reference and query sequence + pattern: "*.coords" + +authors: + - "@mjcipriano" + - "@sateeshperi" diff --git a/modules/muscle/functions.nf b/modules/muscle/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/muscle/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..6d549aaa 100644 --- a/modules/muscle/main.nf +++ b/modules/muscle/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process MUSCLE { 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::muscle=3.8.1551" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/muscle:3.8.1551--h7d875b9_6" - } else { - container "quay.io/biocontainers/muscle:3.8.1551--h7d875b9_6" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/muscle:3.8.1551--h7d875b9_6' : + 'quay.io/biocontainers/muscle:3.8.1551--h7d875b9_6' }" input: tuple val(meta), path(fasta) @@ -30,22 +19,21 @@ 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: 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" : '' - def msf_out = options.args.contains('-msf') ? "-msfout ${prefix}_muscle_msa.msf" : '' - def phys_out = options.args.contains('-phys') ? "-physout ${prefix}_muscle_msa.phys" : '' - def phyi_out = options.args.contains('-phyi') ? "-phyiout ${prefix}_muscle_msa.phyi" : '' - def html_out = options.args.contains('-html') ? "-htmlout ${prefix}_muscle_msa.html" : '' - def tree_out = options.args.contains('-maketree') ? "-out ${prefix}_muscle_msa.tree" : '' - + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def fasta_out = args.contains('-fasta') ? "-fastaout ${prefix}_muscle_msa.afa" : '' + def clw_out = args.contains('-clw') ? "-clwout ${prefix}_muscle_msa.clw" : '' + def msf_out = args.contains('-msf') ? "-msfout ${prefix}_muscle_msa.msf" : '' + def phys_out = args.contains('-phys') ? "-physout ${prefix}_muscle_msa.phys" : '' + def phyi_out = args.contains('-phyi') ? "-phyiout ${prefix}_muscle_msa.phyi" : '' + def html_out = args.contains('-html') ? "-htmlout ${prefix}_muscle_msa.html" : '' + def tree_out = args.contains('-maketree') ? "-out ${prefix}_muscle_msa.tree" : '' """ muscle \\ - $options.args \\ + $args \\ -in $fasta \\ $fasta_out \\ $clw_out \\ @@ -55,6 +43,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 + "${task.process}": + muscle: \$(muscle -version | sed 's/^MUSCLE v//; s/by.*\$//') + END_VERSIONS """ } diff --git a/modules/muscle/meta.yml b/modules/muscle/meta.yml index e0eb5289..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 - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@MGordon" diff --git a/modules/nanolyse/functions.nf b/modules/nanolyse/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/nanolyse/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..0ad0f799 100644 --- a/modules/nanolyse/main.nf +++ b/modules/nanolyse/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process NANOLYSE { 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::nanolyse=1.2.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/nanolyse:1.2.0--py_0" - } else { - container "quay.io/biocontainers/nanolyse:1.2.0--py_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/nanolyse:1.2.0--py_0' : + 'quay.io/biocontainers/nanolyse:1.2.0--py_0' }" input: tuple val(meta), path(fastq) @@ -25,15 +14,18 @@ process NANOLYSE { output: tuple val(meta), path("*.fastq.gz"), emit: fastq path "*.log" , emit: log - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ 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 + "${task.process}": + nanolyse: \$(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..326fc221 100644 --- a/modules/nanolyse/meta.yml +++ b/modules/nanolyse/meta.yml @@ -8,6 +8,7 @@ tools: DNA contaminant removal using NanoLyse homepage: https://github.com/wdecoster/nanolyse documentation: https://github.com/wdecoster/nanolyse#nanolyse + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -38,9 +39,9 @@ output: type: file description: Log of the Nanolyse run. pattern: "*.log" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@yuukiiwa" diff --git a/modules/nanoplot/functions.nf b/modules/nanoplot/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/nanoplot/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 af080dc8..36577d8a 100644 --- a/modules/nanoplot/main.nf +++ b/modules/nanoplot/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process NANOPLOT { 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::nanoplot=1.36.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/nanoplot:1.36.1--pyhdfd78af_0" - } else { - container "quay.io/biocontainers/nanoplot:1.36.1--pyhdfd78af_0" - } + conda (params.enable_conda ? 'bioconda::nanoplot=1.38.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/nanoplot:1.38.0--pyhdfd78af_0' : + 'quay.io/biocontainers/nanoplot:1.38.0--pyhdfd78af_0' }" input: tuple val(meta), path(ontfile) @@ -26,17 +15,20 @@ 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: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' def input_file = ("$ontfile".endsWith(".fastq.gz")) ? "--fastq ${ontfile}" : ("$ontfile".endsWith(".txt")) ? "--summary ${ontfile}" : '' """ NanoPlot \\ - $options.args \\ + $args \\ -t $task.cpus \\ $input_file - echo \$(NanoPlot --version 2>&1) | sed 's/^.*NanoPlot //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + nanoplot: \$(echo \$(NanoPlot --version 2>&1) | sed 's/^.*NanoPlot //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/nanoplot/meta.yml b/modules/nanoplot/meta.yml index f1d94312..52ebb622 100644 --- a/modules/nanoplot/meta.yml +++ b/modules/nanoplot/meta.yml @@ -13,6 +13,7 @@ tools: alignment. homepage: http://nanoplot.bioinf.be documentation: https://github.com/wdecoster/NanoPlot + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -49,10 +50,10 @@ output: type: file description: log file of NanoPlot run pattern: "*{.log}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@yuukiiwa" diff --git a/modules/ncbigenomedownload/main.nf b/modules/ncbigenomedownload/main.nf new file mode 100644 index 00000000..9897c861 --- /dev/null +++ b/modules/ncbigenomedownload/main.nf @@ -0,0 +1,46 @@ +process NCBIGENOMEDOWNLOAD { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::ncbi-genome-download=0.3.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ncbi-genome-download:0.3.0--pyh864c0ab_1' : + 'quay.io/biocontainers/ncbi-genome-download:0.3.0--pyh864c0ab_1' }" + + input: + val meta + path accessions + + output: + tuple val(meta), path("*_genomic.gbff.gz") , emit: gbk , optional: true + tuple val(meta), path("*_genomic.fna.gz") , emit: fna , optional: true + tuple val(meta), path("*_rm.out.gz") , emit: rm , optional: true + tuple val(meta), path("*_feature_table.txt.gz") , emit: features, optional: true + tuple val(meta), path("*_genomic.gff.gz") , emit: gff , optional: true + tuple val(meta), path("*_protein.faa.gz") , emit: faa , optional: true + tuple val(meta), path("*_protein.gpff.gz") , emit: gpff , optional: true + tuple val(meta), path("*_wgsmaster.gbff.gz") , emit: wgs_gbk , optional: true + tuple val(meta), path("*_cds_from_genomic.fna.gz"), emit: cds , optional: true + tuple val(meta), path("*_rna.fna.gz") , emit: rna , optional: true + tuple val(meta), path("*_rna_from_genomic.fna.gz"), emit: rna_fna , optional: true + tuple val(meta), path("*_assembly_report.txt") , emit: report , optional: true + tuple val(meta), path("*_assembly_stats.txt") , emit: stats , optional: true + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def accessions_opt = accessions ? "-A ${accessions}" : "" + """ + ncbi-genome-download \\ + $args \\ + $accessions_opt \\ + --output-folder ./ \\ + --flat-output + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ncbigenomedownload: \$( ncbi-genome-download --version ) + END_VERSIONS + """ +} diff --git a/modules/ncbigenomedownload/meta.yml b/modules/ncbigenomedownload/meta.yml new file mode 100644 index 00000000..fd9e0a45 --- /dev/null +++ b/modules/ncbigenomedownload/meta.yml @@ -0,0 +1,91 @@ +name: ncbigenomedownload +description: A tool to quickly download assemblies from NCBI's Assembly database +keywords: + - fasta + - download + - assembly +tools: + - ncbigenomedownload: + description: Download genome files from the NCBI FTP server. + homepage: https://github.com/kblin/ncbi-genome-download + documentation: https://github.com/kblin/ncbi-genome-download + tool_dev_url: https://github.com/kblin/ncbi-genome-download + doi: "" + licence: ['Apache Software License'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - accessions: + type: file + description: List of accessions (one per line) to download + 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" + - gbk: + type: file + description: GenBank format of the genomic sequence(s) in the assembly + pattern: "*_genomic.gbff.gz" + - fna: + type: file + description: FASTA format of the genomic sequence(s) in the assembly. + pattern: "*_genomic.fna.gz" + - rm: + type: file + description: RepeatMasker output for eukaryotes. + pattern: "*_rm.out.gz" + - features: + type: file + description: Tab-delimited text file reporting locations and attributes for a subset of annotated features + pattern: "*_feature_table.txt.gz" + - gff: + type: file + description: Annotation of the genomic sequence(s) in GFF3 format + pattern: "*_genomic.gff.gz" + - faa: + type: file + description: FASTA format of the accessioned protein products annotated on the genome assembly. + pattern: "*_protein.faa.gz" + - gpff: + type: file + description: GenPept format of the accessioned protein products annotated on the genome assembly. + pattern: "*_protein.gpff.gz" + - wgs_gbk: + type: file + description: GenBank flat file format of the WGS master for the assembly + pattern: "*_wgsmaster.gbff.gz" + - cds: + type: file + description: FASTA format of the nucleotide sequences corresponding to all CDS features annotated on the assembly + pattern: "*_cds_from_genomic.fna.gz" + - rna: + type: file + description: FASTA format of accessioned RNA products annotated on the genome assembly + pattern: "*_rna.fna.gz" + - rna_fna: + type: file + description: FASTA format of the nucleotide sequences corresponding to all RNA features annotated on the assembly + pattern: "*_rna_from_genomic.fna.gz" + - report: + type: file + description: Tab-delimited text file reporting the name, role and sequence accession.version for objects in the assembly + pattern: "*_assembly_report.txt" + - stats: + type: file + description: Tab-delimited text file reporting statistics for the assembly + pattern: "*_assembly_stats.txt" + +authors: + - "@rpetit3" diff --git a/modules/nextclade/functions.nf b/modules/nextclade/functions.nf deleted file mode 100755 index da9da093..00000000 --- a/modules/nextclade/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 24ca7309..f60af57b 100755 --- a/modules/nextclade/main.nf +++ b/modules/nextclade/main.nf @@ -1,55 +1,40 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process NEXTCLADE { 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::nextclade_js=0.14.4" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/nextclade_js:0.14.4--h9ee0642_0" - } else { - container "quay.io/biocontainers/nextclade_js:0.14.4--h9ee0642_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/nextclade_js:0.14.4--h9ee0642_0' : + 'quay.io/biocontainers/nextclade_js:0.14.4--h9ee0642_0' }" input: tuple val(meta), path(fasta) - val output_format output: - tuple val(meta), path("${prefix}.csv") , optional:true, emit: csv - tuple val(meta), path("${prefix}.json") , optional:true, emit: json - tuple val(meta), path("${prefix}.tree.json") , optional:true, emit: json_tree - tuple val(meta), path("${prefix}.tsv") , optional:true, emit: tsv + tuple val(meta), path("${prefix}.csv") , emit: csv + tuple val(meta), path("${prefix}.json") , emit: json + 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: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def format = output_format - if (!(format in ['json', 'csv', 'tsv', 'tree', 'tsv-clades-only'])) { - format = 'json' - } - def extension = format - if (format in ['tsv-clades-only']) { - extension = '.clades.tsv' - } else if (format in ['tree']) { - extension = 'tree.json' - } + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" """ nextclade \\ - $options.args \\ + $args \\ --jobs $task.cpus \\ --input-fasta $fasta \\ - --output-${format} ${prefix}.${extension} + --output-json ${prefix}.json \\ + --output-csv ${prefix}.csv \\ + --output-tsv ${prefix}.tsv \\ + --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 + "${task.process}": + nextclade: \$(nextclade --version 2>&1) + END_VERSIONS """ } diff --git a/modules/nextclade/meta.yml b/modules/nextclade/meta.yml index 8e0eabd7..1b4a435a 100755 --- a/modules/nextclade/meta.yml +++ b/modules/nextclade/meta.yml @@ -11,7 +11,7 @@ tools: documentation: None tool_dev_url: https://github.com/nextstrain/nextclade doi: "" - licence: ['MIT'] + licence: ["MIT"] input: - meta: @@ -23,11 +23,6 @@ input: type: file description: FASTA file containing one or more consensus sequences pattern: "*.{fasta,fa}" - - output_format: - type: string - description: | - String for output format supported by nextclade - i.e one of 'json', 'csv', 'tsv', 'tree', 'tsv-clades-only' output: - meta: @@ -35,10 +30,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - csv: type: file description: CSV file containing nextclade results diff --git a/modules/ngmaster/main.nf b/modules/ngmaster/main.nf new file mode 100644 index 00000000..7d04031c --- /dev/null +++ b/modules/ngmaster/main.nf @@ -0,0 +1,31 @@ +process NGMASTER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::ngmaster=0.5.8" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ngmaster:0.5.8--pyhdfd78af_1' : + 'quay.io/biocontainers/ngmaster:0.5.8--pyhdfd78af_1' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*.tsv"), emit: tsv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + ngmaster \\ + $args \\ + $fasta \\ + > ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ngmaster: \$( echo \$(ngmaster --version 2>&1) | sed 's/^.*ngmaster //' ) + END_VERSIONS + """ +} diff --git a/modules/ngmaster/meta.yml b/modules/ngmaster/meta.yml new file mode 100644 index 00000000..1dbb02a0 --- /dev/null +++ b/modules/ngmaster/meta.yml @@ -0,0 +1,43 @@ +name: ngmaster +description: Serotyping Neisseria gonorrhoeae assemblies +keywords: + - fasta + - Neisseria gonorrhoeae + - serotype +tools: + - ngmaster: + description: In silico multi-antigen sequence typing for Neisseria gonorrhoeae (NG-MAST) + homepage: https://github.com/MDU-PHL/ngmaster/blob/master/README.md + documentation: https://github.com/MDU-PHL/ngmaster/blob/master/README.md + tool_dev_url: https://github.com/MDU-PHL/ngmaster + doi: "10.1099/mgen.0.000076" + licence: ['GPL v3 only'] + +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}" + +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 result file + pattern: "*.tsv" + +authors: + - "@rpetit3" diff --git a/modules/nucmer/main.nf b/modules/nucmer/main.nf new file mode 100644 index 00000000..4e296515 --- /dev/null +++ b/modules/nucmer/main.nf @@ -0,0 +1,45 @@ +process NUCMER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::mummer=3.23" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mummer:3.23--pl5262h1b792b2_12' : + 'quay.io/biocontainers/mummer:3.23--pl5262h1b792b2_12' }" + + input: + tuple val(meta), path(ref), path(query) + + output: + tuple val(meta), path("*.delta") , emit: delta + tuple val(meta), path("*.coords"), emit: coords + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def is_compressed_ref = ref.getName().endsWith(".gz") ? true : false + def is_compressed_query = query.getName().endsWith(".gz") ? true : false + def fasta_name_ref = ref.getName().replace(".gz", "") + def fasta_name_query = query.getName().replace(".gz", "") + """ + if [ "$is_compressed_ref" == "true" ]; then + gzip -c -d $ref > $fasta_name_ref + fi + if [ "$is_compressed_query" == "true" ]; then + gzip -c -d $query > $fasta_name_query + fi + + nucmer \\ + -p $prefix \\ + --coords \\ + $args \\ + $fasta_name_ref \\ + $fasta_name_query + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + nucmer: \$( nucmer --version 2>&1 | grep "version" | sed -e "s/NUCmer (NUCleotide MUMmer) version //g; s/nucmer//g;" ) + END_VERSIONS + """ +} diff --git a/modules/nucmer/meta.yml b/modules/nucmer/meta.yml new file mode 100644 index 00000000..cccf723f --- /dev/null +++ b/modules/nucmer/meta.yml @@ -0,0 +1,50 @@ +name: nucmer +description: NUCmer is a pipeline for the alignment of multiple closely related nucleotide sequences. +keywords: + - align + - nucleotide +tools: + - nucmer: + description: NUCmer is a pipeline for the alignment of multiple closely related nucleotide sequences. + homepage: http://mummer.sourceforge.net/ + documentation: http://mummer.sourceforge.net/ + tool_dev_url: http://mummer.sourceforge.net/ + doi: "https://doi.org/10.1186/gb-2004-5-2-r12" + licence: ['The Artistic License'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ref: + type: file + description: FASTA file of the reference sequence + pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz}" + - query: + type: file + description: FASTA file of the query sequence + pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz}" + +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" + - delta: + type: file + description: File containing coordinates of matches between reference and query + - coords: + type: file + description: NUCmer1.1 coords output file + pattern: "*.{coords}" + +authors: + - "@sateeshperi" + - "@mjcipriano" diff --git a/modules/optitype/functions.nf b/modules/optitype/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/optitype/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..d27f7f9f 100644 --- a/modules/optitype/main.nf +++ b/modules/optitype/main.nf @@ -1,53 +1,46 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process OPTITYPE { 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::optitype=1.3.5" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/optitype:1.3.5--0" - } else { - container "quay.io/biocontainers/optitype:1.3.5--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/optitype:1.3.5--0' : + 'quay.io/biocontainers/optitype:1.3.5--0' }" input: tuple val(meta), path(bam) output: tuple val(meta), path("${prefix}"), emit: output - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + prefix = task.ext.prefix ?: "${meta.id}" """ - # Create a config for OptiType on a per sample basis with options.args2 + # Create a config for OptiType on a per sample basis with task.ext.args2 #Doing it old school now echo "[mapping]" > config.ini echo "razers3=razers3" >> config.ini echo "threads=$task.cpus" >> config.ini echo "[ilp]" >> config.ini - echo "$options.args2" >> config.ini + echo "$args2" >> config.ini echo "threads=1" >> config.ini echo "[behavior]" >> config.ini echo "deletebam=true" >> config.ini echo "unpaired_weight=0" >> config.ini echo "use_discordant=false" >> config.ini - # Run the actual OptiType typing with options.args - OptiTypePipeline.py -i ${bam} -c config.ini --${meta.seq_type} $options.args --prefix $prefix --outdir $prefix + # Run the actual OptiType typing with args + OptiTypePipeline.py -i ${bam} -c config.ini --${meta.seq_type} $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 + "${task.process}": + optitype: \$(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..37654463 100644 --- a/modules/optitype/meta.yml +++ b/modules/optitype/meta.yml @@ -10,7 +10,7 @@ tools: homepage: https://github.com/FRED-2/OptiType documentation: https://github.com/FRED-2/OptiType doi: "10.1093/bioinformatics/btu548" - licence: ['BSD'] + licence: ['BSD-3-Clause'] input: - meta: @@ -29,10 +29,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', seq_type:'DNA' ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - output: type: file description: OptiType Results Folder diff --git a/modules/pairix/functions.nf b/modules/pairix/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/pairix/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..c1b9658c 100644 --- a/modules/pairix/main.nf +++ b/modules/pairix/main.nf @@ -1,37 +1,29 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PAIRIX { 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::pairix=0.3.7" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/pairix:0.3.7--py36h30a8e3e_3" - } else { - container "quay.io/biocontainers/pairix:0.3.7--py36h30a8e3e_3" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pairix:0.3.7--py36h30a8e3e_3' : + 'quay.io/biocontainers/pairix:0.3.7--py36h30a8e3e_3' }" input: tuple val(meta), path(pair) output: tuple val(meta), path(pair), path("*.px2"), emit: index - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ pairix \\ - $options.args \\ + $args \\ $pair - echo \$(pairix --help 2>&1) | sed 's/^.*Version: //; s/Usage.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pairix: \$(echo \$(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..45577065 100644 --- a/modules/pairix/meta.yml +++ b/modules/pairix/meta.yml @@ -29,10 +29,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - index: type: file description: pair index file diff --git a/modules/pairtools/dedup/functions.nf b/modules/pairtools/dedup/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/pairtools/dedup/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..fe59e155 100644 --- a/modules/pairtools/dedup/main.nf +++ b/modules/pairtools/dedup/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PAIRTOOLS_DEDUP { 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::pairtools=0.3.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5" - } else { - container "quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5' : + 'quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5' }" input: tuple val(meta), path(input) @@ -24,18 +13,21 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ pairtools dedup \\ - $options.args \\ + $args \\ -o ${prefix}.pairs.gz \\ --output-stats ${prefix}.pairs.stat \\ $input - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pairtools: \$(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..288b421e 100644 --- a/modules/pairtools/dedup/meta.yml +++ b/modules/pairtools/dedup/meta.yml @@ -27,10 +27,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - pairs: type: file description: Duplicates removed pairs diff --git a/modules/pairtools/flip/functions.nf b/modules/pairtools/flip/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/pairtools/flip/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..376191ce 100644 --- a/modules/pairtools/flip/main.nf +++ b/modules/pairtools/flip/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PAIRTOOLS_FLIP { 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::pairtools=0.3.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5" - } else { - container "quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5' : + 'quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5' }" input: tuple val(meta), path(sam) @@ -24,19 +13,22 @@ process PAIRTOOLS_FLIP { output: tuple val(meta), path("*.flip.gz"), emit: flip - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ pairtools \\ flip \\ -c $chromsizes \\ - $options.args \\ + $args \\ -o ${prefix}.flip.gz \\ $sam - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pairtools: \$(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..0d7aa082 100644 --- a/modules/pairtools/flip/meta.yml +++ b/modules/pairtools/flip/meta.yml @@ -30,10 +30,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/pairtools/parse/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..7bd778c9 100644 --- a/modules/pairtools/parse/main.nf +++ b/modules/pairtools/parse/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PAIRTOOLS_PARSE { 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::pairtools=0.3.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5" - } else { - container "quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5' : + 'quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5' }" input: tuple val(meta), path(bam) @@ -25,20 +14,23 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ pairtools \\ parse \\ -c $chromsizes \\ - $options.args \\ + $args \\ --output-stats ${prefix}.pairsam.stat \\ -o ${prefix}.pairsam.gz \\ $bam - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pairtools: \$(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..8c9c30dc 100644 --- a/modules/pairtools/parse/meta.yml +++ b/modules/pairtools/parse/meta.yml @@ -31,10 +31,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - pairsam: type: file description: parsed pair file diff --git a/modules/pairtools/restrict/functions.nf b/modules/pairtools/restrict/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/pairtools/restrict/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..8759f709 100644 --- a/modules/pairtools/restrict/main.nf +++ b/modules/pairtools/restrict/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PAIRTOOLS_RESTRICT { 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::pairtools=0.3.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5" - } else { - container "quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5' : + 'quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5' }" input: tuple val(meta), path(pairs) @@ -24,19 +13,22 @@ process PAIRTOOLS_RESTRICT { output: tuple val(meta), path("*.pairs.gz"), emit: restrict - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ pairtools \\ restrict \\ -f $frag \\ - $options.args \\ + $args \\ -o ${prefix}.pairs.gz \\ $pairs - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pairtools: \$(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..0ab3b420 100644 --- a/modules/pairtools/restrict/meta.yml +++ b/modules/pairtools/restrict/meta.yml @@ -33,10 +33,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - restrict: type: file description: Filtered pairs file diff --git a/modules/pairtools/select/functions.nf b/modules/pairtools/select/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/pairtools/select/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..a6d62ba7 100644 --- a/modules/pairtools/select/main.nf +++ b/modules/pairtools/select/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PAIRTOOLS_SELECT { 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::pairtools=0.3.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5" - } else { - container "quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5' : + 'quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5' }" input: tuple val(meta), path(input) @@ -24,18 +13,21 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ pairtools select \\ - "$options.args" \\ + "$args" \\ -o ${prefix}.selected.pairs.gz \\ --output-rest ${prefix}.unselected.pairs.gz \\ ${input} - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pairtools: \$(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..5e45129b 100644 --- a/modules/pairtools/select/meta.yml +++ b/modules/pairtools/select/meta.yml @@ -27,10 +27,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - selected: type: file description: Selected pairs file diff --git a/modules/pairtools/sort/functions.nf b/modules/pairtools/sort/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/pairtools/sort/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..d5996dd0 100644 --- a/modules/pairtools/sort/main.nf +++ b/modules/pairtools/sort/main.nf @@ -1,43 +1,35 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PAIRTOOLS_SORT { 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::pairtools=0.3.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5" - } else { - container "quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pairtools:0.3.0--py37hb9c2fc3_5' : + 'quay.io/biocontainers/pairtools:0.3.0--py37hb9c2fc3_5' }" input: tuple val(meta), path(input) output: tuple val(meta), path("*.pairs.gz"), emit: sorted - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def mem = task.memory.toString().replaceAll(/(\s|\.|B)+/, '') """ pairtools \\ sort \\ - $options.args \\ + $args \\ --nproc $task.cpus \\ --memory "$mem" \\ -o ${prefix}.pairs.gz \\ $input - echo \$(pairtools --version 2>&1) | sed 's/pairtools.*version //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pairtools: \$(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..6db2f9e2 100644 --- a/modules/pairtools/sort/meta.yml +++ b/modules/pairtools/sort/meta.yml @@ -27,10 +27,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - sorted: type: file description: Sorted pairs file diff --git a/modules/pangolin/functions.nf b/modules/pangolin/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/pangolin/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 7be9311c..5ee2b2e0 100644 --- a/modules/pangolin/main.nf +++ b/modules/pangolin/main.nf @@ -1,40 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PANGOLIN { 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::pangolin=3.0.5' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/pangolin:3.0.5--pyhdfd78af_0' - } else { - container 'quay.io/biocontainers/pangolin:3.0.5--pyhdfd78af_0' - } + conda (params.enable_conda ? 'bioconda::pangolin=3.1.11' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pangolin:3.1.11--pyhdfd78af_1' : + 'quay.io/biocontainers/pangolin:3.1.11--pyhdfd78af_1' }" input: tuple val(meta), path(fasta) output: tuple val(meta), path('*.csv'), emit: report - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ pangolin \\ $fasta\\ --outfile ${prefix}.pangolin.csv \\ --threads $task.cpus \\ - $options.args + $args - echo \$(pangolin --version) | sed "s/pangolin //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pangolin: \$(pangolin --version | sed "s/pangolin //g") + END_VERSIONS """ } diff --git a/modules/pangolin/meta.yml b/modules/pangolin/meta.yml index 2b2eb952..a2c0979a 100644 --- a/modules/pangolin/meta.yml +++ b/modules/pangolin/meta.yml @@ -10,6 +10,7 @@ tools: Phylogenetic Assignment of Named Global Outbreak LINeages homepage: https://github.com/cov-lineages/pangolin#pangolearn-description manual: https://github.com/cov-lineages/pangolin#pangolearn-description + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -24,10 +25,10 @@ output: type: file description: Pangolin lineage report pattern: "*.{csv}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" - "@drpatelh" diff --git a/modules/paraclu/main.nf b/modules/paraclu/main.nf new file mode 100644 index 00000000..1623ea89 --- /dev/null +++ b/modules/paraclu/main.nf @@ -0,0 +1,36 @@ +def VERSION = '10' // Version information not provided by tool on CLI + +process PARACLU { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::paraclu=10" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/paraclu%3A10--h9a82719_1' : + 'quay.io/biocontainers/paraclu:10--h9a82719_1' }" + + input: + tuple val(meta), path(bed) + val(min_cluster) + + output: + tuple val(meta), path("*.bed"), emit: bed + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + + awk -F "\t" '{print\$1"\t"\$6"\t"\$2"\t"\$5}' < $bed > ${bed}_4P + sort -k1,1 -k3n ${bed}_4P > ${bed}_4Ps + paraclu $min_cluster ${bed}_4Ps > ${prefix}.clustered + paraclu-cut ${prefix}.clustered > ${prefix}.clustered.simplified + awk -F '\t' '{print \$1"\t"\$3"\t"\$4"\t"\$1":"\$3".."\$4","\$2"\t"\$6"\t"\$2}' ${prefix}.clustered.simplified > ${prefix}.clustered.simplified.bed + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + paraclu: $VERSION + END_VERSIONS + """ +} diff --git a/modules/paraclu/meta.yml b/modules/paraclu/meta.yml new file mode 100644 index 00000000..a3424c57 --- /dev/null +++ b/modules/paraclu/meta.yml @@ -0,0 +1,45 @@ +name: paraclu +description: Paraclu finds clusters in data attached to sequences. +keywords: + - sort +tools: + - paraclu: + description: Paraclu finds clusters in data attached to sequences. + homepage: https://gitlab.com/mcfrith/paraclu + documentation: https://gitlab.com/mcfrith/paraclu + tool_dev_url: https://gitlab.com/mcfrith/paraclu + doi: "" + licence: ['GPL v3-or-later'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: BED file + pattern: "*.bed" + - min_cluster: + type: integer + description: Minimum size of cluster + pattern: "*.bed" + +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" + - bed: + type: file + description: clustered BED file + pattern: "*.bed" + +authors: + - "@mashehu" diff --git a/modules/pbbam/pbmerge/main.nf b/modules/pbbam/pbmerge/main.nf new file mode 100644 index 00000000..e0525cb1 --- /dev/null +++ b/modules/pbbam/pbmerge/main.nf @@ -0,0 +1,32 @@ +process PBBAM_PBMERGE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::pbbam=1.7.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pbbam:1.7.0--h058f120_1' : + '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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + pbmerge \\ + -o ${prefix}.bam \\ + $args \\ + *.bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pbbam: \$( 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..7042d86b --- /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/modules/pbccs/main.nf b/modules/pbccs/main.nf new file mode 100644 index 00000000..440fbc72 --- /dev/null +++ b/modules/pbccs/main.nf @@ -0,0 +1,42 @@ +process PBCCS { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::pbccs=6.2.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pbccs:6.2.0--h9ee0642_0' : + 'quay.io/biocontainers/pbccs:6.2.0--h9ee0642_0' }" + + input: + tuple val(meta), path(bam), path(pbi) + val chunk_num + val chunk_on + + output: + tuple val(meta), path("*.chunk*.bam") , emit: bam + tuple val(meta), path("*.chunk*.bam.pbi") , emit: pbi + tuple val(meta), path("*.report.txt" ) , emit: report_txt + tuple val(meta), path("*.report.json" ) , emit: report_json + tuple val(meta), path("*.metrics.json.gz"), emit: metrics + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + ccs \\ + $bam \\ + ${prefix}.chunk${chunk_num}.bam \\ + --report-file ${prefix}.chunk${chunk_num}.report.txt \\ + --report-json ${prefix}.chunk${chunk_num}.report.json \\ + --metrics-json ${prefix}.chunk${chunk_num}.metrics.json.gz \\ + --chunk $chunk_num/$chunk_on \\ + -j $task.cpus \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pbccs: \$(echo \$(ccs --version 2>&1) | grep 'ccs' | sed 's/^.*ccs //; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/pbccs/meta.yml b/modules/pbccs/meta.yml new file mode 100644 index 00000000..f55c0d71 --- /dev/null +++ b/modules/pbccs/meta.yml @@ -0,0 +1,67 @@ +name: pbccs +description: Pacbio ccs - Generate Higly Accurate Single-Molecule Consensus Reads +keywords: + - ccs +tools: + - pbccs: + description: pbccs - Generate Highly Accurate Single-Molecule Consensus Reads (HiFi Reads) + homepage: https://github.com/PacificBiosciences/pbbioconda + documentation: https://ccs.how/ + tool_dev_url: https://github.com/PacificBiosciences/ccs + doi: "" + licence: ['BSD-3-Clause-Clear'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + id: id of the split file + - bam: + type: file + description: Raw subreads bam + pattern: "*.subreads.bam" + - pbi: + type: file + description: Pacbio BAM Index + pattern: "*.pbi" + - chunk_num: + -type: integer + -description: BAM part to process + - chunk_on: + -type: integer + -description: Total number of bam parts to process + +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: CCS sequences in bam format + pattern: "*.bam" + - pbi: + type: file + description: PacBio Index of CCS sequences + pattern: "*.pbi" + - report_txt: + type: file + description: Summary of CCS in txt format + pattern: ".txt" + - report_json: + type: file + description: Summary of CCS in txt json + pattern: ".json" + - metrics: + type: file + description: Metrics about zmws + pattern: "*.json.gz" + +authors: + - "@sguizard" diff --git a/modules/peddy/main.nf b/modules/peddy/main.nf new file mode 100644 index 00000000..d64c3762 --- /dev/null +++ b/modules/peddy/main.nf @@ -0,0 +1,37 @@ +process PEDDY { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::peddy=0.4.8" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/peddy:0.4.8--pyh5e36f6f_0' : + 'quay.io/biocontainers/peddy:0.4.8--pyh5e36f6f_0' }" + + input: + tuple val(meta), path(vcf), path(vcf_tbi) + path ped + + output: + tuple val(meta), path("*.html") , emit: html + tuple val(meta), path("*.csv") , emit: csv + tuple val(meta), path("*.peddy.ped"), emit: ped + tuple val(meta), path("*.png") , emit: png + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + peddy \\ + $args \\ + --plot \\ + -p $task.cpus \\ + $vcf \\ + $ped + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + peddy: \$( peddy --version 2>&1 | sed 's/peddy, version //' ) + END_VERSIONS + """ +} diff --git a/modules/peddy/meta.yml b/modules/peddy/meta.yml new file mode 100644 index 00000000..7c3fcf45 --- /dev/null +++ b/modules/peddy/meta.yml @@ -0,0 +1,64 @@ +name: peddy +description: Manipulation, validation and exploration of pedigrees +keywords: + - pedigrees + - ped + - family + +tools: + - peddy: + description: genotype, ped correspondence check, ancestry check, sex check. directly, quickly on VCF + homepage: https://github.com/brentp/peddy + documentation: https://peddy.readthedocs.io/en/latest/ + tool_dev_url: https://github.com/brentp/peddy + doi: "https://doi.org/10.1016/j.ajhg.2017.01.017" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF file + pattern: "*.{vcf.gz}" + - ped: + type: file + description: PED/FAM file + pattern: "*.{ped,fam}" + - vcf_tbi: + type: file + description: TBI file + pattern: "*.{vcf.gz.tbi}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ped: + type: file + description: PED/FAM file + pattern: "*.peddy.{ped}" + - html: + type: file + description: HTML file + pattern: "*.{html}" + - csv: + type: file + description: CSV file + pattern: "*.{csv}" + - png: + type: file + description: PNG file + pattern: "*.{png}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@rannick" diff --git a/modules/phantompeakqualtools/functions.nf b/modules/phantompeakqualtools/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/phantompeakqualtools/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..6fe34cc2 100644 --- a/modules/phantompeakqualtools/main.nf +++ b/modules/phantompeakqualtools/main.nf @@ -1,24 +1,13 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '1.2.2' +def VERSION = '1.2.2' // Version information not provided by tool on CLI process PHANTOMPEAKQUALTOOLS { 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::phantompeakqualtools=1.2.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/phantompeakqualtools:1.2.2--0" - } else { - container "quay.io/biocontainers/phantompeakqualtools:1.2.2--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/phantompeakqualtools:1.2.2--0' : + 'quay.io/biocontainers/phantompeakqualtools:1.2.2--0' }" input: tuple val(meta), path(bam) @@ -27,14 +16,18 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ 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 + "${task.process}": + phantompeakqualtools: $VERSION + END_VERSIONS """ } diff --git a/modules/phyloflash/main.nf b/modules/phyloflash/main.nf new file mode 100644 index 00000000..9ebc40de --- /dev/null +++ b/modules/phyloflash/main.nf @@ -0,0 +1,72 @@ +process PHYLOFLASH { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::phyloflash=3.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/phyloflash:3.4--hdfd78af_1' : + 'quay.io/biocontainers/phyloflash:3.4--hdfd78af_1' }" + + input: + tuple val(meta), path(reads) + path silva_db + path univec_db + + output: + tuple val(meta), path("${meta.id}*/*"), emit: results + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + """ + phyloFlash.pl \\ + $args \\ + -read1 ${reads[0]} \\ + -lib $prefix \\ + -interleaved \\ + -dbhome . \\ + -CPUs $task.cpus + + mkdir $prefix + mv ${prefix}.* $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + phyloflash: \$(echo \$(phyloFlash.pl -version 2>&1) | sed "s/^.*phyloFlash v//") + END_VERSIONS + """ + } else { + """ + phyloFlash.pl \\ + $args \\ + -read1 ${reads[0]} \\ + -read2 ${reads[1]} \\ + -lib $prefix \\ + -dbhome . \\ + -CPUs $task.cpus + + mkdir $prefix + mv ${prefix}.* $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + phyloflash: \$(echo \$(phyloFlash.pl -version 2>&1) | sed "s/^.*phyloFlash v//") + END_VERSIONS + """ + } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + mkdir ${prefix} + touch ${prefix}/${prefix}.SSU.collection.fasta + touch ${prefix}/${prefix}.phyloFlash + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + phyloflash: \$(echo \$(phyloFlash.pl -version 2>&1) | sed "s/^.*phyloFlash v//") + END_VERSIONS + """ +} diff --git a/modules/phyloflash/meta.yml b/modules/phyloflash/meta.yml new file mode 100644 index 00000000..3ed7a9fa --- /dev/null +++ b/modules/phyloflash/meta.yml @@ -0,0 +1,51 @@ +name: phyloflash +description: phyloFlash is a pipeline to rapidly reconstruct the SSU rRNAs and explore phylogenetic composition of an illumina (meta)genomic dataset. +keywords: + - metagenomics + - illumina datasets + - phylogenetic composition +tools: + - phyloflash: + description: phyloFlash is a pipeline to rapidly reconstruct the SSU rRNAs and explore phylogenetic composition of an illumina (meta)genomic dataset. + + homepage: https://hrgv.github.io/phyloFlash/ + documentation: https://hrgv.github.io/phyloFlash/usage.html + tool_dev_url: https://github.com/HRGV/phyloFlash + doi: "10.1128/mSystems.00920-20" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: Channel containing single or paired-end reads + pattern: "*.{fastq.gz,fq.gz}" + - sliva_db: + type: folder + description: Folder containing the SILVA database + pattern: "ref" + - univec_db: + type: folder + description: Folder containing UniVec database + pattern: "UniVec" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - results: + type: folder + description: Folder containing the results of phyloFlash analysis + pattern: "${prefix}*" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@abhi18av" diff --git a/modules/picard/collecthsmetrics/main.nf b/modules/picard/collecthsmetrics/main.nf new file mode 100644 index 00000000..9dabc3aa --- /dev/null +++ b/modules/picard/collecthsmetrics/main.nf @@ -0,0 +1,48 @@ +process PICARD_COLLECTHSMETRICS { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::picard=2.26.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/picard:2.26.7--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.26.7--hdfd78af_0' }" + + input: + tuple val(meta), path(bam) + path fasta + path fai + path bait_intervals + path target_intervals + + output: + tuple val(meta), path("*collecthsmetrics.txt"), emit: hs_metrics + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def reference = fasta ? "-R $fasta" : "" + + def avail_mem = 3 + if (!task.memory) { + log.info '[Picard CollectHsMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + picard \\ + -Xmx${avail_mem}g \\ + CollectHsMetrics \\ + $args \\ + $reference \\ + -BAIT_INTERVALS $bait_intervals \\ + -TARGET_INTERVALS $target_intervals \\ + -INPUT $bam \\ + -OUTPUT ${prefix}_collecthsmetrics.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + picard: \$(echo \$(picard CollectHsMetrics --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:) + END_VERSIONS + """ +} diff --git a/modules/picard/collecthsmetrics/meta.yml b/modules/picard/collecthsmetrics/meta.yml new file mode 100644 index 00000000..4b94909f --- /dev/null +++ b/modules/picard/collecthsmetrics/meta.yml @@ -0,0 +1,66 @@ +name: picard_collecthsmetrics +description: Collects hybrid-selection (HS) metrics for a SAM or BAM file. +keywords: + - alignment + - metrics + - statistics + - insert + - hybrid-selection + - quality + - bam +tools: + - picard: + description: | + A set of command line tools (in Java) for manipulating high-throughput sequencing (HTS) + data and formats such as SAM/BAM/CRAM and VCF. + homepage: https://broadinstitute.github.io/picard/ + documentation: https://broadinstitute.github.io/picard/ + tool_dev_url: https://github.com/broadinstitute/picard/ + licence: ["MIT"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: An aligned BAM/SAM file + pattern: "*.{bam,sam}" + - fasta: + type: file + description: | + A reference file to calculate dropout metrics measuring reduced representation of reads. + Optional input. + pattern: "*.fasta" + - fai: + type: file + description: Index of FASTA file. Only needed when fasta is supplied. + pattern: "*.fai" + - bait_intervals: + type: file + description: An interval list file that contains the locations of the baits used. + pattern: "baits.interval_list" + - target_intervals: + type: file + description: An interval list file that contains the locations of the targets. + pattern: "targets.interval_list" + +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" + - hs_metrics: + type: file + description: The metrics file. + pattern: "*_collecthsmetrics.txt" + +authors: + - "@projectoriented" diff --git a/modules/picard/collectmultiplemetrics/functions.nf b/modules/picard/collectmultiplemetrics/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/picard/collectmultiplemetrics/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 c0059a40..481761e3 100644 --- a/modules/picard/collectmultiplemetrics/main.nf +++ b/modules/picard/collectmultiplemetrics/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PICARD_COLLECTMULTIPLEMETRICS { 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::picard=2.23.9" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/picard:2.23.9--0" - } else { - container "quay.io/biocontainers/picard:2.23.9--0" - } + conda (params.enable_conda ? "bioconda::picard=2.26.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/picard:2.26.7--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.26.7--hdfd78af_0' }" input: tuple val(meta), path(bam) @@ -25,11 +14,11 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def avail_mem = 3 if (!task.memory) { log.info '[Picard CollectMultipleMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -40,11 +29,14 @@ process PICARD_COLLECTMULTIPLEMETRICS { picard \\ -Xmx${avail_mem}g \\ CollectMultipleMetrics \\ - $options.args \\ + $args \\ INPUT=$bam \\ 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 + "${task.process}": + picard: \$(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..613afc62 100644 --- a/modules/picard/collectmultiplemetrics/meta.yml +++ b/modules/picard/collectmultiplemetrics/meta.yml @@ -14,6 +14,7 @@ tools: data and formats such as SAM/BAM/CRAM and VCF. homepage: https://broadinstitute.github.io/picard/ documentation: https://broadinstitute.github.io/picard/ + licence: ['MIT'] input: - meta: type: map @@ -41,9 +42,9 @@ output: type: file description: PDF plots of metrics pattern: "*.{pdf}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/picard/collectwgsmetrics/functions.nf b/modules/picard/collectwgsmetrics/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/picard/collectwgsmetrics/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 f1c69d28..361ca1b5 100644 --- a/modules/picard/collectwgsmetrics/main.nf +++ b/modules/picard/collectwgsmetrics/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PICARD_COLLECTWGSMETRICS { 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::picard=2.25.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/picard:2.25.0--0" - } else { - container "quay.io/biocontainers/picard:2.25.0--0" - } + conda (params.enable_conda ? "bioconda::picard=2.26.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/picard:2.26.7--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.26.7--hdfd78af_0' }" input: tuple val(meta), path(bam), path(bai) @@ -24,11 +13,11 @@ process PICARD_COLLECTWGSMETRICS { output: tuple val(meta), path("*_metrics"), emit: metrics - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def avail_mem = 3 if (!task.memory) { log.info '[Picard CollectWgsMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -39,11 +28,14 @@ process PICARD_COLLECTWGSMETRICS { picard \\ -Xmx${avail_mem}g \\ CollectWgsMetrics \\ - $options.args \\ + $args \\ INPUT=$bam \\ 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 + "${task.process}": + picard: \$(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..5b4d8139 100644 --- a/modules/picard/collectwgsmetrics/meta.yml +++ b/modules/picard/collectwgsmetrics/meta.yml @@ -13,6 +13,7 @@ tools: data and formats such as SAM/BAM/CRAM and VCF. homepage: https://broadinstitute.github.io/picard/ documentation: https://broadinstitute.github.io/picard/ + licence: ['MIT'] input: - meta: type: map @@ -36,10 +37,10 @@ output: type: file description: Alignment metrics files generated by picard pattern: "*_{metrics}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@flowuenne" diff --git a/modules/picard/filtersamreads/main.nf b/modules/picard/filtersamreads/main.nf new file mode 100644 index 00000000..70bd2fa7 --- /dev/null +++ b/modules/picard/filtersamreads/main.nf @@ -0,0 +1,59 @@ +process PICARD_FILTERSAMREADS { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::picard=2.26.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/picard:2.26.7--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.26.7--hdfd78af_0' }" + + input: + tuple val(meta), path(bam), path(readlist) + val filter + + output: + tuple val(meta), path("*.bam"), emit: bam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def avail_mem = 3 + if (!task.memory) { + log.info '[Picard FilterSamReads] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + if ( filter == 'includeAligned' || filter == 'excludeAligned' ) { + """ + picard \\ + FilterSamReads \\ + -Xmx${avail_mem}g \\ + --INPUT $bam \\ + --OUTPUT ${prefix}.bam \\ + --FILTER $filter \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + picard: \$(picard FilterSamReads --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:) + END_VERSIONS + """ + } else if ( filter == 'includeReadList' || filter == 'excludeReadList' ) { + """ + picard \\ + FilterSamReads \\ + -Xmx${avail_mem}g \\ + --INPUT $bam \\ + --OUTPUT ${prefix}.bam \\ + --FILTER $filter \\ + --READ_LIST_FILE $readlist \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + picard: \$(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 new file mode 100644 index 00000000..d63ebcf0 --- /dev/null +++ b/modules/picard/filtersamreads/meta.yml @@ -0,0 +1,51 @@ +name: picard_filtersamreads +description: Filters SAM/BAM files to include/exclude either aligned/unaligned reads or based on a read list +keywords: + - bam + - filter +tools: + - picard: + description: | + A set of command line tools (in Java) for manipulating high-throughput sequencing (HTS) + data and formats such as SAM/BAM/CRAM and VCF. + homepage: https://broadinstitute.github.io/picard/ + documentation: https://broadinstitute.github.io/picard/ + tool_dev_url: https://github.com/broadinstitute/picard + doi: "" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: List of BAM files. If filtering without read list must be sorted by queryname with picard sortsam + pattern: "*.{bam}" + - filter: + type: value + description: Picard filter type + pattern: "includeAligned|excludeAligned|includeReadList|excludeReadList" + - readlist: + type: file + description: Optional text file containing reads IDs to include or exclude + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Filtered BAM file + pattern: "*.{bam}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@jfy133" diff --git a/modules/picard/markduplicates/functions.nf b/modules/picard/markduplicates/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/picard/markduplicates/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 d7647414..3087bff4 100644 --- a/modules/picard/markduplicates/main.nf +++ b/modules/picard/markduplicates/main.nf @@ -1,34 +1,24 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PICARD_MARKDUPLICATES { 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::picard=2.23.9" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/picard:2.23.9--0" - } else { - container "quay.io/biocontainers/picard:2.23.9--0" - } + conda (params.enable_conda ? "bioconda::picard=2.26.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/picard:2.26.7--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.26.7--hdfd78af_0' }" input: tuple val(meta), path(bam) output: 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def avail_mem = 3 if (!task.memory) { log.info '[Picard MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -39,11 +29,14 @@ process PICARD_MARKDUPLICATES { picard \\ -Xmx${avail_mem}g \\ MarkDuplicates \\ - $options.args \\ - INPUT=$bam \\ - OUTPUT=${prefix}.bam \\ - METRICS_FILE=${prefix}.MarkDuplicates.metrics.txt + $args \\ + I=$bam \\ + 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 + "${task.process}": + picard: \$(echo \$(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 6420ce9a..c9a08b36 100644 --- a/modules/picard/markduplicates/meta.yml +++ b/modules/picard/markduplicates/meta.yml @@ -1,46 +1,52 @@ name: picard_markduplicates description: Locate and tag duplicate reads in a BAM file keywords: - - markduplicates - - pcr - - duplicates - - bam - - sam - - cram + - markduplicates + - pcr + - duplicates + - bam + - sam + - cram tools: - - picard: - description: | - A set of command line tools (in Java) for manipulating high-throughput sequencing (HTS) - data and formats such as SAM/BAM/CRAM and VCF. - homepage: https://broadinstitute.github.io/picard/ - documentation: https://broadinstitute.github.io/picard/ + - picard: + description: | + A set of command line tools (in Java) for manipulating high-throughput sequencing (HTS) + data and formats such as SAM/BAM/CRAM and VCF. + homepage: https://broadinstitute.github.io/picard/ + documentation: https://broadinstitute.github.io/picard/ + licence: ['MIT'] input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: BAM file - pattern: "*.{bam}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM file + pattern: "*.{bam}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: BAM file with duplicate reads marked/removed - pattern: "*.{bam}" - - metrics: - type: file - description: Duplicate metrics file generated by picard - pattern: "*.{metrics.txt}" - - version: - type: file - description: File containing software version - pattern: "*.{version.txt}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM file with duplicate reads marked/removed + pattern: "*.{bam}" + - bai: + type: file + description: An optional BAM index file. If desired, --CREATE_INDEX must be passed as a flag + pattern: "*.{bai}" + - metrics: + type: file + description: Duplicate metrics file generated by picard + pattern: "*.{metrics.txt}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - - "@drpatelh" + - "@drpatelh" + - "@projectoriented" diff --git a/modules/picard/mergesamfiles/functions.nf b/modules/picard/mergesamfiles/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/picard/mergesamfiles/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 abbfae8f..952d6331 100644 --- a/modules/picard/mergesamfiles/main.nf +++ b/modules/picard/mergesamfiles/main.nf @@ -1,33 +1,22 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PICARD_MERGESAMFILES { 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::picard=2.23.9" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/picard:2.23.9--0" - } else { - container "quay.io/biocontainers/picard:2.23.9--0" - } + conda (params.enable_conda ? "bioconda::picard=2.26.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/picard:2.26.7--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.26.7--hdfd78af_0' }" input: tuple val(meta), path(bams) output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def bam_files = bams.sort() def avail_mem = 3 if (!task.memory) { @@ -40,15 +29,21 @@ process PICARD_MERGESAMFILES { picard \\ -Xmx${avail_mem}g \\ MergeSamFiles \\ - $options.args \\ + $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 + "${task.process}": + picard: \$( echo \$(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 + "${task.process}": + picard: \$( echo \$(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..3d010c3c 100644 --- a/modules/picard/mergesamfiles/meta.yml +++ b/modules/picard/mergesamfiles/meta.yml @@ -12,6 +12,7 @@ tools: data and formats such as SAM/BAM/CRAM and VCF. homepage: https://broadinstitute.github.io/picard/ documentation: https://broadinstitute.github.io/picard/ + licence: ['MIT'] input: - meta: type: map @@ -32,9 +33,9 @@ output: type: file description: Merged BAM file pattern: "*.{bam}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/picard/sortsam/main.nf b/modules/picard/sortsam/main.nf new file mode 100644 index 00000000..7728484c --- /dev/null +++ b/modules/picard/sortsam/main.nf @@ -0,0 +1,40 @@ +process PICARD_SORTSAM { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::picard=2.26.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/picard:2.26.7--hdfd78af_0' : + 'quay.io/biocontainers/picard:2.26.7--hdfd78af_0' }" + + input: + tuple val(meta), path(bam) + val sort_order + + output: + tuple val(meta), path("*.bam"), emit: bam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def avail_mem = 3 + if (!task.memory) { + log.info '[Picard SortSam] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + picard \\ + SortSam \\ + -Xmx${avail_mem}g \\ + --INPUT $bam \\ + --OUTPUT ${prefix}.bam \\ + --SORT_ORDER $sort_order + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + picard: \$(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 new file mode 100644 index 00000000..aa90e456 --- /dev/null +++ b/modules/picard/sortsam/meta.yml @@ -0,0 +1,48 @@ +name: picard_sortsam +description: Sorts BAM/SAM files based on a variety of picard specific criteria +keywords: + - sort + - bam + - sam +tools: + - picard: + description: | + A set of command line tools (in Java) for manipulating high-throughput sequencing (HTS) + data and formats such as SAM/BAM/CRAM and VCF. + homepage: https://broadinstitute.github.io/picard/ + documentation: https://broadinstitute.github.io/picard/ + 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,sam}" + - sort_order: + type: value + description: Picard sort order type + pattern: "unsorted|queryname|coordinate|duplicate|unknown" + +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: Sorted BAM/CRAM/SAM file + pattern: "*.{bam}" + + +authors: + - "@jfy133" diff --git a/modules/pirate/main.nf b/modules/pirate/main.nf new file mode 100644 index 00000000..70de52e6 --- /dev/null +++ b/modules/pirate/main.nf @@ -0,0 +1,33 @@ +process PIRATE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::pirate=1.0.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pirate%3A1.0.4--hdfd78af_1' : + '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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + PIRATE \\ + $args \\ + --threads $task.cpus \\ + --input ./ \\ + --output results/ + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pirate: \$( 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/modules/plasmidid/functions.nf b/modules/plasmidid/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/plasmidid/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..7404a678 100644 --- a/modules/plasmidid/main.nf +++ b/modules/plasmidid/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PLASMIDID { 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::plasmidid=1.6.5' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/plasmidid:1.6.5--hdfd78af_0' - } else { - container 'quay.io/biocontainers/plasmidid:1.6.5--hdfd78af_0' - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/plasmidid:1.6.5--hdfd78af_0' : + 'quay.io/biocontainers/plasmidid:1.6.5--hdfd78af_0' }" input: tuple val(meta), path(scaffold) @@ -31,20 +20,23 @@ 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: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" """ plasmidID \\ -d $fasta \\ -s $prefix \\ -c $scaffold \\ - $options.args \\ + $args \\ -o . mv NO_GROUP/$prefix ./$prefix - echo \$(plasmidID --version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + plasmidid: \$(echo \$(plasmidID --version 2>&1)) + END_VERSIONS """ } diff --git a/modules/plasmidid/meta.yml b/modules/plasmidid/meta.yml index b7b188f8..8cde23c5 100644 --- a/modules/plasmidid/meta.yml +++ b/modules/plasmidid/meta.yml @@ -66,10 +66,10 @@ output: type: directory description: Directory containing the kmer files produced by plasmidid pattern: "database" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/plink/extract/main.nf b/modules/plink/extract/main.nf new file mode 100644 index 00000000..9b8a52f3 --- /dev/null +++ b/modules/plink/extract/main.nf @@ -0,0 +1,37 @@ +process PLINK_EXTRACT { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::plink=1.90b6.21" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/plink:1.90b6.21--h779adbc_1' : + 'quay.io/biocontainers/plink:1.90b6.21--h779adbc_1' }" + + input: + tuple val(meta), path(bed), path(bim), path(fam), path(variants) + + output: + tuple val(meta), path("*.bed"), emit: bed + tuple val(meta), path("*.bim"), emit: bim + tuple val(meta), path("*.fam"), emit: fam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + if( "$bed" == "${prefix}.bed" ) error "Input and output names are the same, use the suffix option to disambiguate" + """ + plink \\ + --bfile ${meta.id} \\ + $args \\ + --extract $variants \\ + --threads $task.cpus \\ + --make-bed \\ + --out $prefix + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + plink: \$(echo \$(plink --version) | sed 's/^PLINK v//;s/64.*//') + END_VERSIONS + """ +} diff --git a/modules/plink/extract/meta.yml b/modules/plink/extract/meta.yml new file mode 100644 index 00000000..3978fbb4 --- /dev/null +++ b/modules/plink/extract/meta.yml @@ -0,0 +1,62 @@ +name: plink_extract +description: Subset plink bfiles with a text file of variant identifiers +keywords: + - extract + - plink +tools: + - plink: + description: Whole genome association analysis toolset, designed to perform a range of basic, large-scale analyses in a computationally efficient manner. + homepage: None + documentation: None + tool_dev_url: None + doi: "" + licence: ['GPL'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: PLINK binary biallelic genotype table + pattern: "*.{bed}" + - bim: + type: file + description: PLINK extended MAP file + pattern: "*.{bim}" + - fam: + type: file + description: PLINK sample information file + pattern: "*.{fam}" + - variants: + type: file + description: A text file containing variant identifiers to keep (one per line) + pattern: "*.{keep}" + +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" + - bed: + type: file + description: PLINK binary biallelic genotype table + pattern: "*.{bed}" + - bim: + type: file + description: PLINK extended MAP file + pattern: "*.{bim}" + - fam: + type: file + description: PLINK sample information file + pattern: "*.{fam}" + +authors: + - "@nebfield" diff --git a/modules/plink/vcf/main.nf b/modules/plink/vcf/main.nf new file mode 100644 index 00000000..719e90d2 --- /dev/null +++ b/modules/plink/vcf/main.nf @@ -0,0 +1,36 @@ +process PLINK_VCF { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::plink=1.90b6.21" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/plink:1.90b6.21--h779adbc_1' : + 'quay.io/biocontainers/plink:1.90b6.21--h779adbc_1' }" + + input: + tuple val(meta), path(vcf) + + output: + tuple val(meta), path("*.bed"), emit: bed, optional: true + tuple val(meta), path("*.bim"), emit: bim, optional: true + tuple val(meta), path("*.fam"), emit: fam, optional: true + + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + plink \\ + --vcf ${vcf} \\ + $args \\ + --threads $task.cpus \\ + --out ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + plink: \$(echo \$(plink --version 2>&1) | sed 's/^PLINK v//' | sed 's/..-bit.*//' ) + END_VERSIONS + """ +} diff --git a/modules/plink/vcf/meta.yml b/modules/plink/vcf/meta.yml new file mode 100644 index 00000000..d39892b7 --- /dev/null +++ b/modules/plink/vcf/meta.yml @@ -0,0 +1,53 @@ +name: plink_vcf +description: Analyses variant calling files using plink +keywords: + - plink + - vcf +tools: + - plink: + description: | + Whole genome association analysis toolset, designed to perform a range + of basic, large-scale analyses in a computationally efficient manner + homepage: "https://www.cog-genomics.org/plink" + documentation: None + tool_dev_url: "https://www.cog-genomics.org/plink/1.9/dev" + doi: "" + licence: ['GPL'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: Variant calling file (vcf) + pattern: "*.{vcf}" + +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" + - bed: + type: file + description: PLINK binary biallelic genotype table + pattern: "*.{bed}" + - bim: + type: file + description: PLINK extended MAP file + pattern: "*.{bim}" + - fam: + type: file + description: PLINK sample information file + pattern: "*.{fam}" + +authors: + - "@Mxrcon" + - "@abhi18av" diff --git a/modules/plink2/vcf/main.nf b/modules/plink2/vcf/main.nf new file mode 100644 index 00000000..078ece1e --- /dev/null +++ b/modules/plink2/vcf/main.nf @@ -0,0 +1,33 @@ +process PLINK2_VCF { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::plink2=2.00a2.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/plink2:2.00a2.3--h712d239_1' : + 'quay.io/biocontainers/plink2:2.00a2.3--h712d239_1' }" + + input: + tuple val(meta), path(vcf) + + output: + tuple val(meta), path("*.pgen"), emit: pgen + tuple val(meta), path("*.psam"), emit: psam + tuple val(meta), path("*.pvar"), emit: pvar + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + plink2 \\ + $args \\ + --vcf $vcf \\ + --out ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + plink2: \$(plink2 --version 2>&1 | sed 's/^PLINK v//; s/ 64.*\$//' ) + END_VERSIONS + """ +} diff --git a/modules/plink2/vcf/meta.yml b/modules/plink2/vcf/meta.yml new file mode 100644 index 00000000..1b2f3a9b --- /dev/null +++ b/modules/plink2/vcf/meta.yml @@ -0,0 +1,52 @@ +name: plink2_vcf +description: Import variant genetic data using plink2 +keywords: + - plink2 + - import +tools: + - plink2: + description: | + Whole genome association analysis toolset, designed to perform a range + of basic, large-scale analyses in a computationally efficient manner + homepage: http://www.cog-genomics.org/plink/2.0/ + documentation: http://www.cog-genomics.org/plink/2.0/general_usage + tool_dev_url: None + doi: "" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: Variant calling file (vcf) + pattern: "*.{vcf}, *.{vcf.gz}" + +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" + - pgen: + type: file + description: PLINK 2 binary genotype table + pattern: "*.{pgen}" + - psam: + type: file + description: PLINK 2 sample information file + pattern: "*.{psam}" + - pvar: + type: file + description: PLINK 2 variant information file + pattern: "*.{psam}" + +authors: + - "@nebfield" diff --git a/modules/pmdtools/filter/main.nf b/modules/pmdtools/filter/main.nf new file mode 100644 index 00000000..0b3bcbc6 --- /dev/null +++ b/modules/pmdtools/filter/main.nf @@ -0,0 +1,52 @@ +process PMDTOOLS_FILTER { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::pmdtools=0.60" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pmdtools:0.60--hdfd78af_5' : + 'quay.io/biocontainers/pmdtools:0.60--hdfd78af_5' }" + + input: + tuple val(meta), path(bam), path (bai) + val(threshold) + path(reference) + + output: + tuple val(meta), path("*.bam"), emit: bam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def args3 = task.ext.args3 ?: '' + def split_cpus = Math.floor(task.cpus/2) + def prefix = task.ext.prefix ?: "${meta.id}" + if ("$bam" == "${prefix}.bam") error "[pmdtools/filter] Input and output names are the same, use the suffix option to disambiguate!" + //threshold and header flags activate filtering function of pmdtools + """ + samtools \\ + calmd \\ + $bam \\ + $reference \\ + $args \\ + -@ ${split_cpus} \\ + | pmdtools \\ + --threshold $threshold \\ + --header \\ + $args2 \\ + | samtools \\ + view \\ + $args3 \\ + -Sb \\ + - \\ + -@ ${split_cpus} \\ + -o ${prefix}.bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pmdtools: \$( pmdtools --version | cut -f2 -d ' ' | sed 's/v//') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ +} diff --git a/modules/pmdtools/filter/meta.yml b/modules/pmdtools/filter/meta.yml new file mode 100644 index 00000000..72abbfdc --- /dev/null +++ b/modules/pmdtools/filter/meta.yml @@ -0,0 +1,55 @@ +name: pmdtools_filter +description: pmdtools command to filter ancient DNA molecules from others +keywords: + - pmdtools + - aDNA + - filter + - damage +tools: + - pmdtools: + description: Compute postmortem damage patterns and decontaminate ancient genomes + homepage: https://github.com/pontussk/PMDtools + documentation: https://github.com/pontussk/PMDtools + tool_dev_url: https://github.com/pontussk/PMDtools + doi: "10.1073/pnas.1318934111" + 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 file + pattern: "*.bam" + - bai: + type: file + description: BAM index file + pattern: "*.bai" + - threshold: + type: value + description: Post-mortem damage score threshold + - reference: + type: file + description: FASTA file + pattern: "*.{fa,fasta}" + +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: Filtered BAM file + pattern: "*.bam" + +authors: + - "@alexandregilardet" diff --git a/modules/porechop/main.nf b/modules/porechop/main.nf new file mode 100644 index 00000000..249efad9 --- /dev/null +++ b/modules/porechop/main.nf @@ -0,0 +1,32 @@ +process PORECHOP { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::porechop=0.2.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/porechop:0.2.4--py39h7cff6ad_2' : + 'quay.io/biocontainers/porechop:0.2.4--py38h8c62d01_2' }" + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("*.fastq.gz"), emit: reads + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + porechop \\ + -i $reads \\ + -t $task.cpus \\ + $args \\ + -o ${prefix}.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + porechop: \$( porechop --version ) + END_VERSIONS + """ +} diff --git a/modules/porechop/meta.yml b/modules/porechop/meta.yml new file mode 100644 index 00000000..81399d28 --- /dev/null +++ b/modules/porechop/meta.yml @@ -0,0 +1,50 @@ +name: porechop +description: Adapter removal and demultiplexing of Oxford Nanopore reads +keywords: + - adapter + - nanopore + - demultiplexing +tools: + - porechop: + description: Adapter removal and demultiplexing of Oxford Nanopore reads + homepage: "https://github.com/rrwick/Porechop" + documentation: "https://github.com/rrwick/Porechop" + tool_dev_url: "https://github.com/rrwick/Porechop" + doi: "10.1099/mgen.0.000132" + licence: ["GPL v3"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: fastq/fastq.gz file + pattern: "*.{fastq,fastq.gz,fq,fq.gz}" + +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: Demultiplexed and/or adapter-trimmed fastq.gz file + pattern: "*.{fastq.gz}" + +authors: + - "@ggabernet" + - "@jasmezz" + - "@d4straub" + - "@LaurenceKuhl" + - "@SusiJo" + - "@jonasscheid" + - "@jonoave" + - "@GokceOGUZ" diff --git a/modules/preseq/lcextrap/functions.nf b/modules/preseq/lcextrap/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/preseq/lcextrap/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..b5bd0620 100644 --- a/modules/preseq/lcextrap/main.nf +++ b/modules/preseq/lcextrap/main.nf @@ -1,23 +1,12 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PRESEQ_LCEXTRAP { tag "$meta.id" label 'process_medium' label 'error_ignore' - 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::preseq=3.1.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/preseq:3.1.2--h06ef8b0_1" - } else { - container "quay.io/biocontainers/preseq:3.1.2--h06ef8b0_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/preseq:3.1.2--h06ef8b0_1' : + 'quay.io/biocontainers/preseq:3.1.2--h06ef8b0_1' }" input: tuple val(meta), path(bam) @@ -25,21 +14,24 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def paired_end = meta.single_end ? '' : '-pe' """ preseq \\ lc_extrap \\ - $options.args \\ + $args \\ $paired_end \\ -output ${prefix}.ccurve.txt \\ $bam cp .command.err ${prefix}.command.log - echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + preseq: \$(echo \$(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..bdc61228 100755 --- a/modules/preseq/lcextrap/meta.yml +++ b/modules/preseq/lcextrap/meta.yml @@ -30,10 +30,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/prodigal/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..184b17bb 100644 --- a/modules/prodigal/main.nf +++ b/modules/prodigal/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PRODIGAL { 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::prodigal=2.6.3" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/prodigal:2.6.3--h516909a_2" - } else { - container "quay.io/biocontainers/prodigal:2.6.3--h516909a_2" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/prodigal:2.6.3--h516909a_2' : + 'quay.io/biocontainers/prodigal:2.6.3--h516909a_2' }" input: tuple val(meta), path(genome) @@ -27,20 +16,23 @@ 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: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" """ prodigal -i "${genome}" \\ - $options.args \\ + $args \\ -f $output_format \\ -d "${prefix}.fna" \\ -o "${prefix}.${output_format}" \\ -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 + "${task.process}": + prodigal: \$(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 10e0a3eb..5bcc4e77 100644 --- a/modules/prodigal/meta.yml +++ b/modules/prodigal/meta.yml @@ -1,43 +1,37 @@ name: prodigal -## TODO nf-core: Add a description of the module and list keywords -description: write your description here +description: Prodigal (Prokaryotic Dynamic Programming Genefinding Algorithm) is a microbial (bacterial and archaeal) gene finding program keywords: - sort tools: - prodigal: - ## TODO nf-core: Add a description and other details for the software below description: Prodigal (Prokaryotic Dynamic Programming Genefinding Algorithm) is a microbial (bacterial and archaeal) gene finding program homepage: {} documentation: {} tool_dev_url: {} doi: "" - licence: ['GPL v3'] + licence: ["GPL v3"] -## TODO nf-core: Add a description of all of the variables used as input input: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - ## TODO nf-core: Delete / customise this example input - bam: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" -## TODO nf-core: Add a description of all of the variables used as output output: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" - ## TODO nf-core: Delete / customise this example output + description: File containing software versions + pattern: "versions.yml" - bam: type: file description: Sorted BAM/CRAM/SAM file diff --git a/modules/prokka/functions.nf b/modules/prokka/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/prokka/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..551a17b9 100644 --- a/modules/prokka/main.nf +++ b/modules/prokka/main.nf @@ -1,21 +1,11 @@ -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PROKKA { 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::prokka=1.14.6" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/prokka:1.14.6--pl526_0" - } else { - container "quay.io/biocontainers/prokka:1.14.6--pl526_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/prokka:1.14.6--pl526_0' : + 'quay.io/biocontainers/prokka:1.14.6--pl526_0' }" input: tuple val(meta), path(fasta) @@ -35,22 +25,25 @@ 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: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" def proteins_opt = proteins ? "--proteins ${proteins[0]}" : "" def prodigal_opt = prodigal_tf ? "--prodigaltf ${prodigal_tf[0]}" : "" """ prokka \\ - $options.args \\ + $args \\ --cpus $task.cpus \\ --prefix $prefix \\ $proteins_opt \\ $prodigal_tf \\ $fasta - echo \$(prokka --version 2>&1) | sed 's/^.*prokka //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + prokka: \$(echo \$(prokka --version 2>&1) | sed 's/^.*prokka //') + END_VERSIONS """ } diff --git a/modules/prokka/meta.yml b/modules/prokka/meta.yml index 4489b2fd..87446694 100644 --- a/modules/prokka/meta.yml +++ b/modules/prokka/meta.yml @@ -34,10 +34,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/pycoqc/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..e966b31c 100644 --- a/modules/pycoqc/main.nf +++ b/modules/pycoqc/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process PYCOQC { tag "$summary" 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:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::pycoqc=2.5.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/pycoqc:2.5.2--py_0" - } else { - container "quay.io/biocontainers/pycoqc:2.5.2--py_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pycoqc:2.5.2--py_0' : + 'quay.io/biocontainers/pycoqc:2.5.2--py_0' }" input: path summary @@ -24,17 +13,20 @@ process PYCOQC { output: path "*.html" , emit: html path "*.json" , emit: json - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ pycoQC \\ - $options.args \\ + $args \\ -f $summary \\ -o pycoqc.html \\ -j pycoqc.json - echo \$(pycoQC --version 2>&1) | sed 's/^.*pycoQC v//; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pycoqc: \$(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..33bd6b07 100644 --- a/modules/pycoqc/meta.yml +++ b/modules/pycoqc/meta.yml @@ -38,10 +38,10 @@ output: type: file description: Results in JSON format pattern: "*.{json}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" diff --git a/modules/pydamage/analyze/main.nf b/modules/pydamage/analyze/main.nf new file mode 100644 index 00000000..c06c592c --- /dev/null +++ b/modules/pydamage/analyze/main.nf @@ -0,0 +1,32 @@ +process PYDAMAGE_ANALYZE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::pydamage=0.62" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pydamage:0.62--pyhdfd78af_0' : + 'quay.io/biocontainers/pydamage:0.62--pyhdfd78af_0' }" + + input: + tuple val(meta), path(bam), path(bai) + + output: + tuple val(meta), path("pydamage_results/pydamage_results.csv"), emit: csv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + pydamage \\ + analyze \\ + $args \\ + -p $task.cpus \\ + $bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pydamage: \$(echo \$(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 new file mode 100644 index 00000000..918fbce9 --- /dev/null +++ b/modules/pydamage/analyze/meta.yml @@ -0,0 +1,55 @@ +name: pydamage_analyze +description: Damage parameter estimation for ancient DNA +keywords: + - ancient DNA + - aDNA + - de novo assembly + - filtering + - damage + - deamination + - miscoding lesions + - C to T + - palaeogenomics + - archaeogenomics + - palaeogenetics + - archaeogenetics +tools: + - pydamage: + description: Damage parameter estimation for ancient DNA + homepage: https://github.com/maxibor/pydamage + documentation: https://pydamage.readthedocs.io/ + tool_dev_url: https://github.com/maxibor/pydamage + 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/SAM file + pattern: "*.{bam,cram,sam}" + - bai: + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" + +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" + - csv: + type: file + description: PyDamage results as csv files + pattern: "*.csv" + +authors: + - "@maxibor" diff --git a/modules/pydamage/filter/main.nf b/modules/pydamage/filter/main.nf new file mode 100644 index 00000000..ab0b2115 --- /dev/null +++ b/modules/pydamage/filter/main.nf @@ -0,0 +1,32 @@ +process PYDAMAGE_FILTER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::pydamage=0.62" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/pydamage:0.62--pyhdfd78af_0' : + 'quay.io/biocontainers/pydamage:0.62--pyhdfd78af_0' }" + + input: + tuple val(meta), path(csv) + + output: + tuple val(meta), path("pydamage_results/pydamage_filtered_results.csv"), emit: csv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + + pydamage \\ + filter \\ + $args \\ + $csv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pydamage: \$(echo \$(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 new file mode 100644 index 00000000..706e38b0 --- /dev/null +++ b/modules/pydamage/filter/meta.yml @@ -0,0 +1,51 @@ +name: pydamage_filter +description: Damage parameter estimation for ancient DNA +keywords: + - ancient DNA + - aDNA + - de novo assembly + - filtering + - damage + - deamination + - miscoding lesions + - C to T + - palaeogenomics + - archaeogenomics + - palaeogenetics + - archaeogenetics +tools: + - pydamage: + description: Damage parameter estimation for ancient DNA + homepage: https://github.com/maxibor/pydamage + documentation: https://pydamage.readthedocs.io/ + tool_dev_url: https://github.com/maxibor/pydamage + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - csv: + type: file + description: csv file from pydamage analyze + pattern: "*.csv" + +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" + - csv: + type: file + description: PyDamage filtered results as csv file + pattern: "*.csv" + +authors: + - "@maxibor" diff --git a/modules/qcat/functions.nf b/modules/qcat/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/qcat/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..7d81952d 100644 --- a/modules/qcat/main.nf +++ b/modules/qcat/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process QCAT { 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::qcat=1.1.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/qcat:1.1.0--py_0" - } else { - container "quay.io/biocontainers/qcat:1.1.0--py_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/qcat:1.1.0--py_0' : + 'quay.io/biocontainers/qcat:1.1.0--py_0' }" input: tuple val(meta), path(reads) @@ -24,11 +13,11 @@ process QCAT { output: tuple val(meta), path("fastq/*.fastq.gz"), emit: reads - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ ## Unzip fastq file ## qcat doesn't support zipped files yet @@ -47,6 +36,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 + "${task.process}": + qcat: \$(qcat --version 2>&1 | sed 's/^.*qcat //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/qcat/meta.yml b/modules/qcat/meta.yml index 3280f26e..e0ab6a0f 100644 --- a/modules/qcat/meta.yml +++ b/modules/qcat/meta.yml @@ -9,6 +9,7 @@ tools: A demultiplexer for Nanopore samples homepage: https://github.com/nanoporetech/qcat documentation: https://github.com/nanoporetech/qcat#qcat + licence: ['MPL-2.0'] input: - meta: type: map @@ -30,10 +31,10 @@ output: type: file description: Demultiplexed fastq samples pattern: "*.fastq.gz" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@yuukiiwa" - "@drpatelh" diff --git a/modules/qualimap/bamqc/functions.nf b/modules/qualimap/bamqc/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/qualimap/bamqc/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..973fd6a4 100644 --- a/modules/qualimap/bamqc/main.nf +++ b/modules/qualimap/bamqc/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process QUALIMAP_BAMQC { 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::qualimap=2.2.2d" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1" - } else { - container "quay.io/biocontainers/qualimap:2.2.2d--1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1' : + 'quay.io/biocontainers/qualimap:2.2.2d--1' }" input: tuple val(meta), path(bam) @@ -25,11 +14,11 @@ process QUALIMAP_BAMQC { output: tuple val(meta), path("${prefix}"), emit: results - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" def collect_pairs = meta.single_end ? '' : '--collect-overlap-pairs' def memory = task.memory.toGiga() + "G" @@ -48,7 +37,7 @@ process QUALIMAP_BAMQC { qualimap \\ --java-mem-size=$memory \\ bamqc \\ - $options.args \\ + $args \\ -bam $bam \\ $regions \\ -p $strandedness \\ @@ -56,6 +45,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 + "${task.process}": + qualimap: \$(echo \$(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..6888d30e 100644 --- a/modules/qualimap/bamqc/meta.yml +++ b/modules/qualimap/bamqc/meta.yml @@ -14,6 +14,7 @@ tools: homepage: http://qualimap.bioinfo.cipf.es/ documentation: http://qualimap.conesalab.org/doc_html/index.html doi: 10.1093/bioinformatics/bts503 + licence: ['GPL-2.0-only'] input: - meta: type: map @@ -41,9 +42,9 @@ output: type: dir description: Qualimap results dir pattern: "*/*" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@phue" diff --git a/modules/qualimap/rnaseq/functions.nf b/modules/qualimap/rnaseq/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/qualimap/rnaseq/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..d83fcd99 100644 --- a/modules/qualimap/rnaseq/main.nf +++ b/modules/qualimap/rnaseq/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process QUALIMAP_RNASEQ { 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::qualimap=2.2.2d" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1" - } else { - container "quay.io/biocontainers/qualimap:2.2.2d--1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1' : + 'quay.io/biocontainers/qualimap:2.2.2d--1' }" input: tuple val(meta), path(bam) @@ -24,11 +13,11 @@ process QUALIMAP_RNASEQ { output: tuple val(meta), path("${prefix}"), emit: results - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" def paired_end = meta.single_end ? '' : '-pe' def memory = task.memory.toGiga() + "G" @@ -45,13 +34,16 @@ process QUALIMAP_RNASEQ { qualimap \\ --java-mem-size=$memory \\ rnaseq \\ - $options.args \\ + $args \\ -bam $bam \\ -gtf $gtf \\ -p $strandedness \\ $paired_end \\ -outdir $prefix - echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + qualimap: \$(echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//') + END_VERSIONS """ } diff --git a/modules/quast/functions.nf b/modules/quast/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/quast/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..e88051b5 100644 --- a/modules/quast/main.nf +++ b/modules/quast/main.nf @@ -1,21 +1,10 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process QUAST { 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:[:], publish_by_meta:[]) } conda (params.enable_conda ? 'bioconda::quast=5.0.2' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/quast:5.0.2--py37pl526hb5aa323_2' - } else { - container 'quay.io/biocontainers/quast:5.0.2--py37pl526hb5aa323_2' - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/quast:5.0.2--py37pl526hb5aa323_2' : + 'quay.io/biocontainers/quast:5.0.2--py37pl526hb5aa323_2' }" input: path consensus @@ -27,11 +16,11 @@ process QUAST { output: path "${prefix}" , emit: results path '*.tsv' , emit: tsv - path '*.version.txt', emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ?: software + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: 'quast' def features = use_gff ? "--features $gff" : '' def reference = use_fasta ? "-r $fasta" : '' """ @@ -40,9 +29,14 @@ process QUAST { $reference \\ $features \\ --threads $task.cpus \\ - $options.args \\ + $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 + "${task.process}": + quast: \$(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..05faa8b8 100644 --- a/modules/quast/meta.yml +++ b/modules/quast/meta.yml @@ -9,7 +9,8 @@ tools: description: | QUAST calculates quality metrics for genome assemblies homepage: http://bioinf.spbau.ru/quast - doi: + doi: https://doi.org/10.1093/bioinformatics/btt086 + licence: ['GPL-2.0-only'] input: - consensus: type: file @@ -36,10 +37,10 @@ output: pattern: "{prefix}.lineage_report.csv" - report: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/racon/main.nf b/modules/racon/main.nf new file mode 100644 index 00000000..9be5ce63 --- /dev/null +++ b/modules/racon/main.nf @@ -0,0 +1,35 @@ +process RACON { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::racon=1.4.20" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/racon:1.4.20--h9a82719_1' : + 'quay.io/biocontainers/racon:1.4.20--h9a82719_1' }" + + input: + tuple val(meta), path(reads), path(assembly), path(paf) + + output: + tuple val(meta), path('*_assembly_consensus.fasta.gz') , emit: improved_assembly + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + racon -t "$task.cpus" \\ + "${reads}" \\ + "${paf}" \\ + $args \\ + "${assembly}" > \\ + ${prefix}_assembly_consensus.fasta + + gzip -n ${prefix}_assembly_consensus.fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + racon: \$( racon --version 2>&1 | sed 's/^.*v//' ) + END_VERSIONS + """ +} diff --git a/modules/racon/meta.yml b/modules/racon/meta.yml new file mode 100644 index 00000000..2428f044 --- /dev/null +++ b/modules/racon/meta.yml @@ -0,0 +1,52 @@ +name: racon +description: Consensus module for raw de novo DNA assembly of long uncorrected reads +keywords: + - assembly + - pacbio + - nanopore + - polish +tools: + - racon: + description: Ultrafast consensus module for raw de novo genome assembly of long uncorrected reads. + homepage: https://github.com/lbcb-sci/racon + documentation: https://github.com/lbcb-sci/racon + tool_dev_url: https://github.com/lbcb-sci/racon + doi: https://doi.org/10.1101/gr.214270.116 + licence: ['MIT'] + +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. Racon expects single end reads + pattern: "*.{fastq,fastq.gz,fq,fq.gz}" + - assembly: + type: file + description: Genome assembly to be improved + pattern: "*.{fasta,fa}" + - paf: + type: file + description: Alignment in PAF format + pattern: "*.paf" + +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" + - improved_assembly: + type: file + description: Improved genome assembly + pattern: "*_assembly_consensus.fasta.gz" + +authors: + - "@avantonder" diff --git a/modules/rapidnj/functions.nf b/modules/rapidnj/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/rapidnj/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..04a08227 100644 --- a/modules/rapidnj/main.nf +++ b/modules/rapidnj/main.nf @@ -1,44 +1,38 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) +def VERSION = '2.3.2' // Version information not provided by tool on CLI process RAPIDNJ { 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:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::rapidnj=2.3.2 conda-forge::biopython=1.78" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-805c6e0f138f952f9c61cdd57c632a1a263ea990:3c52e4c8da6b3e4d69b9ca83fa4d366168898179-0" - } else { - container "quay.io/biocontainers/mulled-v2-805c6e0f138f952f9c61cdd57c632a1a263ea990:3c52e4c8da6b3e4d69b9ca83fa4d366168898179-0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-805c6e0f138f952f9c61cdd57c632a1a263ea990:3c52e4c8da6b3e4d69b9ca83fa4d366168898179-0' : + 'quay.io/biocontainers/mulled-v2-805c6e0f138f952f9c61cdd57c632a1a263ea990:3c52e4c8da6b3e4d69b9ca83fa4d366168898179-0' }" input: path alignment output: - path "*.sth" , emit: stockholm_alignment - path "*.tre" , emit: phylogeny - path "*.version.txt", emit: version + path "*.sth" , emit: stockholm_alignment + path "*.tre" , emit: phylogeny + path "versions.yml", emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ python \\ -c 'from Bio import SeqIO; SeqIO.convert("$alignment", "fasta", "alignment.sth", "stockholm")' rapidnj \\ alignment.sth \\ - $options.args \\ + $args \\ -i sth \\ -c $task.cpus \\ -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 + "${task.process}": + rapidnj: $VERSION + biopython: \$(python -c "import Bio; print(Bio.__version__)") + END_VERSIONS """ } diff --git a/modules/rapidnj/meta.yml b/modules/rapidnj/meta.yml index cf2c61fc..ead54e09 100644 --- a/modules/rapidnj/meta.yml +++ b/modules/rapidnj/meta.yml @@ -20,10 +20,10 @@ input: pattern: "*.{fasta,fas,fa,mfa}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - phylogeny: type: file description: A phylogeny in Newick format diff --git a/modules/rasusa/functions.nf b/modules/rasusa/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/rasusa/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..c2893d18 100644 --- a/modules/rasusa/main.nf +++ b/modules/rasusa/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process RASUSA { 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::rasusa=0.3.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/rasusa:0.3.0--h779adbc_1" - } else { - container "quay.io/biocontainers/rasusa:0.3.0--h779adbc_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/rasusa:0.3.0--h779adbc_1' : + 'quay.io/biocontainers/rasusa:0.3.0--h779adbc_1' }" input: tuple val(meta), path(reads), val(genome_size) @@ -24,19 +13,22 @@ process RASUSA { output: tuple val(meta), path('*.fastq.gz'), emit: reads - path '*.version.txt' , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def output = meta.single_end ? "--output ${prefix}.fastq.gz" : "--output ${prefix}_1.fastq.gz ${prefix}_2.fastq.gz" """ rasusa \\ - $options.args \\ + $args \\ --coverage $depth_cutoff \\ --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 + "${task.process}": + rasusa: \$(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..610afd3f 100644 --- a/modules/rasusa/meta.yml +++ b/modules/rasusa/meta.yml @@ -35,10 +35,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - reads: type: file description: Reads with subsampled coverage diff --git a/modules/raxmlng/functions.nf b/modules/raxmlng/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/raxmlng/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 02c01927..62b6c78a 100644 --- a/modules/raxmlng/main.nf +++ b/modules/raxmlng/main.nf @@ -1,21 +1,10 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process RAXMLNG { 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:[:], publish_by_meta:[]) } - conda (params.enable_conda ? "bioconda::raxml-ng=1.0.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/raxml-ng:1.0.2--h7447c1b_0" - } else { - container "quay.io/biocontainers/raxml-ng:1.0.2--h7447c1b_0" - } + conda (params.enable_conda ? 'bioconda::raxml-ng=1.0.3' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/raxml-ng:1.0.3--h32fcf60_0' : + 'quay.io/biocontainers/raxml-ng:1.0.3--h32fcf60_0' }" input: path alignment @@ -23,17 +12,20 @@ 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: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ raxml-ng \\ - $options.args \\ + $args \\ --msa $alignment \\ --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 + "${task.process}": + raxmlng: \$(echo \$(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..3cc558f4 100644 --- a/modules/raxmlng/meta.yml +++ b/modules/raxmlng/meta.yml @@ -20,10 +20,10 @@ input: pattern: "*.{fasta,fas,fa,mfa}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - phylogeny: type: file description: A phylogeny in Newick format diff --git a/modules/rmarkdownnotebook/main.nf b/modules/rmarkdownnotebook/main.nf new file mode 100644 index 00000000..f8183216 --- /dev/null +++ b/modules/rmarkdownnotebook/main.nf @@ -0,0 +1,88 @@ +include { dump_params_yml; indent_code_block } from "./parametrize" + +process RMARKDOWNNOTEBOOK { + tag "$meta.id" + label 'process_low' + + //NB: You likely want to override this with a container containing all required + //dependencies for your analysis. The container at least needs to contain the + //yaml and rmarkdown R packages. + conda (params.enable_conda ? "r-base=4.1.0 r-rmarkdown=2.9 r-yaml=2.2.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-31ad840d814d356e5f98030a4ee308a16db64ec5%3A0e852a1e4063fdcbe3f254ac2c7469747a60e361-0' : + 'quay.io/biocontainers/mulled-v2-31ad840d814d356e5f98030a4ee308a16db64ec5:0e852a1e4063fdcbe3f254ac2c7469747a60e361-0' }" + + input: + tuple val(meta), path(notebook) + val parameters + path input_files + + output: + tuple val(meta), path("*.html") , emit: report + tuple val(meta), path ("artifacts/*") , emit: artifacts, optional: true + tuple val(meta), path ("session_info.log"), emit: session_info + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def parametrize = (task.ext.parametrize == null) ? true : task.ext.parametrize + def implicit_params = (task.ext.implicit_params == null) ? true : task.ext.implicit_params + def meta_params = (task.ext.meta_params == null) ? true : task.ext.meta_params + + // Dump parameters to yaml file. + // Using a yaml file over using the CLI params because + // * no issue with escaping + // * allows to pass nested maps instead of just single values + def params_cmd = "" + def render_cmd = "" + if (parametrize) { + nb_params = [:] + if (implicit_params) { + nb_params["cpus"] = task.cpus + nb_params["artifact_dir"] = "artifacts" + nb_params["input_dir"] = "./" + } + if (meta_params) { + nb_params["meta"] = meta + } + nb_params += parameters + params_cmd = dump_params_yml(nb_params) + render_cmd = """\ + params = yaml::read_yaml('.params.yml') + rmarkdown::render('${prefix}.Rmd', params=params, envir=new.env()) + """ + } else { + render_cmd = "rmarkdown::render('${prefix}.Rmd')" + } + + """ + # Dump .params.yml heredoc (section will be empty if parametrization is disabled) + ${indent_code_block(params_cmd, 4)} + + # Create output directory + mkdir artifacts + + # Set parallelism for BLAS/MKL etc. to avoid over-booking of resources + export MKL_NUM_THREADS="$task.cpus" + export OPENBLAS_NUM_THREADS="$task.cpus" + export OMP_NUM_THREADS="$task.cpus" + + # Work around https://github.com/rstudio/rmarkdown/issues/1508 + # If the symbolic link is not replaced by a physical file + # output- and temporary files will be written to the original directory. + mv "${notebook}" "${notebook}.orig" + cp -L "${notebook}.orig" "${prefix}.Rmd" + + # Render notebook + Rscript - < versions.yml + "${task.process}": + rmarkdown: \$(Rscript -e "cat(paste(packageVersion('rmarkdown'), collapse='.'))") + END_VERSIONS + """ +} diff --git a/modules/rmarkdownnotebook/meta.yml b/modules/rmarkdownnotebook/meta.yml new file mode 100644 index 00000000..8d0f9d28 --- /dev/null +++ b/modules/rmarkdownnotebook/meta.yml @@ -0,0 +1,73 @@ +name: rmarkdownnotebook +description: Render an rmarkdown notebook. Supports parametrization. +keywords: + - R + - notebook + - reports +tools: + - rmarkdown: + description: Dynamic Documents for R + homepage: https://rmarkdown.rstudio.com/ + documentation: https://rmarkdown.rstudio.com/lesson-1.html + tool_dev_url: https://github.com/rstudio/rmarkdown + doi: "" + licence: GPL-3 + +params: + - parametrize: + type: boolean + description: If true, parametrize the notebook + - implicit_params: + type: boolean + description: | + If true (default), include the implicit params + * `input_dir`, which points to the directory containing the files added via `input_files`, + * `artifact_dir`, which points to the directory where the notebook should place output files, and + * `cpus`, which contains the value of ${task.cpus} + - meta_params: + type: boolean + description: | + If true, include a parameter `meta` which contains the information specified + via the `meta` input channel. + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - notebook: + type: file + description: Rmarkdown file + pattern: "*.{Rmd}" + - parameters: + type: map + description: | + Groovy map with notebook parameters which will be passed to + rmarkdown to generate parametrized reports. + - input_files: + type: path + description: One or multiple files serving as input data for the notebook. + pattern: "*" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - report: + type: file + description: HTML report generated from Rmarkdown + pattern: "*.html" + - session_info: + type: file + description: dump of R SessionInfo + pattern: "*.log" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@grst" diff --git a/modules/rmarkdownnotebook/parametrize.nf b/modules/rmarkdownnotebook/parametrize.nf new file mode 100644 index 00000000..05e259eb --- /dev/null +++ b/modules/rmarkdownnotebook/parametrize.nf @@ -0,0 +1,36 @@ +import org.yaml.snakeyaml.Yaml +import org.yaml.snakeyaml.DumperOptions + + +/** + * Multiline code blocks need to have the same indentation level + * as the `script:` section. This function re-indents code to the specified level. + */ +def indent_code_block(code, n_spaces) { + def indent_str = " ".multiply(n_spaces) + return code.stripIndent().split("\n").join("\n" + indent_str) +} + +/** + * Create a config YAML file from a groovy map + * + * @params task The process' `task` variable + * @returns a line to be inserted in the bash script. + */ +def dump_params_yml(params) { + DumperOptions options = new DumperOptions(); + options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); + def yaml = new Yaml(options) + def yaml_str = yaml.dump(params) + + // Writing the .params.yml file directly as follows does not work. + // It only works in 'exec:', but not if there is a `script:` section: + // task.workDir.resolve('.params.yml').text = yaml_str + + // Therefore, we inject it into the bash script: + return """\ + cat <<"END_PARAMS_SECTION" > ./.params.yml + ${indent_code_block(yaml_str, 8)} + END_PARAMS_SECTION + """ +} diff --git a/modules/roary/main.nf b/modules/roary/main.nf new file mode 100644 index 00000000..edda3281 --- /dev/null +++ b/modules/roary/main.nf @@ -0,0 +1,33 @@ +process ROARY { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::roary=3.13.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/roary:3.13.0--pl526h516909a_0' : + '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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + roary \\ + $args \\ + -p $task.cpus \\ + -f results/ \\ + $gff + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + roary: \$( 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/modules/rsem/calculateexpression/functions.nf b/modules/rsem/calculateexpression/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/rsem/calculateexpression/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..4b2ada47 100644 --- a/modules/rsem/calculateexpression/main.nf +++ b/modules/rsem/calculateexpression/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process RSEM_CALCULATEEXPRESSION { 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::rsem=1.3.3 bioconda::star=2.7.6a" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" - } else { - container "quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0' : + 'quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0' }" input: tuple val(meta), path(reads) @@ -27,15 +16,15 @@ 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: 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 args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" def strandedness = '' if (meta.strandedness == 'forward') { @@ -51,11 +40,15 @@ process RSEM_CALCULATEEXPRESSION { --temporary-folder ./tmp/ \\ $strandedness \\ $paired_end \\ - $options.args \\ + $args \\ $reads \\ \$INDEX \\ $prefix - rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rsem: \$(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/calculateexpression/meta.yml b/modules/rsem/calculateexpression/meta.yml index f8577085..fdfaa0c4 100644 --- a/modules/rsem/calculateexpression/meta.yml +++ b/modules/rsem/calculateexpression/meta.yml @@ -11,6 +11,7 @@ tools: homepage: https://github.com/deweylab/RSEM documentation: https://github.com/deweylab/RSEM doi: https://doi.org/10.1186/1471-2105-12-323 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -42,10 +43,10 @@ output: type: file description: RSEM logs pattern: "*.log" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/rsem/preparereference/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..a5b8922a 100644 --- a/modules/rsem/preparereference/main.nf +++ b/modules/rsem/preparereference/main.nf @@ -1,37 +1,27 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process RSEM_PREPAREREFERENCE { tag "$fasta" label 'process_high' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::rsem=1.3.3 bioconda::star=2.7.6a" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" - } else { - container "quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0' : + 'quay.io/biocontainers/mulled-v2-cf0123ef83b3c38c13e3b0696a3f285d3f20f15b:606b713ec440e799d53a2b51a6e79dbfd28ecf3e-0' }" input: path fasta, stageAs: "rsem/*" path gtf output: - path "rsem" , emit: index - path "rsem/*transcripts.fa", emit: transcript_fasta - path "*.version.txt" , emit: version + path "rsem" , emit: index + path "*transcripts.fa", emit: transcript_fasta + 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') } + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def args_list = args.tokenize() + if (args_list.contains('--star')) { + args_list.removeIf { it.contains('--star') } def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' """ STAR \\ @@ -41,27 +31,39 @@ process RSEM_PREPAREREFERENCE { --sjdbGTFfile $gtf \\ --runThreadN $task.cpus \\ $memory \\ - $options.args2 + $args2 rsem-prepare-reference \\ --gtf $gtf \\ --num-threads $task.cpus \\ - ${args.join(' ')} \\ + ${args_list.join(' ')} \\ $fasta \\ rsem/genome - rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g" > ${software}.version.txt + cp rsem/genome.transcripts.fa . + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rsem: \$(rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g") + star: \$(STAR --version | sed -e "s/STAR_//g") + END_VERSIONS """ } else { """ rsem-prepare-reference \\ --gtf $gtf \\ --num-threads $task.cpus \\ - $options.args \\ + $args \\ $fasta \\ rsem/genome - rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g" > ${software}.version.txt + cp rsem/genome.transcripts.fa . + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rsem: \$(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/meta.yml b/modules/rsem/preparereference/meta.yml index d7c02154..062f0256 100644 --- a/modules/rsem/preparereference/meta.yml +++ b/modules/rsem/preparereference/meta.yml @@ -10,6 +10,7 @@ tools: homepage: https://github.com/deweylab/RSEM documentation: https://github.com/deweylab/RSEM doi: https://doi.org/10.1186/1471-2105-12-323 + licence: ['GPL-3.0-or-later'] input: - fasta: type: file @@ -28,10 +29,10 @@ output: type: file description: Fasta file of transcripts pattern: "rsem/*transcripts.fa" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/bamstat/functions.nf b/modules/rseqc/bamstat/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/rseqc/bamstat/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 ac80b6d0..1141a13f 100644 --- a/modules/rseqc/bamstat/main.nf +++ b/modules/rseqc/bamstat/main.nf @@ -1,39 +1,31 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process RSEQC_BAMSTAT { 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::rseqc=3.0.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - } else { - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - } + conda (params.enable_conda ? "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : + 'quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1' }" input: tuple val(meta), path(bam) output: tuple val(meta), path("*.bam_stat.txt"), emit: txt - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bam_stat.py \\ -i $bam \\ - $options.args \\ + $args \\ > ${prefix}.bam_stat.txt - bam_stat.py --version | sed -e "s/bam_stat.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(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..561ba195 100644 --- a/modules/rseqc/bamstat/meta.yml +++ b/modules/rseqc/bamstat/meta.yml @@ -12,6 +12,7 @@ tools: homepage: http://rseqc.sourceforge.net/ documentation: http://rseqc.sourceforge.net/ doi: 10.1093/bioinformatics/bts356 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -27,10 +28,10 @@ output: type: file description: bam statistics report pattern: "*.bam_stat.txt" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/inferexperiment/functions.nf b/modules/rseqc/inferexperiment/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/rseqc/inferexperiment/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 da0958d4..2243c43e 100644 --- a/modules/rseqc/inferexperiment/main.nf +++ b/modules/rseqc/inferexperiment/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process RSEQC_INFEREXPERIMENT { 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::rseqc=3.0.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - } else { - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - } + conda (params.enable_conda ? "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : + 'quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1' }" input: tuple val(meta), path(bam) @@ -24,18 +13,21 @@ process RSEQC_INFEREXPERIMENT { output: tuple val(meta), path("*.infer_experiment.txt"), emit: txt - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ infer_experiment.py \\ -i $bam \\ -r $bed \\ - $options.args \\ + $args \\ > ${prefix}.infer_experiment.txt - infer_experiment.py --version | sed -e "s/infer_experiment.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(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..88eabc8a 100644 --- a/modules/rseqc/inferexperiment/meta.yml +++ b/modules/rseqc/inferexperiment/meta.yml @@ -11,6 +11,7 @@ tools: homepage: http://rseqc.sourceforge.net/ documentation: http://rseqc.sourceforge.net/ doi: 10.1093/bioinformatics/bts356 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -30,10 +31,10 @@ output: type: file description: infer_experiment results report pattern: "*.infer_experiment.txt" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/innerdistance/functions.nf b/modules/rseqc/innerdistance/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/rseqc/innerdistance/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 2688fca6..425737d6 100644 --- a/modules/rseqc/innerdistance/main.nf +++ b/modules/rseqc/innerdistance/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process RSEQC_INNERDISTANCE { 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::rseqc=3.0.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - } else { - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - } + conda (params.enable_conda ? "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : + 'quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1' }" input: tuple val(meta), path(bam) @@ -28,26 +17,32 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" if (!meta.single_end) { """ inner_distance.py \\ -i $bam \\ -r $bed \\ -o $prefix \\ - $options.args \\ + $args \\ > 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 + "${task.process}": + rseqc: \$(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 + "${task.process}": + rseqc: \$(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..27bcf242 100644 --- a/modules/rseqc/innerdistance/meta.yml +++ b/modules/rseqc/innerdistance/meta.yml @@ -11,6 +11,7 @@ tools: homepage: http://rseqc.sourceforge.net/ documentation: http://rseqc.sourceforge.net/ doi: 10.1093/bioinformatics/bts356 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -46,10 +47,10 @@ output: type: file description: script to reproduce the plot pattern: "*.inner_distance_plot.R" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/junctionannotation/functions.nf b/modules/rseqc/junctionannotation/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/rseqc/junctionannotation/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 909ee9ae..d2562e5c 100644 --- a/modules/rseqc/junctionannotation/main.nf +++ b/modules/rseqc/junctionannotation/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process RSEQC_JUNCTIONANNOTATION { 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::rseqc=3.0.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - } else { - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - } + conda (params.enable_conda ? "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : + 'quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1' }" input: tuple val(meta), path(bam) @@ -27,22 +16,25 @@ process RSEQC_JUNCTIONANNOTATION { tuple val(meta), path("*.r") , emit: rscript tuple val(meta), path("*.log") , emit: log tuple val(meta), path("*.junction.bed"), optional:true, emit: bed - tuple val(meta), path("*.interact.bed"), optional:true, emit: interact_bed + 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ junction_annotation.py \\ -i $bam \\ -r $bed \\ -o $prefix \\ - $options.args \\ + $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 + "${task.process}": + rseqc: \$(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..56364232 100644 --- a/modules/rseqc/junctionannotation/meta.yml +++ b/modules/rseqc/junctionannotation/meta.yml @@ -12,6 +12,7 @@ tools: homepage: http://rseqc.sourceforge.net/ documentation: http://rseqc.sourceforge.net/ doi: 10.1093/bioinformatics/bts356 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -52,10 +53,10 @@ output: description: Rscript to reproduce the plots pattern: "*.r" - log: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/junctionsaturation/functions.nf b/modules/rseqc/junctionsaturation/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/rseqc/junctionsaturation/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 e6e21638..695762b5 100644 --- a/modules/rseqc/junctionsaturation/main.nf +++ b/modules/rseqc/junctionsaturation/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process RSEQC_JUNCTIONSATURATION { 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::rseqc=3.0.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - } else { - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - } + conda (params.enable_conda ? "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : + 'quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1' }" input: tuple val(meta), path(bam) @@ -25,18 +14,21 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ junction_saturation.py \\ -i $bam \\ -r $bed \\ -o $prefix \\ - $options.args + $args - junction_saturation.py --version | sed -e "s/junction_saturation.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(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..05d814ad 100644 --- a/modules/rseqc/junctionsaturation/meta.yml +++ b/modules/rseqc/junctionsaturation/meta.yml @@ -12,6 +12,7 @@ tools: homepage: http://rseqc.sourceforge.net/ documentation: http://rseqc.sourceforge.net/ doi: 10.1093/bioinformatics/bts356 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -35,10 +36,10 @@ output: type: file description: Junction saturation R-script pattern: "*.r" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/readdistribution/functions.nf b/modules/rseqc/readdistribution/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/rseqc/readdistribution/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 a6ed6c9f..333193e3 100644 --- a/modules/rseqc/readdistribution/main.nf +++ b/modules/rseqc/readdistribution/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process RSEQC_READDISTRIBUTION { 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::rseqc=3.0.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - } else { - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - } + conda (params.enable_conda ? "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : + 'quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1' }" input: tuple val(meta), path(bam) @@ -24,17 +13,20 @@ process RSEQC_READDISTRIBUTION { output: tuple val(meta), path("*.read_distribution.txt"), emit: txt - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ read_distribution.py \\ -i $bam \\ -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 + "${task.process}": + rseqc: \$(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..4c736878 100644 --- a/modules/rseqc/readdistribution/meta.yml +++ b/modules/rseqc/readdistribution/meta.yml @@ -12,6 +12,7 @@ tools: homepage: http://rseqc.sourceforge.net/ documentation: http://rseqc.sourceforge.net/ doi: 10.1093/bioinformatics/bts356 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -31,10 +32,10 @@ output: type: file description: the read distribution report pattern: "*.read_distribution.txt" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/readduplication/functions.nf b/modules/rseqc/readduplication/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/rseqc/readduplication/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 6fb06f63..134f2e8d 100644 --- a/modules/rseqc/readduplication/main.nf +++ b/modules/rseqc/readduplication/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process RSEQC_READDUPLICATION { 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::rseqc=3.0.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1" - } else { - container "quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1" - } + conda (params.enable_conda ? "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : + 'quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1' }" input: tuple val(meta), path(bam) @@ -26,17 +15,20 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ read_duplication.py \\ -i $bam \\ -o $prefix \\ - $options.args + $args - read_duplication.py --version | sed -e "s/read_duplication.py //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(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..3623de80 100644 --- a/modules/rseqc/readduplication/meta.yml +++ b/modules/rseqc/readduplication/meta.yml @@ -11,6 +11,7 @@ tools: homepage: http://rseqc.sourceforge.net/ documentation: http://rseqc.sourceforge.net/ doi: 10.1093/bioinformatics/bts356 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -42,10 +43,10 @@ output: type: file description: script to reproduce the plot pattern: "*.R" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@kevinmenden" diff --git a/modules/rseqc/tin/main.nf b/modules/rseqc/tin/main.nf new file mode 100644 index 00000000..b7bff0f3 --- /dev/null +++ b/modules/rseqc/tin/main.nf @@ -0,0 +1,33 @@ +process RSEQC_TIN { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::rseqc=3.0.1 'conda-forge::r-base>=3.5'" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/rseqc:3.0.1--py37h516909a_1' : + 'quay.io/biocontainers/rseqc:3.0.1--py37h516909a_1' }" + + input: + tuple val(meta), path(bam), path(bai) + path bed + + output: + tuple val(meta), path("*.txt"), emit: txt + tuple val(meta), path("*.xls"), emit: xls + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + tin.py \\ + -i $bam \\ + -r $bed \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(tin.py --version | sed -e "s/tin.py //g") + END_VERSIONS + """ +} diff --git a/modules/rseqc/tin/meta.yml b/modules/rseqc/tin/meta.yml new file mode 100644 index 00000000..158b4033 --- /dev/null +++ b/modules/rseqc/tin/meta.yml @@ -0,0 +1,48 @@ +name: rseqc_tin +description: Calculte TIN (transcript integrity number) from RNA-seq reads +keywords: + - rnaseq + - transcript + - integrity +tools: + - rseqc: + description: | + RSeQC package provides a number of useful modules that can comprehensively evaluate + high throughput sequence data especially RNA-seq data. + homepage: http://rseqc.sourceforge.net/ + documentation: http://rseqc.sourceforge.net/ + doi: 10.1093/bioinformatics/bts356 + licence: ['GPL-3.0-or-later'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Input BAM file + pattern: "*.{bam}" + - bai: + type: file + description: Index for input BAM file + pattern: "*.{bai}" + - bed: + type: file + description: BED file containing the reference gene model + pattern: "*.{bed}" +output: + - txt: + type: file + description: TXT file containing tin.py results summary + pattern: "*.txt" + - xls: + type: file + description: XLS file containing tin.py results + pattern: "*.xls" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@drpatelh" diff --git a/modules/salmon/index/functions.nf b/modules/salmon/index/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/salmon/index/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 17d5bc06..b0a2f973 100644 --- a/modules/salmon/index/main.nf +++ b/modules/salmon/index/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SALMON_INDEX { tag "$transcript_fasta" label "process_medium" - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) } - conda (params.enable_conda ? "bioconda::salmon=1.4.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/salmon:1.4.0--hf69c8f4_0" - } else { - container "quay.io/biocontainers/salmon:1.4.0--hf69c8f4_0" - } + conda (params.enable_conda ? 'bioconda::salmon=1.5.2' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/salmon:1.5.2--h84f40af_0' : + 'quay.io/biocontainers/salmon:1.5.2--h84f40af_0' }" input: path genome_fasta @@ -24,10 +13,10 @@ process SALMON_INDEX { output: path "salmon" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' def get_decoy_ids = "grep '^>' $genome_fasta | cut -d ' ' -f 1 > decoys.txt" def gentrome = "gentrome.fa" if (genome_fasta.endsWith('.gz')) { @@ -44,8 +33,11 @@ process SALMON_INDEX { --threads $task.cpus \\ -t $gentrome \\ -d decoys.txt \\ - $options.args \\ + $args \\ -i salmon - salmon --version | sed -e "s/salmon //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + salmon: \$(echo \$(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..3b0cd853 100644 --- a/modules/salmon/index/meta.yml +++ b/modules/salmon/index/meta.yml @@ -12,6 +12,7 @@ tools: homepage: https://salmon.readthedocs.io/en/latest/salmon.html manual: https://salmon.readthedocs.io/en/latest/salmon.html doi: 10.1038/nmeth.4197 + licence: ['GPL-3.0-or-later'] input: - genome_fasta: type: file @@ -25,10 +26,10 @@ output: type: directory description: Folder containing the star index files pattern: "salmon" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/salmon/quant/functions.nf b/modules/salmon/quant/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/salmon/quant/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 093137de..6cae4f72 100644 --- a/modules/salmon/quant/main.nf +++ b/modules/salmon/quant/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SALMON_QUANT { 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::salmon=1.4.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/salmon:1.4.0--hf69c8f4_0" - } else { - container "quay.io/biocontainers/salmon:1.4.0--hf69c8f4_0" - } + conda (params.enable_conda ? 'bioconda::salmon=1.5.2' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/salmon:1.5.2--h84f40af_0' : + 'quay.io/biocontainers/salmon:1.5.2--h84f40af_0' }" input: tuple val(meta), path(reads) @@ -28,11 +17,11 @@ process SALMON_QUANT { output: tuple val(meta), path("${prefix}"), emit: results - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" def reference = "--index $index" def input_reads = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}" @@ -69,9 +58,12 @@ process SALMON_QUANT { --libType=$strandedness \\ $reference \\ $input_reads \\ - $options.args \\ + $args \\ -o $prefix - salmon --version | sed -e "s/salmon //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + salmon: \$(echo \$(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..223ca82b 100644 --- a/modules/salmon/quant/meta.yml +++ b/modules/salmon/quant/meta.yml @@ -12,6 +12,7 @@ tools: homepage: https://salmon.readthedocs.io/en/latest/salmon.html manual: https://salmon.readthedocs.io/en/latest/salmon.html doi: 10.1038/nmeth.4197 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -45,10 +46,10 @@ output: type: directory description: Folder containing the quantification results for a specific sample pattern: "${prefix}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/samblaster/main.nf b/modules/samblaster/main.nf new file mode 100644 index 00000000..c6573283 --- /dev/null +++ b/modules/samblaster/main.nf @@ -0,0 +1,34 @@ +process SAMBLASTER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::samblaster=0.1.26 bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-19fa9f1a5c3966b63a24166365e81da35738c5ab:ba4a02b56f3e524a6e006bcd99fe8cc1d7fe09eb-0' : + 'quay.io/biocontainers/mulled-v2-19fa9f1a5c3966b63a24166365e81da35738c5ab:ba4a02b56f3e524a6e006bcd99fe8cc1d7fe09eb-0' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.bam"), emit: bam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def args3 = task.ext.args3 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + if( "$bam" == "${prefix}.bam" ) error "Input and output names are the same, use the suffix option to disambiguate" + """ + samtools view -h $args2 $bam | \\ + samblaster $args | \\ + samtools view $args3 -Sb - >${prefix}.bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samblaster: \$( samblaster -h 2>&1 | head -n 1 | sed 's/^samblaster: Version //' ) + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ +} diff --git a/modules/samblaster/meta.yml b/modules/samblaster/meta.yml new file mode 100644 index 00000000..4d51f4fe --- /dev/null +++ b/modules/samblaster/meta.yml @@ -0,0 +1,53 @@ +name: samblaster +description: | + This module combines samtools and samblaster in order to use + samblaster capability to filter or tag SAM files, with the advantage + of maintaining both input and output in BAM format. + Samblaster input must contain a sequence header: for this reason it has been piped + with the "samtools view -h" command. + Additional desired arguments for samtools can be passed using: + options.args2 for the input bam file + options.args3 for the output bam file +keywords: + - sort +tools: + - samblaster: + description: | + samblaster is a fast and flexible program for marking duplicates in read-id grouped paired-end SAM files. + It can also optionally output discordant read pairs and/or split read mappings to separate SAM files, + and/or unmapped/clipped reads to a separate FASTQ file. + By default, samblaster reads SAM input from stdin and writes SAM to stdout. + homepage: None + documentation: https://github.com/GregoryFaust/samblaster + tool_dev_url: https://github.com/GregoryFaust/samblaster + doi: "10.1093/bioinformatics/btu314" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM file + 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: Tagged or filtered BAM file + pattern: "*.bam" + +authors: + - "@lescai" diff --git a/modules/samtools/ampliconclip/main.nf b/modules/samtools/ampliconclip/main.nf new file mode 100644 index 00000000..55a2f736 --- /dev/null +++ b/modules/samtools/ampliconclip/main.nf @@ -0,0 +1,42 @@ +process SAMTOOLS_AMPLICONCLIP { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + + input: + tuple val(meta), path(bam) + path bed + val save_cliprejects + val save_clipstats + + output: + 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: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def rejects = save_cliprejects ? "--rejects-file ${prefix}.cliprejects.bam" : "" + def stats = save_clipstats ? "-f ${prefix}.clipstats.txt" : "" + """ + samtools \\ + ampliconclip \\ + $args \\ + $rejects \\ + $stats \\ + -b $bed \\ + -o ${prefix}.bam \\ + $bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(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 new file mode 100644 index 00000000..8959b98d --- /dev/null +++ b/modules/samtools/ampliconclip/meta.yml @@ -0,0 +1,65 @@ +name: samtools_ampliconclip +description: write your description here +keywords: + - amplicon + - clipping + - ampliconclip + - samtools ampliconclip + - samtools +tools: + - samtools: + description: | + SAMtools is a set of utilities for interacting with and post-processing + short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. + These files are generated as output by short read aligners like BWA. + homepage: http://www.htslib.org/ + documentation: hhttp://www.htslib.org/doc/samtools.html + doi: 10.1093/bioinformatics/btp352 + 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}" + - bed: + type: file + description: BED file of regions to be removed (e.g. amplicon primers) + pattern: "*.{bed}" + - save_cliprejects: + type: value + description: Save filtered reads to a file + - save_clipstats: + type: value + description: Save clipping stats to a file + +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: Clipped reads BAM file + pattern: "*.{bam}" + - stats: + type: file + description: Clipping statistics text file + pattern: "*.{clipstats.txt}" + - rejects_bam: + type: file + description: Filtered reads BAM file + pattern: "*.{cliprejects.bam}" + +authors: + - "@bjohnnyd" diff --git a/modules/samtools/bam2fq/main.nf b/modules/samtools/bam2fq/main.nf new file mode 100644 index 00000000..689eb960 --- /dev/null +++ b/modules/samtools/bam2fq/main.nf @@ -0,0 +1,54 @@ +process SAMTOOLS_BAM2FQ { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + + input: + tuple val(meta), path(inputbam) + val(split) + + output: + tuple val(meta), path("*.fq.gz"), emit: reads + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + if (split){ + """ + samtools \\ + bam2fq \\ + $args \\ + -@ $task.cpus \\ + -1 ${prefix}_1.fq.gz \\ + -2 ${prefix}_2.fq.gz \\ + -0 ${prefix}_other.fq.gz \\ + -s ${prefix}_singleton.fq.gz \\ + $inputbam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ + } else { + """ + samtools \\ + bam2fq \\ + $args \\ + -@ $task.cpus \\ + $inputbam >${prefix}_interleaved.fq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ + } + +} diff --git a/modules/samtools/bam2fq/meta.yml b/modules/samtools/bam2fq/meta.yml new file mode 100644 index 00000000..f35701c4 --- /dev/null +++ b/modules/samtools/bam2fq/meta.yml @@ -0,0 +1,55 @@ +name: samtools_bam2fq +description: | + The module uses bam2fq method from samtools to + convert a SAM, BAM or CRAM file to FASTQ format +keywords: + - bam2fq + - samtools + - fastq +tools: + - samtools: + description: Tools for dealing with SAM, BAM and CRAM files + homepage: None + documentation: http://www.htslib.org/doc/1.1/samtools.html + tool_dev_url: None + doi: "" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - inputbam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - split: + type: boolean + description: | + TRUE/FALSE value to indicate if reads should be separated into + /1, /2 and if present other, or singleton. + Note: choosing TRUE will generate 4 different files. + Choosing FALSE will produce a single file, which will be interleaved in case + the input contains paired reads. + +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: | + FASTQ files, which will be either a group of 4 files (read_1, read_2, other and singleton) + or a single interleaved .fq.gz file if the user chooses not to split the reads. + pattern: "*.fq.gz" + +authors: + - "@lescai" diff --git a/modules/samtools/depth/main.nf b/modules/samtools/depth/main.nf new file mode 100644 index 00000000..ebf029aa --- /dev/null +++ b/modules/samtools/depth/main.nf @@ -0,0 +1,33 @@ +process SAMTOOLS_DEPTH { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.tsv"), emit: tsv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + samtools \\ + depth \\ + $args \\ + -o ${prefix}.tsv \\ + $bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ +} diff --git a/modules/samtools/depth/meta.yml b/modules/samtools/depth/meta.yml new file mode 100644 index 00000000..a46fd332 --- /dev/null +++ b/modules/samtools/depth/meta.yml @@ -0,0 +1,44 @@ +name: samtools_depth +description: Computes the depth at each position or region. +keywords: + - depth + - samtools + - statistics + - coverage +tools: + - samtools: + description: Tools for dealing with SAM, BAM and CRAM files; samtools depth – computes the read depth at each position or region + homepage: http://www.htslib.org + documentation: http://www.htslib.org/doc/samtools-depth.html + tool_dev_url: https://github.com/samtools/samtools + doi: "10.1093/bioinformatics/btp352" + licence: ['MIT'] + +input: + - 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}" + +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: The output of samtools depth has three columns - the name of the contig or chromosome, the position and the number of reads aligned at that position + pattern: "*.{tsv}" + +authors: + - "@louperelo" diff --git a/modules/samtools/faidx/functions.nf b/modules/samtools/faidx/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/samtools/faidx/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 6c023f1c..d8308b03 100644 --- a/modules/samtools/faidx/main.nf +++ b/modules/samtools/faidx/main.nf @@ -1,34 +1,26 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SAMTOOLS_FAIDX { tag "$fasta" 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::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/samtools:1.12--hd5e65b6_0" - } else { - container "quay.io/biocontainers/samtools:1.12--hd5e65b6_0" - } + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" input: - path fasta + tuple val(meta), path(fasta) output: - path "*.fai" , emit: fai - path "*.version.txt", emit: version + tuple val(meta), path ("*.fai") , emit: fai + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ samtools faidx $fasta - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(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..bae97a39 100644 --- a/modules/samtools/faidx/meta.yml +++ b/modules/samtools/faidx/meta.yml @@ -12,20 +12,31 @@ tools: homepage: http://www.htslib.org/ documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - fasta: type: file description: FASTA file pattern: "*.{fa,fasta}" output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - fai: type: file description: FASTA index file pattern: "*.{fai}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/samtools/fastq/functions.nf b/modules/samtools/fastq/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/samtools/fastq/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 48b3a43f..212e804e 100644 --- a/modules/samtools/fastq/main.nf +++ b/modules/samtools/fastq/main.nf @@ -1,41 +1,33 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SAMTOOLS_FASTQ { 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::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/samtools:1.12--hd5e65b6_0" - } else { - container "quay.io/biocontainers/samtools:1.12--hd5e65b6_0" - } + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" input: tuple val(meta), path(bam) output: tuple val(meta), path("*.fastq.gz"), emit: fastq - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def endedness = meta.single_end ? "-0 ${prefix}.fastq.gz" : "-1 ${prefix}_1.fastq.gz -2 ${prefix}_2.fastq.gz" """ samtools fastq \\ - $options.args \\ - -@ $task.cpus \\ + $args \\ + --threads ${task.cpus-1} \\ $endedness \\ $bam - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(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..91fd476d 100644 --- a/modules/samtools/fastq/meta.yml +++ b/modules/samtools/fastq/meta.yml @@ -14,6 +14,7 @@ tools: homepage: http://www.htslib.org/ documentation: hhttp://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -34,9 +35,9 @@ output: type: file description: compressed FASTQ file pattern: "*.fastq.gz" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@suzannejin" diff --git a/modules/samtools/fixmate/main.nf b/modules/samtools/fixmate/main.nf new file mode 100644 index 00000000..8f86c1c4 --- /dev/null +++ b/modules/samtools/fixmate/main.nf @@ -0,0 +1,35 @@ +process SAMTOOLS_FIXMATE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.bam"), emit: bam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use the suffix option to disambiguate!" + + """ + samtools \\ + fixmate \\ + $args \\ + --threads ${task.cpus-1} \\ + $bam \\ + ${prefix}.bam \\ + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ +} diff --git a/modules/samtools/fixmate/meta.yml b/modules/samtools/fixmate/meta.yml new file mode 100644 index 00000000..2cec6e7c --- /dev/null +++ b/modules/samtools/fixmate/meta.yml @@ -0,0 +1,49 @@ +name: samtools_fixmate +description: Samtools fixmate is a tool that can fill in information (insert size, cigar, mapq) about paired end reads onto the corresponding other read. Also has options to remove secondary/unmapped alignments and recalculate whether reads are proper pairs. +keywords: + - fixmate + - samtools + - insert size + - repair + - bam + - paired + - read pairs +tools: + - samtools: + description: | + SAMtools is a set of utilities for interacting with and post-processing + short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. + These files are generated as output by short read aligners like BWA. + homepage: http://www.htslib.org/ + documentation: http://www.htslib.org/doc/samtools.html + tool_dev_url: https://github.com/samtools/samtools + doi: 10.1093/bioinformatics/btp352 + 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, must be sorted by name, not coordinate + pattern: "*.{bam,cram,sam}" + +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: A BAM/CRAM/SAM file with mate information added and/or proper pairs recalled + pattern: "*.{bam,cram,sam}" + +authors: + - "@sppearce" diff --git a/modules/samtools/flagstat/functions.nf b/modules/samtools/flagstat/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/samtools/flagstat/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 a66ea56d..03721d0b 100644 --- a/modules/samtools/flagstat/main.nf +++ b/modules/samtools/flagstat/main.nf @@ -1,34 +1,26 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SAMTOOLS_FLAGSTAT { 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::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/samtools:1.12--hd5e65b6_0" - } else { - container "quay.io/biocontainers/samtools:1.12--hd5e65b6_0" - } + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" input: tuple val(meta), path(bam), path(bai) output: tuple val(meta), path("*.flagstat"), emit: flagstat - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ - samtools flagstat $bam > ${bam}.flagstat - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + samtools flagstat --threads ${task.cpus-1} $bam > ${bam}.flagstat + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(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..9bd9ff89 100644 --- a/modules/samtools/flagstat/meta.yml +++ b/modules/samtools/flagstat/meta.yml @@ -16,6 +16,7 @@ tools: homepage: http://www.htslib.org/ documentation: hhttp://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -40,9 +41,9 @@ output: type: file description: File containing samtools flagstat output pattern: "*.{flagstat}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/idxstats/functions.nf b/modules/samtools/idxstats/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/samtools/idxstats/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 ff3cd9a6..cd068679 100644 --- a/modules/samtools/idxstats/main.nf +++ b/modules/samtools/idxstats/main.nf @@ -1,34 +1,26 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SAMTOOLS_IDXSTATS { 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::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/samtools:1.12--hd5e65b6_0" - } else { - container "quay.io/biocontainers/samtools:1.12--hd5e65b6_0" - } + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" input: tuple val(meta), path(bam), path(bai) output: tuple val(meta), path("*.idxstats"), emit: idxstats - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ samtools idxstats $bam > ${bam}.idxstats - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(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..ec542f34 100644 --- a/modules/samtools/idxstats/meta.yml +++ b/modules/samtools/idxstats/meta.yml @@ -17,6 +17,7 @@ tools: homepage: http://www.htslib.org/ documentation: hhttp://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -41,9 +42,9 @@ output: type: file description: File containing samtools idxstats output pattern: "*.{idxstats}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/samtools/index/functions.nf b/modules/samtools/index/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/samtools/index/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 778e9384..db025a8f 100644 --- a/modules/samtools/index/main.nf +++ b/modules/samtools/index/main.nf @@ -1,35 +1,29 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SAMTOOLS_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::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/samtools:1.12--hd5e65b6_0" - } else { - container "quay.io/biocontainers/samtools:1.12--hd5e65b6_0" - } + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" input: - tuple val(meta), path(bam) + tuple val(meta), path(input) output: - tuple val(meta), path("*.bai"), optional:true, emit: bai - tuple val(meta), path("*.csi"), optional:true, emit: csi - path "*.version.txt" , emit: version + tuple val(meta), path("*.bai") , optional:true, emit: bai + tuple val(meta), path("*.csi") , optional:true, emit: csi + tuple val(meta), path("*.crai"), optional:true, emit: crai + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ - samtools index $options.args $bam - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + samtools index -@ ${task.cpus-1} $args $input + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(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..0905b3cd 100644 --- a/modules/samtools/index/meta.yml +++ b/modules/samtools/index/meta.yml @@ -14,6 +14,7 @@ tools: homepage: http://www.htslib.org/ documentation: hhttp://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -34,14 +35,19 @@ output: type: file description: BAM/CRAM/SAM index file pattern: "*.{bai,crai,sai}" + - crai: + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" - csi: type: file description: CSI index file pattern: "*.{csi}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" + - "@maxulysse" diff --git a/modules/samtools/merge/functions.nf b/modules/samtools/merge/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/samtools/merge/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 81b2828c..fcfcf61f 100644 --- a/modules/samtools/merge/main.nf +++ b/modules/samtools/merge/main.nf @@ -1,35 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SAMTOOLS_MERGE { 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::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/samtools:1.12--hd5e65b6_0" - } else { - container "quay.io/biocontainers/samtools:1.12--hd5e65b6_0" - } + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" input: - tuple val(meta), path(bams) + tuple val(meta), path(input_files) + path fasta output: - tuple val(meta), path("*merged.bam"), emit: merged_bam - path "*.version.txt" , emit: version + tuple val(meta), path("${prefix}.bam"), optional:true, emit: bam + tuple val(meta), path("${prefix}.cram"), optional:true, emit: cram + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def file_type = input_files[0].getExtension() + def reference = fasta ? "--reference ${fasta}" : "" """ - samtools merge ${prefix}_merged.bam $bams - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + samtools merge --threads ${task.cpus-1} $args ${reference} ${prefix}.${file_type} $input_files + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(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..2576a3a3 100644 --- a/modules/samtools/merge/meta.yml +++ b/modules/samtools/merge/meta.yml @@ -1,5 +1,5 @@ name: samtools_merge -description: Merge BAM file +description: Merge BAM or CRAM file keywords: - merge - bam @@ -14,31 +14,41 @@ tools: homepage: http://www.htslib.org/ documentation: hhttp://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input_files: + type: file + description: BAM/CRAM file + pattern: "*.{bam,cram,sam}" + - fasta: + type: optional file + description: Reference file the CRAM was created with + pattern: "*.{fasta,fa}" +output: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - bam: - type: file - description: BAM file - pattern: "*.{bam,cram,sam}" -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - merged_bam: type: file description: BAM file pattern: "*.{bam}" - - version: + - cram: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: CRAM file + pattern: "*.{cram}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@yuukiiwa " - "@maxulysse" + - "@FriederikeHanssen" diff --git a/modules/samtools/mpileup/functions.nf b/modules/samtools/mpileup/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/samtools/mpileup/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 8f2cebd1..c40f46d1 100644 --- a/modules/samtools/mpileup/main.nf +++ b/modules/samtools/mpileup/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SAMTOOLS_MPILEUP { 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::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/samtools:1.12--hd5e65b6_0" - } else { - container "quay.io/biocontainers/samtools:1.12--hd5e65b6_0" - } + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" input: tuple val(meta), path(bam) @@ -24,17 +13,20 @@ process SAMTOOLS_MPILEUP { output: tuple val(meta), path("*.mpileup"), emit: mpileup - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ samtools mpileup \\ --fasta-ref $fasta \\ --output ${prefix}.mpileup \\ - $options.args \\ + $args \\ $bam - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(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..fac7a5bc 100644 --- a/modules/samtools/mpileup/meta.yml +++ b/modules/samtools/mpileup/meta.yml @@ -14,6 +14,7 @@ tools: homepage: http://www.htslib.org/ documentation: hhttp://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -38,10 +39,10 @@ output: type: file description: mpileup file pattern: "*.{mpileup}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@joseespinosa" diff --git a/modules/samtools/sort/functions.nf b/modules/samtools/sort/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/samtools/sort/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 240e8e9f..0c2cf25e 100644 --- a/modules/samtools/sort/main.nf +++ b/modules/samtools/sort/main.nf @@ -1,35 +1,27 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SAMTOOLS_SORT { 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::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/samtools:1.12--hd5e65b6_0" - } else { - container "quay.io/biocontainers/samtools:1.12--hd5e65b6_0" - } + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" input: tuple val(meta), path(bam) output: tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${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 + samtools sort $args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(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..3402a068 100644 --- a/modules/samtools/sort/meta.yml +++ b/modules/samtools/sort/meta.yml @@ -14,6 +14,7 @@ tools: homepage: http://www.htslib.org/ documentation: hhttp://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -34,10 +35,10 @@ output: type: file description: Sorted BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/samtools/stats/functions.nf b/modules/samtools/stats/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/samtools/stats/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 6bb0a4c7..83c87002 100644 --- a/modules/samtools/stats/main.nf +++ b/modules/samtools/stats/main.nf @@ -1,34 +1,29 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SAMTOOLS_STATS { 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::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/samtools:1.12--hd5e65b6_0" - } else { - container "quay.io/biocontainers/samtools:1.12--hd5e65b6_0" - } + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" input: - tuple val(meta), path(bam), path(bai) + tuple val(meta), path(input), path(input_index) + path fasta output: tuple val(meta), path("*.stats"), emit: stats - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' + def reference = fasta ? "--reference ${fasta}" : "" """ - samtools stats $bam > ${bam}.stats - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + samtools stats --threads ${task.cpus-1} ${reference} ${input} > ${input}.stats + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(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..869e62e3 100644 --- a/modules/samtools/stats/meta.yml +++ b/modules/samtools/stats/meta.yml @@ -15,20 +15,25 @@ tools: homepage: http://www.htslib.org/ documentation: hhttp://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 + 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: Index for BAM/CRAM/SAM file - pattern: "*.{bai,crai,sai}" + - input: + type: file + description: BAM/CRAM file from alignment + pattern: "*.{bam,cram}" + - input_index: + type: file + description: BAI/CRAI file from alignment + pattern: "*.{bai,crai}" + - fasta: + type: optional file + description: Reference file the CRAM was created with + pattern: "*.{fasta,fa}" output: - meta: type: map @@ -39,9 +44,10 @@ output: type: file description: File containing samtools stats output pattern: "*.{stats}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" + - "@FriederikeHanssen" diff --git a/modules/samtools/view/functions.nf b/modules/samtools/view/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/samtools/view/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 ec6c747f..619b84dc 100644 --- a/modules/samtools/view/main.nf +++ b/modules/samtools/view/main.nf @@ -1,35 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SAMTOOLS_VIEW { 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::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/samtools:1.12--hd5e65b6_0" - } else { - container "quay.io/biocontainers/samtools:1.12--hd5e65b6_0" - } + conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : + 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" input: - tuple val(meta), path(bam) + tuple val(meta), path(input) + path fasta output: - tuple val(meta), path("*.bam"), emit: bam - path "*.version.txt" , emit: version + tuple val(meta), path("*.bam") , emit: bam , optional: true + tuple val(meta), path("*.cram"), emit: cram, optional: true + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def reference = fasta ? "--reference ${fasta} -C" : "" + def file_type = input.getExtension() """ - samtools view $options.args $bam > ${prefix}.bam - echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' > ${software}.version.txt + samtools view --threads ${task.cpus-1} ${reference} $args $input > ${prefix}.${file_type} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(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..8abf34af 100644 --- a/modules/samtools/view/meta.yml +++ b/modules/samtools/view/meta.yml @@ -14,16 +14,21 @@ tools: homepage: http://www.htslib.org/ documentation: hhttp://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bam: + - input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" + - fasta: + type: optional file + description: Reference file the CRAM was created with + pattern: "*.{fasta,fa}" output: - meta: type: map @@ -32,12 +37,17 @@ output: e.g. [ id:'test', single_end:false ] - bam: type: file - description: filtered/converted BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - version: + description: filtered/converted BAM/SAM file + pattern: "*.{bam,sam}" + - cram: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: filtered/converted CRAM file + pattern: "*.cram" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@joseespinosa" + - "@FriederikeHanssen" diff --git a/modules/scoary/main.nf b/modules/scoary/main.nf new file mode 100644 index 00000000..ca33041d --- /dev/null +++ b/modules/scoary/main.nf @@ -0,0 +1,35 @@ +process SCOARY { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::scoary=1.6.16" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/scoary:1.6.16--py_2' : + 'quay.io/biocontainers/scoary:1.6.16--py_2' }" + + input: + tuple val(meta), path(genes), path(traits) + path(tree) + + output: + tuple val(meta), path("*.csv"), emit: csv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def newick_tree = tree ? "-n ${tree}" : "" + """ + scoary \\ + $args \\ + --no-time \\ + --threads $task.cpus \\ + --traits $traits \\ + --genes $genes + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + scoary: \$( scoary --version 2>&1 ) + END_VERSIONS + """ +} diff --git a/modules/scoary/meta.yml b/modules/scoary/meta.yml new file mode 100644 index 00000000..e8e8515e --- /dev/null +++ b/modules/scoary/meta.yml @@ -0,0 +1,51 @@ +name: scoary +description: Use pangenome outputs for GWAS +keywords: + - gwas + - pangenome + - prokaryote +tools: + - scoary: + description: Microbial pan-GWAS using the output from Roary + homepage: https://github.com/AdmiralenOla/Scoary + documentation: https://github.com/AdmiralenOla/Scoary + tool_dev_url: https://github.com/AdmiralenOla/Scoary + doi: "10.1186/s13059-016-1108-8" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - genes: + type: file + description: A presence/absence matrix of genes in the pan-genome + pattern: "*.csv" + - traits: + type: file + description: A CSV file containing trait information per-sample + pattern: "*.csv" + - tree: + type: file + description: A Newick formtted tree for phylogenetic analyses + pattern: "*.{dnd,nwk,treefile}" + +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" + - csv: + type: file + description: Gene associations in a CSV file per trait + pattern: "*.csv" + +authors: + - "@rpetit3" diff --git a/modules/seacr/callpeak/functions.nf b/modules/seacr/callpeak/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/seacr/callpeak/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..12b9205f 100644 --- a/modules/seacr/callpeak/main.nf +++ b/modules/seacr/callpeak/main.nf @@ -1,42 +1,38 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '1.3' +def VERSION = '1.3' // Version information not provided by tool on CLI process SEACR_CALLPEAK { 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::seacr=1.3 conda-forge::r-base=4.0.2 bioconda::bedtools=2.29.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:5bb5ed4307a8187a7f34730b00431de93688fa59-0" - } else { - container 'quay.io/biocontainers/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:5bb5ed4307a8187a7f34730b00431de93688fa59-0' - } + conda (params.enable_conda ? "bioconda::seacr=1.3 conda-forge::r-base=4.0.2 bioconda::bedtools=2.30.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:f4bb19b68e66de27e4c64306f951d5ff11919931-0' : + 'quay.io/biocontainers/mulled-v2-03bfeb32fe80910c231f630d4262b83677c8c0f4:f4bb19b68e66de27e4c64306f951d5ff11919931-0' }" input: tuple val(meta), path(bedgraph), path(ctrlbedgraph) + val (threshold) output: tuple val(meta), path("*.bed"), emit: bed - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def function_switch = ctrlbedgraph ? "$ctrlbedgraph" : "$threshold" """ SEACR_1.3.sh \\ $bedgraph \\ - $ctrlbedgraph \\ - $options.args \\ + $function_switch \\ + $args \\ $prefix - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + seacr: $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/seacr/callpeak/meta.yml b/modules/seacr/callpeak/meta.yml index 579961e2..53b3415f 100644 --- a/modules/seacr/callpeak/meta.yml +++ b/modules/seacr/callpeak/meta.yml @@ -1,3 +1,4 @@ + name: seacr_callpeak description: Call peaks using SEACR on sequenced reads in bedgraph format keywords: @@ -16,6 +17,7 @@ tools: (i.e. regions with no read coverage). homepage: https://github.com/FredHutch/SEACR documentation: https://github.com/FredHutch/SEACR + licence: ['GPL-2.0-only'] input: - meta: type: map @@ -30,6 +32,10 @@ input: type: file description: | Control (IgG) data bedgraph file to generate an empirical threshold for peak calling. + - threshold: + type: value + description: | + Threshold value used to call peaks if the ctrlbedgraph input is set to []. Set to 1 if using a control bedgraph output: - meta: type: map @@ -40,9 +46,9 @@ output: type: file description: Bed file containing the calculated peaks. pattern: "*.bed" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@chris-cheshire" diff --git a/modules/seqkit/split2/functions.nf b/modules/seqkit/split2/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/seqkit/split2/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 ec7057f7..5bed1dae 100644 --- a/modules/seqkit/split2/main.nf +++ b/modules/seqkit/split2/main.nf @@ -1,59 +1,50 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -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.15.0" : null) - - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/seqkit:0.15.0--0" - } else { - container "quay.io/biocontainers/seqkit:0.15.0--0" - } + conda (params.enable_conda ? 'bioconda::seqkit=2.1.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/seqkit:2.1.0--h9ee0642_0' : + 'quay.io/biocontainers/seqkit:2.1.0--h9ee0642_0' }" input: tuple val(meta), path(reads) output: - tuple val(meta), path("*.split/*.gz"), emit: reads - path("*.version.txt") , emit: version - + tuple val(meta), path("**/*.gz"), emit: reads + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" if(meta.single_end){ - """ - seqkit \ - split2 \ - $options.args \ - --threads $task.cpus \ - -1 ${reads} \ - --out-dir ${prefix}.split + """ + seqkit \\ + split2 \\ + $args \\ + --threads $task.cpus \\ + $reads \\ + --out-dir ${prefix} - echo \$(seqkit --version 2>&1) | sed 's/^.*seqkit //; s/Using.*\$//' > ${software}.version.txt - """ + cat <<-END_VERSIONS > versions.yml + "${task.process}": + seqkit: \$(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 \\ + $args \\ + --threads $task.cpus \\ + --read1 ${reads[0]} \\ + --read2 ${reads[1]} \\ + --out-dir ${prefix} - echo \$(seqkit --version 2>&1) | sed 's/^.*seqkit //; s/Using.*\$//' > ${software}.version.txt - """ + cat <<-END_VERSIONS > versions.yml + "${task.process}": + seqkit: \$(echo \$(seqkit 2>&1) | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS + """ } } diff --git a/modules/seqkit/split2/meta.yml b/modules/seqkit/split2/meta.yml index 44ae4ea7..90eec7f9 100644 --- a/modules/seqkit/split2/meta.yml +++ b/modules/seqkit/split2/meta.yml @@ -10,6 +10,7 @@ tools: homepage: https://github.com/shenwei356/seqkit documentation: https://bioinf.shenwei.me/seqkit/ doi: 10.1371/journal.pone.0163962 + licence: ['MIT'] input: - meta: type: map @@ -30,9 +31,9 @@ output: type: file description: Split fastq files pattern: "*.{fq.gz/fastq.gz}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@FriederikeHanssen" diff --git a/modules/seqsero2/main.nf b/modules/seqsero2/main.nf new file mode 100644 index 00000000..0a7aa6ad --- /dev/null +++ b/modules/seqsero2/main.nf @@ -0,0 +1,35 @@ +process SEQSERO2 { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::seqsero2=1.2.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/seqsero2:1.2.1--py_0' : + 'quay.io/biocontainers/seqsero2:1.2.1--py_0' }" + + input: + tuple val(meta), path(seqs) + + output: + tuple val(meta), path("results/*_log.txt") , emit: log + tuple val(meta), path("results/*_result.tsv"), emit: tsv + tuple val(meta), path("results/*_result.txt"), emit: txt + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + SeqSero2_package.py \\ + $args \\ + -d results/ \\ + -n $prefix \\ + -p $task.cpus \\ + -i $seqs + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + seqsero2: \$( echo \$( SeqSero2_package.py --version 2>&1) | sed 's/^.*SeqSero2_package.py //' ) + END_VERSIONS + """ +} diff --git a/modules/seqsero2/meta.yml b/modules/seqsero2/meta.yml new file mode 100644 index 00000000..ceea80e3 --- /dev/null +++ b/modules/seqsero2/meta.yml @@ -0,0 +1,52 @@ +name: seqsero2 +description: Salmonella serotype prediction from reads and assemblies +keywords: + - fasta + - fastq + - salmonella + - sertotype +tools: + - seqsero2: + description: Salmonella serotype prediction from genome sequencing data + homepage: https://github.com/denglab/SeqSero2 + documentation: https://github.com/denglab/SeqSero2 + tool_dev_url: https://github.com/denglab/SeqSero2 + doi: "10.1128/AEM.01746-19" + licence: ['GPL v2'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - seqs: + type: file + description: FASTQ or FASTA formated sequences + pattern: "*.{fq.gz,fastq.gz,fna.gz,fna,fasta.gz,fasta,fa.gz,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" + - log: + type: file + description: A log of serotype antigen results + pattern: "*_log.txt" + - tsv: + type: file + description: Tab-delimited summary of the SeqSero2 results + pattern: "*_result.tsv" + - txt: + type: file + description: Detailed summary of the SeqSero2 results + pattern: "*_result.txt" + +authors: + - "@rpetit3" diff --git a/modules/seqtk/mergepe/main.nf b/modules/seqtk/mergepe/main.nf new file mode 100644 index 00000000..299c9ea4 --- /dev/null +++ b/modules/seqtk/mergepe/main.nf @@ -0,0 +1,43 @@ +process SEQTK_MERGEPE { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::seqtk=1.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/seqtk:1.3--h5bf99c6_3' : + 'quay.io/biocontainers/seqtk:1.3--h5bf99c6_3' }" + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("*.fastq.gz"), emit: reads + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + """ + ln -s ${reads} ${prefix}.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + seqtk: \$(echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS + """ + } else { + """ + seqtk \\ + mergepe \\ + $args \\ + ${reads} \\ + | gzip -n >> ${prefix}.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + seqtk: \$(echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS + """ + } +} diff --git a/modules/seqtk/mergepe/meta.yml b/modules/seqtk/mergepe/meta.yml new file mode 100644 index 00000000..a342f60b --- /dev/null +++ b/modules/seqtk/mergepe/meta.yml @@ -0,0 +1,40 @@ +name: seqtk_mergepe +description: Interleave pair-end reads from FastQ files +keywords: + - interleave +tools: + - seqtk: + description: Seqtk is a fast and lightweight tool for processing sequences in the FASTA or FASTQ format. Seqtk mergepe command merges pair-end reads into one interleaved file. + homepage: https://github.com/lh3/seqtk + documentation: https://docs.csc.fi/apps/seqtk/ + tool_dev_url: https://github.com/lh3/seqtk + licence: ['MIT'] + +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. + pattern: "*.{fastq.gz}" + +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: If single-end reads, the output is the same as the input, 1 FastQ file for each read. If pair-end reads, the read pairs will be interleaved and output as 1 FastQ file for each read pair. + pattern: "*.{fastq.gz}" + +authors: + - "@emnilsson" diff --git a/modules/seqtk/sample/functions.nf b/modules/seqtk/sample/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/seqtk/sample/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..96e08fd4 100644 --- a/modules/seqtk/sample/main.nf +++ b/modules/seqtk/sample/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SEQTK_SAMPLE { 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::seqtk=1.3" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/seqtk:1.3--h5bf99c6_3" - } else { - container "quay.io/biocontainers/seqtk:1.3--h5bf99c6_3" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/seqtk:1.3--h5bf99c6_3' : + 'quay.io/biocontainers/seqtk:1.3--h5bf99c6_3' }" input: tuple val(meta), path(reads) @@ -24,42 +13,48 @@ process SEQTK_SAMPLE { output: tuple val(meta), path("*.fastq.gz"), emit: reads - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" if (meta.single_end) { """ seqtk \\ sample \\ - $options.args \\ + $args \\ $reads \\ $sample_size \\ | gzip --no-name > ${prefix}.fastq.gz \\ - echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + seqtk: \$(echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//') + END_VERSIONS """ } else { - if (!(options.args ==~ /.*-s[0-9]+.*/)) { - options.args = options.args + " -s100" + if (!(args ==~ /.*-s[0-9]+.*/)) { + args += " -s100" } """ seqtk \\ sample \\ - $options.args \\ + $args \\ ${reads[0]} \\ $sample_size \\ | gzip --no-name > ${prefix}_1.fastq.gz \\ seqtk \\ sample \\ - $options.args \\ + $args \\ ${reads[1]} \\ $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 + "${task.process}": + seqtk: \$(echo \$(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..6cc4d657 100644 --- a/modules/seqtk/sample/meta.yml +++ b/modules/seqtk/sample/meta.yml @@ -30,10 +30,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/seqtk/subseq/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..abfe4faa 100644 --- a/modules/seqtk/subseq/main.nf +++ b/modules/seqtk/subseq/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SEQTK_SUBSEQ { tag '$sequences' 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::seqtk=1.3" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/seqtk:1.3--h5bf99c6_3" - } else { - container "quay.io/biocontainers/seqtk:1.3--h5bf99c6_3" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/seqtk:1.3--h5bf99c6_3' : + 'quay.io/biocontainers/seqtk:1.3--h5bf99c6_3' }" input: path sequences @@ -24,11 +13,11 @@ process SEQTK_SUBSEQ { output: path "*.gz" , emit: sequences - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ?: '' + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: '' def ext = "fa" if ("$sequences" ==~ /.+\.fq|.+\.fq.gz|.+\.fastq|.+\.fastq.gz/) { ext = "fq" @@ -36,11 +25,14 @@ process SEQTK_SUBSEQ { """ seqtk \\ subseq \\ - $options.args \\ + $args \\ $sequences \\ $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 + "${task.process}": + seqtk: \$(echo \$(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..0d9a802b 100644 --- a/modules/seqtk/subseq/meta.yml +++ b/modules/seqtk/subseq/meta.yml @@ -21,10 +21,10 @@ input: pattern: "*.{bed,lst}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - sequences: type: file description: FASTQ/FASTA file diff --git a/modules/sequenzautils/bam2seqz/functions.nf b/modules/sequenzautils/bam2seqz/functions.nf deleted file mode 100755 index da9da093..00000000 --- a/modules/sequenzautils/bam2seqz/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..ce9d1962 100644 --- a/modules/sequenzautils/bam2seqz/main.nf +++ b/modules/sequenzautils/bam2seqz/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SEQUENZAUTILS_BAM2SEQZ { 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::sequenza-utils=3.0.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/sequenza-utils:3.0.0--py38h6ed170a_2" - } else { - container "quay.io/biocontainers/sequenza-utils:3.0.0--py38h6ed170a_2" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sequenza-utils:3.0.0--py38h6ed170a_2' : + 'quay.io/biocontainers/sequenza-utils:3.0.0--py38h6ed170a_2' }" input: tuple val(meta), path(normalbam), path(tumourbam) @@ -24,22 +13,25 @@ process SEQUENZAUTILS_BAM2SEQZ { path wigfile output: - tuple val(meta), path("*.seqz.gz"), emit: seqz - path "*.version.txt" , emit: version + tuple val(meta), path("*.gz"), emit: seqz + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ sequenza-utils \\ bam2seqz \\ - $options.args \\ + $args \\ -n $normalbam \\ -t $tumourbam \\ --fasta $fasta \\ -gc $wigfile \\ - -o ${prefix}.seqz.gz + -o ${prefix}.gz - echo \$(sequenzautils --version 2>&1) | sed 's/^.*sequenzautils //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sequenzautils: \$(echo \$(sequenza-utils 2>&1) | sed 's/^.*is version //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/sequenzautils/bam2seqz/meta.yml b/modules/sequenzautils/bam2seqz/meta.yml index 171e155c..e05d2fa9 100755 --- a/modules/sequenzautils/bam2seqz/meta.yml +++ b/modules/sequenzautils/bam2seqz/meta.yml @@ -8,7 +8,7 @@ tools: homepage: https://sequenza-utils.readthedocs.io/en/latest/index.html documentation: https://sequenza-utils.readthedocs.io/en/latest/index.html doi: 10.1093/annonc/mdu479 - + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -37,10 +37,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - seqz: type: file description: Seqz file diff --git a/modules/sequenzautils/gcwiggle/functions.nf b/modules/sequenzautils/gcwiggle/functions.nf deleted file mode 100755 index da9da093..00000000 --- a/modules/sequenzautils/gcwiggle/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..a6fcb559 100644 --- a/modules/sequenzautils/gcwiggle/main.nf +++ b/modules/sequenzautils/gcwiggle/main.nf @@ -1,40 +1,32 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SEQUENZAUTILS_GCWIGGLE { 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::sequenza-utils=3.0.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/sequenza-utils:3.0.0--py38h6ed170a_2" - } else { - container "quay.io/biocontainers/sequenza-utils:3.0.0--py38h6ed170a_2" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sequenza-utils:3.0.0--py38h6ed170a_2' : + 'quay.io/biocontainers/sequenza-utils:3.0.0--py38h6ed170a_2' }" input: tuple val(meta), path(fasta) output: tuple val(meta), path("*.wig.gz"), emit: wig - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ sequenza-utils \\ gc_wiggle \\ - $options.args \\ + $args \\ --fasta $fasta \\ -o ${prefix}.wig.gz - echo \$(sequenzautils --version 2>&1) | sed 's/^.*sequenzautils //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sequenzautils: \$(echo \$(sequenza-utils 2>&1) | sed 's/^.*is version //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/sequenzautils/gcwiggle/meta.yml b/modules/sequenzautils/gcwiggle/meta.yml index e1cb7b03..616e073b 100644 --- a/modules/sequenzautils/gcwiggle/meta.yml +++ b/modules/sequenzautils/gcwiggle/meta.yml @@ -8,6 +8,7 @@ tools: homepage: https://sequenza-utils.readthedocs.io/en/latest/index.html documentation: https://sequenza-utils.readthedocs.io/en/latest/index.html doi: 10.1093/annonc/mdu479 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -25,10 +26,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/seqwish/induce/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 64ecd595..6d6b33e7 100644 --- a/modules/seqwish/induce/main.nf +++ b/modules/seqwish/induce/main.nf @@ -1,44 +1,36 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' -params.options = [:] -options = initOptions(params.options) - -def VERSION = '0.4.1' +def VERSION = '0.7.2' // Version information not provided by tool on CLI process SEQWISH_INDUCE { 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::seqwish=0.4.1" : null) + conda (params.enable_conda ? 'bioconda::seqwish=0.7.2' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/seqwish:0.4.1--h8b12597_0" - } else { - container "quay.io/biocontainers/seqwish:0.4.1--h8b12597_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/seqwish:0.7.2--h2e03b76_0' : + 'quay.io/biocontainers/seqwish:0.7.2--h2e03b76_0' }" input: tuple val(meta), path(paf), path(fasta) output: tuple val(meta), path("*.gfa"), emit: gfa - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ seqwish \\ --threads $task.cpus \\ --paf-alns=$paf \\ --seqs=$fasta \\ --gfa=${prefix}.gfa \\ - $options.args + $args - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + seqwish: $VERSION + END_VERSIONS """ } diff --git a/modules/seqwish/induce/meta.yml b/modules/seqwish/induce/meta.yml index 0b6b4b5b..281e3994 100644 --- a/modules/seqwish/induce/meta.yml +++ b/modules/seqwish/induce/meta.yml @@ -13,6 +13,7 @@ tools: sequences to a variation graph encoding the sequences and their alignments. homepage: https://github.com/ekg/seqwish documentation: https://github.com/ekg/seqwish + licence: ['MIT'] input: - meta: type: map @@ -36,11 +37,11 @@ output: e.g. [ id:'test', single_end:false ] - gfa: type: file - description: Variation graph in GFA1 format + description: Variation graph in GFA 1.0 format pattern: "*.{gfa}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@heuermh" diff --git a/modules/shovill/functions.nf b/modules/shovill/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/shovill/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..1a56df27 100644 --- a/modules/shovill/main.nf +++ b/modules/shovill/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SHOVILL { 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::shovill=1.1.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/shovill:1.1.0--0" - } else { - container "quay.io/biocontainers/shovill:1.1.0--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/shovill:1.1.0--0' : + 'quay.io/biocontainers/shovill:1.1.0--0' }" input: tuple val(meta), path(reads) @@ -27,21 +16,24 @@ 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: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' def memory = task.memory.toGiga() """ shovill \\ --R1 ${reads[0]} \\ --R2 ${reads[1]} \\ - $options.args \\ + $args \\ --cpus $task.cpus \\ --ram $memory \\ --outdir ./ \\ --force - echo \$(shovill --version 2>&1) | sed 's/^.*shovill //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + shovill: \$(echo \$(shovill --version 2>&1) | sed 's/^.*shovill //') + END_VERSIONS """ } diff --git a/modules/shovill/meta.yml b/modules/shovill/meta.yml index 0a8661b1..1f3c3a8f 100644 --- a/modules/shovill/meta.yml +++ b/modules/shovill/meta.yml @@ -1,5 +1,4 @@ name: shovill -## TODO nf-core: Add a description of the module and list keywords description: Assemble bacterial isolate genomes from Illumina paired-end reads keywords: - bacterial @@ -8,11 +7,10 @@ keywords: tools: - shovill: - ## TODO nf-core: Add a description and other details for the software below description: Microbial assembly pipeline for Illumina paired-end reads homepage: https://github.com/tseemann/shovill documentation: https://github.com/tseemann/shovill/blob/master/README.md - licence: ['GPL v2'] + licence: ["GPL v2"] input: - meta: @@ -21,8 +19,8 @@ input: Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - reads: - type: file - description: List of input paired-end FastQ files + type: file + description: List of input paired-end FastQ files output: - meta: @@ -30,10 +28,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - contigs: type: file description: The final assembly produced by Shovill diff --git a/modules/snpdists/main.nf b/modules/snpdists/main.nf new file mode 100644 index 00000000..c8d61161 --- /dev/null +++ b/modules/snpdists/main.nf @@ -0,0 +1,30 @@ +process SNPDISTS { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::snp-dists=0.8.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/snp-dists:0.8.2--h5bf99c6_0' : + 'quay.io/biocontainers/snp-dists:0.8.2--h5bf99c6_0' }" + + input: + tuple val(meta), path(alignment) + + output: + tuple val(meta), path("*.tsv"), emit: tsv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + snp-dists \\ + $args \\ + $alignment > ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + snpdists: \$(snp-dists -v 2>&1 | sed 's/snp-dists //;') + END_VERSIONS + """ +} diff --git a/modules/snpdists/meta.yml b/modules/snpdists/meta.yml new file mode 100644 index 00000000..bf4366ff --- /dev/null +++ b/modules/snpdists/meta.yml @@ -0,0 +1,41 @@ +name: snpdists +description: Pairwise SNP distance matrix from a FASTA sequence alignment +keywords: + - snp-dists + - distance-matrix +tools: + - snpdists: + description: Convert a FASTA alignment to SNP distance matrix + homepage: https://github.com/tseemann/snp-dists + documentation: https://github.com/tseemann/snp-dists + tool_dev_url: https://github.com/tseemann/snp-dists + doi: "" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - alignment: + type: file + description: The input FASTA sequence alignment file + pattern: "*.{fasta,fasta.gz}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - tsv: + type: file + description: The output TSV file containing SNP distance matrix + pattern: "*.tsv" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@abhi18av" diff --git a/modules/snpeff/functions.nf b/modules/snpeff/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/snpeff/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..6248fee3 100644 --- a/modules/snpeff/main.nf +++ b/modules/snpeff/main.nf @@ -1,27 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) -params.use_cache = false -params.snpeff_tag = "" - process SNPEFF { + 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::snpeff=5.0" : null) - if (params.use_cache) { - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/snpeff:5.0--hdfd78af_1" - } else { - container "quay.io/biocontainers/snpeff:5.0--hdfd78af_1" - } - } else { - container "nfcore/snpeff:${params.snpeff_tag}" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/snpeff:5.0--hdfd78af_1' : + 'quay.io/biocontainers/snpeff:5.0--hdfd78af_1' }" input: tuple val(meta), path(vcf) @@ -31,27 +15,31 @@ process SNPEFF { output: tuple val(meta), path("*.ann.vcf"), emit: vcf path "*.csv" , emit: report - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' def avail_mem = 6 if (!task.memory) { log.info '[snpEff] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.' } else { avail_mem = task.memory.giga } - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - cache = params.use_cache ? "-dataDir \${PWD}/${snpeff_cache}" : "" + def prefix = task.ext.prefix ?: "${meta.id}" + def cache_command = cache ? "-dataDir \${PWD}/${cache}" : "" """ - snpEff -Xmx${avail_mem}g \\ + snpEff \\ + -Xmx${avail_mem}g \\ $db \\ - $options.args \\ + $args \\ -csvStats ${prefix}.csv \\ - $cache \\ + $cache_command \\ $vcf \\ > ${prefix}.ann.vcf - echo \$(snpEff -version 2>&1) > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + snpeff: \$(echo \$(snpEff -version 2>&1) | cut -f 2 -d ' ') + END_VERSIONS """ } diff --git a/modules/snpeff/meta.yml b/modules/snpeff/meta.yml index 7ba62cde..8ba18683 100644 --- a/modules/snpeff/meta.yml +++ b/modules/snpeff/meta.yml @@ -9,6 +9,7 @@ tools: It annotates and predicts the effects of genetic variants on genes and proteins (such as amino acid changes). homepage: https://pcingola.github.io/SnpEff/ documentation: https://pcingola.github.io/SnpEff/se_introduction/ + licence: ['MIT'] params: - use_cache: type: boolean @@ -49,9 +50,9 @@ output: type: file description: snpEff report file pattern: "*.html" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/snpsift/split/main.nf b/modules/snpsift/split/main.nf new file mode 100644 index 00000000..a83052ad --- /dev/null +++ b/modules/snpsift/split/main.nf @@ -0,0 +1,48 @@ +process SNPSIFT_SPLIT { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::snpsift=4.3.1t" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/snpsift:4.3.1t--hdfd78af_3' : + 'quay.io/biocontainers/snpsift:4.3.1t--hdfd78af_3' }" + + input: + tuple val(meta), path(vcf) + + output: + tuple val(meta), path("*.vcf"), emit: out_vcfs + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.split) { + """ + SnpSift \\ + split \\ + $args \\ + $vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + snpsift: \$( echo \$(SnpSift split -h 2>&1) | sed 's/^.*version //' | sed 's/(.*//' | sed 's/t//g' ) + END_VERSIONS + """ + } else { + """ + SnpSift \\ + split \\ + -j \\ + $args \\ + $vcf \\ + > ${prefix}.joined.vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + snpsift: \$( echo \$(SnpSift split -h 2>&1) | sed 's/^.*version //' | sed 's/(.*//' | sed 's/t//g' ) + END_VERSIONS + """ + } + +} diff --git a/modules/snpsift/split/meta.yml b/modules/snpsift/split/meta.yml new file mode 100644 index 00000000..5a125b62 --- /dev/null +++ b/modules/snpsift/split/meta.yml @@ -0,0 +1,44 @@ +name: snpsift_split +description: Splits/Joins VCF(s) file into chromosomes +keywords: + - split + - join + - vcf +tools: + - snpsift: + description: SnpSift is a toolbox that allows you to filter and manipulate annotated files + homepage: https://pcingola.github.io/SnpEff/ss_introduction/ + documentation: https://pcingola.github.io/SnpEff/ss_introduction/ + tool_dev_url: https://github.com/pcingola/SnpEff + doi: "10.3389/fgene.2012.00035" + licence: ['MIT'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file (split) or list of files (join) + description: VCF file(s) + pattern: "*.{vcf,vcf.gz}" + +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" + - out_vcfs: + type: file + description: Split/Joined VCF file(s) + pattern: "*.vcf" + +authors: + - "@SusiJo" + - "@jonasscheid" diff --git a/modules/snpsites/functions.nf b/modules/snpsites/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/snpsites/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..60e694ac 100644 --- a/modules/snpsites/main.nf +++ b/modules/snpsites/main.nf @@ -1,21 +1,10 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SNPSITES { 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:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::snp-sites=2.5.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/snp-sites:2.5.1--hed695b0_0" - } else { - container "quay.io/biocontainers/snp-sites:2.5.1--hed695b0_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/snp-sites:2.5.1--hed695b0_0' : + 'quay.io/biocontainers/snp-sites:2.5.1--hed695b0_0' }" input: path alignment @@ -23,21 +12,24 @@ process SNPSITES { output: path "*.fas" , emit: fasta path "*.sites.txt" , emit: constant_sites - path "*.version.txt", emit: version + path "versions.yml" , emit: versions env CONSTANT_SITES, emit: constant_sites_string script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ snp-sites \\ $alignment \\ - $options.args \\ + $args \\ > filtered_alignment.fas echo \$(snp-sites -C $alignment) > constant.sites.txt CONSTANT_SITES=\$(cat constant.sites.txt) - echo \$(snp-sites -V 2>&1) | sed 's/snp-sites //' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + snpsites: \$(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..381d25cc 100644 --- a/modules/snpsites/meta.yml +++ b/modules/snpsites/meta.yml @@ -9,16 +9,17 @@ tools: description: Rapidly extracts SNPs from a multi-FASTA alignment. homepage: https://www.sanger.ac.uk/tool/snp-sites/ documentation: https://github.com/sanger-pathogens/snp-sites + licence: ['GPL-3.0-or-later'] input: - alignment: type: file description: fasta alignment file pattern: "*.{fasta,fas,fa,aln}" output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - fasta: type: file description: Variant fasta file diff --git a/modules/sortmerna/functions.nf b/modules/sortmerna/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/sortmerna/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..5c0950d8 100644 --- a/modules/sortmerna/main.nf +++ b/modules/sortmerna/main.nf @@ -1,58 +1,47 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SORTMERNA { 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::sortmerna=4.2.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/sortmerna:4.2.0--0" - } else { - container "quay.io/biocontainers/sortmerna:4.2.0--0" - } + conda (params.enable_conda ? "bioconda::sortmerna=4.3.4" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sortmerna:4.3.4--h9ee0642_0' : + 'quay.io/biocontainers/sortmerna:4.3.4--h9ee0642_0' }" input: tuple val(meta), path(reads) - path fasta + path fastas 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - - def Refs = "" - for (i=0; i ${prefix}.fastq.gz + mv non_rRNA_reads.fq.gz ${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 + "${task.process}": + sortmerna: \$(echo \$(sortmerna --version 2>&1) | sed 's/^.*SortMeRNA version //; s/ Build Date.*\$//') + END_VERSIONS """ } else { """ sortmerna \\ - $Refs \\ + ${'--ref '+fastas.join(' --ref ')} \\ --reads ${reads[0]} \\ --reads ${reads[1]} \\ --threads $task.cpus \\ @@ -61,13 +50,16 @@ process SORTMERNA { --other non_rRNA_reads \\ --paired_in \\ --out2 \\ - $options.args + $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 - echo \$(sortmerna --version 2>&1) | sed 's/^.*SortMeRNA version //; s/ Build Date.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sortmerna: \$(echo \$(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 deleted file mode 100644 index da9da093..00000000 --- a/modules/spades/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 c6208053..ba690d35 100644 --- a/modules/spades/main.nf +++ b/modules/spades/main.nf @@ -1,67 +1,70 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SPADES { 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::spades=3.15.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/spades:3.15.2--h95f258a_1" - } else { - container "quay.io/biocontainers/spades:3.15.2--h95f258a_1" - } + conda (params.enable_conda ? 'bioconda::spades=3.15.3' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/spades:3.15.3--h95f258a_0' : + 'quay.io/biocontainers/spades:3.15.3--h95f258a_0' }" input: - tuple val(meta), path(reads) + tuple val(meta), path(illumina), path(pacbio), path(nanopore) path hmm output: - tuple val(meta), path('*.scaffolds.fa') , optional:true, emit: scaffolds - tuple val(meta), path('*.contigs.fa') , optional:true, emit: contigs - tuple val(meta), path('*.transcripts.fa') , optional:true, emit: transcripts - 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 + tuple val(meta), path('*.scaffolds.fa.gz') , optional:true, emit: scaffolds + tuple val(meta), path('*.contigs.fa.gz') , optional:true, emit: contigs + tuple val(meta), path('*.transcripts.fa.gz') , optional:true, emit: transcripts + tuple val(meta), path('*.gene_clusters.fa.gz'), optional:true, emit: gene_clusters + tuple val(meta), path('*.assembly.gfa.gz') , optional:true, emit: gfa + tuple val(meta), path('*.log') , emit: log + 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" : "" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def maxmem = task.memory.toGiga() + def illumina_reads = illumina ? ( meta.single_end ? "-s $illumina" : "-1 ${illumina[0]} -2 ${illumina[1]}" ) : "" + def pacbio_reads = pacbio ? "--pacbio $pacbio" : "" + def nanopore_reads = nanopore ? "--nanopore $nanopore" : "" + def custom_hmms = hmm ? "--custom-hmms $hmm" : "" """ spades.py \\ - $options.args \\ + $args \\ --threads $task.cpus \\ + --memory $maxmem \\ $custom_hmms \\ - $input_reads \\ + $illumina_reads \\ + $pacbio_reads \\ + $nanopore_reads \\ -o ./ mv spades.log ${prefix}.spades.log if [ -f scaffolds.fasta ]; then mv scaffolds.fasta ${prefix}.scaffolds.fa + gzip -n ${prefix}.scaffolds.fa fi if [ -f contigs.fasta ]; then mv contigs.fasta ${prefix}.contigs.fa + gzip -n ${prefix}.contigs.fa fi if [ -f transcripts.fasta ]; then mv transcripts.fasta ${prefix}.transcripts.fa + gzip -n ${prefix}.transcripts.fa fi if [ -f assembly_graph_with_scaffolds.gfa ]; then mv assembly_graph_with_scaffolds.gfa ${prefix}.assembly.gfa + gzip -n ${prefix}.assembly.gfa fi if [ -f gene_clusters.fasta ]; then mv gene_clusters.fasta ${prefix}.gene_clusters.fa + gzip -n ${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 + "${task.process}": + spades: \$(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..b6878d3d 100644 --- a/modules/spades/meta.yml +++ b/modules/spades/meta.yml @@ -20,11 +20,20 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - reads: + - illumina: type: file description: | - List of input FastQ files of size 1 and 2 for single-end and paired-end data, - respectively. + List of input FastQ (Illumina or PacBio CCS reads) files + of size 1 and 2 for single-end and paired-end data, + respectively. This input data type is required. + - pacbio: + type: file + description: | + List of input PacBio CLR FastQ files of size 1. + - nanopore: + type: file + description: | + List of input FastQ files of size 1, originating from Oxford Nanopore technology. - hmm: type: file description: @@ -39,31 +48,38 @@ output: type: file description: | Fasta file containing scaffolds + pattern: "*.fa.gz" - contigs: type: file description: | Fasta file containing contigs + pattern: "*.fa.gz" - transcripts: type: file description: | Fasta file containing transcripts + pattern: "*.fa.gz" - gene_clusters: type: file description: | Fasta file containing gene_clusters + pattern: "*.fa.gz" - gfa: type: file description: | gfa file containing assembly + pattern: "*.gfa.gz" - log: type: file description: | Spades log file - - version: + pattern: "*.log" + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@JoseEspinosa" - "@drpatelh" + - "@d4straub" diff --git a/modules/spatyper/main.nf b/modules/spatyper/main.nf new file mode 100644 index 00000000..e0ba8d13 --- /dev/null +++ b/modules/spatyper/main.nf @@ -0,0 +1,35 @@ +process SPATYPER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::spatyper=0.3.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/spatyper%3A0.3.3--pyhdfd78af_3' : + '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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def input_args = repeats && repeat_order ? "-r ${repeats} -o ${repeat_order}" : "" + """ + spaTyper \\ + $args \\ + $input_args \\ + --fasta $fasta \\ + --output ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + spatyper: \$( 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/modules/sratools/fasterqdump/main.nf b/modules/sratools/fasterqdump/main.nf new file mode 100644 index 00000000..73e3673d --- /dev/null +++ b/modules/sratools/fasterqdump/main.nf @@ -0,0 +1,49 @@ +process SRATOOLS_FASTERQDUMP { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? 'bioconda::sra-tools=2.11.0 conda-forge::pigz=2.6' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-5f89fe0cd045cb1d615630b9261a1d17943a9b6a:6a9ff0e76ec016c3d0d27e0c0d362339f2d787e6-0' : + '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 args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + 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 \\ + $args \\ + --threads $task.cpus \\ + ${sra.name} + + pigz \\ + $args2 \\ + --no-name \\ + --processes $task.cpus \\ + *.fastq + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sratools: \$(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..1478bed8 --- /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: ['US-Government-Work'] + +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/modules/sratools/prefetch/main.nf b/modules/sratools/prefetch/main.nf new file mode 100644 index 00000000..1e1eb802 --- /dev/null +++ b/modules/sratools/prefetch/main.nf @@ -0,0 +1,40 @@ +process SRATOOLS_PREFETCH { + tag "$id" + label 'process_low' + label 'error_retry' + + conda (params.enable_conda ? 'bioconda::sra-tools=2.11.0' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sra-tools:2.11.0--pl5262h314213e_0' : + '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 args = task.ext.args ?: '' + 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 \\ + $args \\ + --progress \\ + $id + + vdb-validate $id + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sratools: \$(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..22213b29 --- /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: ['US-Government-Work'] + +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/modules/staphopiasccmec/main.nf b/modules/staphopiasccmec/main.nf new file mode 100644 index 00000000..dbb61a27 --- /dev/null +++ b/modules/staphopiasccmec/main.nf @@ -0,0 +1,28 @@ +process STAPHOPIASCCMEC { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::staphopia-sccmec=1.0.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/staphopia-sccmec:1.0.0--hdfd78af_0' : + 'quay.io/biocontainers/staphopia-sccmec:1.0.0--hdfd78af_0' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*.tsv"), emit: tsv + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + staphopia-sccmec --assembly $fasta $args > ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + staphopiasccmec: \$(staphopia-sccmec --version 2>&1 | sed 's/^.*staphopia-sccmec //') + END_VERSIONS + """ +} diff --git a/modules/staphopiasccmec/meta.yml b/modules/staphopiasccmec/meta.yml new file mode 100644 index 00000000..006e5389 --- /dev/null +++ b/modules/staphopiasccmec/meta.yml @@ -0,0 +1,44 @@ +name: staphopiasccmec +description: Predicts Staphylococcus aureus SCCmec type based on primers. +keywords: + - amr + - fasta + - sccmec + +tools: + - staphopiasccmec: + description: Predicts Staphylococcus aureus SCCmec type based on primers. + homepage: https://staphopia.emory.edu + documentation: https://github.com/staphopia/staphopia-sccmec + tool_dev_url: https://github.com/staphopia/staphopia-sccmec + doi: https://doi.org/10.7717/peerj.5261 + licence: ['MIT'] + +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}" + +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/modules/star/align/functions.nf b/modules/star/align/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/star/align/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 e85ddb79..9725496f 100644 --- a/modules/star/align/main.nf +++ b/modules/star/align/main.nf @@ -1,49 +1,43 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process STAR_ALIGN { 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']) } // Note: 2.7X indices incompatible with AWS iGenomes. - conda (params.enable_conda ? 'bioconda::star=2.6.1d' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container 'https://depot.galaxyproject.org/singularity/star:2.6.1d--0' - } else { - container 'quay.io/biocontainers/star:2.6.1d--0' - } + conda (params.enable_conda ? 'bioconda::star=2.7.9a' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/star:2.7.9a--h9ee0642_0' : + 'quay.io/biocontainers/star:2.7.9a--h9ee0642_0' }" input: tuple val(meta), path(reads) path index path gtf + val star_ignore_sjdbgtf + val seq_platform + val seq_center output: tuple val(meta), path('*d.out.bam') , emit: bam 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: 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 tuple val(meta), path('*Aligned.unsort.out.bam') , optional:true, emit: bam_unsorted tuple val(meta), path('*fastq.gz') , optional:true, emit: fastq tuple val(meta), path('*.tab') , optional:true, emit: tab + 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_center = params.seq_center ? "--outSAMattrRGline ID:$prefix 'CN:$params.seq_center' 'SM:$prefix'" : "--outSAMattrRGline ID:$prefix 'SM:$prefix'" - def out_sam_type = (options.args.contains('--outSAMtype')) ? '' : '--outSAMtype BAM Unsorted' - def mv_unsorted_bam = (options.args.contains('--outSAMtype BAM Unsorted SortedByCoordinate')) ? "mv ${prefix}.Aligned.out.bam ${prefix}.Aligned.unsort.out.bam" : '' + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def ignore_gtf = star_ignore_sjdbgtf ? '' : "--sjdbGTFfile $gtf" + def seq_platform = seq_platform ? "'PL:$seq_platform'" : "" + def seq_center = seq_center ? "--outSAMattrRGline ID:$prefix 'CN:$seq_center' 'SM:$prefix' $seq_platform " : "--outSAMattrRGline ID:$prefix 'SM:$prefix' $seq_platform " + def out_sam_type = (args.contains('--outSAMtype')) ? '' : '--outSAMtype BAM Unsorted' + def mv_unsorted_bam = (args.contains('--outSAMtype BAM Unsorted SortedByCoordinate')) ? "mv ${prefix}.Aligned.out.bam ${prefix}.Aligned.unsort.out.bam" : '' """ STAR \\ --genomeDir $index \\ @@ -53,7 +47,7 @@ process STAR_ALIGN { $out_sam_type \\ $ignore_gtf \\ $seq_center \\ - $options.args + $args $mv_unsorted_bam @@ -66,6 +60,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 + "${task.process}": + star: \$(STAR --version | sed -e "s/STAR_//g") + END_VERSIONS """ } diff --git a/modules/star/align/meta.yml b/modules/star/align/meta.yml index 01bc2ecf..2d78b81a 100644 --- a/modules/star/align/meta.yml +++ b/modules/star/align/meta.yml @@ -13,6 +13,7 @@ tools: homepage: https://github.com/alexdobin/STAR manual: https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf doi: 10.1093/bioinformatics/bts635 + licence: ['MIT'] input: - meta: type: map @@ -45,10 +46,10 @@ output: type: file description: STAR log progress file pattern: "*Log.progress.out" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bam_sorted: type: file description: Sorted BAM file of read alignments (optional) @@ -69,7 +70,12 @@ output: type: file description: STAR output tab file(s) (optional) pattern: "*.tab" + - junction: + type: file + description: STAR chimeric junction output file (optional) + pattern: "*.out.junction" authors: - "@kevinmenden" - "@drpatelh" + - "@praveenraj2018" diff --git a/modules/star/genomegenerate/functions.nf b/modules/star/genomegenerate/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/star/genomegenerate/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 b440b415..ad32c0dd 100644 --- a/modules/star/genomegenerate/main.nf +++ b/modules/star/genomegenerate/main.nf @@ -1,23 +1,12 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process STAR_GENOMEGENERATE { tag "$fasta" label 'process_high' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) } // Note: 2.7X indices incompatible with AWS iGenomes. - conda (params.enable_conda ? "bioconda::star=2.6.1d bioconda::samtools=1.10 conda-forge::gawk=5.1.0" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:59cdd445419f14abac76b31dd0d71217994cbcc9-0" - } else { - container "quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:59cdd445419f14abac76b31dd0d71217994cbcc9-0" - } + conda (params.enable_conda ? "bioconda::star=2.7.9a bioconda::samtools=1.13 conda-forge::gawk=5.1.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:a7908dfb0485a80ca94e4d17b0ac991532e4e989-0' : + 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:a7908dfb0485a80ca94e4d17b0ac991532e4e989-0' }" input: path fasta @@ -25,13 +14,13 @@ process STAR_GENOMEGENERATE { output: path "star" , emit: index - path "*.version.txt", emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' + def args_list = args.tokenize() def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' - def args = options.args.tokenize() - if (args.contains('--genomeSAindexNbases')) { + if (args_list.contains('--genomeSAindexNbases')) { """ mkdir star STAR \\ @@ -41,9 +30,14 @@ process STAR_GENOMEGENERATE { --sjdbGTFfile $gtf \\ --runThreadN $task.cpus \\ $memory \\ - $options.args + $args - STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + star: \$(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 { """ @@ -59,9 +53,14 @@ process STAR_GENOMEGENERATE { --runThreadN $task.cpus \\ --genomeSAindexNbases \$NUM_BASES \\ $memory \\ - $options.args + $args - STAR --version | sed -e "s/STAR_//g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + star: \$(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/star/genomegenerate/meta.yml b/modules/star/genomegenerate/meta.yml index aae0219b..04ade195 100644 --- a/modules/star/genomegenerate/meta.yml +++ b/modules/star/genomegenerate/meta.yml @@ -13,6 +13,7 @@ tools: homepage: https://github.com/alexdobin/STAR manual: https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf doi: 10.1093/bioinformatics/bts635 + licence: ['MIT'] input: - fasta: type: file @@ -26,10 +27,10 @@ output: type: directory description: Folder containing the star index files pattern: "star" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@kevinmenden" diff --git a/modules/strelka/germline/functions.nf b/modules/strelka/germline/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/strelka/germline/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..324be6df 100644 --- a/modules/strelka/germline/main.nf +++ b/modules/strelka/germline/main.nf @@ -1,46 +1,36 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process STRELKA_GERMLINE { 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--0" - } else { - container "quay.io/biocontainers/strelka:2.9.10--0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/strelka:2.9.10--0' : + 'quay.io/biocontainers/strelka:2.9.10--0' }" input: - tuple val(meta), path(bam), path(bai) + tuple val(meta), path(input), path(input_index) path fasta path fai path target_bed + path target_bed_tbi output: tuple val(meta), path("*variants.vcf.gz") , emit: vcf 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: 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}" : "" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def regions = target_bed ? "--exome --callRegions ${target_bed}" : "" """ configureStrelkaGermlineWorkflow.py \\ - --bam $bam \\ + --bam $input \\ --referenceFasta $fasta \\ $regions \\ - $options.args \\ + $args \\ --runDir strelka python strelka/runWorkflow.py -m local -j $task.cpus @@ -49,6 +39,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 + "${task.process}": + strelka: \$( configureStrelkaGermlineWorkflow.py --version ) + END_VERSIONS """ } diff --git a/modules/strelka/germline/meta.yml b/modules/strelka/germline/meta.yml index ae0ecb47..2eeb0f8f 100644 --- a/modules/strelka/germline/meta.yml +++ b/modules/strelka/germline/meta.yml @@ -21,14 +21,14 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test'] - - bam: + - input: type: file - description: BAM file - pattern: "*.{bam}" - - bai: + description: BAM/CRAM file + pattern: "*.{bam,cram}" + - input_index: type: file - description: BAM index file - pattern: "*.{bai}" + description: BAM/CRAI index file + pattern: "*.{bai,crai}" - target_bed: type: file description: An optional bed file @@ -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 - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@arontommi" diff --git a/modules/strelka/somatic/main.nf b/modules/strelka/somatic/main.nf new file mode 100644 index 00000000..a9766d01 --- /dev/null +++ b/modules/strelka/somatic/main.nf @@ -0,0 +1,51 @@ +process STRELKA_SOMATIC { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::strelka=2.9.10" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/strelka:2.9.10--h9ee0642_1' : + 'quay.io/biocontainers/strelka:2.9.10--h9ee0642_1' }" + + input: + tuple val(meta), path(input_normal), path(input_index_normal), path(input_tumor), path(input_index_tumor), path(manta_candidate_small_indels), path(manta_candidate_small_indels_tbi) + 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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def options_target_bed = target_bed ? "--exome --callRegions ${target_bed}" : "" + def options_manta = manta_candidate_small_indels ? "--indelCandidates ${manta_candidate_small_indels}" : "" + """ + configureStrelkaSomaticWorkflow.py \\ + --tumor $input_tumor \\ + --normal $input_normal \\ + --referenceFasta $fasta \\ + $options_target_bed \\ + $options_manta \\ + $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 + "${task.process}": + strelka: \$( 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..076c1036 --- /dev/null +++ b/modules/strelka/somatic/meta.yml @@ -0,0 +1,93 @@ +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 ] + - input_normal: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - input_index_normal: + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" + - input_tumor: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - input_index_tumor: + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" + - manta_candidate_small_indels: + type: file + description: VCF.gz file + pattern: "*.{vcf.gz}" + - manta_candidate_small_indels_tbi: + type: file + description: VCF.gz index file + pattern: "*.tbi" + - 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/modules/stringtie/merge/functions.nf b/modules/stringtie/merge/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/stringtie/merge/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 3c88d494..756dc6ec 100644 --- a/modules/stringtie/merge/main.nf +++ b/modules/stringtie/merge/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process STRINGTIE_MERGE { 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:[:], publish_by_meta:[]) } // Note: 2.7X indices incompatible with AWS iGenomes. - conda (params.enable_conda ? "bioconda::stringtie=2.1.4" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/stringtie:2.1.4--h7e0af3c_0" - } else { - container "quay.io/biocontainers/stringtie:2.1.4--h7e0af3c_0" - } + conda (params.enable_conda ? "bioconda::stringtie=2.1.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/stringtie:2.1.7--h978d192_0' : + 'quay.io/biocontainers/stringtie:2.1.7--h978d192_0' }" input: path stringtie_gtf @@ -24,12 +13,19 @@ process STRINGTIE_MERGE { output: path "stringtie.merged.gtf", emit: gtf + path "versions.yml" , emit: versions script: + def args = task.ext.args ?: '' """ stringtie \\ --merge $stringtie_gtf \\ -G $annotation_gtf \\ -o stringtie.merged.gtf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + stringtie: \$(stringtie --version 2>&1) + END_VERSIONS """ } diff --git a/modules/stringtie/merge/meta.yml b/modules/stringtie/merge/meta.yml index 5752c0a9..02899766 100644 --- a/modules/stringtie/merge/meta.yml +++ b/modules/stringtie/merge/meta.yml @@ -10,6 +10,7 @@ tools: Transcript assembly and quantification for RNA-Seq homepage: https://ccb.jhu.edu/software/stringtie/index.shtml documentation: https://ccb.jhu.edu/software/stringtie/index.shtml?t=manual + licence: ['MIT'] input: - stringtie_gtf: type: file @@ -27,5 +28,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/functions.nf b/modules/stringtie/stringtie/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/stringtie/stringtie/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 eb751321..9d62a966 100644 --- a/modules/stringtie/stringtie/main.nf +++ b/modules/stringtie/stringtie/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process STRINGTIE { 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::stringtie=2.1.4" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/stringtie:2.1.4--h7e0af3c_0" - } else { - container "quay.io/biocontainers/stringtie:2.1.4--h7e0af3c_0" - } + conda (params.enable_conda ? "bioconda::stringtie=2.1.7" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/stringtie:2.1.7--h978d192_0' : + 'quay.io/biocontainers/stringtie:2.1.7--h978d192_0' }" input: tuple val(meta), path(bam) @@ -27,11 +16,11 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def strandedness = '' if (meta.strandedness == 'forward') { @@ -48,8 +37,12 @@ process STRINGTIE { -A ${prefix}.gene.abundance.txt \\ -C ${prefix}.coverage.gtf \\ -b ${prefix}.ballgown \\ - $options.args + -p $task.cpus \\ + $args - stringtie --version > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + stringtie: \$(stringtie --version 2>&1) + END_VERSIONS """ } diff --git a/modules/stringtie/stringtie/meta.yml b/modules/stringtie/stringtie/meta.yml index 52ec899d..7e854caa 100644 --- a/modules/stringtie/stringtie/meta.yml +++ b/modules/stringtie/stringtie/meta.yml @@ -12,6 +12,7 @@ tools: Transcript assembly and quantification for RNA-Seq homepage: https://ccb.jhu.edu/software/stringtie/index.shtml documentation: https://ccb.jhu.edu/software/stringtie/index.shtml?t=manual + licence: ['MIT'] input: - meta: type: map @@ -48,9 +49,9 @@ output: type: file description: for running ballgown pattern: "*.{ballgown}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" diff --git a/modules/subread/featurecounts/functions.nf b/modules/subread/featurecounts/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/subread/featurecounts/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..53eb279e 100644 --- a/modules/subread/featurecounts/main.nf +++ b/modules/subread/featurecounts/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process SUBREAD_FEATURECOUNTS { 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::subread=2.0.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/subread:2.0.1--hed695b0_0" - } else { - container "quay.io/biocontainers/subread:2.0.1--hed695b0_0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/subread:2.0.1--hed695b0_0' : + 'quay.io/biocontainers/subread:2.0.1--hed695b0_0' }" input: tuple val(meta), path(bams), path(annotation) @@ -24,11 +13,11 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def paired_end = meta.single_end ? '' : '-p' def strandedness = 0 @@ -39,7 +28,7 @@ process SUBREAD_FEATURECOUNTS { } """ featureCounts \\ - $options.args \\ + $args \\ $paired_end \\ -T $task.cpus \\ -a $annotation \\ @@ -47,6 +36,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 + "${task.process}": + subread: \$( echo \$(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..1100a091 100644 --- a/modules/subread/featurecounts/meta.yml +++ b/modules/subread/featurecounts/meta.yml @@ -43,10 +43,10 @@ output: type: file description: Summary log file pattern: "*.featureCounts.txt.summary" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@ntoda03" diff --git a/modules/tabix/bgzip/functions.nf b/modules/tabix/bgzip/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/tabix/bgzip/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 56a351db..ed9362b2 100644 --- a/modules/tabix/bgzip/main.nf +++ b/modules/tabix/bgzip/main.nf @@ -1,36 +1,28 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process TABIX_BGZIP { 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::tabix=0.2.6" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/tabix:0.2.6--ha92aebf_0" - } else { - container "quay.io/biocontainers/tabix:0.2.6--ha92aebf_0" - } + conda (params.enable_conda ? 'bioconda::tabix=1.11' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' : + 'quay.io/biocontainers/tabix:1.11--hdfd78af_0' }" input: tuple val(meta), path(input) output: tuple val(meta), path("*.gz"), emit: gz - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ - bgzip -c $options.args $input > ${prefix}.${input.getExtension()}.gz + bgzip -c $args $input > ${prefix}.${input.getExtension()}.gz - echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + tabix: \$(echo \$(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..f8318c7c 100644 --- a/modules/tabix/bgzip/meta.yml +++ b/modules/tabix/bgzip/meta.yml @@ -11,6 +11,7 @@ tools: homepage: https://www.htslib.org/doc/tabix.html documentation: http://www.htslib.org/doc/bgzip.html doi: 10.1093/bioinformatics/btp352 + licence: ['MIT'] input: - meta: type: map @@ -30,10 +31,10 @@ output: type: file description: Output compressed file pattern: "*.{gz}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/tabix/bgziptabix/functions.nf b/modules/tabix/bgziptabix/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/tabix/bgziptabix/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 866a8bf8..e419d153 100644 --- a/modules/tabix/bgziptabix/main.nf +++ b/modules/tabix/bgziptabix/main.nf @@ -1,37 +1,30 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process TABIX_BGZIPTABIX { 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::tabix=0.2.6" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/tabix:0.2.6--ha92aebf_0" - } else { - container "quay.io/biocontainers/tabix:0.2.6--ha92aebf_0" - } + conda (params.enable_conda ? 'bioconda::tabix=1.11' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' : + 'quay.io/biocontainers/tabix:1.11--hdfd78af_0' }" input: tuple val(meta), path(input) output: - tuple val(meta), path("*.gz"), path("*.tbi"), emit: tbi - path "*.version.txt", emit: version + tuple val(meta), path("*.gz"), path("*.tbi"), emit: gz_tbi + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ - bgzip -c $options.args $input > ${prefix}.gz - tabix $options.args2 ${prefix}.gz + bgzip -c $args $input > ${prefix}.gz + tabix $args2 ${prefix}.gz - echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + tabix: \$(echo \$(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..f2aed84d 100644 --- a/modules/tabix/bgziptabix/meta.yml +++ b/modules/tabix/bgziptabix/meta.yml @@ -12,6 +12,7 @@ tools: homepage: https://www.htslib.org/doc/tabix.html documentation: https://www.htslib.org/doc/tabix.1.html doi: 10.1093/bioinformatics/btq671 + licence: ['MIT'] input: - meta: type: map @@ -36,9 +37,9 @@ output: type: file description: tabix index file pattern: "*.{gz.tbi}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/tabix/tabix/functions.nf b/modules/tabix/tabix/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/tabix/tabix/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 da23f535..c721a554 100644 --- a/modules/tabix/tabix/main.nf +++ b/modules/tabix/tabix/main.nf @@ -1,35 +1,27 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process TABIX_TABIX { 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::tabix=0.2.6" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/tabix:0.2.6--ha92aebf_0" - } else { - container "quay.io/biocontainers/tabix:0.2.6--ha92aebf_0" - } + conda (params.enable_conda ? 'bioconda::tabix=1.11' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' : + 'quay.io/biocontainers/tabix:1.11--hdfd78af_0' }" input: tuple val(meta), path(tab) output: tuple val(meta), path("*.tbi"), emit: tbi - path "*.version.txt" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ - tabix $options.args $tab + tabix $args $tab - echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + tabix: \$(echo \$(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..2e37c4ff 100644 --- a/modules/tabix/tabix/meta.yml +++ b/modules/tabix/tabix/meta.yml @@ -10,6 +10,7 @@ tools: homepage: https://www.htslib.org/doc/tabix.html documentation: https://www.htslib.org/doc/tabix.1.html doi: 10.1093/bioinformatics/btq671 + licence: ['MIT'] input: - meta: type: map @@ -30,10 +31,10 @@ output: type: file description: tabix index file pattern: "*.{tbi}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/tbprofiler/profile/main.nf b/modules/tbprofiler/profile/main.nf new file mode 100644 index 00000000..87175a39 --- /dev/null +++ b/modules/tbprofiler/profile/main.nf @@ -0,0 +1,38 @@ +process TBPROFILER_PROFILE { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::tb-profiler=3.0.8" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/tb-profiler:3.0.8--pypyh5e36f6f_0' : + 'quay.io/biocontainers/tb-profiler:3.0.8--pypyh5e36f6f_0' }" + + input: + tuple val(meta), path(reads) + + output: + tuple val(meta), path("bam/*.bam") , emit: bam + tuple val(meta), path("results/*.csv") , emit: csv, optional: true + tuple val(meta), path("results/*.json"), emit: json + tuple val(meta), path("results/*.txt") , emit: txt, optional: true + tuple val(meta), path("vcf/*.vcf.gz") , emit: vcf + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def input_reads = meta.single_end ? "--read1 $reads" : "--read1 ${reads[0]} --read2 ${reads[1]}" + """ + tb-profiler \\ + profile \\ + $args \\ + --prefix ${prefix} \\ + --threads $task.cpus \\ + $input_reads + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + tbprofiler: \$( echo \$(tb-profiler --version 2>&1) | sed 's/TBProfiler version //') + END_VERSIONS + """ +} diff --git a/modules/tbprofiler/profile/meta.yml b/modules/tbprofiler/profile/meta.yml new file mode 100644 index 00000000..0cac6d6b --- /dev/null +++ b/modules/tbprofiler/profile/meta.yml @@ -0,0 +1,59 @@ +name: tbprofiler_profile +description: A tool to detect resistance and lineages of M. tuberculosis genomes +keywords: + - Mycobacterium tuberculosis + - resistance + - serotype +tools: + - tbprofiler: + description: Profiling tool for Mycobacterium tuberculosis to detect drug resistance and lineage from WGS data + homepage: https://github.com/jodyphelan/TBProfiler + documentation: https://jodyphelan.gitbook.io/tb-profiler/ + tool_dev_url: https://github.com/jodyphelan/TBProfiler + doi: "10.1186/s13073-019-0650-x" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: FASTQ file + pattern: "*.{fastq.gz,fq.gz}" + +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: BAM file with alignment details + pattern: "*.bam" + - csv: + type: file + description: Optional CSV formated result file of resistance and strain type + pattern: "*.csv" + - json: + type: file + description: JSON formated result file of resistance and strain type + pattern: "*.json" + - txt: + type: file + description: Optional text file of resistance and strain type + pattern: "*.txt" + - vcf: + type: file + description: VCF with variant info again refernce genomes + pattern: "*.vcf" + +authors: + - "@rpetit3" diff --git a/modules/tiddit/cov/main.nf b/modules/tiddit/cov/main.nf new file mode 100644 index 00000000..c5a1ca0f --- /dev/null +++ b/modules/tiddit/cov/main.nf @@ -0,0 +1,36 @@ +process TIDDIT_COV { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::tiddit=2.12.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/tiddit:2.12.1--py38h1773678_0' : + '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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def reference = fasta ? "--ref $fasta" : "" + """ + tiddit \\ + --cov \\ + -o $prefix \\ + $args \\ + --bam $bam \\ + $reference + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + tiddit: \$(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/modules/tiddit/sv/functions.nf b/modules/tiddit/sv/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/tiddit/sv/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..08eecc01 100644 --- a/modules/tiddit/sv/main.nf +++ b/modules/tiddit/sv/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process TIDDIT_SV { 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::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" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/tiddit:2.12.1--py38h1773678_0' : + 'quay.io/biocontainers/tiddit:2.12.1--py38h1773678_0' }" input: tuple val(meta), path(bam) @@ -27,19 +16,23 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def reference = fasta == "dummy_file.txt" ? "--ref $fasta" : "" """ tiddit \\ - --sv $options.args \\ + --sv \\ + $args \\ --bam $bam \\ $reference \\ -o $prefix - echo \$(tiddit -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*TIDDIT-//; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/tiddit/sv/meta.yml b/modules/tiddit/sv/meta.yml index f1601f72..f788ffa6 100644 --- a/modules/tiddit/sv/meta.yml +++ b/modules/tiddit/sv/meta.yml @@ -10,6 +10,7 @@ tools: homepage: https://github.com/SciLifeLab/TIDDIT documentation: https://github.com/SciLifeLab/TIDDIT/blob/master/README.md doi: 10.12688/f1000research.11168.1 + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -42,9 +43,9 @@ output: type: file description: tab pattern: "*.{signals.tab}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@maxulysse" diff --git a/modules/trimgalore/functions.nf b/modules/trimgalore/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/trimgalore/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 44b36e71..ee40b780 100644 --- a/modules/trimgalore/main.nf +++ b/modules/trimgalore/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process TRIMGALORE { 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::trim-galore=0.6.6" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/trim-galore:0.6.6--0" - } else { - container "quay.io/biocontainers/trim-galore:0.6.6--0" - } + conda (params.enable_conda ? 'bioconda::trim-galore=0.6.7' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/trim-galore:0.6.7--hdfd78af_0' : + 'quay.io/biocontainers/trim-galore:0.6.7--hdfd78af_0' }" input: tuple val(meta), path(reads) @@ -24,12 +13,13 @@ 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: versions tuple val(meta), path("*.html"), emit: html optional true tuple val(meta), path("*.zip") , emit: zip optional true script: + def args = task.ext.args ?: '' // Calculate number of --cores for TrimGalore based on value of task.cpus // See: https://github.com/FelixKrueger/TrimGalore/blob/master/Changelog.md#version-060-release-on-1-mar-2019 // See: https://github.com/nf-core/atacseq/pull/65 @@ -48,26 +38,29 @@ 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}" + def prefix = task.ext.prefix ?: "${meta.id}" if (meta.single_end) { """ [ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz trim_galore \\ - $options.args \\ + $args \\ --cores $cores \\ --gzip \\ $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 + "${task.process}": + trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//') + cutadapt: \$(cutadapt --version) + 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 trim_galore \\ - $options.args \\ + $args \\ --cores $cores \\ --paired \\ --gzip \\ @@ -77,7 +70,11 @@ 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 + "${task.process}": + trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//') + cutadapt: \$(cutadapt --version) + END_VERSIONS """ } } diff --git a/modules/trimgalore/meta.yml b/modules/trimgalore/meta.yml index 73538707..c7e1df1d 100644 --- a/modules/trimgalore/meta.yml +++ b/modules/trimgalore/meta.yml @@ -13,6 +13,7 @@ tools: MspI-digested RRBS-type (Reduced Representation Bisufite-Seq) libraries. homepage: https://www.bioinformatics.babraham.ac.uk/projects/trim_galore/ documentation: https://github.com/FelixKrueger/TrimGalore/blob/master/Docs/Trim_Galore_User_Guide.md + licence: ['GPL-3.0-or-later'] input: - meta: type: map @@ -48,10 +49,10 @@ output: type: file description: Trim Galore! trimming report pattern: "*_{report.txt}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/ucsc/bed12tobigbed/functions.nf b/modules/ucsc/bed12tobigbed/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/ucsc/bed12tobigbed/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..742798b3 100644 --- a/modules/ucsc/bed12tobigbed/main.nf +++ b/modules/ucsc/bed12tobigbed/main.nf @@ -1,24 +1,13 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '377' +def VERSION = '377' // Version information not provided by tool on CLI process UCSC_BED12TOBIGBED { 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::ucsc-bedtobigbed=377" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/ucsc-bedtobigbed:377--h446ed27_1" - } else { - container "quay.io/biocontainers/ucsc-bedtobigbed:377--h446ed27_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ucsc-bedtobigbed:377--h446ed27_1' : + 'quay.io/biocontainers/ucsc-bedtobigbed:377--h446ed27_1' }" input: tuple val(meta), path(bed) @@ -26,17 +15,20 @@ process UCSC_BED12TOBIGBED { output: tuple val(meta), path("*.bigBed"), emit: bigbed - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bedToBigBed \\ $bed \\ $sizes \\ ${prefix}.bigBed - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ucsc: $VERSION + END_VERSIONS """ } diff --git a/modules/ucsc/bed12tobigbed/meta.yml b/modules/ucsc/bed12tobigbed/meta.yml index 7541eb2d..f3e8a604 100755 --- a/modules/ucsc/bed12tobigbed/meta.yml +++ b/modules/ucsc/bed12tobigbed/meta.yml @@ -33,10 +33,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bigbed: type: file description: bigBed file diff --git a/modules/ucsc/bedclip/functions.nf b/modules/ucsc/bedclip/functions.nf deleted file mode 100755 index da9da093..00000000 --- a/modules/ucsc/bedclip/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..dacd7260 100755 --- a/modules/ucsc/bedclip/main.nf +++ b/modules/ucsc/bedclip/main.nf @@ -1,24 +1,13 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '377' +def VERSION = '377' // Version information not provided by tool on CLI process UCSC_BEDCLIP { 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::ucsc-bedclip=377" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/ucsc-bedclip:377--h0b8a92a_2" - } else { - container "quay.io/biocontainers/ucsc-bedclip:377--h0b8a92a_2" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ucsc-bedclip:377--h0b8a92a_2' : + 'quay.io/biocontainers/ucsc-bedclip:377--h0b8a92a_2' }" input: tuple val(meta), path(bedgraph) @@ -26,17 +15,20 @@ process UCSC_BEDCLIP { output: tuple val(meta), path("*.bedGraph"), emit: bedgraph - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ bedClip \\ $bedgraph \\ $sizes \\ ${prefix}.bedGraph - echo $VERSION > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ucsc: $VERSION + END_VERSIONS """ } diff --git a/modules/ucsc/bedclip/meta.yml b/modules/ucsc/bedclip/meta.yml index f20b4617..c7372925 100755 --- a/modules/ucsc/bedclip/meta.yml +++ b/modules/ucsc/bedclip/meta.yml @@ -28,10 +28,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bedgraph: type: file description: bedGraph file diff --git a/modules/ucsc/bedgraphtobigwig/functions.nf b/modules/ucsc/bedgraphtobigwig/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/ucsc/bedgraphtobigwig/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..9ba306ab 100644 --- a/modules/ucsc/bedgraphtobigwig/main.nf +++ b/modules/ucsc/bedgraphtobigwig/main.nf @@ -1,24 +1,13 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - -def VERSION = '377' +def VERSION = '377' // Version information not provided by tool on CLI process UCSC_BEDGRAPHTOBIGWIG { 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::ucsc-bedgraphtobigwig=377" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1" - } else { - container "quay.io/biocontainers/ucsc-bedgraphtobigwig:377--h446ed27_1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1' : + 'quay.io/biocontainers/ucsc-bedgraphtobigwig:377--h446ed27_1' }" input: tuple val(meta), path(bedgraph) @@ -26,13 +15,20 @@ process UCSC_BEDGRAPHTOBIGWIG { output: tuple val(meta), path("*.bigWig"), emit: bigwig - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" """ - bedGraphToBigWig $bedgraph $sizes ${prefix}.bigWig - echo $VERSION > ${software}.version.txt + bedGraphToBigWig \\ + $bedgraph \\ + $sizes \\ + ${prefix}.bigWig + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ucsc: $VERSION + END_VERSIONS """ } diff --git a/modules/ucsc/bedgraphtobigwig/meta.yml b/modules/ucsc/bedgraphtobigwig/meta.yml index 31365f48..1be1a3b7 100755 --- a/modules/ucsc/bedgraphtobigwig/meta.yml +++ b/modules/ucsc/bedgraphtobigwig/meta.yml @@ -33,10 +33,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bigwig: type: file description: bigWig file diff --git a/modules/ucsc/bigwigaverageoverbed/functions.nf b/modules/ucsc/bigwigaverageoverbed/functions.nf deleted file mode 100755 index da9da093..00000000 --- a/modules/ucsc/bigwigaverageoverbed/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..1e97c83d 100644 --- a/modules/ucsc/bigwigaverageoverbed/main.nf +++ b/modules/ucsc/bigwigaverageoverbed/main.nf @@ -1,38 +1,36 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) +def VERSION = '377' // Version information not provided by tool on CLI process UCSC_BIGWIGAVERAGEOVERBED { 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::ucsc-bigwigaverageoverbed=377" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/ucsc-bigwigaverageoverbed:377--h0b8a92a_2" - } else { - container "quay.io/biocontainers/ucsc-bigwigaverageoverbed:377--h0b8a92a_2" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ucsc-bigwigaverageoverbed:377--h0b8a92a_2' : + 'quay.io/biocontainers/ucsc-bigwigaverageoverbed:377--h0b8a92a_2' }" input: tuple val(meta), path(bed) path bigwig output: - tuple val(meta), path("*.tab") , emit: tab - path "*.version.txt" , emit: version + tuple val(meta), path("*.tab"), emit: tab + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + // BUG: bigWigAverageOverBed cannot handle ensembl seqlevels style """ - # there is a bug that bigWigAverageOverBed can not handle ensembl seqlevels style. - bigWigAverageOverBed ${options.args} $bigwig $bed ${bed.getSimpleName()}.tab + bigWigAverageOverBed \\ + $args \\ + $bigwig \\ + $bed \\ + ${prefix}.tab - echo \$(bigWigAverageOverBed 2>&1) | sed 's/bigWigAverageOverBed v//; s/ - Compute.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ucsc: $VERSION + END_VERSIONS """ } diff --git a/modules/ucsc/bigwigaverageoverbed/meta.yml b/modules/ucsc/bigwigaverageoverbed/meta.yml index 1f007f42..c2b31f88 100644 --- a/modules/ucsc/bigwigaverageoverbed/meta.yml +++ b/modules/ucsc/bigwigaverageoverbed/meta.yml @@ -33,10 +33,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - tab: type: file description: tab file diff --git a/modules/ucsc/liftover/main.nf b/modules/ucsc/liftover/main.nf new file mode 100644 index 00000000..3dd9531e --- /dev/null +++ b/modules/ucsc/liftover/main.nf @@ -0,0 +1,38 @@ +def VERSION = '377' // Version information not provided by tool on CLI + +process UCSC_LIFTOVER { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::ucsc-liftover=377" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ucsc-liftover:377--h0b8a92a_3' : + 'quay.io/biocontainers/ucsc-liftover:377--h0b8a92a_3' }" + + input: + tuple val(meta), path(bed) + path(chain) + + output: + tuple val(meta), path("*.lifted.bed") , emit: lifted + tuple val(meta), path("*.unlifted.bed"), emit: unlifted + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + liftOver \\ + $args \ + $bed \\ + $chain \\ + ${prefix}.lifted.bed \\ + ${prefix}.unlifted.bed + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ucsc: $VERSION + END_VERSIONS + """ +} diff --git a/modules/ucsc/liftover/meta.yml b/modules/ucsc/liftover/meta.yml new file mode 100644 index 00000000..5c2febdc --- /dev/null +++ b/modules/ucsc/liftover/meta.yml @@ -0,0 +1,45 @@ +name: ucsc_liftover +description: convert between genome builds +keywords: + - liftOver +tools: + - ucsc: + description: Move annotations from one assembly to another + homepage: http://hgdownload.cse.ucsc.edu/admin/exe/ + documentation: None + tool_dev_url: None + doi: "" + licence: ['varies; see http://genome.ucsc.edu/license'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: Browser Extensible Data (BED) file + 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: "versions.yml" + - lifted: + type: file + description: BED file containing successfully lifted variants + pattern: "*.{lifted.bed}" + - unlifted: + type: file + description: BED file containing variants that couldn't be lifted + pattern: "*.{unlifted.bed}" + +authors: + - "@nebfield" diff --git a/modules/ucsc/wigtobigwig/functions.nf b/modules/ucsc/wigtobigwig/functions.nf deleted file mode 100755 index da9da093..00000000 --- a/modules/ucsc/wigtobigwig/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..4c596c9a 100644 --- a/modules/ucsc/wigtobigwig/main.nf +++ b/modules/ucsc/wigtobigwig/main.nf @@ -1,41 +1,34 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) +def VERSION = '377' // Version information not provided by tool on CLI process UCSC_WIGTOBIGWIG { tag '$wig' 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:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::ucsc-wigtobigwig=377" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/ucsc-wigtobigwig:377--h0b8a92a_2" - } else { - container "quay.io/biocontainers/ucsc-wigtobigwig:377--h0b8a92a_2" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ucsc-wigtobigwig:377--h0b8a92a_2' : + 'quay.io/biocontainers/ucsc-wigtobigwig:377--h0b8a92a_2' }" input: path wig - path chromsizes + path sizes output: - path "*.bw" , emit: bw - path "*.version.txt" , emit: version + path "*.bw" , emit: bw + path "versions.yml", emit: versions script: - def software = getSoftwareName(task.process) - + def args = task.ext.args ?: '' """ wigToBigWig \\ - $options.args \\ + $args \\ $wig \\ - $chromsizes \\ + $sizes \\ ${wig.getSimpleName()}.bw - echo \$(wigToBigWig 2>&1) | sed 's/wigToBigWig v //; s/ - Convert.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ucsc: $VERSION + END_VERSIONS """ } diff --git a/modules/ucsc/wigtobigwig/meta.yml b/modules/ucsc/wigtobigwig/meta.yml index 6ed4b026..4723ff2b 100644 --- a/modules/ucsc/wigtobigwig/meta.yml +++ b/modules/ucsc/wigtobigwig/meta.yml @@ -24,10 +24,10 @@ input: description: chromosome sizes file output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bw: type: file description: bigwig file diff --git a/modules/ultra/pipeline/main.nf b/modules/ultra/pipeline/main.nf new file mode 100644 index 00000000..f2dcb543 --- /dev/null +++ b/modules/ultra/pipeline/main.nf @@ -0,0 +1,38 @@ +process ULTRA_PIPELINE { + tag "$meta.id" + label 'process_high' + + conda (params.enable_conda ? "bioconda::ultra_bioinformatics=0.0.4.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ultra_bioinformatics:0.0.4.1--pyh5e36f6f_0' : + 'quay.io/biocontainers/ultra_bioinformatics:0.0.4.1--pyh5e36f6f_0' }" + + input: + tuple val(meta), path(reads) + path genome + path gtf + + output: + tuple val(meta), path("*.sam"), emit: sam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + uLTRA \\ + pipeline \\ + --t $task.cpus \\ + --prefix $prefix \\ + $args \\ + $genome \\ + $gtf \\ + $reads \\ + ./ + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ultra: \$( uLTRA --version|sed 's/uLTRA //g' ) + END_VERSIONS + """ +} diff --git a/modules/ultra/pipeline/meta.yml b/modules/ultra/pipeline/meta.yml new file mode 100644 index 00000000..fa8366e8 --- /dev/null +++ b/modules/ultra/pipeline/meta.yml @@ -0,0 +1,52 @@ +name: ultra_pipeline +description: uLTRA aligner - A wrapper around minimap2 to improve small exon detection +keywords: + - uLTRA + - minimap2 +tools: + - ultra: + description: Splice aligner of long transcriptomic reads to genome. + homepage: https://github.com/ksahlin/uLTRA + documentation: https://github.com/ksahlin/uLTRA + tool_dev_url: https://github.com/ksahlin/uLTRA + doi: "10.1093/bioinformatics/btab540" + licence: ['GNU GPLV3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: A fasta or fastq file of reads to align + pattern: "*.{fasta,fastq}" + - genome: + type: file + description: fasta file of reference genome + pattern: "*.fasta" + - gtf: + type: file + description: A annotation of use the genome + pattern: "*.gtf" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - sam: + type: file + description: The aligned reads in sam format + pattern: "*.sam" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@sguizard" + - "@lassefolkersen" + - "@ksahlin" diff --git a/modules/umitools/dedup/functions.nf b/modules/umitools/dedup/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/umitools/dedup/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 93ea6d45..ce21437d 100644 --- a/modules/umitools/dedup/main.nf +++ b/modules/umitools/dedup/main.nf @@ -1,41 +1,33 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process UMITOOLS_DEDUP { 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::umi_tools=1.1.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/umi_tools:1.1.1--py38h0213d0e_1" - } else { - container "quay.io/biocontainers/umi_tools:1.1.1--py38h0213d0e_1" - } + conda (params.enable_conda ? "bioconda::umi_tools=1.1.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/umi_tools:1.1.2--py38h4a8c8d9_0' : + 'quay.io/biocontainers/umi_tools:1.1.2--py38h4a8c8d9_0' }" input: tuple val(meta), path(bam), path(bai) output: tuple val(meta), path("*.bam"), emit: bam - tuple val(meta), path("*.tsv"), emit: tsv - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def paired = meta.single_end ? "" : "--paired" """ umi_tools dedup \\ -I $bam \\ -S ${prefix}.bam \\ - --output-stats=$prefix \\ - $options.args \\ + $paired \\ + $args - umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + umitools: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') + END_VERSIONS """ } diff --git a/modules/umitools/dedup/meta.yml b/modules/umitools/dedup/meta.yml new file mode 100644 index 00000000..f89cc1ea --- /dev/null +++ b/modules/umitools/dedup/meta.yml @@ -0,0 +1,47 @@ +name: umitools_dedup +description: Deduplicate reads based on the mapping co-ordinate and the UMI attached to the read. +keywords: + - umitools + - deduplication +tools: + - umi_tools: + description: > + UMI-tools contains tools for dealing with Unique Molecular Identifiers (UMIs)/Random Molecular Tags (RMTs) + and single cell RNA-Seq cell barcodes + documentation: https://umi-tools.readthedocs.io/en/latest/ + license: ['MIT'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: | + BAM file containing reads to be deduplicated via UMIs. + pattern: "*.{bam}" + - bai: + type: file + description: | + BAM index files corresponding to the input BAM file. + pattern: "*.{bai}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM file with deduplicated UMIs. + pattern: "*.{bam}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@drpatelh" + - "@grst" + - "@klkeys" diff --git a/modules/umitools/extract/functions.nf b/modules/umitools/extract/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/umitools/extract/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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 581f41c3..fba8f054 100644 --- a/modules/umitools/extract/main.nf +++ b/modules/umitools/extract/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process UMITOOLS_EXTRACT { 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::umi_tools=1.1.1" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/umi_tools:1.1.1--py38h0213d0e_1" - } else { - container "quay.io/biocontainers/umi_tools:1.1.1--py38h0213d0e_1" - } + conda (params.enable_conda ? "bioconda::umi_tools=1.1.2" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/umi_tools:1.1.2--py38h4a8c8d9_0' : + 'quay.io/biocontainers/umi_tools:1.1.2--py38h4a8c8d9_0' }" input: tuple val(meta), path(reads) @@ -24,21 +13,24 @@ 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: versions script: - def software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" if (meta.single_end) { """ umi_tools \\ extract \\ -I $reads \\ -S ${prefix}.umi_extract.fastq.gz \\ - $options.args \\ + $args \\ > ${prefix}.umi_extract.log - umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + umitools: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') + END_VERSIONS """ } else { """ @@ -48,10 +40,13 @@ process UMITOOLS_EXTRACT { --read2-in=${reads[1]} \\ -S ${prefix}.umi_extract_1.fastq.gz \\ --read2-out=${prefix}.umi_extract_2.fastq.gz \\ - $options.args \\ + $args \\ > ${prefix}.umi_extract.log - umi_tools --version | sed -e "s/UMI-tools version: //g" > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + umitools: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') + END_VERSIONS """ } } diff --git a/modules/umitools/extract/meta.yml b/modules/umitools/extract/meta.yml new file mode 100644 index 00000000..ae6f9fee --- /dev/null +++ b/modules/umitools/extract/meta.yml @@ -0,0 +1,46 @@ +name: umitools_extract +description: Extracts UMI barcode from a read and add it to the read name, leaving any sample barcode in place +keywords: + - umitools + - extract +tools: + - umi_tools: + description: > + UMI-tools contains tools for dealing with Unique Molecular Identifiers (UMIs)/Random Molecular Tags (RMTs) + and single cell RNA-Seq cell barcodes + documentation: https://umi-tools.readthedocs.io/en/latest/ + license: ['MIT'] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: list + description: | + List of input FASTQ files whose UMIs will be extracted. +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: Extracted FASTQ files. | + For single-end reads, pattern is \${prefix}.umi_extract.fastq.gz. | + For paired-end reads, pattern is \${prefix}.umi_extract_{1,2}.fastq.gz. + pattern: "*.{fastq.gz}" + - log: + type: file + description: Logfile for umi_tools + pattern: "*.{log}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@drpatelh" + - "@grst" diff --git a/modules/unicycler/functions.nf b/modules/unicycler/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/unicycler/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..1ccc72a9 100644 --- a/modules/unicycler/main.nf +++ b/modules/unicycler/main.nf @@ -1,47 +1,43 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process UNICYCLER { 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::unicycler=0.4.8' : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/unicycler:0.4.8--py38h8162308_3" - } else { - container "quay.io/biocontainers/unicycler:0.4.8--py38h8162308_3" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/unicycler:0.4.8--py38h8162308_3' : + 'quay.io/biocontainers/unicycler:0.4.8--py38h8162308_3' }" input: - tuple val(meta), path(reads) + tuple val(meta), path(shortreads), path(longreads) output: - 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 + tuple val(meta), path('*.scaffolds.fa.gz'), emit: scaffolds + tuple val(meta), path('*.assembly.gfa.gz'), emit: gfa + tuple val(meta), path('*.log') , emit: log + 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 args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def short_reads = shortreads ? ( meta.single_end ? "-s $shortreads" : "-1 ${shortreads[0]} -2 ${shortreads[1]}" ) : "" + def long_reads = longreads ? "-l $longreads" : "" """ unicycler \\ --threads $task.cpus \\ - $options.args \\ - $input_reads \\ + $args \\ + $short_reads \\ + $long_reads \\ --out ./ mv assembly.fasta ${prefix}.scaffolds.fa + gzip -n ${prefix}.scaffolds.fa mv assembly.gfa ${prefix}.assembly.gfa + gzip -n ${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 + "${task.process}": + unicycler: \$(echo \$(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..b04ac882 100644 --- a/modules/unicycler/meta.yml +++ b/modules/unicycler/meta.yml @@ -19,37 +19,42 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - reads: + - shortreads: type: file description: | - List of input FastQ files of size 1 and 2 for single-end and paired-end data, + List of input Illumina FastQ files of size 1 and 2 for single-end and paired-end data, respectively. + - longreads: + type: file + description: | + List of input FastQ files of size 1, PacBio or Nanopore long reads. output: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - scaffolds: type: file description: Fasta file containing scaffolds - pattern: "*.{scaffolds.fa}" + pattern: "*.{scaffolds.fa.gz}" - gfa: type: file description: gfa file containing assembly - pattern: "*.{assembly.gfa}" + pattern: "*.{assembly.gfa.gz}" - log: type: file description: unicycler log file pattern: "*.{log}" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@JoseEspinosa" - "@drpatelh" + - "@d4straub" diff --git a/modules/untar/functions.nf b/modules/untar/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/untar/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..6d1996e7 100644 --- a/modules/untar/main.nf +++ b/modules/untar/main.nf @@ -1,35 +1,33 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process UNTAR { tag "$archive" 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 ? "conda-forge::sed=4.7" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img" - } else { - container "biocontainers/biocontainers:v1.2.0_cv1" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : + 'biocontainers/biocontainers:v1.2.0_cv1' }" input: path archive output: - path "$untar" , emit: untar - path "*.version.txt", emit: version + path "$untar" , emit: untar + path "versions.yml", emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' untar = archive.toString() - '.tar.gz' """ - tar -xzvf $options.args $archive - echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//' > ${software}.version.txt + tar \\ + -xzvf \\ + $args \\ + $archive \\ + $args2 \\ + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + untar: \$(echo \$(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..51f94995 100644 --- a/modules/untar/meta.yml +++ b/modules/untar/meta.yml @@ -8,6 +8,7 @@ tools: description: | Extract tar.gz files. documentation: https://www.gnu.org/software/tar/manual/ + licence: ['GPL-3.0-or-later'] input: - archive: type: file @@ -18,10 +19,10 @@ output: type: file description: pattern: "*.*" - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/unzip/main.nf b/modules/unzip/main.nf new file mode 100644 index 00000000..294ac0b0 --- /dev/null +++ b/modules/unzip/main.nf @@ -0,0 +1,32 @@ +process UNZIP { + tag "$archive" + label 'process_low' + + conda (params.enable_conda ? "bioconda::p7zip=15.09" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/p7zip:15.09--h2d50403_4' : + 'quay.io/biocontainers/p7zip:15.09--h2d50403_4' }" + + input: + path archive + + output: + path "${archive.baseName}/", emit: unzipped_archive + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + 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 \\ + -o"${archive.baseName}"/ \\ + $args \\ + $archive + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + 7za: \$(echo \$(7za --help) | sed 's/.*p7zip Version //; s/(.*//') + END_VERSIONS + """ +} diff --git a/modules/unzip/meta.yml b/modules/unzip/meta.yml new file mode 100644 index 00000000..7bca1ec2 --- /dev/null +++ b/modules/unzip/meta.yml @@ -0,0 +1,31 @@ +name: unzip +description: Unzip ZIP archive files +keywords: + - unzip + - decompression +tools: + - unzip: + description: p7zip is a quick port of 7z.exe and 7za.exe (command line version of 7zip, see www.7-zip.org) for Unix. + homepage: https://sourceforge.net/projects/p7zip/ + documentation: https://sourceforge.net/projects/p7zip/ + tool_dev_url: https://sourceforge.net/projects/p7zip" + licence: ['LGPL-2.1-or-later'] + +input: + - archive: + type: file + description: ZIP file + pattern: "*.zip" + +output: + - 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/main.nf b/modules/variantbam/main.nf new file mode 100644 index 00000000..11059a9a --- /dev/null +++ b/modules/variantbam/main.nf @@ -0,0 +1,33 @@ +def VERSION = '1.4.4a' // Version information not provided by tool on CLI + +process VARIANTBAM { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::variantbam=1.4.4a" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/variantbam:1.4.4a--h7d7f7ad_5' : + 'quay.io/biocontainers/variantbam:1.4.4a--h7d7f7ad_5' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.bam"), emit: bam + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + variant \\ + $bam \\ + -o ${prefix}.bam \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + variantbam: $VERSION + END_VERSIONS + """ +} diff --git a/modules/variantbam/meta.yml b/modules/variantbam/meta.yml new file mode 100644 index 00000000..ddcd0656 --- /dev/null +++ b/modules/variantbam/meta.yml @@ -0,0 +1,46 @@ +name: variantbam +description: Filtering, downsampling and profiling alignments in BAM/CRAM formats +keywords: + - filter + - bam + - subsample + - downsample + - downsample bam + - subsample bam +tools: + - variantbam: + description: Filtering and profiling of next-generational sequencing data using region-specific rules + homepage: https://github.com/walaj/VariantBam + documentation: https://github.com/walaj/VariantBam#table-of-contents + tool_dev_url: https://github.com/walaj/VariantBam + doi: 10.1093/bioinformatics/btw111 + licence: ['Apache-2.0'] + +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}" + +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: Filtered or downsampled BAM file + pattern: "*.{bam}" + +authors: + - "@bjohnnyd" diff --git a/modules/vcftools/functions.nf b/modules/vcftools/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/vcftools/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..fbe646ca 100644 --- a/modules/vcftools/main.nf +++ b/modules/vcftools/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process VCFTOOLS { 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::vcftools=0.1.16" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/vcftools:0.1.16--he513fc3_4" - } else { - container "quay.io/biocontainers/vcftools:0.1.16--he513fc3_4" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/vcftools:0.1.16--he513fc3_4' : + 'quay.io/biocontainers/vcftools:0.1.16--he513fc3_4' }" input: // Owing to the nature of vcftools we here provide solutions to working with optional bed files and optional @@ -24,93 +13,92 @@ 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("*.version.txt"), emit: version - - 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 software = getSoftwareName(task.process) - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - def args = options.args.tokenize() + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def args_list = args.tokenize() - def bed_arg = (options.args.contains('--bed')) ? "--bed ${bed}" : - (options.args.contains('--exclude-bed')) ? "--exclude-bed ${bed}" : - (options.args.contains('--hapcount')) ? "--hapcount ${bed}" : '' - args.removeIf { it.contains('--bed') } - args.removeIf { it.contains('--exclude-bed') } - args.removeIf { it.contains('--hapcount') } + def bed_arg = (args.contains('--bed')) ? "--bed ${bed}" : + (args.contains('--exclude-bed')) ? "--exclude-bed ${bed}" : + (args.contains('--hapcount')) ? "--hapcount ${bed}" : '' + args_list.removeIf { it.contains('--bed') } + args_list.removeIf { it.contains('--exclude-bed') } + args_list.removeIf { it.contains('--hapcount') } - def diff_variant_arg = (options.args.contains('--diff')) ? "--diff ${diff_variant_file}" : - (options.args.contains('--gzdiff')) ? "--gzdiff ${diff_variant_file}" : - (options.args.contains('--diff-bcf')) ? "--diff-bcf ${diff_variant_file}" : '' - args.removeIf { it.contains('--diff') } - args.removeIf { it.contains('--gzdiff') } - args.removeIf { it.contains('--diff-bcf') } + def diff_variant_arg = (args.contains('--diff')) ? "--diff ${diff_variant_file}" : + (args.contains('--gzdiff')) ? "--gzdiff ${diff_variant_file}" : + (args.contains('--diff-bcf')) ? "--diff-bcf ${diff_variant_file}" : '' + args_list.removeIf { it.contains('--diff') } + args_list.removeIf { it.contains('--gzdiff') } + args_list.removeIf { it.contains('--diff-bcf') } def input_file = ("$variant_file".endsWith(".vcf")) ? "--vcf ${variant_file}" : ("$variant_file".endsWith(".vcf.gz")) ? "--gzvcf ${variant_file}" : @@ -120,10 +108,13 @@ process VCFTOOLS { vcftools \\ $input_file \\ --out $prefix \\ - ${args.join(' ')} \\ + ${args_list.join(' ')} \\ $bed_arg \\ - $diff_variant_arg \\ + $diff_variant_arg - echo \$(vcftools --version 2>&1) | sed 's/^.*vcftools //; s/Using.*\$//' > ${software}.version.txt + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vcftools: \$(echo \$(vcftools --version 2>&1) | sed 's/^.*VCFtools (//;s/).*//') + END_VERSIONS """ } diff --git a/modules/vcftools/meta.yml b/modules/vcftools/meta.yml index 4da9b6c2..a8f864a9 100644 --- a/modules/vcftools/meta.yml +++ b/modules/vcftools/meta.yml @@ -33,10 +33,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - vcf: type: file description: vcf file (optional) diff --git a/modules/yara/index/functions.nf b/modules/yara/index/functions.nf deleted file mode 100644 index da9da093..00000000 --- a/modules/yara/index/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..77122c78 100644 --- a/modules/yara/index/main.nf +++ b/modules/yara/index/main.nf @@ -1,39 +1,35 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process YARA_INDEX { tag "$fasta" label 'process_medium' - publishDir "${params.outdir}", - mode: params.publish_dir_mode, - saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:'index', meta:[:], publish_by_meta:[]) } conda (params.enable_conda ? "bioconda::yara=1.0.2" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/yara:1.0.2--2" - } else { - container "quay.io/biocontainers/yara:1.0.2--2" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/yara:1.0.2--2' : + 'quay.io/biocontainers/yara:1.0.2--2' }" input: path fasta output: - path "yara", emit: index - path "*.version.txt" , emit: version + path "yara" , emit: index + path "versions.yml", emit: versions script: - def software = getSoftwareName(task.process) + def args = task.ext.args ?: '' """ mkdir yara - yara_indexer $fasta -o "yara" + + yara_indexer \\ + $fasta \\ + -o "yara" + 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 + "${task.process}": + yara: \$(echo \$(yara_indexer --version 2>&1) | sed 's/^.*yara_indexer version: //; s/ .*\$//') + END_VERSIONS """ } diff --git a/modules/yara/index/meta.yml b/modules/yara/index/meta.yml index f1e2ab93..651a67ee 100644 --- a/modules/yara/index/meta.yml +++ b/modules/yara/index/meta.yml @@ -21,10 +21,10 @@ input: description: Input genome fasta file output: - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + 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 deleted file mode 100644 index da9da093..00000000 --- a/modules/yara/mapper/functions.nf +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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() -} - -// -// 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) { - 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) - } - } - } - if (ioptions.publish_files instanceof Map) { - for (ext in ioptions.publish_files) { - if (args.filename.endsWith(ext.key)) { - def ext_list = path_list.collect() - ext_list.add(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..4539033d 100644 --- a/modules/yara/mapper/main.nf +++ b/modules/yara/mapper/main.nf @@ -1,22 +1,11 @@ -// Import generic module functions -include { initOptions; saveFiles; getSoftwareName } from './functions' - -params.options = [:] -options = initOptions(params.options) - process YARA_MAPPER { 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::yara=1.0.2 bioconda::samtools=1.12" : null) - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/mulled-v2-f13549097a0d1ca36f9d4f017636fb3609f6c083:f794a548b8692f29264c8984ff116c2141b90d9e-0" - } else { - container "quay.io/biocontainers/mulled-v2-f13549097a0d1ca36f9d4f017636fb3609f6c083:f794a548b8692f29264c8984ff116c2141b90d9e-0" - } + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-f13549097a0d1ca36f9d4f017636fb3609f6c083:f794a548b8692f29264c8984ff116c2141b90d9e-0' : + 'quay.io/biocontainers/mulled-v2-f13549097a0d1ca36f9d4f017636fb3609f6c083:f794a548b8692f29264c8984ff116c2141b90d9e-0' }" input: tuple val(meta), path(reads) @@ -24,25 +13,44 @@ process YARA_MAPPER { output: tuple val(meta), path("*.mapped.bam"), emit: bam - path "*.version.txt" , 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 = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + """ + yara_mapper \\ + $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 - - echo \$(yara_mapper --help 2>&1) > ${software}.version.txt - """ + cat <<-END_VERSIONS > versions.yml + "${task.process}": + yara: \$(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 - echo \$(yara_mapper --version 2>&1) | grep -e "yara_mapper version:" | sed 's/yara_mapper version: //g' > ${software}.version.txt - """ - } + """ + yara_mapper \\ + $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 + "${task.process}": + yara: \$(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/modules/yara/mapper/meta.yml b/modules/yara/mapper/meta.yml index 4a8e6494..d49823d2 100644 --- a/modules/yara/mapper/meta.yml +++ b/modules/yara/mapper/meta.yml @@ -34,10 +34,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - version: + - versions: type: file - description: File containing software version - pattern: "*.{version.txt}" + description: File containing software versions + pattern: "versions.yml" - bam: type: file description: Sorted BAM file 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/annotation_ensemblvep/main.nf b/subworkflows/nf-core/annotation_ensemblvep/main.nf new file mode 100644 index 00000000..3f3ecc6e --- /dev/null +++ b/subworkflows/nf-core/annotation_ensemblvep/main.nf @@ -0,0 +1,26 @@ +// +// Run VEP to annotate VCF files +// + +include { ENSEMBLVEP } from '../../../modules/ensemblvep/main' +include { TABIX_BGZIPTABIX as ANNOTATION_BGZIPTABIX } from '../../../modules/tabix/bgziptabix/main' + +workflow ANNOTATION_ENSEMBLVEP { + take: + vcf // channel: [ val(meta), vcf ] + vep_genome // value: which genome + vep_species // value: which species + vep_cache_version // value: which cache version + vep_cache // path: path_to_vep_cache (optionnal) + + main: + ENSEMBLVEP(vcf, vep_genome, vep_species, vep_cache_version, vep_cache) + ANNOTATION_BGZIPTABIX(ENSEMBLVEP.out.vcf) + + ch_versions = ENSEMBLVEP.out.versions.first().mix(ANNOTATION_BGZIPTABIX.out.versions.first()) + + emit: + vcf_tbi = ANNOTATION_BGZIPTABIX.out.gz_tbi // channel: [ val(meta), vcf.gz, vcf.gz.tbi ] + reports = ENSEMBLVEP.out.report // path: *.html + versions = ch_versions // path: versions.yml +} diff --git a/subworkflows/nf-core/annotation_ensemblvep/meta.yml b/subworkflows/nf-core/annotation_ensemblvep/meta.yml new file mode 100644 index 00000000..e7d92ce9 --- /dev/null +++ b/subworkflows/nf-core/annotation_ensemblvep/meta.yml @@ -0,0 +1,29 @@ +name: annotation_ensemblvep +description: | + Perform annotation with ensemblvep and bgzip + tabix index the resulting VCF file +keywords: + - ensemblvep +modules: + - ensemblvep + - tabix/bgziptabix +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - input: + type: vcf + description: list containing one vcf file + pattern: "[ *.{vcf,vcf.gz} ]" +output: + - versions: + type: file + description: File containing software versions + pattern: 'versions.yml' + - vcf_tbi: + type: file + description: Compressed vcf file + tabix index + pattern: "[ *{.vcf.gz,vcf.gz.tbi} ]" +authors: + - '@maxulysse' diff --git a/subworkflows/nf-core/annotation_snpeff/main.nf b/subworkflows/nf-core/annotation_snpeff/main.nf new file mode 100644 index 00000000..add5f9c8 --- /dev/null +++ b/subworkflows/nf-core/annotation_snpeff/main.nf @@ -0,0 +1,23 @@ +// +// Run SNPEFF to annotate VCF files +// + +include { SNPEFF } from '../../../modules/snpeff/main' +include { TABIX_BGZIPTABIX as ANNOTATION_BGZIPTABIX } from '../../../modules/tabix/bgziptabix/main' + +workflow ANNOTATION_SNPEFF { + take: + vcf // channel: [ val(meta), vcf ] + snpeff_db // value: version of db to use + snpeff_cache // path: path_to_snpeff_cache (optionnal) + + main: + SNPEFF(vcf, snpeff_db, snpeff_cache) + ANNOTATION_BGZIPTABIX(SNPEFF.out.vcf) + ch_versions = SNPEFF.out.versions.first().mix(ANNOTATION_BGZIPTABIX.out.versions.first()) + + emit: + vcf_tbi = ANNOTATION_BGZIPTABIX.out.gz_tbi // channel: [ val(meta), vcf.gz, vcf.gz.tbi ] + reports = SNPEFF.out.report // path: *.html + versions = ch_versions // path: versions.yml +} diff --git a/subworkflows/nf-core/annotation_snpeff/meta.yml b/subworkflows/nf-core/annotation_snpeff/meta.yml new file mode 100644 index 00000000..164a0ee2 --- /dev/null +++ b/subworkflows/nf-core/annotation_snpeff/meta.yml @@ -0,0 +1,29 @@ +name: annotation_snpeff +description: | + Perform annotation with snpeff and bgzip + tabix index the resulting VCF file +keywords: + - snpeff +modules: + - snpeff + - tabix/bgziptabix +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - input: + type: vcf + description: list containing one vcf file + pattern: "[ *.{vcf,vcf.gz} ]" +output: + - versions: + type: file + description: File containing software versions + pattern: 'versions.yml' + - vcf_tbi: + type: file + description: Compressed vcf file + tabix index + pattern: "[ *{.vcf.gz,vcf.gz.tbi} ]" +authors: + - '@maxulysse' 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..72128aad --- /dev/null +++ b/subworkflows/nf-core/bam_sort_samtools/nextflow.config @@ -0,0 +1,3 @@ +params.sort_options = [:] +params.index_options = [:] +params.stats_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..463ec99d --- /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/subworkflows/nf-core/fgbio_create_umi_consensus/main.nf b/subworkflows/nf-core/fgbio_create_umi_consensus/main.nf new file mode 100644 index 00000000..042d0bbd --- /dev/null +++ b/subworkflows/nf-core/fgbio_create_umi_consensus/main.nf @@ -0,0 +1,86 @@ +// +// Runs FGBIO tools to remove UMI tags from FASTQ reads +// Convert them to unmapped BAM file, map them to the reference genome, +// use the mapped information to group UMIs and generate consensus reads +// + + +include { BWAMEM2_INDEX } from '../../../modules/bwamem2/index/main.nf' +include { BWAMEM2_MEM } from '../../../modules/bwamem2/mem/main' +include { BWA_INDEX as BWAMEM1_INDEX } from '../../../modules/bwa/index/main.nf' +include { BWA_MEM as BWAMEM1_MEM } from '../../../modules/bwa/mem/main' +include { FGBIO_CALLMOLECULARCONSENSUSREADS as CALLUMICONSENSUS } from '../../../modules/fgbio/callmolecularconsensusreads/main.nf' +include { FGBIO_FASTQTOBAM as FASTQTOBAM } from '../../../modules/fgbio/fastqtobam/main' +include { FGBIO_GROUPREADSBYUMI as GROUPREADSBYUMI } from '../../../modules/fgbio/groupreadsbyumi/main' +include { SAMBLASTER } from '../../../modules/samblaster/main' +include { SAMTOOLS_BAM2FQ as BAM2FASTQ } from '../../../modules/samtools/bam2fq/main.nf' + + +workflow CREATE_UMI_CONSENSUS { + take: + reads // channel: [mandatory] [ val(meta), [ reads ] ] + fasta // channel: [mandatory] /path/to/reference/fasta + read_structure // string: [mandatory] "read_structure" + groupreadsbyumi_strategy // string: [mandatory] grouping strategy - default: "Adjacency" + aligner // string: [mandatory] "bwa-mem" or "bwa-mem2" + + main: + ch_versions = Channel.empty() + + // using information in val(read_structure) FASTQ reads are converted into + // a tagged unmapped BAM file (uBAM) + FASTQTOBAM ( reads, read_structure ) + ch_versions = ch_versions.mix(FASTQTOBAM.out.version) + + // in order to map uBAM using BWA MEM, we need to convert uBAM to FASTQ + // but keep the appropriate UMI tags in the FASTQ comment field and produce + // an interleaved FASQT file (hence, split = false) + split = false + BAM2FASTQ ( FASTQTOBAM.out.umibam, split ) + ch_versions = ch_versions.mix(BAM2FASTQ.out.versions) + + // the user can choose here to use either bwa-mem (default) or bwa-mem2 + aligned_bam = Channel.empty() + + if (aligner == "bwa-mem") { + // reference is indexed + BWAMEM1_INDEX ( fasta ) + ch_versions = ch_versions.mix(BWAMEM1_INDEX.out.versions) + + // appropriately tagged interleaved FASTQ reads are mapped to the reference + BWAMEM1_MEM ( BAM2FASTQ.out.reads, BWAMEM1_INDEX.out.index, false ) + ch_versions = ch_versions.mix(BWAMEM1_MEM.out.versions) + aligned_bam = BWAMEM1_MEM.out.bam + } else { + // reference is indexed + BWAMEM2_INDEX ( fasta ) + ch_versions = ch_versions.mix(BWAMEM2_INDEX.out.versions) + + // appropriately tagged interleaved FASTQ reads are mapped to the reference + BWAMEM2_MEM ( BAM2FASTQ.out.reads, BWAMEM2_INDEX.out.index, false ) + ch_versions = ch_versions.mix(BWAMEM2_MEM.out.versions) + aligned_bam = BWAMEM2_MEM.out.bam + } + + // samblaster is used in order to tag mates information in the BAM file + // this is used in order to group reads by UMI + SAMBLASTER ( aligned_bam ) + ch_versions = ch_versions.mix(SAMBLASTER.out.versions) + + // appropriately tagged reads are now grouped by UMI information + GROUPREADSBYUMI ( SAMBLASTER.out.bam, groupreadsbyumi_strategy ) + ch_versions = ch_versions.mix(GROUPREADSBYUMI.out.versions) + + // using the above created groups, a consensus across reads in the same grou + // can be called + // this will emit a consensus BAM file + CALLUMICONSENSUS ( GROUPREADSBYUMI.out.bam ) + ch_versions = ch_versions.mix(CALLUMICONSENSUS.out.versions) + + emit: + ubam = FASTQTOBAM.out.umibam // channel: [ val(meta), [ bam ] ] + groupbam = GROUPREADSBYUMI.out.bam // channel: [ val(meta), [ bam ] ] + consensusbam = CALLUMICONSENSUS.out.bam // channel: [ val(meta), [ bam ] ] + versions = ch_versions // channel: [ versions.yml ] +} + diff --git a/subworkflows/nf-core/fgbio_create_umi_consensus/meta.yml b/subworkflows/nf-core/fgbio_create_umi_consensus/meta.yml new file mode 100644 index 00000000..2cb61206 --- /dev/null +++ b/subworkflows/nf-core/fgbio_create_umi_consensus/meta.yml @@ -0,0 +1,67 @@ +name: fgbio_create_umi_consensus +description: | + This workflow uses the suite FGBIO to identify and remove UMI tags from FASTQ reads + convert them to unmapped BAM file, map them to the reference genome, + and finally use the mapped information to group UMIs and generate consensus reads in each group +keywords: + - fgbio + - umi + - samblaster + - samtools + - bwa +modules: + - bwa/index + - bwa/mem + - fgbio/fastqtobam + - fgbio/groupreadsbyumi + - fgbio/callmolecularconsensusreads + - samblaster + - samtools/bam2fq +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - reads: + type: list + description: list umi-tagged reads + pattern: "[ *.{fastq.gz/fq.gz} ]" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - read_structure: + type: string + description: | + A read structure should always be provided for each of the fastq files. + If single end, the string will contain only one structure (i.e. "2M11S+T"), if paired-end the string + will contain two structures separated by a blank space (i.e. "2M11S+T 2M11S+T"). + If the read does not contain any UMI, the structure will be +T (i.e. only template of any length). + https://github.com/fulcrumgenomics/fgbio/wiki/Read-Structures + - groupreadsbyumi_strategy: + type: string + description: | + Reguired argument: defines the UMI assignment strategy. + Must be chosen among: Identity, Edit, Adjacency, Paired. +output: + - versions: + type: file + description: File containing software versions + pattern: 'versions.yml' + - ubam: + type: file + description: unmapped bam file + pattern: '*.bam' + - groupbam: + type: file + description: mapped bam file, where reads are grouped by UMI tag + pattern: '*.bam' + - consensusbam: + type: file + description: | + mapped bam file, where reads are created as consensus of those + belonging to the same UMI group + pattern: '*.bam' +authors: + - '@lescai' diff --git a/subworkflows/nf-core/gatk_create_som_pon/main.nf b/subworkflows/nf-core/gatk_create_som_pon/main.nf new file mode 100644 index 00000000..89a9566e --- /dev/null +++ b/subworkflows/nf-core/gatk_create_som_pon/main.nf @@ -0,0 +1,57 @@ +// +// Run GATK mutect2, genomicsdbimport and createsomaticpanelofnormals +// +params.mutect2_options = [args: '--max-mnp-distance 0'] +params.gendbimport_options = [:] +params.createsompon_options = [:] + +include { GATK4_MUTECT2 } from '../../../modules/gatk4/mutect2/main' addParams( options: params.mutect2_options ) +include { GATK4_GENOMICSDBIMPORT } from '../../../modules/gatk4/genomicsdbimport/main' addParams( options: params.gendbimport_options ) +include { GATK4_CREATESOMATICPANELOFNORMALS } from '../../../modules/gatk4/createsomaticpanelofnormals/main' addParams( options: params.createsompon_options ) + +workflow GATK_CREATE_SOM_PON { + take: + ch_mutect2_in // channel: [ val(meta), [ input ], [ input_index ], [] ] + fasta // channel: /path/to/reference/fasta + fai // channel: /path/to/reference/fasta/index + dict // channel: /path/to/reference/fasta/dictionary + pon_name // channel: name for panel of normals + interval_file // channel: /path/to/interval/file + + main: + ch_versions = Channel.empty() + input = channel.from(ch_mutect2_in) + // + //Perform variant calling for each sample using mutect2 module in panel of normals mode. + // + GATK4_MUTECT2 ( input, false, true, false, [], fasta, fai, dict, [], [], [], [] ) + ch_versions = ch_versions.mix(GATK4_MUTECT2.out.versions.first()) + + // + //Convert all sample vcfs into a genomicsdb workspace using genomicsdbimport. + // + ch_vcf = GATK4_MUTECT2.out.vcf.collect{it[1]}.toList() + ch_index = GATK4_MUTECT2.out.tbi.collect{it[1]}.toList() + gendb_input = Channel.of([[ id:pon_name ]]).combine(ch_vcf).combine(ch_index).combine([interval_file]).combine(['']).combine([dict]) + GATK4_GENOMICSDBIMPORT ( gendb_input, false, false, false ) + ch_versions = ch_versions.mix(GATK4_GENOMICSDBIMPORT.out.versions.first()) + + // + //Panel of normals made from genomicsdb workspace using createsomaticpanelofnormals. + // + GATK4_GENOMICSDBIMPORT.out.genomicsdb.view() + GATK4_CREATESOMATICPANELOFNORMALS ( GATK4_GENOMICSDBIMPORT.out.genomicsdb, fasta, fai, dict ) + ch_versions = ch_versions.mix(GATK4_CREATESOMATICPANELOFNORMALS.out.versions.first()) + + emit: + mutect2_vcf = GATK4_MUTECT2.out.vcf.collect() // channel: [ val(meta), [ vcf ] ] + mutect2_index = GATK4_MUTECT2.out.tbi.collect() // channel: [ val(meta), [ tbi ] ] + mutect2_stats = GATK4_MUTECT2.out.stats.collect() // channel: [ val(meta), [ stats ] ] + + genomicsdb = GATK4_GENOMICSDBIMPORT.out.genomicsdb // channel: [ val(meta), [ genomicsdb ] ] + + pon_vcf = GATK4_CREATESOMATICPANELOFNORMALS.out.vcf // channel: [ val(meta), [ vcf.gz ] ] + pon_index = GATK4_CREATESOMATICPANELOFNORMALS.out.tbi // channel: [ val(meta), [ tbi ] ] + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/gatk_create_som_pon/meta.yml b/subworkflows/nf-core/gatk_create_som_pon/meta.yml new file mode 100644 index 00000000..07404aae --- /dev/null +++ b/subworkflows/nf-core/gatk_create_som_pon/meta.yml @@ -0,0 +1,75 @@ +name: gatk_create_som_pon +description: Perform variant calling on a set of normal samples using mutect2 panel of normals mode. Group them into a genomicsdbworkspace using genomicsdbimport, then use this to create a panel of normals using createsomaticpanelofnormals. +keywords: + - gatk4 + - mutect2 + - genomicsdbimport + - createsomaticpanelofnormals + - variant_calling + - genomicsdb_workspace + - panel_of_normals +modules: + - gatk4/mutect2 + - gatk4/genomicsdbimport + - gatk4/createsomaticpanelofnormals +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - input: + type: list + description: list of BAM files, also able to take CRAM as an input + pattern: "[ *.{bam/cram} ]" + - input_index: + type: list + description: list of BAM file indexes, also able to take CRAM indexes as an input + pattern: "[ *.{bam.bai/cram.crai} ]" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "*.fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" + - pon_name: + type: String + Description: name to be used for the genomicsdb workspace and panel of normals as meta_id has the individual sample names and a name for the combined files is reuired here. + pattern: "example_name" +output: + - versions: + type: file + description: File containing software versions + pattern: 'versions.yml' + - mutect2_vcf: + type: list + description: List of compressed vcf files to be used to make the gendb workspace + pattern: "[ *.vcf.gz ]" + - mutect2_index: + type: list + description: List of indexes of mutect2_vcf files + pattern: "[ *vcf.gz.tbi ]" + - mutect2_stats: + type: list + description: List of stats files that pair with mutect2_vcf files + pattern: "[ *vcf.gz.stats ]" + - genomicsdb: + type: directory + description: Directory containing the files that compose the genomicsdb workspace. + pattern: "path/name_of_workspace" + - pon_vcf: + type: file + description: Panel of normal as compressed vcf file + pattern: "*.vcf.gz" + - pon_index: + type: file + description: Index of pon_vcf file + pattern: "*vcf.gz.tbi" +authors: + - '@GCJMackenzie' diff --git a/subworkflows/nf-core/gatk_create_som_pon/nextflow.config b/subworkflows/nf-core/gatk_create_som_pon/nextflow.config new file mode 100644 index 00000000..6f560c9e --- /dev/null +++ b/subworkflows/nf-core/gatk_create_som_pon/nextflow.config @@ -0,0 +1,3 @@ +params.mutect2_options = [:] +params.gendbimport_options = [:] +params.createsompon_options = [:] diff --git a/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/main.nf b/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/main.nf new file mode 100644 index 00000000..25c63687 --- /dev/null +++ b/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/main.nf @@ -0,0 +1,109 @@ +// +// Run GATK mutect2 in tumor normal mode, getepileupsummaries, calculatecontamination, learnreadorientationmodel and filtermutectcalls +// + +params.mutect2_options = [:] +params.learnorientation_options = [:] +params.getpileup_tumor_options = [suffix: '_tumor'] +params.getpileup_normal_options = [suffix: '_normal'] +params.calccontam_options = [:] +params.filtercalls_options = [suffix: '_filtered'] + +include { GATK4_MUTECT2 as MUTECT2 } from '../../../modules/gatk4/mutect2/main' addParams( options: params.mutect2_options ) +include { GATK4_LEARNREADORIENTATIONMODEL as LEARNREADORIENTATIONMODEL } from '../../../modules/gatk4/learnreadorientationmodel/main' addParams( options: params.learnorientation_options ) +include { GATK4_GETPILEUPSUMMARIES as GETPILEUPSUMMARIES_TUMOR } from '../../../modules/gatk4/getpileupsummaries/main' addParams( options: params.getpileup_tumor_options ) +include { GATK4_GETPILEUPSUMMARIES as GETPILEUPSUMMARIES_NORMAL} from '../../../modules/gatk4/getpileupsummaries/main' addParams( options: params.getpileup_normal_options ) +include { GATK4_CALCULATECONTAMINATION as CALCULATECONTAMINATION } from '../../../modules/gatk4/calculatecontamination/main' addParams( options: params.calccontam_options ) +include { GATK4_FILTERMUTECTCALLS as FILTERMUTECTCALLS } from '../../../modules/gatk4/filtermutectcalls/main' addParams( options: params.filtercalls_options ) + +workflow GATK_TUMOR_NORMAL_SOMATIC_VARIANT_CALLING { + take: + input // channel: [ val(meta), [ input ], [ input_index ], [which_norm] ] + fasta // channel: /path/to/reference/fasta + fai // channel: /path/to/reference/fasta/index + dict // channel: /path/to/reference/fasta/dictionary + germline_resource // channel: /path/to/germline/resource + germline_resource_tbi // channel: /path/to/germline/index + panel_of_normals // channel: /path/to/panel/of/normals + panel_of_normals_tbi // channel: /path/to/panel/of/normals/index + interval_file // channel: /path/to/interval/file + + + main: + ch_versions = Channel.empty() + + // + //Perform variant calling using mutect2 module in tumor single mode. + // + mutect2_input = channel.from(input) + MUTECT2 ( mutect2_input, false, false, false, [], fasta, fai, dict, germline_resource, germline_resource_tbi, panel_of_normals, panel_of_normals_tbi ) + ch_versions = ch_versions.mix(MUTECT2.out.versions) + + // + //Generate artifactpriors using learnreadorientationmodel on the f1r2 output of mutect2. + // + ch_learnread_in = MUTECT2.out.f1r2.collect() + LEARNREADORIENTATIONMODEL (ch_learnread_in) + ch_versions = ch_versions.mix(LEARNREADORIENTATIONMODEL.out.versions) + + // + //Generate pileup summary tables using getepileupsummaries. tumor sample should always be passed in as the first input and input list entries of ch_mutect2_in, + //to ensure correct file order for calculatecontamination. + // + pileup_tumor_input = channel.from(input).map { + meta, input_file, input_index, which_norm -> + [meta, input_file[0], input_index[0]] + } + + pileup_normal_input = channel.from(input).map { + meta, input_file, input_index, which_norm -> + [meta, input_file[1], input_index[1]] + } + GETPILEUPSUMMARIES_TUMOR ( pileup_tumor_input, germline_resource, germline_resource_tbi, interval_file ) + GETPILEUPSUMMARIES_NORMAL ( pileup_normal_input, germline_resource, germline_resource_tbi, interval_file ) + ch_versions = ch_versions.mix(GETPILEUPSUMMARIES_NORMAL.out.versions) + + // + //Contamination and segmentation tables created using calculatecontamination on the pileup summary table. + // + ch_pileup_tumor = GETPILEUPSUMMARIES_TUMOR.out.table.collect() + ch_pileup_normal = GETPILEUPSUMMARIES_NORMAL.out.table.collect() + ch_calccon_in = ch_pileup_tumor.combine(ch_pileup_normal, by: 0) + CALCULATECONTAMINATION ( ch_calccon_in, true ) + ch_versions = ch_versions.mix(CALCULATECONTAMINATION.out.versions) + + // + //Mutect2 calls filtered by filtermutectcalls using the artifactpriors, contamination and segmentation tables. + // + ch_vcf = MUTECT2.out.vcf.collect() + ch_tbi = MUTECT2.out.tbi.collect() + ch_stats = MUTECT2.out.stats.collect() + ch_orientation = LEARNREADORIENTATIONMODEL.out.artifactprior.collect() + ch_segment = CALCULATECONTAMINATION.out.segmentation.collect() + ch_contamination = CALCULATECONTAMINATION.out.contamination.collect() + //[] is used as a placeholder for optional input to specify the contamination estimate as a value, since the contamination table is used, this is not needed. + ch_contamination.add([]) + ch_filtermutect_in = ch_vcf.combine(ch_tbi, by: 0).combine(ch_stats, by: 0).combine(ch_orientation, by: 0).combine(ch_segment, by: 0).combine(ch_contamination, by: 0) + FILTERMUTECTCALLS ( ch_filtermutect_in, fasta, fai, dict ) + ch_versions = ch_versions.mix(FILTERMUTECTCALLS.out.versions) + + emit: + mutect2_vcf = MUTECT2.out.vcf.collect() // channel: [ val(meta), [ vcf ] ] + mutect2_tbi = MUTECT2.out.tbi.collect() // channel: [ val(meta), [ tbi ] ] + mutect2_stats = MUTECT2.out.stats.collect() // channel: [ val(meta), [ stats ] ] + mutect2_f1r2 = MUTECT2.out.f1r2.collect() // channel: [ val(meta), [ f1r2 ] ] + + artifact_priors = LEARNREADORIENTATIONMODEL.out.artifactprior.collect() // channel: [ val(meta), [ artifactprior ] ] + + pileup_table_tumor = GETPILEUPSUMMARIES_TUMOR.out.table.collect() // channel: [ val(meta), [ table_tumor ] ] + pileup_table_normal = GETPILEUPSUMMARIES_NORMAL.out.table.collect() // channel: [ val(meta), [ table_normal ] ] + + contamination_table = CALCULATECONTAMINATION.out.contamination.collect() // channel: [ val(meta), [ contamination ] ] + segmentation_table = CALCULATECONTAMINATION.out.segmentation.collect() // channel: [ val(meta), [ segmentation ] ] + + filtered_vcf = FILTERMUTECTCALLS.out.vcf.collect() // channel: [ val(meta), [ vcf ] ] + filtered_tbi = FILTERMUTECTCALLS.out.tbi.collect() // channel: [ val(meta), [ tbi ] ] + filtered_stats = FILTERMUTECTCALLS.out.stats.collect() // channel: [ val(meta), [ stats ] ] + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/meta.yml b/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/meta.yml new file mode 100644 index 00000000..4c42addf --- /dev/null +++ b/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/meta.yml @@ -0,0 +1,127 @@ +name: gatk_tumor_normal_somatic_variant_calling +description: | + Perform variant calling on a paired tumor normal set of samples using mutect2 tumor normal mode. + f1r2 output of mutect2 is run through learnreadorientationmodel to get the artifact priors. + Run the input bam files through getpileupsummarries and then calculatecontamination to get the contamination and segmentation tables. + Filter the mutect2 output vcf using filtermutectcalls, artifact priors and the contamination & segmentation tables for additional filtering. +keywords: + - gatk4 + - mutect2 + - learnreadorientationmodel + - getpileupsummaries + - calculatecontamination + - filtermutectcalls + - variant_calling + - tumor_only + - filtered_vcf +modules: + - gatk4/mutect2 + - gatk4/learnreadorientationmodel + - gatk4/getpileupsummaries + - gatk4/calculatecontamination + - gatk4/filtermutectcalls +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - input: + type: list + description: list containing the tumor and normal BAM files, in that order, also able to take CRAM as an input + pattern: "[ *.{bam/cram} ]" + - input_index: + type: list + description: list containing the tumor and normal BAM file indexes, in that order, also able to take CRAM index as an input + pattern: "[ *.{bam.bai/cram.crai} ]" + - which_norm: + type: list + description: optional list of sample headers contained in the normal sample input file. + pattern: "testN" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "*.fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" + - germline_resource: + type: file + description: Population vcf of germline sequencing, containing allele fractions. + pattern: "*.vcf.gz" + - germline_resource_tbi: + type: file + description: Index file for the germline resource. + pattern: "*.vcf.gz.tbi" + - panel_of_normals: + type: file + description: vcf file to be used as a panel of normals. + pattern: "*.vcf.gz" + - panel_of_normals_tbi: + type: file + description: Index for the panel of normals. + pattern: "*.vcf.gz.tbi" + - interval_file: + type: file + description: File containing intervals. + pattern: "*.interval_list" +output: + - versions: + type: file + description: File containing software versions + pattern: 'versions.yml' + - mutect2_vcf: + type: file + description: Compressed vcf file to be used for variant_calling. + pattern: "[ *.vcf.gz ]" + - mutect2_tbi: + type: file + description: Indexes of the mutect2_vcf file + pattern: "[ *vcf.gz.tbi ]" + - mutect2_stats: + type: file + description: Stats files for the mutect2 vcf + pattern: "[ *vcf.gz.stats ]" + - mutect2_f1r2: + type: file + description: file containing information to be passed to LearnReadOrientationModel. + pattern: "*.f1r2.tar.gz" + - artifact_priors: + type: file + description: file containing artifact-priors to be used by filtermutectcalls. + pattern: "*.tar.gz" + - pileup_table_tumor: + type: file + description: File containing the tumor pileup summary table, kept separate as calculatecontamination needs them individually specified. + pattern: "*_tumor.pileups.table" + - pileup_table_normal: + type: file + description: File containing the normal pileup summary table, kept separate as calculatecontamination needs them individually specified. + pattern: "*_normal.pileups.table" + - contamination_table: + type: file + description: File containing the contamination table. + pattern: "*.contamination.table" + - segmentation_table: + type: file + description: Output table containing segmentation of tumor minor allele fractions. + pattern: "*.segmentation.table" + - filtered_vcf: + type: file + description: file containing filtered mutect2 calls. + pattern: "*.vcf.gz" + - filtered_tbi: + type: file + description: tbi file that pairs with filtered vcf. + pattern: "*.vcf.gz.tbi" + - filtered_stats: + type: file + description: file containing statistics of the filtermutectcalls run. + pattern: "*.filteringStats.tsv" +authors: + - '@GCJMackenzie' diff --git a/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/nextflow.config b/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/nextflow.config new file mode 100644 index 00000000..bb8d1bc4 --- /dev/null +++ b/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/nextflow.config @@ -0,0 +1,6 @@ +params.mutect2_options = [:] +params.learnorientation_options = [:] +params.getpileup_tumor_options = [:] +params.getpileup_normal_options = [:] +params.calccontam_options = [:] +params.filtercalls_options = [:] diff --git a/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/main.nf b/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/main.nf new file mode 100644 index 00000000..20d8a176 --- /dev/null +++ b/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/main.nf @@ -0,0 +1,88 @@ +// +// Run GATK mutect2 in tumor only mode, getepileupsummaries, calculatecontamination and filtermutectcalls +// + +params.mutect2_options = [:] +params.getpileup_options = [:] +params.calccontam_options = [:] +params.filtercalls_options = [suffix: '_filtered'] + +include { GATK4_MUTECT2 as MUTECT2 } from '../../../modules/gatk4/mutect2/main' addParams( options: params.mutect2_options ) +include { GATK4_GETPILEUPSUMMARIES as GETPILEUPSUMMARIES } from '../../../modules/gatk4/getpileupsummaries/main' addParams( options: params.getpileup_options ) +include { GATK4_CALCULATECONTAMINATION as CALCULATECONTAMINATION } from '../../../modules/gatk4/calculatecontamination/main' addParams( options: params.calccontam_options ) +include { GATK4_FILTERMUTECTCALLS as FILTERMUTECTCALLS } from '../../../modules/gatk4/filtermutectcalls/main' addParams( options: params.filtercalls_options ) + +workflow GATK_TUMOR_ONLY_SOMATIC_VARIANT_CALLING { + take: + input // channel: [ val(meta), [ input ], [ input_index ], [] ] + fasta // channel: /path/to/reference/fasta + fai // channel: /path/to/reference/fasta/index + dict // channel: /path/to/reference/fasta/dictionary + germline_resource // channel: /path/to/germline/resource + germline_resource_tbi // channel: /path/to/germline/index + panel_of_normals // channel: /path/to/panel/of/normals + panel_of_normals_tbi // channel: /path/to/panel/of/normals/index + interval_file // channel: /path/to/interval/file + + + main: + ch_versions = Channel.empty() + mutect2_input = channel.from(input) + + // + //Perform variant calling using mutect2 module in tumor single mode. + // + MUTECT2 ( mutect2_input , true , false , false , [] , fasta , fai , dict , germline_resource , germline_resource_tbi , panel_of_normals , panel_of_normals_tbi ) + ch_versions = ch_versions.mix(MUTECT2.out.versions) + + // + //Generate pileup summary table using getepileupsummaries. + // + pileup_input = channel.from(input).map { + meta, input_file, input_index, which_norm -> + [meta, input_file[0], input_index[0]] + } + GETPILEUPSUMMARIES ( pileup_input , germline_resource , germline_resource_tbi , interval_file ) + ch_versions = ch_versions.mix(GETPILEUPSUMMARIES.out.versions) + + // + //Contamination and segmentation tables created using calculatecontamination on the pileup summary table. + // + ch_pileup = GETPILEUPSUMMARIES.out.table.collect() + //[] is a placeholder for the optional input where the matched normal sample would be passed in for tumor-normal samples, which is not necessary for this workflow. + ch_pileup.add([]) + CALCULATECONTAMINATION ( ch_pileup, true ) + ch_versions = ch_versions.mix(CALCULATECONTAMINATION.out.versions) + + // + //Mutect2 calls filtered by filtermutectcalls using the contamination and segmentation tables. + // + ch_vcf = MUTECT2.out.vcf.collect() + ch_tbi = MUTECT2.out.tbi.collect() + ch_stats = MUTECT2.out.stats.collect() + //[] is added as a placeholder for the optional input file artifact priors, which is only used for tumor-normal samples and therefor isn't needed in this workflow. + ch_stats.add([]) + ch_segment = CALCULATECONTAMINATION.out.segmentation.collect() + ch_contamination = CALCULATECONTAMINATION.out.contamination.collect() + //[] is added as a placeholder for entering a contamination estimate value, which is not needed as this workflow uses the contamination table instead. + ch_contamination.add([]) + ch_filtermutect_in = ch_vcf.combine(ch_tbi, by: 0).combine(ch_stats, by: 0).combine(ch_segment, by: 0).combine(ch_contamination, by: 0) + FILTERMUTECTCALLS ( ch_filtermutect_in, fasta, fai, dict ) + ch_versions = ch_versions.mix(FILTERMUTECTCALLS.out.versions) + + emit: + mutect2_vcf = MUTECT2.out.vcf.collect() // channel: [ val(meta), [ vcf ] ] + mutect2_index = MUTECT2.out.tbi.collect() // channel: [ val(meta), [ tbi ] ] + mutect2_stats = MUTECT2.out.stats.collect() // channel: [ val(meta), [ stats ] ] + + pileup_table = GETPILEUPSUMMARIES.out.table.collect() // channel: [ val(meta), [ table ] ] + + contamination_table = CALCULATECONTAMINATION.out.contamination.collect() // channel: [ val(meta), [ contamination ] ] + segmentation_table = CALCULATECONTAMINATION.out.segmentation.collect() // channel: [ val(meta), [ segmentation ] ] + + filtered_vcf = FILTERMUTECTCALLS.out.vcf.collect() // channel: [ val(meta), [ vcf ] ] + filtered_index = FILTERMUTECTCALLS.out.tbi.collect() // channel: [ val(meta), [ tbi ] ] + filtered_stats = FILTERMUTECTCALLS.out.stats.collect() // channel: [ val(meta), [ stats ] ] + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/meta.yml b/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/meta.yml new file mode 100644 index 00000000..14329691 --- /dev/null +++ b/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/meta.yml @@ -0,0 +1,108 @@ +name: gatk_tumor_only_somatic_variant_calling +description: | + Perform variant calling on a single tumor sample using mutect2 tumor only mode. + Run the input bam file through getpileupsummarries and then calculatecontaminationto get the contamination and segmentation tables. + Filter the mutect2 output vcf using filtermutectcalls and the contamination & segmentation tables for additional filtering. +keywords: + - gatk4 + - mutect2 + - getpileupsummaries + - calculatecontamination + - filtermutectcalls + - variant_calling + - tumor_only + - filtered_vcf +modules: + - gatk4/mutect2 + - gatk4/getpileupsummaries + - gatk4/calculatecontamination + - gatk4/filtermutectcalls +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - input: + type: list + description: list containing one BAM file, also able to take CRAM as an input + pattern: "[ *.{bam/cram} ]" + - input_index: + type: list + description: list containing one BAM file indexe, also able to take CRAM index as an input + pattern: "[ *.{bam.bai/cram.crai} ]" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" + - fai: + type: file + description: Index of reference fasta file + pattern: "*.fasta.fai" + - dict: + type: file + description: GATK sequence dictionary + pattern: "*.dict" + - germline_resource: + type: file + description: Population vcf of germline sequencing, containing allele fractions. + pattern: "*.vcf.gz" + - germline_resource_tbi: + type: file + description: Index file for the germline resource. + pattern: "*.vcf.gz.tbi" + - panel_of_normals: + type: file + description: vcf file to be used as a panel of normals. + pattern: "*.vcf.gz" + - panel_of_normals_tbi: + type: file + description: Index for the panel of normals. + pattern: "*.vcf.gz.tbi" + - interval_file: + type: file + description: File containing intervals. + pattern: "*.interval_list" +output: + - versions: + type: file + description: File containing software versions + pattern: 'versions.yml' + - mutect2_vcf: + type: file + description: Compressed vcf file to be used for variant_calling. + pattern: "[ *.vcf.gz ]" + - mutect2_tbi: + type: file + description: Indexes of the mutect2_vcf file + pattern: "[ *vcf.gz.tbi ]" + - mutect2_stats: + type: file + description: Stats files for the mutect2 vcf + pattern: "[ *vcf.gz.stats ]" + - pileup_table: + type: file + description: File containing the pileup summary table. + pattern: "*.pileups.table" + - contamination_table: + type: file + description: File containing the contamination table. + pattern: "*.contamination.table" + - segmentation_table: + type: file + description: Output table containing segmentation of tumor minor allele fractions. + pattern: "*.segmentation.table" + - filtered_vcf: + type: file + description: file containing filtered mutect2 calls. + pattern: "*.vcf.gz" + - filtered_tbi: + type: file + description: tbi file that pairs with filtered vcf. + pattern: "*.vcf.gz.tbi" + - filtered_stats: + type: file + description: file containing statistics of the filtermutectcalls run. + pattern: "*.filteringStats.tsv" +authors: + - '@GCJMackenzie' diff --git a/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/nextflow.config b/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/nextflow.config new file mode 100644 index 00000000..af50c2b0 --- /dev/null +++ b/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/nextflow.config @@ -0,0 +1,4 @@ +params.mutect2_options = [:] +params.getpileup_options = [:] +params.calccontam_options = [:] +params.filtercalls_options = [:] 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/nextflow.config b/tests/config/nextflow.config index cd22dde8..741edf5e 100644 --- a/tests/config/nextflow.config +++ b/tests/config/nextflow.config @@ -6,9 +6,9 @@ params { } process { - cpus = 2 - memory = 3.GB - time = 2.h + cpus = 2 + memory = 3.GB + time = 2.h } if ("$PROFILE" == "singularity") { @@ -28,5 +28,5 @@ conda { createTimeout = "120 min" } includeConfig 'test_data.config' manifest { - nextflowVersion = '!>=21.04.0' + nextflowVersion = '!>=21.10.3' } diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml deleted file mode 100644 index 7687eaf3..00000000 --- a/tests/config/pytest_modules.yml +++ /dev/null @@ -1,828 +0,0 @@ -abacas: - - modules/abacas/** - - tests/modules/abacas/** - -adapterremoval: - - modules/adapterremoval/** - - tests/modules/adapterremoval/** - -allelecounter: - - modules/allelecounter/** - - tests/modules/allelecounter/** - -artic/guppyplex: - - modules/artic/guppyplex/** - - tests/modules/artic/guppyplex/** - -artic/minion: - - modules/artic/minion/** - - tests/modules/artic/minion/** - -bandage/image: - - modules/bandage/image/** - - tests/modules/bandage/image/** - -bbmap/bbduk: - - modules/bbmap/bbduk/** - - tests/modules/bbmap/bbduk/** - -bcftools/consensus: - - modules/bcftools/consensus/** - - tests/modules/bcftools/consensus/** - -bcftools/filter: - - modules/bcftools/filter/** - - tests/modules/bcftools/filter/** - -bcftools/isec: - - modules/bcftools/isec/** - - tests/modules/bcftools/isec/** - -bcftools/merge: - - modules/bcftools/merge/** - - tests/modules/bcftools/merge/** - -bcftools/mpileup: - - modules/bcftools/mpileup/** - - tests/modules/bcftools/mpileup/** - -bcftools/stats: - - modules/bcftools/stats/** - - tests/modules/bcftools/stats/** - -bedtools/bamtobed: - - modules/bedtools/bamtobed/** - - tests/modules/bedtools/bamtobed/** - -bedtools/complement: - - modules/bedtools/complement/** - - tests/modules/bedtools/complement/** - -bedtools/genomecov: - - modules/bedtools/genomecov/** - - tests/modules/bedtools/genomecov/** - -bedtools/getfasta: - - modules/bedtools/getfasta/** - - tests/modules/bedtools/getfasta/** - -bedtools/intersect: - - modules/bedtools/intersect/** - - tests/modules/bedtools/intersect/** - -bedtools/maskfasta: - - modules/bedtools/maskfasta/** - - tests/modules/bedtools/maskfasta/** - -bedtools/merge: - - modules/bedtools/merge/** - - tests/modules/bedtools/merge/** - -bedtools/slop: - - modules/bedtools/slop/** - - tests/modules/bedtools/slop/** - -bedtools/sort: - - modules/bedtools/sort/** - - tests/modules/bedtools/sort/** - -bedtools/subtract: - - modules/bedtools/subtract/** - - tests/modules/bedtools/subtract/** - -bismark/align: - - modules/bismark/align/** - - modules/bismark/genomepreparation/** - - tests/modules/bismark/align/** - -bismark/deduplicate: - - modules/bismark/deduplicate/** - - tests/modules/bismark/deduplicate/** - -bismark/genomepreparation: - - modules/bismark/genomepreparation/** - - tests/modules/bismark/genomepreparation/** - -bismark/methylationextractor: - - modules/bismark/methylationextractor/** - - modules/bismark/genomepreparation/** - - tests/modules/bismark/methylationextractor/** - -bismark/report: - - modules/bismark/genomepreparation/** - - modules/bismark/align/** - - modules/bismark/deduplicate/** - - modules/bismark/methylationextractor/** - - modules/bismark/report/** - - tests/modules/bismark/report/** - -bismark/summary: - - modules/bismark/genomepreparation/** - - modules/bismark/align/** - - modules/bismark/deduplicate/** - - modules/bismark/methylationextractor/** - - modules/bismark/summary/** - - tests/modules/bismark/summary/** - -blast/blastn: - - modules/blast/blastn/** - - tests/modules/blast/blastn/** - -blast/makeblastdb: - - modules/blast/makeblastdb/** - - tests/modules/blast/makeblastdb/** - -bowtie/align: - - modules/bowtie/align/** - - modules/bowtie/build/** - - tests/modules/bowtie/align/** - -bowtie/build: - - modules/bowtie/build/** - - tests/modules/bowtie/build_test/** - -bowtie2/align: - - modules/bowtie2/align/** - - modules/bowtie2/build/** - - tests/modules/bowtie2/align/** - -bowtie2/build: - - modules/bowtie2/build/** - - tests/modules/bowtie2/build_test/** - -bwa/index: - - modules/bwa/index/** - - tests/modules/bwa/index/** - -bwa/mem: - - modules/bwa/mem/** - - tests/modules/bwa/mem/** - -bwamem2/index: - - modules/bwamem2/index/** - - tests/modules/bwamem2/index/** - -bwamem2/mem: - - modules/bwamem2/mem/** - - tests/modules/bwamem2/mem/** - -bwameth/align: - - modules/bwameth/align/** - - tests/modules/bwameth/align/** - -bwameth/index: - - modules/bwameth/index/** - - tests/modules/bwameth/index/** - -cat/fastq: - - modules/cat/fastq/** - - tests/modules/cat/fastq/** - -cnvkit: - - modules/cnvkit/** - - tests/modules/cnvkit/** - -cooler/digest: - - modules/cooler/digest/** - - tests/modules/cooler/digest/** - -cooler/dump: - - modules/cooler/dump/** - - tests/modules/cooler/dump/** - -cutadapt: - - modules/cutadapt/** - - tests/modules/cutadapt/** - -damageprofiler: - - modules/damageprofiler/** - - tests/modules/damageprofiler/** - -deeptools/computematrix: - - modules/deeptools/computematrix/** - - tests/modules/deeptools/computematrix/** - -deeptools/plotfingerprint: - - modules/deeptools/plotfingerprint/** - - tests/modules/deeptools/plotfingerprint/** - -deeptools/plotheatmap: - - modules/deeptools/plotheatmap/** - - tests/modules/deeptools/plotheatmap/** - -deeptools/plotprofile: - - modules/deeptools/plotprofile/** - - tests/modules/deeptools/plotprofile/** - -delly/call: - - modules/delly/call/** - - tests/modules/delly/call/** - -dshbio/filterbed: - - modules/dshbio/filterbed/** - - tests/modules/dshbio/filterbed/** - -dshbio/filtergff3: - - modules/dshbio/filtergff3/** - - tests/modules/dshbio/filtergff3/** - -dshbio/splitbed: - - modules/dshbio/splitbed/** - - tests/modules/dshbio/splitbed/** - -dshbio/splitgff3: - - modules/dshbio/splitgff3/** - - tests/modules/dshbio/splitgff3/** - -ensemblvep: - - modules/ensemblvep/** - - tests/modules/ensemblvep/** - -fastp: - - modules/fastp/** - - tests/modules/fastp/** - -fastqc: - - modules/fastqc/** - - tests/modules/fastqc/** - -fasttree: - - modules/fasttree/** - - tests/modules/fasttree/** - -fgbio/callmolecularconsensusreads: - - modules/fgbio/callmolecularconsensusreads/** - - tests/modules/fgbio/callmolecularconsensusreads/** - -fgbio/sortbam: - - modules/fgbio/sortbam/** - - tests/modules/fgbio/sortbam/** - -flash: - - modules/flash/** - - tests/modules/flash/** - -gatk4/applybqsr: - - modules/gatk4/applybqsr/** - - tests/modules/gatk4/applybqsr/** - -gatk4/baserecalibrator: - - modules/gatk4/baserecalibrator/** - - tests/modules/gatk4/baserecalibrator/** - -gatk4/bedtointervallist: - - modules/gatk4/bedtointervallist/** - - tests/modules/gatk4/bedtointervallist/** - -gatk4/createsequencedictionary: - - modules/gatk4/createsequencedictionary/** - - tests/modules/gatk4/createsequencedictionary/** - -gatk4/fastqtosam: - - modules/gatk4/fastqtosam/** - - tests/modules/gatk4/fastqtosam/** - -gatk4/haplotypecaller: - - modules/gatk4/haplotypecaller/** - - tests/modules/gatk4/haplotypecaller/** - -gatk4/intervallisttools: - - modules/gatk4/intervallisttools/** - - tests/modules/gatk4/intervallisttools/** - -gatk4/markduplicates: - - modules/gatk4/markduplicates/** - - tests/modules/gatk4/markduplicates/** - -gatk4/mergebamalignment: - - modules/gatk4/mergebamalignment/** - - tests/modules/gatk4/mergebamalignment/** - -gatk4/mergevcfs: - - modules/gatk4/mergevcfs/** - - tests/modules/gatk4/mergevcfs/** - -gatk4/revertsam: - - modules/gatk4/revertsam/** - - tests/modules/gatk4/revertsam/** - -gatk4/samtofastq: - - modules/gatk4/samtofastq/** - - tests/modules/gatk4/samtofastq/** - -gatk4/splitncigarreads: - - modules/gatk4/splitncigarreads/** - - tests/modules/gatk4/splitncigarreads/** - -gatk4/variantfiltration: - - modules/gatk4/variantfiltration/** - - tests/modules/gatk4/variantfiltration/** - -genmap/index: - - modules/genmap/index/** - - tests/modules/genmap/index/** - -genmap/mappability: - - modules/genmap/mappability/** - - tests/modules/genmap/mappability/** - -gffread: - - modules/gffread/** - - tests/modules/gffread/** - -graphmap2/align: - - modules/graphmap2/align/** - - tests/modules/graphmap2/align/** - -graphmap2/index: - - modules/graphmap2/index/** - - tests/modules/graphmap2/index/** - -gubbins: - - modules/gubbins/** - - tests/modules/gubbins/** - -gunzip: - - modules/gunzip/** - - tests/modules/gunzip/** - -hisat2/align: - - modules/hisat2/align/** - - modules/hisat2/build/** - - modules/hisat2/extractsplicesites/** - - tests/modules/hisat2/align/** - -hisat2/build: - - modules/hisat2/build/** - - modules/hisat2/extractsplicesites/** - - tests/modules/hisat2/build_test/** - -hisat2/extractsplicesites: - - modules/hisat2/extractsplicesites/** - - tests/modules/hisat2/extractsplicesites/** - -hmmer/hmmalign: - - modules/hmmer/hmmalign/** - - tests/modules/hmmer/hmmalign/** - -homer/annotatepeaks: - - modules/homer/annotatepeaks/** - - tests/modules/homer/annotatepeaks/** - -iqtree: - - modules/iqtree/** - - tests/modules/iqtree/** - -ivar/consensus: - - modules/ivar/consensus/** - - tests/modules/ivar/consensus/** - -ivar/trim: - - modules/ivar/trim/** - - tests/modules/ivar/trim/** - -ivar/variants: - - modules/ivar/variants/** - - tests/modules/ivar/variants/** - -kallisto/index: - - modules/kallisto/index/** - - tests/modules/kallisto/index/** - -kallistobustools/count: - - modules/kallistobustools/count/** - - tests/modules/kallistobustools/count/** - -kallistobustools/ref: - - modules/kallistobustools/ref/** - - tests/modules/kallistobustools/ref/** - -kraken2/kraken2: - - modules/kraken2/kraken2/** - - modules/untar/** - - tests/modules/kraken2/kraken2/** - -last/dotplot: - - modules/last/dotplot/** - - tests/modules/last/dotplot/** - -last/lastal: - - modules/last/lastal/** - - tests/modules/last/lastal/** - -last/lastdb: - - modules/last/lastdb/** - - tests/modules/last/lastdb/** - -last/mafconvert: - - modules/last/mafconvert/** - - tests/modules/last/mafconvert/** - -last/mafswap: - - modules/last/mafswap/** - - tests/modules/last/mafswap/** - -last/postmask: - - modules/last/postmask/** - - tests/modules/last/postmask/** - -last/split: - - modules/last/split/** - - tests/modules/last/split/** - -last/train: - - modules/last/train/** - - tests/modules/last/train/** - -lofreq/call: - - modules/lofreq/call/** - - tests/modules/lofreq/call/** - -lofreq/callparallel: - - modules/lofreq/callparallel/** - - tests/modules/lofreq/callparallel/** - -lofreq/filter: - - modules/lofreq/filter/** - - tests/modules/lofreq/filter/** - -lofreq/indelqual: - - modules/lofreq/indelqual/** - - tests/modules/lofreq/indelqual/** - -mash/sketch: - - modules/mash/sketch/** - - tests/modules/mash/sketch/** - -maxquant/lfq: - - modules/maxquant/lfq/** - - tests/modules/maxquant/lfq/** - -maxquant/protemics: - - modules/maxquant/protemics/** - - tests/modules/maxquant/protemics/** - -metaphlan3: - - modules/metaphlan3/** - - tests/modules/metaphlan3/** - -methyldackel/extract: - - modules/methyldackel/extract/** - - tests/modules/methyldackel/extract/** - -methyldackel/mbias: - - modules/methyldackel/mbias/** - - tests/modules/methyldackel/mbias/** - -minia: - - modules/minia/** - - tests/modules/minia/** - -minimap2/align: - - modules/minimap2/align/** - - tests/modules/minimap2/align/** - -minimap2/index: - - modules/minimap2/index/** - - tests/modules/minimap2/index/** - -mosdepth: - - modules/mosdepth/** - - tests/modules/mosdepth/** - -msisensor/msi: - - modules/msisensor/msi/** - - tests/modules/msisensor/msi/** - -msisensor/scan: - - modules/msisensor/scan/** - - tests/modules/msisensor/scan/** - -multiqc: - - modules/fastqc/** - - modules/multiqc/** - - tests/modules/multiqc/** - -muscle: - - modules/muscle/** - - tests/modules/muscle/** - -nanolyse: - - modules/nanolyse/** - - tests/modules/nanolyse/** - -nanoplot: - - modules/nanoplot/** - - tests/modules/nanoplot/** - -nextclade: - - modules/nextclade/** - - tests/modules/nextclade/** - -optitype: - - modules/optitype/** - - tests/modules/optitype/** - -pairix: - - modules/pairix/** - - tests/modules/pairix/** - -pairtools/dedup: - - modules/pairtools/dedup/** - - tests/modules/pairtools/dedup/** - -pairtools/flip: - - modules/pairtools/flip/** - - tests/modules/pairtools/flip/** - -pairtools/parse: - - modules/pairtools/parse/** - - tests/modules/pairtools/parse/** - -pairtools/restrict: - - modules/pairtools/restrict/** - - tests/modules/pairtools/restrict/** - -pairtools/select: - - modules/pairtools/select/** - - tests/modules/pairtools/select/** - -pairtools/sort: - - modules/pairtools/sort/** - - tests/modules/pairtools/sort/** - -pangolin: - - modules/pangolin/** - - tests/modules/pangolin/** - -picard/collectmultiplemetrics: - - modules/picard/collectmultiplemetrics/** - - tests/modules/picard/collectmultiplemetrics/** - -picard/collectwgsmetrics: - - modules/picard/collectwgsmetrics/** - - tests/modules/picard/collectwgsmetrics/** - -picard/markduplicates: - - modules/picard/markduplicates/** - - tests/modules/picard/markduplicates/** - -picard/mergesamfiles: - - modules/picard/mergesamfiles/** - - tests/modules/picard/mergesamfiles/** - -plasmidid: - - modules/plasmidid/** - - tests/modules/plasmidid/** - -preseq/lcextrap: - - modules/preseq/lcextrap/** - - tests/modules/preseq/lcextrap/** - -prodigal: - - modules/prodigal/** - - tests/modules/prodigal/** - -prokka: - - modules/prokka/** - - tests/modules/prokka/** - -pycoqc: - - modules/pycoqc/** - - tests/modules/pycoqc/** - -qcat: - - modules/qcat/** - - tests/modules/qcat/** - -qualimap/bamqc: - - modules/qualimap/bamqc/** - - tests/modules/qualimap/bamqc/** - -quast: - - modules/quast/** - - tests/modules/quast/** - -rapidnj: - - modules/rapidnj/** - - tests/modules/rapidnj/** - -rasusa: - - modules/rasusa/** - - tests/modules/rasusa/** - -raxmlng: - - modules/raxmlng/** - - tests/modules/raxmlng/** - -rsem/calculateexpression: - - modules/rsem/calculateexpression/** - - tests/modules/rsem/calculateexpression/** - -rsem/preparereference: - - modules/rsem/preparereference/** - - tests/modules/rsem/preparereference/** - -rseqc/bamstat: - - modules/rseqc/bamstat/** - - tests/modules/rseqc/bamstat/** - -rseqc/inferexperiment: - - modules/rseqc/inferexperiment/** - - tests/modules/rseqc/inferexperiment/** - -rseqc/innerdistance: - - modules/rseqc/innerdistance/** - - tests/modules/rseqc/innerdistance/** - -rseqc/junctionannotation: - - modules/rseqc/junctionannotation/** - - tests/modules/rseqc/junctionannotation/** - -rseqc/junctionsaturation: - - modules/rseqc/junctionsaturation/** - - tests/modules/rseqc/junctionsaturation/** - -rseqc/readdistribution: - - modules/rseqc/readdistribution/** - - tests/modules/rseqc/readdistribution/** - -rseqc/readduplication: - - modules/rseqc/readduplication/** - - tests/modules/rseqc/readduplication/** - -salmon/index: - - modules/salmon/index/** - - tests/modules/salmon/index/** - -salmon/quant: - - modules/salmon/quant/** - - tests/modules/salmon/quant/** - -samtools/faidx: - - modules/samtools/faidx/** - - tests/modules/samtools/faidx/** - -samtools/fastq: - - modules/samtools/fastq/** - - tests/modules/samtools/fastq/** - -samtools/flagstat: - - modules/samtools/flagstat/** - - tests/modules/samtools/flagstat/** - -samtools/idxstats: - - modules/samtools/idxstats/** - - tests/modules/samtools/idxstats/** - -samtools/index: - - modules/samtools/index/** - - tests/modules/samtools/index/** - -samtools/merge: - - modules/samtools/merge/** - - tests/modules/samtools/merge/** - -samtools/mpileup: - - modules/samtools/mpileup/** - - tests/modules/samtools/mpileup/** - -samtools/sort: - - modules/samtools/sort/** - - tests/modules/samtools/sort/** - -samtools/stats: - - modules/samtools/stats/** - - tests/modules/samtools/stats/** - -samtools/view: - - modules/samtools/view/** - - tests/modules/samtools/view/** - -seacr/callpeak: - - modules/seacr/callpeak/** - - tests/modules/seacr/callpeak/** - -seqkit/split2: - - modules/seqkit/split2/** - - tests/modules/seqkit/split2/** - -seqtk/sample: - - modules/seqtk/sample/** - - tests/modules/seqtk/sample/** - -seqtk/subseq: - - modules/seqtk/subseq/** - - tests/modules/seqtk/subseq/** - -sequenzautils/bam2seqz: - - modules/sequenzautils/bam2seqz/** - - tests/modules/sequenzautils/bam2seqz/** - -sequenzautils/gcwiggle: - - modules/sequenzautils/gcwiggle/** - - tests/modules/sequenzautils/gcwiggle/** - -seqwish/induce: - - modules/seqwish/induce/** - - tests/modules/seqwish/induce/** - -shovill: - - modules/shovill/** - - tests/modules/shovill/** - -snpeff: - - modules/snpeff/** - - tests/modules/snpeff/** - -snpsites: - - modules/snpsites/** - - tests/modules/snpsites/** - -spades: - - modules/spades/** - - tests/modules/spades/** - -star/align: - - modules/star/align/** - - tests/modules/star/align/** - -star/genomegenerate: - - modules/star/genomegenerate/** - - tests/modules/star/genomegenerate/** - -strelka/germline: - - modules/strelka/germline/** - - tests/modules/strelka/germline/** - -stringtie/merge: - - modules/stringtie/merge/** - - tests/modules/stringtie/merge/** - -stringtie/stringtie: - - modules/stringtie/stringtie/** - - tests/modules/stringtie/stringtie/** - -subread/featurecounts: - - modules/subread/featurecounts/** - - tests/modules/subread/featurecounts/** - -tabix/bgzip: - - modules/tabix/bgzip/** - - tests/modules/tabix/bgzip/** - -tabix/bgziptabix: - - modules/tabix/bgziptabix/** - - tests/modules/tabix/bgziptabix/** - -tabix/tabix: - - modules/tabix/tabix/** - - tests/modules/tabix/tabix/** - -tiddit/sv: - - modules/tiddit/sv/** - - tests/modules/tiddit/sv/** - -trimgalore: - - modules/trimgalore/** - - tests/modules/trimgalore/** - -ucsc/bed12tobigbed: - - modules/ucsc/bed12tobigbed/** - - tests/modules/ucsc/bed12tobigbed/** - -ucsc/bedclip: - - modules/ucsc/bedclip/** - - tests/modules/ucsc/bedclip/** - -ucsc/bedgraphtobigwig: - - modules/ucsc/bedgraphtobigwig/** - - tests/modules/ucsc/bedgraphtobigwig/** - -ucsc/bigwigaverageoverbed: - - modules/ucsc/bigwigaverageoverbed/** - - tests/modules/ucsc/bigwigaverageoverbed/** - -ucsc/wigtobigwig: - - modules/ucsc/wigtobigwig/** - - tests/modules/ucsc/wigtobigwig/** - -unicycler: - - modules/unicycler/** - - tests/modules/unicycler/** - -untar: - - modules/untar/** - - tests/modules/untar/** - -vcftools: - - modules/vcftools/** - - tests/modules/vcftools/** - -yara/index: - - modules/yara/index/** - - tests/modules/yara/index/** - -yara/mapper: - - modules/yara/mapper/** - - tests/modules/yara/mapper/** diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 314a2329..ee1ba0d8 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -11,6 +11,7 @@ params { genome_gff3 = "${test_data_dir}/genomics/sarscov2/genome/genome.gff3" genome_gff3_gz = "${test_data_dir}/genomics/sarscov2/genome/genome.gff3.gz" genome_gtf = "${test_data_dir}/genomics/sarscov2/genome/genome.gtf" + genome_paf = "${test_data_dir}/genomics/sarscov2/genome/genome.paf" genome_sizes = "${test_data_dir}/genomics/sarscov2/genome/genome.sizes" transcriptome_fasta = "${test_data_dir}/genomics/sarscov2/genome/transcriptome.fasta" transcriptome_paf = "${test_data_dir}/genomics/sarscov2/genome/transcriptome.paf" @@ -24,12 +25,18 @@ params { kraken2 = "${test_data_dir}/genomics/sarscov2/genome/db/kraken2" kraken2_tar_gz = "${test_data_dir}/genomics/sarscov2/genome/db/kraken2.tar.gz" + ncbi_taxmap_zip = "${test_data_dir}/genomics/sarscov2/genome/db/maltextract/ncbi_taxmap.zip" + taxon_list_txt = "${test_data_dir}/genomics/sarscov2/genome/db/maltextract/taxon_list.txt" + all_sites_fas = "${test_data_dir}/genomics/sarscov2/genome/alignment/all_sites.fas" informative_sites_fas = "${test_data_dir}/genomics/sarscov2/genome/alignment/informative_sites.fas" contigs_genome_maf_gz = "${test_data_dir}/genomics/sarscov2/genome/alignment/last/contigs.genome.maf.gz" contigs_genome_par = "${test_data_dir}/genomics/sarscov2/genome/alignment/last/contigs.genome.par" lastdb_tar_gz = "${test_data_dir}/genomics/sarscov2/genome/alignment/last/lastdb.tar.gz" + + baits_interval_list = "${test_data_dir}/genomics/sarscov2/genome/picard/baits.interval_list" + targets_interval_list = "${test_data_dir}/genomics/sarscov2/genome/picard/targets.interval_list" } 'illumina' { test_single_end_bam = "${test_data_dir}/genomics/sarscov2/illumina/bam/test.single_end.bam" @@ -66,6 +73,7 @@ params { test2_vcf = "${test_data_dir}/genomics/sarscov2/illumina/vcf/test2.vcf" test2_vcf_gz = "${test_data_dir}/genomics/sarscov2/illumina/vcf/test2.vcf.gz" test2_vcf_gz_tbi = "${test_data_dir}/genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi" + test2_vcf_targets_tsv_gz = "${test_data_dir}/genomics/sarscov2/illumina/vcf/test2.targets.tsv.gz" test3_vcf = "${test_data_dir}/genomics/sarscov2/illumina/vcf/test3.vcf" test3_vcf_gz = "${test_data_dir}/genomics/sarscov2/illumina/vcf/test3.vcf.gz" test3_vcf_gz_tbi = "${test_data_dir}/genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi" @@ -74,12 +82,17 @@ params { scaffolds_fasta = "${test_data_dir}/genomics/sarscov2/illumina/fasta/scaffolds.fasta" 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" test_sorted_bam_bai = "${test_data_dir}/genomics/sarscov2/nanopore/bam/test.sorted.bam.bai" - fast5_tar_gz = "${test_data_dir}/genomics/sarscov2/nanopore/fast5/fast5.tar.gz" + fast5_tar_gz = "${test_data_dir}/genomics/sarscov2/nanopore/fast5/fast5.tar.gz" test_fastq_gz = "${test_data_dir}/genomics/sarscov2/nanopore/fastq/test.fastq.gz" @@ -93,9 +106,18 @@ params { genome_dict = "${test_data_dir}/genomics/homo_sapiens/genome/genome.dict" genome_gff3 = "${test_data_dir}/genomics/homo_sapiens/genome/genome.gff3" genome_gtf = "${test_data_dir}/genomics/homo_sapiens/genome/genome.gtf" + genome_interval_list = "${test_data_dir}/genomics/homo_sapiens/genome/genome.interval_list" 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" + genome2_fasta = "${test_data_dir}/genomics/homo_sapiens/genome/genome2.fasta" + genome_chain_gz = "${test_data_dir}/genomics/homo_sapiens/genome/genome.chain.gz" + genome_21_fasta = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/genome.fasta" + genome_21_fasta_fai = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai" + genome_21_dict = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/sequence/genome.dict" dbsnp_146_hg38_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz" dbsnp_146_hg38_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz.tbi" @@ -103,24 +125,45 @@ params { gnomad_r2_1_1_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/gnomAD.r2.1.1.vcf.gz.tbi" mills_and_1000g_indels_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/mills_and_1000G.indels.vcf.gz" mills_and_1000g_indels_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/mills_and_1000G.indels.vcf.gz.tbi" + hapmap_3_3_hg38_21_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/germlineresources/hapmap_3.3.hg38.vcf.gz" + hapmap_3_3_hg38_21_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/germlineresources/hapmap_3.3.hg38.vcf.gz.tbi" + res_1000g_omni2_5_hg38_21_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/germlineresources/1000G_omni2.5.hg38.vcf.gz" + res_1000g_omni2_5_hg38_21_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/germlineresources/1000G_omni2.5.hg38.vcf.gz.tbi" + res_1000g_phase1_snps_hg38_21_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/germlineresources/1000G_phase1.snps.hg38.vcf.gz" + res_1000g_phase1_snps_hg38_21_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/germlineresources/1000G_phase1.snps.hg38.vcf.gz.tbi" + dbsnp_138_hg38_21_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz" + dbsnp_138_hg38_21_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi" + + syntheticvcf_short_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/syntheticvcf_short.vcf.gz" + syntheticvcf_short_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/syntheticvcf_short.vcf.gz.tbi" + index_salmon = "${test_data_dir}/genomics/homo_sapiens/genome/index/salmon" + repeat_expansions = "${test_data_dir}/genomics/homo_sapiens/genome/loci/repeat_expansions.json" + justhusky_ped = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/ped/justhusky.ped" + justhusky_minimal_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/ped/justhusky_minimal.vcf.gz" + justhusky_minimal_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/ped/justhusky_minimal.vcf.gz.tbi" + } '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_name_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test.paired_end.name.sorted.bam" + 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" + test_paired_end_hla = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/example_hla_pe.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" + test2_paired_end_name_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test2.paired_end.name.sorted.bam" test2_paired_end_markduplicates_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test2.paired_end.markduplicates.sorted.bam" test2_paired_end_markduplicates_sorted_bam_bai = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test2.paired_end.markduplicates.sorted.bam.bai" test2_paired_end_recalibrated_sorted_bam = "${test_data_dir}/genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam" @@ -132,6 +175,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" @@ -145,6 +202,29 @@ 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_genomicsdb_tar_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test_genomicsdb.tar.gz" + test_pon_genomicsdb_tar_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test_pon_genomicsdb.tar.gz" + + test2_haplotc_ann_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz" + test2_haplotc_ann_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi" + + test2_recal = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2.recal" + test2_recal_idx = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2.recal.idx" + test2_tranches = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2.tranches" + test2_allele_specific_recal = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2_allele_specific.recal" + test2_allele_specific_recal_idx = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2_allele_specific.recal.idx" + test2_allele_specific_tranches = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2_allele_specific.tranches" + + 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" @@ -156,8 +236,123 @@ params { test2_genome_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz.tbi" test2_genome_vcf_idx = "${test_data_dir}/genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.idx" - test_10x_1_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/10xgenomics/test.10x_1.fastq.gz" - test_10x_2_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/10xgenomics/test.10x_2.fastq.gz" + test_broadpeak = "${test_data_dir}/genomics/homo_sapiens/illumina/broadpeak/test.broadPeak" + test2_broadpeak = "${test_data_dir}/genomics/homo_sapiens/illumina/broadpeak/test2.broadPeak" + + test_narrowpeak = "${test_data_dir}/genomics/homo_sapiens/illumina/narrowpeak/test.narrowPeak" + test2_narrowpeak = "${test_data_dir}/genomics/homo_sapiens/illumina/narrowpeak/test2.narrowPeak" + + test_10x_1_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/10xgenomics/test_10x_S1_L001_R1_001.fastq.gz" + test_10x_2_fastq_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/10xgenomics/test_10x_S1_L001_R2_001.fastq.gz" + + test_yak = "${test_data_dir}/genomics/homo_sapiens/illumina/yak/test.yak" + test2_yak = "${test_data_dir}/genomics/homo_sapiens/illumina/yak/test2.yak" + + cutandrun_bedgraph_test_1 = "${test_data_dir}/genomics/homo_sapiens/illumina/bedgraph/cutandtag_h3k27me3_test_1.bedGraph" + cutandrun_bedgraph_test_2 = "${test_data_dir}/genomics/homo_sapiens/illumina/bedgraph/cutandtag_igg_test_1.bedGraph" + + test_rnaseq_vcf = "${test_data_dir}/genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf" + } + 'pacbio' { + primers = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/primers.fasta" + 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" + 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" + singletons = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.bam" + aligned = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned.bam" + alignedbai = "${test_data_dir}/genomics/homo_sapiens/pacbio/bam/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned.bam.bai" + genemodel1 = "${test_data_dir}/genomics/homo_sapiens/pacbio/bed/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned_tc.bed" + genemodel2 = "${test_data_dir}/genomics/homo_sapiens/pacbio/bed/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned_tc.2.bed" + filelist = "${test_data_dir}/genomics/homo_sapiens/pacbio/txt/filelist.txt" + } + } + 'bacteroides_fragilis' { + 'genome' { + genome_fna_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz" + genome_paf = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.paf" + } + 'illumina' { + test1_contigs_fa_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/fasta/test1.contigs.fa.gz" + test1_1_fastq_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz" + test1_2_fastq_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_2.fastq.gz" + test2_1_fastq_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test2_1.fastq.gz" + test2_2_fastq_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test2_2.fastq.gz" + test1_paired_end_bam = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test1.bam" + test1_paired_end_sorted_bam = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test1.sorted.bam" + test1_paired_end_sorted_bam_bai = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test1.sorted.bam.bai" + test2_paired_end_bam = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test2.bam" + test2_paired_end_sorted_bam = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test2.sorted.bam" + test2_paired_end_sorted_bam_bai = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test2.sorted.bam.bai" + } + 'nanopore' { + test_fastq_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/nanopore/fastq/test.fastq.gz" + overlap_paf = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/nanopore/overlap.paf" + } + } + 'candidatus_portiera_aleyrodidarum' { + 'genome' { + genome_fasta = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/genome.fasta" + genome_sizes = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/genome.sizes" + genome_aln_gz = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/genome.aln.gz" + genome_aln_nwk = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/genome.aln.nwk" + proteome_fasta = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/proteome.fasta" + test1_gff = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test1.gff" + test2_gff = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test2.gff" + test3_gff = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/gff/test3.gff" + } + 'illumina' { + test_1_fastq_gz = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/illumina/fasta/test_1.fastq.gz" + test_2_fastq_gz = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/illumina/fastq/test_2.fastq.gz" + test_se_fastq_gz = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/illumina/fastq/test_se.fastq.gz" + } + 'nanopore' { + test_fastq_gz = "${test_data_dir}/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/nanopore/fastq/test.fastq.gz" + } + } + 'haemophilus_influenzae' { + 'genome' { + genome_fna_gz = "${test_data_dir}/genomics/prokaryotes/haemophilus_influenzae/genome/genome.fna.gz" + genome_aln_gz = "${test_data_dir}/genomics/prokaryotes/haemophilus_influenzae/genome/genome.aln.gz" + genome_aln_nwk = "${test_data_dir}/genomics/prokaryotes/haemophilus_influenzae/genome/genome.aln.nwk" + } + } + 'generic' { + 'csv' { + test_csv = "${test_data_dir}/generic/csv/test.csv" + } + 'notebooks' { + rmarkdown = "${test_data_dir}/generic/notebooks/rmarkdown/rmarkdown_notebook.Rmd" + ipython_md = "${test_data_dir}/generic/notebooks/jupyter/ipython_notebook.md" + ipython_ipynb = "${test_data_dir}/generic/notebooks/jupyter/ipython_notebook.ipynb" + } + 'tsv' { + test_tsv = "${test_data_dir}/generic/tsv/test.tsv" + } + 'txt' { + hello = "${test_data_dir}/generic/txt/hello.txt" + } + 'cnn' { + reference = "${test_data_dir}/generic/cnn/reference.cnn" + } + 'cooler'{ + test_pairix_pair_gz = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz" + test_pairix_pair_gz_px2 = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz.px2" + test_pairs_pair = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.sample1.pairs" + test_tabix_pair_gz = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.sorted.possrt.txt.gz" + test_tabix_pair_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.sorted.possrt.txt.gz.tbi" + hg19_chrom_sizes = "${test_data_dir}/genomics/homo_sapiens/cooler/cload/hg19/hg19.chrom.sizes" + test_merge_cool = "${test_data_dir}/genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cool" + test_merge_cool_cp2 = "${test_data_dir}/genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cp2.cool" + } } } diff --git a/tests/modules/abacas/main.nf b/tests/modules/abacas/main.nf index dc58ed61..542a67af 100644 --- a/tests/modules/abacas/main.nf +++ b/tests/modules/abacas/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { ABACAS } from '../../../modules/abacas/main.nf' addParams ( options: ['args' : '-m -p nucmer'] ) +include { ABACAS } from '../../../modules/abacas/main.nf' workflow test_abacas { diff --git a/tests/modules/abacas/nextflow.config b/tests/modules/abacas/nextflow.config new file mode 100644 index 00000000..17296503 --- /dev/null +++ b/tests/modules/abacas/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: ABACAS { + ext.args = '-m -p nucmer' + } + +} diff --git a/tests/modules/abacas/test.yml b/tests/modules/abacas/test.yml index 899bc4db..c466a6ed 100644 --- a/tests/modules/abacas/test.yml +++ b/tests/modules/abacas/test.yml @@ -1,5 +1,5 @@ - name: abacas - command: nextflow run ./tests/modules/abacas -entry test_abacas -c tests/config/nextflow.config + command: nextflow run ./tests/modules/abacas -entry test_abacas -c ./tests/config/nextflow.config -c ./tests/modules/abacas/nextflow.config tags: - abacas files: diff --git a/tests/modules/adapterremoval/main.nf b/tests/modules/adapterremoval/main.nf index 9dd37aa9..ee7f1c44 100644 --- a/tests/modules/adapterremoval/main.nf +++ b/tests/modules/adapterremoval/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { ADAPTERREMOVAL } from '../../../modules/adapterremoval/main.nf' addParams( options: [:] ) +include { ADAPTERREMOVAL } from '../../../modules/adapterremoval/main.nf' workflow test_adapterremoval_single_end { input = [ [ id:'test', single_end:true, collapse:false ], // meta map diff --git a/tests/modules/adapterremoval/nextflow.config b/tests/modules/adapterremoval/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/adapterremoval/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/adapterremoval/test.yml b/tests/modules/adapterremoval/test.yml index 95cd4b04..a6c4a6cf 100644 --- a/tests/modules/adapterremoval/test.yml +++ b/tests/modules/adapterremoval/test.yml @@ -1,5 +1,5 @@ - name: adapterremoval test_adapterremoval_single_end - command: nextflow run tests/modules/adapterremoval -entry test_adapterremoval_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/adapterremoval -entry test_adapterremoval_single_end -c ./tests/config/nextflow.config -c ./tests/modules/adapterremoval/nextflow.config tags: - adapterremoval files: @@ -9,23 +9,23 @@ md5sum: 62139afee94defad5b83bdd0b8475a1f - name: adapterremoval test_adapterremoval_paired_end - command: nextflow run tests/modules/adapterremoval -entry test_adapterremoval_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/adapterremoval -entry test_adapterremoval_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/adapterremoval/nextflow.config tags: - adapterremoval files: - - path: output/adapterremoval/test.pair2.trimmed.fastq.gz - md5sum: f076a9f666235e01a3281f8c46c9d010 - path: output/adapterremoval/test.log - md5sum: bea86105aff4d27fe29c83e24498fefa + md5sum: b8a451d3981b327f3fdb44f40ba2d6d1 - path: output/adapterremoval/test.pair1.trimmed.fastq.gz - md5sum: f076a9f666235e01a3281f8c46c9d010 + md5sum: 294a6277f0139bd597e57c6fa31f39c7 + - path: output/adapterremoval/test.pair2.trimmed.fastq.gz + md5sum: de7b38e2c881bced8671acb1ab452d78 - name: adapterremoval test_adapterremoval_paired_end_collapse - command: nextflow run tests/modules/adapterremoval -entry test_adapterremoval_paired_end_collapse -c tests/config/nextflow.config + command: nextflow run ./tests/modules/adapterremoval -entry test_adapterremoval_paired_end_collapse -c ./tests/config/nextflow.config -c ./tests/modules/adapterremoval/nextflow.config tags: - adapterremoval files: - path: output/adapterremoval/test.log - md5sum: 97cb97b3d03123ac88430768b2e36c59 + md5sum: 7f0b2328152226e46101a535cce718b3 - path: output/adapterremoval/test.merged.fastq.gz - md5sum: 50a4f9fdac6a24e211eb4dcf9f292bef + md5sum: 07a8f725bfd3ecbeabdc41b32d898dee diff --git a/tests/modules/agrvate/main.nf b/tests/modules/agrvate/main.nf new file mode 100644 index 00000000..ac682bef --- /dev/null +++ b/tests/modules/agrvate/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { AGRVATE } from '../../../modules/agrvate/main.nf' + +workflow test_agrvate { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + AGRVATE ( input ) +} diff --git a/tests/modules/agrvate/nextflow.config b/tests/modules/agrvate/nextflow.config new file mode 100644 index 00000000..7f127e5e --- /dev/null +++ b/tests/modules/agrvate/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: AGRVATE { + ext.args = '--mummer' + } + +} diff --git a/tests/modules/agrvate/test.yml b/tests/modules/agrvate/test.yml new file mode 100644 index 00000000..36e8886c --- /dev/null +++ b/tests/modules/agrvate/test.yml @@ -0,0 +1,7 @@ +- name: agrvate + command: nextflow run ./tests/modules/agrvate -entry test_agrvate -c ./tests/config/nextflow.config -c ./tests/modules/agrvate/nextflow.config + tags: + - agrvate + files: + - path: output/agrvate/genome-results/genome-summary.tab + md5sum: 781a9e5fc6ebc9f90ddfe8753d1633db diff --git a/tests/modules/allelecounter/main.nf b/tests/modules/allelecounter/main.nf index 542529c2..3fe11be3 100644 --- a/tests/modules/allelecounter/main.nf +++ b/tests/modules/allelecounter/main.nf @@ -1,14 +1,26 @@ #!/usr/bin/env nextflow nextflow.enable.dsl = 2 -include { ALLELECOUNTER } from '../../../modules/allelecounter/main.nf' addParams( options: [:] ) +include { ALLELECOUNTER } from '../../../modules/allelecounter/main.nf' -workflow test_allelecounter { +workflow test_allelecounter_bam { 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) ] positions = [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ] - ALLELECOUNTER ( input, positions ) + ALLELECOUNTER ( input, positions, [] ) +} + + +workflow test_allelecounter_cram { + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) + ] + positions = [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) ] + fasta = [ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + + ALLELECOUNTER ( input, positions, fasta ) } diff --git a/tests/modules/allelecounter/nextflow.config b/tests/modules/allelecounter/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/allelecounter/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/allelecounter/test.yml b/tests/modules/allelecounter/test.yml index 7ed71559..a0afbc12 100644 --- a/tests/modules/allelecounter/test.yml +++ b/tests/modules/allelecounter/test.yml @@ -1,7 +1,15 @@ -- name: allelecounter test_allelecounter - command: nextflow run tests/modules/allelecounter -entry test_allelecounter -c tests/config/nextflow.config +- name: allelecounter test_allelecounter_bam + command: nextflow run ./tests/modules/allelecounter -entry test_allelecounter_bam -c ./tests/config/nextflow.config -c ./tests/modules/allelecounter/nextflow.config tags: - allelecounter files: - path: output/allelecounter/test.alleleCount md5sum: 2bbe9d7331b78bdac30fe30dbc5fdaf3 + +- name: allelecounter test_allelecounter_cram + command: nextflow run ./tests/modules/allelecounter -entry test_allelecounter_cram -c ./tests/config/nextflow.config -c ./tests/modules/allelecounter/nextflow.config + tags: + - allelecounter + files: + - path: output/allelecounter/test.alleleCount + md5sum: 2f83352a185168c7c98e9e42550b2856 diff --git a/tests/modules/amps/main.nf b/tests/modules/amps/main.nf new file mode 100644 index 00000000..15572096 --- /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' +include { UNZIP as UNZIP_MALTEXTRACT } from '../../../modules/unzip/main.nf' +include { MALT_BUILD } from '../../../modules/malt/build/main.nf' +include { MALT_RUN } from '../../../modules/malt/run/main.nf' +include { MALTEXTRACT } from '../../../modules/maltextract/main.nf' +include { AMPS } from '../../../modules/amps/main.nf' + + +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/nextflow.config b/tests/modules/amps/nextflow.config new file mode 100644 index 00000000..b58ac3fe --- /dev/null +++ b/tests/modules/amps/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: MALTEXTRACT { + ext.args = '-f def_anc' + } + +} diff --git a/tests/modules/amps/test.yml b/tests/modules/amps/test.yml new file mode 100644 index 00000000..f38320e4 --- /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 -c ./tests/modules/amps/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 diff --git a/tests/modules/arriba/main.nf b/tests/modules/arriba/main.nf new file mode 100644 index 00000000..60741275 --- /dev/null +++ b/tests/modules/arriba/main.nf @@ -0,0 +1,42 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { STAR_GENOMEGENERATE } from '../../../modules/star/genomegenerate/main.nf' +include { STAR_ALIGN } from '../../../modules/star/align/main.nf' +include { ARRIBA } from '../../../modules/arriba/main.nf' + +workflow test_arriba_single_end { + + input = [ [ id:'test', single_end:true ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_1_fastq_gz'], 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) + gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) + star_ignore_sjdbgtf = false + seq_platform = 'illumina' + seq_center = false + + STAR_GENOMEGENERATE ( fasta, gtf ) + STAR_ALIGN ( input, STAR_GENOMEGENERATE.out.index, gtf, star_ignore_sjdbgtf, seq_platform, seq_center ) + ARRIBA ( STAR_ALIGN.out.bam, fasta, gtf ) +} + +workflow test_arriba_paired_end { + + input = [ [ id:'test', single_end:false ], // 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) + fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) + star_ignore_sjdbgtf = false + seq_platform = 'illumina' + seq_center = false + + STAR_GENOMEGENERATE ( fasta, gtf ) + STAR_ALIGN ( input, STAR_GENOMEGENERATE.out.index, gtf, star_ignore_sjdbgtf, seq_platform, seq_center ) + ARRIBA ( STAR_ALIGN.out.bam, fasta, gtf ) +} diff --git a/tests/modules/arriba/nextflow.config b/tests/modules/arriba/nextflow.config new file mode 100644 index 00000000..1b66d8df --- /dev/null +++ b/tests/modules/arriba/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: STAR_GENOMEGENERATE { + ext.args = '--genomeSAindexNbases 11' + } + + withName: STAR_ALIGN { + ext.args = '--readFilesCommand zcat --outSAMtype BAM Unsorted --outSAMunmapped Within --outBAMcompression 0 --outFilterMultimapNmax 50 --peOverlapNbasesMin 10 --alignSplicedMateMapLminOverLmate 0.5 --alignSJstitchMismatchNmax 5 -1 5 5 --chimSegmentMin 10 --chimOutType WithinBAM HardClip --chimJunctionOverhangMin 10 --chimScoreDropMax 30 --chimScoreJunctionNonGTAG 0 --chimScoreSeparation 1 --chimSegmentReadGapMax 3 --chimMultimapNmax 50' + } + +} diff --git a/tests/modules/arriba/test.yml b/tests/modules/arriba/test.yml new file mode 100644 index 00000000..52743167 --- /dev/null +++ b/tests/modules/arriba/test.yml @@ -0,0 +1,91 @@ +- name: arriba test_arriba_single_end + command: nextflow run ./tests/modules/arriba -entry test_arriba_single_end -c ./tests/config/nextflow.config -c ./tests/modules/arriba/nextflow.config + tags: + - arriba + files: + - path: output/arriba/test.fusions.discarded.tsv + md5sum: cad8c215b938d1e45b747a5b7898a4c2 + - path: output/arriba/test.fusions.tsv + md5sum: 7c3383f7eb6d79b84b0bd30a7ef02d70 + - path: output/star/star/Genome + md5sum: a654229fbca6071dcb6b01ce7df704da + - path: output/star/star/Log.out + - path: output/star/star/SA + md5sum: 8c3edc46697b72c9e92440d4cf43506c + - path: output/star/star/SAindex + md5sum: 9f085c626553b1c52f2827421972ac10 + - path: output/star/star/chrLength.txt + md5sum: c81f40f27e72606d7d07097c1d56a5b5 + - path: output/star/star/chrName.txt + md5sum: 5ae68a67b70976ee95342a7451cb5af1 + - path: output/star/star/chrNameLength.txt + md5sum: b190587cae0531f3cf25552d8aa674db + - path: output/star/star/chrStart.txt + md5sum: 8d3291e6bcdbe9902fbd7c887494173f + - path: output/star/star/exonGeTrInfo.tab + md5sum: d04497f69d6ef889efd4d34fe63edcc4 + - path: output/star/star/exonInfo.tab + md5sum: 0d560290fab688b7268d88d5494bf9fe + - path: output/star/star/geneInfo.tab + md5sum: 8b608537307443ffaee4927d2b428805 + - path: output/star/star/genomeParameters.txt + md5sum: 9e42067b1ec70b773257529230dd7b3a + - path: output/star/star/sjdbInfo.txt + md5sum: 5690ea9d9f09f7ff85b7fd47bd234903 + - path: output/star/star/sjdbList.fromGTF.out.tab + md5sum: 8760c33e966dad0b39f440301ebbdee4 + - path: output/star/star/sjdbList.out.tab + md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1 + - path: output/star/star/transcriptInfo.tab + md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 + - path: output/star/test.Aligned.out.bam + - path: output/star/test.Log.final.out + - path: output/star/test.Log.out + - path: output/star/test.Log.progress.out + - path: output/star/test.SJ.out.tab + +- name: arriba test_arriba_paired_end + command: nextflow run ./tests/modules/arriba -entry test_arriba_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/arriba/nextflow.config + tags: + - arriba + files: + - path: output/arriba/test.fusions.discarded.tsv + md5sum: 85e36c887464e4deaa65f45174d3b8fd + - path: output/arriba/test.fusions.tsv + md5sum: 7c3383f7eb6d79b84b0bd30a7ef02d70 + - path: output/star/star/Genome + md5sum: a654229fbca6071dcb6b01ce7df704da + - path: output/star/star/Log.out + - path: output/star/star/SA + md5sum: 8c3edc46697b72c9e92440d4cf43506c + - path: output/star/star/SAindex + md5sum: 9f085c626553b1c52f2827421972ac10 + - path: output/star/star/chrLength.txt + md5sum: c81f40f27e72606d7d07097c1d56a5b5 + - path: output/star/star/chrName.txt + md5sum: 5ae68a67b70976ee95342a7451cb5af1 + - path: output/star/star/chrNameLength.txt + md5sum: b190587cae0531f3cf25552d8aa674db + - path: output/star/star/chrStart.txt + md5sum: 8d3291e6bcdbe9902fbd7c887494173f + - path: output/star/star/exonGeTrInfo.tab + md5sum: d04497f69d6ef889efd4d34fe63edcc4 + - path: output/star/star/exonInfo.tab + md5sum: 0d560290fab688b7268d88d5494bf9fe + - path: output/star/star/geneInfo.tab + md5sum: 8b608537307443ffaee4927d2b428805 + - path: output/star/star/genomeParameters.txt + md5sum: 9e42067b1ec70b773257529230dd7b3a + - path: output/star/star/sjdbInfo.txt + md5sum: 5690ea9d9f09f7ff85b7fd47bd234903 + - path: output/star/star/sjdbList.fromGTF.out.tab + md5sum: 8760c33e966dad0b39f440301ebbdee4 + - path: output/star/star/sjdbList.out.tab + md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1 + - path: output/star/star/transcriptInfo.tab + md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 + - path: output/star/test.Aligned.out.bam + - path: output/star/test.Log.final.out + - path: output/star/test.Log.out + - path: output/star/test.Log.progress.out + - path: output/star/test.SJ.out.tab diff --git a/tests/modules/artic/guppyplex/main.nf b/tests/modules/artic/guppyplex/main.nf index 972a6e66..89f67c74 100644 --- a/tests/modules/artic/guppyplex/main.nf +++ b/tests/modules/artic/guppyplex/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { ARTIC_GUPPYPLEX } from '../../../../modules/artic/guppyplex/main.nf' addParams( options: [:] ) +include { ARTIC_GUPPYPLEX } from '../../../../modules/artic/guppyplex/main.nf' process STAGE_FASTQ_DIR { input: diff --git a/tests/modules/artic/guppyplex/nextflow.config b/tests/modules/artic/guppyplex/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/artic/guppyplex/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/artic/guppyplex/test.yml b/tests/modules/artic/guppyplex/test.yml index 133f0b15..6fd10898 100644 --- a/tests/modules/artic/guppyplex/test.yml +++ b/tests/modules/artic/guppyplex/test.yml @@ -1,5 +1,5 @@ - name: artic guppyplex - command: nextflow run tests/modules/artic/guppyplex -entry test_artic_guppyplex -c tests/config/nextflow.config + command: nextflow run ./tests/modules/artic/guppyplex -entry test_artic_guppyplex -c ./tests/config/nextflow.config -c ./tests/modules/artic/guppyplex/nextflow.config tags: - artic - artic/guppyplex diff --git a/tests/modules/artic/minion/main.nf b/tests/modules/artic/minion/main.nf index f4993289..ca66ede0 100644 --- a/tests/modules/artic/minion/main.nf +++ b/tests/modules/artic/minion/main.nf @@ -3,17 +3,19 @@ nextflow.enable.dsl = 2 include { UNTAR } from '../../../../modules/untar/main.nf' -include { ARTIC_MINION } from '../../../../modules/artic/minion/main.nf' addParams( fast5_dir: true, sequencing_summary: true, artic_minion_medaka_model:false ) +include { ARTIC_MINION } from '../../../../modules/artic/minion/main.nf' workflow test_artic_minion { - input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true) ] - fast5_tar = [ file(params.test_data['sarscov2']['nanopore']['fast5_tar_gz'], checkIfExists: true) ] - sequencing_summary = [ file(params.test_data['sarscov2']['nanopore']['test_sequencing_summary'], checkIfExists: true) ] - fasta = [ file('https://github.com/artic-network/primer-schemes/raw/master/nCoV-2019/V3/nCoV-2019.reference.fasta', checkIfExists: true) ] - bed = [ file('https://github.com/artic-network/primer-schemes/raw/master/nCoV-2019/V3/nCoV-2019.primer.bed', checkIfExists: true) ] - dummy_file = [ ] + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true) + ] + fast5_tar = file(params.test_data['sarscov2']['nanopore']['fast5_tar_gz'], checkIfExists: true) + sequencing_summary = file(params.test_data['sarscov2']['nanopore']['test_sequencing_summary'], checkIfExists: true) + fasta = file('https://github.com/artic-network/primer-schemes/raw/master/nCoV-2019/V3/nCoV-2019.reference.fasta', checkIfExists: true) + bed = file('https://github.com/artic-network/primer-schemes/raw/master/nCoV-2019/V3/nCoV-2019.primer.bed', checkIfExists: true) + dummy_file = [] fast5_dir = UNTAR ( fast5_tar ).untar diff --git a/tests/modules/artic/minion/nextflow.config b/tests/modules/artic/minion/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/artic/minion/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/artic/minion/test.yml b/tests/modules/artic/minion/test.yml index b3c5f0f1..8b36b224 100644 --- a/tests/modules/artic/minion/test.yml +++ b/tests/modules/artic/minion/test.yml @@ -1,5 +1,5 @@ - name: artic minion - command: nextflow run tests/modules/artic/minion -entry test_artic_minion -c tests/config/nextflow.config + command: nextflow run ./tests/modules/artic/minion -entry test_artic_minion -c ./tests/config/nextflow.config -c ./tests/modules/artic/minion/nextflow.config tags: - artic - artic/minion diff --git a/tests/modules/assemblyscan/main.nf b/tests/modules/assemblyscan/main.nf new file mode 100644 index 00000000..7cd5f393 --- /dev/null +++ b/tests/modules/assemblyscan/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ASSEMBLYSCAN } from '../../../modules/assemblyscan/main.nf' + +workflow test_assemblyscan { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + ASSEMBLYSCAN ( input ) +} diff --git a/tests/modules/assemblyscan/nextflow.config b/tests/modules/assemblyscan/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/assemblyscan/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/assemblyscan/test.yml b/tests/modules/assemblyscan/test.yml new file mode 100644 index 00000000..4a3ba5ec --- /dev/null +++ b/tests/modules/assemblyscan/test.yml @@ -0,0 +1,7 @@ +- name: assemblyscan test_assemblyscan + command: nextflow run ./tests/modules/assemblyscan -entry test_assemblyscan -c ./tests/config/nextflow.config -c ./tests/modules/assemblyscan/nextflow.config + tags: + - assemblyscan + files: + - path: output/assemblyscan/test.json + md5sum: 9140e3d43f2d676f62e1325ace5dd8bd diff --git a/tests/modules/ataqv/ataqv/main.nf b/tests/modules/ataqv/ataqv/main.nf new file mode 100644 index 00000000..b1103350 --- /dev/null +++ b/tests/modules/ataqv/ataqv/main.nf @@ -0,0 +1,69 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ATAQV_ATAQV } from '../../../../modules/ataqv/ataqv/main.nf' +include { ATAQV_ATAQV as ATAQV_ATAQV_PROBLEM_READS} from '../../../../modules/ataqv/ataqv/main.nf' + +workflow test_ataqv_ataqv { + + input = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true), + [], + [] + ] + + ATAQV_ATAQV ( input, 'human', [], [], [] ) +} + +workflow test_ataqv_ataqv_problem_reads { + + input = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true), + [], + [] + ] + + ATAQV_ATAQV_PROBLEM_READS ( input, 'human', [], [], [] ) +} + +workflow test_ataqv_ataqv_peak { + + input = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + [], + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + + ATAQV_ATAQV ( input, 'human', [], [], [] ) +} + +workflow test_ataqv_ataqv_tss { + + input = [ + [ id:'test', single_end:false ], + 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), + [] + ] + tss_file = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + + ATAQV_ATAQV ( input, 'human', tss_file, [], [] ) +} + +workflow test_ataqv_ataqv_excluded_regs { + + input = [ + [ id:'test', single_end:false ], + 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), + [] + ] + tss_file = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + excl_regs_file = file(params.test_data['sarscov2']['genome']['test2_bed'], checkIfExists: true) + + ATAQV_ATAQV ( input, 'human', tss_file, excl_regs_file, [] ) +} diff --git a/tests/modules/ataqv/ataqv/nextflow.config b/tests/modules/ataqv/ataqv/nextflow.config new file mode 100644 index 00000000..31700510 --- /dev/null +++ b/tests/modules/ataqv/ataqv/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: ATAQV_ATAQV_PROBLEM_READS { + ext.args = '--log-problematic-reads' + } + +} diff --git a/tests/modules/ataqv/ataqv/test.yml b/tests/modules/ataqv/ataqv/test.yml new file mode 100644 index 00000000..f9f2a888 --- /dev/null +++ b/tests/modules/ataqv/ataqv/test.yml @@ -0,0 +1,51 @@ +- name: ataqv ataqv test_ataqv_ataqv + command: nextflow run ./tests/modules/ataqv/ataqv -entry test_ataqv_ataqv -c ./tests/config/nextflow.config -c ./tests/modules/ataqv/ataqv/nextflow.config + tags: + - ataqv + - ataqv/ataqv + files: + - path: output/ataqv/test.ataqv.json + contains: + - '"forward_mate_reads": 101' + +- name: ataqv ataqv test_ataqv_ataqv_problem_reads + command: nextflow run ./tests/modules/ataqv/ataqv -entry test_ataqv_ataqv_problem_reads -c ./tests/config/nextflow.config -c ./tests/modules/ataqv/ataqv/nextflow.config + tags: + - ataqv + - ataqv/ataqv + files: + - path: output/ataqv/1.problems + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/ataqv/test.ataqv.json + contains: + - '"forward_mate_reads": 101' + +- name: ataqv ataqv test_ataqv_ataqv_peak + command: nextflow run ./tests/modules/ataqv/ataqv -entry test_ataqv_ataqv_peak -c ./tests/config/nextflow.config -c ./tests/modules/ataqv/ataqv/nextflow.config + tags: + - ataqv + - ataqv/ataqv + files: + - path: output/ataqv/test.ataqv.json + contains: + - '"forward_mate_reads": 101' + +- name: ataqv ataqv test_ataqv_ataqv_tss + command: nextflow run ./tests/modules/ataqv/ataqv -entry test_ataqv_ataqv_tss -c ./tests/config/nextflow.config -c ./tests/modules/ataqv/ataqv/nextflow.config + tags: + - ataqv + - ataqv/ataqv + files: + - path: output/ataqv/test.ataqv.json + contains: + - '"forward_mate_reads": 101' + +- name: ataqv ataqv test_ataqv_ataqv_excluded_regs + command: nextflow run ./tests/modules/ataqv/ataqv -entry test_ataqv_ataqv_excluded_regs -c ./tests/config/nextflow.config -c ./tests/modules/ataqv/ataqv/nextflow.config + tags: + - ataqv + - ataqv/ataqv + files: + - path: output/ataqv/test.ataqv.json + contains: + - '"forward_mate_reads": 101' diff --git a/tests/modules/bakta/main.nf b/tests/modules/bakta/main.nf new file mode 100644 index 00000000..1bc00622 --- /dev/null +++ b/tests/modules/bakta/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BAKTA } from '../../../modules/bakta/main.nf' + +workflow test_bakta { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + + BAKTA ( input, [], [], [] ) +} diff --git a/tests/modules/bakta/nextflow.config b/tests/modules/bakta/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bakta/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bakta/test.yml b/tests/modules/bakta/test.yml new file mode 100644 index 00000000..dcfc32bc --- /dev/null +++ b/tests/modules/bakta/test.yml @@ -0,0 +1,25 @@ +## TODO nf-core: Please run the following command to build this file: +# nf-core modules create-test-yml bakta +- name: bakta + command: nextflow run ./tests/modules/bakta -entry test_bakta -c tests/config/nextflow.config -stub-run + tags: + - bakta + files: + - path: output/bakta/test.embl + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/bakta/test.faa + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/bakta/test.ffn + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/bakta/test.fna + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/bakta/test.gbff + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/bakta/test.gff3 + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/bakta/test.hypotheticals.tsv + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/bakta/test.hypotheticals.faa + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/bakta/test.tsv + md5sum: d41d8cd98f00b204e9800998ecf8427e diff --git a/tests/modules/bamaligncleaner/main.nf b/tests/modules/bamaligncleaner/main.nf new file mode 100644 index 00000000..c9d517ae --- /dev/null +++ b/tests/modules/bamaligncleaner/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BAMALIGNCLEANER } from '../../../modules/bamaligncleaner/main.nf' + +workflow test_bamaligncleaner { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true) ] + + BAMALIGNCLEANER ( input ) +} diff --git a/tests/modules/bamaligncleaner/nextflow.config b/tests/modules/bamaligncleaner/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bamaligncleaner/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bamaligncleaner/test.yml b/tests/modules/bamaligncleaner/test.yml new file mode 100644 index 00000000..4207b8c2 --- /dev/null +++ b/tests/modules/bamaligncleaner/test.yml @@ -0,0 +1,7 @@ +- name: bamaligncleaner + command: nextflow run ./tests/modules/bamaligncleaner -entry test_bamaligncleaner -c ./tests/config/nextflow.config -c ./tests/modules/bamaligncleaner/nextflow.config + tags: + - bamaligncleaner + files: + - path: output/bamaligncleaner/test.bam + md5sum: 173cdb4c2713b77c528cac36ca2610fb diff --git a/tests/modules/bamtools/split/main.nf b/tests/modules/bamtools/split/main.nf new file mode 100644 index 00000000..eb0bed01 --- /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' + +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/nextflow.config b/tests/modules/bamtools/split/nextflow.config new file mode 100644 index 00000000..e7de5477 --- /dev/null +++ b/tests/modules/bamtools/split/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BAMTOOLS_SPLIT { + ext.args = '-reference' + } + +} diff --git a/tests/modules/bamtools/split/test.yml b/tests/modules/bamtools/split/test.yml new file mode 100644 index 00000000..4f52e9ce --- /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 -c ./tests/modules/bamtools/split/nextflow.config + tags: + - bamtools/split + - bamtools + files: + - path: output/bamtools/test.paired_end.sorted.REF_chr22.bam + md5sum: b7dc50e0edf9c6bfc2e3b0e6d074dc07 + - path: output/bamtools/test.paired_end.sorted.REF_unmapped.bam + md5sum: e0754bf72c51543b2d745d96537035fb diff --git a/tests/modules/bamutil/trimbam/main.nf b/tests/modules/bamutil/trimbam/main.nf new file mode 100644 index 00000000..2967b038 --- /dev/null +++ b/tests/modules/bamutil/trimbam/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BAMUTIL_TRIMBAM } from '../../../../modules/bamutil/trimbam/main.nf' + +workflow test_bamutil_trimbam { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true), + 2, + 2 ] + + BAMUTIL_TRIMBAM ( input ) +} diff --git a/tests/modules/bamutil/trimbam/nextflow.config b/tests/modules/bamutil/trimbam/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bamutil/trimbam/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bamutil/trimbam/test.yml b/tests/modules/bamutil/trimbam/test.yml new file mode 100644 index 00000000..443a4ded --- /dev/null +++ b/tests/modules/bamutil/trimbam/test.yml @@ -0,0 +1,8 @@ +- name: bamutil trimbam test_bamutil_trimbam + command: nextflow run ./tests/modules/bamutil/trimbam -entry test_bamutil_trimbam -c ./tests/config/nextflow.config -c ./tests/modules/bamutil/trimbam/nextflow.config + tags: + - bamutil/trimbam + - bamutil + files: + - path: output/bamutil/test.bam + md5sum: 9ddd0ecca82f7f3433383f3d1308970e diff --git a/tests/modules/bandage/image/main.nf b/tests/modules/bandage/image/main.nf index becfb450..15f01ab1 100644 --- a/tests/modules/bandage/image/main.nf +++ b/tests/modules/bandage/image/main.nf @@ -2,13 +2,13 @@ nextflow.enable.dsl = 2 -include { BANDAGE_IMAGE } from '../../../../modules/bandage/image/main.nf' addParams( options: [:] ) +include { BANDAGE_IMAGE } from '../../../../modules/bandage/image/main.nf' 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/bandage/image/nextflow.config b/tests/modules/bandage/image/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bandage/image/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bandage/image/test.yml b/tests/modules/bandage/image/test.yml index 437eca05..2abdd175 100644 --- a/tests/modules/bandage/image/test.yml +++ b/tests/modules/bandage/image/test.yml @@ -1,5 +1,5 @@ - name: bandage image - command: nextflow run ./tests/modules/bandage/image -entry test_bandage_image -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bandage/image -entry test_bandage_image -c ./tests/config/nextflow.config -c ./tests/modules/bandage/image/nextflow.config tags: - bandage - bandage/image diff --git a/tests/modules/bbmap/align/main.nf b/tests/modules/bbmap/align/main.nf new file mode 100644 index 00000000..c7a02e2a --- /dev/null +++ b/tests/modules/bbmap/align/main.nf @@ -0,0 +1,59 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BBMAP_INDEX } from '../../../../modules/bbmap/index/main.nf' +include { BBMAP_ALIGN } from '../../../../modules/bbmap/align/main.nf' +include { BBMAP_ALIGN as BBMAP_ALIGN_PIGZ } from '../../../../modules/bbmap/align/main.nf' + +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) + ] + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + BBMAP_ALIGN ( input, fasta ) +} + +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) + ] + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + BBMAP_INDEX ( fasta ) + BBMAP_ALIGN ( input, BBMAP_INDEX.out.index ) +} + +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) + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + BBMAP_INDEX ( fasta ) + BBMAP_ALIGN ( input, BBMAP_INDEX.out.index ) +} + +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) + ] + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + BBMAP_INDEX ( fasta ) + BBMAP_ALIGN_PIGZ ( input, BBMAP_INDEX.out.index ) +} diff --git a/tests/modules/bbmap/align/nextflow.config b/tests/modules/bbmap/align/nextflow.config new file mode 100644 index 00000000..fe0afd72 --- /dev/null +++ b/tests/modules/bbmap/align/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BBMAP_ALIGN_PIGZ { + ext.args = 'unpigz=t' + } + +} diff --git a/tests/modules/bbmap/align/test.yml b/tests/modules/bbmap/align/test.yml new file mode 100644 index 00000000..d9f9a862 --- /dev/null +++ b/tests/modules/bbmap/align/test.yml @@ -0,0 +1,39 @@ +- name: bbmap align paired end fasta ref + command: nextflow run ./tests/modules/bbmap/align -entry test_bbmap_align_paired_end_fasta_ref -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/align/nextflow.config + tags: + - bbmap + - bbmap/align + files: + - path: output/bbmap/test.bam + md5sum: e0ec7f1eec537acf146fac1cbdd868d1 + - path: output/bbmap/test.bbmap.log + +- name: bbmap align paired end index ref + command: nextflow run ./tests/modules/bbmap/align -entry test_bbmap_align_paired_end_index_ref -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/align/nextflow.config + tags: + - bbmap + - bbmap/align + files: + - path: output/bbmap/test.bam + md5sum: 345a72a0d58366d75dd263b107caa460 + - path: output/bbmap/test.bbmap.log + +- name: bbmap align single end index ref + command: nextflow run ./tests/modules/bbmap/align -entry test_bbmap_align_single_end_index_ref -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/align/nextflow.config + tags: + - bbmap + - bbmap/align + files: + - path: output/bbmap/test.bam + md5sum: 95f690636581ce9b27cf8568c715ae4d + - path: output/bbmap/test.bbmap.log + +- name: bbmap align paired end index ref pigz + command: nextflow run ./tests/modules/bbmap/align -entry test_bbmap_align_paired_end_index_ref_pigz -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/align/nextflow.config + tags: + - bbmap + - bbmap/align + files: + - path: output/bbmap/test.bam + md5sum: 441c4f196b9a82c7b224903538064308 + - path: output/bbmap/test.bbmap.log diff --git a/tests/modules/bbmap/bbduk/main.nf b/tests/modules/bbmap/bbduk/main.nf index 911ca391..e1f0c2de 100644 --- a/tests/modules/bbmap/bbduk/main.nf +++ b/tests/modules/bbmap/bbduk/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BBMAP_BBDUK } from '../../../../modules/bbmap/bbduk/main.nf' addParams( options: [ 'args' : 'trimq=10 qtrim=r', 'suffix' : '.trim' ] ) +include { BBMAP_BBDUK } from '../../../../modules/bbmap/bbduk/main.nf' workflow test_bbmap_bbduk_single_end { diff --git a/tests/modules/bbmap/bbduk/nextflow.config b/tests/modules/bbmap/bbduk/nextflow.config new file mode 100644 index 00000000..46fc33b4 --- /dev/null +++ b/tests/modules/bbmap/bbduk/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BBMAP_BBDUK { + ext.args = 'trimq=10 qtrim=r' + ext.prefix = { "${meta.id}.trim" } + } + +} diff --git a/tests/modules/bbmap/bbduk/test.yml b/tests/modules/bbmap/bbduk/test.yml index 4d2b8604..7ab5b963 100644 --- a/tests/modules/bbmap/bbduk/test.yml +++ b/tests/modules/bbmap/bbduk/test.yml @@ -1,5 +1,5 @@ - name: bbmap bbduk test_bbmap_bbduk_single_end - command: nextflow run tests/modules/bbmap/bbduk -entry test_bbmap_bbduk_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bbmap/bbduk -entry test_bbmap_bbduk_single_end -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/bbduk/nextflow.config tags: - bbmap/bbduk files: @@ -10,7 +10,7 @@ md5sum: a87d0cbd5ced7df8bf1751e4cb407482 - name: bbmap bbduk test_bbmap_bbduk_paired_end - command: nextflow run tests/modules/bbmap/bbduk -entry test_bbmap_bbduk_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bbmap/bbduk -entry test_bbmap_bbduk_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/bbduk/nextflow.config tags: - bbmap/bbduk files: @@ -23,7 +23,7 @@ md5sum: 406e068fbe198f02b48e7e210cc0c69f - name: bbmap bbduk test_bbmap_bbduk_se_ref - command: nextflow run tests/modules/bbmap/bbduk -entry test_bbmap_bbduk_se_ref -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bbmap/bbduk -entry test_bbmap_bbduk_se_ref -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/bbduk/nextflow.config tags: - bbmap/bbduk files: @@ -34,7 +34,7 @@ md5sum: 3970e82605c7d109bb348fc94e9eecc0 - name: bbmap bbduk test_bbmap_bbduk_pe_ref - command: nextflow run tests/modules/bbmap/bbduk -entry test_bbmap_bbduk_pe_ref -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bbmap/bbduk -entry test_bbmap_bbduk_pe_ref -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/bbduk/nextflow.config tags: - bbmap/bbduk files: diff --git a/tests/modules/bbmap/bbsplit/main.nf b/tests/modules/bbmap/bbsplit/main.nf new file mode 100644 index 00000000..d1236061 --- /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' +include { BBMAP_BBSPLIT as BBMAP_BBSPLIT_SPLIT } from '../../../../modules/bbmap/bbsplit/main.nf' + +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/nextflow.config b/tests/modules/bbmap/bbsplit/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bbmap/bbsplit/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bbmap/bbsplit/test.yml b/tests/modules/bbmap/bbsplit/test.yml new file mode 100644 index 00000000..add9b519 --- /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 -c ./tests/modules/bbmap/bbsplit/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 diff --git a/tests/modules/bbmap/index/main.nf b/tests/modules/bbmap/index/main.nf new file mode 100644 index 00000000..a6f111f4 --- /dev/null +++ b/tests/modules/bbmap/index/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BBMAP_INDEX } from '../../../../modules/bbmap/index/main.nf' + +workflow test_bbmap_index { + + input = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + + BBMAP_INDEX ( input ) +} diff --git a/tests/modules/bbmap/index/nextflow.config b/tests/modules/bbmap/index/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bbmap/index/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bbmap/index/test.yml b/tests/modules/bbmap/index/test.yml new file mode 100644 index 00000000..4e8d7196 --- /dev/null +++ b/tests/modules/bbmap/index/test.yml @@ -0,0 +1,9 @@ +- name: bbmap index + command: nextflow run ./tests/modules/bbmap/index -entry test_bbmap_index -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/index/nextflow.config + tags: + - bbmap + - bbmap/index + files: + - path: output/bbmap/ref/genome/1/chr1.chrom.gz + - path: output/bbmap/ref/index/1/chr1_index_k13_c15_b1.block + md5sum: 9f0d9a7413c1d2c16cc24555b2381163 diff --git a/tests/modules/bcftools/concat/main.nf b/tests/modules/bcftools/concat/main.nf new file mode 100644 index 00000000..8441d488 --- /dev/null +++ b/tests/modules/bcftools/concat/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BCFTOOLS_CONCAT } from '../../../../modules/bcftools/concat/main.nf' + +workflow test_bcftools_concat { + + input = [ [ id:'test3' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) ] + ] + + + BCFTOOLS_CONCAT ( input ) +} diff --git a/tests/modules/bcftools/concat/nextflow.config b/tests/modules/bcftools/concat/nextflow.config new file mode 100644 index 00000000..3f0d064a --- /dev/null +++ b/tests/modules/bcftools/concat/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BCFTOOLS_CONCAT { + ext.args = '--no-version' + } + +} diff --git a/tests/modules/bcftools/concat/test.yml b/tests/modules/bcftools/concat/test.yml new file mode 100644 index 00000000..fee6158f --- /dev/null +++ b/tests/modules/bcftools/concat/test.yml @@ -0,0 +1,8 @@ +- name: bcftools concat test_bcftools_concat + command: nextflow run ./tests/modules/bcftools/concat -entry test_bcftools_concat -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/concat/nextflow.config + tags: + - bcftools/concat + - bcftools + files: + - path: output/bcftools/test3.vcf.gz + md5sum: c400c7458524d889e0967b06ed72534f diff --git a/tests/modules/bcftools/consensus/main.nf b/tests/modules/bcftools/consensus/main.nf index 13f7b39e..ab00fbce 100644 --- a/tests/modules/bcftools/consensus/main.nf +++ b/tests/modules/bcftools/consensus/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BCFTOOLS_CONSENSUS } from '../../../../modules/bcftools/consensus/main.nf' addParams( options: [:] ) +include { BCFTOOLS_CONSENSUS } from '../../../../modules/bcftools/consensus/main.nf' workflow test_bcftools_consensus { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/bcftools/consensus/nextflow.config b/tests/modules/bcftools/consensus/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bcftools/consensus/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bcftools/consensus/test.yml b/tests/modules/bcftools/consensus/test.yml index b3760fcd..7fa4ecae 100644 --- a/tests/modules/bcftools/consensus/test.yml +++ b/tests/modules/bcftools/consensus/test.yml @@ -1,5 +1,5 @@ - name: bcftools consensus test_bcftools_consensus - command: nextflow run tests/modules/bcftools/consensus -entry test_bcftools_consensus -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bcftools/consensus -entry test_bcftools_consensus -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/consensus/nextflow.config tags: - bcftools/consensus - bcftools diff --git a/tests/modules/bcftools/filter/main.nf b/tests/modules/bcftools/filter/main.nf index bd419e3a..85fbf950 100644 --- a/tests/modules/bcftools/filter/main.nf +++ b/tests/modules/bcftools/filter/main.nf @@ -3,7 +3,7 @@ nextflow.enable.dsl = 2 //keep --no-verson argument, otherwise md5 will change on each execution -include { BCFTOOLS_FILTER } from '../../../../modules/bcftools/filter/main.nf' addParams( options: ['args': '--no-version'] ) +include { BCFTOOLS_FILTER } from '../../../../modules/bcftools/filter/main.nf' workflow test_bcftools_filter { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/bcftools/filter/nextflow.config b/tests/modules/bcftools/filter/nextflow.config new file mode 100644 index 00000000..68cac7bb --- /dev/null +++ b/tests/modules/bcftools/filter/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BCFTOOLS_FILTER { + ext.args = '--no-version' + } + +} diff --git a/tests/modules/bcftools/filter/test.yml b/tests/modules/bcftools/filter/test.yml index a998f441..da842538 100644 --- a/tests/modules/bcftools/filter/test.yml +++ b/tests/modules/bcftools/filter/test.yml @@ -1,8 +1,8 @@ - name: bcftools filter test_bcftools_filter - command: nextflow run tests/modules/bcftools/filter -entry test_bcftools_filter -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bcftools/filter -entry test_bcftools_filter -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/filter/nextflow.config tags: - bcftools/filter - bcftools files: - path: output/bcftools/test.vcf.gz - md5sum: 9d491cfa84067450342ba8e66c75e5b8 + md5sum: fc178eb342a91dc0d1d568601ad8f8e2 diff --git a/tests/modules/bcftools/index/main.nf b/tests/modules/bcftools/index/main.nf new file mode 100644 index 00000000..839cd988 --- /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' +include { BCFTOOLS_INDEX as BCFTOOLS_INDEX_TBI } from '../../../../modules/bcftools/index/main.nf' + + +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/nextflow.config b/tests/modules/bcftools/index/nextflow.config new file mode 100644 index 00000000..9a060ba2 --- /dev/null +++ b/tests/modules/bcftools/index/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BCFTOOLS_INDEX_TBI { + ext.args = '-t' + } + +} diff --git a/tests/modules/bcftools/index/test.yml b/tests/modules/bcftools/index/test.yml new file mode 100644 index 00000000..f1a29437 --- /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 -c ./tests/modules/bcftools/index/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 -c ./tests/modules/bcftools/index/nextflow.config + tags: + - bcftools + - bcftools/index + files: + - path: output/bcftools/test.vcf.gz.tbi + md5sum: 36e11bf96ed0af4a92caa91a68612d64 diff --git a/tests/modules/bcftools/isec/main.nf b/tests/modules/bcftools/isec/main.nf index 1b0c2c07..0b8ffc5c 100644 --- a/tests/modules/bcftools/isec/main.nf +++ b/tests/modules/bcftools/isec/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BCFTOOLS_ISEC } from '../../../../modules/bcftools/isec/main.nf' addParams( options: ['args': '--nfiles +2 --output-type z --no-version'] ) +include { BCFTOOLS_ISEC } from '../../../../modules/bcftools/isec/main.nf' workflow test_bcftools_isec { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/bcftools/isec/nextflow.config b/tests/modules/bcftools/isec/nextflow.config new file mode 100644 index 00000000..770e4674 --- /dev/null +++ b/tests/modules/bcftools/isec/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BCFTOOLS_ISEC { + ext.args = '--nfiles +2 --output-type z --no-version' + } + +} diff --git a/tests/modules/bcftools/isec/test.yml b/tests/modules/bcftools/isec/test.yml index 92186c89..fc887d9d 100644 --- a/tests/modules/bcftools/isec/test.yml +++ b/tests/modules/bcftools/isec/test.yml @@ -1,5 +1,5 @@ - name: bcftools isec test_bcftools_isec - command: nextflow run tests/modules/bcftools/isec -entry test_bcftools_isec -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bcftools/isec -entry test_bcftools_isec -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/isec/nextflow.config tags: - bcftools - bcftools/isec diff --git a/tests/modules/bcftools/merge/main.nf b/tests/modules/bcftools/merge/main.nf index a672a9a7..119e237a 100644 --- a/tests/modules/bcftools/merge/main.nf +++ b/tests/modules/bcftools/merge/main.nf @@ -3,7 +3,7 @@ nextflow.enable.dsl = 2 //keep --no-verson argument, otherwise md5 will change on each execution -include { BCFTOOLS_MERGE } from '../../../../modules/bcftools/merge/main.nf' addParams( options: ['args': '--force-samples --no-version'] ) +include { BCFTOOLS_MERGE } from '../../../../modules/bcftools/merge/main.nf' workflow test_bcftools_merge { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/bcftools/merge/nextflow.config b/tests/modules/bcftools/merge/nextflow.config new file mode 100644 index 00000000..e11e50b6 --- /dev/null +++ b/tests/modules/bcftools/merge/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BCFTOOLS_MERGE { + ext.args = '--force-samples --no-version' + } + +} diff --git a/tests/modules/bcftools/merge/test.yml b/tests/modules/bcftools/merge/test.yml index d3cdd74a..6c9dd556 100644 --- a/tests/modules/bcftools/merge/test.yml +++ b/tests/modules/bcftools/merge/test.yml @@ -1,5 +1,5 @@ - name: bcftools merge test_bcftools_merge - command: nextflow run tests/modules/bcftools/merge -entry test_bcftools_merge -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bcftools/merge -entry test_bcftools_merge -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/merge/nextflow.config tags: - bcftools/merge - bcftools diff --git a/tests/modules/bcftools/mpileup/main.nf b/tests/modules/bcftools/mpileup/main.nf index 2225c5e0..813ca408 100644 --- a/tests/modules/bcftools/mpileup/main.nf +++ b/tests/modules/bcftools/mpileup/main.nf @@ -2,8 +2,7 @@ nextflow.enable.dsl = 2 -include { BCFTOOLS_MPILEUP } from '../../../../modules/bcftools/mpileup/main.nf' addParams( options: ['args2': '--no-version --ploidy 1 --multiallelic-caller', - 'args3': '--no-version' ] ) +include { BCFTOOLS_MPILEUP } from '../../../../modules/bcftools/mpileup/main.nf' workflow test_bcftools_mpileup { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/bcftools/mpileup/nextflow.config b/tests/modules/bcftools/mpileup/nextflow.config new file mode 100644 index 00000000..c21fef8d --- /dev/null +++ b/tests/modules/bcftools/mpileup/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BCFTOOLS_MPILEUP { + ext.args2 = '--no-version --ploidy 1 --multiallelic-caller' + ext.args3 = '--no-version' + } + +} diff --git a/tests/modules/bcftools/mpileup/test.yml b/tests/modules/bcftools/mpileup/test.yml index c0c8d6a6..f081c543 100644 --- a/tests/modules/bcftools/mpileup/test.yml +++ b/tests/modules/bcftools/mpileup/test.yml @@ -1,12 +1,12 @@ - name: bcftools mpileup test_bcftools_mpileup - command: nextflow run tests/modules/bcftools/mpileup -entry test_bcftools_mpileup -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bcftools/mpileup -entry test_bcftools_mpileup -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/mpileup/nextflow.config tags: - bcftools/mpileup - bcftools files: - path: output/bcftools/test.bcftools_stats.txt - md5sum: 2d506e32837a53a01fea0fc90402632a + md5sum: 74863ef525eef8d87e3119146d281bcf - path: output/bcftools/test.vcf.gz.tbi - md5sum: 11d90b5b35e4adf6b44fc53bec93bed3 + md5sum: 0772419c5d819b4caa4aebfcad010c6e - path: output/bcftools/test.vcf.gz - md5sum: 2cf273a9fa3784383799b6b24df2f88c + md5sum: 9811674bb8da7ff30581319a910f2396 diff --git a/tests/modules/bcftools/norm/main.nf b/tests/modules/bcftools/norm/main.nf new file mode 100644 index 00000000..ac056bea --- /dev/null +++ b/tests/modules/bcftools/norm/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BCFTOOLS_NORM } from '../../../../modules/bcftools/norm/main.nf' + +workflow test_bcftools_norm { + + input = [ [ id:'test2', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true)] + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + BCFTOOLS_NORM ( input, fasta ) +} diff --git a/tests/modules/bcftools/norm/nextflow.config b/tests/modules/bcftools/norm/nextflow.config new file mode 100644 index 00000000..e4d27a73 --- /dev/null +++ b/tests/modules/bcftools/norm/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BCFTOOLS_NORM { + ext.args = '-m -any --no-version' + } + +} diff --git a/tests/modules/bcftools/norm/test.yml b/tests/modules/bcftools/norm/test.yml new file mode 100644 index 00000000..bb4f9aca --- /dev/null +++ b/tests/modules/bcftools/norm/test.yml @@ -0,0 +1,8 @@ +- name: bcftools norm + command: nextflow run ./tests/modules/bcftools/norm -entry test_bcftools_norm -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/norm/nextflow.config + tags: + - bcftools + - bcftools/norm + files: + - path: output/bcftools/test2.vcf.gz + md5sum: 2b1cac07d1875b8adcd7a85346890f07 diff --git a/tests/modules/bcftools/query/main.nf b/tests/modules/bcftools/query/main.nf new file mode 100644 index 00000000..733cae17 --- /dev/null +++ b/tests/modules/bcftools/query/main.nf @@ -0,0 +1,31 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BCFTOOLS_QUERY } from '../../../../modules/bcftools/query/main.nf' + +workflow test_bcftools_query { + + regions = [] + targets = [] + samples = [] + + input = [ [ id:'out' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] + + BCFTOOLS_QUERY ( input, regions, targets, samples ) +} + +workflow test_bcftools_query_with_optional_files { + + regions = file(params.test_data['sarscov2']['illumina']['test3_vcf_gz'], checkIfExists: true) + targets = file(params.test_data['sarscov2']['illumina']['test2_vcf_targets_tsv_gz'], checkIfExists: true) + samples = [] + + input = [ [ id:'out' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] + + BCFTOOLS_QUERY ( input, regions, targets, samples ) +} diff --git a/tests/modules/bcftools/query/nextflow.config b/tests/modules/bcftools/query/nextflow.config new file mode 100644 index 00000000..e4105006 --- /dev/null +++ b/tests/modules/bcftools/query/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BCFTOOLS_QUERY { + ext.args = "-f '%CHROM %POS %REF %ALT[%SAMPLE=%GT]'" + } + +} diff --git a/tests/modules/bcftools/query/test.yml b/tests/modules/bcftools/query/test.yml new file mode 100644 index 00000000..aaa9af7b --- /dev/null +++ b/tests/modules/bcftools/query/test.yml @@ -0,0 +1,17 @@ +- name: bcftools query + command: nextflow run ./tests/modules/bcftools/query -entry test_bcftools_query -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/query/nextflow.config + tags: + - bcftools + - bcftools/query + files: + - path: output/bcftools/out.vcf.gz + md5sum: c32a6d28f185822d8fe1eeb7e42ec155 + +- name: bcftools query with optional files + command: nextflow run ./tests/modules/bcftools/query -entry test_bcftools_query_with_optional_files -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/query/nextflow.config + tags: + - bcftools + - bcftools/query + files: + - path: output/bcftools/out.vcf.gz + md5sum: 6bb5df49bfb5af39f7037cdf95032aac diff --git a/tests/modules/bcftools/reheader/main.nf b/tests/modules/bcftools/reheader/main.nf new file mode 100644 index 00000000..d1dcd8b8 --- /dev/null +++ b/tests/modules/bcftools/reheader/main.nf @@ -0,0 +1,40 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BCFTOOLS_REHEADER } from '../../../../modules/bcftools/reheader/main.nf' + +workflow test_bcftools_reheader_update_sequences { + + input = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) + ] + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + header = [] + BCFTOOLS_REHEADER ( input, fai, header ) +} + +workflow test_bcftools_reheader_new_header { + + input = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) + ] + fai = [] + header = file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) + + BCFTOOLS_REHEADER ( input, fai, header ) +} + +workflow test_bcftools_reheader_new_header_update_sequences { + + input = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) + ] + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + header = file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) + + BCFTOOLS_REHEADER ( input, fai, header ) +} diff --git a/tests/modules/bcftools/reheader/nextflow.config b/tests/modules/bcftools/reheader/nextflow.config new file mode 100644 index 00000000..55d2cff8 --- /dev/null +++ b/tests/modules/bcftools/reheader/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BCFTOOLS_REHEADER { + ext.prefix = { "${meta.id}.updated" } + } + +} diff --git a/tests/modules/bcftools/reheader/test.yml b/tests/modules/bcftools/reheader/test.yml new file mode 100644 index 00000000..1ce0b104 --- /dev/null +++ b/tests/modules/bcftools/reheader/test.yml @@ -0,0 +1,26 @@ +- name: bcftools reheader test_bcftools_reheader_update_sequences + command: nextflow run ./tests/modules/bcftools/reheader -entry test_bcftools_reheader_update_sequences -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/reheader/nextflow.config + tags: + - bcftools/reheader + - bcftools + files: + - path: output/bcftools/test.updated.vcf.gz + md5sum: 9e29f28038bfce77ee00022627209ed6 + +- name: bcftools reheader test_bcftools_reheader_new_header + command: nextflow run ./tests/modules/bcftools/reheader -entry test_bcftools_reheader_new_header -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/reheader/nextflow.config + tags: + - bcftools/reheader + - bcftools + files: + - path: output/bcftools/test.updated.vcf.gz + md5sum: f7f536d889bbf5be40243252c394ee1f + +- name: bcftools reheader test_bcftools_reheader_new_header_update_sequences + command: nextflow run ./tests/modules/bcftools/reheader -entry test_bcftools_reheader_new_header_update_sequences -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/reheader/nextflow.config + tags: + - bcftools/reheader + - bcftools + files: + - path: output/bcftools/test.updated.vcf.gz + md5sum: 9e29f28038bfce77ee00022627209ed6 diff --git a/tests/modules/bcftools/stats/main.nf b/tests/modules/bcftools/stats/main.nf index 4039c080..808a3330 100644 --- a/tests/modules/bcftools/stats/main.nf +++ b/tests/modules/bcftools/stats/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BCFTOOLS_STATS } from '../../../../modules/bcftools/stats/main.nf' addParams( options: [:] ) +include { BCFTOOLS_STATS } from '../../../../modules/bcftools/stats/main.nf' workflow test_bcftools_stats { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/bcftools/stats/nextflow.config b/tests/modules/bcftools/stats/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bcftools/stats/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bcftools/stats/test.yml b/tests/modules/bcftools/stats/test.yml index f863bfca..d3587f95 100644 --- a/tests/modules/bcftools/stats/test.yml +++ b/tests/modules/bcftools/stats/test.yml @@ -1,8 +1,8 @@ - name: bcftools stats test_bcftools_stats - command: nextflow run tests/modules/bcftools/stats -entry test_bcftools_stats -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bcftools/stats -entry test_bcftools_stats -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/stats/nextflow.config tags: - bcftools - bcftools/stats files: - path: output/bcftools/test.bcftools_stats.txt - md5sum: c4c5938add12a20050eec3782c8ad623 + md5sum: d3543531396cf7012f13ebdce639cbc8 diff --git a/tests/modules/bcftools/view/main.nf b/tests/modules/bcftools/view/main.nf new file mode 100644 index 00000000..f45d0284 --- /dev/null +++ b/tests/modules/bcftools/view/main.nf @@ -0,0 +1,31 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BCFTOOLS_VIEW } from '../../../../modules/bcftools/view/main.nf' + +workflow test_bcftools_view { + + regions = [] + targets = [] + samples = [] + + input = [[ id:'out', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)] + + BCFTOOLS_VIEW ( input, regions, targets, samples ) +} + +workflow test_bcftools_view_with_optional_files { + + regions = file(params.test_data['sarscov2']['illumina']['test3_vcf_gz'], checkIfExists: true) + targets = file(params.test_data['sarscov2']['illumina']['test2_vcf_targets_tsv_gz'], checkIfExists: true) + samples = [] + + input = [[ id:'out', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true)] + + BCFTOOLS_VIEW ( input, regions, targets, samples ) +} diff --git a/tests/modules/bcftools/view/nextflow.config b/tests/modules/bcftools/view/nextflow.config new file mode 100644 index 00000000..e1723b89 --- /dev/null +++ b/tests/modules/bcftools/view/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BCFTOOLS_VIEW { + ext.args = '--no-version' + } + +} diff --git a/tests/modules/bcftools/view/test.yml b/tests/modules/bcftools/view/test.yml new file mode 100644 index 00000000..fa926dd6 --- /dev/null +++ b/tests/modules/bcftools/view/test.yml @@ -0,0 +1,17 @@ +- name: bcftools view + command: nextflow run ./tests/modules/bcftools/view -entry test_bcftools_view -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/view/nextflow.config + tags: + - bcftools + - bcftools/view + files: + - path: output/bcftools/out.vcf.gz + md5sum: fc178eb342a91dc0d1d568601ad8f8e2 + +- name: bcftools view with optional files + command: nextflow run ./tests/modules/bcftools/view -entry test_bcftools_view_with_optional_files -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/view/nextflow.config + tags: + - bcftools + - bcftools/view + files: + - path: output/bcftools/out.vcf.gz + md5sum: 1d450e1c65b081ead0edbf5e4fa539ee diff --git a/tests/modules/bedtools/bamtobed/main.nf b/tests/modules/bedtools/bamtobed/main.nf index 41cf460a..e7635a3d 100644 --- a/tests/modules/bedtools/bamtobed/main.nf +++ b/tests/modules/bedtools/bamtobed/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BEDTOOLS_BAMTOBED } from '../../../../modules/bedtools/bamtobed/main.nf' addParams( options: [:] ) +include { BEDTOOLS_BAMTOBED } from '../../../../modules/bedtools/bamtobed/main.nf' workflow test_bedtools_bamtobed { input = [ [ id:'test'], //meta map diff --git a/tests/modules/bedtools/bamtobed/nextflow.config b/tests/modules/bedtools/bamtobed/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bedtools/bamtobed/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bedtools/bamtobed/test.yml b/tests/modules/bedtools/bamtobed/test.yml index 106d125d..b038467c 100644 --- a/tests/modules/bedtools/bamtobed/test.yml +++ b/tests/modules/bedtools/bamtobed/test.yml @@ -1,5 +1,5 @@ - name: bedtools bamtobed - command: nextflow run ./tests/modules/bedtools/bamtobed -entry test_bedtools_bamtobed -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bedtools/bamtobed -entry test_bedtools_bamtobed -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/bamtobed/nextflow.config tags: - bedtools - bedtools/bamtobed diff --git a/tests/modules/bedtools/complement/main.nf b/tests/modules/bedtools/complement/main.nf index 6456fe60..a1cca033 100644 --- a/tests/modules/bedtools/complement/main.nf +++ b/tests/modules/bedtools/complement/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BEDTOOLS_COMPLEMENT } from '../../../../modules/bedtools/complement/main.nf' addParams( options: [suffix: '_out'] ) +include { BEDTOOLS_COMPLEMENT } from '../../../../modules/bedtools/complement/main.nf' workflow test_bedtools_complement { input = [ [ id:'test'], diff --git a/tests/modules/bedtools/complement/nextflow.config b/tests/modules/bedtools/complement/nextflow.config new file mode 100644 index 00000000..cb867120 --- /dev/null +++ b/tests/modules/bedtools/complement/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BEDTOOLS_COMPLEMENT { + ext.prefix = { "${meta.id}_out" } + } + +} diff --git a/tests/modules/bedtools/complement/test.yml b/tests/modules/bedtools/complement/test.yml index 2ebc6419..9dbeb36f 100644 --- a/tests/modules/bedtools/complement/test.yml +++ b/tests/modules/bedtools/complement/test.yml @@ -1,5 +1,5 @@ - name: bedtools complement - command: nextflow run ./tests/modules/bedtools/complement -entry test_bedtools_complement -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bedtools/complement -entry test_bedtools_complement -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/complement/nextflow.config tags: - bedtools - bedtools/complement diff --git a/tests/modules/bedtools/genomecov/main.nf b/tests/modules/bedtools/genomecov/main.nf index 431a42bd..b507a2cd 100644 --- a/tests/modules/bedtools/genomecov/main.nf +++ b/tests/modules/bedtools/genomecov/main.nf @@ -2,12 +2,39 @@ nextflow.enable.dsl = 2 -include { BEDTOOLS_GENOMECOV } from '../../../../modules/bedtools/genomecov/main.nf' addParams( options: [suffix: '_out'] ) +include { BEDTOOLS_GENOMECOV } from '../../../../modules/bedtools/genomecov/main.nf' -workflow test_bedtools_genomecov { +workflow test_bedtools_genomecov_noscale { input = [ [ id:'test'], - file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true), + 1 + ] + + sizes = [] + extension = 'txt' + + BEDTOOLS_GENOMECOV ( input, sizes, extension ) +} + +workflow test_bedtools_genomecov_nonbam_noscale { + input = [ + [ id:'test'], + file(params.test_data['sarscov2']['genome']['baits_bed'], checkIfExists: true), + 1 + ] + + sizes = file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true) + extension = 'txt' + + BEDTOOLS_GENOMECOV ( input, sizes, extension ) +} + +workflow test_bedtools_genomecov_scale { + input = [ + [ id:'test'], + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true), + 0.5 ] sizes = file('dummy_chromosome_sizes') @@ -16,10 +43,11 @@ workflow test_bedtools_genomecov { BEDTOOLS_GENOMECOV ( input, sizes, extension ) } -workflow test_bedtools_genomecov_nonbam { +workflow test_bedtools_genomecov_nonbam_scale { input = [ [ id:'test'], - file(params.test_data['sarscov2']['genome']['baits_bed'], checkIfExists: true) + file(params.test_data['sarscov2']['genome']['baits_bed'], checkIfExists: true), + 0.5 ] sizes = file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true) diff --git a/tests/modules/bedtools/genomecov/nextflow.config b/tests/modules/bedtools/genomecov/nextflow.config new file mode 100644 index 00000000..6e1c03e2 --- /dev/null +++ b/tests/modules/bedtools/genomecov/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BEDTOOLS_GENOMECOV { + ext.prefix = { "${meta.id}_out" } + } + +} diff --git a/tests/modules/bedtools/genomecov/test.yml b/tests/modules/bedtools/genomecov/test.yml index c1f2080a..8f63bde9 100644 --- a/tests/modules/bedtools/genomecov/test.yml +++ b/tests/modules/bedtools/genomecov/test.yml @@ -1,5 +1,5 @@ -- name: bedtools genomecov test_bedtools_genomecov - command: nextflow run ./tests/modules/bedtools/genomecov -entry test_bedtools_genomecov -c tests/config/nextflow.config +- name: bedtools genomecov test_bedtools_genomecov_noscale + command: nextflow run ./tests/modules/bedtools/genomecov -entry test_bedtools_genomecov_noscale -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/genomecov/nextflow.config tags: - bedtools - bedtools/genomecov @@ -7,11 +7,29 @@ - path: output/bedtools/test_out.txt md5sum: 66083198daca6c001d328ba9616e9b53 -- name: bedtools genomecov test_bedtools_genomecov_nonbam - command: nextflow run tests/modules/bedtools/genomecov -entry test_bedtools_genomecov_nonbam -c tests/config/nextflow.config +- name: bedtools genomecov test_bedtools_genomecov_nonbam_noscale + command: nextflow run ./tests/modules/bedtools/genomecov -entry test_bedtools_genomecov_nonbam_noscale -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/genomecov/nextflow.config tags: - bedtools - bedtools/genomecov files: - path: output/bedtools/test_out.txt md5sum: f47b58840087426e5b643d8dfd155c1f + +- name: bedtools genomecov test_bedtools_genomecov_scale + command: nextflow run ./tests/modules/bedtools/genomecov -entry test_bedtools_genomecov_scale -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/genomecov/nextflow.config + tags: + - bedtools + - bedtools/genomecov + files: + - path: output/bedtools/test_out.txt + md5sum: 01291b6e1beab72e046653e709eb0e10 + +- name: bedtools genomecov test_bedtools_genomecov_nonbam_scale + command: nextflow run ./tests/modules/bedtools/genomecov -entry test_bedtools_genomecov_nonbam_scale -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/genomecov/nextflow.config + tags: + - bedtools + - bedtools/genomecov + files: + - path: output/bedtools/test_out.txt + md5sum: de3c59c0ea123bcdbbad27bc0a0a601e diff --git a/tests/modules/bedtools/getfasta/main.nf b/tests/modules/bedtools/getfasta/main.nf index 194597ae..425c49d5 100644 --- a/tests/modules/bedtools/getfasta/main.nf +++ b/tests/modules/bedtools/getfasta/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BEDTOOLS_GETFASTA } from '../../../../modules/bedtools/getfasta/main.nf' addParams( options: [:] ) +include { BEDTOOLS_GETFASTA } from '../../../../modules/bedtools/getfasta/main.nf' workflow test_bedtools_getfasta { bed = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) diff --git a/tests/modules/bedtools/getfasta/nextflow.config b/tests/modules/bedtools/getfasta/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bedtools/getfasta/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bedtools/getfasta/test.yml b/tests/modules/bedtools/getfasta/test.yml index adf10da5..a455f861 100644 --- a/tests/modules/bedtools/getfasta/test.yml +++ b/tests/modules/bedtools/getfasta/test.yml @@ -1,5 +1,5 @@ - name: bedtools getfasta - command: nextflow run ./tests/modules/bedtools/getfasta -entry test_bedtools_getfasta -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bedtools/getfasta -entry test_bedtools_getfasta -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/getfasta/nextflow.config tags: - bedtools - bedtools/getfasta diff --git a/tests/modules/bedtools/intersect/main.nf b/tests/modules/bedtools/intersect/main.nf index 73a9b30c..c17d03e6 100644 --- a/tests/modules/bedtools/intersect/main.nf +++ b/tests/modules/bedtools/intersect/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BEDTOOLS_INTERSECT } from '../../../../modules/bedtools/intersect/main.nf' addParams( options: [suffix: '_out'] ) +include { BEDTOOLS_INTERSECT } from '../../../../modules/bedtools/intersect/main.nf' workflow test_bedtools_intersect { input = [ diff --git a/tests/modules/bedtools/intersect/nextflow.config b/tests/modules/bedtools/intersect/nextflow.config new file mode 100644 index 00000000..3aa2593f --- /dev/null +++ b/tests/modules/bedtools/intersect/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BEDTOOLS_INTERSECT { + ext.prefix = { "${meta.id}_out" } + } + +} diff --git a/tests/modules/bedtools/intersect/test.yml b/tests/modules/bedtools/intersect/test.yml index c8c3ad6e..86fe70cd 100644 --- a/tests/modules/bedtools/intersect/test.yml +++ b/tests/modules/bedtools/intersect/test.yml @@ -1,5 +1,5 @@ - name: bedtools intersect test_bedtools_intersect - command: nextflow run ./tests/modules/bedtools/intersect -entry test_bedtools_intersect -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bedtools/intersect -entry test_bedtools_intersect -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/intersect/nextflow.config tags: - bedtools - bedtools/intersect @@ -8,7 +8,7 @@ md5sum: afcbf01c2f2013aad71dbe8e34f2c15c - name: bedtools intersect test_bedtools_intersect_bam - command: nextflow run tests/modules/bedtools/intersect -entry test_bedtools_intersect_bam -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bedtools/intersect -entry test_bedtools_intersect_bam -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/intersect/nextflow.config tags: - bedtools - bedtools/intersect diff --git a/tests/modules/bedtools/makewindows/main.nf b/tests/modules/bedtools/makewindows/main.nf new file mode 100644 index 00000000..ce37de72 --- /dev/null +++ b/tests/modules/bedtools/makewindows/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BEDTOOLS_MAKEWINDOWS } from '../../../../modules/bedtools/makewindows/main.nf' + +workflow test_bedtools_makewindows { + + input = [ + [ id:'test'], + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + + BEDTOOLS_MAKEWINDOWS ( input, true ) +} diff --git a/tests/modules/bedtools/makewindows/nextflow.config b/tests/modules/bedtools/makewindows/nextflow.config new file mode 100644 index 00000000..e8b8c3ea --- /dev/null +++ b/tests/modules/bedtools/makewindows/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BEDTOOLS_MAKEWINDOWS { + ext.args = '-w 50 ' + } + +} diff --git a/tests/modules/bedtools/makewindows/test.yml b/tests/modules/bedtools/makewindows/test.yml new file mode 100644 index 00000000..8accaa36 --- /dev/null +++ b/tests/modules/bedtools/makewindows/test.yml @@ -0,0 +1,8 @@ +- name: bedtools makewindows test_bedtools_makewindows + command: nextflow run ./tests/modules/bedtools/makewindows -entry test_bedtools_makewindows -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/makewindows/nextflow.config + tags: + - bedtools/makewindows + - bedtools + files: + - path: output/bedtools/test.tab + md5sum: 0cf6ed2b6f470cd44a247da74ca4fe4e diff --git a/tests/modules/bedtools/maskfasta/main.nf b/tests/modules/bedtools/maskfasta/main.nf index 8c30fbdc..0da02ad3 100644 --- a/tests/modules/bedtools/maskfasta/main.nf +++ b/tests/modules/bedtools/maskfasta/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BEDTOOLS_MASKFASTA } from '../../../../modules/bedtools/maskfasta/main.nf' addParams( options: [:] ) +include { BEDTOOLS_MASKFASTA } from '../../../../modules/bedtools/maskfasta/main.nf' workflow test_bedtools_maskfasta { bed = [ [ id:'test'], diff --git a/tests/modules/bedtools/maskfasta/nextflow.config b/tests/modules/bedtools/maskfasta/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bedtools/maskfasta/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bedtools/maskfasta/test.yml b/tests/modules/bedtools/maskfasta/test.yml index f536a6eb..f1e8f35a 100644 --- a/tests/modules/bedtools/maskfasta/test.yml +++ b/tests/modules/bedtools/maskfasta/test.yml @@ -1,5 +1,5 @@ - name: bedtools maskfasta - command: nextflow run ./tests/modules/bedtools/maskfasta -entry test_bedtools_maskfasta -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bedtools/maskfasta -entry test_bedtools_maskfasta -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/maskfasta/nextflow.config tags: - bedtools - bedtools/maskfasta diff --git a/tests/modules/bedtools/merge/main.nf b/tests/modules/bedtools/merge/main.nf index f11b804a..5fca0526 100644 --- a/tests/modules/bedtools/merge/main.nf +++ b/tests/modules/bedtools/merge/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BEDTOOLS_MERGE } from '../../../../modules/bedtools/merge/main.nf' addParams( options: [suffix: '_out'] ) +include { BEDTOOLS_MERGE } from '../../../../modules/bedtools/merge/main.nf' workflow test_bedtools_merge { input = [ [ id:'test'], diff --git a/tests/modules/bedtools/merge/nextflow.config b/tests/modules/bedtools/merge/nextflow.config new file mode 100644 index 00000000..545a523d --- /dev/null +++ b/tests/modules/bedtools/merge/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BEDTOOLS_MERGE { + ext.prefix = { "${meta.id}_out" } + } + +} diff --git a/tests/modules/bedtools/merge/test.yml b/tests/modules/bedtools/merge/test.yml index 62bc6860..5fc8b034 100644 --- a/tests/modules/bedtools/merge/test.yml +++ b/tests/modules/bedtools/merge/test.yml @@ -1,5 +1,5 @@ - name: bedtools merge - command: nextflow run ./tests/modules/bedtools/merge -entry test_bedtools_merge -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bedtools/merge -entry test_bedtools_merge -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/merge/nextflow.config tags: - bedtools - bedtools/merge diff --git a/tests/modules/bedtools/slop/main.nf b/tests/modules/bedtools/slop/main.nf index 47c19781..e7136fdc 100644 --- a/tests/modules/bedtools/slop/main.nf +++ b/tests/modules/bedtools/slop/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BEDTOOLS_SLOP } from '../../../../modules/bedtools/slop/main.nf' addParams( options: [args: '-l 15 -r 30', suffix: '_out'] ) +include { BEDTOOLS_SLOP } from '../../../../modules/bedtools/slop/main.nf' workflow test_bedtools_slop { input = [ [ id:'test'], diff --git a/tests/modules/bedtools/slop/nextflow.config b/tests/modules/bedtools/slop/nextflow.config new file mode 100644 index 00000000..09abb51a --- /dev/null +++ b/tests/modules/bedtools/slop/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BEDTOOLS_SLOP { + ext.args = '-l 15 -r 30' + ext.prefix = { "${meta.id}_out" } + } + +} diff --git a/tests/modules/bedtools/slop/test.yml b/tests/modules/bedtools/slop/test.yml index 859b569e..0d49e66b 100644 --- a/tests/modules/bedtools/slop/test.yml +++ b/tests/modules/bedtools/slop/test.yml @@ -1,5 +1,5 @@ - name: bedtools slop - command: nextflow run ./tests/modules/bedtools/slop -entry test_bedtools_slop -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bedtools/slop -entry test_bedtools_slop -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/slop/nextflow.config tags: - bedtools - bedtools/slop diff --git a/tests/modules/bedtools/sort/main.nf b/tests/modules/bedtools/sort/main.nf index ad1a3df4..342b4116 100644 --- a/tests/modules/bedtools/sort/main.nf +++ b/tests/modules/bedtools/sort/main.nf @@ -2,12 +2,12 @@ nextflow.enable.dsl = 2 -include { BEDTOOLS_SORT } from '../../../../modules/bedtools/sort/main.nf' addParams( options: [suffix: '_out'] ) +include { BEDTOOLS_SORT } from '../../../../modules/bedtools/sort/main.nf' workflow test_bedtools_sort { input = [ [ id:'test'], file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ] - BEDTOOLS_SORT ( input ) + BEDTOOLS_SORT ( input, "testext" ) } diff --git a/tests/modules/bedtools/sort/nextflow.config b/tests/modules/bedtools/sort/nextflow.config new file mode 100644 index 00000000..2ecc295a --- /dev/null +++ b/tests/modules/bedtools/sort/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BEDTOOLS_SORT { + ext.prefix = { "${meta.id}_out" } + } + +} diff --git a/tests/modules/bedtools/sort/test.yml b/tests/modules/bedtools/sort/test.yml index ceb25f7d..173f0587 100644 --- a/tests/modules/bedtools/sort/test.yml +++ b/tests/modules/bedtools/sort/test.yml @@ -1,8 +1,8 @@ - name: bedtools sort - command: nextflow run ./tests/modules/bedtools/sort -entry test_bedtools_sort -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bedtools/sort -entry test_bedtools_sort -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/sort/nextflow.config tags: - bedtools - bedtools/sort files: - - path: ./output/bedtools/test_out.bed + - path: ./output/bedtools/test_out.testext md5sum: fe4053cf4de3aebbdfc3be2efb125a74 diff --git a/tests/modules/bedtools/subtract/main.nf b/tests/modules/bedtools/subtract/main.nf index 9997f08c..2a0e6eab 100644 --- a/tests/modules/bedtools/subtract/main.nf +++ b/tests/modules/bedtools/subtract/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BEDTOOLS_SUBTRACT } from '../../../../modules/bedtools/subtract/main.nf' addParams( options: [:] ) +include { BEDTOOLS_SUBTRACT } from '../../../../modules/bedtools/subtract/main.nf' workflow test_bedtools_subtract { input = [ diff --git a/tests/modules/bedtools/subtract/nextflow.config b/tests/modules/bedtools/subtract/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bedtools/subtract/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bedtools/subtract/test.yml b/tests/modules/bedtools/subtract/test.yml index fd8660fc..52b57436 100644 --- a/tests/modules/bedtools/subtract/test.yml +++ b/tests/modules/bedtools/subtract/test.yml @@ -1,5 +1,5 @@ - name: bedtools subtract - command: nextflow run ./tests/modules/bedtools/subtract -entry test_bedtools_subtract -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bedtools/subtract -entry test_bedtools_subtract -c ./tests/config/nextflow.config -c ./tests/modules/bedtools/subtract/nextflow.config tags: - bedtools - bedtools/subtract diff --git a/tests/modules/bismark/align/main.nf b/tests/modules/bismark/align/main.nf index 1f1fcdce..fe6d616a 100644 --- a/tests/modules/bismark/align/main.nf +++ b/tests/modules/bismark/align/main.nf @@ -2,9 +2,9 @@ nextflow.enable.dsl = 2 -include { BISMARK_GENOMEPREPARATION } from '../../../../modules/bismark/genomepreparation/main.nf' addParams( options: [:] ) -include { BISMARK_ALIGN as BISMARK_ALIGN_SE } from '../../../../modules/bismark/align/main.nf' addParams( options: [ publish_dir:'test_single_end' ] ) -include { BISMARK_ALIGN as BISMARK_ALIGN_PE } from '../../../../modules/bismark/align/main.nf' addParams( options: [ publish_dir:'test_paired_end' ] ) +include { BISMARK_GENOMEPREPARATION } from '../../../../modules/bismark/genomepreparation/main.nf' +include { BISMARK_ALIGN as BISMARK_ALIGN_SE } from '../../../../modules/bismark/align/main.nf' +include { BISMARK_ALIGN as BISMARK_ALIGN_PE } from '../../../../modules/bismark/align/main.nf' // // Test with single-end data diff --git a/tests/modules/bismark/align/nextflow.config b/tests/modules/bismark/align/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bismark/align/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bismark/align/test.yml b/tests/modules/bismark/align/test.yml index 662a4aef..ffae05af 100644 --- a/tests/modules/bismark/align/test.yml +++ b/tests/modules/bismark/align/test.yml @@ -1,19 +1,19 @@ -- name: Run bismark align single-end test workflow - command: nextflow run ./tests/modules/bismark/align -entry test_bismark_align_single_end -c tests/config/nextflow.config +- 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 -c ./tests/modules/bismark/align/nextflow.config tags: - bismark - bismark/align files: - - path: output/test_single_end/test.methylated_1_bismark_bt2.bam + - path: output/bismark/test.methylated_1_bismark_bt2.bam md5sum: dca4ba9ff705b70446f812e59bdb1a32 - - path: output/test_single_end/test.methylated_1_bismark_bt2_SE_report.txt + - path: output/bismark/test.methylated_1_bismark_bt2_SE_report.txt -- name: Run bismark align paired-end test workflow - command: nextflow run ./tests/modules/bismark/align -entry test_bismark_align_paired_end -c tests/config/nextflow.config +- 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 -c ./tests/modules/bismark/align/nextflow.config tags: - bismark - bismark/align files: - - path: output/test_paired_end/test.methylated_1_bismark_bt2_pe.bam + - path: output/bismark/test.methylated_1_bismark_bt2_pe.bam md5sum: 43943b1f30d056fcbd9ed26061ea0583 - - path: output/test_paired_end/test.methylated_1_bismark_bt2_PE_report.txt + - path: output/bismark/test.methylated_1_bismark_bt2_PE_report.txt diff --git a/tests/modules/bismark/deduplicate/main.nf b/tests/modules/bismark/deduplicate/main.nf index fc44745c..ad97d66a 100644 --- a/tests/modules/bismark/deduplicate/main.nf +++ b/tests/modules/bismark/deduplicate/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BISMARK_DEDUPLICATE } from '../../../../modules/bismark/deduplicate/main.nf' addParams( options: [:] ) +include { BISMARK_DEDUPLICATE } from '../../../../modules/bismark/deduplicate/main.nf' workflow test_bismark_deduplicate { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/bismark/deduplicate/nextflow.config b/tests/modules/bismark/deduplicate/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bismark/deduplicate/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bismark/deduplicate/test.yml b/tests/modules/bismark/deduplicate/test.yml index b0fb858c..12099750 100644 --- a/tests/modules/bismark/deduplicate/test.yml +++ b/tests/modules/bismark/deduplicate/test.yml @@ -1,5 +1,5 @@ -- name: Run bismark deduplicate test workflow - command: nextflow run ./tests/modules/bismark/deduplicate -entry test_bismark_deduplicate -c tests/config/nextflow.config +- name: bismark deduplicate test workflow + command: nextflow run ./tests/modules/bismark/deduplicate -entry test_bismark_deduplicate -c ./tests/config/nextflow.config -c ./tests/modules/bismark/deduplicate/nextflow.config tags: - bismark - bismark/deduplicate diff --git a/tests/modules/bismark/genomepreparation/main.nf b/tests/modules/bismark/genomepreparation/main.nf index ab847171..a9111af3 100644 --- a/tests/modules/bismark/genomepreparation/main.nf +++ b/tests/modules/bismark/genomepreparation/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BISMARK_GENOMEPREPARATION } from '../../../../modules/bismark/genomepreparation/main.nf' addParams( options: [:] ) +include { BISMARK_GENOMEPREPARATION } from '../../../../modules/bismark/genomepreparation/main.nf' workflow test_bismark_genomepreparation { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bismark/genomepreparation/nextflow.config b/tests/modules/bismark/genomepreparation/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bismark/genomepreparation/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bismark/genomepreparation/test.yml b/tests/modules/bismark/genomepreparation/test.yml index 5ce272c6..a0d3c072 100644 --- a/tests/modules/bismark/genomepreparation/test.yml +++ b/tests/modules/bismark/genomepreparation/test.yml @@ -1,5 +1,5 @@ -- name: Run bismark_genomepreparation test workflow - command: nextflow run ./tests/modules/bismark/genomepreparation -entry test_bismark_genomepreparation -c tests/config/nextflow.config +- name: bismark genomepreparation test workflow + command: nextflow run ./tests/modules/bismark/genomepreparation -entry test_bismark_genomepreparation -c ./tests/config/nextflow.config -c ./tests/modules/bismark/genomepreparation/nextflow.config tags: - bismark - bismark/genomepreparation diff --git a/tests/modules/bismark/methylationextractor/main.nf b/tests/modules/bismark/methylationextractor/main.nf index 0b3f77a1..ed857fe8 100644 --- a/tests/modules/bismark/methylationextractor/main.nf +++ b/tests/modules/bismark/methylationextractor/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { BISMARK_GENOMEPREPARATION } from '../../../../modules/bismark/genomepreparation/main.nf' addParams( options: [:] ) -include { BISMARK_METHYLATIONEXTRACTOR } from '../../../../modules/bismark/methylationextractor/main.nf' addParams( options: [:] ) +include { BISMARK_GENOMEPREPARATION } from '../../../../modules/bismark/genomepreparation/main.nf' +include { BISMARK_METHYLATIONEXTRACTOR } from '../../../../modules/bismark/methylationextractor/main.nf' workflow test_bismark_methylationextractor { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/bismark/methylationextractor/nextflow.config b/tests/modules/bismark/methylationextractor/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bismark/methylationextractor/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bismark/methylationextractor/test.yml b/tests/modules/bismark/methylationextractor/test.yml index a64c1edf..f25b7646 100644 --- a/tests/modules/bismark/methylationextractor/test.yml +++ b/tests/modules/bismark/methylationextractor/test.yml @@ -1,5 +1,5 @@ -- name: Run bismark methylation extractor test workflow - command: nextflow run ./tests/modules/bismark/methylationextractor -entry test_bismark_methylationextractor -c tests/config/nextflow.config +- name: bismark methylation extractor test workflow + command: nextflow run ./tests/modules/bismark/methylationextractor -entry test_bismark_methylationextractor -c ./tests/config/nextflow.config -c ./tests/modules/bismark/methylationextractor/nextflow.config tags: - bismark - bismark/methylationextractor diff --git a/tests/modules/bismark/report/main.nf b/tests/modules/bismark/report/main.nf index 945d24ed..f80fb2bc 100644 --- a/tests/modules/bismark/report/main.nf +++ b/tests/modules/bismark/report/main.nf @@ -2,11 +2,11 @@ nextflow.enable.dsl = 2 -include { BISMARK_GENOMEPREPARATION } from '../../../../modules/bismark/genomepreparation/main.nf' addParams( options: [:] ) -include { BISMARK_ALIGN } from '../../../../modules/bismark/align/main.nf' addParams( options: [:] ) -include { BISMARK_DEDUPLICATE } from '../../../../modules/bismark/deduplicate/main.nf' addParams( options: [:] ) -include { BISMARK_METHYLATIONEXTRACTOR } from '../../../../modules/bismark/methylationextractor/main.nf' addParams( options: [:] ) -include { BISMARK_REPORT } from '../../../../modules/bismark/report/main.nf' addParams( options: [:] ) +include { BISMARK_GENOMEPREPARATION } from '../../../../modules/bismark/genomepreparation/main.nf' +include { BISMARK_ALIGN } from '../../../../modules/bismark/align/main.nf' +include { BISMARK_DEDUPLICATE } from '../../../../modules/bismark/deduplicate/main.nf' +include { BISMARK_METHYLATIONEXTRACTOR } from '../../../../modules/bismark/methylationextractor/main.nf' +include { BISMARK_REPORT } from '../../../../modules/bismark/report/main.nf' workflow test_bismark_report { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/bismark/report/nextflow.config b/tests/modules/bismark/report/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bismark/report/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bismark/report/test.yml b/tests/modules/bismark/report/test.yml index 7025d38c..9195994c 100644 --- a/tests/modules/bismark/report/test.yml +++ b/tests/modules/bismark/report/test.yml @@ -1,5 +1,5 @@ -- name: Run bismark report test workflow - command: nextflow run ./tests/modules/bismark/report -entry test_bismark_report -c tests/config/nextflow.config +- name: bismark report test workflow + command: nextflow run ./tests/modules/bismark/report -entry test_bismark_report -c ./tests/config/nextflow.config -c ./tests/modules/bismark/report/nextflow.config tags: - bismark - bismark/report diff --git a/tests/modules/bismark/summary/main.nf b/tests/modules/bismark/summary/main.nf index 4170d19a..8eabe51f 100644 --- a/tests/modules/bismark/summary/main.nf +++ b/tests/modules/bismark/summary/main.nf @@ -2,11 +2,11 @@ nextflow.enable.dsl = 2 -include { BISMARK_GENOMEPREPARATION } from '../../../../modules/bismark/genomepreparation/main.nf' addParams( options: [:] ) -include { BISMARK_ALIGN } from '../../../../modules/bismark/align/main.nf' addParams( options: [:] ) -include { BISMARK_DEDUPLICATE } from '../../../../modules/bismark/deduplicate/main.nf' addParams( options: [:] ) -include { BISMARK_METHYLATIONEXTRACTOR } from '../../../../modules/bismark/methylationextractor/main.nf' addParams( options: [:] ) -include { BISMARK_SUMMARY } from '../../../../modules/bismark/summary/main.nf' addParams( options: [:] ) +include { BISMARK_GENOMEPREPARATION } from '../../../../modules/bismark/genomepreparation/main.nf' +include { BISMARK_ALIGN } from '../../../../modules/bismark/align/main.nf' +include { BISMARK_DEDUPLICATE } from '../../../../modules/bismark/deduplicate/main.nf' +include { BISMARK_METHYLATIONEXTRACTOR } from '../../../../modules/bismark/methylationextractor/main.nf' +include { BISMARK_SUMMARY } from '../../../../modules/bismark/summary/main.nf' workflow test_bismark_summary { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/bismark/summary/nextflow.config b/tests/modules/bismark/summary/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bismark/summary/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bismark/summary/test.yml b/tests/modules/bismark/summary/test.yml index ee438991..3b5196b9 100644 --- a/tests/modules/bismark/summary/test.yml +++ b/tests/modules/bismark/summary/test.yml @@ -1,5 +1,5 @@ -- name: Run bismark summary test workflow - command: nextflow run ./tests/modules/bismark/summary -entry test_bismark_summary -c tests/config/nextflow.config +- name: bismark summary test workflow + command: nextflow run ./tests/modules/bismark/summary -entry test_bismark_summary -c ./tests/config/nextflow.config -c ./tests/modules/bismark/summary/nextflow.config tags: - bismark - bismark/summary diff --git a/tests/modules/blast/blastn/main.nf b/tests/modules/blast/blastn/main.nf index fd690dcc..3c8496dc 100644 --- a/tests/modules/blast/blastn/main.nf +++ b/tests/modules/blast/blastn/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { BLAST_MAKEBLASTDB } from '../../../../modules/blast/makeblastdb/main.nf' addParams( options: ['args': '-dbtype nucl'] ) -include { BLAST_BLASTN } from '../../../../modules/blast/blastn/main.nf' addParams( options: [:] ) +include { BLAST_MAKEBLASTDB } from '../../../../modules/blast/makeblastdb/main.nf' +include { BLAST_BLASTN } from '../../../../modules/blast/blastn/main.nf' workflow test_blast_blastn { input = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] diff --git a/tests/modules/blast/blastn/nextflow.config b/tests/modules/blast/blastn/nextflow.config new file mode 100644 index 00000000..1d5a2c01 --- /dev/null +++ b/tests/modules/blast/blastn/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BLAST_MAKEBLASTDB { + ext.args = '-dbtype nucl' + } + +} diff --git a/tests/modules/blast/blastn/test.yml b/tests/modules/blast/blastn/test.yml index ebc03e45..17522c9b 100644 --- a/tests/modules/blast/blastn/test.yml +++ b/tests/modules/blast/blastn/test.yml @@ -1,5 +1,5 @@ - name: blast_blastn - command: nextflow run ./tests/modules/blast/blastn -entry test_blast_blastn -c tests/config/nextflow.config + command: nextflow run ./tests/modules/blast/blastn -entry test_blast_blastn -c ./tests/config/nextflow.config -c ./tests/modules/blast/blastn/nextflow.config tags: - blast - blast/blastn @@ -13,10 +13,10 @@ - path: ./output/blast/blast_db/genome.fasta.nhr md5sum: f4b4ddb034fd3dd7b25c89e9d50c004e - path: ./output/blast/blast_db/genome.fasta.ndb - md5sum: 45f2daf9769957ff80868dd3d80d30a3 + md5sum: 0d553c830656469211de113c5022f06d - path: ./output/blast/blast_db/genome.fasta.not md5sum: 1e53e9d08f1d23af0299cfa87478a7bb - path: ./output/blast/blast_db/genome.fasta.nto md5sum: 33cdeccccebe80329f1fdbee7f5874cb - path: ./output/blast/blast_db/genome.fasta.ntf - md5sum: 1f6027d443e67a98ad0edc2d39971b0c + md5sum: de1250813f0c7affc6d12dac9d0fb6bb diff --git a/tests/modules/blast/makeblastdb/main.nf b/tests/modules/blast/makeblastdb/main.nf index 48b39f22..9d778457 100644 --- a/tests/modules/blast/makeblastdb/main.nf +++ b/tests/modules/blast/makeblastdb/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { BLAST_MAKEBLASTDB } from '../../../../modules/blast/makeblastdb/main.nf' addParams( options: ['args': '-dbtype nucl'] ) +include { BLAST_MAKEBLASTDB } from '../../../../modules/blast/makeblastdb/main.nf' workflow test_blast_makeblastdb { input = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] diff --git a/tests/modules/blast/makeblastdb/nextflow.config b/tests/modules/blast/makeblastdb/nextflow.config new file mode 100644 index 00000000..1d5a2c01 --- /dev/null +++ b/tests/modules/blast/makeblastdb/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BLAST_MAKEBLASTDB { + ext.args = '-dbtype nucl' + } + +} diff --git a/tests/modules/blast/makeblastdb/test.yml b/tests/modules/blast/makeblastdb/test.yml index c060ba59..3b59f3f6 100644 --- a/tests/modules/blast/makeblastdb/test.yml +++ b/tests/modules/blast/makeblastdb/test.yml @@ -1,5 +1,5 @@ - name: blast_makeblastdb - command: nextflow run ./tests/modules/blast/makeblastdb -entry test_blast_makeblastdb -c tests/config/nextflow.config + command: nextflow run ./tests/modules/blast/makeblastdb -entry test_blast_makeblastdb -c ./tests/config/nextflow.config -c ./tests/modules/blast/makeblastdb/nextflow.config tags: - blast - blast/makeblastdb @@ -12,10 +12,10 @@ - path: ./output/blast/blast_db/genome.fasta.nhr md5sum: f4b4ddb034fd3dd7b25c89e9d50c004e - path: ./output/blast/blast_db/genome.fasta.ndb - md5sum: 45f2daf9769957ff80868dd3d80d30a3 + md5sum: 0d553c830656469211de113c5022f06d - path: ./output/blast/blast_db/genome.fasta.not md5sum: 1e53e9d08f1d23af0299cfa87478a7bb - path: ./output/blast/blast_db/genome.fasta.nto md5sum: 33cdeccccebe80329f1fdbee7f5874cb - path: ./output/blast/blast_db/genome.fasta.ntf - md5sum: 1f6027d443e67a98ad0edc2d39971b0c + md5sum: de1250813f0c7affc6d12dac9d0fb6bb diff --git a/tests/modules/bowtie/align/main.nf b/tests/modules/bowtie/align/main.nf index b2c8059a..e773cd38 100644 --- a/tests/modules/bowtie/align/main.nf +++ b/tests/modules/bowtie/align/main.nf @@ -2,13 +2,16 @@ nextflow.enable.dsl = 2 -include { BOWTIE_BUILD } from '../../../../modules/bowtie/build/main.nf' addParams( options: [:] ) -include { BOWTIE_ALIGN } from '../../../../modules/bowtie/align/main.nf' addParams( options: [:] ) +include { BOWTIE_BUILD } from '../../../../modules/bowtie/build/main.nf' +include { BOWTIE_ALIGN } from '../../../../modules/bowtie/align/main.nf' workflow test_bowtie_align_single_end { - input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_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) + ] + ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) BOWTIE_BUILD ( fasta ) @@ -16,10 +19,13 @@ workflow test_bowtie_align_single_end { } workflow test_bowtie_align_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) ] - ] + 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) BOWTIE_BUILD ( fasta ) diff --git a/tests/modules/bowtie/align/nextflow.config b/tests/modules/bowtie/align/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bowtie/align/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bowtie/align/test.yml b/tests/modules/bowtie/align/test.yml index 76d63d68..1f8d1294 100644 --- a/tests/modules/bowtie/align/test.yml +++ b/tests/modules/bowtie/align/test.yml @@ -1,5 +1,5 @@ - name: bowtie align single-end - command: nextflow run ./tests/modules/bowtie/align -entry test_bowtie_align_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bowtie/align -entry test_bowtie_align_single_end -c ./tests/config/nextflow.config -c ./tests/modules/bowtie/align/nextflow.config tags: - bowtie - bowtie/align @@ -7,36 +7,36 @@ - path: ./output/bowtie/test.bam - path: ./output/bowtie/test.out md5sum: 4b9140ceadb8a18ae9330885370f8a0b - - 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 - name: bowtie align paired-end - command: nextflow run ./tests/modules/bowtie/align -entry test_bowtie_align_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bowtie/align -entry test_bowtie_align_single_end -c ./tests/config/nextflow.config -c ./tests/modules/bowtie/align/nextflow.config tags: - bowtie - bowtie/align files: - path: ./output/bowtie/test.bam - path: ./output/bowtie/test.out - - 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/bowtie/build_test/main.nf b/tests/modules/bowtie/build_test/main.nf index 6796aad2..7a36fb55 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' workflow test_bowtie_build { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bowtie/build_test/nextflow.config b/tests/modules/bowtie/build_test/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bowtie/build_test/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bowtie/build_test/test.yml b/tests/modules/bowtie/build_test/test.yml index 0ba58194..c51d1e8a 100644 --- a/tests/modules/bowtie/build_test/test.yml +++ b/tests/modules/bowtie/build_test/test.yml @@ -1,18 +1,18 @@ - name: bowtie build - command: nextflow run ./tests/modules/bowtie/build_test -entry test_bowtie_build -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bowtie/build_test -entry test_bowtie_build -c ./tests/config/nextflow.config -c ./tests/modules/bowtie/build/nextflow.config tags: - 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/align/main.nf b/tests/modules/bowtie2/align/main.nf index 20602f30..8c8e3ab8 100644 --- a/tests/modules/bowtie2/align/main.nf +++ b/tests/modules/bowtie2/align/main.nf @@ -2,13 +2,16 @@ nextflow.enable.dsl = 2 -include { BOWTIE2_BUILD } from '../../../../modules/bowtie2/build/main.nf' addParams( options: [:] ) -include { BOWTIE2_ALIGN } from '../../../../modules/bowtie2/align/main.nf' addParams( options: [:] ) +include { BOWTIE2_BUILD } from '../../../../modules/bowtie2/build/main.nf' +include { BOWTIE2_ALIGN } from '../../../../modules/bowtie2/align/main.nf' workflow test_bowtie2_align_single_end { - input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_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) + ] + ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) BOWTIE2_BUILD ( fasta ) @@ -16,11 +19,15 @@ workflow test_bowtie2_align_single_end { } workflow test_bowtie2_align_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) ] - ] + 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 ) BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index ) } diff --git a/tests/modules/bowtie2/align/nextflow.config b/tests/modules/bowtie2/align/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bowtie2/align/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bowtie2/align/test.yml b/tests/modules/bowtie2/align/test.yml index 05952b76..95d48b88 100644 --- a/tests/modules/bowtie2/align/test.yml +++ b/tests/modules/bowtie2/align/test.yml @@ -1,41 +1,41 @@ - name: bowtie2 align single-end - command: nextflow run ./tests/modules/bowtie2/align -entry test_bowtie2_align_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bowtie2/align -entry test_bowtie2_align_single_end -c ./tests/config/nextflow.config -c ./tests/modules/bowtie2/align/nextflow.config tags: - bowtie2 - bowtie2/align files: - path: ./output/bowtie2/test.bam - path: ./output/bowtie2/test.bowtie2.log - - 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 - name: bowtie2 align paired-end - command: nextflow run ./tests/modules/bowtie2/align -entry test_bowtie2_align_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bowtie2/align -entry test_bowtie2_align_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/bowtie2/align/nextflow.config tags: - bowtie2 - bowtie2/align files: - path: ./output/bowtie2/test.bam - path: ./output/bowtie2/test.bowtie2.log - - 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/bowtie2/build_test/main.nf b/tests/modules/bowtie2/build_test/main.nf index f1a95156..f1d35083 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' workflow test_bowtie2_build { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bowtie2/build_test/nextflow.config b/tests/modules/bowtie2/build_test/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bowtie2/build_test/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bowtie2/build_test/test.yml b/tests/modules/bowtie2/build_test/test.yml index cb7283e3..88e6c3ad 100644 --- a/tests/modules/bowtie2/build_test/test.yml +++ b/tests/modules/bowtie2/build_test/test.yml @@ -1,18 +1,18 @@ - name: bowtie2 build - command: nextflow run ./tests/modules/bowtie2/build_test -entry test_bowtie2_build -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bowtie2/build_test -entry test_bowtie2_build -c ./tests/config/nextflow.config -c ./tests/modules/bowtie2/build/nextflow.config tags: - 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/aln/main.nf b/tests/modules/bwa/aln/main.nf new file mode 100644 index 00000000..909e7a2d --- /dev/null +++ b/tests/modules/bwa/aln/main.nf @@ -0,0 +1,39 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' +include { BWA_ALN } from '../../../../modules/bwa/aln/main.nf' + +// +// Test with single-end data +// +workflow test_bwa_aln_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) + + BWA_INDEX ( fasta ) + BWA_ALN ( input, BWA_INDEX.out.index ) +} + +// +// Test with paired-end data +// +workflow test_bwa_aln_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) + + BWA_INDEX ( fasta ) + BWA_ALN ( input, BWA_INDEX.out.index ) +} diff --git a/tests/modules/bwa/aln/nextflow.config b/tests/modules/bwa/aln/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bwa/aln/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bwa/aln/test.yml b/tests/modules/bwa/aln/test.yml new file mode 100644 index 00000000..c89c47be --- /dev/null +++ b/tests/modules/bwa/aln/test.yml @@ -0,0 +1,39 @@ +- name: bwa aln single-end + command: nextflow run ./tests/modules/bwa/aln -entry test_bwa_aln_single_end -c ./tests/config/nextflow.config -c ./tests/modules/bwa/aln/nextflow.config + tags: + - bwa + - bwa/aln + files: + - path: ./output/bwa/test.sai + md5sum: aaaf39b6814c96ca1a5eacc662adf926 + - path: ./output/bwa/bwa/genome.bwt + md5sum: 0469c30a1e239dd08f68afe66fde99da + - path: ./output/bwa/bwa/genome.amb + md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e + - path: ./output/bwa/bwa/genome.ann + md5sum: c32e11f6c859f166c7525a9c1d583567 + - path: ./output/bwa/bwa/genome.pac + md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 + - path: ./output/bwa/bwa/genome.sa + md5sum: ab3952cabf026b48cd3eb5bccbb636d1 + +- name: bwa aln paired-end + command: nextflow run ./tests/modules/bwa/aln -entry test_bwa_aln_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/bwa/aln/nextflow.config + tags: + - bwa + - bwa/aln + files: + - path: ./output/bwa/test.1.sai + md5sum: aaaf39b6814c96ca1a5eacc662adf926 + - path: ./output/bwa/test.2.sai + md5sum: b4f185d9b4cb256dd5c377070a536124 + - path: ./output/bwa/bwa/genome.bwt + md5sum: 0469c30a1e239dd08f68afe66fde99da + - path: ./output/bwa/bwa/genome.amb + md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e + - path: ./output/bwa/bwa/genome.ann + md5sum: c32e11f6c859f166c7525a9c1d583567 + - path: ./output/bwa/bwa/genome.pac + md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 + - path: ./output/bwa/bwa/genome.sa + md5sum: ab3952cabf026b48cd3eb5bccbb636d1 diff --git a/tests/modules/bwa/index/main.nf b/tests/modules/bwa/index/main.nf index fa7fffbc..fe040cb2 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' workflow test_bwa_index { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bwa/index/nextflow.config b/tests/modules/bwa/index/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bwa/index/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bwa/index/test.yml b/tests/modules/bwa/index/test.yml index 58af27e3..a9dab91d 100644 --- a/tests/modules/bwa/index/test.yml +++ b/tests/modules/bwa/index/test.yml @@ -1,16 +1,16 @@ -- name: bwa index - command: nextflow run ./tests/modules/bwa/index -entry test_bwa_index -c tests/config/nextflow.config +- name: bwa index test_bwa_index + command: nextflow run ./tests/modules/bwa/index -entry test_bwa_index -c ./tests/config/nextflow.config -c ./tests/modules/bwa/index/nextflow.config tags: - bwa - bwa/index files: - - path: ./output/index/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 - md5sum: ab3952cabf026b48cd3eb5bccbb636d1 - - path: ./output/index/bwa/genome.pac - md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 - - path: ./output/index/bwa/genome.ann + - path: output/bwa/bwa/genome.ann md5sum: c32e11f6c859f166c7525a9c1d583567 + - path: output/bwa/bwa/genome.bwt + md5sum: 0469c30a1e239dd08f68afe66fde99da + - path: output/bwa/bwa/genome.pac + md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 + - path: output/bwa/bwa/genome.sa + md5sum: ab3952cabf026b48cd3eb5bccbb636d1 diff --git a/tests/modules/bwa/mem/main.nf b/tests/modules/bwa/mem/main.nf index bac51d23..c9c57197 100644 --- a/tests/modules/bwa/mem/main.nf +++ b/tests/modules/bwa/mem/main.nf @@ -2,32 +2,71 @@ nextflow.enable.dsl = 2 -include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' addParams( options: [:] ) -include { BWA_MEM } from '../../../../modules/bwa/mem/main.nf' addParams( options: [:] ) +include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' +include { BWA_MEM } from '../../../../modules/bwa/mem/main.nf' // // Test with single-end data // workflow test_bwa_mem_single_end { - input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_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) + ] + ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) BWA_INDEX ( fasta ) - BWA_MEM ( input, BWA_INDEX.out.index ) + BWA_MEM ( input, BWA_INDEX.out.index, false ) +} + +// +// Test with single-end data and sort +// +workflow test_bwa_mem_single_end_sort { + 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) + + BWA_INDEX ( fasta ) + BWA_MEM ( input, BWA_INDEX.out.index, true ) } // // Test with paired-end data // workflow test_bwa_mem_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) ] - ] + 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) BWA_INDEX ( fasta ) - BWA_MEM ( input, BWA_INDEX.out.index ) + BWA_MEM ( input, BWA_INDEX.out.index, false ) +} + +// +// Test with paired-end data and sort +// +workflow test_bwa_mem_paired_end_sort { + 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) + + BWA_INDEX ( fasta ) + BWA_MEM ( input, BWA_INDEX.out.index, true ) } diff --git a/tests/modules/bwa/mem/nextflow.config b/tests/modules/bwa/mem/nextflow.config new file mode 100644 index 00000000..d15f6939 --- /dev/null +++ b/tests/modules/bwa/mem/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BWA_MEM { + ext.args2 = { sort_bam ? "" : "-bh" } + } + +} diff --git a/tests/modules/bwa/mem/test.yml b/tests/modules/bwa/mem/test.yml index df1988b5..8fe2ee6b 100644 --- a/tests/modules/bwa/mem/test.yml +++ b/tests/modules/bwa/mem/test.yml @@ -1,35 +1,71 @@ - name: bwa mem single-end - command: nextflow run ./tests/modules/bwa/mem -entry test_bwa_mem_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bwa/mem -entry test_bwa_mem_single_end -c ./tests/config/nextflow.config -c ./tests/modules/bwa/mem/nextflow.config tags: - bwa - bwa/mem files: - path: ./output/bwa/test.bam - - 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.ann + - path: ./output/bwa/bwa/genome.ann md5sum: c32e11f6c859f166c7525a9c1d583567 - - path: ./output/index/bwa/genome.pac + - path: ./output/bwa/bwa/genome.pac md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 - - path: ./output/index/bwa/genome.sa + - path: ./output/bwa/bwa/genome.sa + md5sum: ab3952cabf026b48cd3eb5bccbb636d1 + +- name: bwa mem single-end sort + command: nextflow run ./tests/modules/bwa/mem -entry test_bwa_mem_single_end_sort -c ./tests/config/nextflow.config -c ./tests/modules/bwa/mem/nextflow.config + tags: + - bwa + - bwa/mem + files: + - path: ./output/bwa/test.bam + - path: ./output/bwa/bwa/genome.bwt + md5sum: 0469c30a1e239dd08f68afe66fde99da + - path: ./output/bwa/bwa/genome.amb + md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e + - path: ./output/bwa/bwa/genome.ann + md5sum: c32e11f6c859f166c7525a9c1d583567 + - path: ./output/bwa/bwa/genome.pac + md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 + - path: ./output/bwa/bwa/genome.sa md5sum: ab3952cabf026b48cd3eb5bccbb636d1 - name: bwa mem paired-end - command: nextflow run ./tests/modules/bwa/mem -entry test_bwa_mem_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bwa/mem -entry test_bwa_mem_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/bwa/mem/nextflow.config tags: - bwa - bwa/mem files: - path: ./output/bwa/test.bam - - 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.ann + - path: ./output/bwa/bwa/genome.ann md5sum: c32e11f6c859f166c7525a9c1d583567 - - path: ./output/index/bwa/genome.pac + - path: ./output/bwa/bwa/genome.pac md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 - - path: ./output/index/bwa/genome.sa + - path: ./output/bwa/bwa/genome.sa + md5sum: ab3952cabf026b48cd3eb5bccbb636d1 + +- name: bwa mem paired-end sort + command: nextflow run ./tests/modules/bwa/mem -entry test_bwa_mem_paired_end_sort -c ./tests/config/nextflow.config -c ./tests/modules/bwa/mem/nextflow.config + tags: + - bwa + - bwa/mem + files: + - path: ./output/bwa/test.bam + - path: ./output/bwa/bwa/genome.bwt + md5sum: 0469c30a1e239dd08f68afe66fde99da + - path: ./output/bwa/bwa/genome.amb + md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e + - path: ./output/bwa/bwa/genome.ann + md5sum: c32e11f6c859f166c7525a9c1d583567 + - path: ./output/bwa/bwa/genome.pac + md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 + - path: ./output/bwa/bwa/genome.sa md5sum: ab3952cabf026b48cd3eb5bccbb636d1 diff --git a/tests/modules/bwa/sampe/main.nf b/tests/modules/bwa/sampe/main.nf new file mode 100644 index 00000000..abd25566 --- /dev/null +++ b/tests/modules/bwa/sampe/main.nf @@ -0,0 +1,25 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' +include { BWA_ALN } from '../../../../modules/bwa/aln/main.nf' +include { BWA_SAMPE } from '../../../../modules/bwa/sampe/main.nf' + +workflow test_bwa_sampe { + + 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 ( input.join(BWA_ALN.out.sai), BWA_INDEX.out.index ) +} diff --git a/tests/modules/bwa/sampe/nextflow.config b/tests/modules/bwa/sampe/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bwa/sampe/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bwa/sampe/test.yml b/tests/modules/bwa/sampe/test.yml new file mode 100644 index 00000000..fb6d7708 --- /dev/null +++ b/tests/modules/bwa/sampe/test.yml @@ -0,0 +1,8 @@ +- name: bwa sampe + command: nextflow run ./tests/modules/bwa/sampe -entry test_bwa_sampe -c ./tests/config/nextflow.config -c ./tests/modules/bwa/sampe/nextflow.config + tags: + - bwa + - bwa/sampe + files: + - path: output/bwa/test.bam + md5sum: f6ad85d66d44c5d26e692109d2e34100 diff --git a/tests/modules/bwa/samse/main.nf b/tests/modules/bwa/samse/main.nf new file mode 100644 index 00000000..17912c36 --- /dev/null +++ b/tests/modules/bwa/samse/main.nf @@ -0,0 +1,22 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' +include { BWA_ALN } from '../../../../modules/bwa/aln/main.nf' +include { BWA_SAMSE } from '../../../../modules/bwa/samse/main.nf' + +workflow test_bwa_samse { + + 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 ( input.join(BWA_ALN.out.sai, by:[0]), BWA_INDEX.out.index ) +} diff --git a/tests/modules/bwa/samse/nextflow.config b/tests/modules/bwa/samse/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bwa/samse/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bwa/samse/test.yml b/tests/modules/bwa/samse/test.yml new file mode 100644 index 00000000..5a2fe1e3 --- /dev/null +++ b/tests/modules/bwa/samse/test.yml @@ -0,0 +1,8 @@ +- name: bwa samse + command: nextflow run ./tests/modules/bwa/samse -entry test_bwa_samse -c ./tests/config/nextflow.config -c ./tests/modules/bwa/samse/nextflow.config + tags: + - bwa + - bwa/samse + files: + - path: output/bwa/test.bam + md5sum: 27eb91146e45dee65664c18596be4262 diff --git a/tests/modules/bwamem2/index/main.nf b/tests/modules/bwamem2/index/main.nf index 897a62fe..fe88f8f7 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' workflow test_bwamem2_index { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bwamem2/index/nextflow.config b/tests/modules/bwamem2/index/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bwamem2/index/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bwamem2/index/test.yml b/tests/modules/bwamem2/index/test.yml index b71b6901..efada6ec 100644 --- a/tests/modules/bwamem2/index/test.yml +++ b/tests/modules/bwamem2/index/test.yml @@ -1,16 +1,16 @@ - name: bwamem2 index - command: nextflow run ./tests/modules/bwamem2/index -entry test_bwamem2_index -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bwamem2/index -entry test_bwamem2_index -c ./tests/config/nextflow.config -c ./tests/modules/bwamem2/index/nextflow.config tags: - 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/bwamem2/mem/main.nf b/tests/modules/bwamem2/mem/main.nf index 5abda8bb..b4293dbe 100644 --- a/tests/modules/bwamem2/mem/main.nf +++ b/tests/modules/bwamem2/mem/main.nf @@ -2,32 +2,72 @@ nextflow.enable.dsl = 2 -include { BWAMEM2_INDEX } from '../../../../modules/bwamem2/index/main.nf' addParams( options: [:] ) -include { BWAMEM2_MEM } from '../../../../modules/bwamem2/mem/main.nf' addParams( options: [:] ) +include { BWAMEM2_INDEX } from '../../../../modules/bwamem2/index/main.nf' +include { BWAMEM2_MEM } from '../../../../modules/bwamem2/mem/main.nf' // // Test with single-end data // workflow test_bwamem2_mem_single_end { - input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_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) + ] + ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) BWAMEM2_INDEX ( fasta ) - BWAMEM2_MEM ( input, BWAMEM2_INDEX.out.index ) + BWAMEM2_MEM ( input, BWAMEM2_INDEX.out.index, false ) } +// +// Test with single-end data and sort +// +workflow test_bwamem2_mem_single_end_sort { + 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) + + BWAMEM2_INDEX ( fasta ) + BWAMEM2_MEM ( input, BWAMEM2_INDEX.out.index, true ) +} + + // // Test with paired-end data // workflow test_bwamem2_mem_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) ] - ] + 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) BWAMEM2_INDEX ( fasta ) - BWAMEM2_MEM ( input, BWAMEM2_INDEX.out.index ) + BWAMEM2_MEM ( input, BWAMEM2_INDEX.out.index, false ) +} + +// +// Test with paired-end data and sort +// +workflow test_bwamem2_mem_paired_end_sort { + 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) + + BWAMEM2_INDEX ( fasta ) + BWAMEM2_MEM ( input, BWAMEM2_INDEX.out.index, true ) } diff --git a/tests/modules/bwamem2/mem/nextflow.config b/tests/modules/bwamem2/mem/nextflow.config new file mode 100644 index 00000000..b5181865 --- /dev/null +++ b/tests/modules/bwamem2/mem/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: BWAMEM2_MEM { + ext.args2 = { sort_bam ? "" : "-bh" } + } + +} diff --git a/tests/modules/bwamem2/mem/test.yml b/tests/modules/bwamem2/mem/test.yml index cc2fe2a8..bf445ebe 100644 --- a/tests/modules/bwamem2/mem/test.yml +++ b/tests/modules/bwamem2/mem/test.yml @@ -1,35 +1,71 @@ - name: bwamem2 mem single-end - command: nextflow run ./tests/modules/bwamem2/mem -entry test_bwamem2_mem_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bwamem2/mem -entry test_bwamem2_mem_single_end -c ./tests/config/nextflow.config -c ./tests/modules/bwamem2/mem/nextflow.config tags: - bwamem2 - bwamem2/mem files: - path: ./output/bwamem2/test.bam - - 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 + +- name: bwamem2 mem single-end sort + command: nextflow run ./tests/modules/bwamem2/mem -entry test_bwamem2_mem_single_end_sort -c ./tests/config/nextflow.config -c ./tests/modules/bwamem2/mem/nextflow.config + tags: + - bwamem2 + - bwamem2/mem + files: + - path: ./output/bwamem2/test.bam + - path: ./output/bwamem2/bwamem2/genome.fasta.amb + md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e + - path: ./output/bwamem2/bwamem2/genome.fasta.pac + md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 + - path: ./output/bwamem2/bwamem2/genome.fasta.0123 + md5sum: b02870de80106104abcb03cd9463e7d8 + - path: ./output/bwamem2/bwamem2/genome.fasta.bwt.2bit.64 + md5sum: d097a1b82dee375d41a1ea69895a9216 + - path: ./output/bwamem2/bwamem2/genome.fasta.ann md5sum: c32e11f6c859f166c7525a9c1d583567 - name: bwamem2 mem paired-end - command: nextflow run ./tests/modules/bwamem2/mem -entry test_bwamem2_mem_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/bwamem2/mem -entry test_bwamem2_mem_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/bwamem2/mem/nextflow.config tags: - bwamem2 - bwamem2/mem files: - path: ./output/bwamem2/test.bam - - 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 + +- name: bwamem2 mem paired-end sort + command: nextflow run ./tests/modules/bwamem2/mem -entry test_bwamem2_mem_paired_end_sort -c ./tests/config/nextflow.config -c ./tests/modules/bwamem2/mem/nextflow.config + tags: + - bwamem2 + - bwamem2/mem + files: + - path: ./output/bwamem2/test.bam + - path: ./output/bwamem2/bwamem2/genome.fasta.amb + md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e + - path: ./output/bwamem2/bwamem2/genome.fasta.pac + md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 + - path: ./output/bwamem2/bwamem2/genome.fasta.0123 + md5sum: b02870de80106104abcb03cd9463e7d8 + - path: ./output/bwamem2/bwamem2/genome.fasta.bwt.2bit.64 + md5sum: d097a1b82dee375d41a1ea69895a9216 + - path: ./output/bwamem2/bwamem2/genome.fasta.ann md5sum: c32e11f6c859f166c7525a9c1d583567 diff --git a/tests/modules/bwameth/align/main.nf b/tests/modules/bwameth/align/main.nf index 7a7aa99c..8066941c 100644 --- a/tests/modules/bwameth/align/main.nf +++ b/tests/modules/bwameth/align/main.nf @@ -2,33 +2,38 @@ 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' +include { BWAMETH_ALIGN } from '../../../../modules/bwameth/align/main.nf' // // Test with single-end data // workflow test_bwameth_align_single_end { - input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true) ] - ] + input = [ + [ id:'test', single_end:true ], // meta map + [ + file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true) + ] + ] 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 ) } // // Test with paired-end data // workflow test_bwameth_align_paired_end { - input = [ [ id:'test', single_end:false ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_methylated_2_fastq_gz'], checkIfExists: true) ] - ] + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_methylated_2_fastq_gz'], checkIfExists: true) + ] + ] 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/nextflow.config b/tests/modules/bwameth/align/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bwameth/align/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bwameth/align/test.yml b/tests/modules/bwameth/align/test.yml index a7d9fdbc..f921b5f4 100644 --- a/tests/modules/bwameth/align/test.yml +++ b/tests/modules/bwameth/align/test.yml @@ -1,16 +1,16 @@ -- name: Run bwameth single-end test workflow - command: nextflow run ./tests/modules/bwameth/align -entry test_bwameth_align_single_end -c tests/config/nextflow.config +- 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 -c ./tests/modules/bwameth/align/nextflow.config tags: - bwameth - bwameth/align files: - - path: output/test_single_end/test.bam + - path: output/bwameth/test.bam -- name: Run bwameth paired-end test workflow - command: nextflow run ./tests/modules/bwameth/align -entry test_bwameth_align_paired_end -c tests/config/nextflow.config +- 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 -c ./tests/modules/bwameth/align/nextflow.config tags: - bwameth - bwameth/align files: - - path: output/test_paired_end/test.bam + - path: output/bwameth/test.bam diff --git a/tests/modules/bwameth/index/main.nf b/tests/modules/bwameth/index/main.nf index 17477ca0..b70fd1f7 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' workflow test_bwameth_index { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bwameth/index/nextflow.config b/tests/modules/bwameth/index/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/bwameth/index/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/bwameth/index/test.yml b/tests/modules/bwameth/index/test.yml index 5a2595d8..9783c511 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 - command: nextflow run ./tests/modules/bwameth/index -entry test_bwameth_index -c tests/config/nextflow.config +- name: bwameth index test workflow + command: nextflow run ./tests/modules/bwameth/index -entry test_bwameth_index -c ./tests/config/nextflow.config -c ./tests/modules/bwameth/index/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/cat/cat/main.nf b/tests/modules/cat/cat/main.nf new file mode 100644 index 00000000..430c71fa --- /dev/null +++ b/tests/modules/cat/cat/main.nf @@ -0,0 +1,45 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CAT_CAT } from '../../../../modules/cat/cat/main.nf' + +workflow test_cat_unzipped_unzipped { + + input = [ + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true) + ] + + CAT_CAT ( input, 'cat.txt' ) +} + +workflow test_cat_zipped_zipped { + + input = [ + file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['contigs_genome_maf_gz'], checkIfExists: true) + ] + + CAT_CAT ( input, 'cat.txt.gz' ) +} + +workflow test_cat_zipped_unzipped { + + input = [ + file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['contigs_genome_maf_gz'], checkIfExists: true) + ] + + CAT_CAT ( input, 'cat.txt' ) +} + +workflow test_cat_unzipped_zipped { + + input = [ + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true) + ] + + CAT_CAT ( input, 'cat.txt.gz' ) +} diff --git a/tests/modules/cat/cat/nextflow.config b/tests/modules/cat/cat/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/cat/cat/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/cat/cat/test.yml b/tests/modules/cat/cat/test.yml new file mode 100644 index 00000000..d7973042 --- /dev/null +++ b/tests/modules/cat/cat/test.yml @@ -0,0 +1,33 @@ +- name: cat unzipped unzipped + command: nextflow run ./tests/modules/cat/cat -entry test_cat_unzipped_unzipped -c ./tests/config/nextflow.config -c ./tests/modules/cat/cat/nextflow.config + tags: + - cat + - cat/cat + files: + - path: output/cat/cat.txt + md5sum: f44b33a0e441ad58b2d3700270e2dbe2 + +- name: cat zipped zipped + command: nextflow run ./tests/modules/cat/cat -entry test_cat_zipped_zipped -c ./tests/config/nextflow.config -c ./tests/modules/cat/cat/nextflow.config + tags: + - cat + - cat/cat + files: + - path: output/cat/cat.txt.gz + +- name: cat zipped unzipped + command: nextflow run ./tests/modules/cat/cat -entry test_cat_zipped_unzipped -c ./tests/config/nextflow.config -c ./tests/modules/cat/cat/nextflow.config + tags: + - cat + - cat/cat + files: + - path: output/cat/cat.txt + md5sum: c439d3b60e7bc03e8802a451a0d9a5d9 + +- name: cat unzipped zipped + command: nextflow run ./tests/modules/cat/cat -entry test_cat_unzipped_zipped -c ./tests/config/nextflow.config -c ./tests/modules/cat/cat/nextflow.config + tags: + - cat + - cat/cat + files: + - path: output/cat/cat.txt.gz diff --git a/tests/modules/cat/fastq/main.nf b/tests/modules/cat/fastq/main.nf index de11bcf2..1ed23ce5 100644 --- a/tests/modules/cat/fastq/main.nf +++ b/tests/modules/cat/fastq/main.nf @@ -2,24 +2,48 @@ nextflow.enable.dsl = 2 -include { CAT_FASTQ } from '../../../../modules/cat/fastq/main.nf' addParams( options: [:] ) +include { CAT_FASTQ } from '../../../../modules/cat/fastq/main.nf' 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 ) +} + +workflow test_cat_fastq_single_end_same_name { + 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']['test_1_fastq_gz'], checkIfExists: true) ] + ] + + CAT_FASTQ ( input ) +} + +workflow test_cat_fastq_paired_end_same_name { + 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_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + ] CAT_FASTQ ( input ) } diff --git a/tests/modules/cat/fastq/nextflow.config b/tests/modules/cat/fastq/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/cat/fastq/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/cat/fastq/test.yml b/tests/modules/cat/fastq/test.yml index 3a23d309..56374060 100644 --- a/tests/modules/cat/fastq/test.yml +++ b/tests/modules/cat/fastq/test.yml @@ -1,19 +1,39 @@ - name: cat fastq single-end - command: nextflow run ./tests/modules/cat/fastq -entry test_cat_fastq_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/cat/fastq -entry test_cat_fastq_single_end -c ./tests/config/nextflow.config -c ./tests/modules/cat/fastq/nextflow.config tags: - cat - cat/fastq files: - - path: ./output/merged_fastq/test.merged.fastq.gz - md5sum: 59f6dbe193741bb40f498f254aeb2e99 + - path: ./output/cat/test.merged.fastq.gz + md5sum: f9cf5e375f7de81a406144a2c70cc64d - name: cat fastq fastqc_paired_end - command: nextflow run ./tests/modules/cat/fastq -entry test_cat_fastq_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/cat/fastq -entry test_cat_fastq_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/cat/fastq/nextflow.config tags: - cat - cat/fastq files: - - path: ./output/merged_fastq/test_2.merged.fastq.gz - md5sum: d2b1a836eef1058738ecab36c907c5ba - - path: ./output/merged_fastq/test_1.merged.fastq.gz - md5sum: 59f6dbe193741bb40f498f254aeb2e99 + - path: ./output/cat/test_2.merged.fastq.gz + md5sum: 77c8e966e130d8c6b6ec9be52fcb2bda + - path: ./output/cat/test_1.merged.fastq.gz + md5sum: f9cf5e375f7de81a406144a2c70cc64d + +- name: cat fastq single-end-same-name + command: nextflow run ./tests/modules/cat/fastq -entry test_cat_fastq_single_end_same_name -c ./tests/config/nextflow.config -c ./tests/modules/cat/fastq/nextflow.config + tags: + - cat + - cat/fastq + files: + - path: ./output/cat/test.merged.fastq.gz + md5sum: 63f817db7a29a03eb538104495556f66 + +- name: cat fastq fastqc_paired_end_same_name + command: nextflow run ./tests/modules/cat/fastq -entry test_cat_fastq_paired_end_same_name -c ./tests/config/nextflow.config -c ./tests/modules/cat/fastq/nextflow.config + tags: + - cat + - cat/fastq + files: + - path: ./output/cat/test_1.merged.fastq.gz + md5sum: 63f817db7a29a03eb538104495556f66 + - path: ./output/cat/test_2.merged.fastq.gz + md5sum: fe9f266f43a6fc3dcab690a18419a56e diff --git a/tests/modules/cellranger/count/main.nf b/tests/modules/cellranger/count/main.nf new file mode 100644 index 00000000..bb9e11d1 --- /dev/null +++ b/tests/modules/cellranger/count/main.nf @@ -0,0 +1,33 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CELLRANGER_MKGTF } from '../../../../modules/cellranger/mkgtf/main.nf' +include { CELLRANGER_MKREF } from '../../../../modules/cellranger/mkref/main.nf' +include { CELLRANGER_COUNT } from '../../../../modules/cellranger/count/main.nf' + +workflow test_cellranger_count { + + input = [ [ id:'test', single_end:true, strandedness:'forward', gem: '123', samples: ["test_10x"] ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_10x_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_10x_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) + reference_name = "homo_sapiens_chr22_reference" + + CELLRANGER_MKGTF ( gtf ) + + CELLRANGER_MKREF ( + fasta, + CELLRANGER_MKGTF.out.gtf, + reference_name + ) + + CELLRANGER_COUNT( + input, + CELLRANGER_MKREF.out.reference + ) +} diff --git a/tests/modules/cellranger/count/nextflow.config b/tests/modules/cellranger/count/nextflow.config new file mode 100644 index 00000000..16419fce --- /dev/null +++ b/tests/modules/cellranger/count/nextflow.config @@ -0,0 +1,31 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: CELLRANGER_MKGTF { + ext.args = '--attribute=gene_biotype:protein_coding \ + --attribute=gene_biotype:lincRNA \ + --attribute=gene_biotype:antisense \ + --attribute=gene_biotype:IG_LV_gene \ + --attribute=gene_biotype:IG_V_gene \ + --attribute=gene_biotype:IG_V_pseudogene \ + --attribute=gene_biotype:IG_D_gene \ + --attribute=gene_biotype:IG_J_gene \ + --attribute=gene_biotype:IG_J_pseudogene \ + --attribute=gene_biotype:IG_C_gene \ + --attribute=gene_biotype:IG_C_pseudogene \ + --attribute=gene_biotype:TR_V_gene \ + --attribute=gene_biotype:TR_V_pseudogene \ + --attribute=gene_biotype:TR_D_gene \ + --attribute=gene_biotype:TR_J_gene \ + --attribute=gene_biotype:TR_J_pseudogene \ + --attribute=gene_biotype:TR_C_gene' + + + } + + withName: CELLRANGER_COUNT { + ext.args = '--chemistry SC3Pv3' + } + +} diff --git a/tests/modules/cellranger/count/test.yml b/tests/modules/cellranger/count/test.yml new file mode 100644 index 00000000..6b151a2a --- /dev/null +++ b/tests/modules/cellranger/count/test.yml @@ -0,0 +1,19 @@ +- name: cellranger count test_cellranger_count + command: nextflow run tests/modules/cellranger/count -entry test_cellranger_count -c tests/config/nextflow.config -c tests/modules/cellranger/count/nextflow.config + tags: + - cellranger + - cellranger/count + files: + - path: output/cellranger/sample-123/outs/filtered_feature_bc_matrix.h5 + - path: output/cellranger/sample-123/outs/metrics_summary.csv + md5sum: 707df0f101d479d93f412ca74f9c4131 + - path: output/cellranger/sample-123/outs/molecule_info.h5 + md5sum: cf03b2b3ca776a1c37aa3518e91268ba + - path: output/cellranger/sample-123/outs/possorted_genome_bam.bam + md5sum: 15441da9cfceea0bb48c8b66b1b860df + - path: output/cellranger/sample-123/outs/possorted_genome_bam.bam.bai + md5sum: 7c3d49c77016a09535aff61a027f750c + - path: output/cellranger/sample-123/outs/raw_feature_bc_matrix + - path: output/cellranger/sample-123/outs/raw_feature_bc_matrix.h5 + md5sum: 40c8df814eb8723b7317b234dc8222e9 + - path: output/cellranger/sample-123/outs/web_summary.html diff --git a/tests/modules/cellranger/mkfastq/main.nf b/tests/modules/cellranger/mkfastq/main.nf new file mode 100644 index 00000000..5e594fd1 --- /dev/null +++ b/tests/modules/cellranger/mkfastq/main.nf @@ -0,0 +1,26 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UNTAR } from '../../../../modules/untar/main.nf' +include { CELLRANGER_MKFASTQ } from '../../../../modules/cellranger/mkfastq/main.nf' + +workflow test_cellranger_mkfastq_simple { + + simple_csv = file("https://cf.10xgenomics.com/supp/cell-exp/cellranger-tiny-bcl-simple-1.2.0.csv", checkIfExists: true) + tiny_bcl = file("https://cf.10xgenomics.com/supp/cell-exp/cellranger-tiny-bcl-1.2.0.tar.gz", checkIfExists: true) + + UNTAR ( tiny_bcl ) + + CELLRANGER_MKFASTQ ( UNTAR.out.untar, simple_csv) +} + +workflow test_cellranger_mkfastq_illumina { + + samplesheet_csv = file("https://cf.10xgenomics.com/supp/cell-exp/cellranger-tiny-bcl-samplesheet-1.2.0.csv", checkIfExists: true) + tiny_bcl = file("https://cf.10xgenomics.com/supp/cell-exp/cellranger-tiny-bcl-1.2.0.tar.gz", checkIfExists: true) + + UNTAR ( tiny_bcl ) + + CELLRANGER_MKFASTQ ( UNTAR.out.untar, samplesheet_csv) +} diff --git a/tests/modules/cellranger/mkfastq/nextflow.config b/tests/modules/cellranger/mkfastq/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/cellranger/mkfastq/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/cellranger/mkfastq/test.yml b/tests/modules/cellranger/mkfastq/test.yml new file mode 100644 index 00000000..bdd32187 --- /dev/null +++ b/tests/modules/cellranger/mkfastq/test.yml @@ -0,0 +1,13 @@ +- name: cellranger mkfastq test_cellranger_mkfastq_simple + command: nextflow run tests/modules/cellranger/mkfastq -entry test_cellranger_mkfastq_simple -c tests/config/nextflow.config -c ./tests/modules/cellranger/mkfastq/nextflow.config + tags: + - cellranger + - cellranger/mkfastq + # files: + # - path: output/cellranger/genome.filtered.gtf + # md5sum: a8b8a7b5039e05d3a9cf9151ea138b5b +- name: cellranger mkfastq test_cellranger_mkfastq_illumina + command: nextflow run tests/modules/cellranger/mkfastq -entry test_cellranger_mkfastq_illumina -c tests/config/nextflow.config -c ./tests/modules/cellranger/mkfastq/nextflow.config + tags: + - cellranger + - cellranger/mkfastq diff --git a/tests/modules/cellranger/mkgtf/main.nf b/tests/modules/cellranger/mkgtf/main.nf new file mode 100644 index 00000000..19e2cba0 --- /dev/null +++ b/tests/modules/cellranger/mkgtf/main.nf @@ -0,0 +1,11 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CELLRANGER_MKGTF } from '../../../../modules/cellranger/mkgtf/main.nf' + +workflow test_cellranger_mkgtf { + gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) + + CELLRANGER_MKGTF ( gtf ) +} diff --git a/tests/modules/cellranger/mkgtf/nextflow.config b/tests/modules/cellranger/mkgtf/nextflow.config new file mode 100644 index 00000000..03fd9e09 --- /dev/null +++ b/tests/modules/cellranger/mkgtf/nextflow.config @@ -0,0 +1,27 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: CELLRANGER_MKGTF { + ext.args = '--attribute=gene_biotype:protein_coding \ + --attribute=gene_biotype:lincRNA \ + --attribute=gene_biotype:antisense \ + --attribute=gene_biotype:IG_LV_gene \ + --attribute=gene_biotype:IG_V_gene \ + --attribute=gene_biotype:IG_V_pseudogene \ + --attribute=gene_biotype:IG_D_gene \ + --attribute=gene_biotype:IG_J_gene \ + --attribute=gene_biotype:IG_J_pseudogene \ + --attribute=gene_biotype:IG_C_gene \ + --attribute=gene_biotype:IG_C_pseudogene \ + --attribute=gene_biotype:TR_V_gene \ + --attribute=gene_biotype:TR_V_pseudogene \ + --attribute=gene_biotype:TR_D_gene \ + --attribute=gene_biotype:TR_J_gene \ + --attribute=gene_biotype:TR_J_pseudogene \ + --attribute=gene_biotype:TR_C_gene' + + + } + +} diff --git a/tests/modules/cellranger/mkgtf/test.yml b/tests/modules/cellranger/mkgtf/test.yml new file mode 100644 index 00000000..2130afd2 --- /dev/null +++ b/tests/modules/cellranger/mkgtf/test.yml @@ -0,0 +1,8 @@ +- name: cellranger mkgtf test_cellranger_mkgtf + command: nextflow run tests/modules/cellranger/mkgtf -entry test_cellranger_mkgtf -c tests/config/nextflow.config -c tests/modules/cellranger/mkgtf/nextflow.config + tags: + - cellranger + - cellranger/mkgtf + files: + - path: output/cellranger/genome.filtered.gtf + md5sum: a8b8a7b5039e05d3a9cf9151ea138b5b diff --git a/tests/modules/cellranger/mkref/main.nf b/tests/modules/cellranger/mkref/main.nf new file mode 100644 index 00000000..ad98ed1a --- /dev/null +++ b/tests/modules/cellranger/mkref/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CELLRANGER_MKREF } from '../../../../modules/cellranger/mkref/main.nf' + +workflow test_cellranger_mkref { + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) + reference_name = "homo_sapiens_chr22_reference" + + CELLRANGER_MKREF ( fasta, + gtf, + reference_name ) +} diff --git a/tests/modules/cellranger/mkref/nextflow.config b/tests/modules/cellranger/mkref/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/cellranger/mkref/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/cellranger/mkref/test.yml b/tests/modules/cellranger/mkref/test.yml new file mode 100644 index 00000000..eb01e9e2 --- /dev/null +++ b/tests/modules/cellranger/mkref/test.yml @@ -0,0 +1,43 @@ +- name: cellranger mkref test_cellranger_mkref + command: nextflow run ./tests/modules/cellranger/mkref -entry test_cellranger_mkref -c ./tests/config/nextflow.config -c ./tests/modules/cellranger/mkref/nextflow.config + tags: + - cellranger + - cellranger/mkref + files: + - path: output/cellranger/homo_sapiens_chr22_reference/fasta/genome.fa + md5sum: f315020d899597c1b57e5fe9f60f4c3e + - path: output/cellranger/homo_sapiens_chr22_reference/fasta/genome.fa.fai + md5sum: 3520cd30e1b100e55f578db9c855f685 + - path: output/cellranger/homo_sapiens_chr22_reference/genes/genes.gtf.gz + md5sum: 6d9b5f409bfea95022bc25b9590e194e + - path: output/cellranger/homo_sapiens_chr22_reference/reference.json + md5sum: a4e2b9bbf016c55b0d4d7bc1fa53896f + - path: output/cellranger/homo_sapiens_chr22_reference/star/Genome + md5sum: 22102926fadf5890e905ca71b2da3f35 + - path: output/cellranger/homo_sapiens_chr22_reference/star/SA + md5sum: bcf3e1a855783105150b46c905465333 + - path: output/cellranger/homo_sapiens_chr22_reference/star/SAindex + md5sum: b93fb07d342e6c32a00ebc4311c0ad38 + - path: output/cellranger/homo_sapiens_chr22_reference/star/chrLength.txt + md5sum: c81f40f27e72606d7d07097c1d56a5b5 + - path: output/cellranger/homo_sapiens_chr22_reference/star/chrName.txt + md5sum: 5ae68a67b70976ee95342a7451cb5af1 + - path: output/cellranger/homo_sapiens_chr22_reference/star/chrNameLength.txt + md5sum: b190587cae0531f3cf25552d8aa674db + - path: output/cellranger/homo_sapiens_chr22_reference/star/chrStart.txt + md5sum: bc73df776dd3d5bb9cfcbcba60880519 + - path: output/cellranger/homo_sapiens_chr22_reference/star/exonGeTrInfo.tab + md5sum: d04497f69d6ef889efd4d34fe63edcc4 + - path: output/cellranger/homo_sapiens_chr22_reference/star/exonInfo.tab + md5sum: 0d560290fab688b7268d88d5494bf9fe + - path: output/cellranger/homo_sapiens_chr22_reference/star/geneInfo.tab + md5sum: 8b608537307443ffaee4927d2b428805 + - path: output/cellranger/homo_sapiens_chr22_reference/star/genomeParameters.txt + - path: output/cellranger/homo_sapiens_chr22_reference/star/sjdbInfo.txt + md5sum: 5690ea9d9f09f7ff85b7fd47bd234903 + - path: output/cellranger/homo_sapiens_chr22_reference/star/sjdbList.fromGTF.out.tab + md5sum: 8760c33e966dad0b39f440301ebbdee4 + - path: output/cellranger/homo_sapiens_chr22_reference/star/sjdbList.out.tab + md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1 + - path: output/cellranger/homo_sapiens_chr22_reference/star/transcriptInfo.tab + md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 diff --git a/tests/modules/checkm/lineagewf/main.nf b/tests/modules/checkm/lineagewf/main.nf new file mode 100644 index 00000000..e914774c --- /dev/null +++ b/tests/modules/checkm/lineagewf/main.nf @@ -0,0 +1,24 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CHECKM_LINEAGEWF } from '../../../../modules/checkm/lineagewf/main.nf' + +workflow test_checkm_lineagewf { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true) ] + fasta_ext = 'fasta' + + CHECKM_LINEAGEWF ( input, fasta_ext ) +} + +workflow test_checkm_lineagewf_multi { + + input = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] ] + fasta_ext = 'fasta' + + CHECKM_LINEAGEWF ( input, fasta_ext ) +} diff --git a/tests/modules/checkm/lineagewf/nextflow.config b/tests/modules/checkm/lineagewf/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/checkm/lineagewf/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/checkm/lineagewf/test.yml b/tests/modules/checkm/lineagewf/test.yml new file mode 100644 index 00000000..6749f6aa --- /dev/null +++ b/tests/modules/checkm/lineagewf/test.yml @@ -0,0 +1,35 @@ +- name: checkm lineagewf + command: nextflow run ./tests/modules/checkm/lineagewf -entry test_checkm_lineagewf -c ./tests/config/nextflow.config -c ./tests/modules/checkm/lineagewf/nextflow.config + tags: + - checkm + - checkm/lineagewf + files: + - path: output/checkm/test.tsv + md5sum: d5559764f563c4b55223e4e4a3dc1ec9 + - path: output/checkm/test/checkm.log + contains: + - "INFO: Parsing HMM hits to marker genes:" + - path: output/checkm/test/lineage.ms + contains: + - "# [Lineage Marker File]" + - "contigs" + - "UID1" + +- name: checkm lineagewf_multi + command: nextflow run ./tests/modules/checkm/lineagewf -entry test_checkm_lineagewf_multi -c ./tests/config/nextflow.config -c ./tests/modules/checkm/lineagewf/nextflow.config + tags: + - checkm + - checkm/lineagewf + files: + - path: output/checkm/test.tsv + md5sum: 7e0fa177dcf151b84b7751813fbde3d1 + - path: output/checkm/test/checkm.log + contains: + - "INFO: Parsing HMM hits to marker genes:" + - path: output/checkm/test/lineage.ms + contains: + - "# [Lineage Marker File]" + - "contigs" + - "UID1" + - "genome" + diff --git a/tests/modules/chromap/chromap/main.nf b/tests/modules/chromap/chromap/main.nf new file mode 100644 index 00000000..5522f2b5 --- /dev/null +++ b/tests/modules/chromap/chromap/main.nf @@ -0,0 +1,78 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CHROMAP_INDEX } from '../../../../modules/chromap/index/main.nf' +include { CHROMAP_CHROMAP as CHROMAP_CHROMAP_BASE } from '../../../../modules/chromap/chromap/main.nf' +include { CHROMAP_CHROMAP as CHROMAP_CHROMAP_SAM } from '../../../../modules/chromap/chromap/main.nf' + +workflow test_chromap_chromap_single_end { + + // Test single-end and gz compressed output + 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) + + CHROMAP_INDEX ( fasta ) + CHROMAP_CHROMAP_BASE ( + input, // meta + read data + fasta, // reference genome + CHROMAP_INDEX.out.index, // reference index + [], // barcode file + [], // barcode whitelist + [], // chromosome order file + [] // pairs chromosome order file + ) +} + +workflow test_chromap_chromap_paired_end { + + // Test paired-end and gz compressed output + 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) + + CHROMAP_INDEX ( fasta ) + CHROMAP_CHROMAP_BASE ( + input, // meta + read data + fasta, // reference genome + CHROMAP_INDEX.out.index, // reference index + [], // barcode file + [], // barcode whitelist + [], // chromosome order file + [] // pairs chromosome order file + ) +} + +workflow test_chromap_chromap_paired_bam { + + // Test paired-end and bam output + 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) + + CHROMAP_INDEX ( fasta ) + CHROMAP_CHROMAP_SAM ( + input, // meta + read data + fasta, // reference genome + CHROMAP_INDEX.out.index, // reference index + [], // barcode file + [], // barcode whitelist + [], // chromosome order file + [] // pairs chromosome order file + ) +} diff --git a/tests/modules/chromap/chromap/nextflow.config b/tests/modules/chromap/chromap/nextflow.config new file mode 100644 index 00000000..1e979bb9 --- /dev/null +++ b/tests/modules/chromap/chromap/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: CHROMAP_CHROMAP_SAM { + ext.args = '--SAM' + } + +} diff --git a/tests/modules/chromap/chromap/test.yml b/tests/modules/chromap/chromap/test.yml new file mode 100644 index 00000000..20a51e2b --- /dev/null +++ b/tests/modules/chromap/chromap/test.yml @@ -0,0 +1,32 @@ +- name: chromap chromap test_chromap_chromap_single_end + command: nextflow run ./tests/modules/chromap/chromap -entry test_chromap_chromap_single_end -c ./tests/config/nextflow.config -c ./tests/modules/chromap/chromap/nextflow.config + tags: + - chromap/chromap + - chromap + files: + - path: output/chromap/genome.index + md5sum: f889d5f61d80823766af33277d27d386 + - path: output/chromap/test.bed.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + +- name: chromap chromap test_chromap_chromap_paired_end + command: nextflow run ./tests/modules/chromap/chromap -entry test_chromap_chromap_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/chromap/chromap/nextflow.config + tags: + - chromap/chromap + - chromap + files: + - path: output/chromap/genome.index + md5sum: f889d5f61d80823766af33277d27d386 + - path: output/chromap/test.bed.gz + md5sum: cafd8fb21977f5ae69e9008b220ab169 + +- name: chromap chromap test_chromap_chromap_paired_bam + command: nextflow run ./tests/modules/chromap/chromap -entry test_chromap_chromap_paired_bam -c ./tests/config/nextflow.config -c ./tests/modules/chromap/chromap/nextflow.config + tags: + - chromap/chromap + - chromap + files: + - path: output/chromap/genome.index + md5sum: f889d5f61d80823766af33277d27d386 + - path: output/chromap/test.bam + md5sum: bd1e3fe0f3abd1430ae191754f16a3ed diff --git a/tests/modules/chromap/index/main.nf b/tests/modules/chromap/index/main.nf new file mode 100644 index 00000000..18b42006 --- /dev/null +++ b/tests/modules/chromap/index/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CHROMAP_INDEX } from '../../../../modules/chromap/index/main.nf' + +workflow test_chromap_index { + + input = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + CHROMAP_INDEX ( input ) +} diff --git a/tests/modules/chromap/index/nextflow.config b/tests/modules/chromap/index/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/chromap/index/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/chromap/index/test.yml b/tests/modules/chromap/index/test.yml new file mode 100644 index 00000000..74cfadfc --- /dev/null +++ b/tests/modules/chromap/index/test.yml @@ -0,0 +1,8 @@ +- name: chromap index test_chromap_index + command: nextflow run ./tests/modules/chromap/index -entry test_chromap_index -c ./tests/config/nextflow.config -c ./tests/modules/chromap/index/nextflow.config + tags: + - chromap/index + - chromap + files: + - path: output/chromap/genome.index + md5sum: f889d5f61d80823766af33277d27d386 diff --git a/tests/modules/clonalframeml/main.nf b/tests/modules/clonalframeml/main.nf new file mode 100644 index 00000000..73773113 --- /dev/null +++ b/tests/modules/clonalframeml/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CLONALFRAMEML } from '../../../modules/clonalframeml/main.nf' + +workflow test_clonalframeml { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['haemophilus_influenzae']['genome']['genome_aln_nwk'], checkIfExists: true), + file(params.test_data['haemophilus_influenzae']['genome']['genome_aln_gz'], checkIfExists: true) + ] + + CLONALFRAMEML ( input ) +} diff --git a/tests/modules/clonalframeml/nextflow.config b/tests/modules/clonalframeml/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/clonalframeml/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/clonalframeml/test.yml b/tests/modules/clonalframeml/test.yml new file mode 100644 index 00000000..8ea11d16 --- /dev/null +++ b/tests/modules/clonalframeml/test.yml @@ -0,0 +1,15 @@ +- name: clonalframeml test_clonalframeml + command: nextflow run ./tests/modules/clonalframeml -entry test_clonalframeml -c ./tests/config/nextflow.config -c ./tests/modules/clonalframeml/nextflow.config + tags: + - clonalframeml + files: + - path: output/clonalframeml/test.ML_sequence.fasta + md5sum: 1b75cdaea78f5920ebb92125422a2589 + - path: output/clonalframeml/test.em.txt + md5sum: 5439d59897a9a90390bb175207bf2b9b + - path: output/clonalframeml/test.importation_status.txt + md5sum: 6ce9dbc7746b1c884af042fa02311fba + - path: output/clonalframeml/test.labelled_tree.newick + md5sum: aa47754eea8a3b6bab56bd7c83ba78db + - path: output/clonalframeml/test.position_cross_reference.txt + md5sum: 8ff60768b348fc6f7a1e787aca72f596 diff --git a/tests/modules/cmseq/polymut/main.nf b/tests/modules/cmseq/polymut/main.nf new file mode 100644 index 00000000..df6a0ac1 --- /dev/null +++ b/tests/modules/cmseq/polymut/main.nf @@ -0,0 +1,38 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CMSEQ_POLYMUT } from '../../../../modules/cmseq/polymut/main.nf' + +workflow test_cmseq_polymut_1 { + + input_1 = [ [ 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']['genome']['genome_gff3'], checkIfExists: true), + [] ] + + CMSEQ_POLYMUT( input_1 ) + +} + +workflow test_cmseq_polymut_2 { + input_2 = [ [ 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), + file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true), + [] ] + + CMSEQ_POLYMUT( input_2 ) +} + +workflow test_cmseq_polymut_3 { + input_3 = [ [ 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), + file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), ] + + CMSEQ_POLYMUT( input_3 ) +} + diff --git a/tests/modules/cmseq/polymut/nextflow.config b/tests/modules/cmseq/polymut/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/cmseq/polymut/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/cmseq/polymut/test.yml b/tests/modules/cmseq/polymut/test.yml new file mode 100644 index 00000000..05887fa8 --- /dev/null +++ b/tests/modules/cmseq/polymut/test.yml @@ -0,0 +1,26 @@ +- name: cmseq polymut test_cmseq_polymut_1 + command: nextflow run ./tests/modules/cmseq/polymut -entry test_cmseq_polymut_1 -c ./tests/config/nextflow.config -c ./tests/modules/cmseq/polymut/nextflow.config + tags: + - cmseq/polymut + - cmseq + files: + - path: output/cmseq/test.txt + md5sum: fd325c1724ee23d132a9115c64494efc + +- name: cmseq polymut test_cmseq_polymut_2 + command: nextflow run ./tests/modules/cmseq/polymut -entry test_cmseq_polymut_2 -c ./tests/config/nextflow.config -c ./tests/modules/cmseq/polymut/nextflow.config + tags: + - cmseq/polymut + - cmseq + files: + - path: output/cmseq/test.txt + md5sum: fd325c1724ee23d132a9115c64494efc + +- name: cmseq polymut test_cmseq_polymut_3 + command: nextflow run ./tests/modules/cmseq/polymut -entry test_cmseq_polymut_3 -c ./tests/config/nextflow.config -c ./tests/modules/cmseq/polymut/nextflow.config + tags: + - cmseq/polymut + - cmseq + files: + - path: output/cmseq/test.txt + md5sum: fd325c1724ee23d132a9115c64494efc diff --git a/tests/modules/cnvkit/batch/main.nf b/tests/modules/cnvkit/batch/main.nf new file mode 100755 index 00000000..6b40dec6 --- /dev/null +++ b/tests/modules/cnvkit/batch/main.nf @@ -0,0 +1,57 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CNVKIT_BATCH as CNVKIT_HYBRID } from '../../../../modules/cnvkit/batch/main.nf' +include { CNVKIT_BATCH as CNVKIT_WGS } from '../../../../modules/cnvkit/batch/main.nf' +include { CNVKIT_BATCH as CNVKIT_TUMORONLY } from '../../../../modules/cnvkit/batch/main.nf' + +workflow test_cnvkit_hybrid { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true) + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + targets = file(params.test_data['sarscov2']['genome']['baits_bed'], checkIfExists: true) + + CNVKIT_HYBRID ( input, fasta, targets, [] ) +} + +workflow test_cnvkit_wgs { + + input = [ + [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true), + 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) + + CNVKIT_WGS ( input, fasta, [], [] ) +} + +workflow test_cnvkit_cram { + + input = [ + [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true), + 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) + + CNVKIT_WGS ( input, fasta, [], [] ) +} + +workflow test_cnvkit_tumoronly { + + input = [ + [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true), + [] + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + reference = file(params.test_data['generic']['cnn']['reference'], checkIfExists: true) + + CNVKIT_TUMORONLY ( input, [], [], reference ) +} diff --git a/tests/modules/cnvkit/batch/nextflow.config b/tests/modules/cnvkit/batch/nextflow.config new file mode 100644 index 00000000..b8a8fc3f --- /dev/null +++ b/tests/modules/cnvkit/batch/nextflow.config @@ -0,0 +1,17 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: CNVKIT_HYBRID { + ext.args = '--output-reference reference.cnn' + } + + withName: CNVKIT_WGS { + ext.args = '--output-reference reference.cnn --method wgs' + } + + withName: CNVKIT_TUMORONLY { + ext.args = '--method wgs' + } + +} diff --git a/tests/modules/cnvkit/batch/test.yml b/tests/modules/cnvkit/batch/test.yml new file mode 100755 index 00000000..57af3603 --- /dev/null +++ b/tests/modules/cnvkit/batch/test.yml @@ -0,0 +1,101 @@ +- name: cnvkit batch test_cnvkit_hybrid + command: nextflow run ./tests/modules/cnvkit/batch -entry test_cnvkit_hybrid -c ./tests/config/nextflow.config -c ./tests/modules/cnvkit/batch/nextflow.config + tags: + - cnvkit/batch + - cnvkit + files: + - path: output/cnvkit/baits.antitarget.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/cnvkit/baits.target.bed + md5sum: 26d25ff2d6c45b6d92169b3559c6acdb + - path: output/cnvkit/reference.cnn + md5sum: ac99c1ad8b917b96ae15119146c91ab9 + - path: output/cnvkit/test.paired_end.sorted.antitargetcoverage.cnn + md5sum: 203caf8cef6935bb50b4138097955cb8 + - path: output/cnvkit/test.paired_end.sorted.bintest.cns + md5sum: 6544d979475def8a9f69ba42a985668d + - path: output/cnvkit/test.paired_end.sorted.call.cns + md5sum: f2ca59b4d50b0c317adc526c1b99b622 + - path: output/cnvkit/test.paired_end.sorted.cnr + md5sum: 7e37d73ab604dbc3fe4ebb56aca9bdc3 + - path: output/cnvkit/test.paired_end.sorted.cns + md5sum: 060af1aa637ed51812af19bcce24fcfe + - path: output/cnvkit/test.paired_end.sorted.targetcoverage.cnn + md5sum: 3fe80b6013ffc3e9968345e810158215 + - path: output/cnvkit/test.single_end.sorted.antitargetcoverage.cnn + md5sum: 203caf8cef6935bb50b4138097955cb8 + - path: output/cnvkit/test.single_end.sorted.targetcoverage.cnn + md5sum: aa8a018b1d4d1e688c9f9f6ae01bf4d7 + +- name: cnvkit batch test_cnvkit_wgs + command: nextflow run ./tests/modules/cnvkit/batch -entry test_cnvkit_wgs -c ./tests/config/nextflow.config -c ./tests/modules/cnvkit/batch/nextflow.config + tags: + - cnvkit/batch + - cnvkit + files: + - path: output/cnvkit/genome.antitarget.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/cnvkit/genome.bed + md5sum: 87a15eb9c2ff20ccd5cd8735a28708f7 + - path: output/cnvkit/genome.target.bed + md5sum: a13353ae9c8405e701390c069255bbd2 + - path: output/cnvkit/reference.cnn + md5sum: 05c6211e0179885b8a83e44fd21d5f86 + - path: output/cnvkit/test.paired_end.sorted.antitargetcoverage.cnn + md5sum: 203caf8cef6935bb50b4138097955cb8 + - path: output/cnvkit/test.paired_end.sorted.targetcoverage.cnn + md5sum: ff526714696aa49bdc1dc8d00d965266 + - path: output/cnvkit/test2.paired_end.sorted.antitargetcoverage.cnn + md5sum: 203caf8cef6935bb50b4138097955cb8 + - path: output/cnvkit/test2.paired_end.sorted.bintest.cns + md5sum: 6544d979475def8a9f69ba42a985668d + - path: output/cnvkit/test2.paired_end.sorted.call.cns + md5sum: f6de754c34f780e6befee5b3ff0893f8 + - path: output/cnvkit/test2.paired_end.sorted.cnr + md5sum: 80318d06c6b095945a0fb0e85e887cbc + - path: output/cnvkit/test2.paired_end.sorted.cns + md5sum: 76afa47afc4bd5de35aee8fdb54d3d3a + - path: output/cnvkit/test2.paired_end.sorted.targetcoverage.cnn + md5sum: 6ae6b3fce7299eedca6133d911c38fe1 + +- name: cnvkit batch test_cnvkit_cram + command: nextflow run ./tests/modules/cnvkit/batch -entry test_cnvkit_cram -c ./tests/config/nextflow.config -c ./tests/modules/cnvkit/batch/nextflow.config + tags: + - cnvkit/batch + - cnvkit + files: + - path: output/cnvkit/genome.antitarget.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/cnvkit/genome.bed + md5sum: 87a15eb9c2ff20ccd5cd8735a28708f7 + - path: output/cnvkit/genome.target.bed + md5sum: a13353ae9c8405e701390c069255bbd2 + - path: output/cnvkit/reference.cnn + md5sum: 05c6211e0179885b8a83e44fd21d5f86 + - path: output/cnvkit/test.paired_end.sorted.antitargetcoverage.cnn + md5sum: 203caf8cef6935bb50b4138097955cb8 + - path: output/cnvkit/test.paired_end.sorted.targetcoverage.cnn + md5sum: ff526714696aa49bdc1dc8d00d965266 + - path: output/cnvkit/test2.paired_end.sorted.antitargetcoverage.cnn + md5sum: 203caf8cef6935bb50b4138097955cb8 + - path: output/cnvkit/test2.paired_end.sorted.bintest.cns + md5sum: 6544d979475def8a9f69ba42a985668d + - path: output/cnvkit/test2.paired_end.sorted.call.cns + md5sum: f6de754c34f780e6befee5b3ff0893f8 + - path: output/cnvkit/test2.paired_end.sorted.cnr + md5sum: 80318d06c6b095945a0fb0e85e887cbc + - path: output/cnvkit/test2.paired_end.sorted.cns + md5sum: 76afa47afc4bd5de35aee8fdb54d3d3a + - path: output/cnvkit/test2.paired_end.sorted.targetcoverage.cnn + md5sum: 6ae6b3fce7299eedca6133d911c38fe1 + +- name: cnvkit batch test_cnvkit_tumoronly + command: nextflow run ./tests/modules/cnvkit/batch -entry test_cnvkit_tumoronly -c ./tests/config/nextflow.config -c ./tests/modules/cnvkit/batch/nextflow.config + tags: + - cnvkit/batch + - cnvkit + files: + - path: output/cnvkit/reference.antitarget-tmp.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/cnvkit/reference.target-tmp.bed + md5sum: 26d25ff2d6c45b6d92169b3559c6acdb diff --git a/tests/modules/cnvkit/main.nf b/tests/modules/cnvkit/main.nf deleted file mode 100755 index 6ee959ab..00000000 --- a/tests/modules/cnvkit/main.nf +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { CNVKIT } from '../../../modules/cnvkit/main.nf' addParams( options: [ 'args': '--output-reference reference.cnn' ] ) - -workflow test_cnvkit { - tumourbam = file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) - normalbam = file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true) - - input = [ [ id:'test' ], // meta map - tumourbam, - normalbam - ] - fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - targets = file(params.test_data['sarscov2']['genome']['baits_bed'], checkIfExists: true) - - CNVKIT ( input, fasta, targets ) -} diff --git a/tests/modules/cnvkit/test.yml b/tests/modules/cnvkit/test.yml deleted file mode 100755 index 6e09d6f3..00000000 --- a/tests/modules/cnvkit/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -- name: cnvkit - command: nextflow run ./tests/modules/cnvkit/ -entry test_cnvkit -c tests/config/nextflow.config - tags: - - cnvkit - files: - - path: output/cnvkit/baits.target.bed - md5sum: 26d25ff2d6c45b6d92169b3559c6acdb - - path: output/cnvkit/baits.antitarget.bed - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/cnvkit/reference.cnn - md5sum: ac99c1ad8b917b96ae15119146c91ab9 - - path: output/cnvkit/test.paired_end.sorted.targetcoverage.cnn - md5sum: 3fe80b6013ffc3e9968345e810158215 - - path: output/cnvkit/test.paired_end.sorted.antitargetcoverage.cnn - md5sum: 203caf8cef6935bb50b4138097955cb8 - - path: output/cnvkit/test.single_end.sorted.targetcoverage.cnn - md5sum: aa8a018b1d4d1e688c9f9f6ae01bf4d7 - - path: output/cnvkit/test.single_end.sorted.antitargetcoverage.cnn - md5sum: 203caf8cef6935bb50b4138097955cb8 - - path: output/cnvkit/test.paired_end.sorted.cnr - md5sum: 7e37d73ab604dbc3fe4ebb56aca9bdc3 - - path: output/cnvkit/test.paired_end.sorted.cns - md5sum: 060af1aa637ed51812af19bcce24fcfe - - path: output/cnvkit/test.paired_end.sorted.bintest.cns - md5sum: 6544d979475def8a9f69ba42a985668d - - path: output/cnvkit/test.paired_end.sorted.call.cns - md5sum: f2ca59b4d50b0c317adc526c1b99b622 diff --git a/tests/modules/cooler/cload/main.nf b/tests/modules/cooler/cload/main.nf new file mode 100644 index 00000000..170b7e11 --- /dev/null +++ b/tests/modules/cooler/cload/main.nf @@ -0,0 +1,52 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { COOLER_CLOAD } from '../../../../modules/cooler/cload/main.nf' +include { COOLER_CLOAD as COOLER_CLOAD_PAIRS } from '../../../../modules/cooler/cload/main.nf' +include { COOLER_CLOAD as COOLER_CLOAD_TABIX } from '../../../../modules/cooler/cload/main.nf' +include { COOLER_DUMP } from '../../../../modules/cooler/dump/main.nf' +include { COOLER_DUMP as COOLER_DUMP_PAIRS} from '../../../../modules/cooler/dump/main.nf' +include { COOLER_DUMP as COOLER_DUMP_TABIX} from '../../../../modules/cooler/dump/main.nf' + +workflow test_cooler_cload_pairix { + + input = [ [ id:'test_pairix', single_end:false ], // meta map + file(params.test_data['generic']['cooler']['test_pairix_pair_gz'], checkIfExists: true), + file(params.test_data['generic']['cooler']['test_pairix_pair_gz_px2'], checkIfExists: true)] + + sizes = file(params.test_data['generic']['cooler']['hg19_chrom_sizes'], checkIfExists: true) + bin_size = 2000000 + + COOLER_CLOAD ( input, bin_size, sizes ) + COOLER_DUMP(COOLER_CLOAD.out.cool.map{[it[0], it[2]]}, []) + +} + +workflow test_cooler_cload_pairs { + + input = [ [ id:'test_pairs', single_end:false ], // meta map + file(params.test_data['generic']['cooler']['test_pairs_pair'], checkIfExists: true), + []] + + sizes = file(params.test_data['generic']['cooler']['hg19_chrom_sizes'], checkIfExists: true) + bin_size = 2000000 + + COOLER_CLOAD_PAIRS ( input, bin_size, sizes ) + COOLER_DUMP_PAIRS(COOLER_CLOAD_PAIRS.out.cool.map{[it[0], it[2]]}, []) + +} + +workflow test_cooler_cload_tabix { + + input = [ [ id:'test_tabix', single_end:false ], // meta map + file(params.test_data['generic']['cooler']['test_tabix_pair_gz'], checkIfExists: true), + file(params.test_data['generic']['cooler']['test_tabix_pair_gz_tbi'], checkIfExists: true)] + + sizes = file(params.test_data['generic']['cooler']['hg19_chrom_sizes'], checkIfExists: true) + bin_size = 2000000 + + COOLER_CLOAD_TABIX ( input, bin_size, sizes ) + COOLER_DUMP_TABIX(COOLER_CLOAD_TABIX.out.cool.map{[it[0], it[2]]}, []) + +} diff --git a/tests/modules/cooler/cload/nextflow.config b/tests/modules/cooler/cload/nextflow.config new file mode 100644 index 00000000..610a5425 --- /dev/null +++ b/tests/modules/cooler/cload/nextflow.config @@ -0,0 +1,17 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: COOLER_CLOAD { + ext.args = 'pairix' + } + + withName: COOLER_CLOAD_PAIRS { + ext.args = 'pairs --chrom1 1 --pos1 2 --chrom2 4 --pos2 5 -N' + } + + withName: COOLER_CLOAD_TABIX { + ext.args = 'tabix' + } + +} diff --git a/tests/modules/cooler/cload/test.yml b/tests/modules/cooler/cload/test.yml new file mode 100644 index 00000000..f99f4624 --- /dev/null +++ b/tests/modules/cooler/cload/test.yml @@ -0,0 +1,29 @@ +- name: cooler cload test_cooler_cload_pairix + command: nextflow run ./tests/modules/cooler/cload -entry test_cooler_cload_pairix -c ./tests/config/nextflow.config -c ./tests/modules/cooler/cload/nextflow.config + tags: + - cooler/cload + - cooler + files: + - path: output/cooler/test_pairix.2000000.cool + - path: output/cooler/test_pairix.bedpe + md5sum: 0cd85311089669688ec17468eae02111 + +- name: cooler cload test_cooler_cload_pairs + command: nextflow run ./tests/modules/cooler/cload -entry test_cooler_cload_pairs -c ./tests/config/nextflow.config -c ./tests/modules/cooler/cload/nextflow.config + tags: + - cooler/cload + - cooler + files: + - path: output/cooler/test_pairs.2000000.cool + - path: output/cooler/test_pairs.bedpe + md5sum: 7f832733fc7853ebb1937b33e4c1e0de + +- name: cooler cload test_cooler_cload_tabix + command: nextflow run ./tests/modules/cooler/cload -entry test_cooler_cload_tabix -c ./tests/config/nextflow.config -c ./tests/modules/cooler/cload/nextflow.config + tags: + - cooler/cload + - cooler + files: + - path: output/cooler/test_tabix.2000000.cool + - path: output/cooler/test_tabix.bedpe + md5sum: 0cd85311089669688ec17468eae02111 diff --git a/tests/modules/cooler/digest/main.nf b/tests/modules/cooler/digest/main.nf index 817c9081..4dfa25be 100644 --- a/tests/modules/cooler/digest/main.nf +++ b/tests/modules/cooler/digest/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { COOLER_DIGEST } from '../../../../modules/cooler/digest/main.nf' addParams( options: [:] ) +include { COOLER_DIGEST } from '../../../../modules/cooler/digest/main.nf' workflow test_cooler_digest { diff --git a/tests/modules/cooler/digest/nextflow.config b/tests/modules/cooler/digest/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/cooler/digest/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/cooler/digest/test.yml b/tests/modules/cooler/digest/test.yml index b594a232..80430ed7 100644 --- a/tests/modules/cooler/digest/test.yml +++ b/tests/modules/cooler/digest/test.yml @@ -1,5 +1,5 @@ - name: cooler digest test_cooler_digest - command: nextflow run tests/modules/cooler/digest -entry test_cooler_digest -c tests/config/nextflow.config + command: nextflow run ./tests/modules/cooler/digest -entry test_cooler_digest -c ./tests/config/nextflow.config -c ./tests/modules/cooler/digest/nextflow.config tags: - cooler/digest - cooler diff --git a/tests/modules/cooler/dump/main.nf b/tests/modules/cooler/dump/main.nf index e2a647c5..d80ee0d7 100644 --- a/tests/modules/cooler/dump/main.nf +++ b/tests/modules/cooler/dump/main.nf @@ -2,12 +2,12 @@ nextflow.enable.dsl = 2 -include { COOLER_DUMP } from '../../../../modules/cooler/dump/main.nf' addParams( options: [:] ) +include { COOLER_DUMP } from '../../../../modules/cooler/dump/main.nf' workflow test_cooler_dump { input = [ [ id:'test' ], // meta map file("https://raw.githubusercontent.com/open2c/cooler/master/tests/data/toy.asymm.16.cool", checkIfExists: true) ] - COOLER_DUMP ( input ) + COOLER_DUMP ( input, [:] ) } diff --git a/tests/modules/cooler/dump/nextflow.config b/tests/modules/cooler/dump/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/cooler/dump/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/cooler/dump/test.yml b/tests/modules/cooler/dump/test.yml index ccfc5f47..6f81c7a9 100644 --- a/tests/modules/cooler/dump/test.yml +++ b/tests/modules/cooler/dump/test.yml @@ -1,5 +1,5 @@ - name: cooler dump test_cooler_dump - command: nextflow run tests/modules/cooler/dump -entry test_cooler_dump -c tests/config/nextflow.config + command: nextflow run ./tests/modules/cooler/dump -entry test_cooler_dump -c ./tests/config/nextflow.config -c ./tests/modules/cooler/dump/nextflow.config tags: - cooler/dump - cooler diff --git a/tests/modules/cooler/merge/main.nf b/tests/modules/cooler/merge/main.nf new file mode 100644 index 00000000..81336984 --- /dev/null +++ b/tests/modules/cooler/merge/main.nf @@ -0,0 +1,20 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { COOLER_MERGE } from '../../../../modules/cooler/merge/main.nf' +include { COOLER_DUMP } from '../../../../modules/cooler/dump/main.nf' + +workflow test_cooler_merge { + + input = [ + [ id:'test' ], // meta map + [ + file(params.test_data['generic']['cooler']['test_merge_cool'], checkIfExists: true), + file(params.test_data['generic']['cooler']['test_merge_cool_cp2'], checkIfExists: true) + ] + ] + + COOLER_MERGE ( input ) + COOLER_DUMP ( COOLER_MERGE.out.cool, "" ) +} diff --git a/tests/modules/cooler/merge/nextflow.config b/tests/modules/cooler/merge/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/cooler/merge/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/cooler/merge/test.yml b/tests/modules/cooler/merge/test.yml new file mode 100644 index 00000000..c884ba5e --- /dev/null +++ b/tests/modules/cooler/merge/test.yml @@ -0,0 +1,8 @@ +- name: cooler merge test_cooler_merge + command: nextflow run ./tests/modules/cooler/merge -entry test_cooler_merge -c ./tests/config/nextflow.config -c ./tests/modules/cooler/merge/nextflow.config + tags: + - cooler/merge + - cooler + files: + - path: output/cooler/test.bedpe + md5sum: 0ce5e715bfc4674cdda02f2d7e7e3170 diff --git a/tests/modules/cooler/zoomify/main.nf b/tests/modules/cooler/zoomify/main.nf new file mode 100644 index 00000000..42edadb8 --- /dev/null +++ b/tests/modules/cooler/zoomify/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { COOLER_ZOOMIFY } from '../../../../modules/cooler/zoomify/main.nf' + +workflow test_cooler_zoomify { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['generic']['cooler']['test_merge_cool'], checkIfExists: true) + ] + + COOLER_ZOOMIFY ( input ) +} diff --git a/tests/modules/cooler/zoomify/nextflow.config b/tests/modules/cooler/zoomify/nextflow.config new file mode 100644 index 00000000..d4c3503f --- /dev/null +++ b/tests/modules/cooler/zoomify/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: COOLER_ZOOMIFY { + ext.args = '-r 2,4,8' + } + +} diff --git a/tests/modules/cooler/zoomify/test.yml b/tests/modules/cooler/zoomify/test.yml new file mode 100644 index 00000000..3afdb8a6 --- /dev/null +++ b/tests/modules/cooler/zoomify/test.yml @@ -0,0 +1,8 @@ +- name: cooler zoomify test_cooler_zoomify + command: nextflow run ./tests/modules/cooler/zoomify -entry test_cooler_zoomify -c ./tests/config/nextflow.config -c ./tests/modules/cooler/zoomify/nextflow.config + tags: + - cooler + - cooler/zoomify + files: + - path: output/cooler/test.bedpe + md5sum: 0ce5e715bfc4674cdda02f2d7e7e3170 diff --git a/tests/modules/csvtk/concat/main.nf b/tests/modules/csvtk/concat/main.nf new file mode 100644 index 00000000..aee31679 --- /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' + +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/nextflow.config b/tests/modules/csvtk/concat/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/csvtk/concat/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/csvtk/concat/test.yml b/tests/modules/csvtk/concat/test.yml new file mode 100644 index 00000000..11a2af67 --- /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 -c ./tests/modules/csvtk/concat/nextflow.config + tags: + - csvtk + - csvtk/concat + files: + - path: output/csvtk/test.csv + md5sum: 917fe5d857f04b58e0f49c384d167cec diff --git a/tests/modules/csvtk/split/main.nf b/tests/modules/csvtk/split/main.nf new file mode 100644 index 00000000..31d24d61 --- /dev/null +++ b/tests/modules/csvtk/split/main.nf @@ -0,0 +1,27 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CSVTK_SPLIT } from '../../../../modules/csvtk/split/main.nf' + +workflow test_csvtk_split_tsv { + + input = [ + [ id:'test' ], // meta map + [ file(params.test_data['generic']['tsv']['test_tsv'], checkIfExists: true) ] + ] + in_format = "tsv" + out_format = "tsv" + CSVTK_SPLIT ( input, in_format, out_format ) +} + +workflow test_csvtk_split_csv { + + input = [ + [ id:'test' ], // meta map + [ file(params.test_data['generic']['csv']['test_csv'], checkIfExists: true) ] + ] + in_format = "csv" + out_format = "csv" + CSVTK_SPLIT( input, in_format, out_format ) +} diff --git a/tests/modules/csvtk/split/nextflow.config b/tests/modules/csvtk/split/nextflow.config new file mode 100644 index 00000000..1dbd7615 --- /dev/null +++ b/tests/modules/csvtk/split/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: CSVTK_SPLIT { + ext.args = "-C \'&\' --fields \'first_name\' " + } + +} diff --git a/tests/modules/csvtk/split/test.yml b/tests/modules/csvtk/split/test.yml new file mode 100644 index 00000000..bd13cca6 --- /dev/null +++ b/tests/modules/csvtk/split/test.yml @@ -0,0 +1,25 @@ +- name: csvtk split test_csvtk_split_tsv + command: nextflow run ./tests/modules/csvtk/split -entry test_csvtk_split_tsv -c ./tests/config/nextflow.config -c ./tests/modules/csvtk/split/nextflow.config + tags: + - csvtk/split + - csvtk + files: + - path: output/csvtk/test-Ken.tsv + md5sum: 589a2add7f0b8e998d4959e5d883e7d5 + - path: output/csvtk/test-Rob.tsv + md5sum: 6c5555d689c4e685d35d6e394ad6e1e6 + - path: output/csvtk/test-Robert.tsv + md5sum: 45ae6da8111096746d1736d34220a3ec + +- name: csvtk split test_csvtk_split_csv + command: nextflow run ./tests/modules/csvtk/split -entry test_csvtk_split_csv -c ./tests/config/nextflow.config -c ./tests/modules/csvtk/split/nextflow.config + tags: + - csvtk/split + - csvtk + files: + - path: output/csvtk/test-Ken.csv + md5sum: 71a931dae6f15f5ddb0318c7d4afe81e + - path: output/csvtk/test-Rob.csv + md5sum: efc4bc507021043a3bf2fb0724c4a216 + - path: output/csvtk/test-Robert.csv + md5sum: 8de2f076e64252c2abed69b9c2a3a386 diff --git a/tests/modules/custom/dumpsoftwareversions/main.nf b/tests/modules/custom/dumpsoftwareversions/main.nf new file mode 100644 index 00000000..95a43a82 --- /dev/null +++ b/tests/modules/custom/dumpsoftwareversions/main.nf @@ -0,0 +1,55 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { FASTQC } from '../../../../modules/fastqc/main.nf' +include { MULTIQC } from '../../../../modules/multiqc/main.nf' +include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../../../../modules/custom/dumpsoftwareversions/main.nf' + +workflow fastqc1 { + take: + input + + main: + FASTQC ( input ) + + emit: + versions = FASTQC.out.versions +} + +workflow fastqc2 { + take: + input + + main: + FASTQC ( input ) + + emit: + versions = FASTQC.out.versions + zip = FASTQC.out.zip +} + +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) + ] + ] + + // Using subworkflows to ensure that the script can properly handle + // cases where subworkflows have a module with the same name. + fastqc1 ( input ) + fastqc2 ( input ) + MULTIQC ( fastqc2.out.zip.collect { it[1] } ) + + fastqc1 + .out + .versions + .mix(fastqc2.out.versions) + .mix(MULTIQC.out.versions) + .set { ch_software_versions } + + CUSTOM_DUMPSOFTWAREVERSIONS ( ch_software_versions.collectFile() ) +} diff --git a/tests/modules/custom/dumpsoftwareversions/nextflow.config b/tests/modules/custom/dumpsoftwareversions/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/custom/dumpsoftwareversions/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/custom/dumpsoftwareversions/test.yml b/tests/modules/custom/dumpsoftwareversions/test.yml new file mode 100644 index 00000000..363a1218 --- /dev/null +++ b/tests/modules/custom/dumpsoftwareversions/test.yml @@ -0,0 +1,14 @@ +- name: custom dumpsoftwareversions + command: nextflow run ./tests/modules/custom/dumpsoftwareversions -entry test_custom_dumpsoftwareversions -c ./tests/config/nextflow.config -c ./tests/modules/custom/dumpsoftwareversions/nextflow.config + tags: + - custom + - custom/dumpsoftwareversions + files: + - path: output/custom/software_versions.yml + contains: + - FASTQC + - MULTIQC + must_not_contain: + - fastqc1 + - fastqc2 + - path: output/custom/software_versions_mqc.yml diff --git a/tests/modules/custom/getchromsizes/main.nf b/tests/modules/custom/getchromsizes/main.nf new file mode 100644 index 00000000..b4f9fb9f --- /dev/null +++ b/tests/modules/custom/getchromsizes/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CUSTOM_GETCHROMSIZES } from '../../../../modules/custom/getchromsizes/main.nf' + +workflow test_custom_getchromsizes { + + input = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + CUSTOM_GETCHROMSIZES ( input ) +} diff --git a/tests/modules/custom/getchromsizes/nextflow.config b/tests/modules/custom/getchromsizes/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/custom/getchromsizes/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/custom/getchromsizes/test.yml b/tests/modules/custom/getchromsizes/test.yml new file mode 100644 index 00000000..9a770ad4 --- /dev/null +++ b/tests/modules/custom/getchromsizes/test.yml @@ -0,0 +1,10 @@ +- name: custom getchromsizes + command: nextflow run ./tests/modules/custom/getchromsizes -entry test_custom_getchromsizes -c ./tests/config/nextflow.config -c ./tests/modules/custom/getchromsizes/nextflow.config + tags: + - custom + - custom/getchromsizes + files: + - path: output/custom/genome.fasta.fai + md5sum: 9da2a56e2853dc8c0b86a9e7229c9fe5 + - path: output/custom/genome.fasta.sizes + md5sum: a57c401f27ae5133823fb09fb21c8a3c diff --git a/tests/modules/cutadapt/main.nf b/tests/modules/cutadapt/main.nf index 8e060398..a47feebb 100644 --- a/tests/modules/cutadapt/main.nf +++ b/tests/modules/cutadapt/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { CUTADAPT } from '../../../modules/cutadapt/main.nf' addParams( options: [ args:'-q 25' ] ) +include { CUTADAPT } from '../../../modules/cutadapt/main.nf' // // Test with single-end data diff --git a/tests/modules/cutadapt/nextflow.config b/tests/modules/cutadapt/nextflow.config new file mode 100644 index 00000000..2af532cc --- /dev/null +++ b/tests/modules/cutadapt/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: CUTADAPT { + ext.args = '-q 25' + } + +} diff --git a/tests/modules/cutadapt/test.yml b/tests/modules/cutadapt/test.yml index 40710dc5..6fa0eb4f 100644 --- a/tests/modules/cutadapt/test.yml +++ b/tests/modules/cutadapt/test.yml @@ -1,5 +1,5 @@ - name: cutadapt single-end - command: nextflow run ./tests/modules/cutadapt -entry test_cutadapt_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/cutadapt -entry test_cutadapt_single_end -c ./tests/config/nextflow.config -c ./tests/modules/cutadapt/nextflow.config tags: - cutadapt files: @@ -7,7 +7,7 @@ - path: ./output/cutadapt/test.trim.fastq.gz - name: cutadapt paired-end - command: nextflow run ./tests/modules/cutadapt -entry test_cutadapt_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/cutadapt -entry test_cutadapt_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/cutadapt/nextflow.config tags: - cutadapt files: diff --git a/tests/modules/damageprofiler/main.nf b/tests/modules/damageprofiler/main.nf index 5b128770..9207caf1 100644 --- a/tests/modules/damageprofiler/main.nf +++ b/tests/modules/damageprofiler/main.nf @@ -2,14 +2,38 @@ nextflow.enable.dsl = 2 -include { DAMAGEPROFILER } from '../../../modules/damageprofiler/main.nf' addParams( options: [:] ) +include { DAMAGEPROFILER } from '../../../modules/damageprofiler/main.nf' 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/nextflow.config b/tests/modules/damageprofiler/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/damageprofiler/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/damageprofiler/test.yml b/tests/modules/damageprofiler/test.yml index 357647be..4a560ce1 100644 --- a/tests/modules/damageprofiler/test.yml +++ b/tests/modules/damageprofiler/test.yml @@ -1,16 +1,16 @@ - name: damageprofiler - command: nextflow run ./tests/modules/damageprofiler -entry test_damageprofiler -c tests/config/nextflow.config -dump-channels + command: nextflow run ./tests/modules/damageprofiler -entry test_damageprofiler -c ./tests/config/nextflow.config -dump-channels -c ./tests/modules/damageprofiler/nextflow.config tags: - 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 -c ./tests/modules/damageprofiler/nextflow.config + 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 -c ./tests/modules/damageprofiler/nextflow.config + 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 diff --git a/tests/modules/dastool/dastool/main.nf b/tests/modules/dastool/dastool/main.nf new file mode 100644 index 00000000..f6f6becf --- /dev/null +++ b/tests/modules/dastool/dastool/main.nf @@ -0,0 +1,33 @@ +#!/usr/bin/env nextflow +nextflow.enable.dsl = 2 + +include { METABAT2_METABAT2 } from '../../../../modules/metabat2/metabat2/main.nf' +include { METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS } from '../../../../modules/metabat2/jgisummarizebamcontigdepths/main.nf' +include { DASTOOL_SCAFFOLDS2BIN } from '../../../../modules/dastool/scaffolds2bin/main.nf' +include { DASTOOL_DASTOOL } from '../../../../modules/dastool/dastool/main.nf' + +workflow test_dastool_dastool { + + input_depth = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam_bai'], checkIfExists: true) ] + + METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS ( input_depth ) + + Channel.fromPath(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) + .map { it -> [[ id:'test', single_end:false ], it] } + .join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) + .set { input_metabat2 } + + METABAT2_METABAT2 ( input_metabat2 ) + + DASTOOL_SCAFFOLDS2BIN ( METABAT2_METABAT2.out.fasta.collect(), "fa") + + Channel.of([ [ id:'test', single_end:false ], // meta map + file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true)]) + .join(DASTOOL_SCAFFOLDS2BIN.out.scaffolds2bin) + .set {input_dastool} + + + DASTOOL_DASTOOL ( input_dastool, [], [], [] ) +} diff --git a/tests/modules/dastool/dastool/nextflow.config b/tests/modules/dastool/dastool/nextflow.config new file mode 100644 index 00000000..e306b4b4 --- /dev/null +++ b/tests/modules/dastool/dastool/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: METABAT2_METABAT2 { + ext.args = '--minContig 1500 --minCV 0.1 --minCVSum 0.1 --minClsSize 10 --minS 2' + } + + withName: DASTOOL_DASTOOL { + ext.args = '--score_threshold 0 --debug' + } + +} diff --git a/tests/modules/dastool/dastool/test.yml b/tests/modules/dastool/dastool/test.yml new file mode 100644 index 00000000..e2161890 --- /dev/null +++ b/tests/modules/dastool/dastool/test.yml @@ -0,0 +1,29 @@ +- name: dastool dastool test_dastool_dastool + command: nextflow run ./tests/modules/dastool/dastool -entry test_dastool_dastool -c ./tests/config/nextflow.config -c ./tests/modules/dastool/dastool/nextflow.config + tags: + - dastool + - dastool/dastool + files: + - path: output/dastool/test.seqlength + md5sum: b815a5811008c36808a59b1d0dcfab24 + - path: output/dastool/test.tsv + md5sum: 6e46c0be14dded7cb13af38f54feea47 + - path: output/dastool/test_DASTool.log + contains: + - 'DAS Tool run on' + - path: output/dastool/test_DASTool_scaffolds2bin.txt + md5sum: 6e46c0be14dded7cb13af38f54feea47 + - path: output/dastool/test_DASTool_summary.txt + md5sum: a3efa8717b30dfada78dc5ae9a3dc396 + - path: output/dastool/test_proteins.faa.archaea.scg + md5sum: e79d82eecee25821d1658ea4f082601d + - path: output/dastool/test_proteins.faa.bacteria.scg + md5sum: 8132cfb17cf398d41c036ead55c96ffe + - path: output/dastool/test_test.tsv.eval + md5sum: a3efa8717b30dfada78dc5ae9a3dc396 + - path: output/metabat2/bins/test.1.fa.gz + md5sum: 2b297bf557cc3831b800348859331268 + - path: output/metabat2/test.tsv.gz + md5sum: 619338fa5019e361d5545ce385a6961f + - path: output/metabat2/test.txt.gz + md5sum: 745a0446af6ef68b930975e9ce5a95d6 diff --git a/tests/modules/dastool/scaffolds2bin/main.nf b/tests/modules/dastool/scaffolds2bin/main.nf new file mode 100644 index 00000000..a0cd6726 --- /dev/null +++ b/tests/modules/dastool/scaffolds2bin/main.nf @@ -0,0 +1,25 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { METABAT2_METABAT2 } from '../../../../modules/metabat2/metabat2/main.nf' +include { METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS } from '../../../../modules/metabat2/jgisummarizebamcontigdepths/main.nf' +include { DASTOOL_SCAFFOLDS2BIN } from '../../../../modules/dastool/scaffolds2bin/main.nf' + +workflow test_dastool_scaffolds2bin { + + input_depth = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam_bai'], checkIfExists: true) ] + + METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS ( input_depth ) + + Channel.fromPath(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) + .map { it -> [[ id:'test', single_end:false ], it] } + .join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) + .set { input_metabat2 } + + METABAT2_METABAT2 ( input_metabat2 ) + + DASTOOL_SCAFFOLDS2BIN ( METABAT2_METABAT2.out.fasta.collect(), "fa") +} \ No newline at end of file diff --git a/tests/modules/dastool/scaffolds2bin/nextflow.config b/tests/modules/dastool/scaffolds2bin/nextflow.config new file mode 100644 index 00000000..83754d8b --- /dev/null +++ b/tests/modules/dastool/scaffolds2bin/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: METABAT2_METABAT2 { + ext.args = '--minContig 1500 --minCV 0.1 --minCVSum 0.1 --minClsSize 10 --minS 2' + } + +} diff --git a/tests/modules/dastool/scaffolds2bin/test.yml b/tests/modules/dastool/scaffolds2bin/test.yml new file mode 100644 index 00000000..26f528c9 --- /dev/null +++ b/tests/modules/dastool/scaffolds2bin/test.yml @@ -0,0 +1,14 @@ +- name: dastool scaffolds2bin test_dastool_scaffolds2bin + command: nextflow run ./tests/modules/dastool/scaffolds2bin -entry test_dastool_scaffolds2bin -c ./tests/config/nextflow.config -c ./tests/modules/dastool/scaffolds2bin/nextflow.config + tags: + - dastool + - dastool/scaffolds2bin + files: + - path: output/dastool/test.tsv + md5sum: 6e46c0be14dded7cb13af38f54feea47 + - path: output/metabat2/bins/test.1.fa.gz + md5sum: 2b297bf557cc3831b800348859331268 + - path: output/metabat2/test.tsv.gz + md5sum: 619338fa5019e361d5545ce385a6961f + - path: output/metabat2/test.txt.gz + md5sum: 745a0446af6ef68b930975e9ce5a95d6 diff --git a/tests/modules/dedup/main.nf b/tests/modules/dedup/main.nf new file mode 100644 index 00000000..4a397eaa --- /dev/null +++ b/tests/modules/dedup/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { DEDUP } from '../../../modules/dedup/main.nf' + +workflow test_dedup { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) ] + + DEDUP ( input ) +} diff --git a/tests/modules/dedup/nextflow.config b/tests/modules/dedup/nextflow.config new file mode 100644 index 00000000..80a42463 --- /dev/null +++ b/tests/modules/dedup/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: DEDUP { + ext.args = '-m' + } + +} diff --git a/tests/modules/dedup/test.yml b/tests/modules/dedup/test.yml new file mode 100644 index 00000000..077aac0d --- /dev/null +++ b/tests/modules/dedup/test.yml @@ -0,0 +1,13 @@ +- name: dedup test_dedup + command: nextflow run ./tests/modules/dedup -entry test_dedup -c ./tests/config/nextflow.config -c ./tests/modules/dedup/nextflow.config + tags: + - dedup + files: + - path: output/dedup/test.paired_end.dedup.json + md5sum: 2def0b54aba1fafa21b274f260de1b6f + - path: output/dedup/test.paired_end.hist + md5sum: df3492273a1db0d8152e35d9d5e38aa6 + - path: output/dedup/test.paired_end.log + md5sum: 4b8855bd63b2f4b37da4cfb17e61fb00 + - path: output/dedup/test.paired_end_rmdup.bam + md5sum: 8b0408fe3e258989095303a47e5b5061 diff --git a/tests/modules/deeptools/computematrix/main.nf b/tests/modules/deeptools/computematrix/main.nf index 116bc851..35e49f59 100644 --- a/tests/modules/deeptools/computematrix/main.nf +++ b/tests/modules/deeptools/computematrix/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { DEEPTOOLS_COMPUTEMATRIX } from '../../../../modules/deeptools/computematrix/main.nf' addParams( options: ['args' : 'scale-regions -b 1000'] ) +include { DEEPTOOLS_COMPUTEMATRIX } from '../../../../modules/deeptools/computematrix/main.nf' workflow test_deeptools_computematrix { diff --git a/tests/modules/deeptools/computematrix/nextflow.config b/tests/modules/deeptools/computematrix/nextflow.config new file mode 100644 index 00000000..285b2165 --- /dev/null +++ b/tests/modules/deeptools/computematrix/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: DEEPTOOLS_COMPUTEMATRIX { + ext.args = 'scale-regions -b 1000' + } + +} diff --git a/tests/modules/deeptools/computematrix/test.yml b/tests/modules/deeptools/computematrix/test.yml index fb2fa9e1..88657de3 100644 --- a/tests/modules/deeptools/computematrix/test.yml +++ b/tests/modules/deeptools/computematrix/test.yml @@ -1,5 +1,5 @@ - name: deeptools computematrix - command: nextflow run tests/modules/deeptools/computematrix -entry test_deeptools_computematrix -c tests/config/nextflow.config + command: nextflow run ./tests/modules/deeptools/computematrix -entry test_deeptools_computematrix -c ./tests/config/nextflow.config -c ./tests/modules/deeptools/computematrix/nextflow.config tags: - deeptools - deeptools/computematrix diff --git a/tests/modules/deeptools/plotfingerprint/main.nf b/tests/modules/deeptools/plotfingerprint/main.nf index e84adc39..bcef970e 100644 --- a/tests/modules/deeptools/plotfingerprint/main.nf +++ b/tests/modules/deeptools/plotfingerprint/main.nf @@ -4,7 +4,7 @@ nextflow.enable.dsl = 2 params.fragment_size = 1000 -include { DEEPTOOLS_PLOTFINGERPRINT } from '../../../../modules/deeptools/plotfingerprint/main.nf' addParams( options: [:] ) +include { DEEPTOOLS_PLOTFINGERPRINT } from '../../../../modules/deeptools/plotfingerprint/main.nf' workflow test_deeptools_plotfingerprint { diff --git a/tests/modules/deeptools/plotfingerprint/nextflow.config b/tests/modules/deeptools/plotfingerprint/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/deeptools/plotfingerprint/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/deeptools/plotfingerprint/test.yml b/tests/modules/deeptools/plotfingerprint/test.yml index bb96fbe2..11d4ae7b 100644 --- a/tests/modules/deeptools/plotfingerprint/test.yml +++ b/tests/modules/deeptools/plotfingerprint/test.yml @@ -1,5 +1,5 @@ - name: deeptools plotfingerprint - command: nextflow run tests/modules/deeptools/plotfingerprint -entry test_deeptools_plotfingerprint -c tests/config/nextflow.config + command: nextflow run ./tests/modules/deeptools/plotfingerprint -entry test_deeptools_plotfingerprint -c ./tests/config/nextflow.config -c ./tests/modules/deeptools/plotfingerprint/nextflow.config tags: - deeptools - deeptools/plotfingerprint @@ -7,7 +7,7 @@ - path: output/deeptools/test.plotFingerprint.pdf - path: output/deeptools/test.plotFingerprint.qcmetrics.txt contains: - - "AUC" - - "0.24184576629880325" + - "AUC" + - "0.24184576629880325" - path: output/deeptools/test.plotFingerprint.raw.txt - md5sum: e2a9ff341a315f49e7c8387a3323bdfb + md5sum: aff8e53de0ddd893aa9d8f9d4ce7e291 diff --git a/tests/modules/deeptools/plotheatmap/main.nf b/tests/modules/deeptools/plotheatmap/main.nf index 93e7d373..86005b2c 100644 --- a/tests/modules/deeptools/plotheatmap/main.nf +++ b/tests/modules/deeptools/plotheatmap/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { DEEPTOOLS_PLOTHEATMAP } from '../../../../modules/deeptools/plotheatmap/main.nf' addParams( options: [:] ) +include { DEEPTOOLS_PLOTHEATMAP } from '../../../../modules/deeptools/plotheatmap/main.nf' workflow test_deeptools_plotheatmap { diff --git a/tests/modules/deeptools/plotheatmap/nextflow.config b/tests/modules/deeptools/plotheatmap/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/deeptools/plotheatmap/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/deeptools/plotheatmap/test.yml b/tests/modules/deeptools/plotheatmap/test.yml index 641d5121..9273f840 100644 --- a/tests/modules/deeptools/plotheatmap/test.yml +++ b/tests/modules/deeptools/plotheatmap/test.yml @@ -1,5 +1,5 @@ - name: deeptools plotheatmap - command: nextflow run tests/modules/deeptools/plotheatmap -entry test_deeptools_plotheatmap -c tests/config/nextflow.config + command: nextflow run ./tests/modules/deeptools/plotheatmap -entry test_deeptools_plotheatmap -c ./tests/config/nextflow.config -c ./tests/modules/deeptools/plotheatmap/nextflow.config tags: - deeptools - deeptools/plotheatmap diff --git a/tests/modules/deeptools/plotprofile/main.nf b/tests/modules/deeptools/plotprofile/main.nf index ac91f0c5..63ee47cd 100644 --- a/tests/modules/deeptools/plotprofile/main.nf +++ b/tests/modules/deeptools/plotprofile/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { DEEPTOOLS_PLOTPROFILE } from '../../../../modules/deeptools/plotprofile/main.nf' addParams( options: [:] ) +include { DEEPTOOLS_PLOTPROFILE } from '../../../../modules/deeptools/plotprofile/main.nf' workflow test_deeptools_plotprofile { diff --git a/tests/modules/deeptools/plotprofile/nextflow.config b/tests/modules/deeptools/plotprofile/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/deeptools/plotprofile/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/deeptools/plotprofile/test.yml b/tests/modules/deeptools/plotprofile/test.yml index efe02ce5..4b6c5b9a 100644 --- a/tests/modules/deeptools/plotprofile/test.yml +++ b/tests/modules/deeptools/plotprofile/test.yml @@ -1,5 +1,5 @@ - name: deeptools plotprofile - command: nextflow run tests/modules/deeptools/plotprofile -entry test_deeptools_plotprofile -c tests/config/nextflow.config + command: nextflow run ./tests/modules/deeptools/plotprofile -entry test_deeptools_plotprofile -c ./tests/config/nextflow.config -c ./tests/modules/deeptools/plotprofile/nextflow.config tags: - deeptools - deeptools/plotprofile diff --git a/tests/modules/delly/call/main.nf b/tests/modules/delly/call/main.nf index f41dda95..f4583e05 100644 --- a/tests/modules/delly/call/main.nf +++ b/tests/modules/delly/call/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { DELLY_CALL } from '../../../../modules/delly/call/main.nf' addParams( options: [:] ) +include { DELLY_CALL } from '../../../../modules/delly/call/main.nf' workflow test_delly_call { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/delly/call/nextflow.config b/tests/modules/delly/call/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/delly/call/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/delly/call/test.yml b/tests/modules/delly/call/test.yml index 8faeba78..a770d213 100644 --- a/tests/modules/delly/call/test.yml +++ b/tests/modules/delly/call/test.yml @@ -1,10 +1,9 @@ - name: delly call test_delly_call - command: nextflow run tests/modules/delly/call -entry test_delly_call -c tests/config/nextflow.config + command: nextflow run ./tests/modules/delly/call -entry test_delly_call -c ./tests/config/nextflow.config -c ./tests/modules/delly/call/nextflow.config tags: - delly - delly/call files: - path: output/delly/test.bcf - md5sum: b20df3b9086faccd6bfd2641d97712c8 - path: output/delly/test.bcf.csi md5sum: 19e0cdf06c415f4942f6d4dbd5fb7271 diff --git a/tests/modules/diamond/blastp/main.nf b/tests/modules/diamond/blastp/main.nf new file mode 100644 index 00000000..87d05bf9 --- /dev/null +++ b/tests/modules/diamond/blastp/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { DIAMOND_MAKEDB } from '../../../../modules/diamond/makedb/main.nf' +include { DIAMOND_BLASTP } from '../../../../modules/diamond/blastp/main.nf' + +workflow test_diamond_blastp { + + db = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + fasta = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] + + DIAMOND_MAKEDB ( db ) + DIAMOND_BLASTP ( [ [id:'test'], fasta ], DIAMOND_MAKEDB.out.db ) +} diff --git a/tests/modules/diamond/blastp/nextflow.config b/tests/modules/diamond/blastp/nextflow.config new file mode 100644 index 00000000..5a9aacad --- /dev/null +++ b/tests/modules/diamond/blastp/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: DIAMOND_BLASTP { + ext.prefix = { "${meta.id}.diamond_blastp" } + } + +} diff --git a/tests/modules/diamond/blastp/test.yml b/tests/modules/diamond/blastp/test.yml new file mode 100644 index 00000000..673563cb --- /dev/null +++ b/tests/modules/diamond/blastp/test.yml @@ -0,0 +1,8 @@ +- name: diamond blastp + command: nextflow run ./tests/modules/diamond/blastp -entry test_diamond_blastp -c ./tests/config/nextflow.config -c ./tests/modules/diamond/blastp/nextflow.config + tags: + - diamond + - diamond/blastp + files: + - path: ./output/diamond/test.diamond_blastp.txt + md5sum: 3ca7f6290c1d8741c573370e6f8b4db0 diff --git a/tests/modules/diamond/blastx/main.nf b/tests/modules/diamond/blastx/main.nf new file mode 100644 index 00000000..77eb08ea --- /dev/null +++ b/tests/modules/diamond/blastx/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { DIAMOND_MAKEDB } from '../../../../modules/diamond/makedb/main.nf' +include { DIAMOND_BLASTX } from '../../../../modules/diamond/blastx/main.nf' + +workflow test_diamond_blastx { + + db = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + fasta = [ file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] + + DIAMOND_MAKEDB ( db ) + DIAMOND_BLASTX ( [ [id:'test'], fasta ], DIAMOND_MAKEDB.out.db ) +} diff --git a/tests/modules/diamond/blastx/nextflow.config b/tests/modules/diamond/blastx/nextflow.config new file mode 100644 index 00000000..25320af3 --- /dev/null +++ b/tests/modules/diamond/blastx/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: DIAMOND_BLASTX { + ext.prefix = { "${meta.id}.diamond_blastx" } + } + +} diff --git a/tests/modules/diamond/blastx/test.yml b/tests/modules/diamond/blastx/test.yml new file mode 100644 index 00000000..ee94802f --- /dev/null +++ b/tests/modules/diamond/blastx/test.yml @@ -0,0 +1,8 @@ +- name: diamond blastx + command: nextflow run ./tests/modules/diamond/blastx -entry test_diamond_blastx -c ./tests/config/nextflow.config -c ./tests/modules/diamond/blastx/nextflow.config + tags: + - diamond + - diamond/blastx + files: + - path: ./output/diamond/test.diamond_blastx.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e diff --git a/tests/modules/diamond/makedb/main.nf b/tests/modules/diamond/makedb/main.nf new file mode 100644 index 00000000..70982ae9 --- /dev/null +++ b/tests/modules/diamond/makedb/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { DIAMOND_MAKEDB } from '../../../../modules/diamond/makedb/main.nf' + +workflow test_diamond_makedb { + + input = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + DIAMOND_MAKEDB ( input ) +} diff --git a/tests/modules/diamond/makedb/nextflow.config b/tests/modules/diamond/makedb/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/diamond/makedb/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/diamond/makedb/test.yml b/tests/modules/diamond/makedb/test.yml new file mode 100644 index 00000000..c8f2d79e --- /dev/null +++ b/tests/modules/diamond/makedb/test.yml @@ -0,0 +1,8 @@ +- name: diamond makedb test_diamond_makedb + command: nextflow run ./tests/modules/diamond/makedb -entry test_diamond_makedb -c ./tests/config/nextflow.config -c ./tests/modules/diamond/makedb/nextflow.config + tags: + - diamond + - diamond/makedb + files: + - path: output/diamond/genome.fasta.dmnd + md5sum: 2447fb376394c20d43ea3aad2aa5d15d diff --git a/tests/modules/dragmap/align/main.nf b/tests/modules/dragmap/align/main.nf new file mode 100644 index 00000000..4376602c --- /dev/null +++ b/tests/modules/dragmap/align/main.nf @@ -0,0 +1,60 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { DRAGMAP_HASHTABLE } from '../../../../modules/dragmap/hashtable/main.nf' +include { DRAGMAP_ALIGN } from '../../../../modules/dragmap/align/main.nf' + +workflow test_dragmap_align_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) + + DRAGMAP_HASHTABLE ( fasta ) + DRAGMAP_ALIGN ( input, DRAGMAP_HASHTABLE.out.hashmap, false ) +} + +workflow test_dragmap_align_single_end_sort { + 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) + + DRAGMAP_HASHTABLE ( fasta ) + DRAGMAP_ALIGN ( input, DRAGMAP_HASHTABLE.out.hashmap, true ) +} + +workflow test_dragmap_align_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) + + DRAGMAP_HASHTABLE ( fasta ) + DRAGMAP_ALIGN ( input, DRAGMAP_HASHTABLE.out.hashmap, false ) +} + +workflow test_dragmap_align_paired_end_sort { + 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) + + DRAGMAP_HASHTABLE ( fasta ) + DRAGMAP_ALIGN ( input, DRAGMAP_HASHTABLE.out.hashmap, true ) +} diff --git a/tests/modules/dragmap/align/nextflow.config b/tests/modules/dragmap/align/nextflow.config new file mode 100644 index 00000000..b968c357 --- /dev/null +++ b/tests/modules/dragmap/align/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: DRAGMAP_ALIGN { + ext.args2 = { sort_bam ? "" : "-bh" } + } + +} diff --git a/tests/modules/dragmap/align/test.yml b/tests/modules/dragmap/align/test.yml new file mode 100644 index 00000000..b0196e55 --- /dev/null +++ b/tests/modules/dragmap/align/test.yml @@ -0,0 +1,35 @@ +- name: dragmap align single-end + command: nextflow run ./tests/modules/dragmap/align -entry test_dragmap_align_single_end -c ./tests/config/nextflow.config -c ./tests/modules/dragmap/align/nextflow.config + tags: + - dragmap + - dragmap/align + files: + - path: output/dragmap/test.bam + - path: output/dragmap/test.dragmap.log + +- name: dragmap align single-end_sort + command: nextflow run ./tests/modules/dragmap/align -entry test_dragmap_align_single_end_sort -c ./tests/config/nextflow.config -c ./tests/modules/dragmap/align/nextflow.config + tags: + - dragmap + - dragmap/align + files: + - path: output/dragmap/test.bam + - path: output/dragmap/test.dragmap.log + +- name: dragmap align paired-end + command: nextflow run ./tests/modules/dragmap/align -entry test_dragmap_align_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/dragmap/align/nextflow.config + tags: + - dragmap + - dragmap/align + files: + - path: output/dragmap/test.bam + - path: output/dragmap/test.dragmap.log + +- name: dragmap align paired-end_sort + command: nextflow run ./tests/modules/dragmap/align -entry test_dragmap_align_paired_end_sort -c ./tests/config/nextflow.config -c ./tests/modules/dragmap/align/nextflow.config + tags: + - dragmap + - dragmap/align + files: + - path: output/dragmap/test.bam + - path: output/dragmap/test.dragmap.log diff --git a/tests/modules/dragmap/hashtable/main.nf b/tests/modules/dragmap/hashtable/main.nf new file mode 100644 index 00000000..91b43caa --- /dev/null +++ b/tests/modules/dragmap/hashtable/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { DRAGMAP_HASHTABLE } from '../../../../modules/dragmap/hashtable/main.nf' + +workflow test_dragmap_hashtable { + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + DRAGMAP_HASHTABLE ( fasta ) +} + +// TODO Add test using alt-masked bed file +// https://github.com/Illumina/dragmap#build-hash-table-using-an-alt-masked-bed-file diff --git a/tests/modules/dragmap/hashtable/nextflow.config b/tests/modules/dragmap/hashtable/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/dragmap/hashtable/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/dragmap/hashtable/test.yml b/tests/modules/dragmap/hashtable/test.yml new file mode 100644 index 00000000..59a3ed55 --- /dev/null +++ b/tests/modules/dragmap/hashtable/test.yml @@ -0,0 +1,19 @@ +- name: dragmap hashtable + command: nextflow run ./tests/modules/dragmap/hashtable -entry test_dragmap_hashtable -c ./tests/config/nextflow.config -c ./tests/modules/dragmap/hashtable/nextflow.config + tags: + - dragmap + - dragmap/hashtable + files: + - path: output/dragmap/dragmap/hash_table.cfg + - path: output/dragmap/dragmap/hash_table.cfg.bin + - path: output/dragmap/dragmap/hash_table.cmp + md5sum: bc210e5358fd65656f9aea297b59ec7d + - path: output/dragmap/dragmap/hash_table_stats.txt + - path: output/dragmap/dragmap/reference.bin + md5sum: b6b5c12a42416b990cd2844de8f33c5d + - path: output/dragmap/dragmap/ref_index.bin + md5sum: 8470be9566ecee77eb4aea6a38922a66 + - path: output/dragmap/dragmap/repeat_mask.bin + md5sum: 2439259a2fd32a1d0f4c53d585f3da3a + - path: output/dragmap/dragmap/str_table.bin + md5sum: 302e2b30993973527e69c6bcd1f093d0 diff --git a/tests/modules/dragonflye/main.nf b/tests/modules/dragonflye/main.nf new file mode 100644 index 00000000..3d59bb21 --- /dev/null +++ b/tests/modules/dragonflye/main.nf @@ -0,0 +1,22 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { DRAGONFLYE } from '../../../modules/dragonflye/main.nf' +include { DRAGONFLYE as DRAGONFLYE_RAVEN } from '../../../modules/dragonflye/main.nf' + +workflow test_dragonflye { + input = [ [ id:'test', single_end:true ], // meta map + [ file("https://github.com/nf-core/test-datasets/raw/bacass/nanopore/subset15000.fq.gz", checkIfExists: true) ] + ] + + DRAGONFLYE ( input ) +} + +workflow test_dragonflye_raven { + input = [ [ id:'test', single_end:true ], // meta map + [ file("https://github.com/nf-core/test-datasets/raw/bacass/nanopore/subset15000.fq.gz", checkIfExists: true) ] + ] + + DRAGONFLYE_RAVEN ( input ) +} diff --git a/tests/modules/dragonflye/nextflow.config b/tests/modules/dragonflye/nextflow.config new file mode 100644 index 00000000..fea43da4 --- /dev/null +++ b/tests/modules/dragonflye/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: DRAGONFLYE { + ext.args = '--assembler miniasm --gsize 5000000' + } + + withName: DRAGONFLYE_RAVEN { + ext.args = '--assembler raven --gsize 5000000' + } + +} diff --git a/tests/modules/dragonflye/test.yml b/tests/modules/dragonflye/test.yml new file mode 100644 index 00000000..ef9121ba --- /dev/null +++ b/tests/modules/dragonflye/test.yml @@ -0,0 +1,25 @@ +- name: dragonflye with miniasm + command: nextflow run ./tests/modules/dragonflye -entry test_dragonflye -c ./tests/config/nextflow.config -c ./tests/modules/dragonflye/nextflow.config + tags: + - dragonflye + files: + - path: output/dragonflye/miniasm.fasta + md5sum: 6b8903ba09592df99f43ed05fda488f6 + - path: output/dragonflye/miniasm-unpolished.gfa + md5sum: 40ab03a417eafab0cb4ac2c32bd006e1 + # MD5sum not reproducible (timestamp, contig order) + - path: output/dragonflye/contigs.fa + - path: output/dragonflye/dragonflye.log + +- name: dragonflye with raven + command: nextflow run ./tests/modules/dragonflye -entry test_dragonflye_raven -c ./tests/config/nextflow.config -c ./tests/modules/dragonflye/nextflow.config + tags: + - dragonflye + files: + - path: output/dragonflye/raven.fasta + md5sum: bd4ba5b0dda110a7ccbea9581c97a898 + - path: output/dragonflye/raven-unpolished.gfa + md5sum: 62c21791dbf9b2c7375dc52d7bab5be2 + # MD5sum not reproducible (timestamp, contig order) + - path: output/dragonflye/contigs.fa + - path: output/dragonflye/dragonflye.log diff --git a/tests/modules/dshbio/exportsegments/main.nf b/tests/modules/dshbio/exportsegments/main.nf new file mode 100644 index 00000000..c213dc54 --- /dev/null +++ b/tests/modules/dshbio/exportsegments/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { DSHBIO_EXPORTSEGMENTS } from '../../../../modules/dshbio/exportsegments/main.nf' + +workflow test_dshbio_exportsegments { + input = [ [ id:'test' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['assembly_gfa'], checkIfExists: true) ] + ] + + DSHBIO_EXPORTSEGMENTS ( input ) +} diff --git a/tests/modules/dshbio/exportsegments/nextflow.config b/tests/modules/dshbio/exportsegments/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/dshbio/exportsegments/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/dshbio/exportsegments/test.yml b/tests/modules/dshbio/exportsegments/test.yml new file mode 100644 index 00000000..c811df03 --- /dev/null +++ b/tests/modules/dshbio/exportsegments/test.yml @@ -0,0 +1,8 @@ +- name: dshbio exportsegments + command: nextflow run ./tests/modules/dshbio/exportsegments -entry test_dshbio_exportsegments -c ./tests/config/nextflow.config -c ./tests/modules/dshbio/exportsegments/nextflow.config + tags: + - dshbio + - dshbio/exportsegments + files: + - path: ./output/dshbio/test.fa + md5sum: 19ed0b69970ed3fbb641c5c510ebef61 diff --git a/tests/modules/dshbio/filterbed/main.nf b/tests/modules/dshbio/filterbed/main.nf index 722c88d2..454a03be 100644 --- a/tests/modules/dshbio/filterbed/main.nf +++ b/tests/modules/dshbio/filterbed/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { DSHBIO_FILTERBED } from '../../../../modules/dshbio/filterbed/main.nf' addParams( options: [suffix: '.filtered', args: '--range chr1:0-1000'] ) +include { DSHBIO_FILTERBED } from '../../../../modules/dshbio/filterbed/main.nf' workflow test_dshbio_filterbed { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/dshbio/filterbed/nextflow.config b/tests/modules/dshbio/filterbed/nextflow.config new file mode 100644 index 00000000..3937a184 --- /dev/null +++ b/tests/modules/dshbio/filterbed/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: DSHBIO_FILTERBED { + ext.args = '--range chr1:0-1000' + ext.prefix = { "${meta.id}.filtered" } + } +} diff --git a/tests/modules/dshbio/filterbed/test.yml b/tests/modules/dshbio/filterbed/test.yml index ad1cde66..278fd5a3 100644 --- a/tests/modules/dshbio/filterbed/test.yml +++ b/tests/modules/dshbio/filterbed/test.yml @@ -1,5 +1,5 @@ - name: dshbio filterbed - command: nextflow run ./tests/modules/dshbio/filterbed -entry test_dshbio_filterbed -c tests/config/nextflow.config + command: nextflow run ./tests/modules/dshbio/filterbed -entry test_dshbio_filterbed -c ./tests/config/nextflow.config -c ./tests/modules/dshbio/filterbed/nextflow.config tags: - dshbio - dshbio/filterbed diff --git a/tests/modules/dshbio/filtergff3/main.nf b/tests/modules/dshbio/filtergff3/main.nf index 3156d091..7c803781 100644 --- a/tests/modules/dshbio/filtergff3/main.nf +++ b/tests/modules/dshbio/filtergff3/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { DSHBIO_FILTERGFF3 } from '../../../../modules/dshbio/filtergff3/main.nf' addParams( options: [suffix: '.filtered', args: '--range MT192765.1:0-1000'] ) +include { DSHBIO_FILTERGFF3 } from '../../../../modules/dshbio/filtergff3/main.nf' workflow test_dshbio_filtergff3 { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/dshbio/filtergff3/nextflow.config b/tests/modules/dshbio/filtergff3/nextflow.config new file mode 100644 index 00000000..80dcd28c --- /dev/null +++ b/tests/modules/dshbio/filtergff3/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: DSHBIO_FILTERGFF3 { + ext.args = '--range MT192765.1:0-1000' + ext.prefix = { "${meta.id}.filtered" } + } + +} diff --git a/tests/modules/dshbio/filtergff3/test.yml b/tests/modules/dshbio/filtergff3/test.yml index 95d1b446..43238333 100644 --- a/tests/modules/dshbio/filtergff3/test.yml +++ b/tests/modules/dshbio/filtergff3/test.yml @@ -1,5 +1,5 @@ - name: dshbio filtergff3 - command: nextflow run ./tests/modules/dshbio/filtergff3 -entry test_dshbio_filtergff3 -c tests/config/nextflow.config + command: nextflow run ./tests/modules/dshbio/filtergff3 -entry test_dshbio_filtergff3 -c ./tests/config/nextflow.config -c ./tests/modules/dshbio/filtergff3/nextflow.config tags: - dshbio - dshbio/filtergff3 diff --git a/tests/modules/dshbio/splitbed/main.nf b/tests/modules/dshbio/splitbed/main.nf index d7f3d004..517baad0 100644 --- a/tests/modules/dshbio/splitbed/main.nf +++ b/tests/modules/dshbio/splitbed/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { DSHBIO_SPLITBED } from '../../../../modules/dshbio/splitbed/main.nf' addParams( options: [suffix: '.', args: '--records 2'] ) +include { DSHBIO_SPLITBED } from '../../../../modules/dshbio/splitbed/main.nf' workflow test_dshbio_splitbed { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/dshbio/splitbed/nextflow.config b/tests/modules/dshbio/splitbed/nextflow.config new file mode 100644 index 00000000..ad9c045b --- /dev/null +++ b/tests/modules/dshbio/splitbed/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: DSHBIO_SPLITBED { + ext.prefix = { "${meta.id}." } + ext.args = '--records 2' + } + +} diff --git a/tests/modules/dshbio/splitbed/test.yml b/tests/modules/dshbio/splitbed/test.yml index 04f5b150..ab14648e 100644 --- a/tests/modules/dshbio/splitbed/test.yml +++ b/tests/modules/dshbio/splitbed/test.yml @@ -1,5 +1,5 @@ - name: dshbio splitbed - command: nextflow run ./tests/modules/dshbio/splitbed -entry test_dshbio_splitbed -c tests/config/nextflow.config + command: nextflow run ./tests/modules/dshbio/splitbed -entry test_dshbio_splitbed -c ./tests/config/nextflow.config -c ./tests/modules/dshbio/splitbed/nextflow.config tags: - dshbio - dshbio/splitbed diff --git a/tests/modules/dshbio/splitgff3/main.nf b/tests/modules/dshbio/splitgff3/main.nf index dd58201a..03aa5394 100644 --- a/tests/modules/dshbio/splitgff3/main.nf +++ b/tests/modules/dshbio/splitgff3/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { DSHBIO_SPLITGFF3 } from '../../../../modules/dshbio/splitgff3/main.nf' addParams( options: [suffix: '.', args: '--records 15'] ) +include { DSHBIO_SPLITGFF3 } from '../../../../modules/dshbio/splitgff3/main.nf' workflow test_dshbio_splitgff3 { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/dshbio/splitgff3/nextflow.config b/tests/modules/dshbio/splitgff3/nextflow.config new file mode 100644 index 00000000..f6a0b921 --- /dev/null +++ b/tests/modules/dshbio/splitgff3/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: DSHBIO_SPLITGFF3 { + ext.prefix = { "${meta.id}." } + ext.args = '--records 15' + } + +} diff --git a/tests/modules/dshbio/splitgff3/test.yml b/tests/modules/dshbio/splitgff3/test.yml index fe5b1bed..6087ce11 100644 --- a/tests/modules/dshbio/splitgff3/test.yml +++ b/tests/modules/dshbio/splitgff3/test.yml @@ -1,5 +1,5 @@ - name: dshbio splitgff3 - command: nextflow run ./tests/modules/dshbio/splitgff3 -entry test_dshbio_splitgff3 -c tests/config/nextflow.config + command: nextflow run ./tests/modules/dshbio/splitgff3 -entry test_dshbio_splitgff3 -c ./tests/config/nextflow.config -c ./tests/modules/dshbio/splitgff3/nextflow.config tags: - dshbio - dshbio/splitgff3 diff --git a/tests/modules/ectyper/main.nf b/tests/modules/ectyper/main.nf new file mode 100644 index 00000000..dd359fa2 --- /dev/null +++ b/tests/modules/ectyper/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ECTYPER } from '../../../modules/ectyper/main.nf' + +workflow test_ectyper { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + + ECTYPER ( input ) +} diff --git a/tests/modules/ectyper/nextflow.config b/tests/modules/ectyper/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/ectyper/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/ectyper/test.yml b/tests/modules/ectyper/test.yml new file mode 100644 index 00000000..4f909bd9 --- /dev/null +++ b/tests/modules/ectyper/test.yml @@ -0,0 +1,11 @@ +- name: ectyper test_ectyper + command: nextflow run ./tests/modules/ectyper -entry test_ectyper -c ./tests/config/nextflow.config -c ./tests/modules/ectyper/nextflow.config + tags: + - ectyper + files: + - path: output/ectyper/blast_output_alleles.txt + md5sum: 27f3f5e84f7da451b2948d61589cdb06 + - path: output/ectyper/ectyper.log + contains: ['Serotype', 'RefSeq', 'O-type', 'finished'] + - path: output/ectyper/test.tsv + md5sum: ba923d7c7ee7d1047466aafc9a9df208 diff --git a/tests/modules/emmtyper/main.nf b/tests/modules/emmtyper/main.nf new file mode 100644 index 00000000..ee96fc32 --- /dev/null +++ b/tests/modules/emmtyper/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { EMMTYPER } from '../../../modules/emmtyper/main.nf' + +workflow test_emmtyper { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + EMMTYPER ( input ) +} diff --git a/tests/modules/emmtyper/nextflow.config b/tests/modules/emmtyper/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/emmtyper/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/emmtyper/test.yml b/tests/modules/emmtyper/test.yml new file mode 100644 index 00000000..81854eb6 --- /dev/null +++ b/tests/modules/emmtyper/test.yml @@ -0,0 +1,7 @@ +- name: emmtyper test_emmtyper + command: nextflow run ./tests/modules/emmtyper -entry test_emmtyper -c ./tests/config/nextflow.config -c ./tests/modules/emmtyper/nextflow.config + tags: + - emmtyper + files: + - path: output/emmtyper/test.tsv + md5sum: c727ba859adec9ca8ff0e091ecf79c62 diff --git a/tests/modules/ensemblvep/main.nf b/tests/modules/ensemblvep/main.nf index 3cbb26f1..223847c7 100644 --- a/tests/modules/ensemblvep/main.nf +++ b/tests/modules/ensemblvep/main.nf @@ -2,11 +2,13 @@ nextflow.enable.dsl = 2 -include { ENSEMBLVEP } from '../../../modules/ensemblvep/main.nf' addParams( vep_tag: '104.3.WBcel235', use_cache: false ) +include { ENSEMBLVEP } from '../../../modules/ensemblvep/main.nf' workflow test_ensemblvep { - input = [ [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] - ] + input = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) + ] + ENSEMBLVEP ( input, "WBcel235", "caenorhabditis_elegans", "104", [] ) } diff --git a/tests/modules/ensemblvep/nextflow.config b/tests/modules/ensemblvep/nextflow.config new file mode 100644 index 00000000..f13d62e9 --- /dev/null +++ b/tests/modules/ensemblvep/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: ENSEMBLVEP { + container = 'nfcore/vep:104.3.WBcel235' + } + +} diff --git a/tests/modules/ensemblvep/test.yml b/tests/modules/ensemblvep/test.yml index a6e33cae..42384d6e 100644 --- a/tests/modules/ensemblvep/test.yml +++ b/tests/modules/ensemblvep/test.yml @@ -1,5 +1,5 @@ - name: ensemblvep test_ensemblvep - command: nextflow run tests/modules/ensemblvep -entry test_ensemblvep -c tests/config/nextflow.config + command: nextflow run ./tests/modules/ensemblvep -entry test_ensemblvep -c ./tests/config/nextflow.config -c ./tests/modules/ensemblvep/nextflow.config tags: - ensemblvep files: diff --git a/tests/modules/expansionhunter/main.nf b/tests/modules/expansionhunter/main.nf new file mode 100644 index 00000000..91faeeb8 --- /dev/null +++ b/tests/modules/expansionhunter/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { EXPANSIONHUNTER } from '../../../modules/expansionhunter/main.nf' + +workflow test_expansionhunter { + + input = [ [ id:'test', gender:'male' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + variant_catalog = file(params.test_data['homo_sapiens']['genome']['repeat_expansions'], checkIfExists: true) + + EXPANSIONHUNTER ( input, fasta, variant_catalog ) +} diff --git a/tests/modules/expansionhunter/nextflow.config b/tests/modules/expansionhunter/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/expansionhunter/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/expansionhunter/test.yml b/tests/modules/expansionhunter/test.yml new file mode 100644 index 00000000..19403588 --- /dev/null +++ b/tests/modules/expansionhunter/test.yml @@ -0,0 +1,7 @@ +- name: expansionhunter test_expansionhunter + command: nextflow run ./tests/modules/expansionhunter -entry test_expansionhunter -c ./tests/config/nextflow.config -c ./tests/modules/expansionhunter/nextflow.config + tags: + - expansionhunter + files: + - path: output/expansionhunter/test.vcf + md5sum: ef6c2101d7bd67211bb5a5a132690e02 diff --git a/tests/modules/fargene/main.nf b/tests/modules/fargene/main.nf new file mode 100644 index 00000000..471862e1 --- /dev/null +++ b/tests/modules/fargene/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GUNZIP } from '../../../modules/gunzip/main.nf' +include { FARGENE } from '../../../modules/fargene/main.nf' + +workflow test_fargene { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['bacteroides_fragilis']['illumina']['test1_contigs_fa_gz'], checkIfExists: true) ] + hmm_model = 'class_a' + + GUNZIP ( input ) + FARGENE ( GUNZIP.out.gunzip, hmm_model ) +} diff --git a/tests/modules/fargene/nextflow.config b/tests/modules/fargene/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/fargene/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/fargene/test.yml b/tests/modules/fargene/test.yml new file mode 100644 index 00000000..d97e2257 --- /dev/null +++ b/tests/modules/fargene/test.yml @@ -0,0 +1,14 @@ +- name: fargene + command: nextflow run ./tests/modules/fargene -entry test_fargene -c ./tests/config/nextflow.config -c ./tests/modules/fargene/nextflow.config + tags: + - fargene + files: + - path: output/fargene/fargene_analysis.log + - path: output/fargene/test/hmmsearchresults/test1.contigs-class_A-hmmsearched.out + - path: output/fargene/test/results_summary.txt + md5sum: 690d351cfc52577263ef4cfab1c81f50 + - path: output/fargene/test/tmpdir/test1.contigs-positives.out + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/fargene/test/tmpdir/tmp.out + - path: output/gunzip/test1.contigs.fa + md5sum: 80c4d78f2810f6d9e90fa6da9bb9c4f9 diff --git a/tests/modules/fastani/main.nf b/tests/modules/fastani/main.nf new file mode 100644 index 00000000..0395f6a9 --- /dev/null +++ b/tests/modules/fastani/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { FASTANI } from '../../../modules/fastani/main.nf' + +workflow test_fastani { + + query = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + reference = file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true) + + FASTANI ( [[ id:'test' ], query], reference ) +} diff --git a/tests/modules/fastani/nextflow.config b/tests/modules/fastani/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/fastani/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/fastani/test.yml b/tests/modules/fastani/test.yml new file mode 100644 index 00000000..f3748d25 --- /dev/null +++ b/tests/modules/fastani/test.yml @@ -0,0 +1,7 @@ +- name: fastani + command: nextflow run ./tests/modules/fastani -entry test_fastani -c ./tests/config/nextflow.config -c ./tests/modules/fastani/nextflow.config + tags: + - fastani + files: + - path: output/fastani/test.ani.txt + md5sum: 31d4f04e8cffe13080c86db3f9f3a589 diff --git a/tests/modules/fastp/main.nf b/tests/modules/fastp/main.nf index 012f4c6c..d1540974 100644 --- a/tests/modules/fastp/main.nf +++ b/tests/modules/fastp/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { FASTP } from '../../../modules/fastp/main.nf' addParams( options: [:] ) +include { FASTP } from '../../../modules/fastp/main.nf' // // Test with single-end data @@ -11,8 +11,10 @@ workflow test_fastp_single_end { input = [ [ id:'test', single_end:true ], // meta map [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] ] + save_trimmed_fail = false + save_merged = false - FASTP ( input ) + FASTP ( input, save_trimmed_fail, save_merged ) } // @@ -23,7 +25,49 @@ workflow test_fastp_paired_end { [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] ] + save_trimmed_fail = false + save_merged = false - FASTP ( input ) + FASTP ( input, save_trimmed_fail, save_merged ) } +// +// Test with single-end data with saving trimming fails +// +workflow test_fastp_single_end_trim_fail { + input = [ [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + save_trimmed_fail = true + save_merged = false + + FASTP ( input, save_trimmed_fail, save_merged ) +} + +// +// Test with paired-end data with saving trimming fails +// +workflow test_fastp_paired_end_trim_fail { + 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) ] + ] + save_trimmed_fail = true + save_merged = false + + FASTP ( input, save_trimmed_fail, save_merged ) +} + +// +// Test with paired-end data with merging +// +workflow test_fastp_paired_end_merged { + 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) ] + ] + save_trimmed_fail = false + save_merged = true + + FASTP ( input, save_trimmed_fail, save_merged ) +} diff --git a/tests/modules/fastp/nextflow.config b/tests/modules/fastp/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/fastp/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/fastp/test.yml b/tests/modules/fastp/test.yml index eb9de964..cd7ddeed 100644 --- a/tests/modules/fastp/test.yml +++ b/tests/modules/fastp/test.yml @@ -1,5 +1,5 @@ - name: fastp test_fastp_single_end - command: nextflow run tests/modules/fastp -entry test_fastp_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/fastp -entry test_fastp_single_end -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config tags: - fastp files: @@ -17,7 +17,7 @@ md5sum: e0d856ebb3da9e4462c3ce9683efe01d - name: fastp test_fastp_paired_end - command: nextflow run tests/modules/fastp -entry test_fastp_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config tags: - fastp files: @@ -36,3 +36,73 @@ md5sum: e2257263668dc8a75d95475099fb472d - path: output/fastp/test_2.trim.fastq.gz md5sum: 9eff7203596580cc5e42aceab4a469df + +- name: fastp test_fastp_single_end_trim_fail + command: nextflow run ./tests/modules/fastp -entry test_fastp_single_end_trim_fail -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config + tags: + - fastp + files: + - path: output/fastp/test.fastp.html + contains: + - "Q20 bases:12.922000 K (92.984097%)" + - "single end (151 cycles)" + - path: output/fastp/test.fastp.log + contains: + - "Q20 bases: 12922(92.9841%)" + - "reads passed filter: 99" + - path: output/fastp/test.trim.fastq.gz + md5sum: e2257263668dc8a75d95475099fb472d + - path: output/fastp/test.fastp.json + md5sum: ee65a46d6e59fa556f112727b8a902ce + - path: output/fastp/test.fail.fastq.gz + md5sum: de315d397c994d8e66bafc7a8dc11070 + +- name: fastp test_fastp_paired_end_trim_fail + command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end_trim_fail -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config + tags: + - fastp + files: + - path: output/fastp/test.fastp.html + contains: + - "Q20 bases:25.719000 K (93.033098%)" + - "The input has little adapter percentage (~0.000000%), probably it's trimmed before." + - path: output/fastp/test.fastp.log + contains: + - "No adapter detected for read1" + - "Q30 bases: 12281(88.3716%)" + - path: output/fastp/test.fastp.json + contains: + - '"passed_filter_reads": 198' + - path: output/fastp/test_1.trim.fastq.gz + md5sum: e2257263668dc8a75d95475099fb472d + - path: output/fastp/test_2.trim.fastq.gz + md5sum: 9eff7203596580cc5e42aceab4a469df + - path: output/fastp/test_1.fail.fastq.gz + md5sum: e62ff0123a74adfc6903d59a449cbdb0 + - path: output/fastp/test_2.fail.fastq.gz + md5sum: f52309b35a7c15cbd56a9c3906ef98a5 + +- name: fastp test_fastp_paired_end_merged + command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end_merged -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config + tags: + - fastp + files: + - path: output/fastp/test.fastp.html + contains: + - "
" + - path: output/fastp/test.fastp.json + contains: + - '"merged_and_filtered": {' + - '"total_reads": 75' + - '"total_bases": 13683' + - path: output/fastp/test.fastp.log + contains: + - "Merged and filtered:" + - "total reads: 75" + - "total bases: 13683" + - path: output/fastp/test.merged.fastq.gz + md5sum: ce88539076ced5aff11f866836ea1f40 + - path: output/fastp/test_1.trim.fastq.gz + md5sum: 65d75c13abbfbfd993914e1379634100 + - path: output/fastp/test_2.trim.fastq.gz + md5sum: 0d87ce4d8ef29fb35f337eb0f6c9fcb4 diff --git a/tests/modules/fastqc/main.nf b/tests/modules/fastqc/main.nf index d95befec..f7db9b7c 100644 --- a/tests/modules/fastqc/main.nf +++ b/tests/modules/fastqc/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { FASTQC } from '../../../modules/fastqc/main.nf' addParams( options: [:] ) +include { FASTQC } from '../../../modules/fastqc/main.nf' // // Test with single-end data diff --git a/tests/modules/fastqc/nextflow.config b/tests/modules/fastqc/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/fastqc/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/fastqc/test.yml b/tests/modules/fastqc/test.yml index 794e63fe..fa830cbc 100644 --- a/tests/modules/fastqc/test.yml +++ b/tests/modules/fastqc/test.yml @@ -1,5 +1,5 @@ - name: fastqc single-end - command: nextflow run ./tests/modules/fastqc/ -entry test_fastqc_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/fastqc/ -entry test_fastqc_single_end -c ./tests/config/nextflow.config -c ./tests/modules/fastqc/nextflow.config -c ./tests/modules/fastqc/nextflow.config tags: - fastqc files: @@ -7,7 +7,7 @@ - path: ./output/fastqc/test_fastqc.zip - name: fastqc paired-end - command: nextflow run ./tests/modules/fastqc/ -entry test_fastqc_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/fastqc/ -entry test_fastqc_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/fastqc/nextflow.config -c ./tests/modules/fastqc/nextflow.config tags: - fastqc files: diff --git a/tests/modules/fastqscan/main.nf b/tests/modules/fastqscan/main.nf new file mode 100644 index 00000000..b9a321fe --- /dev/null +++ b/tests/modules/fastqscan/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { FASTQSCAN } from '../../../modules/fastqscan/main.nf' + +workflow test_fastqscan { + + input = [ [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + + FASTQSCAN ( input ) +} diff --git a/tests/modules/fastqscan/nextflow.config b/tests/modules/fastqscan/nextflow.config new file mode 100644 index 00000000..f688ecb6 --- /dev/null +++ b/tests/modules/fastqscan/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: FASTQSCAN { + ext.args = '-g 30000' + } + +} diff --git a/tests/modules/fastqscan/test.yml b/tests/modules/fastqscan/test.yml new file mode 100644 index 00000000..d538804c --- /dev/null +++ b/tests/modules/fastqscan/test.yml @@ -0,0 +1,7 @@ +- name: fastqscan test_fastqscan + command: nextflow run ./tests/modules/fastqscan -entry test_fastqscan -c ./tests/config/nextflow.config -c ./tests/modules/fastqscan/nextflow.config + tags: + - fastqscan + files: + - path: output/fastqscan/test.json + md5sum: b9d59a36fe85e556b5a80573ea0b0266 diff --git a/tests/modules/fasttree/main.nf b/tests/modules/fasttree/main.nf index 109aaa77..e33228a9 100644 --- a/tests/modules/fasttree/main.nf +++ b/tests/modules/fasttree/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { FASTTREE } from '../../../modules/fasttree/main.nf' addParams( options: [:] ) +include { FASTTREE } from '../../../modules/fasttree/main.nf' workflow test_fasttree { diff --git a/tests/modules/fasttree/nextflow.config b/tests/modules/fasttree/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/fasttree/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/fasttree/test.yml b/tests/modules/fasttree/test.yml index b30590c7..7e344cff 100644 --- a/tests/modules/fasttree/test.yml +++ b/tests/modules/fasttree/test.yml @@ -1,5 +1,5 @@ - name: fasttree - command: nextflow run ./tests/modules/fasttree -entry test_fasttree -c tests/config/nextflow.config + command: nextflow run ./tests/modules/fasttree -entry test_fasttree -c ./tests/config/nextflow.config -c ./tests/modules/fasttree/nextflow.config tags: - fasttree files: diff --git a/tests/modules/fgbio/callmolecularconsensusreads/main.nf b/tests/modules/fgbio/callmolecularconsensusreads/main.nf index 8ce34eca..e31fdf39 100644 --- a/tests/modules/fgbio/callmolecularconsensusreads/main.nf +++ b/tests/modules/fgbio/callmolecularconsensusreads/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { FGBIO_SORTBAM } from '../../../../modules/fgbio/sortbam/main.nf' addParams( options: [args: '-s TemplateCoordinate', suffix: '_out'] ) -include { FGBIO_CALLMOLECULARCONSENSUSREADS } from '../../../../modules/fgbio/callmolecularconsensusreads/main.nf' addParams( options: [args: '-M 1', suffix: '_molreads'] ) +include { FGBIO_SORTBAM } from '../../../../modules/fgbio/sortbam/main.nf' +include { FGBIO_CALLMOLECULARCONSENSUSREADS } from '../../../../modules/fgbio/callmolecularconsensusreads/main.nf' workflow test_fgbio_callmolecularconsensusreads { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/fgbio/callmolecularconsensusreads/nextflow.config b/tests/modules/fgbio/callmolecularconsensusreads/nextflow.config new file mode 100644 index 00000000..e6721ff6 --- /dev/null +++ b/tests/modules/fgbio/callmolecularconsensusreads/nextflow.config @@ -0,0 +1,15 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: FGBIO_SORTBAM { + ext.args = '-s TemplateCoordinate' + ext.prefix = { "${meta.id}_out" } + } + + withName: FGBIO_CALLMOLECULARCONSENSUSREADS { + ext.args = '-M 1' + ext.prefix = { "${meta.id}_molreads" } + } + +} diff --git a/tests/modules/fgbio/callmolecularconsensusreads/test.yml b/tests/modules/fgbio/callmolecularconsensusreads/test.yml index ac53957c..5e26cd01 100644 --- a/tests/modules/fgbio/callmolecularconsensusreads/test.yml +++ b/tests/modules/fgbio/callmolecularconsensusreads/test.yml @@ -1,5 +1,5 @@ - name: fgbio callmolecularconsensusreads - command: nextflow run tests/modules/fgbio/callmolecularconsensusreads -entry test_fgbio_callmolecularconsensusreads -c tests/config/nextflow.config + command: nextflow run ./tests/modules/fgbio/callmolecularconsensusreads -entry test_fgbio_callmolecularconsensusreads -c ./tests/config/nextflow.config -c ./tests/modules/fgbio/callmolecularconsensusreads/nextflow.config tags: - fgbio - fgbio/callmolecularconsensusreads diff --git a/tests/modules/fgbio/fastqtobam/main.nf b/tests/modules/fgbio/fastqtobam/main.nf new file mode 100644 index 00000000..f01a17fa --- /dev/null +++ b/tests/modules/fgbio/fastqtobam/main.nf @@ -0,0 +1,19 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { FGBIO_FASTQTOBAM } from '../../../../modules/fgbio/fastqtobam/main.nf' + +workflow test_fgbio_fastqtobam { + + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_umi_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_umi_2_fastq_gz'], checkIfExists: true) + ] + ] + read_structure = "+T 12M11S+T" + + FGBIO_FASTQTOBAM ( input, read_structure ) +} diff --git a/tests/modules/fgbio/fastqtobam/nextflow.config b/tests/modules/fgbio/fastqtobam/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/fgbio/fastqtobam/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/fgbio/fastqtobam/test.yml b/tests/modules/fgbio/fastqtobam/test.yml new file mode 100644 index 00000000..ab73f425 --- /dev/null +++ b/tests/modules/fgbio/fastqtobam/test.yml @@ -0,0 +1,8 @@ +- name: fgbio fastqtobam test_fgbio_fastqtobam + command: nextflow run ./tests/modules/fgbio/fastqtobam -entry test_fgbio_fastqtobam -c ./tests/config/nextflow.config -c ./tests/modules/fgbio/fastqtobam/nextflow.config + tags: + - fgbio/fastqtobam + - fgbio + files: + - path: output/fgbio/test_umi_converted.bam + md5sum: 9510735554e5eff29244077a72075fb6 diff --git a/tests/modules/fgbio/groupreadsbyumi/main.nf b/tests/modules/fgbio/groupreadsbyumi/main.nf new file mode 100644 index 00000000..b9bb350a --- /dev/null +++ b/tests/modules/fgbio/groupreadsbyumi/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { FGBIO_GROUPREADSBYUMI } from '../../../../modules/fgbio/groupreadsbyumi/main.nf' + +workflow test_fgbio_groupreadsbyumi { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_umi_unsorted_tagged_bam'], checkIfExists: true) + ] + + FGBIO_GROUPREADSBYUMI ( input, 'Adjacency' ) +} diff --git a/tests/modules/fgbio/groupreadsbyumi/nextflow.config b/tests/modules/fgbio/groupreadsbyumi/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/fgbio/groupreadsbyumi/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/fgbio/groupreadsbyumi/test.yml b/tests/modules/fgbio/groupreadsbyumi/test.yml new file mode 100644 index 00000000..c1cfd4f0 --- /dev/null +++ b/tests/modules/fgbio/groupreadsbyumi/test.yml @@ -0,0 +1,10 @@ +- name: fgbio groupreadsbyumi test_fgbio_groupreadsbyumi + command: nextflow run ./tests/modules/fgbio/groupreadsbyumi -entry test_fgbio_groupreadsbyumi -c ./tests/config/nextflow.config -c ./tests/modules/fgbio/groupreadsbyumi/nextflow.config + tags: + - fgbio + - fgbio/groupreadsbyumi + files: + - path: output/fgbio/test_umi-grouped.bam + md5sum: f1e53fc845fd99a3da172eb8063dff0b + - path: output/fgbio/test_umi_histogram.txt + md5sum: d17fd167b2a765d46e4b01bf08ece01b diff --git a/tests/modules/fgbio/sortbam/main.nf b/tests/modules/fgbio/sortbam/main.nf index 65bea1d7..ada99d0f 100644 --- a/tests/modules/fgbio/sortbam/main.nf +++ b/tests/modules/fgbio/sortbam/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { FGBIO_SORTBAM } from '../../../../modules/fgbio/sortbam/main.nf' addParams( options: [:] ) +include { FGBIO_SORTBAM } from '../../../../modules/fgbio/sortbam/main.nf' workflow test_fgbio_sortbam { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/fgbio/sortbam/nextflow.config b/tests/modules/fgbio/sortbam/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/fgbio/sortbam/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/fgbio/sortbam/test.yml b/tests/modules/fgbio/sortbam/test.yml index 68183cd2..6789aed8 100644 --- a/tests/modules/fgbio/sortbam/test.yml +++ b/tests/modules/fgbio/sortbam/test.yml @@ -1,5 +1,5 @@ - name: fgbio sortbam - command: nextflow run tests/modules/fgbio/sortbam -entry test_fgbio_sortbam -c tests/config/nextflow.config + command: nextflow run ./tests/modules/fgbio/sortbam -entry test_fgbio_sortbam -c ./tests/config/nextflow.config -c ./tests/modules/fgbio/sortbam/nextflow.config tags: - fgbio - fgbio/sortbam diff --git a/tests/modules/filtlong/main.nf b/tests/modules/filtlong/main.nf new file mode 100644 index 00000000..df7892aa --- /dev/null +++ b/tests/modules/filtlong/main.nf @@ -0,0 +1,36 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { FILTLONG } from '../../../modules/filtlong/main.nf' + +workflow test_filtlong { + + input = [ [ id:'test', single_end:false ], // meta map + [], + [ file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true) ] + ] + + FILTLONG ( input ) +} + +workflow test_filtlong_illumina_se { + + 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']['nanopore']['test_fastq_gz'], checkIfExists: true) ] + ] + + FILTLONG ( input ) +} + +workflow test_filtlong_illumina_pe { + + 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']['nanopore']['test_fastq_gz'], checkIfExists: true) ] + ] + + FILTLONG ( input ) +} diff --git a/tests/modules/filtlong/nextflow.config b/tests/modules/filtlong/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/filtlong/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/filtlong/test.yml b/tests/modules/filtlong/test.yml new file mode 100644 index 00000000..dc5fa5a9 --- /dev/null +++ b/tests/modules/filtlong/test.yml @@ -0,0 +1,23 @@ +- name: filtlong test_filtlong + command: nextflow run ./tests/modules/filtlong -entry test_filtlong -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config + tags: + - filtlong + files: + - path: output/filtlong/test_lr_filtlong.fastq.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + +- name: filtlong test_filtlong_illumina_se + command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_se -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config + tags: + - filtlong + files: + - path: output/filtlong/test_lr_filtlong.fastq.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + +- name: filtlong test_filtlong_illumina_pe + command: nextflow run ./tests/modules/filtlong -entry test_filtlong_illumina_pe -c ./tests/config/nextflow.config -c ./tests/modules/filtlong/nextflow.config + tags: + - filtlong + files: + - path: output/filtlong/test_lr_filtlong.fastq.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a diff --git a/tests/modules/flash/main.nf b/tests/modules/flash/main.nf index e0f5e623..4afcb8fc 100644 --- a/tests/modules/flash/main.nf +++ b/tests/modules/flash/main.nf @@ -2,13 +2,14 @@ nextflow.enable.dsl = 2 -include { FLASH } from '../../../modules/flash/main.nf' addParams( options: [args:'-m 20 -M 100'] ) +include { FLASH } from '../../../modules/flash/main.nf' 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/nextflow.config b/tests/modules/flash/nextflow.config new file mode 100644 index 00000000..2845f9d9 --- /dev/null +++ b/tests/modules/flash/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: FLASH { + ext.args = '-m 20 -M 100' + } + +} diff --git a/tests/modules/flash/test.yml b/tests/modules/flash/test.yml index 61ea9eab..e5ed49ca 100644 --- a/tests/modules/flash/test.yml +++ b/tests/modules/flash/test.yml @@ -1,11 +1,8 @@ - name: flash test_flash - command: nextflow run tests/modules/flash -entry test_flash -c tests/config/nextflow.config + command: nextflow run ./tests/modules/flash -entry test_flash -c ./tests/config/nextflow.config -c ./tests/modules/flash/nextflow.config 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 diff --git a/tests/modules/freebayes/main.nf b/tests/modules/freebayes/main.nf new file mode 100644 index 00000000..f8ae0ecb --- /dev/null +++ b/tests/modules/freebayes/main.nf @@ -0,0 +1,95 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { FREEBAYES } from '../../../modules/freebayes/main.nf' + +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), + [], + [] + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + targets = [] + samples = [] + populations = [] + cnv = [] + + FREEBAYES (input, fasta, fai, 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), + [], + [] + ] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = 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, fasta, fai, targets, samples, populations, cnv) +} + +workflow test_freebayes_cram { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_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) + targets = [] + samples = [] + populations = [] + cnv = [] + + FREEBAYES (input, fasta, fai, targets, samples, populations, cnv) +} + +workflow test_freebayes_somatic { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam_bai'], 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) + targets = [] + samples = [] + populations = [] + cnv = [] + + FREEBAYES (input, fasta, fai, targets, samples, populations, cnv) +} + +workflow test_freebayes_somatic_cram_intervals { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_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) + targets = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + samples = [] + populations = [] + cnv = [] + + FREEBAYES (input, fasta, fai, targets, samples, populations, cnv) +} diff --git a/tests/modules/freebayes/nextflow.config b/tests/modules/freebayes/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/freebayes/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/freebayes/test.yml b/tests/modules/freebayes/test.yml new file mode 100644 index 00000000..c9aa78da --- /dev/null +++ b/tests/modules/freebayes/test.yml @@ -0,0 +1,34 @@ +- name: freebayes test_freebayes + command: nextflow run ./tests/modules/freebayes -entry test_freebayes -c ./tests/config/nextflow.config -c ./tests/modules/freebayes/nextflow.config + tags: + - freebayes + files: + - path: output/freebayes/test.vcf.gz + +- name: freebayes test_freebayes_bed + command: nextflow run ./tests/modules/freebayes -entry test_freebayes_bed -c ./tests/config/nextflow.config -c ./tests/modules/freebayes/nextflow.config + tags: + - freebayes + files: + - path: output/freebayes/test.vcf.gz + +- name: freebayes test_freebayes_cram + command: nextflow run ./tests/modules/freebayes -entry test_freebayes_cram -c ./tests/config/nextflow.config -c ./tests/modules/freebayes/nextflow.config + tags: + - freebayes + files: + - path: output/freebayes/test.vcf.gz + +- name: freebayes test_freebayes_somatic + command: nextflow run ./tests/modules/freebayes -entry test_freebayes_somatic -c ./tests/config/nextflow.config -c ./tests/modules/freebayes/nextflow.config + tags: + - freebayes + files: + - path: output/freebayes/test.vcf.gz + +- name: freebayes test_freebayes_somatic_cram_intervals + command: nextflow run ./tests/modules/freebayes -entry test_freebayes_somatic_cram_intervals -c ./tests/config/nextflow.config -c ./tests/modules/freebayes/nextflow.config + tags: + - freebayes + files: + - path: output/freebayes/test.vcf.gz diff --git a/tests/modules/gatk4/applybqsr/main.nf b/tests/modules/gatk4/applybqsr/main.nf index 5fb590b0..da85b11b 100644 --- a/tests/modules/gatk4/applybqsr/main.nf +++ b/tests/modules/gatk4/applybqsr/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { GATK4_APPLYBQSR } from '../../../../modules/gatk4/applybqsr/main.nf' addParams( options: [:] ) +include { GATK4_APPLYBQSR } from '../../../../modules/gatk4/applybqsr/main.nf' workflow test_gatk4_applybqsr { input = [ [ id:'test' ], // meta map @@ -30,3 +30,17 @@ workflow test_gatk4_applybqsr_intervals { GATK4_APPLYBQSR ( input, fasta, fai, dict, intervals ) } + +workflow test_gatk4_applybqsr_cram { + input = [ [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_baserecalibrator_table'], 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) + dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + intervals = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + + GATK4_APPLYBQSR ( input, fasta, fai, dict, intervals ) +} diff --git a/tests/modules/gatk4/applybqsr/nextflow.config b/tests/modules/gatk4/applybqsr/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gatk4/applybqsr/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gatk4/applybqsr/test.yml b/tests/modules/gatk4/applybqsr/test.yml index 983cc09a..d0b07d94 100644 --- a/tests/modules/gatk4/applybqsr/test.yml +++ b/tests/modules/gatk4/applybqsr/test.yml @@ -1,17 +1,26 @@ - name: gatk4 applybqsr test_gatk4_applybqsr - command: nextflow run tests/modules/gatk4/applybqsr -entry test_gatk4_applybqsr -c tests/config/nextflow.config + command: nextflow run ./tests/modules/gatk4/applybqsr -entry test_gatk4_applybqsr -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/applybqsr/nextflow.config tags: - - gatk4 - gatk4/applybqsr + - gatk4 files: - path: output/gatk4/test.bam - md5sum: dac716c394db5e83c12b44355c098ca7 + md5sum: af56f5dd81b95070079d54670507f530 - name: gatk4 applybqsr test_gatk4_applybqsr_intervals - command: nextflow run tests/modules/gatk4/applybqsr -entry test_gatk4_applybqsr_intervals -c tests/config/nextflow.config + command: nextflow run ./tests/modules/gatk4/applybqsr -entry test_gatk4_applybqsr_intervals -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/applybqsr/nextflow.config tags: - - gatk4 - gatk4/applybqsr + - gatk4 files: - path: output/gatk4/test.bam - md5sum: 400441dbe5344658580ba0a24ba57069 + md5sum: 0cbfa4be143e988d56ce741b5077510e + +- name: gatk4 applybqsr test_gatk4_applybqsr_cram + command: nextflow run ./tests/modules/gatk4/applybqsr -entry test_gatk4_applybqsr_cram -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/applybqsr/nextflow.config + tags: + - gatk4/applybqsr + - gatk4 + files: + - path: output/gatk4/test.bam + md5sum: 720ef7453fc3c9def18bbe396062346c diff --git a/tests/modules/gatk4/applyvqsr/main.nf b/tests/modules/gatk4/applyvqsr/main.nf new file mode 100644 index 00000000..90a57aaa --- /dev/null +++ b/tests/modules/gatk4/applyvqsr/main.nf @@ -0,0 +1,41 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK4_APPLYVQSR } from '../../../../modules/gatk4/applyvqsr/main.nf' + +workflow test_gatk4_applyvqsr { + input = [ [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_recal'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_recal_idx'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_tranches'], checkIfExists: true) + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + dict = file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) + allelespecific = false + truthsensitivity = '99.0' + mode = 'SNP' + + GATK4_APPLYVQSR ( input, fasta, fai, dict, allelespecific, truthsensitivity, mode ) +} + +workflow test_gatk4_applyvqsr_allele_specific { + input = [ [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_allele_specific_recal'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_allele_specific_recal_idx'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_allele_specific_tranches'], checkIfExists: true) + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + dict = file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) + allelespecific = true + truthsensitivity = '99.0' + mode = 'SNP' + + GATK4_APPLYVQSR ( input, fasta, fai, dict, allelespecific, truthsensitivity, mode ) +} diff --git a/tests/modules/gatk4/applyvqsr/nextflow.config b/tests/modules/gatk4/applyvqsr/nextflow.config new file mode 100644 index 00000000..19934e76 --- /dev/null +++ b/tests/modules/gatk4/applyvqsr/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/gatk4/applyvqsr/test.yml b/tests/modules/gatk4/applyvqsr/test.yml new file mode 100644 index 00000000..e870bed3 --- /dev/null +++ b/tests/modules/gatk4/applyvqsr/test.yml @@ -0,0 +1,17 @@ +- name: gatk4 applyvqsr test_gatk4_applyvqsr + command: nextflow run tests/modules/gatk4/applyvqsr -entry test_gatk4_applyvqsr -c tests/config/nextflow.config -c ./tests/modules/gatk4/applyvqsr/nextflow.config + tags: + - gatk4 + - gatk4/applyvqsr + files: + - path: output/gatk4/test.vcf.gz + - path: output/gatk4/test.vcf.gz.tbi + +- name: gatk4 applyvqsr test_gatk4_applyvqsr_allele_specific + command: nextflow run tests/modules/gatk4/applyvqsr -entry test_gatk4_applyvqsr_allele_specific -c tests/config/nextflow.config -c ./tests/modules/gatk4/applyvqsr/nextflow.config + tags: + - gatk4 + - gatk4/applyvqsr + files: + - path: output/gatk4/test.vcf.gz + - path: output/gatk4/test.vcf.gz.tbi diff --git a/tests/modules/gatk4/baserecalibrator/main.nf b/tests/modules/gatk4/baserecalibrator/main.nf index 671a1d67..2675d04b 100644 --- a/tests/modules/gatk4/baserecalibrator/main.nf +++ b/tests/modules/gatk4/baserecalibrator/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { GATK4_BASERECALIBRATOR } from '../../../../modules/gatk4/baserecalibrator/main.nf' addParams( options: [:] ) +include { GATK4_BASERECALIBRATOR } from '../../../../modules/gatk4/baserecalibrator/main.nf' workflow test_gatk4_baserecalibrator { input = [ [ id:'test' ], // meta map @@ -18,6 +18,21 @@ workflow test_gatk4_baserecalibrator { GATK4_BASERECALIBRATOR ( input, fasta, fai, dict, [], sites, sites_tbi ) } +workflow test_gatk4_baserecalibrator_cram { + input = [ [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_baserecalibrator_table'], 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) + dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + sites = file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true) + sites_tbi = file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz_tbi'], checkIfExists: true) + + GATK4_BASERECALIBRATOR ( input, fasta, fai, dict, [], sites, sites_tbi ) +} + workflow test_gatk4_baserecalibrator_intervals { input = [ [ id:'test' ], // meta map file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), diff --git a/tests/modules/gatk4/baserecalibrator/nextflow.config b/tests/modules/gatk4/baserecalibrator/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gatk4/baserecalibrator/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gatk4/baserecalibrator/test.yml b/tests/modules/gatk4/baserecalibrator/test.yml index 3c30d78f..163fac08 100644 --- a/tests/modules/gatk4/baserecalibrator/test.yml +++ b/tests/modules/gatk4/baserecalibrator/test.yml @@ -1,26 +1,35 @@ - name: gatk4 baserecalibrator test_gatk4_baserecalibrator - command: nextflow run tests/modules/gatk4/baserecalibrator -entry test_gatk4_baserecalibrator -c tests/config/nextflow.config + command: nextflow run ./tests/modules/gatk4/baserecalibrator -entry test_gatk4_baserecalibrator -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/baserecalibrator/nextflow.config tags: - - gatk4/baserecalibrator - gatk4 + - gatk4/baserecalibrator files: - path: output/gatk4/test.table md5sum: e2e43abdc0c943c1a54dae816d0b9ea7 -- name: gatk4 baserecalibrator test_gatk4_baserecalibrator_intervals - command: nextflow run tests/modules/gatk4/baserecalibrator -entry test_gatk4_baserecalibrator_intervals -c tests/config/nextflow.config +- name: gatk4 baserecalibrator test_gatk4_baserecalibrator_cram + command: nextflow run ./tests/modules/gatk4/baserecalibrator -entry test_gatk4_baserecalibrator_cram -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/baserecalibrator/nextflow.config tags: - - gatk4/baserecalibrator - gatk4 + - gatk4/baserecalibrator + files: + - path: output/gatk4/test.table + md5sum: 35d89a3811aa31711fc9815b6b80e6ec + +- name: gatk4 baserecalibrator test_gatk4_baserecalibrator_intervals + command: nextflow run ./tests/modules/gatk4/baserecalibrator -entry test_gatk4_baserecalibrator_intervals -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/baserecalibrator/nextflow.config + tags: + - gatk4 + - gatk4/baserecalibrator files: - path: output/gatk4/test.table md5sum: 9ecb5f00a2229291705addc09c0ec231 - name: gatk4 baserecalibrator test_gatk4_baserecalibrator_multiple_sites - command: nextflow run tests/modules/gatk4/baserecalibrator -entry test_gatk4_baserecalibrator_multiple_sites -c tests/config/nextflow.config + command: nextflow run ./tests/modules/gatk4/baserecalibrator -entry test_gatk4_baserecalibrator_multiple_sites -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/baserecalibrator/nextflow.config tags: - - gatk4/baserecalibrator - gatk4 + - gatk4/baserecalibrator files: - path: output/gatk4/test.table md5sum: e2e43abdc0c943c1a54dae816d0b9ea7 diff --git a/tests/modules/gatk4/bedtointervallist/main.nf b/tests/modules/gatk4/bedtointervallist/main.nf index 1ca4be58..2dd72904 100644 --- a/tests/modules/gatk4/bedtointervallist/main.nf +++ b/tests/modules/gatk4/bedtointervallist/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { GATK4_BEDTOINTERVALLIST } from '../../../../modules/gatk4/bedtointervallist/main.nf' addParams( options: [:] ) +include { GATK4_BEDTOINTERVALLIST } from '../../../../modules/gatk4/bedtointervallist/main.nf' workflow test_gatk4_bedtointervallist { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/gatk4/bedtointervallist/nextflow.config b/tests/modules/gatk4/bedtointervallist/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gatk4/bedtointervallist/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gatk4/bedtointervallist/test.yml b/tests/modules/gatk4/bedtointervallist/test.yml index 83c3a574..3482fa6c 100644 --- a/tests/modules/gatk4/bedtointervallist/test.yml +++ b/tests/modules/gatk4/bedtointervallist/test.yml @@ -1,5 +1,5 @@ - name: gatk4 bedtointervallist test_gatk4_bedtointervallist - command: nextflow run tests/modules/gatk4/bedtointervallist -entry test_gatk4_bedtointervallist -c tests/config/nextflow.config + command: nextflow run ./tests/modules/gatk4/bedtointervallist -entry test_gatk4_bedtointervallist -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/bedtointervallist/nextflow.config tags: - gatk4 - gatk4/bedtointervallist diff --git a/tests/modules/gatk4/calculatecontamination/main.nf b/tests/modules/gatk4/calculatecontamination/main.nf new file mode 100644 index 00000000..4b659ed3 --- /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' + +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/nextflow.config b/tests/modules/gatk4/calculatecontamination/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gatk4/calculatecontamination/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gatk4/calculatecontamination/test.yml b/tests/modules/gatk4/calculatecontamination/test.yml new file mode 100644 index 00000000..0c489bff --- /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 -c ./tests/modules/gatk4/calculatecontamination/nextflow.config + tags: + - gatk4/calculatecontamination + - gatk4 + files: + - path: output/gatk4/test.contamination.table + md5sum: 5fdcf1728cf98985ce31c038eb24e05c + +- 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 -c ./tests/modules/gatk4/calculatecontamination/nextflow.config + tags: + - gatk4/calculatecontamination + - gatk4 + files: + - path: output/gatk4/test.contamination.table + md5sum: 5fdcf1728cf98985ce31c038eb24e05c + +- name: gatk4 calculatecontamination test_gatk4_calculatecontamination_segmentation + command: nextflow run ./tests/modules/gatk4/calculatecontamination -entry test_gatk4_calculatecontamination_segmentation -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/calculatecontamination/nextflow.config + tags: + - gatk4/calculatecontamination + - gatk4 + files: + - path: output/gatk4/test.contamination.table + md5sum: 5fdcf1728cf98985ce31c038eb24e05c + - path: output/gatk4/test.segmentation.table + md5sum: 91f28bfe4727a3256810927fc5eba92f diff --git a/tests/modules/gatk4/createsequencedictionary/main.nf b/tests/modules/gatk4/createsequencedictionary/main.nf index 443d77bc..b304b043 100644 --- a/tests/modules/gatk4/createsequencedictionary/main.nf +++ b/tests/modules/gatk4/createsequencedictionary/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { GATK4_CREATESEQUENCEDICTIONARY } from '../../../../modules/gatk4/createsequencedictionary/main.nf' addParams( options: [:] ) +include { GATK4_CREATESEQUENCEDICTIONARY } from '../../../../modules/gatk4/createsequencedictionary/main.nf' workflow test_gatk4_createsequencedictionary { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/gatk4/createsequencedictionary/nextflow.config b/tests/modules/gatk4/createsequencedictionary/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gatk4/createsequencedictionary/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gatk4/createsequencedictionary/test.yml b/tests/modules/gatk4/createsequencedictionary/test.yml index 7788d16a..134a9d74 100644 --- a/tests/modules/gatk4/createsequencedictionary/test.yml +++ b/tests/modules/gatk4/createsequencedictionary/test.yml @@ -1,5 +1,5 @@ - name: gatk4 createsequencedictionary test_gatk4_createsequencedictionary - command: nextflow run tests/modules/gatk4/createsequencedictionary -entry test_gatk4_createsequencedictionary -c tests/config/nextflow.config + command: nextflow run ./tests/modules/gatk4/createsequencedictionary -entry test_gatk4_createsequencedictionary -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/createsequencedictionary/nextflow.config tags: - gatk4 - gatk4/createsequencedictionary diff --git a/tests/modules/gatk4/createsomaticpanelofnormals/main.nf b/tests/modules/gatk4/createsomaticpanelofnormals/main.nf new file mode 100644 index 00000000..5e1d1904 --- /dev/null +++ b/tests/modules/gatk4/createsomaticpanelofnormals/main.nf @@ -0,0 +1,21 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UNTAR } from '../../../../modules/untar/main.nf' +include { GATK4_CREATESOMATICPANELOFNORMALS } from '../../../../modules/gatk4/createsomaticpanelofnormals/main.nf' + +workflow test_gatk4_createsomaticpanelofnormals { + db = file(params.test_data['homo_sapiens']['illumina']['test_genomicsdb_tar_gz'], checkIfExists: true) + + UNTAR ( db ) + + input = Channel.of([ id:'test']) + .combine(UNTAR.out.untar) + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + fastaidx = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + + GATK4_CREATESOMATICPANELOFNORMALS ( input, fasta, fastaidx, dict ) +} diff --git a/tests/modules/gatk4/createsomaticpanelofnormals/nextflow.config b/tests/modules/gatk4/createsomaticpanelofnormals/nextflow.config new file mode 100644 index 00000000..d73e78ad --- /dev/null +++ b/tests/modules/gatk4/createsomaticpanelofnormals/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: GATK4_CREATESOMATICPANELOFNORMALS { + ext.prefix = { "${meta.id}.pon" } + } + +} diff --git a/tests/modules/gatk4/createsomaticpanelofnormals/test.yml b/tests/modules/gatk4/createsomaticpanelofnormals/test.yml new file mode 100644 index 00000000..a0e2bf26 --- /dev/null +++ b/tests/modules/gatk4/createsomaticpanelofnormals/test.yml @@ -0,0 +1,9 @@ +- name: gatk4 createsomaticpanelofnormals test_gatk4_createsomaticpanelofnormals + command: nextflow run ./tests/modules/gatk4/createsomaticpanelofnormals -entry test_gatk4_createsomaticpanelofnormals -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/createsomaticpanelofnormals/nextflow.config + tags: + - gatk4 + - gatk4/createsomaticpanelofnormals + files: + - path: output/gatk4/test.pon.vcf.gz + - path: output/gatk4/test.pon.vcf.gz.tbi + md5sum: e7ca7e9fe76ce12198fd54ec9a64fad4 diff --git a/tests/modules/gatk4/estimatelibrarycomplexity/main.nf b/tests/modules/gatk4/estimatelibrarycomplexity/main.nf new file mode 100644 index 00000000..398a6c79 --- /dev/null +++ b/tests/modules/gatk4/estimatelibrarycomplexity/main.nf @@ -0,0 +1,18 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK4_ESTIMATELIBRARYCOMPLEXITY } from '../../../../modules/gatk4/estimatelibrarycomplexity/main.nf' + +workflow test_gatk4_estimatelibrarycomplexity { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_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) + dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + + GATK4_ESTIMATELIBRARYCOMPLEXITY ( input, fasta, fai, dict ) +} diff --git a/tests/modules/gatk4/estimatelibrarycomplexity/nextflow.config b/tests/modules/gatk4/estimatelibrarycomplexity/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gatk4/estimatelibrarycomplexity/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gatk4/estimatelibrarycomplexity/test.yml b/tests/modules/gatk4/estimatelibrarycomplexity/test.yml new file mode 100644 index 00000000..a33e4ec1 --- /dev/null +++ b/tests/modules/gatk4/estimatelibrarycomplexity/test.yml @@ -0,0 +1,7 @@ +- name: gatk4 estimatelibrarycomplexity test_gatk4_estimatelibrarycomplexity + command: nextflow run ./tests/modules/gatk4/estimatelibrarycomplexity -entry test_gatk4_estimatelibrarycomplexity -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/estimatelibrarycomplexity/nextflow.config + tags: + - gatk4/estimatelibrarycomplexity + - gatk4 + files: + - path: output/gatk4/test.metrics diff --git a/tests/modules/gatk4/fastqtosam/main.nf b/tests/modules/gatk4/fastqtosam/main.nf index 64694d9f..4f53c791 100644 --- a/tests/modules/gatk4/fastqtosam/main.nf +++ b/tests/modules/gatk4/fastqtosam/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { GATK4_FASTQTOSAM } from '../../../../modules/gatk4/fastqtosam/main.nf' addParams( options: [:] ) +include { GATK4_FASTQTOSAM } from '../../../../modules/gatk4/fastqtosam/main.nf' workflow test_gatk4_fastqtosam_single_end { input = [ [ id:'test', single_end:true ], // meta map diff --git a/tests/modules/gatk4/fastqtosam/nextflow.config b/tests/modules/gatk4/fastqtosam/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gatk4/fastqtosam/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gatk4/fastqtosam/test.yml b/tests/modules/gatk4/fastqtosam/test.yml index f6597b66..d5d23f94 100644 --- a/tests/modules/gatk4/fastqtosam/test.yml +++ b/tests/modules/gatk4/fastqtosam/test.yml @@ -1,17 +1,17 @@ - name: gatk4 fastqtosam test_gatk4_fastqtosam_single_end - command: nextflow run tests/modules/gatk4/fastqtosam -entry test_gatk4_fastqtosam_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/gatk4/fastqtosam -entry test_gatk4_fastqtosam_single_end -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/fastqtosam/nextflow.config tags: - gatk4/fastqtosam - gatk4 files: - path: output/gatk4/test.bam - md5sum: 4967100b2e4912c0e4ce0976d946bafb + md5sum: 0a0d308b219837977b8df9daa26db7de - name: gatk4 fastqtosam test_gatk4_fastqtosam_paired_end - command: nextflow run tests/modules/gatk4/fastqtosam -entry test_gatk4_fastqtosam_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/gatk4/fastqtosam -entry test_gatk4_fastqtosam_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/fastqtosam/nextflow.config tags: - gatk4 - gatk4/fastqtosam files: - path: output/gatk4/test.bam - md5sum: 4967100b2e4912c0e4ce0976d946bafb + md5sum: 0a0d308b219837977b8df9daa26db7de diff --git a/tests/modules/gatk4/filtermutectcalls/main.nf b/tests/modules/gatk4/filtermutectcalls/main.nf new file mode 100644 index 00000000..fa0acff9 --- /dev/null +++ b/tests/modules/gatk4/filtermutectcalls/main.nf @@ -0,0 +1,65 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK4_FILTERMUTECTCALLS } from '../../../../modules/gatk4/filtermutectcalls/main.nf' + +workflow test_gatk4_filtermutectcalls_base { + + input = [ + [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz_stats'], 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) + dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + + GATK4_FILTERMUTECTCALLS ( input, fasta, fai, dict ) +} + +workflow test_gatk4_filtermutectcalls_with_files { + + input = [ + [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz_stats'], checkIfExists: true), + [ file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_artifact_prior_tar_gz'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_segmentation_table'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_contamination_table'], 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) + dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + + GATK4_FILTERMUTECTCALLS ( input, fasta, fai, dict ) +} + +workflow test_gatk4_filtermutectcalls_use_val { + + input = [ + [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz_stats'], checkIfExists: true), + [ file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_artifact_prior_tar_gz'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_segmentation_table'], checkIfExists: true) ], + [], + '20.0' + ] + + 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) + dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + + GATK4_FILTERMUTECTCALLS ( input, fasta, fai, dict ) +} diff --git a/tests/modules/gatk4/filtermutectcalls/nextflow.config b/tests/modules/gatk4/filtermutectcalls/nextflow.config new file mode 100644 index 00000000..3d4148d2 --- /dev/null +++ b/tests/modules/gatk4/filtermutectcalls/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: GATK4_FILTERMUTECTCALLS { + ext.prefix = { "${meta.id}.filtered" } + } + +} diff --git a/tests/modules/gatk4/filtermutectcalls/test.yml b/tests/modules/gatk4/filtermutectcalls/test.yml new file mode 100644 index 00000000..72504e66 --- /dev/null +++ b/tests/modules/gatk4/filtermutectcalls/test.yml @@ -0,0 +1,35 @@ +- name: gatk4 filtermutectcalls test_gatk4_filtermutectcalls_base + command: nextflow run ./tests/modules/gatk4/filtermutectcalls -entry test_gatk4_filtermutectcalls_base -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/filtermutectcalls/nextflow.config + tags: + - gatk4 + - gatk4/filtermutectcalls + files: + - path: output/gatk4/test.filtered.vcf.gz + - path: output/gatk4/test.filtered.vcf.gz.filteringStats.tsv + md5sum: 98e1b87a52999eb8f429ef4a7877eb3f + - path: output/gatk4/test.filtered.vcf.gz.tbi + md5sum: e7ca7e9fe76ce12198fd54ec9a64fad4 + +- name: gatk4 filtermutectcalls test_gatk4_filtermutectcalls_with_files + command: nextflow run ./tests/modules/gatk4/filtermutectcalls -entry test_gatk4_filtermutectcalls_with_files -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/filtermutectcalls/nextflow.config + tags: + - gatk4 + - gatk4/filtermutectcalls + files: + - path: output/gatk4/test.filtered.vcf.gz + - path: output/gatk4/test.filtered.vcf.gz.filteringStats.tsv + md5sum: 98e1b87a52999eb8f429ef4a7877eb3f + - path: output/gatk4/test.filtered.vcf.gz.tbi + md5sum: e7ca7e9fe76ce12198fd54ec9a64fad4 + +- name: gatk4 filtermutectcalls test_gatk4_filtermutectcalls_use_val + command: nextflow run ./tests/modules/gatk4/filtermutectcalls -entry test_gatk4_filtermutectcalls_use_val -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/filtermutectcalls/nextflow.config + tags: + - gatk4 + - gatk4/filtermutectcalls + files: + - path: output/gatk4/test.filtered.vcf.gz + - path: output/gatk4/test.filtered.vcf.gz.filteringStats.tsv + md5sum: 98e1b87a52999eb8f429ef4a7877eb3f + - path: output/gatk4/test.filtered.vcf.gz.tbi + md5sum: e7ca7e9fe76ce12198fd54ec9a64fad4 diff --git a/tests/modules/gatk4/gatherbqsrreports/main.nf b/tests/modules/gatk4/gatherbqsrreports/main.nf new file mode 100644 index 00000000..2693a06a --- /dev/null +++ b/tests/modules/gatk4/gatherbqsrreports/main.nf @@ -0,0 +1,27 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK4_GATHERBQSRREPORTS } from '../../../../modules/gatk4/gatherbqsrreports/main.nf' + +workflow test_gatk4_gatherbqsrreports { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_baserecalibrator_table'], checkIfExists: true) + ] + + GATK4_GATHERBQSRREPORTS ( input ) +} + +workflow test_gatk4_gatherbqsrreports_multiple { + + input = [ + [ id:'test', single_end:false ], // meta map + [file(params.test_data['homo_sapiens']['illumina']['test_baserecalibrator_table'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_baserecalibrator_table'], checkIfExists: true) + ] + ] + + GATK4_GATHERBQSRREPORTS ( input ) +} diff --git a/tests/modules/gatk4/gatherbqsrreports/nextflow.config b/tests/modules/gatk4/gatherbqsrreports/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/gatk4/gatherbqsrreports/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/gatk4/gatherbqsrreports/test.yml b/tests/modules/gatk4/gatherbqsrreports/test.yml new file mode 100644 index 00000000..76c90120 --- /dev/null +++ b/tests/modules/gatk4/gatherbqsrreports/test.yml @@ -0,0 +1,21 @@ +- name: gatk4 gatherbqsrreports test_gatk4_gatherbqsrreports + command: nextflow run tests/modules/gatk4/gatherbqsrreports -entry test_gatk4_gatherbqsrreports -c tests/config/nextflow.config + tags: + - gatk4 + - gatk4/gatherbqsrreports + files: + - path: output/gatk4/test.table + md5sum: 9603b69fdc3b5090de2e0dd78bfcc4bf + - path: output/gatk4/versions.yml + md5sum: 50238fd0f3b6f4efb2b5335b6324f905 + +- name: gatk4 gatherbqsrreports test_gatk4_gatherbqsrreports_multiple + command: nextflow run tests/modules/gatk4/gatherbqsrreports -entry test_gatk4_gatherbqsrreports_multiple -c tests/config/nextflow.config + tags: + - gatk4 + - gatk4/gatherbqsrreports + files: + - path: output/gatk4/test.table + md5sum: 0c1257eececf95db8ca378272d0f21f9 + - path: output/gatk4/versions.yml + md5sum: c6ce163062dd3609848fc5bc10660427 diff --git a/tests/modules/gatk4/genomicsdbimport/main.nf b/tests/modules/gatk4/genomicsdbimport/main.nf new file mode 100644 index 00000000..417a08a4 --- /dev/null +++ b/tests/modules/gatk4/genomicsdbimport/main.nf @@ -0,0 +1,61 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UNTAR } from '../../../../modules/untar/main.nf' +include { GATK4_GENOMICSDBIMPORT } from '../../../../modules/gatk4/genomicsdbimport/main.nf' + +workflow test_gatk4_genomicsdbimport_create_genomicsdb { + + input = [ [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) , + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true) , + file(params.test_data['homo_sapiens']['genome']['genome_interval_list'], checkIfExists: true) , + [] , + [] ] + + run_intlist = false + run_updatewspace = false + input_map = false + + GATK4_GENOMICSDBIMPORT ( input, run_intlist, run_updatewspace, input_map ) +} + +workflow test_gatk4_genomicsdbimport_get_intervalslist { + db = file(params.test_data['homo_sapiens']['illumina']['test_genomicsdb_tar_gz'], checkIfExists: true) + + UNTAR ( db ) + + def input = Channel.of([ [ id:'test'], // meta map + [] , + [] , + [] , + [] ]) + .combine(UNTAR.out.untar) + + run_intlist = true + run_updatewspace = false + input_map = false + + GATK4_GENOMICSDBIMPORT ( input, run_intlist, run_updatewspace, input_map ) +} + +workflow test_gatk4_genomicsdbimport_update_genomicsdb { + db = file(params.test_data['homo_sapiens']['illumina']['test_genomicsdb_tar_gz'], checkIfExists: true) + + UNTAR ( db ) + + def input = Channel.of([ [ id:'test'], // meta map + file( params.test_data['homo_sapiens']['illumina']['test2_genome_vcf_gz'] , checkIfExists: true) , + file( params.test_data['homo_sapiens']['illumina']['test2_genome_vcf_gz_tbi'] , checkIfExists: true) , + [] , + [] ]) + .combine(UNTAR.out.untar) + + run_intlist = false + run_updatewspace = true + input_map = false + + GATK4_GENOMICSDBIMPORT ( input, run_intlist, run_updatewspace, input_map ) + +} diff --git a/tests/modules/gatk4/genomicsdbimport/nextflow.config b/tests/modules/gatk4/genomicsdbimport/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gatk4/genomicsdbimport/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gatk4/genomicsdbimport/test.yml b/tests/modules/gatk4/genomicsdbimport/test.yml new file mode 100644 index 00000000..94a1a35e --- /dev/null +++ b/tests/modules/gatk4/genomicsdbimport/test.yml @@ -0,0 +1,50 @@ +- name: gatk4 genomicsdbimport test_gatk4_genomicsdbimport_create_genomicsdb + command: nextflow run ./tests/modules/gatk4/genomicsdbimport -entry test_gatk4_genomicsdbimport_create_genomicsdb -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/genomicsdbimport/nextflow.config + tags: + - gatk4/genomicsdbimport + - gatk4 + files: + - path: output/gatk4/test/__tiledb_workspace.tdb + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/gatk4/test/callset.json + md5sum: a7d07d1c86449bbb1091ff29368da07a + - path: output/gatk4/test/chr22$1$40001/.__consolidation_lock + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/gatk4/test/chr22$1$40001/__array_schema.tdb + - path: output/gatk4/test/chr22$1$40001/genomicsdb_meta_dir/genomicsdb_column_bounds.json + md5sum: 2502f79658bc000578ebcfddfc1194c0 + - path: output/gatk4/test/vcfheader.vcf + contains: + - "FORMAT= 0"', 'suffix': '.filtered'] -include { GATK4_VARIANTFILTRATION } from '../../../../modules/gatk4/variantfiltration/main.nf' addParams( options: test_options ) +include { GATK4_VARIANTFILTRATION } from '../../../../modules/gatk4/variantfiltration/main.nf' -workflow test_gatk4_variantfiltration { - input = [ [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] - ] - fasta = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] - fai = [ file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) ] - genome_dict = [ file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) ] +// Basic parameters with uncompressed VCF input +workflow test_gatk4_variantfiltration_vcf_input { + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_idx'], checkIfExists: true) + ] - GATK4_VARIANTFILTRATION ( input, fasta, fai, genome_dict ) + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + fasta_index = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + fasta_dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + + GATK4_VARIANTFILTRATION ( input, fasta, fasta_index, fasta_dict ) } + +// Basic parameters with compressed VCF input +workflow test_gatk4_variantfiltration_gz_input { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true) + ] + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + fasta_index = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + fasta_dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + + GATK4_VARIANTFILTRATION ( input, fasta, fasta_index, fasta_dict ) +} + + diff --git a/tests/modules/gatk4/variantfiltration/nextflow.config b/tests/modules/gatk4/variantfiltration/nextflow.config new file mode 100644 index 00000000..4b930f28 --- /dev/null +++ b/tests/modules/gatk4/variantfiltration/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: GATK4_VARIANTFILTRATION { + ext.args = "--filter-name \'test_filter\' --filter-expression \'MQ0 > 0\'" + ext.prefix = { "${meta.id}.filtered" } + } + +} diff --git a/tests/modules/gatk4/variantfiltration/test.yml b/tests/modules/gatk4/variantfiltration/test.yml index 1a2bf6d2..b5da0e5c 100644 --- a/tests/modules/gatk4/variantfiltration/test.yml +++ b/tests/modules/gatk4/variantfiltration/test.yml @@ -1,9 +1,19 @@ -- name: gatk4 variantfiltration test_gatk4_variantfiltration - command: nextflow run tests/modules/gatk4/variantfiltration -entry test_gatk4_variantfiltration -c tests/config/nextflow.config +- name: gatk4 variantfiltration test_gatk4_variantfiltration_vcf_input + command: nextflow run ./tests/modules/gatk4/variantfiltration -entry test_gatk4_variantfiltration_vcf_input -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/variantfiltration/nextflow.config tags: - gatk4/variantfiltration - gatk4 files: - - path: output/gatk4/test.filtered.vcf - contains: - - "AC=2;AN=2;DP=1;DP4=0,0,1,0;MQ=60;MQ0F=0;SGB=-0.379885" + - path: output/gatk4/test.filtered.vcf.gz + contains: ['BaseQRankSum=-1.318;DP=17;ExcessHet=3.0103;MLEAC=1,0,0;MLEAF=0.500,0.00,0.00;MQRankSum=0.000;RAW_MQandDP=61200,17;ReadPosRankSum=2.365'] + - path: output/gatk4/test.filtered.vcf.gz.tbi + +- name: gatk4 variantfiltration test_gatk4_variantfiltration_gz_input + command: nextflow run ./tests/modules/gatk4/variantfiltration -entry test_gatk4_variantfiltration_gz_input -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/variantfiltration/nextflow.config + tags: + - gatk4/variantfiltration + - gatk4 + files: + - path: output/gatk4/test.filtered.vcf.gz + contains: ['BaseQRankSum=-1.318;DP=17;ExcessHet=3.0103;MLEAC=1,0,0;MLEAF=0.500,0.00,0.00;MQRankSum=0.000;RAW_MQandDP=61200,17;ReadPosRankSum=2.365'] + - path: output/gatk4/test.filtered.vcf.gz.tbi diff --git a/tests/modules/gatk4/variantrecalibrator/main.nf b/tests/modules/gatk4/variantrecalibrator/main.nf new file mode 100644 index 00000000..bbc1dff5 --- /dev/null +++ b/tests/modules/gatk4/variantrecalibrator/main.nf @@ -0,0 +1,81 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK4_VARIANTRECALIBRATOR } from '../../../../modules/gatk4/variantrecalibrator/main.nf' + +workflow test_gatk4_variantrecalibrator { + + input = [ [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz_tbi'], checkIfExists: true) + ] + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + dict = file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) + allelespecific = false + resources = [ + [ + file(params.test_data['homo_sapiens']['genome']['hapmap_3_3_hg38_21_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['res_1000g_omni2_5_hg38_21_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['res_1000g_phase1_snps_hg38_21_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz'], checkIfExists: true) + ], + [ + file(params.test_data['homo_sapiens']['genome']['hapmap_3_3_hg38_21_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['res_1000g_omni2_5_hg38_21_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['res_1000g_phase1_snps_hg38_21_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz_tbi'], checkIfExists: true) + ], + [ + 'hapmap,known=false,training=true,truth=true,prior=15.0 hapmap_3.3.hg38.vcf.gz', + 'omni,known=false,training=true,truth=false,prior=12.0 1000G_omni2.5.hg38.vcf.gz', + '1000G,known=false,training=true,truth=false,prior=10.0 1000G_phase1.snps.hg38.vcf.gz', + 'dbsnp,known=true,training=false,truth=false,prior=2.0 dbsnp_138.hg38.vcf.gz' + ] + ] + annotation = ['QD', 'MQ', 'FS', 'SOR'] + mode = 'SNP' + create_rscript = false + + GATK4_VARIANTRECALIBRATOR ( input, fasta, fai, dict, allelespecific, resources, annotation, mode, create_rscript) +} + +workflow test_gatk4_variantrecalibrator_allele_specific { + + input = [ [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz_tbi'], checkIfExists: true) + ] + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + dict = file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) + allelespecific = true + resources = [ + [ + file(params.test_data['homo_sapiens']['genome']['hapmap_3_3_hg38_21_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['res_1000g_omni2_5_hg38_21_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['res_1000g_phase1_snps_hg38_21_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz'], checkIfExists: true) + ], + [ + file(params.test_data['homo_sapiens']['genome']['hapmap_3_3_hg38_21_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['res_1000g_omni2_5_hg38_21_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['res_1000g_phase1_snps_hg38_21_vcf_gz_tbi'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz_tbi'], checkIfExists: true) + ], + [ + 'hapmap,known=false,training=true,truth=true,prior=15.0 hapmap_3.3.hg38.vcf.gz', + 'omni,known=false,training=true,truth=false,prior=12.0 1000G_omni2.5.hg38.vcf.gz', + '1000G,known=false,training=true,truth=false,prior=10.0 1000G_phase1.snps.hg38.vcf.gz', + 'dbsnp,known=true,training=false,truth=false,prior=2.0 dbsnp_138.hg38.vcf.gz' + ] + ] + annotation = ['QD', 'MQ', 'FS'] + mode = 'SNP' + create_rscript = false + + GATK4_VARIANTRECALIBRATOR ( input, fasta, fai, dict, allelespecific, resources, annotation, mode, create_rscript) +} diff --git a/tests/modules/gatk4/variantrecalibrator/nextflow.config b/tests/modules/gatk4/variantrecalibrator/nextflow.config new file mode 100644 index 00000000..19934e76 --- /dev/null +++ b/tests/modules/gatk4/variantrecalibrator/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/gatk4/variantrecalibrator/test.yml b/tests/modules/gatk4/variantrecalibrator/test.yml new file mode 100644 index 00000000..42b18e36 --- /dev/null +++ b/tests/modules/gatk4/variantrecalibrator/test.yml @@ -0,0 +1,25 @@ +- name: gatk4 variantrecalibrator test_gatk4_variantrecalibrator + command: nextflow run tests/modules/gatk4/variantrecalibrator -entry test_gatk4_variantrecalibrator -c tests/config/nextflow.config -c ./tests/modules/gatk4/variantrecalibrator/nextflow.config + tags: + - gatk4 + - gatk4/variantrecalibrator + files: + - path: output/gatk4/test.recal + contains: + - "#CHROM POS ID REF ALT QUAL FILTER INFO" + - path: output/gatk4/test.recal.idx + - path: output/gatk4/test.tranches + md5sum: d238e97bf996863969dac7751e345549 + +- name: gatk4 variantrecalibrator test_gatk4_variantrecalibrator_allele_specific + command: nextflow run tests/modules/gatk4/variantrecalibrator -entry test_gatk4_variantrecalibrator_allele_specific -c tests/config/nextflow.config -c ./tests/modules/gatk4/variantrecalibrator/nextflow.config + tags: + - gatk4 + - gatk4/variantrecalibrator + files: + - path: output/gatk4/test.recal + contains: + - "#CHROM POS ID REF ALT QUAL FILTER INFO" + - path: output/gatk4/test.recal.idx + - path: output/gatk4/test.tranches + md5sum: 444438d46716593634a6817958099292 diff --git a/tests/modules/genmap/index/main.nf b/tests/modules/genmap/index/main.nf index dfbdbbed..06106640 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' workflow test_genmap_index { diff --git a/tests/modules/genmap/index/nextflow.config b/tests/modules/genmap/index/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/genmap/index/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/genmap/index/test.yml b/tests/modules/genmap/index/test.yml index 8b06e75e..ce2098ce 100644 --- a/tests/modules/genmap/index/test.yml +++ b/tests/modules/genmap/index/test.yml @@ -1,48 +1,48 @@ - name: genmap index test_genmap_index - command: nextflow run tests/modules/genmap/index -entry test_genmap_index -c tests/config/nextflow.config + command: nextflow run ./tests/modules/genmap/index -entry test_genmap_index -c ./tests/config/nextflow.config -c ./tests/modules/genmap/index/nextflow.config tags: - 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/genmap/mappability/main.nf b/tests/modules/genmap/mappability/main.nf index 636ec0e4..eb6a34fa 100644 --- a/tests/modules/genmap/mappability/main.nf +++ b/tests/modules/genmap/mappability/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { GENMAP_INDEX } from '../../../../modules/genmap/index/main.nf' addParams( options: [:] ) -include { GENMAP_MAPPABILITY } from '../../../../modules/genmap/mappability/main.nf' addParams( options: [args : '-K 50 -E 2 -w -t -bg'] ) +include { GENMAP_INDEX } from '../../../../modules/genmap/index/main.nf' +include { GENMAP_MAPPABILITY } from '../../../../modules/genmap/mappability/main.nf' workflow test_genmap_map { diff --git a/tests/modules/genmap/mappability/nextflow.config b/tests/modules/genmap/mappability/nextflow.config new file mode 100644 index 00000000..6936b9ea --- /dev/null +++ b/tests/modules/genmap/mappability/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: GENMAP_MAPPABILITY { + ext.args = '-K 50 -E 2 -w -t -bg' + } + +} diff --git a/tests/modules/genmap/mappability/test.yml b/tests/modules/genmap/mappability/test.yml index 29a12de1..94c1d501 100644 --- a/tests/modules/genmap/mappability/test.yml +++ b/tests/modules/genmap/mappability/test.yml @@ -1,5 +1,5 @@ - name: genmap mappability test_genmap_map - command: nextflow run tests/modules/genmap/mappability -entry test_genmap_map -c tests/config/nextflow.config + command: nextflow run ./tests/modules/genmap/mappability -entry test_genmap_map -c ./tests/config/nextflow.config -c ./tests/modules/genmap/mappability/nextflow.config tags: - genmap - genmap/mappability diff --git a/tests/modules/genrich/main.nf b/tests/modules/genrich/main.nf new file mode 100644 index 00000000..34db589e --- /dev/null +++ b/tests/modules/genrich/main.nf @@ -0,0 +1,79 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GENRICH } from '../../../modules/genrich/main.nf' +include { GENRICH as GENRICH_CTRL } from '../../../modules/genrich/main.nf' +include { GENRICH as GENRICH_ALL } from '../../../modules/genrich/main.nf' +include { GENRICH as GENRICH_ATACSEQ } from '../../../modules/genrich/main.nf' + +workflow test_genrich { + input = [ [ id:'test', single_end:false ], // meta map + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ]] + control = [ ] + blacklist = [ ] + + save_pvalues = false + save_pileup = false + save_bed = false + save_duplicates = false + + GENRICH ( input, control, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) +} + +workflow test_genrich_ctrl { + input = [ [ id:'test', single_end:false ], // meta map + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ]] + control = [ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true) ] + blacklist = [ ] + + save_pvalues = false + save_pileup = false + save_bed = false + save_duplicates = false + + GENRICH_CTRL ( input, control, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) +} + +workflow test_genrich_all_outputs { + input = [ [ id:'test', single_end:false ], // meta map + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ]] + control = [ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true) ] + blacklist = [ ] + + save_pvalues = true + save_pileup = true + save_bed = true + save_duplicates = true + + GENRICH_ALL ( input, control, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) +} + +workflow test_genrich_blacklist { + input = [ [ id:'test', single_end:false ], // meta map + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ]] + control = [ ] + blacklist = [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true)] + + save_pvalues = false + save_pileup = false + save_bed = false + save_duplicates = false + + GENRICH ( input, control, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) +} + +workflow test_genrich_atacseq { + input = [ [ id:'test', single_end:false ], // meta map + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ]] + control = [ ] + blacklist = [ ] + + save_pvalues = false + save_pileup = false + save_bed = false + save_duplicates = false + + GENRICH_ATACSEQ ( input, control, blacklist, save_pvalues, save_pileup, save_bed, save_duplicates ) +} + diff --git a/tests/modules/genrich/nextflow.config b/tests/modules/genrich/nextflow.config new file mode 100644 index 00000000..8f79d7be --- /dev/null +++ b/tests/modules/genrich/nextflow.config @@ -0,0 +1,21 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: GENRICH { + ext.args = '-p 0.1' + } + + withName: GENRICH_CTRL { + ext.args = '-p 0.9' + } + + withName: GENRICH_ALL { + ext.args = '-r -p 0.1' + } + + withName: GENRICH_ATACSEQ { + ext.args = '-j -p 0.1' + } + +} diff --git a/tests/modules/genrich/test.yml b/tests/modules/genrich/test.yml new file mode 100644 index 00000000..972335c4 --- /dev/null +++ b/tests/modules/genrich/test.yml @@ -0,0 +1,47 @@ +- name: genrich test_genrich + command: nextflow run ./tests/modules/genrich -entry test_genrich -c ./tests/config/nextflow.config -c ./tests/modules/genrich/nextflow.config + tags: + - genrich + files: + - path: output/genrich/test.narrowPeak + md5sum: 6afabdd3f691c7c84c66ff8a23984681 + +- name: genrich test_genrich_ctrl + command: nextflow run ./tests/modules/genrich -entry test_genrich_ctrl -c ./tests/config/nextflow.config -c ./tests/modules/genrich/nextflow.config + tags: + - genrich + files: + - path: output/genrich/test.narrowPeak + md5sum: 2fcc392360b317f5ebee88cdbc149e05 + +- name: genrich test_genrich_all_outputs + command: nextflow run ./tests/modules/genrich -entry test_genrich_all_outputs -c ./tests/config/nextflow.config -c ./tests/modules/genrich/nextflow.config + tags: + - genrich + files: + - path: output/genrich/test.duplicates.txt + md5sum: 159d557af7c23bc3cfb802d87fa96c34 + - path: output/genrich/test.intervals.bed + md5sum: 4bea65caa3f4043d703af4b57161112e + - path: output/genrich/test.narrowPeak + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/genrich/test.pileup.bedGraph + md5sum: 03e53848de695b5794f32f15b2709203 + - path: output/genrich/test.pvalues.bedGraph + md5sum: b14feef34b6d2379a173a734ca963cde + +- name: genrich test_genrich_blacklist + command: nextflow run ./tests/modules/genrich -entry test_genrich_blacklist -c ./tests/config/nextflow.config -c ./tests/modules/genrich/nextflow.config + tags: + - genrich + files: + - path: output/genrich/test.narrowPeak + md5sum: 6afabdd3f691c7c84c66ff8a23984681 + +- name: genrich test_genrich_atacseq + command: nextflow run ./tests/modules/genrich -entry test_genrich_atacseq -c ./tests/config/nextflow.config -c ./tests/modules/genrich/nextflow.config + tags: + - genrich + files: + - path: output/genrich/test.narrowPeak + md5sum: ddea556b820f8be3695ffdf6c6f70aff diff --git a/tests/modules/gffread/main.nf b/tests/modules/gffread/main.nf index e7b5441a..6ab7922b 100644 --- a/tests/modules/gffread/main.nf +++ b/tests/modules/gffread/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { GFFREAD } from '../../../modules/gffread/main.nf' addParams( options: [:] ) +include { GFFREAD } from '../../../modules/gffread/main.nf' workflow test_gffread { input = file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) diff --git a/tests/modules/gffread/nextflow.config b/tests/modules/gffread/nextflow.config new file mode 100644 index 00000000..0714a6e8 --- /dev/null +++ b/tests/modules/gffread/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: GFFREAD { + ext.prefix = { "${gff.baseName}.out" } + } + +} diff --git a/tests/modules/gffread/test.yml b/tests/modules/gffread/test.yml index 21a7bb6a..c5a16132 100644 --- a/tests/modules/gffread/test.yml +++ b/tests/modules/gffread/test.yml @@ -1,7 +1,7 @@ - name: gffread - command: nextflow run ./tests/modules/gffread/ -entry test_gffread -c tests/config/nextflow.config + command: nextflow run ./tests/modules/gffread/ -entry test_gffread -c ./tests/config/nextflow.config -c ./tests/modules/gffread/nextflow.config tags: - gffread files: - - path: ./output/gffread/genome.gtf - md5sum: f184f856b7fe3e159d21b052b5dd3954 + - path: ./output/gffread/genome.out.gtf + md5sum: fcbf5744ed806e47768bc456fa043263 diff --git a/tests/modules/glnexus/main.nf b/tests/modules/glnexus/main.nf new file mode 100644 index 00000000..aeb7c7e2 --- /dev/null +++ b/tests/modules/glnexus/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GLNEXUS } from '../../../modules/glnexus/main.nf' + +workflow test_glnexus { + input = [ + [ id:'test' ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_genome_vcf_gz'], checkIfExists: true) + ] + ] + + GLNEXUS ( input ) +} diff --git a/tests/modules/glnexus/nextflow.config b/tests/modules/glnexus/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/glnexus/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/glnexus/test.yml b/tests/modules/glnexus/test.yml new file mode 100644 index 00000000..bfca4529 --- /dev/null +++ b/tests/modules/glnexus/test.yml @@ -0,0 +1,7 @@ +- name: glnexus test_glnexus + command: nextflow run ./tests/modules/glnexus -entry test_glnexus -c ./tests/config/nextflow.config -c ./tests/modules/glnexus/nextflow.config + tags: + - glnexus + files: + - path: output/glnexus/test.bcf + md5sum: 62b2cea9c1b92ac63645cb031eea46fc diff --git a/tests/modules/graphmap2/align/main.nf b/tests/modules/graphmap2/align/main.nf index 0cd885ab..96b95166 100644 --- a/tests/modules/graphmap2/align/main.nf +++ b/tests/modules/graphmap2/align/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { GRAPHMAP2_INDEX } from '../../../../modules/graphmap2/index/main.nf' addParams( options: [:] ) -include { GRAPHMAP2_ALIGN } from '../../../../modules/graphmap2/align/main.nf' addParams( options: [:] ) +include { GRAPHMAP2_INDEX } from '../../../../modules/graphmap2/index/main.nf' +include { GRAPHMAP2_ALIGN } from '../../../../modules/graphmap2/align/main.nf' workflow test_graphmap2_align { diff --git a/tests/modules/graphmap2/align/nextflow.config b/tests/modules/graphmap2/align/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/graphmap2/align/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/graphmap2/align/test.yml b/tests/modules/graphmap2/align/test.yml index 7e90b8d4..90e52dd1 100644 --- a/tests/modules/graphmap2/align/test.yml +++ b/tests/modules/graphmap2/align/test.yml @@ -1,5 +1,5 @@ - name: graphmap2 align - command: nextflow run ./tests/modules/graphmap2/align -entry test_graphmap2_align -c tests/config/nextflow.config + command: nextflow run ./tests/modules/graphmap2/align -entry test_graphmap2_align -c ./tests/config/nextflow.config -c ./tests/modules/graphmap2/align/nextflow.config tags: - graphmap2 - graphmap2/align diff --git a/tests/modules/graphmap2/index/main.nf b/tests/modules/graphmap2/index/main.nf index 66347f06..3c449c6b 100644 --- a/tests/modules/graphmap2/index/main.nf +++ b/tests/modules/graphmap2/index/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { GRAPHMAP2_INDEX } from '../../../../modules/graphmap2/index/main.nf' addParams( options: [:] ) +include { GRAPHMAP2_INDEX } from '../../../../modules/graphmap2/index/main.nf' workflow test_graphmap2_index { diff --git a/tests/modules/graphmap2/index/nextflow.config b/tests/modules/graphmap2/index/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/graphmap2/index/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/graphmap2/index/test.yml b/tests/modules/graphmap2/index/test.yml index 15042e97..0bff487e 100644 --- a/tests/modules/graphmap2/index/test.yml +++ b/tests/modules/graphmap2/index/test.yml @@ -1,5 +1,5 @@ - name: graphmap2 index - command: nextflow run ./tests/modules/graphmap2/index -entry test_graphmap2_index -c tests/config/nextflow.config + command: nextflow run ./tests/modules/graphmap2/index -entry test_graphmap2_index -c ./tests/config/nextflow.config -c ./tests/modules/graphmap2/index/nextflow.config tags: - graphmap2 - graphmap2/index diff --git a/tests/modules/gstama/collapse/main.nf b/tests/modules/gstama/collapse/main.nf new file mode 100644 index 00000000..3eb97767 --- /dev/null +++ b/tests/modules/gstama/collapse/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GSTAMA_COLLAPSE } from '../../../../modules/gstama/collapse/main.nf' + +workflow test_gstama_collapse { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['pacbio']['aligned'], checkIfExists: true) + ] + genome = file(params.test_data['homo_sapiens']['genome']['genome2_fasta'], checkIfExists: true) + + GSTAMA_COLLAPSE ( input, genome ) +} diff --git a/tests/modules/gstama/collapse/nextflow.config b/tests/modules/gstama/collapse/nextflow.config new file mode 100644 index 00000000..a68f33f2 --- /dev/null +++ b/tests/modules/gstama/collapse/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: GSTAMA_COLLAPSE { + ext.args = '-x capped -b BAM' + ext.prefix = { "${meta.id}_tc" } + } + +} diff --git a/tests/modules/gstama/collapse/test.yml b/tests/modules/gstama/collapse/test.yml new file mode 100644 index 00000000..50d3775e --- /dev/null +++ b/tests/modules/gstama/collapse/test.yml @@ -0,0 +1,24 @@ +- name: gstama collapse test_gstama_collapse + command: nextflow run ./tests/modules/gstama/collapse -entry test_gstama_collapse -c ./tests/config/nextflow.config -c ./tests/modules/gstama/collapse/nextflow.config + tags: + - gstama + - gstama/collapse + files: + - path: output/gstama/test_tc_collapsed.bed + md5sum: e5105198ed970a33ae0ecaa7bff421d9 + - path: output/gstama/test_tc_local_density_error.txt + md5sum: b917ac1f14eccd590b6881a686f324d5 + - path: output/gstama/test_tc_polya.txt + md5sum: 628ea62b918fc4f31e109f724d714a66 + - path: output/gstama/test_tc_read.txt + md5sum: d2685d7f24cd1611e0770a5ce25422fe + - path: output/gstama/test_tc_strand_check.txt + md5sum: 42cc52b2660b1e0b84e1c9ab37a965ec + - path: output/gstama/test_tc_trans_read.bed + md5sum: 0ca1a32f33ef05242d897d913802554b + - path: output/gstama/test_tc_trans_report.txt + md5sum: 33a86c15ca2acce36b2a5962f4c1adc4 + - path: output/gstama/test_tc_varcov.txt + md5sum: 587fd899ff658eb66b1770a35283bfcb + - path: output/gstama/test_tc_variants.txt + md5sum: 5b1165e9f33faba4f7207013fc27257e diff --git a/tests/modules/gstama/merge/main.nf b/tests/modules/gstama/merge/main.nf new file mode 100644 index 00000000..4a9102a2 --- /dev/null +++ b/tests/modules/gstama/merge/main.nf @@ -0,0 +1,19 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GSTAMA_MERGE } from '../../../../modules/gstama/merge/main' + +workflow test_gstama_merge { + + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['pacbio']['genemodel1'], checkIfExists: true), + file(params.test_data['homo_sapiens']['pacbio']['genemodel2'], checkIfExists: true) + ] + ] + filelist = file(params.test_data['homo_sapiens']['pacbio']['filelist'], checkIfExists: true) + + GSTAMA_MERGE ( input, filelist ) +} diff --git a/tests/modules/gstama/merge/nextflow.config b/tests/modules/gstama/merge/nextflow.config new file mode 100644 index 00000000..e0d7c8ef --- /dev/null +++ b/tests/modules/gstama/merge/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: GSTAMA_MERGE { + ext.prefix = { "${meta.id}_merged" } + } + +} diff --git a/tests/modules/gstama/merge/test.yml b/tests/modules/gstama/merge/test.yml new file mode 100644 index 00000000..1db35d15 --- /dev/null +++ b/tests/modules/gstama/merge/test.yml @@ -0,0 +1,14 @@ +- name: gstama merge test_gstama_merge + command: nextflow run ./tests/modules/gstama/merge -entry test_gstama_merge -c ./tests/config/nextflow.config -c ./tests/modules/gstama/merge/nextflow.config + tags: + - gstama + - gstama/merge + files: + - path: output/gstama/test_merged.bed + md5sum: 60ec34e1ff9655d4ce2e83d3f4bbf448 + - path: output/gstama/test_merged_gene_report.txt + md5sum: 7029fd183dfd905a233403cfbe44722a + - path: output/gstama/test_merged_merge.txt + md5sum: 4279e59ed5739ce4f2f811568962893f + - path: output/gstama/test_merged_trans_report.txt + md5sum: 97d8346d9eb9da140941656c3a3325cd diff --git a/tests/modules/gtdbtk/classifywf/main.nf b/tests/modules/gtdbtk/classifywf/main.nf new file mode 100644 index 00000000..1517d7cc --- /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' + +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/nextflow.config b/tests/modules/gtdbtk/classifywf/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gtdbtk/classifywf/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gtdbtk/classifywf/test.yml b/tests/modules/gtdbtk/classifywf/test.yml new file mode 100644 index 00000000..e24f1e17 --- /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 -c ./tests/modules/gtdbtk/classifywf/nextflow.config + tags: + - gtdbtk + - gtdbtk/classifywf + files: + - path: output/gtdbtk/gtdbtk.SPADES-test.stub.summary.tsv + md5sum: d41d8cd98f00b204e9800998ecf8427e diff --git a/tests/modules/gubbins/main.nf b/tests/modules/gubbins/main.nf index 87e164d0..342150b3 100644 --- a/tests/modules/gubbins/main.nf +++ b/tests/modules/gubbins/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { GUBBINS } from '../../../modules/gubbins/main.nf' addParams( options: [:] ) +include { GUBBINS } from '../../../modules/gubbins/main.nf' workflow test_gubbins { input = file(params.test_data['sarscov2']['genome']['all_sites_fas'], checkIfExists: true) diff --git a/tests/modules/gubbins/nextflow.config b/tests/modules/gubbins/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gubbins/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gubbins/test.yml b/tests/modules/gubbins/test.yml index 31e426b1..6c85260d 100644 --- a/tests/modules/gubbins/test.yml +++ b/tests/modules/gubbins/test.yml @@ -1,5 +1,5 @@ - name: gubbins - command: nextflow run ./tests/modules/gubbins -entry test_gubbins -c tests/config/nextflow.config + command: nextflow run ./tests/modules/gubbins -entry test_gubbins -c ./tests/config/nextflow.config -c ./tests/modules/gubbins/nextflow.config tags: - gubbins files: @@ -10,14 +10,14 @@ - path: output/gubbins/all_sites.recombination_predictions.gff md5sum: f95871e79968340cb82532e2c9b0c92b - path: output/gubbins/all_sites.branch_base_reconstruction.embl - md5sum: 02e6fb268f7422bfe34b27ecd3b2c245 + md5sum: 9e051646d630f528fff58f1f73286006 - path: output/gubbins/all_sites.summary_of_snp_distribution.vcf md5sum: 276e62e888ea811577c8ffb2da0b3aff - path: output/gubbins/all_sites.per_branch_statistics.csv - md5sum: 94b09b25d10504b56aa0307beae98a98 + md5sum: 25e4fdb6681c3709a9add1d5632bbf3e - path: output/gubbins/all_sites.filtered_polymorphic_sites.phylip md5sum: 0a77f397a7797c5c3386832745b0c97a - path: output/gubbins/all_sites.final_tree.tre - md5sum: e3c7ea18e2c5c49774c0e2ff78bd1818 + md5sum: 6cb251b58307aab11cb4b48792d6cda1 - path: output/gubbins/all_sites.node_labelled.final_tree.tre - md5sum: 7727b4c4111ebf49cc8a4f1fdd25092c + md5sum: e01f965a15924b4f97603b8011c8d3f7 diff --git a/tests/modules/gunc/downloaddb/main.nf b/tests/modules/gunc/downloaddb/main.nf new file mode 100644 index 00000000..3e3126f5 --- /dev/null +++ b/tests/modules/gunc/downloaddb/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GUNC_DOWNLOADDB } from '../../../../modules/gunc/downloaddb/main.nf' + +workflow test_gunc_downloaddb { + + input = 'progenomes' + + GUNC_DOWNLOADDB ( input ) +} diff --git a/tests/modules/gunc/downloaddb/nextflow.config b/tests/modules/gunc/downloaddb/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gunc/downloaddb/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gunc/downloaddb/test.yml b/tests/modules/gunc/downloaddb/test.yml new file mode 100644 index 00000000..4e1c23f8 --- /dev/null +++ b/tests/modules/gunc/downloaddb/test.yml @@ -0,0 +1,8 @@ +- name: gunc downloaddb + command: nextflow run ./tests/modules/gunc/downloaddb -entry test_gunc_downloaddb -c ./tests/config/nextflow.config -c ./tests/modules/gunc/downloaddb/nextflow.config + tags: + - gunc + - gunc/downloaddb + files: + - path: output/gunc/gunc_db_progenomes2.1.dmnd + md5sum: 447c9330056b02f29f30fe81fe4af4eb diff --git a/tests/modules/gunc/run/main.nf b/tests/modules/gunc/run/main.nf new file mode 100644 index 00000000..28ecd35f --- /dev/null +++ b/tests/modules/gunc/run/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GUNC_RUN } from '../../../../modules/gunc/run/main.nf' +include { GUNC_DOWNLOADDB } from '../../../../modules/gunc/downloaddb/main.nf' + +workflow test_gunc_run { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true) + ] + + GUNC_DOWNLOADDB ( 'progenomes' ) + GUNC_RUN ( input, GUNC_DOWNLOADDB.out.db ) +} diff --git a/tests/modules/gunc/run/nextflow.config b/tests/modules/gunc/run/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gunc/run/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gunc/run/test.yml b/tests/modules/gunc/run/test.yml new file mode 100644 index 00000000..5bcef868 --- /dev/null +++ b/tests/modules/gunc/run/test.yml @@ -0,0 +1,8 @@ +- name: gunc run + command: nextflow run ./tests/modules/gunc/run -entry test_gunc_run -c ./tests/config/nextflow.config -c ./tests/modules/gunc/run/nextflow.config + tags: + - gunc + - gunc/run + files: + - path: output/gunc/GUNC.progenomes_2.1.maxCSS_level.tsv + md5sum: 0420c1a9f2c50fefaee9fab5d80a551a diff --git a/tests/modules/gunzip/main.nf b/tests/modules/gunzip/main.nf index 5a24e742..3d41a4a2 100644 --- a/tests/modules/gunzip/main.nf +++ b/tests/modules/gunzip/main.nf @@ -2,10 +2,12 @@ nextflow.enable.dsl = 2 -include { GUNZIP } from '../../../modules/gunzip/main.nf' addParams( options: [:] ) +include { GUNZIP } from '../../../modules/gunzip/main.nf' workflow test_gunzip { - input = file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + input = [ [], + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] GUNZIP ( input ) } diff --git a/tests/modules/gunzip/nextflow.config b/tests/modules/gunzip/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/gunzip/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/gunzip/test.yml b/tests/modules/gunzip/test.yml index 70012b21..70e95d6b 100644 --- a/tests/modules/gunzip/test.yml +++ b/tests/modules/gunzip/test.yml @@ -1,5 +1,5 @@ - name: gunzip - command: nextflow run ./tests/modules/gunzip -entry test_gunzip -c tests/config/nextflow.config + command: nextflow run ./tests/modules/gunzip -entry test_gunzip -c ./tests/config/nextflow.config -c ./tests/modules/gunzip/nextflow.config tags: - gunzip files: diff --git a/tests/modules/hicap/main.nf b/tests/modules/hicap/main.nf new file mode 100644 index 00000000..82c515de --- /dev/null +++ b/tests/modules/hicap/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HICAP } from '../../../modules/hicap/main.nf' + +workflow test_hicap { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['haemophilus_influenzae']['genome']['genome_fna_gz'], checkIfExists: true) + ] + database_dir = [] + model_fp = [] + + HICAP ( input, database_dir, model_fp ) +} diff --git a/tests/modules/hicap/nextflow.config b/tests/modules/hicap/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/hicap/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/hicap/test.yml b/tests/modules/hicap/test.yml new file mode 100644 index 00000000..0cce28c7 --- /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 -c ./tests/modules/hicap/nextflow.config + tags: + - hicap + files: + - path: output/hicap/genome.gbk + md5sum: 562d026956903354ac80721f501335d4 + - path: output/hicap/genome.svg + md5sum: 4fb94871dd0fdd8b4496049668176631 + - path: output/hicap/genome.tsv diff --git a/tests/modules/hifiasm/main.nf b/tests/modules/hifiasm/main.nf new file mode 100644 index 00000000..f0e2a0f4 --- /dev/null +++ b/tests/modules/hifiasm/main.nf @@ -0,0 +1,31 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HIFIASM } from '../../../modules/hifiasm/main.nf' + +/* + * Test with long reads only + */ +workflow test_hifiasm_hifi_only { + input = [ + [ id:'test' ], // meta map + [ file(params.test_data['homo_sapiens']['pacbio']['hifi'], checkIfExists: true) ] + ] + + HIFIASM ( input, [], [], false ) +} + +/* + * Test with parental reads for phasing + */ +workflow test_hifiasm_with_parental_reads { + input = [ + [ id:'test' ], // meta map + [ 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) + + HIFIASM ( input, paternal_kmer_dump, maternal_kmer_dump, true ) +} diff --git a/tests/modules/hifiasm/nextflow.config b/tests/modules/hifiasm/nextflow.config new file mode 100644 index 00000000..0994c901 --- /dev/null +++ b/tests/modules/hifiasm/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: HIFIASM { + ext.args = '-f0' + } + +} diff --git a/tests/modules/hifiasm/test.yml b/tests/modules/hifiasm/test.yml new file mode 100644 index 00000000..f7e3e6ae --- /dev/null +++ b/tests/modules/hifiasm/test.yml @@ -0,0 +1,33 @@ +- name: hifiasm test_hifiasm_hifi_only + command: nextflow run ./tests/modules/hifiasm -entry test_hifiasm_hifi_only -c ./tests/config/nextflow.config -c ./tests/modules/hifiasm/nextflow.config + tags: + - hifiasm + files: + - path: output/hifiasm/test.asm.bp.hap1.p_ctg.gfa + md5sum: 73b0c1b01d445db91c269034b8660501 + - path: output/hifiasm/test.asm.bp.hap2.p_ctg.gfa + md5sum: 76847b7835185ab92611a820467c0066 + - path: output/hifiasm/test.asm.bp.p_utg.gfa + md5sum: 97446fb95de214835c36b10a90838486 + - path: output/hifiasm/test.asm.bp.r_utg.gfa + md5sum: 97446fb95de214835c36b10a90838486 + - path: output/hifiasm/test.asm.ec.bin + - path: output/hifiasm/test.asm.ovlp.reverse.bin + - path: output/hifiasm/test.asm.ovlp.source.bin + +- name: hifiasm test_hifiasm_with_parental_reads + command: nextflow run ./tests/modules/hifiasm -entry test_hifiasm_with_parental_reads -c ./tests/config/nextflow.config -c ./tests/modules/hifiasm/nextflow.config + tags: + - hifiasm + files: + - path: output/hifiasm/test.asm.dip.hap1.p_ctg.gfa + md5sum: 16907b1aea2081884deb9d039dd14038 + - path: output/hifiasm/test.asm.dip.hap2.p_ctg.gfa + md5sum: d283479bf72a31d0cc34f880535d0bd4 + - path: output/hifiasm/test.asm.dip.p_utg.gfa + md5sum: 97446fb95de214835c36b10a90838486 + - path: output/hifiasm/test.asm.dip.r_utg.gfa + md5sum: 97446fb95de214835c36b10a90838486 + - path: output/hifiasm/test.asm.ec.bin + - path: output/hifiasm/test.asm.ovlp.reverse.bin + - path: output/hifiasm/test.asm.ovlp.source.bin diff --git a/tests/modules/hisat2/align/main.nf b/tests/modules/hisat2/align/main.nf index 7bbe3a4b..17b47c93 100644 --- a/tests/modules/hisat2/align/main.nf +++ b/tests/modules/hisat2/align/main.nf @@ -2,14 +2,17 @@ nextflow.enable.dsl = 2 -include { HISAT2_EXTRACTSPLICESITES } from '../../../../modules/hisat2/extractsplicesites/main.nf' addParams( options: [:] ) -include { HISAT2_BUILD } from '../../../../modules/hisat2/build/main.nf' addParams( options: [:] ) -include { HISAT2_ALIGN } from '../../../../modules/hisat2/align/main.nf' addParams( options: [:] ) +include { HISAT2_EXTRACTSPLICESITES } from '../../../../modules/hisat2/extractsplicesites/main.nf' +include { HISAT2_BUILD } from '../../../../modules/hisat2/build/main.nf' +include { HISAT2_ALIGN } from '../../../../modules/hisat2/align/main.nf' workflow test_hisat2_align_single_end { - input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_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) + ] + ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) @@ -19,10 +22,13 @@ workflow test_hisat2_align_single_end { } workflow test_hisat2_align_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)] - ] + 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) gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) diff --git a/tests/modules/hisat2/align/nextflow.config b/tests/modules/hisat2/align/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/hisat2/align/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/hisat2/align/test.yml b/tests/modules/hisat2/align/test.yml index 9a1fb271..54e263bc 100644 --- a/tests/modules/hisat2/align/test.yml +++ b/tests/modules/hisat2/align/test.yml @@ -1,5 +1,5 @@ - name: hisat2 align test_hisat2_align_single_end - command: nextflow run tests/modules/hisat2/align -entry test_hisat2_align_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/hisat2/align -entry test_hisat2_align_single_end -c ./tests/config/nextflow.config -c ./tests/modules/hisat2/align/nextflow.config tags: - hisat2 - hisat2/align @@ -9,25 +9,25 @@ - path: output/hisat2/genome.splice_sites.txt md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/hisat2/test.bam - - path: output/index/hisat2/genome.5.ht2 + - path: output/hisat2/hisat2/genome.5.ht2 md5sum: 91198831aaba993acac1734138c5f173 - - path: output/index/hisat2/genome.7.ht2 + - path: output/hisat2/hisat2/genome.7.ht2 md5sum: 9013eccd91ad614d7893c739275a394f - - path: output/index/hisat2/genome.1.ht2 - md5sum: 3ea3dc41304941ad8d047e4d71b4899e - - path: output/index/hisat2/genome.2.ht2 + - path: output/hisat2/hisat2/genome.1.ht2 + md5sum: 057cfa8a22b97ee9cff4c8d342498803 + - path: output/hisat2/hisat2/genome.2.ht2 md5sum: 47b153cd1319abc88dda532462651fcf - - path: output/index/hisat2/genome.6.ht2 + - path: output/hisat2/hisat2/genome.6.ht2 md5sum: 265e1284ce85686516fae5d35540994a - - path: output/index/hisat2/genome.3.ht2 + - path: output/hisat2/hisat2/genome.3.ht2 md5sum: 4ed93abba181d8dfab2e303e33114777 - - path: output/index/hisat2/genome.8.ht2 + - path: output/hisat2/hisat2/genome.8.ht2 md5sum: 33cdeccccebe80329f1fdbee7f5874cb - - path: output/index/hisat2/genome.4.ht2 + - path: output/hisat2/hisat2/genome.4.ht2 md5sum: c25be5f8b0378abf7a58c8a880b87626 - name: hisat2 align test_hisat2_align_paired_end - command: nextflow run tests/modules/hisat2/align -entry test_hisat2_align_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/hisat2/align -entry test_hisat2_align_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/hisat2/align/nextflow.config tags: - hisat2 - hisat2/align @@ -37,19 +37,19 @@ - path: output/hisat2/genome.splice_sites.txt md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/hisat2/test.bam - - path: output/index/hisat2/genome.5.ht2 + - path: output/hisat2/hisat2/genome.5.ht2 md5sum: 91198831aaba993acac1734138c5f173 - - path: output/index/hisat2/genome.7.ht2 + - path: output/hisat2/hisat2/genome.7.ht2 md5sum: 9013eccd91ad614d7893c739275a394f - - path: output/index/hisat2/genome.1.ht2 - md5sum: 3ea3dc41304941ad8d047e4d71b4899e - - path: output/index/hisat2/genome.2.ht2 + - path: output/hisat2/hisat2/genome.1.ht2 + md5sum: 057cfa8a22b97ee9cff4c8d342498803 + - path: output/hisat2/hisat2/genome.2.ht2 md5sum: 47b153cd1319abc88dda532462651fcf - - path: output/index/hisat2/genome.6.ht2 + - path: output/hisat2/hisat2/genome.6.ht2 md5sum: 265e1284ce85686516fae5d35540994a - - path: output/index/hisat2/genome.3.ht2 + - path: output/hisat2/hisat2/genome.3.ht2 md5sum: 4ed93abba181d8dfab2e303e33114777 - - path: output/index/hisat2/genome.8.ht2 + - path: output/hisat2/hisat2/genome.8.ht2 md5sum: 33cdeccccebe80329f1fdbee7f5874cb - - path: output/index/hisat2/genome.4.ht2 + - path: output/hisat2/hisat2/genome.4.ht2 md5sum: c25be5f8b0378abf7a58c8a880b87626 diff --git a/tests/modules/hisat2/build_test/main.nf b/tests/modules/hisat2/build_test/main.nf index f40f47cc..a0c14dc8 100644 --- a/tests/modules/hisat2/build_test/main.nf +++ b/tests/modules/hisat2/build_test/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { HISAT2_EXTRACTSPLICESITES } from '../../../../modules/hisat2/extractsplicesites/main.nf' addParams( options: [:] ) -include { HISAT2_BUILD } from '../../../../modules/hisat2/build/main.nf' addParams( options: [:] ) +include { HISAT2_EXTRACTSPLICESITES } from '../../../../modules/hisat2/extractsplicesites/main.nf' +include { HISAT2_BUILD } from '../../../../modules/hisat2/build/main.nf' workflow test_hisat2_build { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/hisat2/build_test/nextflow.config b/tests/modules/hisat2/build_test/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/hisat2/build_test/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/hisat2/build_test/test.yml b/tests/modules/hisat2/build_test/test.yml index 2a8fe324..da5a450c 100644 --- a/tests/modules/hisat2/build_test/test.yml +++ b/tests/modules/hisat2/build_test/test.yml @@ -1,24 +1,24 @@ - name: hisat2 build test_hisat2_build - command: nextflow run tests/modules/hisat2/build_test -entry test_hisat2_build -c tests/config/nextflow.config + command: nextflow run ./tests/modules/hisat2/build_test -entry test_hisat2_build -c ./tests/config/nextflow.config -c ./tests/modules/hisat2/build/nextflow.config tags: - hisat2 - hisat2/build files: - path: output/hisat2/genome.splice_sites.txt md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/index/hisat2/genome.5.ht2 + - path: output/hisat2/hisat2/genome.5.ht2 md5sum: 91198831aaba993acac1734138c5f173 - - path: output/index/hisat2/genome.7.ht2 + - path: output/hisat2/hisat2/genome.7.ht2 md5sum: 9013eccd91ad614d7893c739275a394f - - path: output/index/hisat2/genome.1.ht2 - md5sum: 3ea3dc41304941ad8d047e4d71b4899e - - path: output/index/hisat2/genome.2.ht2 + - path: output/hisat2/hisat2/genome.1.ht2 + md5sum: 057cfa8a22b97ee9cff4c8d342498803 + - path: output/hisat2/hisat2/genome.2.ht2 md5sum: 47b153cd1319abc88dda532462651fcf - - path: output/index/hisat2/genome.6.ht2 + - path: output/hisat2/hisat2/genome.6.ht2 md5sum: 265e1284ce85686516fae5d35540994a - - path: output/index/hisat2/genome.3.ht2 + - path: output/hisat2/hisat2/genome.3.ht2 md5sum: 4ed93abba181d8dfab2e303e33114777 - - path: output/index/hisat2/genome.8.ht2 + - path: output/hisat2/hisat2/genome.8.ht2 md5sum: 33cdeccccebe80329f1fdbee7f5874cb - - path: output/index/hisat2/genome.4.ht2 + - path: output/hisat2/hisat2/genome.4.ht2 md5sum: c25be5f8b0378abf7a58c8a880b87626 diff --git a/tests/modules/hisat2/extractsplicesites/main.nf b/tests/modules/hisat2/extractsplicesites/main.nf index 5c7e17b9..e947717e 100644 --- a/tests/modules/hisat2/extractsplicesites/main.nf +++ b/tests/modules/hisat2/extractsplicesites/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { HISAT2_EXTRACTSPLICESITES } from '../../../../modules/hisat2/extractsplicesites/main.nf' addParams( options: [:] ) +include { HISAT2_EXTRACTSPLICESITES } from '../../../../modules/hisat2/extractsplicesites/main.nf' workflow test_hisat2_extractsplicesites { gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) diff --git a/tests/modules/hisat2/extractsplicesites/nextflow.config b/tests/modules/hisat2/extractsplicesites/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/hisat2/extractsplicesites/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/hisat2/extractsplicesites/test.yml b/tests/modules/hisat2/extractsplicesites/test.yml index a3e29346..a528199c 100644 --- a/tests/modules/hisat2/extractsplicesites/test.yml +++ b/tests/modules/hisat2/extractsplicesites/test.yml @@ -1,5 +1,5 @@ - name: hisat2 extractsplicesites test_hisat2_extractsplicesites - command: nextflow run tests/modules/hisat2/extractsplicesites -entry test_hisat2_extractsplicesites -c tests/config/nextflow.config + command: nextflow run ./tests/modules/hisat2/extractsplicesites -entry test_hisat2_extractsplicesites -c ./tests/config/nextflow.config -c ./tests/modules/hisat2/extractsplicesites/nextflow.config tags: - hisat2 - hisat2/extractsplicesites diff --git a/tests/modules/hmmcopy/gccounter/main.nf b/tests/modules/hmmcopy/gccounter/main.nf new file mode 100644 index 00000000..05728bf5 --- /dev/null +++ b/tests/modules/hmmcopy/gccounter/main.nf @@ -0,0 +1,11 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HMMCOPY_GCCOUNTER } from '../../../../modules/hmmcopy/gccounter/main.nf' + +workflow test_hmmcopy_gccounter { + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + HMMCOPY_GCCOUNTER (fasta) +} diff --git a/tests/modules/hmmcopy/gccounter/nextflow.config b/tests/modules/hmmcopy/gccounter/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/hmmcopy/gccounter/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/hmmcopy/gccounter/test.yml b/tests/modules/hmmcopy/gccounter/test.yml new file mode 100644 index 00000000..1cd20273 --- /dev/null +++ b/tests/modules/hmmcopy/gccounter/test.yml @@ -0,0 +1,8 @@ +- name: hmmcopy gccounter test_hmmcopy_gccounter + command: nextflow run ./tests/modules/hmmcopy/gccounter -entry test_hmmcopy_gccounter -c ./tests/config/nextflow.config -c ./tests/modules/hmmcopy/gccounter/nextflow.config + tags: + - hmmcopy + - hmmcopy/gccounter + files: + - path: output/hmmcopy/genome.gc.wig + md5sum: 59ad14bc5aaa903187d7b248c9490deb diff --git a/tests/modules/hmmcopy/generatemap/main.nf b/tests/modules/hmmcopy/generatemap/main.nf new file mode 100644 index 00000000..381420d3 --- /dev/null +++ b/tests/modules/hmmcopy/generatemap/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HMMCOPY_GENERATEMAP } from '../../../../modules/hmmcopy/generatemap/main.nf' + +workflow test_hmmcopy_generatemap { + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + HMMCOPY_GENERATEMAP ( fasta ) +} diff --git a/tests/modules/hmmcopy/generatemap/nextflow.config b/tests/modules/hmmcopy/generatemap/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/hmmcopy/generatemap/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/hmmcopy/generatemap/test.yml b/tests/modules/hmmcopy/generatemap/test.yml new file mode 100644 index 00000000..274e5d0f --- /dev/null +++ b/tests/modules/hmmcopy/generatemap/test.yml @@ -0,0 +1,10 @@ +- name: hmmcopy generatemap test_hmmcopy_generatemap + command: nextflow run tests/modules/hmmcopy/generatemap -entry test_hmmcopy_generatemap -c tests/config/nextflow.config + tags: + - hmmcopy + - hmmcopy/generatemap + files: + - path: output/hmmcopy/genome.fasta.map.bw + md5sum: 7ad68224a1e40287978284c387e8eb70 + - path: output/hmmcopy/versions.yml + md5sum: f950580f94d8a2d88332c477972cb9f0 diff --git a/tests/modules/hmmcopy/mapcounter/main.nf b/tests/modules/hmmcopy/mapcounter/main.nf new file mode 100644 index 00000000..c364f0f7 --- /dev/null +++ b/tests/modules/hmmcopy/mapcounter/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HMMCOPY_MAPCOUNTER } from '../../../../modules/hmmcopy/mapcounter/main.nf' +include { HMMCOPY_GENERATEMAP } from '../../../../modules/hmmcopy/generatemap/main.nf' +workflow test_hmmcopy_mapcounter { + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + HMMCOPY_GENERATEMAP( fasta ) + + HMMCOPY_MAPCOUNTER ( HMMCOPY_GENERATEMAP.out.bigwig ) +} diff --git a/tests/modules/hmmcopy/mapcounter/nextflow.config b/tests/modules/hmmcopy/mapcounter/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/hmmcopy/mapcounter/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/hmmcopy/mapcounter/test.yml b/tests/modules/hmmcopy/mapcounter/test.yml new file mode 100644 index 00000000..204800a1 --- /dev/null +++ b/tests/modules/hmmcopy/mapcounter/test.yml @@ -0,0 +1,12 @@ +- name: hmmcopy mapcounter test_hmmcopy_mapcounter + command: nextflow run tests/modules/hmmcopy/mapcounter -entry test_hmmcopy_mapcounter -c tests/config/nextflow.config + tags: + - hmmcopy/mapcounter + - hmmcopy + files: + - path: output/hmmcopy/genome.fasta.map.bw + md5sum: 7ad68224a1e40287978284c387e8eb70 + - path: output/hmmcopy/genome.fasta.map.map.wig + md5sum: e2d39dc204ed31c1ce372d633a42560f + - path: output/hmmcopy/versions.yml + md5sum: 8361e3c0f8b96cf84834678cf988a209 diff --git a/tests/modules/hmmcopy/readcounter/main.nf b/tests/modules/hmmcopy/readcounter/main.nf new file mode 100644 index 00000000..21737aab --- /dev/null +++ b/tests/modules/hmmcopy/readcounter/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HMMCOPY_READCOUNTER } from '../../../../modules/hmmcopy/readcounter/main.nf' + +workflow test_hmmcopy_readcounter { + + input = [ [ id:'test'], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true)], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true)] + ] + HMMCOPY_READCOUNTER ( input ) +} diff --git a/tests/modules/hmmcopy/readcounter/nextflow.config b/tests/modules/hmmcopy/readcounter/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/hmmcopy/readcounter/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/hmmcopy/readcounter/test.yml b/tests/modules/hmmcopy/readcounter/test.yml new file mode 100644 index 00000000..e13b0b8d --- /dev/null +++ b/tests/modules/hmmcopy/readcounter/test.yml @@ -0,0 +1,10 @@ +- name: hmmcopy readcounter test_hmmcopy_readcounter + command: nextflow run tests/modules/hmmcopy/readcounter -entry test_hmmcopy_readcounter -c tests/config/nextflow.config + tags: + - hmmcopy + - hmmcopy/readcounter + files: + - path: output/hmmcopy/test.wig + md5sum: 4682778422b9a2510a3cb70bd13ccd08 + - path: output/hmmcopy/versions.yml + md5sum: 624a85e6a1bc61abc33cac03aea33a1e diff --git a/tests/modules/hmmer/hmmalign/main.nf b/tests/modules/hmmer/hmmalign/main.nf index 55194dc6..3bf6d452 100644 --- a/tests/modules/hmmer/hmmalign/main.nf +++ b/tests/modules/hmmer/hmmalign/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { HMMER_HMMALIGN } from '../../../../modules/hmmer/hmmalign/main.nf' addParams( options: [:] ) +include { HMMER_HMMALIGN } from '../../../../modules/hmmer/hmmalign/main.nf' workflow test_hmmer_hmmalign { diff --git a/tests/modules/hmmer/hmmalign/nextflow.config b/tests/modules/hmmer/hmmalign/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/hmmer/hmmalign/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/hmmer/hmmalign/test.yml b/tests/modules/hmmer/hmmalign/test.yml index 4afb34ca..2e5ccfaf 100644 --- a/tests/modules/hmmer/hmmalign/test.yml +++ b/tests/modules/hmmer/hmmalign/test.yml @@ -1,5 +1,5 @@ - name: hmmer hmmalign test_hmmer_hmmalign - command: nextflow run tests/modules/hmmer/hmmalign -entry test_hmmer_hmmalign -c tests/config/nextflow.config + command: nextflow run ./tests/modules/hmmer/hmmalign -entry test_hmmer_hmmalign -c ./tests/config/nextflow.config -c ./tests/modules/hmmer/hmmalign/nextflow.config tags: - hmmer - hmmer/hmmalign diff --git a/tests/modules/homer/annotatepeaks/main.nf b/tests/modules/homer/annotatepeaks/main.nf index b146c857..ab8f6f8f 100644 --- a/tests/modules/homer/annotatepeaks/main.nf +++ b/tests/modules/homer/annotatepeaks/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { HOMER_ANNOTATEPEAKS } from '../../../../modules/homer/annotatepeaks/main.nf' addParams( options: [:] ) +include { HOMER_ANNOTATEPEAKS } from '../../../../modules/homer/annotatepeaks/main.nf' workflow test_homer_annotatepeaks { input = [ [ id:'test'], diff --git a/tests/modules/homer/annotatepeaks/nextflow.config b/tests/modules/homer/annotatepeaks/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/homer/annotatepeaks/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/homer/annotatepeaks/test.yml b/tests/modules/homer/annotatepeaks/test.yml index fed0f82e..52fd99a3 100644 --- a/tests/modules/homer/annotatepeaks/test.yml +++ b/tests/modules/homer/annotatepeaks/test.yml @@ -1,5 +1,5 @@ - name: homer annotatepeaks test_homer_annotatepeaks - command: nextflow run tests/modules/homer/annotatepeaks -entry test_homer_annotatepeaks -c tests/config/nextflow.config + command: nextflow run ./tests/modules/homer/annotatepeaks -entry test_homer_annotatepeaks -c ./tests/config/nextflow.config -c ./tests/modules/homer/annotatepeaks/nextflow.config tags: - homer - homer/annotatepeaks diff --git a/tests/modules/homer/findpeaks/main.nf b/tests/modules/homer/findpeaks/main.nf new file mode 100644 index 00000000..0e7e8ed6 --- /dev/null +++ b/tests/modules/homer/findpeaks/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HOMER_MAKETAGDIRECTORY } from '../../../../modules/homer/maketagdirectory/main.nf' +include { HOMER_FINDPEAKS } from '../../../../modules/homer/findpeaks/main.nf' + +workflow test_homer_findpeaks { + input = [[id:'test'], + [file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test2_bed'], checkIfExists: true)]] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + HOMER_MAKETAGDIRECTORY (input, fasta) + HOMER_FINDPEAKS ( HOMER_MAKETAGDIRECTORY.out.tagdir ) +} + diff --git a/tests/modules/homer/findpeaks/nextflow.config b/tests/modules/homer/findpeaks/nextflow.config new file mode 100644 index 00000000..9a921a3c --- /dev/null +++ b/tests/modules/homer/findpeaks/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: HOMER_MAKETAGDIRECTORY { + ext.args = '-format bed' + } + + withName: HOMER_FINDPEAKS { + ext.args = '-style factor' + } + +} diff --git a/tests/modules/homer/findpeaks/test.yml b/tests/modules/homer/findpeaks/test.yml new file mode 100644 index 00000000..75e94529 --- /dev/null +++ b/tests/modules/homer/findpeaks/test.yml @@ -0,0 +1,8 @@ +- name: homer findpeaks + command: nextflow run ./tests/modules/homer/findpeaks -entry test_homer_findpeaks -c ./tests/config/nextflow.config -c ./tests/modules/homer/findpeaks/nextflow.config + tags: + - homer + - homer/findpeaks + files: + - path: output/homer/test.peaks.txt + md5sum: f75ac1fea67f1e307a1ad4d059a9b6cc diff --git a/tests/modules/homer/maketagdirectory/main.nf b/tests/modules/homer/maketagdirectory/main.nf new file mode 100644 index 00000000..766aff0d --- /dev/null +++ b/tests/modules/homer/maketagdirectory/main.nf @@ -0,0 +1,32 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HOMER_MAKETAGDIRECTORY } from '../../../../modules/homer/maketagdirectory/main.nf' + +workflow test_homer_maketagdirectory { + input = [[id:'test'], + [file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test2_bed'], checkIfExists: true)]] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + HOMER_MAKETAGDIRECTORY (input, fasta) +} + + +workflow test_homer_meta_maketagdirectory { + input = + [[[ id:'test1'], + [file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true)]], + [[ id:'test2'], + [file(params.test_data['sarscov2']['genome']['test2_bed'], checkIfExists: true)]]] + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + meta_input = [[id: 'meta_test']] + [ input.collect{it[1]}.flatten() ] + + HOMER_MAKETAGDIRECTORY (meta_input, fasta) +} + +// TODO Make a failing bam test +// TODO Make a pass bam test that feeds the bam through samtools first diff --git a/tests/modules/homer/maketagdirectory/nextflow.config b/tests/modules/homer/maketagdirectory/nextflow.config new file mode 100644 index 00000000..81587d69 --- /dev/null +++ b/tests/modules/homer/maketagdirectory/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: HOMER_MAKETAGDIRECTORY { + ext.args = '-format bed' + } + +} diff --git a/tests/modules/homer/maketagdirectory/test.yml b/tests/modules/homer/maketagdirectory/test.yml new file mode 100644 index 00000000..746c6ef6 --- /dev/null +++ b/tests/modules/homer/maketagdirectory/test.yml @@ -0,0 +1,33 @@ +- name: homer maketagdirectory + command: nextflow run ./tests/modules/homer/maketagdirectory -entry test_homer_maketagdirectory -c ./tests/config/nextflow.config -c ./tests/modules/homer/maketagdirectory/nextflow.config + tags: + - homer + - homer/maketagdirectory + files: + - path: output/homer/tag_dir/MT192765.1.tags.tsv + md5sum: e29522171ca2169b57396495f8b97485 + - path: output/homer/tag_dir/tagAutocorrelation.txt + md5sum: 62b107c4971b94126fb89a0bc2800455 + - path: output/homer/tag_dir/tagCountDistribution.txt + md5sum: fd4ee7ce7c5dfd7c9d739534b8180578 + - path: output/homer/tag_dir/tagInfo.txt + md5sum: 816baa642c946f8284eaa465638e9abb + - path: output/homer/tag_dir/tagLengthDistribution.txt + md5sum: e5aa2b9843ca9c04ace297280aed6af4 + +- name: homer meta maketagdirectory + command: nextflow run ./tests/modules/homer/maketagdirectory -entry test_homer_meta_maketagdirectory -c ./tests/config/nextflow.config -c ./tests/modules/homer/maketagdirectory/nextflow.config + tags: + - homer + - homer/maketagdirectory + files: + - path: output/homer/tag_dir/MT192765.1.tags.tsv + md5sum: e29522171ca2169b57396495f8b97485 + - path: output/homer/tag_dir/tagAutocorrelation.txt + md5sum: 62b107c4971b94126fb89a0bc2800455 + - path: output/homer/tag_dir/tagCountDistribution.txt + md5sum: fd4ee7ce7c5dfd7c9d739534b8180578 + - path: output/homer/tag_dir/tagInfo.txt + md5sum: 816baa642c946f8284eaa465638e9abb + - path: output/homer/tag_dir/tagLengthDistribution.txt + md5sum: e5aa2b9843ca9c04ace297280aed6af4 diff --git a/tests/modules/homer/makeucscfile/main.nf b/tests/modules/homer/makeucscfile/main.nf new file mode 100644 index 00000000..986c9c14 --- /dev/null +++ b/tests/modules/homer/makeucscfile/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HOMER_MAKETAGDIRECTORY } from '../../../../modules/homer/maketagdirectory/main.nf' +include { HOMER_MAKEUCSCFILE } from '../../../../modules/homer/makeucscfile/main.nf' + +workflow test_homer_makeucscfile { + input = [[id:'test'], + [file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test2_bed'], checkIfExists: true)]] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + HOMER_MAKETAGDIRECTORY (input, fasta) + HOMER_MAKEUCSCFILE ( HOMER_MAKETAGDIRECTORY.out.tagdir ) +} + diff --git a/tests/modules/homer/makeucscfile/nextflow.config b/tests/modules/homer/makeucscfile/nextflow.config new file mode 100644 index 00000000..81587d69 --- /dev/null +++ b/tests/modules/homer/makeucscfile/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: HOMER_MAKETAGDIRECTORY { + ext.args = '-format bed' + } + +} diff --git a/tests/modules/homer/makeucscfile/test.yml b/tests/modules/homer/makeucscfile/test.yml new file mode 100644 index 00000000..cf3d1b4d --- /dev/null +++ b/tests/modules/homer/makeucscfile/test.yml @@ -0,0 +1,7 @@ +- name: homer makeucscfile + command: nextflow run ./tests/modules/homer/makeucscfile -entry test_homer_makeucscfile -c ./tests/config/nextflow.config -c ./tests/modules/homer/makeucscfile/nextflow.config + tags: + - homer + - homer/makeucscfile + files: + - path: output/homer/tag_dir/tag_dir.ucsc.bedGraph.gz diff --git a/tests/modules/idr/main.nf b/tests/modules/idr/main.nf new file mode 100644 index 00000000..ed3bf289 --- /dev/null +++ b/tests/modules/idr/main.nf @@ -0,0 +1,35 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { IDR } from '../../../modules/idr/main.nf' + +workflow test_idr_narrowpeak { + + input = [ + file(params.test_data['homo_sapiens']['illumina']['test_narrowpeak'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_narrowpeak'], checkIfExists: true) + ] + + IDR ( input, 'narrowPeak', 'test' ) +} + +workflow test_idr_broadpeak { + + input = [ + file(params.test_data['homo_sapiens']['illumina']['test_broadpeak'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_broadpeak'], checkIfExists: true) + ] + + IDR ( input, 'broadPeak', 'test' ) +} + +workflow test_idr_noprefix { + + input = [ + file(params.test_data['homo_sapiens']['illumina']['test_narrowpeak'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_narrowpeak'], checkIfExists: true) + ] + + IDR ( input, 'narrowPeak', '' ) +} diff --git a/tests/modules/idr/nextflow.config b/tests/modules/idr/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/idr/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/idr/test.yml b/tests/modules/idr/test.yml new file mode 100644 index 00000000..9d5ef2a7 --- /dev/null +++ b/tests/modules/idr/test.yml @@ -0,0 +1,35 @@ +- name: idr test_idr_narrowpeak + command: nextflow run ./tests/modules/idr -entry test_idr_narrowpeak -c ./tests/config/nextflow.config -c ./tests/modules/idr/nextflow.config + tags: + - idr + files: + - path: output/idr/test.idrValues.txt + md5sum: 09be837cc6abbc3eb5958b74802eea55 + - path: output/idr/test.idrValues.txt.png + md5sum: 4a7143ccc0ccadb37c2317bf626e6d96 + - path: output/idr/test.log.txt + md5sum: 6443507ac66b9d3b64bc56b78328083e + +- name: idr test_idr_broadpeak + command: nextflow run ./tests/modules/idr -entry test_idr_broadpeak -c ./tests/config/nextflow.config -c ./tests/modules/idr/nextflow.config + tags: + - idr + files: + - path: output/idr/test.idrValues.txt + md5sum: 387441c716815e4caec3e70a2cc11a4a + - path: output/idr/test.idrValues.txt.png + md5sum: 7204083ca5b920b4215a5991c12cb4e7 + - path: output/idr/test.log.txt + md5sum: e6917133112b5cec135c182ffac19237 + +- name: idr test_idr_noprefix + command: nextflow run ./tests/modules/idr -entry test_idr_noprefix -c ./tests/config/nextflow.config -c ./tests/modules/idr/nextflow.config + tags: + - idr + files: + - path: output/idr/idrValues.txt + md5sum: 09be837cc6abbc3eb5958b74802eea55 + - path: output/idr/idrValues.txt.png + md5sum: 4a7143ccc0ccadb37c2317bf626e6d96 + - path: output/idr/log.txt + md5sum: 6443507ac66b9d3b64bc56b78328083e diff --git a/tests/modules/imputeme/vcftoprs/main.nf b/tests/modules/imputeme/vcftoprs/main.nf new file mode 100644 index 00000000..dccc06e0 --- /dev/null +++ b/tests/modules/imputeme/vcftoprs/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { IMPUTEME_VCFTOPRS } from '../../../../modules/imputeme/vcftoprs/main.nf' + +workflow test_imputeme_vcftoprs { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['genome']['syntheticvcf_short_vcf_gz'], checkIfExists: true) + ] + + IMPUTEME_VCFTOPRS ( input ) +} diff --git a/tests/modules/imputeme/vcftoprs/nextflow.config b/tests/modules/imputeme/vcftoprs/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/imputeme/vcftoprs/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/imputeme/vcftoprs/test.yml b/tests/modules/imputeme/vcftoprs/test.yml new file mode 100644 index 00000000..e5152a03 --- /dev/null +++ b/tests/modules/imputeme/vcftoprs/test.yml @@ -0,0 +1,8 @@ +- name: imputeme vcftoprs test_imputeme_vcftoprs + command: nextflow run ./tests/modules/imputeme/vcftoprs -entry test_imputeme_vcftoprs -c ./tests/config/nextflow.config -c ./tests/modules/imputeme/vcftoprs/nextflow.config + tags: + - imputeme + - imputeme/vcftoprs + files: + - path: output/imputeme/output.json + contains: [ 'type_2_diabetes_32541925":{"GRS":[24.01]' ] diff --git a/tests/modules/iqtree/main.nf b/tests/modules/iqtree/main.nf index 977d7c0a..2d73bd52 100644 --- a/tests/modules/iqtree/main.nf +++ b/tests/modules/iqtree/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { IQTREE } from '../../../modules/iqtree/main.nf' addParams( options: [:] ) +include { IQTREE } from '../../../modules/iqtree/main.nf' workflow test_iqtree { diff --git a/tests/modules/iqtree/nextflow.config b/tests/modules/iqtree/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/iqtree/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/iqtree/test.yml b/tests/modules/iqtree/test.yml index 7bacd0e6..06de90d9 100644 --- a/tests/modules/iqtree/test.yml +++ b/tests/modules/iqtree/test.yml @@ -1,5 +1,5 @@ -- name: iqtree - command: nextflow run ./tests/modules/iqtree -entry test_iqtree -c tests/config/nextflow.config +- name: iqtree test workflow + command: nextflow run ./tests/modules/iqtree -entry test_iqtree -c ./tests/config/nextflow.config -c ./tests/modules/iqtree/nextflow.config tags: - iqtree files: diff --git a/tests/modules/ismapper/main.nf b/tests/modules/ismapper/main.nf new file mode 100644 index 00000000..abb180f7 --- /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' + +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/nextflow.config b/tests/modules/ismapper/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/ismapper/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/ismapper/test.yml b/tests/modules/ismapper/test.yml new file mode 100644 index 00000000..b4f64448 --- /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 -c ./tests/modules/ismapper/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 diff --git a/tests/modules/isoseq3/cluster/main.nf b/tests/modules/isoseq3/cluster/main.nf new file mode 100644 index 00000000..958b03a6 --- /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' + +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/nextflow.config b/tests/modules/isoseq3/cluster/nextflow.config new file mode 100644 index 00000000..8bfeaebd --- /dev/null +++ b/tests/modules/isoseq3/cluster/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: ISOSEQ3_CLUSTER { + ext.args = '--singletons --use-qvs --verbose' + } + +} diff --git a/tests/modules/isoseq3/cluster/test.yml b/tests/modules/isoseq3/cluster/test.yml new file mode 100644 index 00000000..b1f12df7 --- /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 -c ./tests/modules/isoseq3/cluster/nextflow.config + tags: + - isoseq3 + - isoseq3/cluster + files: + - 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.transcripts.cluster_report.csv + md5sum: 342d97dc10aedf80a45977edcb491c62 + - 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' ] diff --git a/tests/modules/isoseq3/refine/main.nf b/tests/modules/isoseq3/refine/main.nf new file mode 100644 index 00000000..45dd1560 --- /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' + +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/nextflow.config b/tests/modules/isoseq3/refine/nextflow.config new file mode 100644 index 00000000..6a4dea9f --- /dev/null +++ b/tests/modules/isoseq3/refine/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: ISOSEQ3_REFINE { + ext.prefix = { "${meta.id}.refine" } + } + +} diff --git a/tests/modules/isoseq3/refine/test.yml b/tests/modules/isoseq3/refine/test.yml new file mode 100644 index 00000000..f2c63fda --- /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 -c ./tests/modules/isoseq3/refine/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 diff --git a/tests/modules/ivar/consensus/main.nf b/tests/modules/ivar/consensus/main.nf index 5e0457b5..d0807984 100644 --- a/tests/modules/ivar/consensus/main.nf +++ b/tests/modules/ivar/consensus/main.nf @@ -3,7 +3,7 @@ nextflow.enable.dsl = 2 params.save_mpileup = true -include { IVAR_CONSENSUS } from '../../../../modules/ivar/consensus/main.nf' addParams( [ options: [args2: '-aa -A -d 0 -Q 0'] ] ) +include { IVAR_CONSENSUS } from '../../../../modules/ivar/consensus/main.nf' workflow test_ivar_consensus { input = [ [ id:'test'], diff --git a/tests/modules/ivar/consensus/nextflow.config b/tests/modules/ivar/consensus/nextflow.config new file mode 100644 index 00000000..7407619a --- /dev/null +++ b/tests/modules/ivar/consensus/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: IVAR_CONSENSUS { + ext.args2 = '-aa -A -d 0 -Q 0' + } + +} diff --git a/tests/modules/ivar/consensus/test.yml b/tests/modules/ivar/consensus/test.yml index 071fdc98..caaa640f 100644 --- a/tests/modules/ivar/consensus/test.yml +++ b/tests/modules/ivar/consensus/test.yml @@ -1,5 +1,5 @@ - name: ivar consensus - command: nextflow run ./tests/modules/ivar/consensus -entry test_ivar_consensus -c tests/config/nextflow.config + command: nextflow run ./tests/modules/ivar/consensus -entry test_ivar_consensus -c ./tests/config/nextflow.config -c ./tests/modules/ivar/consensus/nextflow.config tags: - ivar - ivar/consensus diff --git a/tests/modules/ivar/trim/main.nf b/tests/modules/ivar/trim/main.nf index 05b390b0..15d0e739 100644 --- a/tests/modules/ivar/trim/main.nf +++ b/tests/modules/ivar/trim/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { IVAR_TRIM } from '../../../../modules/ivar/trim/main.nf' addParams([:]) +include { IVAR_TRIM } from '../../../../modules/ivar/trim/main.nf' workflow test_ivar_trim { input = [ [ id:'test'], diff --git a/tests/modules/ivar/trim/nextflow.config b/tests/modules/ivar/trim/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/ivar/trim/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/ivar/trim/test.yml b/tests/modules/ivar/trim/test.yml index 013c6365..0be18ba8 100644 --- a/tests/modules/ivar/trim/test.yml +++ b/tests/modules/ivar/trim/test.yml @@ -1,8 +1,8 @@ - name: ivar trim - command: nextflow run ./tests/modules/ivar/trim -entry test_ivar_trim -c tests/config/nextflow.config + command: nextflow run ./tests/modules/ivar/trim -entry test_ivar_trim -c ./tests/config/nextflow.config -c ./tests/modules/ivar/trim/nextflow.config tags: - ivar - ivar/trim files: - path: output/ivar/test.bam - md5sum: 8705d032b28a1c3dbfe78fa762a2132f + md5sum: 12cff17d43b1efdba8120a6bff5311e3 diff --git a/tests/modules/ivar/variants/main.nf b/tests/modules/ivar/variants/main.nf index 5358e785..f603b5e5 100644 --- a/tests/modules/ivar/variants/main.nf +++ b/tests/modules/ivar/variants/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { IVAR_VARIANTS } from '../../../../modules/ivar/variants/main.nf' addParams([:]) +include { IVAR_VARIANTS } from '../../../../modules/ivar/variants/main.nf' workflow test_ivar_variants_no_gff_no_mpileup { params.gff = false diff --git a/tests/modules/ivar/variants/nextflow.config b/tests/modules/ivar/variants/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/ivar/variants/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/ivar/variants/test.yml b/tests/modules/ivar/variants/test.yml index a8be12a8..00e6e2c0 100644 --- a/tests/modules/ivar/variants/test.yml +++ b/tests/modules/ivar/variants/test.yml @@ -1,5 +1,5 @@ - name: ivar variants no gff no mpileup - command: nextflow run ./tests/modules/ivar/variants -entry test_ivar_variants_no_gff_no_mpileup -c tests/config/nextflow.config + command: nextflow run ./tests/modules/ivar/variants -entry test_ivar_variants_no_gff_no_mpileup -c ./tests/config/nextflow.config -c ./tests/modules/ivar/variants/nextflow.config tags: - ivar - ivar/variants @@ -8,7 +8,7 @@ md5sum: 728f1430f2402861396d9953465ac706 - name: ivar variants no gff with mpileup - command: nextflow run ./tests/modules/ivar/variants -entry test_ivar_variants_no_gff_with_mpileup -c tests/config/nextflow.config --save_mpileup + command: nextflow run ./tests/modules/ivar/variants -entry test_ivar_variants_no_gff_with_mpileup -c ./tests/config/nextflow.config --save_mpileup -c ./tests/modules/ivar/variants/nextflow.config tags: - ivar - ivar/variants @@ -19,7 +19,7 @@ md5sum: 56c4cd5a4ecb7d6364878818f46ae256 - name: ivar variants with gff with mpileup - command: nextflow run ./tests/modules/ivar/variants -entry test_ivar_variants_with_gff_with_mpileup -c tests/config/nextflow.config --gff tests/data/gff/sarscov2/MN908947.3.gff3 --save_mpileup + command: nextflow run ./tests/modules/ivar/variants -entry test_ivar_variants_with_gff_with_mpileup -c ./tests/config/nextflow.config --gff tests/data/gff/sarscov2/MN908947.3.gff3 --save_mpileup -c ./tests/modules/ivar/variants/nextflow.config tags: - ivar - ivar/variants diff --git a/tests/modules/jupyternotebook/main.nf b/tests/modules/jupyternotebook/main.nf new file mode 100644 index 00000000..1db9d812 --- /dev/null +++ b/tests/modules/jupyternotebook/main.nf @@ -0,0 +1,43 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { JUPYTERNOTEBOOK } from '../../../modules/jupyternotebook/main.nf' +include { JUPYTERNOTEBOOK as JUPYTERNOTEBOOK_PARAMETRIZE } from '../../../modules/jupyternotebook/main.nf' +include { JUPYTERNOTEBOOK as JUPYTERNOTEBOOK_PARAMETRIZE_IPYNB } from '../../../modules/jupyternotebook/main.nf' + +workflow test_jupyternotebook { + + input = [ [ id:'test_jupyter' ], // meta map + file(params.test_data['generic']['notebooks']['ipython_md'], checkIfExists: true) ] + + JUPYTERNOTEBOOK ( input, [:], []) + +} + +workflow test_jupyternotebook_parametrize { + + input = [ [ id:'test_jupyter' ], // meta map + file(params.test_data['generic']['notebooks']['ipython_md'], checkIfExists: true) ] + + JUPYTERNOTEBOOK_PARAMETRIZE( + input, + [input_filename: "hello.txt", n_iter: 12], + file(params.test_data['generic']['txt']['hello'], checkIfExists: true) + ) + +} + +workflow test_jupyternotebook_parametrize_ipynb { + + input = [ [ id:'test_jupyter' ], // meta map + file(params.test_data['generic']['notebooks']['ipython_ipynb'], checkIfExists: true) ] + + JUPYTERNOTEBOOK_PARAMETRIZE_IPYNB( + input, + [input_filename: "hello.txt", n_iter: 12], + file(params.test_data['generic']['txt']['hello'], checkIfExists: true) + ) + +} + diff --git a/tests/modules/jupyternotebook/nextflow.config b/tests/modules/jupyternotebook/nextflow.config new file mode 100644 index 00000000..6066b2b8 --- /dev/null +++ b/tests/modules/jupyternotebook/nextflow.config @@ -0,0 +1,19 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: JUPYTERNOTEBOOK { + ext = ['parametrize': false] + } + + // this should be the default options, but need to work around + // https://github.com/nextflow-io/nextflow/issues/2422 + withName: JUPYTERNOTEBOOK_PARAMETRIZE { + ext = ['parametrize': true] + } + + withName: JUPYTERNOTEBOOK_PARAMETRIZE_IPYNB { + ext = ['parametrize': true] + } + +} diff --git a/tests/modules/jupyternotebook/test.yml b/tests/modules/jupyternotebook/test.yml new file mode 100644 index 00000000..31fdfdbb --- /dev/null +++ b/tests/modules/jupyternotebook/test.yml @@ -0,0 +1,30 @@ +- name: jupyternotebook test_jupyternotebook + command: nextflow run ./tests/modules/jupyternotebook -entry test_jupyternotebook -c ./tests/config/nextflow.config -c ./tests/modules/jupyternotebook/nextflow.config + tags: + - jupyternotebook + files: + - path: output/jupyternotebook/test_jupyter.html + contains: + - "n_iter = 10" + +- name: jupyternotebook test_jupyternotebook_parametrize + command: nextflow run ./tests/modules/jupyternotebook -entry test_jupyternotebook_parametrize -c ./tests/config/nextflow.config -c ./tests/modules/jupyternotebook/nextflow.config + tags: + - jupyternotebook + files: + - path: output/jupyternotebook/artifacts/artifact.txt + md5sum: 8ddd8be4b179a529afa5f2ffae4b9858 + - path: output/jupyternotebook/test_jupyter.html + contains: + - "n_iter = 12" + +- name: jupyternotebook test_jupyternotebook_parametrize_ipynb + command: nextflow run ./tests/modules/jupyternotebook -entry test_jupyternotebook_parametrize_ipynb -c ./tests/config/nextflow.config -c ./tests/modules/jupyternotebook/nextflow.config + tags: + - jupyternotebook + files: + - path: output/jupyternotebook/artifacts/artifact.txt + md5sum: 8ddd8be4b179a529afa5f2ffae4b9858 + - path: output/jupyternotebook/test_jupyter.html + contains: + - "n_iter = 12" diff --git a/tests/modules/kallisto/index/main.nf b/tests/modules/kallisto/index/main.nf index bab78f51..8ecd6d52 100644 --- a/tests/modules/kallisto/index/main.nf +++ b/tests/modules/kallisto/index/main.nf @@ -2,12 +2,12 @@ nextflow.enable.dsl = 2 -include { KALLISTO_INDEX } from '../../../../modules/kallisto/index/main.nf' addParams( options: [:] ) +include { KALLISTO_INDEX } from '../../../../modules/kallisto/index/main.nf' 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/kallisto/index/nextflow.config b/tests/modules/kallisto/index/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/kallisto/index/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/kallisto/index/test.yml b/tests/modules/kallisto/index/test.yml index b9dd23ad..90a06325 100644 --- a/tests/modules/kallisto/index/test.yml +++ b/tests/modules/kallisto/index/test.yml @@ -1,5 +1,5 @@ - name: kallisto index test_kallisto_index - command: nextflow run tests/modules/kallisto/index -entry test_kallisto_index -c tests/config/nextflow.config + command: nextflow run ./tests/modules/kallisto/index -entry test_kallisto_index -c ./tests/config/nextflow.config -c ./tests/modules/kallisto/index/nextflow.config tags: - kallisto - kallisto/index diff --git a/tests/modules/kallistobustools/count/main.nf b/tests/modules/kallistobustools/count/main.nf index 051195af..6e6be03d 100644 --- a/tests/modules/kallistobustools/count/main.nf +++ b/tests/modules/kallistobustools/count/main.nf @@ -2,23 +2,23 @@ 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' workflow test_kallistobustools_count { - - input = [ [id:'test_standard'], // meta map - [file("https://github.com/nf-core/test-datasets/blob/modules/data/genomics/homo_sapiens/illumina/10xgenomics/test_1.fastq.gz?raw=true", checkIfExists: true), - file("https://github.com/nf-core/test-datasets/blob/modules/data/genomics/homo_sapiens/illumina/10xgenomics/test_2.fastq.gz?raw=true", checkIfExists: true)] - ] - - index = file("https://github.com/FloWuenne/test-datasets/blob/scrnaseq/reference/kallistobustools/kb_ref.idx?raw=true", checkIfExists: true) - t2g = file("https://raw.githubusercontent.com/FloWuenne/test-datasets/scrnaseq/reference/kallistobustools/t2g.txt", checkIfExists: true) - t1c = file('t1c_dummy') - t2c = file('t2c_dummy') - use_t1c = false - use_t2c = false - workflow = "standard" - technology = "10XV3" - KALLISTOBUSTOOLS_COUNT (input,index,t2g,t1c,t2c,use_t1c,use_t2c,workflow,technology) + input = [ + [id:'test'], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_10x_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_10x_2_fastq_gz'], checkIfExists: true) + ] + ] + + index = file("https://github.com/FloWuenne/test-datasets/blob/scrnaseq/reference/kallistobustools/kb_ref.idx?raw=true", checkIfExists: true) + t2g = file("https://raw.githubusercontent.com/FloWuenne/test-datasets/scrnaseq/reference/kallistobustools/t2g.txt", checkIfExists: true) + t1c = [] + t2c = [] + workflow = "standard" + technology = "10XV3" + + KALLISTOBUSTOOLS_COUNT ( input, index, t2g, t1c, t2c, workflow, technology ) } diff --git a/tests/modules/kallistobustools/count/nextflow.config b/tests/modules/kallistobustools/count/nextflow.config new file mode 100644 index 00000000..eb4e20bd --- /dev/null +++ b/tests/modules/kallistobustools/count/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: KALLISTOBUSTOOLS_COUNT { + ext.args = '--cellranger -m 1' + } + +} diff --git a/tests/modules/kallistobustools/count/test.yml b/tests/modules/kallistobustools/count/test.yml index 8ff9a66f..664e9fa6 100644 --- a/tests/modules/kallistobustools/count/test.yml +++ b/tests/modules/kallistobustools/count/test.yml @@ -1,36 +1,36 @@ - name: kallistobustools count test_kallistobustools_count - command: nextflow run tests/modules/kallistobustools/count -entry test_kallistobustools_count -c tests/config/nextflow.config + command: nextflow run ./tests/modules/kallistobustools/count -entry test_kallistobustools_count -c ./tests/config/nextflow.config -c ./tests/modules/kallistobustools/count/nextflow.config tags: - kallistobustools/count - kallistobustools files: - - path: output/kallistobustools/test_standard_kallistobustools_count/10xv3_whitelist.txt + - path: output/kallistobustools/test.count/10x_version3_whitelist.txt md5sum: 3d36d0a4021fd292b265e2b5e72aaaf3 - - path: output/kallistobustools/test_standard_kallistobustools_count/counts_unfiltered/cellranger/barcodes.tsv + - path: output/kallistobustools/test.count/counts_unfiltered/cellranger/barcodes.tsv md5sum: 8f734732c46f52c4d1c025bfe4134bd2 - - path: output/kallistobustools/test_standard_kallistobustools_count/counts_unfiltered/cellranger/genes.tsv + - path: output/kallistobustools/test.count/counts_unfiltered/cellranger/genes.tsv md5sum: fbebf995a3de568db8ac028cd0c5d993 - - path: output/kallistobustools/test_standard_kallistobustools_count/counts_unfiltered/cellranger/matrix.mtx + - path: output/kallistobustools/test.count/counts_unfiltered/cellranger/matrix.mtx md5sum: 4847bae27c41961496d504bcfe9890ba - - path: output/kallistobustools/test_standard_kallistobustools_count/counts_unfiltered/cells_x_genes.barcodes.txt + - path: output/kallistobustools/test.count/counts_unfiltered/cells_x_genes.barcodes.txt md5sum: cafdf96423987e3d9e807cdc16139541 - - path: output/kallistobustools/test_standard_kallistobustools_count/counts_unfiltered/cells_x_genes.genes.txt + - path: output/kallistobustools/test.count/counts_unfiltered/cells_x_genes.genes.txt md5sum: 52d0627aaf0418bebe3ef75ad77da53f - - path: output/kallistobustools/test_standard_kallistobustools_count/counts_unfiltered/cells_x_genes.mtx + - path: output/kallistobustools/test.count/counts_unfiltered/cells_x_genes.mtx md5sum: d05e1582385ba5f215fa73c470343c06 - - path: output/kallistobustools/test_standard_kallistobustools_count/inspect.json + - path: output/kallistobustools/test.count/inspect.json md5sum: d3d23063f3fc07f7fbd24748aa4271a9 - - path: output/kallistobustools/test_standard_kallistobustools_count/kb_info.json - contains: - - 'kallisto' - - path: output/kallistobustools/test_standard_kallistobustools_count/matrix.ec + - path: output/kallistobustools/test.count/kb_info.json + contains: + - "kallisto" + - path: output/kallistobustools/test.count/matrix.ec md5sum: cd8340e3fb78d74ad85fabdbe0a778f0 - - path: output/kallistobustools/test_standard_kallistobustools_count/output.bus + - path: output/kallistobustools/test.count/output.bus md5sum: f4702922bd0c142e34b3680c2251426a - - path: output/kallistobustools/test_standard_kallistobustools_count/output.unfiltered.bus + - path: output/kallistobustools/test.count/output.unfiltered.bus md5sum: e38f99748e598e33fe035b89e7c89fb5 - - path: output/kallistobustools/test_standard_kallistobustools_count/run_info.json - contains: - - 'n_targets' - - path: output/kallistobustools/test_standard_kallistobustools_count/transcripts.txt + - path: output/kallistobustools/test.count/run_info.json + contains: + - "n_targets" + - path: output/kallistobustools/test.count/transcripts.txt md5sum: 6d583083eaf6ca81e409332a40d2e74c diff --git a/tests/modules/kallistobustools/ref/main.nf b/tests/modules/kallistobustools/ref/main.nf index 1ecfa339..09ea68ea 100644 --- a/tests/modules/kallistobustools/ref/main.nf +++ b/tests/modules/kallistobustools/ref/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { KALLISTOBUSTOOLS_REF } from '../../../../modules/kallistobustools/ref/main.nf' addParams( options: [:] ) +include { KALLISTOBUSTOOLS_REF } from '../../../../modules/kallistobustools/ref/main.nf' workflow test_kallistobustools_ref_standard { @@ -30,3 +30,4 @@ workflow test_kallistobustools_ref_nucleus { KALLISTOBUSTOOLS_REF( fasta, gtf, workflow) } + diff --git a/tests/modules/kallistobustools/ref/nextflow.config b/tests/modules/kallistobustools/ref/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/kallistobustools/ref/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/kallistobustools/ref/test.yml b/tests/modules/kallistobustools/ref/test.yml index 1821533a..1e8fd6c4 100644 --- a/tests/modules/kallistobustools/ref/test.yml +++ b/tests/modules/kallistobustools/ref/test.yml @@ -1,50 +1,35 @@ - name: kallistobustools ref test_kallistobustools_ref_standard - command: nextflow run tests/modules/kallistobustools/ref -entry test_kallistobustools_ref_standard -c tests/config/nextflow.config + command: nextflow run ./tests/modules/kallistobustools/ref -entry test_kallistobustools_ref_standard -c ./tests/config/nextflow.config -c ./tests/modules/kallistobustools/ref/nextflow.config tags: - kallistobustools/ref - kallistobustools files: - path: output/kallistobustools/cdna.fa - md5sum: 0de7fdac9e7418576987ed93640927c7 - path: output/kallistobustools/kb_ref_out.idx - md5sum: 7d5cd0731e7c467e5521d761f7d79895 - path: output/kallistobustools/t2g.txt - md5sum: d5bcfd61ff078aa92e576abf8cc4fc08 - name: kallistobustools ref test_kallistobustools_ref_lamanno - command: nextflow run tests/modules/kallistobustools/ref -entry test_kallistobustools_ref_lamanno -c tests/config/nextflow.config + command: nextflow run ./tests/modules/kallistobustools/ref -entry test_kallistobustools_ref_lamanno -c ./tests/config/nextflow.config -c ./tests/modules/kallistobustools/ref/nextflow.config tags: - kallistobustools/ref - kallistobustools files: - path: output/kallistobustools/cdna.fa - md5sum: 0de7fdac9e7418576987ed93640927c7 - path: output/kallistobustools/cdna_t2c.txt - md5sum: 6d583083eaf6ca81e409332a40d2e74c - path: output/kallistobustools/intron.fa - md5sum: ca5ca147afa0a25f6a730edfb39a6098 - path: output/kallistobustools/intron_t2c.txt - md5sum: 728480007abfdbdb248f7ba9de6026ef - path: output/kallistobustools/kb_ref_out.idx - md5sum: 48ca8323aadd30b1762d4e8f5a7d7aee - path: output/kallistobustools/t2g.txt - md5sum: 7cae93dfb9a26f70adf4a57fe2a83027 - name: kallistobustools ref test_kallistobustools_ref_nucleus - command: nextflow run tests/modules/kallistobustools/ref -entry test_kallistobustools_ref_nucleus -c tests/config/nextflow.config + command: nextflow run ./tests/modules/kallistobustools/ref -entry test_kallistobustools_ref_nucleus -c ./tests/config/nextflow.config -c ./tests/modules/kallistobustools/ref/nextflow.config tags: - kallistobustools/ref - kallistobustools files: - path: output/kallistobustools/cdna.fa - md5sum: 0de7fdac9e7418576987ed93640927c7 - path: output/kallistobustools/cdna_t2c.txt - md5sum: 6d583083eaf6ca81e409332a40d2e74c - path: output/kallistobustools/intron.fa - md5sum: ca5ca147afa0a25f6a730edfb39a6098 - path: output/kallistobustools/intron_t2c.txt - md5sum: 728480007abfdbdb248f7ba9de6026ef - path: output/kallistobustools/kb_ref_out.idx - md5sum: 48ca8323aadd30b1762d4e8f5a7d7aee - path: output/kallistobustools/t2g.txt - md5sum: 7cae93dfb9a26f70adf4a57fe2a83027 diff --git a/tests/modules/khmer/normalizebymedian/main.nf b/tests/modules/khmer/normalizebymedian/main.nf new file mode 100644 index 00000000..c439c40f --- /dev/null +++ b/tests/modules/khmer/normalizebymedian/main.nf @@ -0,0 +1,85 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SEQTK_MERGEPE } from '../../../../modules/seqtk/mergepe/main.nf' +include { KHMER_NORMALIZEBYMEDIAN } from '../../../../modules/khmer/normalizebymedian/main.nf' +include { KHMER_NORMALIZEBYMEDIAN as KHMER_NORMALIZEBYMEDIAN_ARGS } from '../../../../modules/khmer/normalizebymedian/main.nf' + +workflow test_khmer_normalizebymedian_only_pe { + + pe_reads = [ + [ id:'khmer_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) + ] + ] + + SEQTK_MERGEPE(pe_reads) + + KHMER_NORMALIZEBYMEDIAN ( SEQTK_MERGEPE.out.reads.collect { it[1] }, [], 'only_pe' ) +} + +workflow test_khmer_normalizebymedian_only_se { + + se_reads = [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + ] + + KHMER_NORMALIZEBYMEDIAN ( [], se_reads, 'only_se' ) +} + +workflow test_khmer_normalizebymedian_mixed { + + pe_reads = [ + [ id:'khmer_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) + ] + ] + se_reads = file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + + SEQTK_MERGEPE(pe_reads) + + KHMER_NORMALIZEBYMEDIAN ( SEQTK_MERGEPE.out.reads.map { it[1] }, se_reads, 'mixed' ) +} + +workflow test_khmer_normalizebymedian_multiple_pe { + + pe_reads = [ + [ id:'khmer_test0', 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) + ], + [ id:'khmer_test1', 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) + ] + ] + se_reads = file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + + SEQTK_MERGEPE(pe_reads) + + KHMER_NORMALIZEBYMEDIAN ( SEQTK_MERGEPE.out.reads.collect { it[1] }, se_reads, 'multiple_pe' ) +} + +workflow test_khmer_normalizebymedian_args { + + pe_reads = [ + [ id:'khmer_test0', 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) + ] + ] + se_reads = file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + + SEQTK_MERGEPE(pe_reads) + + KHMER_NORMALIZEBYMEDIAN_ARGS ( SEQTK_MERGEPE.out.reads.collect { it[1] }, se_reads, 'args' ) +} diff --git a/tests/modules/khmer/normalizebymedian/nextflow.config b/tests/modules/khmer/normalizebymedian/nextflow.config new file mode 100644 index 00000000..279a972a --- /dev/null +++ b/tests/modules/khmer/normalizebymedian/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: KHMER_NORMALIZEBYMEDIAN_ARGS { + ext.args = '-C 20 -k 32' + } + +} diff --git a/tests/modules/khmer/normalizebymedian/test.yml b/tests/modules/khmer/normalizebymedian/test.yml new file mode 100644 index 00000000..0e61588f --- /dev/null +++ b/tests/modules/khmer/normalizebymedian/test.yml @@ -0,0 +1,42 @@ +# nf-core modules create-test-yml khmer/normalizebymedian +- name: khmer normalizebymedian only pe reads + command: nextflow run ./tests/modules/khmer/normalizebymedian -entry test_khmer_normalizebymedian_only_pe -c ./tests/config/nextflow.config -c ./tests/modules/khmer/normalizebymedian/nextflow.config + tags: + - khmer + - khmer/normalizebymedian + files: + - path: output/khmer/only_pe.fastq.gz + # md5sum not stable even locally with docker (gzip done by tool) + #md5sum: 75e05f2e80cf4bd0b534d4b73f7c059c + +- name: khmer normalizebymedian only se reads + command: nextflow run ./tests/modules/khmer/normalizebymedian -entry test_khmer_normalizebymedian_only_se -c ./tests/config/nextflow.config -c ./tests/modules/khmer/normalizebymedian/nextflow.config + tags: + - khmer + - khmer/normalizebymedian + files: + - path: output/khmer/only_se.fastq.gz + +- name: khmer normalizebymedian mixed reads + command: nextflow run ./tests/modules/khmer/normalizebymedian -entry test_khmer_normalizebymedian_mixed -c ./tests/config/nextflow.config -c ./tests/modules/khmer/normalizebymedian/nextflow.config + tags: + - khmer + - khmer/normalizebymedian + files: + - path: output/khmer/mixed.fastq.gz + +- name: khmer normalizebymedian multiple pe reads + command: nextflow run ./tests/modules/khmer/normalizebymedian -entry test_khmer_normalizebymedian_multiple_pe -c ./tests/config/nextflow.config -c ./tests/modules/khmer/normalizebymedian/nextflow.config + tags: + - khmer + - khmer/normalizebymedian + files: + - path: output/khmer/multiple_pe.fastq.gz + +- name: khmer normalizebymedian args + command: nextflow run ./tests/modules/khmer/normalizebymedian -entry test_khmer_normalizebymedian_args -c ./tests/config/nextflow.config -c ./tests/modules/khmer/normalizebymedian/nextflow.config + tags: + - khmer + - khmer/normalizebymedian + files: + - path: output/khmer/args.fastq.gz diff --git a/tests/modules/kleborate/main.nf b/tests/modules/kleborate/main.nf new file mode 100644 index 00000000..bce31225 --- /dev/null +++ b/tests/modules/kleborate/main.nf @@ -0,0 +1,18 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { KLEBORATE } from '../../../modules/kleborate/main.nf' + +workflow test_kleborate { + + input = [ + [ id:'test', single_end:false ], // meta map + [ 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) + ] + ] + + KLEBORATE ( input ) +} diff --git a/tests/modules/kleborate/nextflow.config b/tests/modules/kleborate/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/kleborate/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/kleborate/test.yml b/tests/modules/kleborate/test.yml new file mode 100644 index 00000000..c7b25778 --- /dev/null +++ b/tests/modules/kleborate/test.yml @@ -0,0 +1,7 @@ +- name: kleborate + command: nextflow run ./tests/modules/kleborate -entry test_kleborate -c ./tests/config/nextflow.config -c ./tests/modules/kleborate/nextflow.config + tags: + - kleborate + files: + - path: output/kleborate/test.results.txt + md5sum: b7979a71170736098fb8403cd92748f5 diff --git a/tests/modules/kraken2/kraken2/main.nf b/tests/modules/kraken2/kraken2/main.nf index e5638ec5..12399e9e 100644 --- a/tests/modules/kraken2/kraken2/main.nf +++ b/tests/modules/kraken2/kraken2/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { UNTAR } from '../../../../modules/untar/main.nf' addParams( options: [:] ) -include { KRAKEN2_KRAKEN2 } from '../../../../modules/kraken2/kraken2/main.nf' addParams( options: [:] ) +include { UNTAR } from '../../../../modules/untar/main.nf' +include { KRAKEN2_KRAKEN2 } from '../../../../modules/kraken2/kraken2/main.nf' workflow test_kraken2_kraken2_single_end { input = [ [ id:'test', single_end:true ], // meta map diff --git a/tests/modules/kraken2/kraken2/nextflow.config b/tests/modules/kraken2/kraken2/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/kraken2/kraken2/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/kraken2/kraken2/test.yml b/tests/modules/kraken2/kraken2/test.yml index 688fb34c..1ec413bf 100644 --- a/tests/modules/kraken2/kraken2/test.yml +++ b/tests/modules/kraken2/kraken2/test.yml @@ -1,5 +1,5 @@ - name: kraken2 kraken2 single-end - command: nextflow run ./tests/modules/kraken2/kraken2 -entry test_kraken2_kraken2_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/kraken2/kraken2 -entry test_kraken2_kraken2_single_end -c ./tests/config/nextflow.config -c ./tests/modules/kraken2/kraken2/nextflow.config tags: - kraken2 - kraken2/kraken2 @@ -12,7 +12,7 @@ md5sum: 4227755fe40478b8d7dc8634b489761e - name: kraken2 kraken2 paired-end - command: nextflow run ./tests/modules/kraken2/kraken2 -entry test_kraken2_kraken2_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/kraken2/kraken2 -entry test_kraken2_kraken2_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/kraken2/kraken2/nextflow.config tags: - kraken2 - kraken2/kraken2 diff --git a/tests/modules/krona/kronadb/main.nf b/tests/modules/krona/kronadb/main.nf new file mode 100644 index 00000000..ed955854 --- /dev/null +++ b/tests/modules/krona/kronadb/main.nf @@ -0,0 +1,9 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { KRONA_KRONADB } from '../../../../modules/krona/kronadb/main.nf' + +workflow test_krona_kronadb { + KRONA_KRONADB ( ) +} diff --git a/tests/modules/krona/kronadb/nextflow.config b/tests/modules/krona/kronadb/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/krona/kronadb/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/krona/kronadb/test.yml b/tests/modules/krona/kronadb/test.yml new file mode 100644 index 00000000..1d61640f --- /dev/null +++ b/tests/modules/krona/kronadb/test.yml @@ -0,0 +1,7 @@ +- name: krona kronadb test_krona_kronadb + command: nextflow run ./tests/modules/krona/kronadb -entry test_krona_kronadb -c ./tests/config/nextflow.config -c ./tests/modules/krona/kronadb/nextflow.config + tags: + - krona + - krona/kronadb + files: + - path: output/krona/taxonomy/taxonomy.tab diff --git a/tests/modules/krona/ktimporttaxonomy/main.nf b/tests/modules/krona/ktimporttaxonomy/main.nf new file mode 100644 index 00000000..a23e6fcb --- /dev/null +++ b/tests/modules/krona/ktimporttaxonomy/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { KRONA_KTIMPORTTAXONOMY } from '../../../../modules/krona/ktimporttaxonomy/main.nf' + +workflow test_krona_ktimporttaxonomy { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['generic']['txt']['hello'], checkIfExists: true) + ] + taxonomy = file(params.test_data['generic']['txt']['hello'], checkIfExists: true) + + KRONA_KTIMPORTTAXONOMY ( input, taxonomy ) +} diff --git a/tests/modules/krona/ktimporttaxonomy/nextflow.config b/tests/modules/krona/ktimporttaxonomy/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/krona/ktimporttaxonomy/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/krona/ktimporttaxonomy/test.yml b/tests/modules/krona/ktimporttaxonomy/test.yml new file mode 100644 index 00000000..b7748980 --- /dev/null +++ b/tests/modules/krona/ktimporttaxonomy/test.yml @@ -0,0 +1,9 @@ +- name: krona ktimporttaxonomy test_krona_ktimporttaxonomy + command: nextflow run ./tests/modules/krona/ktimporttaxonomy -entry test_krona_ktimporttaxonomy -c ./tests/config/nextflow.config -c ./tests/modules/krona/ktimporttaxonomy/nextflow.config + tags: + - krona/ktimporttaxonomy + - krona + files: + - path: output/krona/taxonomy.krona.html + contains: + - "DOCTYPE html PUBLIC" diff --git a/tests/modules/last/dotplot/main.nf b/tests/modules/last/dotplot/main.nf index b92ed270..3353821d 100644 --- a/tests/modules/last/dotplot/main.nf +++ b/tests/modules/last/dotplot/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { LAST_DOTPLOT } from '../../../../modules/last/dotplot/main.nf' addParams( options: [:] ) +include { LAST_DOTPLOT } from '../../../../modules/last/dotplot/main.nf' workflow test_last_dotplot { diff --git a/tests/modules/last/dotplot/nextflow.config b/tests/modules/last/dotplot/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/last/dotplot/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/last/dotplot/test.yml b/tests/modules/last/dotplot/test.yml index 177e377b..c2a9910f 100644 --- a/tests/modules/last/dotplot/test.yml +++ b/tests/modules/last/dotplot/test.yml @@ -1,5 +1,5 @@ - name: last dotplot test_last_dotplot - command: nextflow run tests/modules/last/dotplot -entry test_last_dotplot -c tests/config/nextflow.config + command: nextflow run ./tests/modules/last/dotplot -entry test_last_dotplot -c ./tests/config/nextflow.config -c ./tests/modules/last/dotplot/nextflow.config tags: - last/dotplot - last diff --git a/tests/modules/last/lastal/main.nf b/tests/modules/last/lastal/main.nf index 262c8f5f..95c2f917 100644 --- a/tests/modules/last/lastal/main.nf +++ b/tests/modules/last/lastal/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { UNTAR } from '../../../../modules/untar/main.nf' addParams( options: [:] ) -include { LAST_LASTAL } from '../../../../modules/last/lastal/main.nf' addParams( options: [:] ) +include { UNTAR } from '../../../../modules/untar/main.nf' +include { LAST_LASTAL } from '../../../../modules/last/lastal/main.nf' workflow test_last_lastal_with_dummy_param_file { diff --git a/tests/modules/last/lastal/nextflow.config b/tests/modules/last/lastal/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/last/lastal/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/last/lastal/test.yml b/tests/modules/last/lastal/test.yml index c6966a5f..f75e4ac5 100644 --- a/tests/modules/last/lastal/test.yml +++ b/tests/modules/last/lastal/test.yml @@ -1,11 +1,11 @@ - name: last lastal test_last_lastal_with_dummy_param_file - command: nextflow run tests/modules/last/lastal -entry test_last_lastal_with_dummy_param_file -c tests/config/nextflow.config + command: nextflow run ./tests/modules/last/lastal -entry test_last_lastal_with_dummy_param_file -c ./tests/config/nextflow.config -c ./tests/modules/last/lastal/nextflow.config tags: - last - last/lastal files: - path: output/last/contigs.genome.maf.gz - md5sum: 2fc56553282d0826310bdef16a55e587 + md5sum: 670f4fa1a94b23690cdb6fc603813c75 - path: output/untar/lastdb/genome.bck md5sum: 5519879b9b6c4d1fc508da7f17f88f2e - path: output/untar/lastdb/genome.des @@ -22,13 +22,13 @@ md5sum: b7c40f06b1309dc6f37849eeb86dfd22 - name: last lastal test_last_lastal_with_real_param_file - command: nextflow run tests/modules/last/lastal -entry test_last_lastal_with_real_param_file -c tests/config/nextflow.config + command: nextflow run ./tests/modules/last/lastal -entry test_last_lastal_with_real_param_file -c ./tests/config/nextflow.config -c ./tests/modules/last/lastal/nextflow.config tags: - last - last/lastal files: - path: output/last/contigs.genome.maf.gz - md5sum: f50557bed5430b42de7b0d5d61075cf0 + md5sum: b0202b013e1caa9163516cd4ff4fbdbc - path: output/untar/lastdb/genome.bck md5sum: 5519879b9b6c4d1fc508da7f17f88f2e - path: output/untar/lastdb/genome.des diff --git a/tests/modules/last/lastdb/main.nf b/tests/modules/last/lastdb/main.nf index 2f11bee4..d1c7b79a 100644 --- a/tests/modules/last/lastdb/main.nf +++ b/tests/modules/last/lastdb/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { LAST_LASTDB } from '../../../../modules/last/lastdb/main.nf' addParams( options: ['args': '-Q0'] ) +include { LAST_LASTDB } from '../../../../modules/last/lastdb/main.nf' workflow test_last_lastdb { diff --git a/tests/modules/last/lastdb/nextflow.config b/tests/modules/last/lastdb/nextflow.config new file mode 100644 index 00000000..9b8b9878 --- /dev/null +++ b/tests/modules/last/lastdb/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: LAST_LASTDB { + ext.args = '-Q0' + } + +} diff --git a/tests/modules/last/lastdb/test.yml b/tests/modules/last/lastdb/test.yml index fed274eb..ece44cf3 100644 --- a/tests/modules/last/lastdb/test.yml +++ b/tests/modules/last/lastdb/test.yml @@ -1,5 +1,5 @@ - name: last lastdb test_last_lastdb - command: nextflow run tests/modules/last/lastdb -entry test_last_lastdb -c tests/config/nextflow.config + command: nextflow run ./tests/modules/last/lastdb -entry test_last_lastdb -c ./tests/config/nextflow.config -c ./tests/modules/last/lastdb/nextflow.config tags: - last/lastdb - last @@ -9,7 +9,7 @@ - path: output/last/lastdb/test.des md5sum: 3a9ea6d336e113a74d7fdca5e7b623fc - path: output/last/lastdb/test.prj - md5sum: 2c981eb9b9d2012d8413946a5b378f20 + md5sum: 6948d17d2a10e470ea545f659930a543 - path: output/last/lastdb/test.sds md5sum: 2cd381f4f8a9c52cfcd323a2863eccb2 - path: output/last/lastdb/test.ssp @@ -20,7 +20,7 @@ md5sum: b7c40f06b1309dc6f37849eeb86dfd22 - name: last lastdb test_last_lastdb_gzipped_input - command: nextflow run tests/modules/last/lastdb -entry test_last_lastdb_gzipped_input -c tests/config/nextflow.config + command: nextflow run ./tests/modules/last/lastdb -entry test_last_lastdb_gzipped_input -c ./tests/config/nextflow.config -c ./tests/modules/last/lastdb/nextflow.config tags: - last/lastdb - last @@ -30,7 +30,7 @@ - path: output/last/lastdb/test.des md5sum: 26ab49015cc572172b9efa50fc5190bc - path: output/last/lastdb/test.prj - md5sum: aec51a18da1c2361aaca70dd16eb7b7b + md5sum: d253fc4320d9b4d7fcfc43b2734412ee - path: output/last/lastdb/test.sds md5sum: cad9927d4bd161257e98165ad755d8e4 - path: output/last/lastdb/test.ssp diff --git a/tests/modules/last/mafconvert/main.nf b/tests/modules/last/mafconvert/main.nf index 7864c68a..c87f6e6a 100644 --- a/tests/modules/last/mafconvert/main.nf +++ b/tests/modules/last/mafconvert/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { LAST_MAFCONVERT } from '../../../../modules/last/mafconvert/main.nf' addParams( options: [:] ) +include { LAST_MAFCONVERT } from '../../../../modules/last/mafconvert/main.nf' workflow test_last_mafconvert { diff --git a/tests/modules/last/mafconvert/nextflow.config b/tests/modules/last/mafconvert/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/last/mafconvert/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/last/mafconvert/test.yml b/tests/modules/last/mafconvert/test.yml index 35c65ce9..86a80f20 100644 --- a/tests/modules/last/mafconvert/test.yml +++ b/tests/modules/last/mafconvert/test.yml @@ -1,5 +1,5 @@ - name: last mafconvert test_last_mafconvert - command: nextflow run tests/modules/last/mafconvert -entry test_last_mafconvert -c tests/config/nextflow.config + command: nextflow run ./tests/modules/last/mafconvert -entry test_last_mafconvert -c ./tests/config/nextflow.config -c ./tests/modules/last/mafconvert/nextflow.config tags: - last/mafconvert - last diff --git a/tests/modules/last/mafswap/main.nf b/tests/modules/last/mafswap/main.nf index 3bb72d63..5cc94932 100644 --- a/tests/modules/last/mafswap/main.nf +++ b/tests/modules/last/mafswap/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { LAST_MAFSWAP } from '../../../../modules/last/mafswap/main.nf' addParams( options: [:] ) +include { LAST_MAFSWAP } from '../../../../modules/last/mafswap/main.nf' workflow test_last_mafswap { diff --git a/tests/modules/last/mafswap/nextflow.config b/tests/modules/last/mafswap/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/last/mafswap/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/last/mafswap/test.yml b/tests/modules/last/mafswap/test.yml index c7e3778d..a0865e00 100644 --- a/tests/modules/last/mafswap/test.yml +++ b/tests/modules/last/mafswap/test.yml @@ -1,5 +1,5 @@ - name: last mafswap test_last_mafswap - command: nextflow run tests/modules/last/mafswap -entry test_last_mafswap -c tests/config/nextflow.config + command: nextflow run ./tests/modules/last/mafswap -entry test_last_mafswap -c ./tests/config/nextflow.config -c ./tests/modules/last/mafswap/nextflow.config tags: - last - last/mafswap diff --git a/tests/modules/last/postmask/main.nf b/tests/modules/last/postmask/main.nf index c30ac806..9bbb10e9 100644 --- a/tests/modules/last/postmask/main.nf +++ b/tests/modules/last/postmask/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { LAST_POSTMASK } from '../../../../modules/last/postmask/main.nf' addParams( options: [suffix:'.postmask'] ) +include { LAST_POSTMASK } from '../../../../modules/last/postmask/main.nf' workflow test_last_postmask { diff --git a/tests/modules/last/postmask/nextflow.config b/tests/modules/last/postmask/nextflow.config new file mode 100644 index 00000000..70c3f35b --- /dev/null +++ b/tests/modules/last/postmask/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: LAST_POSTMASK { + ext.prefix = { "${meta.id}.postmask" } + } + +} diff --git a/tests/modules/last/postmask/test.yml b/tests/modules/last/postmask/test.yml index 57aea822..81ae7f73 100644 --- a/tests/modules/last/postmask/test.yml +++ b/tests/modules/last/postmask/test.yml @@ -1,5 +1,5 @@ - name: last postmask test_last_postmask - command: nextflow run tests/modules/last/postmask -entry test_last_postmask -c tests/config/nextflow.config + command: nextflow run ./tests/modules/last/postmask -entry test_last_postmask -c ./tests/config/nextflow.config -c ./tests/modules/last/postmask/nextflow.config tags: - last - last/postmask diff --git a/tests/modules/last/split/main.nf b/tests/modules/last/split/main.nf index 19d899ab..f4ece4f2 100644 --- a/tests/modules/last/split/main.nf +++ b/tests/modules/last/split/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { LAST_SPLIT } from '../../../../modules/last/split/main.nf' addParams( options: ['suffix':'.split'] ) +include { LAST_SPLIT } from '../../../../modules/last/split/main.nf' workflow test_last_split { diff --git a/tests/modules/last/split/nextflow.config b/tests/modules/last/split/nextflow.config new file mode 100644 index 00000000..6252ec14 --- /dev/null +++ b/tests/modules/last/split/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: LAST_SPLIT { + ext.prefix = { "${meta.id}.split" } + } + +} diff --git a/tests/modules/last/split/test.yml b/tests/modules/last/split/test.yml index d57d7477..57eb345f 100644 --- a/tests/modules/last/split/test.yml +++ b/tests/modules/last/split/test.yml @@ -1,5 +1,5 @@ - name: last split test_last_split - command: nextflow run tests/modules/last/split -entry test_last_split -c tests/config/nextflow.config + command: nextflow run ./tests/modules/last/split -entry test_last_split -c ./tests/config/nextflow.config -c ./tests/modules/last/split/nextflow.config tags: - last - last/split diff --git a/tests/modules/last/train/main.nf b/tests/modules/last/train/main.nf index 26e318c3..0f280a82 100644 --- a/tests/modules/last/train/main.nf +++ b/tests/modules/last/train/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { UNTAR } from '../../../../modules/untar/main.nf' addParams( options: [:] ) -include { LAST_TRAIN } from '../../../../modules/last/train/main.nf' addParams( options: [:] ) +include { UNTAR } from '../../../../modules/untar/main.nf' +include { LAST_TRAIN } from '../../../../modules/last/train/main.nf' workflow test_last_train { diff --git a/tests/modules/last/train/nextflow.config b/tests/modules/last/train/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/last/train/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/last/train/test.yml b/tests/modules/last/train/test.yml index 18eec951..8641600b 100644 --- a/tests/modules/last/train/test.yml +++ b/tests/modules/last/train/test.yml @@ -1,5 +1,5 @@ - name: last train test_last_train - command: nextflow run tests/modules/last/train -entry test_last_train -c tests/config/nextflow.config + command: nextflow run ./tests/modules/last/train -entry test_last_train -c ./tests/config/nextflow.config -c ./tests/modules/last/train/nextflow.config tags: - last/train - last diff --git a/tests/modules/leehom/main.nf b/tests/modules/leehom/main.nf new file mode 100644 index 00000000..1615d2e1 --- /dev/null +++ b/tests/modules/leehom/main.nf @@ -0,0 +1,36 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { LEEHOM } from '../../../modules/leehom/main.nf' +include { SAMTOOLS_VIEW } from '../../../modules/samtools/view/main.nf' + +workflow test_leehom_bam { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + + fasta = [] + + SAMTOOLS_VIEW ( input, fasta ) + LEEHOM ( SAMTOOLS_VIEW.out.bam ) +} + +workflow test_leehom_se_fq { + + input = [ [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + + LEEHOM ( input ) +} + +workflow test_leehom_pe_fq { + + 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) + ] ] + + LEEHOM ( input ) +} diff --git a/tests/modules/leehom/nextflow.config b/tests/modules/leehom/nextflow.config new file mode 100644 index 00000000..25df48cd --- /dev/null +++ b/tests/modules/leehom/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SAMTOOLS_VIEW { + ext.args = '-f4 -b' + } + +} diff --git a/tests/modules/leehom/test.yml b/tests/modules/leehom/test.yml new file mode 100644 index 00000000..98257492 --- /dev/null +++ b/tests/modules/leehom/test.yml @@ -0,0 +1,41 @@ +- name: leehom test_leehom_bam + command: nextflow run ./tests/modules/leehom -entry test_leehom_bam -c ./tests/config/nextflow.config -c ./tests/modules/leehom/nextflow.config + tags: + - leehom + files: + - path: output/leehom/test.bam + - path: output/samtools/test.bam + - path: output/leehom/test.log + md5sum: d1f5da273eb69f41babda510797c7671 + +- name: leehom test_leehom_se_fq + command: nextflow run ./tests/modules/leehom -entry test_leehom_se_fq -c ./tests/config/nextflow.config -c ./tests/modules/leehom/nextflow.config + tags: + - leehom + files: + - path: output/leehom/test.fail.fq.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/leehom/test.fq.gz + md5sum: ed10c4bbf5c3082ca68823535b91e1e2 + - path: output/leehom/test.log + md5sum: 59aa280cb72dfbea05ba913cb89db143 + +- name: leehom test_leehom_pe_fq + command: nextflow run ./tests/modules/leehom -entry test_leehom_pe_fq -c ./tests/config/nextflow.config -c ./tests/modules/leehom/nextflow.config + tags: + - leehom + files: + - path: output/leehom/test.fail.fq.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/leehom/test.fq.gz + md5sum: 84929b78e3f89371ecd3b4c915b9ec33 + - path: output/leehom/test.log + md5sum: 800b5a88dc0822886bfbb271029e2a4a + - path: output/leehom/test_r1.fail.fq.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/leehom/test_r1.fq.gz + md5sum: e9258420fa712e8536106995a7d1d97a + - path: output/leehom/test_r2.fail.fq.gz + md5sum: 7029066c27ac6f5ef18d660d5741979a + - path: output/leehom/test_r2.fq.gz + md5sum: 27230bcc5eae81ec5c1701798d39c1af diff --git a/tests/modules/lima/main.nf b/tests/modules/lima/main.nf new file mode 100644 index 00000000..7501def9 --- /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' + +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/nextflow.config b/tests/modules/lima/nextflow.config new file mode 100644 index 00000000..8da2613f --- /dev/null +++ b/tests/modules/lima/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: LIMA { + ext.args = '--isoseq --peek-guess' + ext.prefix = { "${meta.id}.fl" } + } + +} diff --git a/tests/modules/lima/test.yml b/tests/modules/lima/test.yml new file mode 100644 index 00000000..8d927624 --- /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 -c ./tests/modules/lima/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 -c ./tests/modules/lima/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 -c ./tests/modules/lima/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 -c ./tests/modules/lima/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 -c ./tests/modules/lima/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 diff --git a/tests/modules/lissero/main.nf b/tests/modules/lissero/main.nf new file mode 100644 index 00000000..339576c3 --- /dev/null +++ b/tests/modules/lissero/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { LISSERO } from '../../../modules/lissero/main.nf' + +workflow test_lissero { + + input = [ [ id:'test', single_end:false ], // meta map + file("https://github.com/MDU-PHL/LisSero/raw/master/tests/test_seq/NC_002973.fna", checkIfExists: true) ] + + LISSERO ( input ) +} diff --git a/tests/modules/lissero/nextflow.config b/tests/modules/lissero/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/lissero/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/lissero/test.yml b/tests/modules/lissero/test.yml new file mode 100644 index 00000000..8dd7339e --- /dev/null +++ b/tests/modules/lissero/test.yml @@ -0,0 +1,7 @@ +- name: lissero test_lissero + command: nextflow run ./tests/modules/lissero -entry test_lissero -c ./tests/config/nextflow.config -c ./tests/modules/lissero/nextflow.config + tags: + - lissero + files: + - path: output/lissero/test.tsv + contains: ['ID', 'SEROTYPE', 'FULL'] diff --git a/tests/modules/lofreq/call/main.nf b/tests/modules/lofreq/call/main.nf index 2c306fd1..70da4ea5 100644 --- a/tests/modules/lofreq/call/main.nf +++ b/tests/modules/lofreq/call/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { LOFREQ_CALL } from '../../../../modules/lofreq/call/main.nf' addParams( options: [:] ) +include { LOFREQ_CALL } from '../../../../modules/lofreq/call/main.nf' workflow test_lofreq_call { diff --git a/tests/modules/lofreq/call/nextflow.config b/tests/modules/lofreq/call/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/lofreq/call/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/lofreq/call/test.yml b/tests/modules/lofreq/call/test.yml index a809b2da..b9f42542 100644 --- a/tests/modules/lofreq/call/test.yml +++ b/tests/modules/lofreq/call/test.yml @@ -1,8 +1,8 @@ - name: lofreq call test_lofreq_call - command: nextflow run tests/modules/lofreq/call -entry test_lofreq_call -c tests/config/nextflow.config + command: nextflow run ./tests/modules/lofreq/call -entry test_lofreq_call -c ./tests/config/nextflow.config -c ./tests/modules/lofreq/call/nextflow.config tags: - lofreq - lofreq/call files: - path: output/lofreq/test.vcf.gz - md5sum: 421b407a172191e54d054018c8868cf7 + contains: ['##INFO='] diff --git a/tests/modules/lofreq/callparallel/main.nf b/tests/modules/lofreq/callparallel/main.nf index 724bbff1..24ab2db3 100644 --- a/tests/modules/lofreq/callparallel/main.nf +++ b/tests/modules/lofreq/callparallel/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { LOFREQ_CALLPARALLEL } from '../../../../modules/lofreq/callparallel/main.nf' addParams( options: [:] ) +include { LOFREQ_CALLPARALLEL } from '../../../../modules/lofreq/callparallel/main.nf' workflow test_lofreq_callparallel { diff --git a/tests/modules/lofreq/callparallel/nextflow.config b/tests/modules/lofreq/callparallel/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/lofreq/callparallel/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/lofreq/callparallel/test.yml b/tests/modules/lofreq/callparallel/test.yml index 3ffb459e..db281012 100644 --- a/tests/modules/lofreq/callparallel/test.yml +++ b/tests/modules/lofreq/callparallel/test.yml @@ -1,7 +1,8 @@ -- name: lofreq callparallel - command: nextflow run ./tests/modules/lofreq/callparallel -entry test_lofreq_callparallel -c tests/config/nextflow.config +- name: lofreq callparallel test_lofreq_callparallel + command: nextflow run ./tests/modules/lofreq/callparallel -entry test_lofreq_callparallel -c ./tests/config/nextflow.config -c ./tests/modules/lofreq/callparallel/nextflow.config tags: - - lofreq - lofreq/callparallel + - lofreq files: - - path: output/lofreq/test.vcf + - path: output/lofreq/test.vcf.gz + contains: ['##INFO='] diff --git a/tests/modules/lofreq/filter/main.nf b/tests/modules/lofreq/filter/main.nf index c5dcea97..bd2a7f54 100644 --- a/tests/modules/lofreq/filter/main.nf +++ b/tests/modules/lofreq/filter/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { LOFREQ_FILTER } from '../../../../modules/lofreq/filter/main.nf' addParams( options: [:] ) +include { LOFREQ_FILTER } from '../../../../modules/lofreq/filter/main.nf' workflow test_lofreq_filter { diff --git a/tests/modules/lofreq/filter/nextflow.config b/tests/modules/lofreq/filter/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/lofreq/filter/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/lofreq/filter/test.yml b/tests/modules/lofreq/filter/test.yml index 4ee82654..d3ee3812 100644 --- a/tests/modules/lofreq/filter/test.yml +++ b/tests/modules/lofreq/filter/test.yml @@ -1,5 +1,5 @@ - name: lofreq filter test_lofreq_filter - command: nextflow run tests/modules/lofreq/filter -entry test_lofreq_filter -c tests/config/nextflow.config + command: nextflow run ./tests/modules/lofreq/filter -entry test_lofreq_filter -c ./tests/config/nextflow.config -c ./tests/modules/lofreq/filter/nextflow.config tags: - lofreq - lofreq/filter diff --git a/tests/modules/lofreq/indelqual/main.nf b/tests/modules/lofreq/indelqual/main.nf index ba0493dd..71652ce1 100644 --- a/tests/modules/lofreq/indelqual/main.nf +++ b/tests/modules/lofreq/indelqual/main.nf @@ -3,7 +3,7 @@ nextflow.enable.dsl = 2 -include { LOFREQ_INDELQUAL } from '../../../../modules/lofreq/indelqual/main.nf' addParams( options: [ 'args': '--dindel', 'suffix':'.indelqual'] ) +include { LOFREQ_INDELQUAL } from '../../../../modules/lofreq/indelqual/main.nf' workflow test_lofreq_indelqual { diff --git a/tests/modules/lofreq/indelqual/nextflow.config b/tests/modules/lofreq/indelqual/nextflow.config new file mode 100644 index 00000000..c50c1363 --- /dev/null +++ b/tests/modules/lofreq/indelqual/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: LOFREQ_INDELQUAL { + ext.args = '--dindel' + ext.prefix = { "${meta.id}.indelqual" } + } + +} diff --git a/tests/modules/lofreq/indelqual/test.yml b/tests/modules/lofreq/indelqual/test.yml index f3e73297..6fffb523 100644 --- a/tests/modules/lofreq/indelqual/test.yml +++ b/tests/modules/lofreq/indelqual/test.yml @@ -1,5 +1,5 @@ - name: lofreq indelqual - command: nextflow run ./tests/modules/lofreq/indelqual -entry test_lofreq_indelqual -c tests/config/nextflow.config + command: nextflow run ./tests/modules/lofreq/indelqual -entry test_lofreq_indelqual -c ./tests/config/nextflow.config -c ./tests/modules/lofreq/indelqual/nextflow.config tags: - lofreq - lofreq/indelqual diff --git a/tests/modules/macrel/contigs/main.nf b/tests/modules/macrel/contigs/main.nf new file mode 100644 index 00000000..a613dcc4 --- /dev/null +++ b/tests/modules/macrel/contigs/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MACREL_CONTIGS } from '../../../../modules/macrel/contigs/main.nf' + +workflow test_macrel_contigs { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['bacteroides_fragilis']['illumina']['test1_contigs_fa_gz'], checkIfExists: true) + ] + + MACREL_CONTIGS ( input ) +} diff --git a/tests/modules/macrel/contigs/nextflow.config b/tests/modules/macrel/contigs/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/macrel/contigs/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/macrel/contigs/test.yml b/tests/modules/macrel/contigs/test.yml new file mode 100644 index 00000000..af272605 --- /dev/null +++ b/tests/modules/macrel/contigs/test.yml @@ -0,0 +1,16 @@ +- name: macrel contigs test_macrel_contigs + command: nextflow run ./tests/modules/macrel/contigs -entry test_macrel_contigs -c ./tests/config/nextflow.config -c ./tests/modules/macrel/contigs/nextflow.config + tags: + - macrel/contigs + - macrel + files: + - path: output/macrel/test/README.md + md5sum: fa3706dfc95d0538a52c4d0d824be5fb + - path: output/macrel/test/test.all_orfs.faa.gz + - path: output/macrel/test/test.prediction.gz + - path: output/macrel/test/test.smorfs.faa.gz + md5sum: 79704c6120c2f794518301af6f9b963d + - path: output/macrel/test/test_log.txt + md5sum: 6fdba143dce759597eb9f80e5d968729 + - path: output/macrel/versions.yml + md5sum: be8bf0d0647751c635c3736655f29f85 diff --git a/tests/modules/macs2/callpeak/main.nf b/tests/modules/macs2/callpeak/main.nf new file mode 100644 index 00000000..070469dd --- /dev/null +++ b/tests/modules/macs2/callpeak/main.nf @@ -0,0 +1,31 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MACS2_CALLPEAK } from '../../../../modules/macs2/callpeak/main.nf' +include { MACS2_CALLPEAK as MACS2_CALLPEAK_CTRL } from '../../../../modules/macs2/callpeak/main.nf' +include { MACS2_CALLPEAK as MACS2_CALLPEAK_BED } from '../../../../modules/macs2/callpeak/main.nf' + +workflow test_macs2_callpeak_bed { + input = [ [ id:'test', single_end:false ], // meta map + [ file( params.test_data['homo_sapiens']['pacbio']['genemodel1'], checkIfExists: true)], + []] + + MACS2_CALLPEAK_BED ( input, 4000 ) +} + +workflow test_macs2_callpeak { + input = [ [ id:'test', single_end:false ], // meta map + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ], + []] + + MACS2_CALLPEAK ( input, 40000 ) +} + +workflow test_macs2_callpeak_ctrl { + input = [ [ id:'test', single_end:false ], // meta map + [ file( params.test_data['homo_sapiens']['illumina']['test_paired_end_name_sorted_bam'], checkIfExists: true) ], + [ file( params.test_data['homo_sapiens']['illumina']['test2_paired_end_name_sorted_bam'], checkIfExists: true) ]] + + MACS2_CALLPEAK_CTRL ( input, 40000 ) +} diff --git a/tests/modules/macs2/callpeak/nextflow.config b/tests/modules/macs2/callpeak/nextflow.config new file mode 100644 index 00000000..e3bd3f5d --- /dev/null +++ b/tests/modules/macs2/callpeak/nextflow.config @@ -0,0 +1,17 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: MACS2_CALLPEAK { + ext.args = '--qval 0.1' + } + + withName: MACS2_CALLPEAK_CTRL { + ext.args = '--qval 0.1' + } + + withName: MACS2_CALLPEAK_BED { + ext.args = '--format BED --qval 1 --nomodel --extsize 200' + } + +} diff --git a/tests/modules/macs2/callpeak/test.yml b/tests/modules/macs2/callpeak/test.yml new file mode 100644 index 00000000..43c99140 --- /dev/null +++ b/tests/modules/macs2/callpeak/test.yml @@ -0,0 +1,38 @@ +- name: macs2 callpeak test_macs2_callpeak_bed + command: nextflow run ./tests/modules/macs2/callpeak -entry test_macs2_callpeak_bed -c ./tests/config/nextflow.config -c ./tests/modules/macs2/callpeak/nextflow.config + tags: + - macs2 + - macs2/callpeak + files: + - path: output/macs2/test_peaks.narrowPeak + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/macs2/test_peaks.xls + md5sum: 762383e3a35e1f9ac3834fd6b2926092 + - path: output/macs2/test_summits.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e + +- name: macs2 callpeak test_macs2_callpeak + command: nextflow run ./tests/modules/macs2/callpeak -entry test_macs2_callpeak -c ./tests/config/nextflow.config -c ./tests/modules/macs2/callpeak/nextflow.config + tags: + - macs2 + - macs2/callpeak + files: + - path: output/macs2/test_peaks.narrowPeak + md5sum: 2e4da1c1704595e12aaf99cc715ad70c + - path: output/macs2/test_peaks.xls + md5sum: 5d65cb3dbd5421ea3bb5b490a100e9a4 + - path: output/macs2/test_summits.bed + md5sum: 26f0f97b6c14dbca129e947a58067c82 + +- name: macs2 callpeak test_macs2_callpeak_ctrl + command: nextflow run ./tests/modules/macs2/callpeak -entry test_macs2_callpeak_ctrl -c ./tests/config/nextflow.config -c ./tests/modules/macs2/callpeak/nextflow.config + tags: + - macs2 + - macs2/callpeak + files: + - path: output/macs2/test_peaks.narrowPeak + md5sum: 653e1108cc57ca07d0f60fc0f4fb8ba3 + - path: output/macs2/test_peaks.xls + md5sum: bf86546faa7b581b5209c29b22046a0a + - path: output/macs2/test_summits.bed + md5sum: 4f3c7c53a1d730d90d1b3dd9d3197af4 diff --git a/tests/modules/malt/build b/tests/modules/malt/build new file mode 120000 index 00000000..942cadb7 --- /dev/null +++ b/tests/modules/malt/build @@ -0,0 +1 @@ +build_test/ \ No newline at end of file diff --git a/tests/modules/malt/build_test/main.nf b/tests/modules/malt/build_test/main.nf new file mode 100644 index 00000000..2542da0c --- /dev/null +++ b/tests/modules/malt/build_test/main.nf @@ -0,0 +1,26 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UNZIP } from '../../../../modules/unzip/main.nf' +include { MALT_BUILD } from '../../../../modules/malt/build/main.nf' + +workflow test_malt_build { + fastas = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + seq_type = "DNA" + gff = [] + map_db = file("https://software-ab.informatik.uni-tuebingen.de/download/megan6/megan-nucl-Jan2021.db.zip", checkIfExists: true) + + UNZIP ( map_db ) + MALT_BUILD ( fastas, seq_type, gff, UNZIP.out.unzipped_archive ) +} + +workflow test_malt_build_gff { + fastas = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + seq_type = "DNA" + gff = file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) + map_db = file("https://software-ab.informatik.uni-tuebingen.de/download/megan6/megan-nucl-Jan2021.db.zip", checkIfExists: true) + + UNZIP ( map_db ) + MALT_BUILD ( fastas, seq_type, gff, UNZIP.out.unzipped_archive ) +} diff --git a/tests/modules/malt/build_test/nextflow.config b/tests/modules/malt/build_test/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/malt/build_test/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/malt/build_test/test.yml b/tests/modules/malt/build_test/test.yml new file mode 100644 index 00000000..c6694ad5 --- /dev/null +++ b/tests/modules/malt/build_test/test.yml @@ -0,0 +1,48 @@ +- name: malt build + command: nextflow run ./tests/modules/malt/build_test -entry test_malt_build -c ./tests/config/nextflow.config -c ./tests/modules/malt/build/nextflow.config + tags: + - malt + - malt/build + files: + - path: output/malt/malt_index/index0.idx + md5sum: 1954f2c00b418d00112829b0a6adb8ce + - path: output/malt/malt_index/ref.db + md5sum: 772a09aeb162515485b037604399f2bd + - path: output/malt/malt_index/ref.idx + md5sum: 7dea362b3fac8e00956a4952a3d4f474 + - path: output/malt/malt_index/ref.inf + md5sum: b146842067cf278ef1d23e6c2e7c0c35 + - path: output/malt/malt_index/table0.db + - path: output/malt/malt_index/table0.idx + - path: output/malt/malt_index/taxonomy.idx + md5sum: bb335e7c378a5bd85761b6eeed16d984 + - path: output/malt/malt_index/taxonomy.map + md5sum: f6b05bbab2149e388cb769098e14d433 + - path: output/malt/malt_index/taxonomy.tre + md5sum: bde26a1fff5c63d3046d3863607a1e70 +- name: malt build gff + command: nextflow run ./tests/modules/malt/build_test -entry test_malt_build_gff -c ./tests/config/nextflow.config -c ./tests/modules/malt/build/nextflow.config + tags: + - malt + - malt/build + files: + - path: output/malt/malt_index/aadd.dbx + md5sum: 4e2ed57e713d5372bd09350f447cdf53 + - path: output/malt/malt_index/aadd.idx + md5sum: 0994061bc8673ebd283fa6546c3dd12c + - path: output/malt/malt_index/index0.idx + md5sum: 1954f2c00b418d00112829b0a6adb8ce + - path: output/malt/malt_index/ref.db + md5sum: 772a09aeb162515485b037604399f2bd + - path: output/malt/malt_index/ref.idx + md5sum: 7dea362b3fac8e00956a4952a3d4f474 + - path: output/malt/malt_index/ref.inf + md5sum: b146842067cf278ef1d23e6c2e7c0c35 + - path: output/malt/malt_index/table0.db + - path: output/malt/malt_index/table0.idx + - path: output/malt/malt_index/taxonomy.idx + md5sum: bb335e7c378a5bd85761b6eeed16d984 + - path: output/malt/malt_index/taxonomy.map + md5sum: f6b05bbab2149e388cb769098e14d433 + - path: output/malt/malt_index/taxonomy.tre + md5sum: bde26a1fff5c63d3046d3863607a1e70 diff --git a/tests/modules/malt/run/main.nf b/tests/modules/malt/run/main.nf new file mode 100644 index 00000000..292a3fcf --- /dev/null +++ b/tests/modules/malt/run/main.nf @@ -0,0 +1,21 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UNZIP } from '../../../../modules/unzip/main.nf' +include { MALT_BUILD } from '../../../../modules/malt/build/main.nf' +include { MALT_RUN } from '../../../../modules/malt/run/main.nf' + +workflow test_malt_run { + + fastas = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + gff = file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) + 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" + + UNZIP ( map_db ) + MALT_BUILD ( fastas, seq_type, gff, UNZIP.out.unzipped_archive ) + MALT_RUN ( input, mode, MALT_BUILD.out.index ) +} diff --git a/tests/modules/malt/run/nextflow.config b/tests/modules/malt/run/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/malt/run/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/malt/run/test.yml b/tests/modules/malt/run/test.yml new file mode 100644 index 00000000..5b0742e4 --- /dev/null +++ b/tests/modules/malt/run/test.yml @@ -0,0 +1,9 @@ +- name: malt run + command: nextflow run ./tests/modules/malt/run -entry test_malt_run -c ./tests/config/nextflow.config -c ./tests/modules/malt/run/nextflow.config + tags: + - malt + - malt/run + files: + - path: output/malt/test_1.rma6 + - path: output/malt/malt-run.log + diff --git a/tests/modules/maltextract/main.nf b/tests/modules/maltextract/main.nf new file mode 100644 index 00000000..8e0a2241 --- /dev/null +++ b/tests/modules/maltextract/main.nf @@ -0,0 +1,27 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UNZIP as UNZIP_MALT } from '../../../modules/unzip/main.nf' +include { UNZIP as UNZIP_MALTEXTRACT } from '../../../modules/unzip/main.nf' +include { MALT_BUILD } from '../../../modules/malt/build/main.nf' +include { MALT_RUN } from '../../../modules/malt/run/main.nf' +include { MALTEXTRACT } from '../../../modules/maltextract/main.nf' + +workflow test_maltextract { + + 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) + + 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) +} diff --git a/tests/modules/maltextract/nextflow.config b/tests/modules/maltextract/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/maltextract/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/maltextract/test.yml b/tests/modules/maltextract/test.yml new file mode 100644 index 00000000..2440c100 --- /dev/null +++ b/tests/modules/maltextract/test.yml @@ -0,0 +1,11 @@ +- name: maltextract + command: nextflow run ./tests/modules/maltextract -entry test_maltextract -c ./tests/config/nextflow.config -c ./tests/modules/maltextract/nextflow.config + tags: + - maltextract + files: + - path: output/maltextract/results/error.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/maltextract/results/error.txt + - path: output/maltextract/results/log.txt + contains: + - "INFO: Peak memory" diff --git a/tests/modules/manta/germline/main.nf b/tests/modules/manta/germline/main.nf new file mode 100644 index 00000000..f8adedb0 --- /dev/null +++ b/tests/modules/manta/germline/main.nf @@ -0,0 +1,35 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MANTA_GERMLINE } from '../../../../modules/manta/germline/main.nf' + +workflow test_manta_germline { + input = [ + [ id:'test'], // 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) + ] + + 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 = [] + bed_tbi = [] + + MANTA_GERMLINE ( input, fasta, fai, bed, bed_tbi ) +} + +workflow test_manta_germline_target_bed { + input = [ + [ id:'test'], // 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) + ] + + 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) + + MANTA_GERMLINE ( input, fasta, fai, bed, bed_tbi ) +} diff --git a/tests/modules/manta/germline/nextflow.config b/tests/modules/manta/germline/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/manta/germline/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/manta/germline/test.yml b/tests/modules/manta/germline/test.yml new file mode 100644 index 00000000..c6ead9eb --- /dev/null +++ b/tests/modules/manta/germline/test.yml @@ -0,0 +1,24 @@ +- name: manta germline + command: nextflow run ./tests/modules/manta/germline -entry test_manta_germline -c ./tests/config/nextflow.config -c ./tests/modules/manta/germline/nextflow.config + tags: + - manta + - manta/germline + files: + - path: output/manta/test.candidate_small_indels.vcf.gz + - path: output/manta/test.candidate_small_indels.vcf.gz.tbi + - path: output/manta/test.candidate_sv.vcf.gz + - path: output/manta/test.candidate_sv.vcf.gz.tbi + - path: output/manta/test.diploid_sv.vcf.gz + - path: output/manta/test.diploid_sv.vcf.gz.tbi +- name: manta germline target bed + command: nextflow run ./tests/modules/manta/germline -entry test_manta_germline_target_bed -c ./tests/config/nextflow.config -c ./tests/modules/manta/germline/nextflow.config + tags: + - manta + - manta/germline + files: + - path: output/manta/test.candidate_small_indels.vcf.gz + - path: output/manta/test.candidate_small_indels.vcf.gz.tbi + - path: output/manta/test.candidate_sv.vcf.gz + - path: output/manta/test.candidate_sv.vcf.gz.tbi + - path: output/manta/test.diploid_sv.vcf.gz + - path: output/manta/test.diploid_sv.vcf.gz.tbi diff --git a/tests/modules/manta/somatic/main.nf b/tests/modules/manta/somatic/main.nf new file mode 100644 index 00000000..7da41bea --- /dev/null +++ b/tests/modules/manta/somatic/main.nf @@ -0,0 +1,23 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MANTA_SOMATIC } from '../../../../modules/manta/somatic/main.nf' + +workflow test_manta_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) + + MANTA_SOMATIC ( input, fasta, fai, bed, bed_tbi ) +} diff --git a/tests/modules/manta/somatic/nextflow.config b/tests/modules/manta/somatic/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/manta/somatic/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/manta/somatic/test.yml b/tests/modules/manta/somatic/test.yml new file mode 100644 index 00000000..d701a210 --- /dev/null +++ b/tests/modules/manta/somatic/test.yml @@ -0,0 +1,18 @@ +- name: manta somatic test_manta_somatic + command: nextflow run ./tests/modules/manta/somatic -entry test_manta_somatic -c ./tests/config/nextflow.config -c ./tests/modules/manta/somatic/nextflow.config + tags: + - manta/somatic + - manta + files: + - path: output/manta/test.candidate_small_indels.vcf.gz + - path: output/manta/test.candidate_small_indels.vcf.gz.tbi + md5sum: 4cb176febbc8c26d717a6c6e67b9c905 + - path: output/manta/test.candidate_sv.vcf.gz + - path: output/manta/test.candidate_sv.vcf.gz.tbi + md5sum: 4cb176febbc8c26d717a6c6e67b9c905 + - path: output/manta/test.diploid_sv.vcf.gz + - path: output/manta/test.diploid_sv.vcf.gz.tbi + md5sum: 4cb176febbc8c26d717a6c6e67b9c905 + - path: output/manta/test.somatic_sv.vcf.gz + - path: output/manta/test.somatic_sv.vcf.gz.tbi + md5sum: 4cb176febbc8c26d717a6c6e67b9c905 diff --git a/tests/modules/manta/tumoronly/main.nf b/tests/modules/manta/tumoronly/main.nf new file mode 100644 index 00000000..be0d3dbb --- /dev/null +++ b/tests/modules/manta/tumoronly/main.nf @@ -0,0 +1,35 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MANTA_TUMORONLY } from '../../../../modules/manta/tumoronly/main.nf' + +workflow test_manta_tumoronly { + input = [ + [ id:'test'], // meta map + 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 = [] + bed_tbi = [] + + MANTA_TUMORONLY ( input, fasta, fai, bed, bed_tbi ) +} + +workflow test_manta_tumoronly_target_bed { + input = [ + [ id:'test'], // meta map + 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) + + MANTA_TUMORONLY ( input, fasta, fai, bed, bed_tbi ) +} diff --git a/tests/modules/manta/tumoronly/nextflow.config b/tests/modules/manta/tumoronly/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/manta/tumoronly/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/manta/tumoronly/test.yml b/tests/modules/manta/tumoronly/test.yml new file mode 100644 index 00000000..c56e23fa --- /dev/null +++ b/tests/modules/manta/tumoronly/test.yml @@ -0,0 +1,24 @@ +- name: manta tumoronly + command: nextflow run ./tests/modules/manta/tumoronly -entry test_manta_tumoronly -c ./tests/config/nextflow.config -c ./tests/modules/manta/tumoronly/nextflow.config + tags: + - manta + - manta/tumoronly + files: + - path: output/manta/test.candidate_small_indels.vcf.gz + - path: output/manta/test.candidate_small_indels.vcf.gz.tbi + - path: output/manta/test.candidate_sv.vcf.gz + - path: output/manta/test.candidate_sv.vcf.gz.tbi + - path: output/manta/test.tumor_sv.vcf.gz + - path: output/manta/test.tumor_sv.vcf.gz.tbi +- name: manta tumoronly target bed + command: nextflow run ./tests/modules/manta/tumoronly -entry test_manta_tumoronly_target_bed -c ./tests/config/nextflow.config -c ./tests/modules/manta/tumoronly/nextflow.config + tags: + - manta + - manta/tumoronly + files: + - path: output/manta/test.candidate_small_indels.vcf.gz + - path: output/manta/test.candidate_small_indels.vcf.gz.tbi + - path: output/manta/test.candidate_sv.vcf.gz + - path: output/manta/test.candidate_sv.vcf.gz.tbi + - path: output/manta/test.tumor_sv.vcf.gz + - path: output/manta/test.tumor_sv.vcf.gz.tbi diff --git a/tests/modules/mapdamage2/main.nf b/tests/modules/mapdamage2/main.nf new file mode 100644 index 00000000..b7e4d23b --- /dev/null +++ b/tests/modules/mapdamage2/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MAPDAMAGE2 } from '../../../modules/mapdamage2/main.nf' + +workflow test_mapdamage2 { + + 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) + + MAPDAMAGE2 ( input, fasta ) +} diff --git a/tests/modules/mapdamage2/nextflow.config b/tests/modules/mapdamage2/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/mapdamage2/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/mapdamage2/test.yml b/tests/modules/mapdamage2/test.yml new file mode 100644 index 00000000..96c8b2da --- /dev/null +++ b/tests/modules/mapdamage2/test.yml @@ -0,0 +1,25 @@ +- name: mapdamage2 test_mapdamage2 + command: nextflow run ./tests/modules/mapdamage2 -entry test_mapdamage2 -c ./tests/config/nextflow.config -c ./tests/modules/mapdamage2/nextflow.config + tags: + - mapdamage2 + files: + - path: output/mapdamage2/results_test.paired_end.sorted/3pGtoA_freq.txt + md5sum: 3b300b8d2842441675cb2b56740801f0 + - path: output/mapdamage2/results_test.paired_end.sorted/5pCtoT_freq.txt + md5sum: 4c27465cd02e1fb8bf6fb2b01e98446d + - path: output/mapdamage2/results_test.paired_end.sorted/Fragmisincorporation_plot.pdf + - path: output/mapdamage2/results_test.paired_end.sorted/Runtime_log.txt + - path: output/mapdamage2/results_test.paired_end.sorted/Stats_out_MCMC_correct_prob.csv + - path: output/mapdamage2/results_test.paired_end.sorted/Stats_out_MCMC_hist.pdf + - path: output/mapdamage2/results_test.paired_end.sorted/Stats_out_MCMC_iter.csv + - path: output/mapdamage2/results_test.paired_end.sorted/Stats_out_MCMC_iter_summ_stat.csv + - path: output/mapdamage2/results_test.paired_end.sorted/Stats_out_MCMC_post_pred.pdf + - path: output/mapdamage2/results_test.paired_end.sorted/Stats_out_MCMC_trace.pdf + - path: output/mapdamage2/results_test.paired_end.sorted/dnacomp.txt + md5sum: 4244d9fa554bbfeebbcea8eba3ad6466 + - path: output/mapdamage2/results_test.paired_end.sorted/dnacomp_genome.csv + md5sum: ea91a3d205717d3c6b3e0b77bb840945 + - path: output/mapdamage2/results_test.paired_end.sorted/lgdistribution.txt + md5sum: f86dfc04b1fff4337cc91add6356e3a0 + - path: output/mapdamage2/results_test.paired_end.sorted/misincorporation.txt + md5sum: 1c89b4c96d1f8996c3d0879cad5129a5 diff --git a/tests/modules/mash/sketch/main.nf b/tests/modules/mash/sketch/main.nf index da72d1e3..cec2035b 100644 --- a/tests/modules/mash/sketch/main.nf +++ b/tests/modules/mash/sketch/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { MASH_SKETCH } from '../../../../modules/mash/sketch/main.nf' addParams( options: [:] ) +include { MASH_SKETCH } from '../../../../modules/mash/sketch/main.nf' workflow test_mash_sketch { diff --git a/tests/modules/mash/sketch/nextflow.config b/tests/modules/mash/sketch/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/mash/sketch/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/mash/sketch/test.yml b/tests/modules/mash/sketch/test.yml index 78f4598b..d5039956 100644 --- a/tests/modules/mash/sketch/test.yml +++ b/tests/modules/mash/sketch/test.yml @@ -1,5 +1,5 @@ - name: mash sketch - command: nextflow run ./tests/modules/mash/sketch -entry test_mash_sketch -c tests/config/nextflow.config + command: nextflow run ./tests/modules/mash/sketch -entry test_mash_sketch -c ./tests/config/nextflow.config -c ./tests/modules/mash/sketch/nextflow.config tags: - mash/sketch files: diff --git a/tests/modules/mashtree/main.nf b/tests/modules/mashtree/main.nf new file mode 100644 index 00000000..07f5e561 --- /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' + +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/nextflow.config b/tests/modules/mashtree/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/mashtree/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/mashtree/test.yml b/tests/modules/mashtree/test.yml new file mode 100644 index 00000000..bea9638c --- /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 -c ./tests/modules/mashtree/nextflow.config + tags: + - mashtree + files: + - path: output/mashtree/test.dnd + md5sum: 007b3949a9f0c991624791d2fb076824 + - path: output/mashtree/test.tsv diff --git a/tests/modules/maxbin2/main.nf b/tests/modules/maxbin2/main.nf new file mode 100644 index 00000000..3df417be --- /dev/null +++ b/tests/modules/maxbin2/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MAXBIN2 } from '../../../modules/maxbin2/main.nf' + +workflow test_maxbin2 { + + input = [ + [ id:'test1', single_end:false ], // meta map + file(params.test_data['bacteroides_fragilis']['illumina']['test1_contigs_fa_gz'], checkIfExists: true), + file(params.test_data['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true), + [] + ] + + MAXBIN2 ( input ) +} diff --git a/tests/modules/maxbin2/nextflow.config b/tests/modules/maxbin2/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/maxbin2/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/maxbin2/test.yml b/tests/modules/maxbin2/test.yml new file mode 100644 index 00000000..a8ba98f9 --- /dev/null +++ b/tests/modules/maxbin2/test.yml @@ -0,0 +1,15 @@ +- name: maxbin2 + command: nextflow run ./tests/modules/maxbin2 -entry test_maxbin2 -c ./tests/config/nextflow.config -c ./tests/modules/maxbin2/nextflow.config + tags: + - maxbin2 + files: + - path: output/maxbin2/test1.001.fasta.gz + - path: output/maxbin2/test1.002.fasta.gz + - path: output/maxbin2/test1.log.gz + - path: output/maxbin2/test1.marker.gz + - path: output/maxbin2/test1.marker_of_each_bin.tar.gz + - path: output/maxbin2/test1.noclass.gz + - path: output/maxbin2/test1.summary + contains: + - "Bin name\tAbundance\tCompleteness\tGenome size\tGC content" + - path: output/maxbin2/test1.tooshort.gz diff --git a/tests/modules/medaka/main.nf b/tests/modules/medaka/main.nf new file mode 100644 index 00000000..75fc135b --- /dev/null +++ b/tests/modules/medaka/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MEDAKA } from '../../../modules/medaka/main.nf' + +workflow test_medaka { + + input = [ + [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + + MEDAKA ( input ) +} diff --git a/tests/modules/medaka/nextflow.config b/tests/modules/medaka/nextflow.config new file mode 100644 index 00000000..c0b1b507 --- /dev/null +++ b/tests/modules/medaka/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: MEDAKA { + ext.prefix = { "${meta.id}.polished.genome" } + } + +} diff --git a/tests/modules/medaka/test.yml b/tests/modules/medaka/test.yml new file mode 100644 index 00000000..54146bdc --- /dev/null +++ b/tests/modules/medaka/test.yml @@ -0,0 +1,7 @@ +- name: medaka test_medaka + command: nextflow run ./tests/modules/medaka -entry test_medaka -c ./tests/config/nextflow.config -c ./tests/modules/medaka/nextflow.config + tags: + - medaka + files: + - path: output/medaka/test.polished.genome.fa.gz + md5sum: f42303f1d6c2c79175faeb00e10b9a6e \ No newline at end of file diff --git a/tests/modules/megahit/main.nf b/tests/modules/megahit/main.nf new file mode 100644 index 00000000..88acf3e3 --- /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' + +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/nextflow.config b/tests/modules/megahit/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/megahit/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/megahit/test.yml b/tests/modules/megahit/test.yml new file mode 100644 index 00000000..2072ac12 --- /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 -c ./tests/modules/megahit/nextflow.config + 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 -c ./tests/modules/megahit/nextflow.config + 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 diff --git a/tests/modules/meningotype/main.nf b/tests/modules/meningotype/main.nf new file mode 100644 index 00000000..a2d0ff10 --- /dev/null +++ b/tests/modules/meningotype/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MENINGOTYPE } from '../../../modules/meningotype/main.nf' + +workflow test_meningotype { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + MENINGOTYPE ( input ) +} diff --git a/tests/modules/meningotype/nextflow.config b/tests/modules/meningotype/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/meningotype/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/meningotype/test.yml b/tests/modules/meningotype/test.yml new file mode 100644 index 00000000..02ec8e1f --- /dev/null +++ b/tests/modules/meningotype/test.yml @@ -0,0 +1,7 @@ +- name: meningotype test_meningotype + command: nextflow run ./tests/modules/meningotype -entry test_meningotype -c ./tests/config/nextflow.config -c ./tests/modules/meningotype/nextflow.config + tags: + - meningotype + files: + - path: output/meningotype/test.tsv + md5sum: 25651bccb3d1c64cefcb7946fda30a6c diff --git a/tests/modules/metabat2/jgisummarizebamcontigdepths/main.nf b/tests/modules/metabat2/jgisummarizebamcontigdepths/main.nf new file mode 100644 index 00000000..00309402 --- /dev/null +++ b/tests/modules/metabat2/jgisummarizebamcontigdepths/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS } from '../../../../modules/metabat2/jgisummarizebamcontigdepths/main.nf' + +workflow test_metabat2_jgisummarizebamcontigdepths { + + input = [ [ id:'test' ], // 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) ] + + METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS ( input ) +} diff --git a/tests/modules/metabat2/jgisummarizebamcontigdepths/nextflow.config b/tests/modules/metabat2/jgisummarizebamcontigdepths/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/metabat2/jgisummarizebamcontigdepths/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/metabat2/jgisummarizebamcontigdepths/test.yml b/tests/modules/metabat2/jgisummarizebamcontigdepths/test.yml new file mode 100644 index 00000000..86c49d26 --- /dev/null +++ b/tests/modules/metabat2/jgisummarizebamcontigdepths/test.yml @@ -0,0 +1,8 @@ +- name: metabat2 jgisummarizebamcontigdepths test_metabat2_jgisummarizebamcontigdepths + command: nextflow run ./tests/modules/metabat2/jgisummarizebamcontigdepths -entry test_metabat2_jgisummarizebamcontigdepths -c ./tests/config/nextflow.config -c ./tests/modules/metabat2/jgisummarizebamcontigdepths/nextflow.config + tags: + - metabat2/jgisummarizebamcontigdepths + - metabat2 + files: + - path: output/metabat2/test.txt.gz + md5sum: 8f735aa408d6c90e5a0310e06ace7a9a diff --git a/tests/modules/metabat2/metabat2/main.nf b/tests/modules/metabat2/metabat2/main.nf new file mode 100644 index 00000000..0179e4c3 --- /dev/null +++ b/tests/modules/metabat2/metabat2/main.nf @@ -0,0 +1,35 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { METABAT2_METABAT2 } from '../../../../modules/metabat2/metabat2/main.nf' +include { METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS } from '../../../../modules/metabat2/jgisummarizebamcontigdepths/main.nf' + +workflow test_metabat2_no_depth { + + input_depth = [ [ 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) ] + + Channel.fromPath(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + .map { it -> [[ id:'test', single_end:false ], it, []] } + .set { input_metabat2 } + + METABAT2_METABAT2 ( input_metabat2 ) +} + +workflow test_metabat2_depth { + + input_depth = [ [ 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) ] + + METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS ( input_depth ) + + Channel.fromPath(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + .map { it -> [[ id:'test', single_end:false ], it] } + .join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) + .set { input_metabat2 } + + METABAT2_METABAT2 ( input_metabat2 ) +} diff --git a/tests/modules/metabat2/metabat2/nextflow.config b/tests/modules/metabat2/metabat2/nextflow.config new file mode 100644 index 00000000..83754d8b --- /dev/null +++ b/tests/modules/metabat2/metabat2/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: METABAT2_METABAT2 { + ext.args = '--minContig 1500 --minCV 0.1 --minCVSum 0.1 --minClsSize 10 --minS 2' + } + +} diff --git a/tests/modules/metabat2/metabat2/test.yml b/tests/modules/metabat2/metabat2/test.yml new file mode 100644 index 00000000..9389295e --- /dev/null +++ b/tests/modules/metabat2/metabat2/test.yml @@ -0,0 +1,24 @@ +- name: metabat2 metabat2 test_metabat2_no_depth + command: nextflow run tests/modules/metabat2/metabat2 -entry test_metabat2_no_depth -c tests/config/nextflow.config + tags: + - metabat2 + - metabat2/metabat2 + files: + - path: output/metabat2/bins/test.1.fa.gz + md5sum: 0e9bce5b5a0033fd4411a21dec881170 + - path: output/metabat2/test.tsv.gz + - path: output/metabat2/versions.yml + md5sum: 5742a71af36c3a748fd5726d76924ba8 + +- name: metabat2 metabat2 test_metabat2_depth + command: nextflow run tests/modules/metabat2/metabat2 -entry test_metabat2_depth -c tests/config/nextflow.config + tags: + - metabat2 + - metabat2/metabat2 + files: + - path: output/metabat2/bins/test.1.fa.gz + md5sum: 0e9bce5b5a0033fd4411a21dec881170 + - path: output/metabat2/test.tsv.gz + - path: output/metabat2/test.txt.gz + - path: output/metabat2/versions.yml + md5sum: 538c56b2df7d90580f05097218b5d5b1 diff --git a/tests/modules/metaphlan3/main.nf b/tests/modules/metaphlan3/main.nf index 2d855683..3354d2d9 100644 --- a/tests/modules/metaphlan3/main.nf +++ b/tests/modules/metaphlan3/main.nf @@ -2,9 +2,9 @@ nextflow.enable.dsl = 2 -include { UNTAR } from '../../../modules/untar/main.nf' addParams( options: [:] ) -include { SAMTOOLS_VIEW } from '../../../modules/samtools/view/main.nf' addParams( options: ['suffix': '.sam'] ) -include { METAPHLAN3 } from '../../../modules/metaphlan3/main.nf' addParams( options: [ 'args':'--index mpa_v30_CHOCOPhlAn_201901 --add_viruses --bt2_ps very-sensitive-local' ] ) +include { UNTAR } from '../../../modules/untar/main.nf' +include { SAMTOOLS_VIEW } from '../../../modules/samtools/view/main.nf' +include { METAPHLAN3 } from '../../../modules/metaphlan3/main.nf' workflow test_metaphlan3_single_end { @@ -42,7 +42,7 @@ workflow test_metaphlan3_sam { UNTAR ( db ) - SAMTOOLS_VIEW ( input ) + SAMTOOLS_VIEW ( input, [] ) METAPHLAN3 ( SAMTOOLS_VIEW.out.bam, UNTAR.out.untar ) } diff --git a/tests/modules/metaphlan3/nextflow.config b/tests/modules/metaphlan3/nextflow.config new file mode 100644 index 00000000..a47b46e0 --- /dev/null +++ b/tests/modules/metaphlan3/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SAMTOOLS_VIEW { + ext.prefix = { "${meta.id}.sam" } + } + + withName: METAPHLAN3 { + ext.args = '--index mpa_v30_CHOCOPhlAn_201901 --add_viruses --bt2_ps very-sensitive-local' + } + +} diff --git a/tests/modules/metaphlan3/test.yml b/tests/modules/metaphlan3/test.yml index fbd5e70b..92e731d2 100644 --- a/tests/modules/metaphlan3/test.yml +++ b/tests/modules/metaphlan3/test.yml @@ -1,5 +1,5 @@ - name: metaphlan3 test_metaphlan3_single_end - command: nextflow run tests/modules/metaphlan3 -entry test_metaphlan3_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/metaphlan3 -entry test_metaphlan3_single_end -c ./tests/config/nextflow.config -c ./tests/modules/metaphlan3/nextflow.config tags: - metaphlan3 files: @@ -30,7 +30,7 @@ md5sum: 1ca16b905abf657b88ca2bc12e7ad404 - name: metaphlan3 test_metaphlan3_paired_end - command: nextflow run tests/modules/metaphlan3 -entry test_metaphlan3_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/metaphlan3 -entry test_metaphlan3_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/metaphlan3/nextflow.config tags: - metaphlan3 files: @@ -61,7 +61,7 @@ md5sum: 1ca16b905abf657b88ca2bc12e7ad404 - name: metaphlan3 test_metaphlan3_sam - command: nextflow run tests/modules/metaphlan3 -entry test_metaphlan3_sam -c tests/config/nextflow.config + command: nextflow run ./tests/modules/metaphlan3 -entry test_metaphlan3_sam -c ./tests/config/nextflow.config -c ./tests/modules/metaphlan3/nextflow.config tags: - metaphlan3 files: @@ -92,7 +92,7 @@ md5sum: 1ca16b905abf657b88ca2bc12e7ad404 - name: metaphlan3 test_metaphlan3_fasta - command: nextflow run tests/modules/metaphlan3 -entry test_metaphlan3_fasta -c tests/config/nextflow.config + command: nextflow run ./tests/modules/metaphlan3 -entry test_metaphlan3_fasta -c ./tests/config/nextflow.config -c ./tests/modules/metaphlan3/nextflow.config tags: - metaphlan3 files: diff --git a/tests/modules/methyldackel/extract/main.nf b/tests/modules/methyldackel/extract/main.nf index 40e87b0b..92f92308 100644 --- a/tests/modules/methyldackel/extract/main.nf +++ b/tests/modules/methyldackel/extract/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { METHYLDACKEL_EXTRACT } from '../../../../modules/methyldackel/extract/main.nf' addParams( options: [:] ) +include { METHYLDACKEL_EXTRACT } from '../../../../modules/methyldackel/extract/main.nf' workflow test_methyldackel_extract { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/methyldackel/extract/nextflow.config b/tests/modules/methyldackel/extract/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/methyldackel/extract/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/methyldackel/extract/test.yml b/tests/modules/methyldackel/extract/test.yml index e2494181..28f969f3 100644 --- a/tests/modules/methyldackel/extract/test.yml +++ b/tests/modules/methyldackel/extract/test.yml @@ -1,5 +1,5 @@ -- name: Run methyldackel extract test workflow - command: nextflow run ./tests/modules/methyldackel/extract -entry test_methyldackel_extract -c tests/config/nextflow.config +- name: methyldackel extract + command: nextflow run ./tests/modules/methyldackel/extract -entry test_methyldackel_extract -c ./tests/config/nextflow.config -c ./tests/modules/methyldackel/extract/nextflow.config tags: - methyldackel - methyldackel/extract diff --git a/tests/modules/methyldackel/mbias/main.nf b/tests/modules/methyldackel/mbias/main.nf index 318dd663..f304e22f 100644 --- a/tests/modules/methyldackel/mbias/main.nf +++ b/tests/modules/methyldackel/mbias/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { METHYLDACKEL_MBIAS } from '../../../../modules/methyldackel/mbias/main.nf' addParams( options: [:] ) +include { METHYLDACKEL_MBIAS } from '../../../../modules/methyldackel/mbias/main.nf' workflow test_methyldackel_mbias { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/methyldackel/mbias/nextflow.config b/tests/modules/methyldackel/mbias/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/methyldackel/mbias/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/methyldackel/mbias/test.yml b/tests/modules/methyldackel/mbias/test.yml index 37102aec..8bb23f24 100644 --- a/tests/modules/methyldackel/mbias/test.yml +++ b/tests/modules/methyldackel/mbias/test.yml @@ -1,5 +1,5 @@ -- name: Run methyldackel mbias test workflow - command: nextflow run ./tests/modules/methyldackel/mbias -entry test_methyldackel_mbias -c tests/config/nextflow.config +- name: methyldackel mbias + command: nextflow run ./tests/modules/methyldackel/mbias -entry test_methyldackel_mbias -c ./tests/config/nextflow.config -c ./tests/modules/methyldackel/mbias/nextflow.config tags: - methyldackel - methyldackel/mbias diff --git a/tests/modules/minia/main.nf b/tests/modules/minia/main.nf index e23f5cc4..5be4d17f 100644 --- a/tests/modules/minia/main.nf +++ b/tests/modules/minia/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { MINIA } from '../../../modules/minia/main.nf' addParams( options: [:] ) +include { MINIA } from '../../../modules/minia/main.nf' workflow test_minia { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/minia/nextflow.config b/tests/modules/minia/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/minia/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/minia/test.yml b/tests/modules/minia/test.yml index d4e84e52..78b84f37 100644 --- a/tests/modules/minia/test.yml +++ b/tests/modules/minia/test.yml @@ -1,5 +1,5 @@ -- name: Run tests for minia - test_minia - command: nextflow run tests/modules/minia -entry test_minia -c tests/config/nextflow.config +- name: minia + command: nextflow run ./tests/modules/minia -entry test_minia -c ./tests/config/nextflow.config -c ./tests/modules/minia/nextflow.config tags: - minia files: diff --git a/tests/modules/miniasm/main.nf b/tests/modules/miniasm/main.nf new file mode 100644 index 00000000..949660ac --- /dev/null +++ b/tests/modules/miniasm/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MINIASM } from '../../../modules/miniasm/main.nf' + +workflow test_miniasm { + + input = [ [ id:'test', single_end:true ], // meta map + file(params.test_data['bacteroides_fragilis']['nanopore']['test_fastq_gz'], checkIfExists: true), + file(params.test_data['bacteroides_fragilis']['nanopore']['overlap_paf'], checkIfExists: true) + ] + + MINIASM ( input ) +} diff --git a/tests/modules/miniasm/nextflow.config b/tests/modules/miniasm/nextflow.config new file mode 100644 index 00000000..23f0a8d0 --- /dev/null +++ b/tests/modules/miniasm/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: MINIASM { + ext.prefix = { "${meta.id}.assembly" } + } + +} diff --git a/tests/modules/miniasm/test.yml b/tests/modules/miniasm/test.yml new file mode 100644 index 00000000..0bdc350a --- /dev/null +++ b/tests/modules/miniasm/test.yml @@ -0,0 +1,9 @@ +- name: miniasm test_miniasm + command: nextflow run ./tests/modules/miniasm -entry test_miniasm -c ./tests/config/nextflow.config -c ./tests/modules/miniasm/nextflow.config + tags: + - miniasm + files: + - path: output/miniasm/test.assembly.gfa.gz + md5sum: c68e4c2b64338d1c0f5b79b32934da14 + - path: output/miniasm/test.assembly.fasta.gz + md5sum: d2f78ae618c02744e7a57bf4706ab8b4 diff --git a/tests/modules/minimap2/align/main.nf b/tests/modules/minimap2/align/main.nf index b4dbf5bd..e507d3e5 100644 --- a/tests/modules/minimap2/align/main.nf +++ b/tests/modules/minimap2/align/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { MINIMAP2_ALIGN } from '../../../../modules/minimap2/align/main.nf' addParams( options: [:] ) +include { MINIMAP2_ALIGN } from '../../../../modules/minimap2/align/main.nf' workflow test_minimap2_align_single_end { input = [ [ id:'test', single_end:true ], // meta map diff --git a/tests/modules/minimap2/align/nextflow.config b/tests/modules/minimap2/align/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/minimap2/align/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/minimap2/align/test.yml b/tests/modules/minimap2/align/test.yml index 484fa9f7..598a5d25 100644 --- a/tests/modules/minimap2/align/test.yml +++ b/tests/modules/minimap2/align/test.yml @@ -1,17 +1,17 @@ - name: minimap2 align single-end - command: nextflow run ./tests/modules/minimap2/align -entry test_minimap2_align_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/minimap2/align -entry test_minimap2_align_single_end -c ./tests/config/nextflow.config -c ./tests/modules/minimap2/align/nextflow.config tags: - minimap2 - minimap2/align files: - path: ./output/minimap2/test.paf - md5sum: 5a9648fc67c30a2c83b0ef094171faa0 + md5sum: 70e8cf299ee3ecd33e629d10c1f588ce - name: minimap2 align paired-end - command: nextflow run ./tests/modules/minimap2/align -entry test_minimap2_align_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/minimap2/align -entry test_minimap2_align_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/minimap2/align/nextflow.config tags: - minimap2 - minimap2/align files: - path: ./output/minimap2/test.paf - md5sum: e7b952be872bdbef16bf99d512690df7 + md5sum: 5e7b55a26bf0ea3a2843423d3e0b9a28 \ No newline at end of file diff --git a/tests/modules/minimap2/index/main.nf b/tests/modules/minimap2/index/main.nf index 39aa93e0..a69efa85 100644 --- a/tests/modules/minimap2/index/main.nf +++ b/tests/modules/minimap2/index/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { MINIMAP2_INDEX } from '../../../../modules/minimap2/index/main.nf' addParams( options: [:] ) +include { MINIMAP2_INDEX } from '../../../../modules/minimap2/index/main.nf' workflow test_minimap2_index { diff --git a/tests/modules/minimap2/index/nextflow.config b/tests/modules/minimap2/index/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/minimap2/index/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/minimap2/index/test.yml b/tests/modules/minimap2/index/test.yml index 7a3cc8fa..95700452 100644 --- a/tests/modules/minimap2/index/test.yml +++ b/tests/modules/minimap2/index/test.yml @@ -1,5 +1,5 @@ - name: minimap2 index - command: nextflow run ./tests/modules/minimap2/index -entry test_minimap2_index -c tests/config/nextflow.config + command: nextflow run ./tests/modules/minimap2/index -entry test_minimap2_index -c ./tests/config/nextflow.config -c ./tests/modules/minimap2/index/nextflow.config tags: - minimap2 - minimap2/index diff --git a/tests/modules/mlst/main.nf b/tests/modules/mlst/main.nf new file mode 100644 index 00000000..f84ec622 --- /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' + +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/nextflow.config b/tests/modules/mlst/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/mlst/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/mlst/test.yml b/tests/modules/mlst/test.yml new file mode 100644 index 00000000..53eacc5a --- /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 -c ./tests/modules/mlst/nextflow.config + tags: + - mlst + files: + - path: output/mlst/test.tsv + md5sum: b52df6178834a156c9402012718eb65e diff --git a/tests/modules/mosdepth/main.nf b/tests/modules/mosdepth/main.nf index c4d8e9c4..8862204d 100644 --- a/tests/modules/mosdepth/main.nf +++ b/tests/modules/mosdepth/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' addParams( options: [:] ) +include { MOSDEPTH } from '../../../modules/mosdepth/main.nf' workflow test_mosdepth { input = [ [ id:'test', single_end:true ], diff --git a/tests/modules/mosdepth/nextflow.config b/tests/modules/mosdepth/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/mosdepth/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/mosdepth/test.yml b/tests/modules/mosdepth/test.yml index f5ab5608..e264ef3b 100644 --- a/tests/modules/mosdepth/test.yml +++ b/tests/modules/mosdepth/test.yml @@ -1,5 +1,5 @@ - name: mosdepth - command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth -c tests/config/nextflow.config + command: nextflow run ./tests/modules/mosdepth -entry test_mosdepth -c ./tests/config/nextflow.config -c ./tests/modules/mosdepth/nextflow.config tags: - mosdepth files: diff --git a/tests/modules/msisensor/msi/main.nf b/tests/modules/msisensor/msi/main.nf index f8ce4187..259ec887 100644 --- a/tests/modules/msisensor/msi/main.nf +++ b/tests/modules/msisensor/msi/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { MSISENSOR_SCAN } from '../../../../modules/msisensor/scan/main.nf' addParams( options: [:] ) -include { MSISENSOR_MSI } from '../../../../modules/msisensor/msi/main.nf' addParams( options: [:] ) +include { MSISENSOR_SCAN } from '../../../../modules/msisensor/scan/main.nf' +include { MSISENSOR_MSI } from '../../../../modules/msisensor/msi/main.nf' workflow test_msisensor_msi { diff --git a/tests/modules/msisensor/msi/nextflow.config b/tests/modules/msisensor/msi/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/msisensor/msi/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/msisensor/msi/test.yml b/tests/modules/msisensor/msi/test.yml index 1fc74ad3..0d0da1ee 100644 --- a/tests/modules/msisensor/msi/test.yml +++ b/tests/modules/msisensor/msi/test.yml @@ -1,5 +1,5 @@ - name: msisensor msi - command: nextflow run ./tests/modules/msisensor/msi -entry test_msisensor_msi -c tests/config/nextflow.config + command: nextflow run ./tests/modules/msisensor/msi -entry test_msisensor_msi -c ./tests/config/nextflow.config -c ./tests/modules/msisensor/msi/nextflow.config tags: - msisensor - msisensor/msi diff --git a/tests/modules/msisensor/scan/main.nf b/tests/modules/msisensor/scan/main.nf index 2303d0b9..de46dd9b 100644 --- a/tests/modules/msisensor/scan/main.nf +++ b/tests/modules/msisensor/scan/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { MSISENSOR_SCAN } from '../../../../modules/msisensor/scan/main.nf' addParams( options: [:] ) +include { MSISENSOR_SCAN } from '../../../../modules/msisensor/scan/main.nf' workflow test_msisensor_scan { diff --git a/tests/modules/msisensor/scan/nextflow.config b/tests/modules/msisensor/scan/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/msisensor/scan/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/msisensor/scan/test.yml b/tests/modules/msisensor/scan/test.yml index 0d28c5a2..9e697a59 100644 --- a/tests/modules/msisensor/scan/test.yml +++ b/tests/modules/msisensor/scan/test.yml @@ -1,5 +1,5 @@ - name: msisensor scan - command: nextflow run ./tests/modules/msisensor/scan -entry test_msisensor_scan -c tests/config/nextflow.config + command: nextflow run ./tests/modules/msisensor/scan -entry test_msisensor_scan -c ./tests/config/nextflow.config -c ./tests/modules/msisensor/scan/nextflow.config tags: - msisensor - msisensor/scan diff --git a/tests/modules/mtnucratio/main.nf b/tests/modules/mtnucratio/main.nf new file mode 100644 index 00000000..6d6f5e1d --- /dev/null +++ b/tests/modules/mtnucratio/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MTNUCRATIO } from '../../../modules/mtnucratio/main.nf' + +workflow test_mtnucratio { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true)] + mt_id = 'mt_id' + + MTNUCRATIO ( input, mt_id ) +} diff --git a/tests/modules/mtnucratio/nextflow.config b/tests/modules/mtnucratio/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/mtnucratio/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/mtnucratio/test.yml b/tests/modules/mtnucratio/test.yml new file mode 100644 index 00000000..24dc3d16 --- /dev/null +++ b/tests/modules/mtnucratio/test.yml @@ -0,0 +1,9 @@ +- name: mtnucratio + command: nextflow run ./tests/modules/mtnucratio -entry test_mtnucratio -c ./tests/config/nextflow.config -c ./tests/modules/mtnucratio/nextflow.config + tags: + - mtnucratio + files: + - path: output/mtnucratio/test.single_end.sorted.bam.mtnucratio + md5sum: 19e96849802c70aa0694785f716274b7 + - path: output/mtnucratio/test.single_end.sorted.bam.mtnucratiomtnuc.json + md5sum: 14d24be6272854d6762f0dfad5918ef6 diff --git a/tests/modules/multiqc/main.nf b/tests/modules/multiqc/main.nf index ddabb43a..43643985 100644 --- a/tests/modules/multiqc/main.nf +++ b/tests/modules/multiqc/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { FASTQC } from '../../../modules/fastqc/main.nf' addParams( options: [:] ) -include { MULTIQC } from '../../../modules/multiqc/main.nf' addParams( options: [:] ) +include { FASTQC } from '../../../modules/fastqc/main.nf' +include { MULTIQC } from '../../../modules/multiqc/main.nf' workflow test_multiqc { input = [ [ id: 'test', single_end: false ], diff --git a/tests/modules/multiqc/nextflow.config b/tests/modules/multiqc/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/multiqc/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/multiqc/test.yml b/tests/modules/multiqc/test.yml index 69ded5d5..39796872 100644 --- a/tests/modules/multiqc/test.yml +++ b/tests/modules/multiqc/test.yml @@ -1,5 +1,5 @@ - name: multiqc - command: nextflow run ./tests/modules/multiqc -entry test_multiqc -c tests/config/nextflow.config + command: nextflow run ./tests/modules/multiqc -entry test_multiqc -c ./tests/config/nextflow.config -c ./tests/modules/multiqc/nextflow.config tags: - multiqc files: diff --git a/tests/modules/mummer/main.nf b/tests/modules/mummer/main.nf new file mode 100644 index 00000000..30c8c4b8 --- /dev/null +++ b/tests/modules/mummer/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MUMMER } from '../../../modules/mummer/main.nf' + +workflow test_mummer { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] + + MUMMER ( input ) +} diff --git a/tests/modules/mummer/nextflow.config b/tests/modules/mummer/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/mummer/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/mummer/test.yml b/tests/modules/mummer/test.yml new file mode 100644 index 00000000..359fd4ad --- /dev/null +++ b/tests/modules/mummer/test.yml @@ -0,0 +1,7 @@ +- name: mummer test_mummer + command: nextflow run ./tests/modules/mummer -entry test_mummer -c ./tests/config/nextflow.config -c ./tests/modules/mummer/nextflow.config + tags: + - mummer + files: + - path: output/mummer/test.coords + md5sum: 6084fe43c7cb2eca8b96d674560bdefc diff --git a/tests/modules/muscle/main.nf b/tests/modules/muscle/main.nf index 81a71761..a6294519 100644 --- a/tests/modules/muscle/main.nf +++ b/tests/modules/muscle/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { MUSCLE } from '../../../modules/muscle/main.nf' addParams( options: ['args': '-fasta -verbose -phys -phyi -maxiters 2']) -include { MUSCLE as MUSCLE_TREE } from '../../../modules/muscle/main.nf' addParams( options: ['args': '-maketree']) +include { MUSCLE } from '../../../modules/muscle/main.nf' +include { MUSCLE as MUSCLE_TREE } from '../../../modules/muscle/main.nf' workflow test_muscle { diff --git a/tests/modules/muscle/nextflow.config b/tests/modules/muscle/nextflow.config new file mode 100644 index 00000000..31331b0f --- /dev/null +++ b/tests/modules/muscle/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: MUSCLE { + ext.args = '-fasta -verbose -phys -phyi -maxiters 2' + } + + withName: MUSCLE_TREE { + ext.args = '-maketree' + } + +} diff --git a/tests/modules/muscle/test.yml b/tests/modules/muscle/test.yml index 7f9d2a54..6995d71d 100644 --- a/tests/modules/muscle/test.yml +++ b/tests/modules/muscle/test.yml @@ -1,5 +1,5 @@ - name: muscle test_muscle - command: nextflow run tests/modules/muscle -entry test_muscle -c tests/config/nextflow.config + command: nextflow run ./tests/modules/muscle -entry test_muscle -c ./tests/config/nextflow.config -c ./tests/modules/muscle/nextflow.config tags: - muscle files: diff --git a/tests/modules/nanolyse/main.nf b/tests/modules/nanolyse/main.nf index 97941a6d..91013cd0 100644 --- a/tests/modules/nanolyse/main.nf +++ b/tests/modules/nanolyse/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { NANOLYSE } from '../../../modules/nanolyse/main.nf' addParams( options: [suffix: '.clean'] ) +include { NANOLYSE } from '../../../modules/nanolyse/main.nf' workflow test_nanolyse { input = [ diff --git a/tests/modules/nanolyse/nextflow.config b/tests/modules/nanolyse/nextflow.config new file mode 100644 index 00000000..5f7b5bed --- /dev/null +++ b/tests/modules/nanolyse/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: NANOLYSE { + ext.prefix = { "${meta.id}.clean" } + } + +} diff --git a/tests/modules/nanolyse/test.yml b/tests/modules/nanolyse/test.yml index 4938fe57..5af2e65e 100644 --- a/tests/modules/nanolyse/test.yml +++ b/tests/modules/nanolyse/test.yml @@ -1,5 +1,5 @@ - name: nanolyse - command: nextflow run ./tests/modules/nanolyse -entry test_nanolyse -c tests/config/nextflow.config + command: nextflow run ./tests/modules/nanolyse -entry test_nanolyse -c ./tests/config/nextflow.config -c ./tests/modules/nanolyse/nextflow.config tags: - nanolyse files: diff --git a/tests/modules/nanoplot/main.nf b/tests/modules/nanoplot/main.nf index a483f5e2..04c923c2 100644 --- a/tests/modules/nanoplot/main.nf +++ b/tests/modules/nanoplot/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { NANOPLOT } from '../../../modules/nanoplot/main.nf' addParams( options: [:] ) +include { NANOPLOT } from '../../../modules/nanoplot/main.nf' workflow test_nanoplot_summary { def input = [] diff --git a/tests/modules/nanoplot/nextflow.config b/tests/modules/nanoplot/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/nanoplot/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/nanoplot/test.yml b/tests/modules/nanoplot/test.yml index 475b90c9..6549953e 100644 --- a/tests/modules/nanoplot/test.yml +++ b/tests/modules/nanoplot/test.yml @@ -1,6 +1,6 @@ - name: nanoplot_summary - command: nextflow run ./tests/modules/nanoplot -entry test_nanoplot_summary -c tests/config/nextflow.config + command: nextflow run ./tests/modules/nanoplot -entry test_nanoplot_summary -c ./tests/config/nextflow.config -c ./tests/modules/nanoplot/nextflow.config tags: - nanoplot files: @@ -8,7 +8,7 @@ contains: - "report" - name: nanoplot_fastq - command: nextflow run ./tests/modules/nanoplot -entry test_nanoplot_fastq -c tests/config/nextflow.config + command: nextflow run ./tests/modules/nanoplot -entry test_nanoplot_fastq -c ./tests/config/nextflow.config -c ./tests/modules/nanoplot/nextflow.config tags: - nanoplot files: diff --git a/tests/modules/ncbigenomedownload/main.nf b/tests/modules/ncbigenomedownload/main.nf new file mode 100644 index 00000000..2447b97c --- /dev/null +++ b/tests/modules/ncbigenomedownload/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { NCBIGENOMEDOWNLOAD } from '../../../modules/ncbigenomedownload/main.nf' + +workflow test_ncbigenomedownload { + + input = [ [ id:'test', single_end:false ] ] + + accessions = [] + + NCBIGENOMEDOWNLOAD ( input, accessions) +} + + diff --git a/tests/modules/ncbigenomedownload/nextflow.config b/tests/modules/ncbigenomedownload/nextflow.config new file mode 100644 index 00000000..7e6ccf70 --- /dev/null +++ b/tests/modules/ncbigenomedownload/nextflow.config @@ -0,0 +1,8 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: NCBIGENOMEDOWNLOAD { + ext.args = '-A GCF_000013425.1 --formats genbank,fasta,assembly-stats bacteria' + } +} diff --git a/tests/modules/ncbigenomedownload/test.yml b/tests/modules/ncbigenomedownload/test.yml new file mode 100644 index 00000000..8765e04f --- /dev/null +++ b/tests/modules/ncbigenomedownload/test.yml @@ -0,0 +1,11 @@ +- name: ncbigenomedownload test_ncbigenomedownload + command: nextflow run ./tests/modules/ncbigenomedownload -entry test_ncbigenomedownload -c ./tests/config/nextflow.config -c ./tests/modules/ncbigenomedownload/nextflow.config + tags: + - ncbigenomedownload + files: + - path: output/ncbigenomedownload/GCF_000013425.1_ASM1342v1_assembly_stats.txt + md5sum: f78c6a373130e50fac5472962a5fdf44 + - path: output/ncbigenomedownload/GCF_000013425.1_ASM1342v1_genomic.fna.gz + md5sum: b086eb1020e7df022afa545dc6d93297 + - path: output/ncbigenomedownload/GCF_000013425.1_ASM1342v1_genomic.gbff.gz + md5sum: ae2da70e32c783858e6c60c72e9eeb7a diff --git a/tests/modules/nextclade/main.nf b/tests/modules/nextclade/main.nf index fe8f72c9..15750990 100755 --- a/tests/modules/nextclade/main.nf +++ b/tests/modules/nextclade/main.nf @@ -2,32 +2,13 @@ nextflow.enable.dsl = 2 -include { NEXTCLADE } from '../../../modules/nextclade/main.nf' addParams( options: [:] ) +include { NEXTCLADE } from '../../../modules/nextclade/main.nf' -workflow test_nextclade_json { - input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - NEXTCLADE ( input, 'json' ) -} - -workflow test_nextclade_csv { - input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - NEXTCLADE ( input, 'csv' ) -} - -workflow test_nextclade_tsv { - input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - NEXTCLADE ( input, 'tsv' ) -} - -workflow test_nextclade_tree { - input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - NEXTCLADE ( input, 'tree' ) +workflow test_nextclade { + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + + NEXTCLADE ( input ) } diff --git a/tests/modules/nextclade/nextflow.config b/tests/modules/nextclade/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/nextclade/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/nextclade/test.yml b/tests/modules/nextclade/test.yml index 9826dbad..36218aad 100755 --- a/tests/modules/nextclade/test.yml +++ b/tests/modules/nextclade/test.yml @@ -1,31 +1,13 @@ -- name: nextclade test_nextclade_json - command: nextflow run tests/modules/nextclade -entry test_nextclade_json -c tests/config/nextflow.config +- name: nextclade test_nextclade + command: nextflow run ./tests/modules/nextclade -entry test_nextclade -c ./tests/config/nextflow.config -c ./tests/modules/nextclade/nextflow.config tags: - nextclade files: - path: output/nextclade/test.json md5sum: cab92830c5cb66076e7d6c054ea98362 - -- name: nextclade test_nextclade_csv - command: nextflow run tests/modules/nextclade -entry test_nextclade_csv -c tests/config/nextflow.config - tags: - - nextclade - files: - path: output/nextclade/test.csv md5sum: 4f7096df9be51f99a0d62a38653b29cf - -- name: nextclade test_nextclade_tsv - command: nextflow run tests/modules/nextclade -entry test_nextclade_tsv -c tests/config/nextflow.config - tags: - - nextclade - files: - path: output/nextclade/test.tsv md5sum: fe07dc4ffcd81742ca9bef93f88e8836 - -- name: nextclade test_nextclade_tree - command: nextflow run tests/modules/nextclade -entry test_nextclade_tree -c tests/config/nextflow.config - tags: - - nextclade - files: - path: output/nextclade/test.tree.json md5sum: 5c57dd724bc2b5cfde8f42a17ff2865a diff --git a/tests/modules/ngmaster/main.nf b/tests/modules/ngmaster/main.nf new file mode 100644 index 00000000..b23530bc --- /dev/null +++ b/tests/modules/ngmaster/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { NGMASTER } from '../../../modules/ngmaster/main.nf' + +workflow test_ngmaster { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + NGMASTER ( input ) +} diff --git a/tests/modules/ngmaster/nextflow.config b/tests/modules/ngmaster/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/ngmaster/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/ngmaster/test.yml b/tests/modules/ngmaster/test.yml new file mode 100644 index 00000000..fb8dec82 --- /dev/null +++ b/tests/modules/ngmaster/test.yml @@ -0,0 +1,7 @@ +- name: ngmaster test_ngmaster + command: nextflow run ./tests/modules/ngmaster -entry test_ngmaster -c ./tests/config/nextflow.config -c ./tests/modules/ngmaster/nextflow.config + tags: + - ngmaster + files: + - path: output/ngmaster/test.tsv + md5sum: cf674474eaf8ac6abfcebce0af0226cf diff --git a/tests/modules/nucmer/main.nf b/tests/modules/nucmer/main.nf new file mode 100644 index 00000000..98e74b07 --- /dev/null +++ b/tests/modules/nucmer/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { NUCMER } from '../../../modules/nucmer/main.nf' + +workflow test_nucmer { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) ] + + NUCMER ( input ) +} diff --git a/tests/modules/nucmer/nextflow.config b/tests/modules/nucmer/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/nucmer/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/nucmer/test.yml b/tests/modules/nucmer/test.yml new file mode 100644 index 00000000..62caced4 --- /dev/null +++ b/tests/modules/nucmer/test.yml @@ -0,0 +1,9 @@ +- name: nucmer test_nucmer + command: nextflow run ./tests/modules/nucmer -entry test_nucmer -c ./tests/config/nextflow.config -c ./tests/modules/nucmer/nextflow.config + tags: + - nucmer + files: + - path: output/nucmer/test.coords + contains: ['MT192765.1'] + - path: output/nucmer/test.delta + contains: ['MT192765.1'] diff --git a/tests/modules/optitype/main.nf b/tests/modules/optitype/main.nf index 7d740473..55b46f0a 100644 --- a/tests/modules/optitype/main.nf +++ b/tests/modules/optitype/main.nf @@ -2,12 +2,12 @@ nextflow.enable.dsl = 2 -include { OPTITYPE } from '../../../modules/optitype/main.nf' addParams( options: ['args':'-e 1 -b 0.009', 'args2':'solver=glpk'] ) +include { OPTITYPE } from '../../../modules/optitype/main.nf' workflow test_optitype { input = [ [ id:'test', seq_type:'dna' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_bam'], checkIfExists: true) + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_hla'], checkIfExists: true) ] - + OPTITYPE ( input ) } diff --git a/tests/modules/optitype/nextflow.config b/tests/modules/optitype/nextflow.config new file mode 100644 index 00000000..14ad9e3f --- /dev/null +++ b/tests/modules/optitype/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: OPTITYPE { + ext.args = '-e 1 -b 0.009' + ext.args2 = 'solver=glpk' + } + +} diff --git a/tests/modules/optitype/test.yml b/tests/modules/optitype/test.yml index 5ee5a067..7c2ff0d0 100644 --- a/tests/modules/optitype/test.yml +++ b/tests/modules/optitype/test.yml @@ -1,7 +1,9 @@ - name: optitype test_optitype - command: nextflow run tests/modules/optitype -entry test_optitype -c tests/config/nextflow.config + command: nextflow run ./tests/modules/optitype -entry test_optitype -c ./tests/config/nextflow.config -c ./tests/modules/optitype/nextflow.config tags: - optitype files: - - path: output/optitype/test/test_result.tsv - path: output/optitype/test/test_coverage_plot.pdf + - path: output/optitype/test/test_result.tsv + contains: + - '1446' diff --git a/tests/modules/pairix/main.nf b/tests/modules/pairix/main.nf index f1e2a44a..474bacbb 100644 --- a/tests/modules/pairix/main.nf +++ b/tests/modules/pairix/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PAIRIX } from '../../../modules/pairix/main.nf' addParams( options: [:] ) +include { PAIRIX } from '../../../modules/pairix/main.nf' workflow test_pairix { diff --git a/tests/modules/pairix/nextflow.config b/tests/modules/pairix/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/pairix/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/pairix/test.yml b/tests/modules/pairix/test.yml index 304a94b3..4cd9d37d 100644 --- a/tests/modules/pairix/test.yml +++ b/tests/modules/pairix/test.yml @@ -1,5 +1,5 @@ - name: pairix test_pairix - command: nextflow run tests/modules/pairix -entry test_pairix -c tests/config/nextflow.config + command: nextflow run ./tests/modules/pairix -entry test_pairix -c ./tests/config/nextflow.config -c ./tests/modules/pairix/nextflow.config tags: - pairix files: diff --git a/tests/modules/pairtools/dedup/main.nf b/tests/modules/pairtools/dedup/main.nf index 2c10c85b..28121526 100644 --- a/tests/modules/pairtools/dedup/main.nf +++ b/tests/modules/pairtools/dedup/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PAIRTOOLS_DEDUP } from '../../../../modules/pairtools/dedup/main.nf' addParams( options: ['suffix':'.dedup'] ) +include { PAIRTOOLS_DEDUP } from '../../../../modules/pairtools/dedup/main.nf' workflow test_pairtools_dedup { diff --git a/tests/modules/pairtools/dedup/nextflow.config b/tests/modules/pairtools/dedup/nextflow.config new file mode 100644 index 00000000..b47fab16 --- /dev/null +++ b/tests/modules/pairtools/dedup/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PAIRTOOLS_DEDUP { + ext.prefix = { "${meta.id}.dedup" } + } + +} diff --git a/tests/modules/pairtools/dedup/test.yml b/tests/modules/pairtools/dedup/test.yml index 25fc51f7..6d7f99f4 100644 --- a/tests/modules/pairtools/dedup/test.yml +++ b/tests/modules/pairtools/dedup/test.yml @@ -1,5 +1,5 @@ - name: pairtools dedup test_pairtools_dedup - command: nextflow run tests/modules/pairtools/dedup -entry test_pairtools_dedup -c tests/config/nextflow.config + command: nextflow run ./tests/modules/pairtools/dedup -entry test_pairtools_dedup -c ./tests/config/nextflow.config -c ./tests/modules/pairtools/dedup/nextflow.config tags: - pairtools/dedup - pairtools diff --git a/tests/modules/pairtools/flip/main.nf b/tests/modules/pairtools/flip/main.nf index ed980102..e4d740e2 100644 --- a/tests/modules/pairtools/flip/main.nf +++ b/tests/modules/pairtools/flip/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PAIRTOOLS_FLIP } from '../../../../modules/pairtools/flip/main.nf' addParams( options: [:] ) +include { PAIRTOOLS_FLIP } from '../../../../modules/pairtools/flip/main.nf' workflow test_pairtools_flip { diff --git a/tests/modules/pairtools/flip/nextflow.config b/tests/modules/pairtools/flip/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/pairtools/flip/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/pairtools/flip/test.yml b/tests/modules/pairtools/flip/test.yml index eeef6530..cec54976 100644 --- a/tests/modules/pairtools/flip/test.yml +++ b/tests/modules/pairtools/flip/test.yml @@ -1,5 +1,5 @@ - name: pairtools flip test_pairtools_flip - command: nextflow run tests/modules/pairtools/flip -entry test_pairtools_flip -c tests/config/nextflow.config + command: nextflow run ./tests/modules/pairtools/flip -entry test_pairtools_flip -c ./tests/config/nextflow.config -c ./tests/modules/pairtools/flip/nextflow.config tags: - pairtools/flip - pairtools diff --git a/tests/modules/pairtools/parse/main.nf b/tests/modules/pairtools/parse/main.nf index 26ceaa4f..f006fd6a 100644 --- a/tests/modules/pairtools/parse/main.nf +++ b/tests/modules/pairtools/parse/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PAIRTOOLS_PARSE } from '../../../../modules/pairtools/parse/main.nf' addParams( options: ['suffix':'.raw'] ) +include { PAIRTOOLS_PARSE } from '../../../../modules/pairtools/parse/main.nf' workflow test_pairtools_parse { diff --git a/tests/modules/pairtools/parse/nextflow.config b/tests/modules/pairtools/parse/nextflow.config new file mode 100644 index 00000000..a5d3ef9d --- /dev/null +++ b/tests/modules/pairtools/parse/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PAIRTOOLS_PARSE { + ext.prefix = { "${meta.id}.raw" } + } + +} diff --git a/tests/modules/pairtools/parse/test.yml b/tests/modules/pairtools/parse/test.yml index e5d18e01..cf01038c 100644 --- a/tests/modules/pairtools/parse/test.yml +++ b/tests/modules/pairtools/parse/test.yml @@ -1,5 +1,5 @@ - name: pairtools parse test_pairtools_parse - command: nextflow run tests/modules/pairtools/parse -entry test_pairtools_parse -c tests/config/nextflow.config + command: nextflow run ./tests/modules/pairtools/parse -entry test_pairtools_parse -c ./tests/config/nextflow.config -c ./tests/modules/pairtools/parse/nextflow.config tags: - pairtools - pairtools/parse diff --git a/tests/modules/pairtools/restrict/main.nf b/tests/modules/pairtools/restrict/main.nf index f785ed88..ae7e328b 100644 --- a/tests/modules/pairtools/restrict/main.nf +++ b/tests/modules/pairtools/restrict/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PAIRTOOLS_RESTRICT } from '../../../../modules/pairtools/restrict/main.nf' addParams( options: ['suffix':'.restrict'] ) +include { PAIRTOOLS_RESTRICT } from '../../../../modules/pairtools/restrict/main.nf' workflow test_pairtools_restrict { diff --git a/tests/modules/pairtools/restrict/nextflow.config b/tests/modules/pairtools/restrict/nextflow.config new file mode 100644 index 00000000..fa8217bc --- /dev/null +++ b/tests/modules/pairtools/restrict/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PAIRTOOLS_RESTRICT { + ext.prefix = { "${meta.id}.restrict" } + } + +} diff --git a/tests/modules/pairtools/restrict/test.yml b/tests/modules/pairtools/restrict/test.yml index afc64930..484b3739 100644 --- a/tests/modules/pairtools/restrict/test.yml +++ b/tests/modules/pairtools/restrict/test.yml @@ -1,5 +1,5 @@ - name: pairtools restrict test_pairtools_restrict - command: nextflow run tests/modules/pairtools/restrict -entry test_pairtools_restrict -c tests/config/nextflow.config + command: nextflow run ./tests/modules/pairtools/restrict -entry test_pairtools_restrict -c ./tests/config/nextflow.config -c ./tests/modules/pairtools/restrict/nextflow.config tags: - pairtools/restrict - pairtools diff --git a/tests/modules/pairtools/select/main.nf b/tests/modules/pairtools/select/main.nf index 2efd29c7..ff65cd95 100644 --- a/tests/modules/pairtools/select/main.nf +++ b/tests/modules/pairtools/select/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PAIRTOOLS_SELECT } from '../../../../modules/pairtools/select/main.nf' addParams( options: [args:"(pair_type == 'RU') or (pair_type == 'UR') or (pair_type == 'UU')"] ) +include { PAIRTOOLS_SELECT } from '../../../../modules/pairtools/select/main.nf' workflow test_pairtools_select { diff --git a/tests/modules/pairtools/select/nextflow.config b/tests/modules/pairtools/select/nextflow.config new file mode 100644 index 00000000..df33cd2e --- /dev/null +++ b/tests/modules/pairtools/select/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PAIRTOOLS_SELECT { + ext.args = "(pair_type == \'RU\') or (pair_type == \'UR\') or (pair_type == \'UU\')" + } + +} diff --git a/tests/modules/pairtools/select/test.yml b/tests/modules/pairtools/select/test.yml index adeb50c3..431e8366 100644 --- a/tests/modules/pairtools/select/test.yml +++ b/tests/modules/pairtools/select/test.yml @@ -1,5 +1,5 @@ - name: pairtools select test_pairtools_select - command: nextflow run tests/modules/pairtools/select -entry test_pairtools_select -c tests/config/nextflow.config + command: nextflow run ./tests/modules/pairtools/select -entry test_pairtools_select -c ./tests/config/nextflow.config -c ./tests/modules/pairtools/select/nextflow.config tags: - pairtools/select - pairtools diff --git a/tests/modules/pairtools/sort/main.nf b/tests/modules/pairtools/sort/main.nf index dfb505e0..0e484c76 100644 --- a/tests/modules/pairtools/sort/main.nf +++ b/tests/modules/pairtools/sort/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PAIRTOOLS_SORT } from '../../../../modules/pairtools/sort/main.nf' addParams( options: ['suffix':'.sorted'] ) +include { PAIRTOOLS_SORT } from '../../../../modules/pairtools/sort/main.nf' workflow test_pairtools_sort { diff --git a/tests/modules/pairtools/sort/nextflow.config b/tests/modules/pairtools/sort/nextflow.config new file mode 100644 index 00000000..dfaf6053 --- /dev/null +++ b/tests/modules/pairtools/sort/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PAIRTOOLS_SORT { + ext.prefix = { "${meta.id}.sorted" } + } + +} diff --git a/tests/modules/pairtools/sort/test.yml b/tests/modules/pairtools/sort/test.yml index 9eea74a0..4d4866aa 100644 --- a/tests/modules/pairtools/sort/test.yml +++ b/tests/modules/pairtools/sort/test.yml @@ -1,5 +1,5 @@ - name: pairtools sort test_pairtools_sort - command: nextflow run tests/modules/pairtools/sort -entry test_pairtools_sort -c tests/config/nextflow.config + command: nextflow run ./tests/modules/pairtools/sort -entry test_pairtools_sort -c ./tests/config/nextflow.config -c ./tests/modules/pairtools/sort/nextflow.config tags: - pairtools/sort - pairtools diff --git a/tests/modules/pangolin/main.nf b/tests/modules/pangolin/main.nf index b8130c5d..ab4aa4af 100644 --- a/tests/modules/pangolin/main.nf +++ b/tests/modules/pangolin/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PANGOLIN } from '../../../modules/pangolin/main.nf' addParams( options: [:] ) +include { PANGOLIN } from '../../../modules/pangolin/main.nf' workflow test_pangolin { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/pangolin/nextflow.config b/tests/modules/pangolin/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/pangolin/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/pangolin/test.yml b/tests/modules/pangolin/test.yml index debee708..c77e4912 100644 --- a/tests/modules/pangolin/test.yml +++ b/tests/modules/pangolin/test.yml @@ -1,7 +1,7 @@ - name: pangolin - command: nextflow run ./tests/modules/pangolin -entry test_pangolin -c ./tests/config/nextflow.config + command: nextflow run ./tests/modules/pangolin -entry test_pangolin -c ./tests/config/nextflow.config -c ./tests/modules/pangolin/nextflow.config tags: - pangolin files: - path: ./output/pangolin/test.pangolin.csv - md5sum: 02d916f18095694a7641ebc29fecaeae + md5sum: 4eaff46b5b11cd59fb44d4e8e7c4945e diff --git a/tests/modules/paraclu/main.nf b/tests/modules/paraclu/main.nf new file mode 100644 index 00000000..3bd75dc0 --- /dev/null +++ b/tests/modules/paraclu/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PARACLU } from '../../../modules/paraclu/main.nf' + +workflow test_paraclu { + + input = [[ id:'test' ], // meta map + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + min_cluster = 30 + + PARACLU ( input, min_cluster ) +} diff --git a/tests/modules/paraclu/nextflow.config b/tests/modules/paraclu/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/paraclu/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/paraclu/test.yml b/tests/modules/paraclu/test.yml new file mode 100644 index 00000000..36b37df5 --- /dev/null +++ b/tests/modules/paraclu/test.yml @@ -0,0 +1,7 @@ +- name: paraclu test_paraclu + command: nextflow run ./tests/modules/paraclu -entry test_paraclu -c ./tests/config/nextflow.config -c ./tests/modules/paraclu/nextflow.config + tags: + - paraclu + files: + - path: output/paraclu/test.clustered.simplified.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e diff --git a/tests/modules/pbbam/pbmerge/main.nf b/tests/modules/pbbam/pbmerge/main.nf new file mode 100644 index 00000000..34ed33a6 --- /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' + +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/nextflow.config b/tests/modules/pbbam/pbmerge/nextflow.config new file mode 100644 index 00000000..4fc270a9 --- /dev/null +++ b/tests/modules/pbbam/pbmerge/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PBBAM_PBMERGE { + ext.prefix = { "${meta.id}.merged" } + } + +} diff --git a/tests/modules/pbbam/pbmerge/test.yml b/tests/modules/pbbam/pbmerge/test.yml new file mode 100644 index 00000000..0a6d7da3 --- /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 -c ./tests/modules/pbbam/pbmerge/nextflow.config + tags: + - pbbam/pbmerge + - pbbam + files: + - path: output/pbbam/test.merged.bam + md5sum: 727c7ba1289192085c06890dda70f973 + - path: output/pbbam/test.merged.bam.pbi + md5sum: edfadd3a81c598d1ee051899792db75d diff --git a/tests/modules/pbccs/main.nf b/tests/modules/pbccs/main.nf new file mode 100644 index 00000000..91a2ab30 --- /dev/null +++ b/tests/modules/pbccs/main.nf @@ -0,0 +1,19 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PBCCS } from '../../../modules/pbccs/main.nf' + +workflow test_pbccs { + + input = [ + [ id:'alz' ], // meta map + file(params.test_data['homo_sapiens']['pacbio']['alz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['pacbio']['alzpbi'], checkIfExists: true) + ] + + chunk_num = 2 + chunk_on = 3 + + PBCCS ( input, chunk_num, chunk_on ) +} diff --git a/tests/modules/pbccs/nextflow.config b/tests/modules/pbccs/nextflow.config new file mode 100644 index 00000000..869909ce --- /dev/null +++ b/tests/modules/pbccs/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PBCCS { + ext.args = '--min-rq 0.9' + } + +} diff --git a/tests/modules/pbccs/test.yml b/tests/modules/pbccs/test.yml new file mode 100644 index 00000000..5d481923 --- /dev/null +++ b/tests/modules/pbccs/test.yml @@ -0,0 +1,15 @@ +- name: pbccs test_pbccs + command: nextflow run ./tests/modules/pbccs -entry test_pbccs -c ./tests/config/nextflow.config -c ./tests/modules/pbccs/nextflow.config + tags: + - pbccs + files: + - path: output/pbccs/alz.chunk2.bam + md5sum: 2b6451f2d0454eb08359cb84e2e4069c + - path: output/pbccs/alz.chunk2.bam.pbi + md5sum: 3112cda9744e3facbf38245d41aaf080 + - path: output/pbccs/alz.chunk2.metrics.json.gz + contains: [ 'zmws' ] + - path: output/pbccs/alz.chunk2.report.json + contains: [ 'Created by pbcopper' ] + - path: output/pbccs/alz.chunk2.report.txt + md5sum: bbc5bd7a1269345cf7a7f3d4c746024b diff --git a/tests/modules/peddy/main.nf b/tests/modules/peddy/main.nf new file mode 100644 index 00000000..e53e8152 --- /dev/null +++ b/tests/modules/peddy/main.nf @@ -0,0 +1,17 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PEDDY } from '../../../modules/peddy/main.nf' + +workflow test_peddy { + + input = [ + [ id:'test', single_end:false ], + file(params.test_data['homo_sapiens']['genome']['justhusky_minimal_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['justhusky_minimal_vcf_gz_tbi'], checkIfExists: true) + ] + ped = file(params.test_data['homo_sapiens']['genome']['justhusky_ped'], checkIfExists: true) + + PEDDY ( input, ped ) +} diff --git a/tests/modules/peddy/nextflow.config b/tests/modules/peddy/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/peddy/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/peddy/test.yml b/tests/modules/peddy/test.yml new file mode 100644 index 00000000..0ed6dc94 --- /dev/null +++ b/tests/modules/peddy/test.yml @@ -0,0 +1,17 @@ +- name: peddy test_peddy + command: nextflow run ./tests/modules/peddy -entry test_peddy -c ./tests/config/nextflow.config ./tests/modules/peddy/nextflow.config + tags: + - peddy + files: + - path: output/peddy/justhusky_minimal.het_check.csv + md5sum: f4006d47355f2a760e40215b403926c3 + - path: output/peddy/justhusky_minimal.html + md5sum: 4f189cdbe8f03fe5c32d343c183506a5 + - path: output/peddy/justhusky_minimal.ped_check.csv + md5sum: d79a98558e280afe794d1374d2b985d4 + - path: output/peddy/justhusky_minimal.ped_check.rel-difference.csv + md5sum: 9de7e287cb30c742db2ff3622b0e63b1 + - path: output/peddy/justhusky_minimal.sex_check.csv + md5sum: 60848489bc697490da6a53b5170baf3b + - path: output/peddy/justhusky_minimal.vs.html + md5sum: 20f5f3a97fa781057c876ac79e044010 diff --git a/tests/modules/phyloflash/main.nf b/tests/modules/phyloflash/main.nf new file mode 100644 index 00000000..412e0321 --- /dev/null +++ b/tests/modules/phyloflash/main.nf @@ -0,0 +1,44 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PHYLOFLASH } from '../../../modules/phyloflash/main.nf' + +process STUB_PHYLOFLASH_DATABASE { + output: + path "ref" , emit: silva_db + path "UniVec" , emit: univec_db + + stub: + """ + mkdir ref + touch UniVec + """ +} + +workflow test_phyloflash_single_end { + + STUB_PHYLOFLASH_DATABASE () + + input = [ + [ id:'test', single_end:true ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + ] + + PHYLOFLASH ( input, STUB_PHYLOFLASH_DATABASE.out.silva_db, STUB_PHYLOFLASH_DATABASE.out.univec_db ) +} + +workflow test_phyloflash_paired_end { + + STUB_PHYLOFLASH_DATABASE () + + 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) + ] + ] + + PHYLOFLASH ( input, STUB_PHYLOFLASH_DATABASE.out.silva_db, STUB_PHYLOFLASH_DATABASE.out.univec_db ) +} diff --git a/tests/modules/phyloflash/nextflow.config b/tests/modules/phyloflash/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/phyloflash/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/phyloflash/test.yml b/tests/modules/phyloflash/test.yml new file mode 100644 index 00000000..81eac2f2 --- /dev/null +++ b/tests/modules/phyloflash/test.yml @@ -0,0 +1,15 @@ +- name: phyloflash single-end + command: nextflow run ./tests/modules/phyloflash -entry test_phyloflash_single_end -c ./tests/config/nextflow.config -c ./tests/modules/phyloflash/nextflow.config -stub-run + tags: + - phyloflash + files: + - path: output/phyloflash/test/test.SSU.collection.fasta + md5sum: d41d8cd98f00b204e9800998ecf8427e + +- name: phyloflash paired-end + command: nextflow run ./tests/modules/phyloflash -entry test_phyloflash_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/phyloflash/nextflow.config -stub-run + tags: + - phyloflash + files: + - path: output/phyloflash/test/test.SSU.collection.fasta + md5sum: d41d8cd98f00b204e9800998ecf8427e diff --git a/tests/modules/picard/collecthsmetrics/main.nf b/tests/modules/picard/collecthsmetrics/main.nf new file mode 100644 index 00000000..2e8727b5 --- /dev/null +++ b/tests/modules/picard/collecthsmetrics/main.nf @@ -0,0 +1,18 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PICARD_COLLECTHSMETRICS } from '../../../../modules/picard/collecthsmetrics/main.nf' + +workflow test_picard_collecthsmetrics { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) ] + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + bait_intervals = file(params.test_data['sarscov2']['genome']['baits_interval_list'], checkIfExists: true) + target_intervals = file(params.test_data['sarscov2']['genome']['targets_interval_list'], checkIfExists: true) + + PICARD_COLLECTHSMETRICS ( input, fasta, fai, bait_intervals, target_intervals ) +} diff --git a/tests/modules/picard/collecthsmetrics/nextflow.config b/tests/modules/picard/collecthsmetrics/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/picard/collecthsmetrics/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/picard/collecthsmetrics/test.yml b/tests/modules/picard/collecthsmetrics/test.yml new file mode 100644 index 00000000..9232d508 --- /dev/null +++ b/tests/modules/picard/collecthsmetrics/test.yml @@ -0,0 +1,8 @@ +- name: picard collecthsmetrics test_picard_collecthsmetrics + command: nextflow run ./tests/modules/picard/collecthsmetrics -entry test_picard_collecthsmetrics -c ./tests/config/nextflow.config -c ./tests/modules/picard/collecthsmetrics/nextflow.config + tags: + - picard + - picard/collecthsmetrics + files: + # The file can't be md5'd consistently + - path: output/picard/test_collecthsmetrics.txt diff --git a/tests/modules/picard/collectmultiplemetrics/main.nf b/tests/modules/picard/collectmultiplemetrics/main.nf index 73ac0013..453ecc91 100644 --- a/tests/modules/picard/collectmultiplemetrics/main.nf +++ b/tests/modules/picard/collectmultiplemetrics/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PICARD_COLLECTMULTIPLEMETRICS } from '../../../../modules/picard/collectmultiplemetrics/main.nf' addParams( options: [:] ) +include { PICARD_COLLECTMULTIPLEMETRICS } from '../../../../modules/picard/collectmultiplemetrics/main.nf' workflow test_picard_collectmultiplemetrics { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/picard/collectmultiplemetrics/nextflow.config b/tests/modules/picard/collectmultiplemetrics/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/picard/collectmultiplemetrics/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/picard/collectmultiplemetrics/test.yml b/tests/modules/picard/collectmultiplemetrics/test.yml index fc4d0347..8fecca73 100644 --- a/tests/modules/picard/collectmultiplemetrics/test.yml +++ b/tests/modules/picard/collectmultiplemetrics/test.yml @@ -1,5 +1,5 @@ - name: picard collectmultiplemetrics - command: nextflow run ./tests/modules/picard/collectmultiplemetrics -entry test_picard_collectmultiplemetrics -c tests/config/nextflow.config + command: nextflow run ./tests/modules/picard/collectmultiplemetrics -entry test_picard_collectmultiplemetrics -c ./tests/config/nextflow.config -c ./tests/modules/picard/collectmultiplemetrics/nextflow.config tags: - picard - picard/collectmultiplemetrics diff --git a/tests/modules/picard/collectwgsmetrics/main.nf b/tests/modules/picard/collectwgsmetrics/main.nf index 5bdf17ab..1d75a2bd 100644 --- a/tests/modules/picard/collectwgsmetrics/main.nf +++ b/tests/modules/picard/collectwgsmetrics/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PICARD_COLLECTWGSMETRICS } from '../../../../modules/picard/collectwgsmetrics/main.nf' addParams( options: [:] ) +include { PICARD_COLLECTWGSMETRICS } from '../../../../modules/picard/collectwgsmetrics/main.nf' workflow test_picard_collectwgsmetrics { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/picard/collectwgsmetrics/nextflow.config b/tests/modules/picard/collectwgsmetrics/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/picard/collectwgsmetrics/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/picard/collectwgsmetrics/test.yml b/tests/modules/picard/collectwgsmetrics/test.yml index 62e87e65..2daef406 100644 --- a/tests/modules/picard/collectwgsmetrics/test.yml +++ b/tests/modules/picard/collectwgsmetrics/test.yml @@ -1,5 +1,5 @@ - name: picard collectwgsmetrics test_picard_collectwgsmetrics - command: nextflow run tests/modules/picard/collectwgsmetrics -entry test_picard_collectwgsmetrics -c tests/config/nextflow.config + command: nextflow run ./tests/modules/picard/collectwgsmetrics -entry test_picard_collectwgsmetrics -c ./tests/config/nextflow.config -c ./tests/modules/picard/collectwgsmetrics/nextflow.config tags: - picard/collectwgsmetrics - picard diff --git a/tests/modules/picard/filtersamreads/main.nf b/tests/modules/picard/filtersamreads/main.nf new file mode 100644 index 00000000..847bee57 --- /dev/null +++ b/tests/modules/picard/filtersamreads/main.nf @@ -0,0 +1,32 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PICARD_SORTSAM } from '../../../../modules/picard/sortsam/main.nf' +include { PICARD_FILTERSAMREADS } from '../../../../modules/picard/filtersamreads/main.nf' + +workflow test_picard_filtersamreads { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) ] + sort_order = 'queryname' + filter = 'includeAligned' + + PICARD_SORTSAM ( input, sort_order ) + PICARD_SORTSAM.out.bam + .map { + [ it[0], it[1], [] ] + } + .set{ ch_sorted_for_filtersamreads } + PICARD_FILTERSAMREADS ( ch_sorted_for_filtersamreads, filter ) +} + +workflow test_picard_filtersamreads_readlist { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_single_end_bam_readlist_txt'], checkIfExists: true) ] + filter = 'includeReadList' + + PICARD_FILTERSAMREADS ( input, filter ) +} diff --git a/tests/modules/picard/filtersamreads/nextflow.config b/tests/modules/picard/filtersamreads/nextflow.config new file mode 100644 index 00000000..653e9633 --- /dev/null +++ b/tests/modules/picard/filtersamreads/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PICARD_SORTSAM { + ext.prefix = { "${meta.id}.sorted" } + } + + withName: PICARD_FILTERSAMREADS { + ext.prefix = { "${meta.id}.filtered" } + } + +} diff --git a/tests/modules/picard/filtersamreads/test.yml b/tests/modules/picard/filtersamreads/test.yml new file mode 100644 index 00000000..a0ab712b --- /dev/null +++ b/tests/modules/picard/filtersamreads/test.yml @@ -0,0 +1,18 @@ +- name: picard filtersamreads + command: nextflow run ./tests/modules/picard/filtersamreads -entry test_picard_filtersamreads -c ./tests/config/nextflow.config -c ./tests/modules/picard/filtersamreads/nextflow.config + tags: + - picard + - picard/filtersamreads + files: + - path: output/picard/test.filtered.bam + md5sum: b44a6ca04811a9470c7813c3c9465fd5 + + +- name: picard filtersamreads readlist + command: nextflow run ./tests/modules/picard/filtersamreads -entry test_picard_filtersamreads_readlist -c ./tests/config/nextflow.config -c ./tests/modules/picard/filtersamreads/nextflow.config + tags: + - picard + - picard/filtersamreads + files: + - path: output/picard/test.filtered.bam + md5sum: 1e86b738b56f2c2b09f4cab52baf05c7 diff --git a/tests/modules/picard/markduplicates/main.nf b/tests/modules/picard/markduplicates/main.nf index 2d4ff746..12f3ac26 100644 --- a/tests/modules/picard/markduplicates/main.nf +++ b/tests/modules/picard/markduplicates/main.nf @@ -2,7 +2,8 @@ nextflow.enable.dsl = 2 -include { PICARD_MARKDUPLICATES } from '../../../../modules/picard/markduplicates/main.nf' addParams( options: [:] ) +include { PICARD_MARKDUPLICATES } from '../../../../modules/picard/markduplicates/main.nf' +include { PICARD_MARKDUPLICATES as PICARD_MARKDUPLICATES_UNSORTED} from '../../../../modules/picard/markduplicates/main.nf' 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/nextflow.config b/tests/modules/picard/markduplicates/nextflow.config new file mode 100644 index 00000000..9178c5b1 --- /dev/null +++ b/tests/modules/picard/markduplicates/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PICARD_MARKDUPLICATES_UNSORTED { + ext.args = 'ASSUME_SORT_ORDER=queryname' + } + +} diff --git a/tests/modules/picard/markduplicates/test.yml b/tests/modules/picard/markduplicates/test.yml index db3cf253..beb54009 100644 --- a/tests/modules/picard/markduplicates/test.yml +++ b/tests/modules/picard/markduplicates/test.yml @@ -1,16 +1,21 @@ -- name: picard markduplicates on sorted bam - command: nextflow run ./tests/modules/picard/markduplicates -entry test_picard_markduplicates_sorted_bam -c tests/config/nextflow.config +- name: picard markduplicates sorted bam + command: nextflow run ./tests/modules/picard/markduplicates -entry test_picard_markduplicates_sorted_bam -c ./tests/config/nextflow.config -c ./tests/modules/picard/markduplicates/nextflow.config tags: - picard - picard/markduplicates files: - path: ./output/picard/test.MarkDuplicates.metrics.txt + contains: + - "1.0 97 97" - path: ./output/picard/test.bam - md5sum: fe8ed25b4bd25be0cc7a8730fc3b2f30 - -- name: picard markduplicates on unsorted bam - command: nextflow run ./tests/modules/picard/markduplicates -entry test_picard_markduplicates_unsorted_bam -c tests/config/nextflow.config +- name: picard markduplicates unsorted bam + command: nextflow run ./tests/modules/picard/markduplicates -entry test_picard_markduplicates_unsorted_bam -c ./tests/config/nextflow.config -c ./tests/modules/picard/markduplicates/nextflow.config tags: - picard - picard/markduplicates - exit_code: 1 + files: + - path: ./output/picard/test.MarkDuplicates.metrics.txt + contains: + - "1.0 97 97" + - path: ./output/picard/test.bam + diff --git a/tests/modules/picard/mergesamfiles/main.nf b/tests/modules/picard/mergesamfiles/main.nf index 5ddc849f..51c070b6 100644 --- a/tests/modules/picard/mergesamfiles/main.nf +++ b/tests/modules/picard/mergesamfiles/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PICARD_MERGESAMFILES } from '../../../../modules/picard/mergesamfiles/main.nf' addParams( options: [:] ) +include { PICARD_MERGESAMFILES } from '../../../../modules/picard/mergesamfiles/main.nf' workflow test_picard_mergesamfiles { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/picard/mergesamfiles/nextflow.config b/tests/modules/picard/mergesamfiles/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/picard/mergesamfiles/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/picard/mergesamfiles/test.yml b/tests/modules/picard/mergesamfiles/test.yml index be82034f..1cf59cb7 100644 --- a/tests/modules/picard/mergesamfiles/test.yml +++ b/tests/modules/picard/mergesamfiles/test.yml @@ -1,8 +1,7 @@ - name: picard mergesamfiles - command: nextflow run ./tests/modules/picard/mergesamfiles -entry test_picard_mergesamfiles -c tests/config/nextflow.config + command: nextflow run ./tests/modules/picard/mergesamfiles -entry test_picard_mergesamfiles -c ./tests/config/nextflow.config -c ./tests/modules/picard/mergesamfiles/nextflow.config tags: - picard - picard/mergesamfiles files: - path: ./output/picard/test.bam - md5sum: b8bd6c22f36c6ebc91bca98bd637a2eb diff --git a/tests/modules/picard/sortsam/main.nf b/tests/modules/picard/sortsam/main.nf new file mode 100644 index 00000000..1516682c --- /dev/null +++ b/tests/modules/picard/sortsam/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PICARD_SORTSAM } from '../../../../modules/picard/sortsam/main.nf' + +workflow test_picard_sortsam { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) ] + sort_order = "queryname" + + PICARD_SORTSAM ( input, sort_order ) +} diff --git a/tests/modules/picard/sortsam/nextflow.config b/tests/modules/picard/sortsam/nextflow.config new file mode 100644 index 00000000..ca572c2f --- /dev/null +++ b/tests/modules/picard/sortsam/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PICARD_SORTSAM { + ext.prefix = { "${meta.id}.sorted" } + } + +} diff --git a/tests/modules/picard/sortsam/test.yml b/tests/modules/picard/sortsam/test.yml new file mode 100644 index 00000000..61521850 --- /dev/null +++ b/tests/modules/picard/sortsam/test.yml @@ -0,0 +1,8 @@ +- name: picard sortsam + command: nextflow run ./tests/modules/picard/sortsam -entry test_picard_sortsam -c ./tests/config/nextflow.config -c ./tests/modules/picard/sortsam/nextflow.config + tags: + - picard + - picard/sortsam + files: + - path: output/picard/test.sorted.bam + md5sum: b44a6ca04811a9470c7813c3c9465fd5 diff --git a/tests/modules/pirate/main.nf b/tests/modules/pirate/main.nf new file mode 100644 index 00000000..05e5bdd8 --- /dev/null +++ b/tests/modules/pirate/main.nf @@ -0,0 +1,23 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PIRATE } from '../../../modules/pirate/main.nf' + +workflow test_pirate { + + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test1_gff'], checkIfExists: true), + file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test2_gff'], checkIfExists: true), + file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test3_gff'], checkIfExists: true) + ] + ] + // [ 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/nextflow.config b/tests/modules/pirate/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/pirate/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/pirate/test.yml b/tests/modules/pirate/test.yml new file mode 100644 index 00000000..b8d36b95 --- /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 -c ./tests/modules/pirate/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'] diff --git a/tests/modules/plasmidid/main.nf b/tests/modules/plasmidid/main.nf index 1dd57daf..52d25a91 100644 --- a/tests/modules/plasmidid/main.nf +++ b/tests/modules/plasmidid/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PLASMIDID } from '../../../modules/plasmidid/main.nf' addParams ( options: ['args' : '-k 0.8'] ) +include { PLASMIDID } from '../../../modules/plasmidid/main.nf' workflow test_plasmidid { diff --git a/tests/modules/plasmidid/nextflow.config b/tests/modules/plasmidid/nextflow.config new file mode 100644 index 00000000..2090bfae --- /dev/null +++ b/tests/modules/plasmidid/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PLASMIDID { + ext.args = '-k 0.8' + } + +} diff --git a/tests/modules/plasmidid/test.yml b/tests/modules/plasmidid/test.yml index dd472a72..cd0528cb 100644 --- a/tests/modules/plasmidid/test.yml +++ b/tests/modules/plasmidid/test.yml @@ -1,5 +1,5 @@ - name: plasmidid - command: nextflow run ./tests/modules/plasmidid -entry test_plasmidid -c tests/config/nextflow.config + command: nextflow run ./tests/modules/plasmidid -entry test_plasmidid -c ./tests/config/nextflow.config -c ./tests/modules/plasmidid/nextflow.config tags: - plasmidid files: @@ -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 diff --git a/tests/modules/plink/extract/main.nf b/tests/modules/plink/extract/main.nf new file mode 100644 index 00000000..6beb0469 --- /dev/null +++ b/tests/modules/plink/extract/main.nf @@ -0,0 +1,29 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PLINK_VCF } from '../../../../modules/plink/vcf/main.nf' +include { PLINK_EXTRACT } from '../../../../modules/plink/extract/main.nf' + +workflow test_plink_extract { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['genome']['syntheticvcf_short_vcf_gz'], checkIfExists: true) + ] + + PLINK_VCF ( input ) + + PLINK_VCF.out.bim + .splitText(file: 'variants.keep', keepHeader: false, by: 10) + .first() + .set { ch_variants } + + PLINK_VCF.out.bed + .concat(PLINK_VCF.out.bim, PLINK_VCF.out.fam.concat(ch_variants)) + .groupTuple() + .map{ meta, paths -> [meta, paths[0], paths[1], paths[2], paths[3]] } + .set { ch_extract } + + PLINK_EXTRACT ( ch_extract ) +} diff --git a/tests/modules/plink/extract/nextflow.config b/tests/modules/plink/extract/nextflow.config new file mode 100644 index 00000000..6a7f6d42 --- /dev/null +++ b/tests/modules/plink/extract/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PLINK_VCF { + ext.args = '--make-bed --set-missing-var-ids @:#:\\$1:\\$2' + } + + withName: PLINK_EXTRACT { + ext.prefix = { "${meta.id}.extract" } + } + +} diff --git a/tests/modules/plink/extract/test.yml b/tests/modules/plink/extract/test.yml new file mode 100644 index 00000000..87cf82cc --- /dev/null +++ b/tests/modules/plink/extract/test.yml @@ -0,0 +1,18 @@ +- name: plink extract test_plink_extract + command: nextflow run ./tests/modules/plink/extract -entry test_plink_extract -c ./tests/config/nextflow.config -c ./tests/modules/plink/extract/nextflow.config + tags: + - plink + - plink/extract + files: + - path: output/plink/test.bed + md5sum: 9121010aba9905eee965e96bc983611d + - path: output/plink/test.bim + md5sum: 510ec606219ee5daaf5c207cb01554bf + - path: output/plink/test.extract.bed + md5sum: 9e02f7143bcc756a51f20d50ca7f8032 + - path: output/plink/test.extract.bim + md5sum: 63d190aea4094aa5d042aacd63397f94 + - path: output/plink/test.extract.fam + md5sum: c499456df4da78792ef29934ef3cd47d + - path: output/plink/test.fam + md5sum: c499456df4da78792ef29934ef3cd47d diff --git a/tests/modules/plink/vcf/main.nf b/tests/modules/plink/vcf/main.nf new file mode 100644 index 00000000..4dac8978 --- /dev/null +++ b/tests/modules/plink/vcf/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PLINK_VCF } from '../../../../modules/plink/vcf/main.nf' + +workflow test_plink_vcf { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] + + PLINK_VCF ( input ) +} diff --git a/tests/modules/plink/vcf/nextflow.config b/tests/modules/plink/vcf/nextflow.config new file mode 100644 index 00000000..f0b72c8d --- /dev/null +++ b/tests/modules/plink/vcf/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PLINK_VCF { + ext.args = ' --make-bed --biallelic-only strict --vcf-half-call missing --double-id --recode ped --id-delim \'=\' --allow-extra-chr' + } + +} diff --git a/tests/modules/plink/vcf/test.yml b/tests/modules/plink/vcf/test.yml new file mode 100644 index 00000000..9042d14a --- /dev/null +++ b/tests/modules/plink/vcf/test.yml @@ -0,0 +1,12 @@ +- name: plink vcf test_plink_vcf + command: nextflow run ./tests/modules/plink/vcf -entry test_plink_vcf -c ./tests/config/nextflow.config -c ./tests/modules/plink/vcf/nextflow.config + tags: + - plink + - plink/vcf + files: + - path: output/plink/test.bed + md5sum: 55c3ab2636212911b5f952ef6f5d855c + - path: output/plink/test.bim + md5sum: 54164b6f103e152de05712c6bb317db8 + - path: output/plink/test.fam + md5sum: 22d32d7daa3ae6b819a24895e82b2a70 diff --git a/tests/modules/plink2/vcf/main.nf b/tests/modules/plink2/vcf/main.nf new file mode 100644 index 00000000..08d7dc61 --- /dev/null +++ b/tests/modules/plink2/vcf/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PLINK2_VCF } from '../../../../modules/plink2/vcf/main.nf' + +workflow test_plink2_vcf { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + + PLINK2_VCF ( input ) +} diff --git a/tests/modules/plink2/vcf/nextflow.config b/tests/modules/plink2/vcf/nextflow.config new file mode 100644 index 00000000..7f7e5e77 --- /dev/null +++ b/tests/modules/plink2/vcf/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PLINK2_VCF { + ext.args = '--allow-extra-chr' + } + +} diff --git a/tests/modules/plink2/vcf/test.yml b/tests/modules/plink2/vcf/test.yml new file mode 100644 index 00000000..52f58a42 --- /dev/null +++ b/tests/modules/plink2/vcf/test.yml @@ -0,0 +1,12 @@ +- name: plink2 vcf test_plink2_vcf + command: nextflow run ./tests/modules/plink2/vcf -entry test_plink2_vcf -c ./tests/config/nextflow.config -c ./tests/modules/plink2/vcf/nextflow.config + tags: + - plink2/vcf + - plink2 + files: + - path: output/plink2/test.pgen + md5sum: d66d3cd4a6c9cca1a4073d7f4b277041 + - path: output/plink2/test.psam + md5sum: dc3b77d7753a7bed41734323e3549b10 + - path: output/plink2/test.pvar + md5sum: d61e53f847a6335138b584216b4e45d0 diff --git a/tests/modules/pmdtools/filter/main.nf b/tests/modules/pmdtools/filter/main.nf new file mode 100644 index 00000000..f1b2b4d3 --- /dev/null +++ b/tests/modules/pmdtools/filter/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PMDTOOLS_FILTER } from '../../../../modules/pmdtools/filter/main.nf' + +workflow test_pmdtools_filter { + + input = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ]] + threshold = 3 + reference = [ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + PMDTOOLS_FILTER ( input, threshold, reference ) +} diff --git a/tests/modules/pmdtools/filter/nextflow.config b/tests/modules/pmdtools/filter/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/pmdtools/filter/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/pmdtools/filter/test.yml b/tests/modules/pmdtools/filter/test.yml new file mode 100644 index 00000000..a7ebefbe --- /dev/null +++ b/tests/modules/pmdtools/filter/test.yml @@ -0,0 +1,8 @@ +- name: pmdtools filter + command: nextflow run ./tests/modules/pmdtools/filter -entry test_pmdtools_filter -c ./tests/config/nextflow.config -c ./tests/modules/pmdtools/filter/nextflow.config + tags: + - pmdtools + - pmdtools/filter + files: + - path: output/pmdtools/test.bam + md5sum: 0fa64cb87d0439d4482938a4b6990b9d diff --git a/tests/modules/porechop/main.nf b/tests/modules/porechop/main.nf new file mode 100644 index 00000000..f20b7a6e --- /dev/null +++ b/tests/modules/porechop/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PORECHOP } from '../../../modules/porechop/main.nf' + +workflow test_porechop { + + input = [ [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true) ] + + PORECHOP ( input ) +} diff --git a/tests/modules/porechop/nextflow.config b/tests/modules/porechop/nextflow.config new file mode 100644 index 00000000..85eb257a --- /dev/null +++ b/tests/modules/porechop/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PORECHOP { + ext.args = '' + ext.prefix = { "${meta.id}_porechop" } + } + +} diff --git a/tests/modules/porechop/test.yml b/tests/modules/porechop/test.yml new file mode 100644 index 00000000..8790ab87 --- /dev/null +++ b/tests/modules/porechop/test.yml @@ -0,0 +1,7 @@ +- name: porechop test_porechop + command: nextflow run ./tests/modules/porechop -entry test_porechop -c ./tests/config/nextflow.config -c ./tests/modules/porechop/nextflow.config + tags: + - porechop + files: + - path: output/porechop/test_porechop.fastq.gz + md5sum: 08f314ae9f162c8dcc27e5b513d2064d diff --git a/tests/modules/preseq/lcextrap/main.nf b/tests/modules/preseq/lcextrap/main.nf index 390039bd..4bbbd146 100644 --- a/tests/modules/preseq/lcextrap/main.nf +++ b/tests/modules/preseq/lcextrap/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PRESEQ_LCEXTRAP } from '../../../../modules/preseq/lcextrap/main.nf' addParams( options: [:] ) +include { PRESEQ_LCEXTRAP } from '../../../../modules/preseq/lcextrap/main.nf' // // Test with single-end data diff --git a/tests/modules/preseq/lcextrap/nextflow.config b/tests/modules/preseq/lcextrap/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/preseq/lcextrap/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/preseq/lcextrap/test.yml b/tests/modules/preseq/lcextrap/test.yml index 4472a485..ecd1d046 100644 --- a/tests/modules/preseq/lcextrap/test.yml +++ b/tests/modules/preseq/lcextrap/test.yml @@ -1,5 +1,5 @@ - name: preseq lcextrap single-end - command: nextflow run ./tests/modules/preseq/lcextrap -entry test_preseq_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/preseq/lcextrap -entry test_preseq_single_end -c ./tests/config/nextflow.config -c ./tests/modules/preseq/lcextrap/nextflow.config tags: - preseq - preseq/lcextrap @@ -9,7 +9,7 @@ - path: output/preseq/test.command.log - name: preseq lcextrap paired-end - command: nextflow run ./tests/modules/preseq/lcextrap -entry test_preseq_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/preseq/lcextrap -entry test_preseq_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/preseq/lcextrap/nextflow.config tags: - preseq - preseq/lcextrap diff --git a/tests/modules/prodigal/main.nf b/tests/modules/prodigal/main.nf index 414585a1..6e282015 100644 --- a/tests/modules/prodigal/main.nf +++ b/tests/modules/prodigal/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PRODIGAL } from '../../../modules/prodigal/main.nf' addParams( options: [:] ) +include { PRODIGAL } from '../../../modules/prodigal/main.nf' workflow test_prodigal { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/prodigal/nextflow.config b/tests/modules/prodigal/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/prodigal/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/prodigal/test.yml b/tests/modules/prodigal/test.yml index 93caa998..7f0ab88c 100644 --- a/tests/modules/prodigal/test.yml +++ b/tests/modules/prodigal/test.yml @@ -1,5 +1,5 @@ - name: prodigal test_prodigal - command: nextflow run tests/modules/prodigal -entry test_prodigal -c tests/config/nextflow.config + command: nextflow run ./tests/modules/prodigal -entry test_prodigal -c ./tests/config/nextflow.config -c ./tests/modules/prodigal/nextflow.config tags: - prodigal files: diff --git a/tests/modules/prokka/main.nf b/tests/modules/prokka/main.nf index e35cb1d9..97e94ca8 100644 --- a/tests/modules/prokka/main.nf +++ b/tests/modules/prokka/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PROKKA } from '../../../modules/prokka/main.nf' addParams( options: [:] ) +include { PROKKA } from '../../../modules/prokka/main.nf' workflow test_prokka { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/prokka/nextflow.config b/tests/modules/prokka/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/prokka/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/prokka/test.yml b/tests/modules/prokka/test.yml index 2823353c..92f813a7 100644 --- a/tests/modules/prokka/test.yml +++ b/tests/modules/prokka/test.yml @@ -1,5 +1,5 @@ - name: prokka - command: nextflow run ./tests/modules/prokka -entry test_prokka -c tests/config/nextflow.config + command: nextflow run ./tests/modules/prokka -entry test_prokka -c ./tests/config/nextflow.config -c ./tests/modules/prokka/nextflow.config tags: - prokka files: diff --git a/tests/modules/pycoqc/main.nf b/tests/modules/pycoqc/main.nf index ab65dadc..c8a8ee2c 100644 --- a/tests/modules/pycoqc/main.nf +++ b/tests/modules/pycoqc/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { PYCOQC } from '../../../modules/pycoqc/main.nf' addParams ( options: ['args' : '--min_pass_qual 0'] ) +include { PYCOQC } from '../../../modules/pycoqc/main.nf' workflow test_pycoqc { diff --git a/tests/modules/pycoqc/nextflow.config b/tests/modules/pycoqc/nextflow.config new file mode 100644 index 00000000..d532f8f7 --- /dev/null +++ b/tests/modules/pycoqc/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: PYCOQC { + ext.args = '--min_pass_qual 0' + } + +} diff --git a/tests/modules/pycoqc/test.yml b/tests/modules/pycoqc/test.yml index 052e3e1a..becd911b 100644 --- a/tests/modules/pycoqc/test.yml +++ b/tests/modules/pycoqc/test.yml @@ -1,5 +1,5 @@ - name: pycoqc - command: nextflow run ./tests/modules/pycoqc -entry test_pycoqc -c tests/config/nextflow.config + command: nextflow run ./tests/modules/pycoqc -entry test_pycoqc -c ./tests/config/nextflow.config -c ./tests/modules/pycoqc/nextflow.config tags: - pycoqc files: diff --git a/tests/modules/pydamage/analyze/main.nf b/tests/modules/pydamage/analyze/main.nf new file mode 100644 index 00000000..920a4201 --- /dev/null +++ b/tests/modules/pydamage/analyze/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PYDAMAGE_ANALYZE } from '../../../../modules/pydamage/analyze/main.nf' + +workflow test_pydamage { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] + + PYDAMAGE_ANALYZE ( input ) +} diff --git a/tests/modules/pydamage/analyze/nextflow.config b/tests/modules/pydamage/analyze/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/pydamage/analyze/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/pydamage/analyze/test.yml b/tests/modules/pydamage/analyze/test.yml new file mode 100644 index 00000000..9d22f20e --- /dev/null +++ b/tests/modules/pydamage/analyze/test.yml @@ -0,0 +1,8 @@ +- name: pydamage analyze test workflow + command: nextflow run ./tests/modules/pydamage/analyze -entry test_pydamage -c ./tests/config/nextflow.config -c ./tests/modules/pydamage/analyze/nextflow.config + tags: + - pydamage + - pydamage/analyze + files: + - path: output/pydamage/pydamage_results/pydamage_results.csv + md5sum: 37ee6b4dee6890fd2ec8550337f21ac9 diff --git a/tests/modules/pydamage/filter/main.nf b/tests/modules/pydamage/filter/main.nf new file mode 100644 index 00000000..dac03e78 --- /dev/null +++ b/tests/modules/pydamage/filter/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { PYDAMAGE_ANALYZE } from '../../../../modules/pydamage/analyze/main.nf' +include { PYDAMAGE_FILTER } from '../../../../modules/pydamage/filter/main.nf' + +workflow test_pydamage { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] + + PYDAMAGE_ANALYZE ( input ) + PYDAMAGE_FILTER (PYDAMAGE_ANALYZE.out.csv) +} diff --git a/tests/modules/pydamage/filter/nextflow.config b/tests/modules/pydamage/filter/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/pydamage/filter/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/pydamage/filter/test.yml b/tests/modules/pydamage/filter/test.yml new file mode 100644 index 00000000..b6738e3d --- /dev/null +++ b/tests/modules/pydamage/filter/test.yml @@ -0,0 +1,10 @@ +- name: pydamage filter test workflow + command: nextflow run ./tests/modules/pydamage/filter -entry test_pydamage -c ./tests/config/nextflow.config -c ./tests/modules/pydamage/filter/nextflow.config + tags: + - pydamage + - pydamage/filter + files: + - path: output/pydamage/pydamage_results/pydamage_filtered_results.csv + md5sum: 9f297233cf4932d7d7e52cc72d4727dc + - path: output/pydamage/pydamage_results/pydamage_results.csv + md5sum: 37ee6b4dee6890fd2ec8550337f21ac9 diff --git a/tests/modules/qcat/main.nf b/tests/modules/qcat/main.nf index 72c87e37..8a5cdd6d 100644 --- a/tests/modules/qcat/main.nf +++ b/tests/modules/qcat/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { QCAT } from '../../../modules/qcat/main.nf' addParams( options: [:] ) +include { QCAT } from '../../../modules/qcat/main.nf' workflow test_qcat { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/qcat/nextflow.config b/tests/modules/qcat/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/qcat/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/qcat/test.yml b/tests/modules/qcat/test.yml index 5c43841b..47ece983 100644 --- a/tests/modules/qcat/test.yml +++ b/tests/modules/qcat/test.yml @@ -1,5 +1,5 @@ - name: qcat - command: nextflow run ./tests/modules/qcat -entry test_qcat -c tests/config/nextflow.config + command: nextflow run ./tests/modules/qcat -entry test_qcat -c ./tests/config/nextflow.config -c ./tests/modules/qcat/nextflow.config tags: - qcat files: diff --git a/tests/modules/qualimap/bamqc/main.nf b/tests/modules/qualimap/bamqc/main.nf index 803d0220..a17efd59 100644 --- a/tests/modules/qualimap/bamqc/main.nf +++ b/tests/modules/qualimap/bamqc/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { QUALIMAP_BAMQC } from '../../../../modules/qualimap/bamqc/main.nf' addParams( options: [:] ) +include { QUALIMAP_BAMQC } from '../../../../modules/qualimap/bamqc/main.nf' workflow test_qualimap_bamqc { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/qualimap/bamqc/nextflow.config b/tests/modules/qualimap/bamqc/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/qualimap/bamqc/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/qualimap/bamqc/test.yml b/tests/modules/qualimap/bamqc/test.yml index 704c08b2..41c4199e 100644 --- a/tests/modules/qualimap/bamqc/test.yml +++ b/tests/modules/qualimap/bamqc/test.yml @@ -1,12 +1,12 @@ -- name: Run qualimap bamqc test workflow - command: nextflow run ./tests/modules/qualimap/bamqc -entry test_qualimap_bamqc -c tests/config/nextflow.config +- name: qualimap bamqc test workflow + command: nextflow run ./tests/modules/qualimap/bamqc -entry test_qualimap_bamqc -c ./tests/config/nextflow.config -c ./tests/modules/qualimap/bamqc/nextflow.config tags: - qualimap - qualimap/bamqc 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/quast/main.nf b/tests/modules/quast/main.nf index d263470c..c879a8a9 100644 --- a/tests/modules/quast/main.nf +++ b/tests/modules/quast/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { QUAST } from '../../../modules/quast/main.nf' addParams(options: [:]) +include { QUAST } from '../../../modules/quast/main.nf' workflow test_quast_ref { fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/quast/nextflow.config b/tests/modules/quast/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/quast/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/quast/test.yml b/tests/modules/quast/test.yml index 6e1f991f..166cd896 100644 --- a/tests/modules/quast/test.yml +++ b/tests/modules/quast/test.yml @@ -1,5 +1,5 @@ - name: quast with reference - command: nextflow run ./tests/modules/quast -entry test_quast_ref -c ./tests/config/nextflow.config + command: nextflow run ./tests/modules/quast -entry test_quast_ref -c ./tests/config/nextflow.config -c ./tests/modules/quast/nextflow.config tags: - quast files: @@ -82,7 +82,7 @@ - path: ./output/quast/quast/icarus_viewers/contig_size_viewer.html - name: quast without reference - command: nextflow run ./tests/modules/quast -entry test_quast_noref -c ./tests/config/nextflow.config + command: nextflow run ./tests/modules/quast -entry test_quast_noref -c ./tests/config/nextflow.config -c ./tests/modules/quast/nextflow.config tags: - quast files: diff --git a/tests/modules/racon/main.nf b/tests/modules/racon/main.nf new file mode 100644 index 00000000..507d8d8d --- /dev/null +++ b/tests/modules/racon/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { RACON } from '../../../modules/racon/main.nf' + +workflow test_racon { + input = [ [ id:'test', single_end:true ], // meta map + file(params.test_data['bacteroides_fragilis']['nanopore']['test_fastq_gz'], checkIfExists: true), + file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true), + file(params.test_data['bacteroides_fragilis']['genome']['genome_paf'], checkIfExists: true) + ] + + RACON ( input ) +} \ No newline at end of file diff --git a/tests/modules/racon/nextflow.config b/tests/modules/racon/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/racon/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/racon/test.yml b/tests/modules/racon/test.yml new file mode 100644 index 00000000..0250fa36 --- /dev/null +++ b/tests/modules/racon/test.yml @@ -0,0 +1,7 @@ +- name: racon test_racon + command: nextflow run ./tests/modules/racon -entry test_racon -c ./tests/config/nextflow.config -c ./tests/modules/racon/nextflow.config + tags: + - racon + files: + - path: output/racon/test_assembly_consensus.fasta.gz + md5sum: 96a0ba94c6154f6f37b5a76a0207eb6f diff --git a/tests/modules/rapidnj/main.nf b/tests/modules/rapidnj/main.nf index e23fa46f..66d19c3c 100644 --- a/tests/modules/rapidnj/main.nf +++ b/tests/modules/rapidnj/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { RAPIDNJ } from '../../../modules/rapidnj/main.nf' addParams( options: [:] ) +include { RAPIDNJ } from '../../../modules/rapidnj/main.nf' workflow test_rapidnj { diff --git a/tests/modules/rapidnj/nextflow.config b/tests/modules/rapidnj/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/rapidnj/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/rapidnj/test.yml b/tests/modules/rapidnj/test.yml index 0b7ecff5..21f6ead9 100644 --- a/tests/modules/rapidnj/test.yml +++ b/tests/modules/rapidnj/test.yml @@ -1,5 +1,5 @@ - name: rapidnj - command: nextflow run ./tests/modules/rapidnj -entry test_rapidnj -c tests/config/nextflow.config + command: nextflow run ./tests/modules/rapidnj -entry test_rapidnj -c ./tests/config/nextflow.config -c ./tests/modules/rapidnj/nextflow.config tags: - rapidnj files: diff --git a/tests/modules/rasusa/main.nf b/tests/modules/rasusa/main.nf index 9cc139ad..8a11627c 100644 --- a/tests/modules/rasusa/main.nf +++ b/tests/modules/rasusa/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { RASUSA } from '../../../modules/rasusa/main.nf' addParams( options: ['suffix':'_100X']) +include { RASUSA } from '../../../modules/rasusa/main.nf' workflow test_rasusa { input = [ [ id:'test', single_end:false], // meta map diff --git a/tests/modules/rasusa/nextflow.config b/tests/modules/rasusa/nextflow.config new file mode 100644 index 00000000..50c32e5c --- /dev/null +++ b/tests/modules/rasusa/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: RASUSA { + ext.prefix = { "${meta.id}_100X" } + } + +} diff --git a/tests/modules/rasusa/test.yml b/tests/modules/rasusa/test.yml index bb30c99e..41c56b67 100644 --- a/tests/modules/rasusa/test.yml +++ b/tests/modules/rasusa/test.yml @@ -1,5 +1,5 @@ - name: rasusa test_rasusa - command: nextflow run tests/modules/rasusa -entry test_rasusa -c tests/config/nextflow.config + command: nextflow run ./tests/modules/rasusa -entry test_rasusa -c ./tests/config/nextflow.config -c ./tests/modules/rasusa/nextflow.config tags: - rasusa files: diff --git a/tests/modules/raxmlng/main.nf b/tests/modules/raxmlng/main.nf index 2cac6b31..5fad6953 100644 --- a/tests/modules/raxmlng/main.nf +++ b/tests/modules/raxmlng/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { RAXMLNG as RAXMLNG_NO_BOOTSTRAP } from '../../../modules/raxmlng/main.nf' addParams( options: [args:'--model GTR+G'] ) -include { RAXMLNG as RAXMLNG_BOOTSTRAP } from '../../../modules/raxmlng/main.nf' addParams( options: [args:'--all --model GTR+G --bs-trees 1000'] ) +include { RAXMLNG as RAXMLNG_NO_BOOTSTRAP } from '../../../modules/raxmlng/main.nf' +include { RAXMLNG as RAXMLNG_BOOTSTRAP } from '../../../modules/raxmlng/main.nf' // // Test without bootstrapping diff --git a/tests/modules/raxmlng/nextflow.config b/tests/modules/raxmlng/nextflow.config new file mode 100644 index 00000000..8c269a9b --- /dev/null +++ b/tests/modules/raxmlng/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: RAXMLNG_NO_BOOTSTRAP { + ext.args = '--model GTR+G' + } + + withName: RAXMLNG_BOOTSTRAP { + ext.args = '--all --model GTR+G --bs-trees 1000' + } + +} diff --git a/tests/modules/raxmlng/test.yml b/tests/modules/raxmlng/test.yml index 950c48ad..735b6a74 100644 --- a/tests/modules/raxmlng/test.yml +++ b/tests/modules/raxmlng/test.yml @@ -1,5 +1,5 @@ - name: raxmlng no_bootstrap - command: nextflow run ./tests/modules/raxmlng -entry test_raxmlng_no_bootstrap -c tests/config/nextflow.config + command: nextflow run ./tests/modules/raxmlng -entry test_raxmlng_no_bootstrap -c ./tests/config/nextflow.config -c ./tests/modules/raxmlng/nextflow.config tags: - raxmlng files: @@ -11,7 +11,7 @@ - 'sample4:0.111' - name: raxmlng bootstrap - command: nextflow run ./tests/modules/raxmlng -entry test_raxmlng_bootstrap -c tests/config/nextflow.config + command: nextflow run ./tests/modules/raxmlng -entry test_raxmlng_bootstrap -c ./tests/config/nextflow.config -c ./tests/modules/raxmlng/nextflow.config tags: - raxmlng files: diff --git a/tests/modules/rmarkdownnotebook/main.nf b/tests/modules/rmarkdownnotebook/main.nf new file mode 100644 index 00000000..fdb7d3b9 --- /dev/null +++ b/tests/modules/rmarkdownnotebook/main.nf @@ -0,0 +1,29 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { RMARKDOWNNOTEBOOK } from '../../../modules/rmarkdownnotebook/main.nf' +include { RMARKDOWNNOTEBOOK as RMARKDOWNNOTEBOOK_PARAMETRIZE } from '../../../modules/rmarkdownnotebook/main.nf' + +workflow test_rmarkdown { + + input = [ [ id:'test_rmd' ], // meta map + file(params.test_data['generic']['notebooks']['rmarkdown'], checkIfExists: true) ] + + RMARKDOWNNOTEBOOK ( input, [:], []) + +} + +workflow test_rmarkdown_parametrize { + + input = [ [ id:'test_rmd' ], // meta map + file(params.test_data['generic']['notebooks']['rmarkdown'], checkIfExists: true) ] + + RMARKDOWNNOTEBOOK_PARAMETRIZE( + input, + [input_filename: "hello.txt", n_iter: 12], + file(params.test_data['generic']['txt']['hello'], checkIfExists: true) + ) + +} + diff --git a/tests/modules/rmarkdownnotebook/nextflow.config b/tests/modules/rmarkdownnotebook/nextflow.config new file mode 100644 index 00000000..c99f5250 --- /dev/null +++ b/tests/modules/rmarkdownnotebook/nextflow.config @@ -0,0 +1,15 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: RMARKDOWNNOTEBOOK { + ext = ['parametrize': false] + } + + // this should be the default options, but need to work around + // https://github.com/nextflow-io/nextflow/issues/2422 + withName: RMARKDOWNNOTEBOOK_PARAMETRIZE { + ext = ['parametrize': true] + } + +} diff --git a/tests/modules/rmarkdownnotebook/test.yml b/tests/modules/rmarkdownnotebook/test.yml new file mode 100644 index 00000000..3645514a --- /dev/null +++ b/tests/modules/rmarkdownnotebook/test.yml @@ -0,0 +1,27 @@ +- name: rmarkdownnotebook test_rmarkdown + command: nextflow run ./tests/modules/rmarkdownnotebook -entry test_rmarkdown -c ./tests/config/nextflow.config -c ./tests/modules/rmarkdownnotebook/nextflow.config + tags: + - rmarkdownnotebook + files: + - path: output/rmarkdownnotebook/session_info.log + contains: + - R version 4.1.0 + - yaml_2.2.1 + - path: output/rmarkdownnotebook/test_rmd.html + contains: + - "n_iter = 10" + +- name: rmarkdownnotebook test_rmarkdown_parametrize + command: nextflow run ./tests/modules/rmarkdownnotebook -entry test_rmarkdown_parametrize -c ./tests/config/nextflow.config -c ./tests/modules/rmarkdownnotebook/nextflow.config + tags: + - rmarkdownnotebook + files: + - path: output/rmarkdownnotebook/artifacts/artifact.txt + md5sum: b10a8db164e0754105b7a99be72e3fe5 + - path: output/rmarkdownnotebook/session_info.log + contains: + - R version 4.1.0 + - yaml_2.2.1 + - path: output/rmarkdownnotebook/test_rmd.html + contains: + - "n_iter = 12" diff --git a/tests/modules/roary/main.nf b/tests/modules/roary/main.nf new file mode 100644 index 00000000..3fae516c --- /dev/null +++ b/tests/modules/roary/main.nf @@ -0,0 +1,19 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ROARY } from '../../../modules/roary/main.nf' + +workflow test_roary { + + input = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test1_gff'], checkIfExists: true), + file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test2_gff'], checkIfExists: true), + file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['test3_gff'], checkIfExists: true) + ] + ] + + ROARY ( input ) +} diff --git a/tests/modules/roary/nextflow.config b/tests/modules/roary/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/roary/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/roary/test.yml b/tests/modules/roary/test.yml new file mode 100644 index 00000000..981ab51c --- /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 -c ./tests/modules/roary/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: d4191cf748dd8016ad877857a034bef3 + - path: output/roary/results/accessory_binary_genes.fa.newick + md5sum: d4a2a64e781263ca1b9b3a4bc9d3a6ea + - 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="test1 test2 test3"'] + - 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 diff --git a/tests/modules/rsem/calculateexpression/main.nf b/tests/modules/rsem/calculateexpression/main.nf index ee01687e..9d6d3c5c 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' +include { RSEM_CALCULATEEXPRESSION } from '../../../../modules/rsem/calculateexpression/main.nf' 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/calculateexpression/nextflow.config b/tests/modules/rsem/calculateexpression/nextflow.config new file mode 100644 index 00000000..b17a1cf2 --- /dev/null +++ b/tests/modules/rsem/calculateexpression/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: RSEM_PREPAREREFERENCE { + ext.args = '--star' + } + + withName: RSEM_CALCULATEEXPRESSION { + ext.args = '--star --star-gzipped-read-file' + } + +} diff --git a/tests/modules/rsem/calculateexpression/test.yml b/tests/modules/rsem/calculateexpression/test.yml index 9eb5effc..f19c3398 100644 --- a/tests/modules/rsem/calculateexpression/test.yml +++ b/tests/modules/rsem/calculateexpression/test.yml @@ -1,55 +1,55 @@ - name: rsem calculateexpression test_rsem_calculateexpression - command: nextflow run tests/modules/rsem/calculateexpression -entry test_rsem_calculateexpression -c tests/config/nextflow.config + command: nextflow run ./tests/modules/rsem/calculateexpression -entry test_rsem_calculateexpression -c ./tests/config/nextflow.config -c ./tests/modules/rsem/calculateexpression/nextflow.config tags: - - rsem/calculateexpression - rsem + - rsem/calculateexpression files: - - path: output/index/rsem/Genome + - path: output/rsem/rsem/Genome md5sum: a654229fbca6071dcb6b01ce7df704da - - path: output/index/rsem/Log.out - - path: output/index/rsem/SA + - path: output/rsem/rsem/Log.out + - path: output/rsem/rsem/SA md5sum: 8c3edc46697b72c9e92440d4cf43506c - - path: output/index/rsem/SAindex + - path: output/rsem/rsem/SAindex md5sum: fd05c149960e72642a8d7c860528ae81 - - path: output/index/rsem/chrLength.txt + - path: output/rsem/rsem/chrLength.txt md5sum: c81f40f27e72606d7d07097c1d56a5b5 - - path: output/index/rsem/chrName.txt + - path: output/rsem/rsem/chrName.txt md5sum: 5ae68a67b70976ee95342a7451cb5af1 - - path: output/index/rsem/chrNameLength.txt + - path: output/rsem/rsem/chrNameLength.txt md5sum: b190587cae0531f3cf25552d8aa674db - - path: output/index/rsem/chrStart.txt + - path: output/rsem/rsem/chrStart.txt md5sum: 8d3291e6bcdbe9902fbd7c887494173f - - path: output/index/rsem/exonGeTrInfo.tab + - path: output/rsem/rsem/exonGeTrInfo.tab md5sum: d04497f69d6ef889efd4d34fe63edcc4 - - path: output/index/rsem/exonInfo.tab + - path: output/rsem/rsem/exonInfo.tab md5sum: 0d560290fab688b7268d88d5494bf9fe - - path: output/index/rsem/geneInfo.tab + - path: output/rsem/rsem/geneInfo.tab md5sum: 8b608537307443ffaee4927d2b428805 - - 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 - - path: output/index/rsem/genomeParameters.txt + - path: output/rsem/rsem/genomeParameters.txt md5sum: 2fe3a030e1706c3e8cd4df3818e6dd2f - - path: output/index/rsem/sjdbInfo.txt + - path: output/rsem/rsem/sjdbInfo.txt md5sum: 5690ea9d9f09f7ff85b7fd47bd234903 - - path: output/index/rsem/sjdbList.fromGTF.out.tab + - path: output/rsem/rsem/sjdbList.fromGTF.out.tab md5sum: 8760c33e966dad0b39f440301ebbdee4 - - path: output/index/rsem/sjdbList.out.tab + - path: output/rsem/rsem/sjdbList.out.tab md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1 - - path: output/index/rsem/transcriptInfo.tab + - path: output/rsem/rsem/transcriptInfo.tab md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/rsem/test.genes.results md5sum: c7ec226f76736ea805771e73553ae359 diff --git a/tests/modules/rsem/preparereference/main.nf b/tests/modules/rsem/preparereference/main.nf index a579960b..8062737d 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' workflow test_rsem_preparereference { diff --git a/tests/modules/rsem/preparereference/nextflow.config b/tests/modules/rsem/preparereference/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/rsem/preparereference/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/rsem/preparereference/test.yml b/tests/modules/rsem/preparereference/test.yml index 1526120e..1f058bea 100644 --- a/tests/modules/rsem/preparereference/test.yml +++ b/tests/modules/rsem/preparereference/test.yml @@ -1,22 +1,22 @@ - name: rsem preparereference test_rsem_preparereference - command: nextflow run tests/modules/rsem/preparereference -entry test_rsem_preparereference -c tests/config/nextflow.config + command: nextflow run ./tests/modules/rsem/preparereference -entry test_rsem_preparereference -c ./tests/config/nextflow.config -c ./tests/modules/rsem/preparereference/nextflow.config tags: - 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/rseqc/bamstat/main.nf b/tests/modules/rseqc/bamstat/main.nf index c13e7f97..4c53a1af 100644 --- a/tests/modules/rseqc/bamstat/main.nf +++ b/tests/modules/rseqc/bamstat/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { RSEQC_BAMSTAT } from '../../../../modules/rseqc/bamstat/main.nf' addParams(options: [:]) +include { RSEQC_BAMSTAT } from '../../../../modules/rseqc/bamstat/main.nf' workflow test_rseqc_bamstat { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/rseqc/bamstat/nextflow.config b/tests/modules/rseqc/bamstat/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/rseqc/bamstat/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/rseqc/bamstat/test.yml b/tests/modules/rseqc/bamstat/test.yml index 75d62672..4cb35d0c 100644 --- a/tests/modules/rseqc/bamstat/test.yml +++ b/tests/modules/rseqc/bamstat/test.yml @@ -1,5 +1,5 @@ - name: rseqc bamstat test_rseqc_bamstat - command: nextflow run tests/modules/rseqc/bamstat -entry test_rseqc_bamstat -c tests/config/nextflow.config + command: nextflow run ./tests/modules/rseqc/bamstat -entry test_rseqc_bamstat -c ./tests/config/nextflow.config -c ./tests/modules/rseqc/bamstat/nextflow.config tags: - rseqc - rseqc/bamstat diff --git a/tests/modules/rseqc/inferexperiment/main.nf b/tests/modules/rseqc/inferexperiment/main.nf index ae8c53a9..6337063d 100644 --- a/tests/modules/rseqc/inferexperiment/main.nf +++ b/tests/modules/rseqc/inferexperiment/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { RSEQC_INFEREXPERIMENT } from '../../../../modules/rseqc/inferexperiment/main.nf' addParams(options: [:]) +include { RSEQC_INFEREXPERIMENT } from '../../../../modules/rseqc/inferexperiment/main.nf' workflow test_rseqc_inferexperiment { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/rseqc/inferexperiment/nextflow.config b/tests/modules/rseqc/inferexperiment/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/rseqc/inferexperiment/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/rseqc/inferexperiment/test.yml b/tests/modules/rseqc/inferexperiment/test.yml index 59d6f3d5..554f8317 100644 --- a/tests/modules/rseqc/inferexperiment/test.yml +++ b/tests/modules/rseqc/inferexperiment/test.yml @@ -1,5 +1,5 @@ - name: rseqc inferexperiment test_rseqc_inferexperiment - command: nextflow run tests/modules/rseqc/inferexperiment -entry test_rseqc_inferexperiment -c tests/config/nextflow.config + command: nextflow run ./tests/modules/rseqc/inferexperiment -entry test_rseqc_inferexperiment -c ./tests/config/nextflow.config -c ./tests/modules/rseqc/inferexperiment/nextflow.config tags: - rseqc - rseqc/inferexperiment diff --git a/tests/modules/rseqc/innerdistance/main.nf b/tests/modules/rseqc/innerdistance/main.nf index 003e8a14..8cc0ec3e 100644 --- a/tests/modules/rseqc/innerdistance/main.nf +++ b/tests/modules/rseqc/innerdistance/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { RSEQC_INNERDISTANCE } from '../../../../modules/rseqc/innerdistance/main.nf' addParams(options: [:]) +include { RSEQC_INNERDISTANCE } from '../../../../modules/rseqc/innerdistance/main.nf' workflow test_rseqc_innerdistance { input = [ [ id:'test', single_end: false ], // meta map diff --git a/tests/modules/rseqc/innerdistance/nextflow.config b/tests/modules/rseqc/innerdistance/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/rseqc/innerdistance/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/rseqc/innerdistance/test.yml b/tests/modules/rseqc/innerdistance/test.yml index b0ee0283..c0f480e9 100644 --- a/tests/modules/rseqc/innerdistance/test.yml +++ b/tests/modules/rseqc/innerdistance/test.yml @@ -1,5 +1,5 @@ - name: rseqc innerdistance test_rseqc_innerdistance - command: nextflow run tests/modules/rseqc/innerdistance -entry test_rseqc_innerdistance -c tests/config/nextflow.config + command: nextflow run ./tests/modules/rseqc/innerdistance -entry test_rseqc_innerdistance -c ./tests/config/nextflow.config -c ./tests/modules/rseqc/innerdistance/nextflow.config tags: - rseqc - rseqc/innerdistance diff --git a/tests/modules/rseqc/junctionannotation/main.nf b/tests/modules/rseqc/junctionannotation/main.nf index a6913850..303dcd85 100644 --- a/tests/modules/rseqc/junctionannotation/main.nf +++ b/tests/modules/rseqc/junctionannotation/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { RSEQC_JUNCTIONANNOTATION } from '../../../../modules/rseqc/junctionannotation/main.nf' addParams(options: [:]) +include { RSEQC_JUNCTIONANNOTATION } from '../../../../modules/rseqc/junctionannotation/main.nf' workflow test_rseqc_junctionannotation { input = [ diff --git a/tests/modules/rseqc/junctionannotation/nextflow.config b/tests/modules/rseqc/junctionannotation/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/rseqc/junctionannotation/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/rseqc/junctionannotation/test.yml b/tests/modules/rseqc/junctionannotation/test.yml index 39326f67..f2020b10 100644 --- a/tests/modules/rseqc/junctionannotation/test.yml +++ b/tests/modules/rseqc/junctionannotation/test.yml @@ -1,5 +1,5 @@ - name: rseqc junctionannotation test_rseqc_junctionannotation - command: nextflow run tests/modules/rseqc/junctionannotation -entry test_rseqc_junctionannotation -c tests/config/nextflow.config + command: nextflow run ./tests/modules/rseqc/junctionannotation -entry test_rseqc_junctionannotation -c ./tests/config/nextflow.config -c ./tests/modules/rseqc/junctionannotation/nextflow.config tags: - rseqc - rseqc/junctionannotation diff --git a/tests/modules/rseqc/junctionsaturation/main.nf b/tests/modules/rseqc/junctionsaturation/main.nf index 047fb372..eefbb492 100644 --- a/tests/modules/rseqc/junctionsaturation/main.nf +++ b/tests/modules/rseqc/junctionsaturation/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { RSEQC_JUNCTIONSATURATION } from '../../../../modules/rseqc/junctionsaturation/main.nf' addParams(options: [:]) +include { RSEQC_JUNCTIONSATURATION } from '../../../../modules/rseqc/junctionsaturation/main.nf' workflow test_rseqc_junctionsaturation { input = [ diff --git a/tests/modules/rseqc/junctionsaturation/nextflow.config b/tests/modules/rseqc/junctionsaturation/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/rseqc/junctionsaturation/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/rseqc/junctionsaturation/test.yml b/tests/modules/rseqc/junctionsaturation/test.yml index dfadb371..db977360 100644 --- a/tests/modules/rseqc/junctionsaturation/test.yml +++ b/tests/modules/rseqc/junctionsaturation/test.yml @@ -1,5 +1,5 @@ - name: rseqc junctionsaturation test_rseqc_junctionsaturation - command: nextflow run tests/modules/rseqc/junctionsaturation -entry test_rseqc_junctionsaturation -c tests/config/nextflow.config + command: nextflow run ./tests/modules/rseqc/junctionsaturation -entry test_rseqc_junctionsaturation -c ./tests/config/nextflow.config -c ./tests/modules/rseqc/junctionsaturation/nextflow.config tags: - rseqc/junctionsaturation - rseqc diff --git a/tests/modules/rseqc/readdistribution/main.nf b/tests/modules/rseqc/readdistribution/main.nf index 415aed9a..180367f2 100644 --- a/tests/modules/rseqc/readdistribution/main.nf +++ b/tests/modules/rseqc/readdistribution/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { RSEQC_READDISTRIBUTION } from '../../../../modules/rseqc/readdistribution/main.nf' addParams(options: [:]) +include { RSEQC_READDISTRIBUTION } from '../../../../modules/rseqc/readdistribution/main.nf' workflow test_rseqc_readdistribution { input = [ [ id:'test', single_end: false ], // meta map diff --git a/tests/modules/rseqc/readdistribution/nextflow.config b/tests/modules/rseqc/readdistribution/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/rseqc/readdistribution/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/rseqc/readdistribution/test.yml b/tests/modules/rseqc/readdistribution/test.yml index 79e7e1d3..e530e92a 100644 --- a/tests/modules/rseqc/readdistribution/test.yml +++ b/tests/modules/rseqc/readdistribution/test.yml @@ -1,5 +1,5 @@ - name: rseqc readdistribution test_rseqc_readdistribution - command: nextflow run tests/modules/rseqc/readdistribution -entry test_rseqc_readdistribution -c tests/config/nextflow.config + command: nextflow run ./tests/modules/rseqc/readdistribution -entry test_rseqc_readdistribution -c ./tests/config/nextflow.config -c ./tests/modules/rseqc/readdistribution/nextflow.config tags: - rseqc - rseqc/readdistribution diff --git a/tests/modules/rseqc/readduplication/main.nf b/tests/modules/rseqc/readduplication/main.nf index b94f6945..bcccde5d 100644 --- a/tests/modules/rseqc/readduplication/main.nf +++ b/tests/modules/rseqc/readduplication/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { RSEQC_READDUPLICATION } from '../../../../modules/rseqc/readduplication/main.nf' addParams(options: [:]) +include { RSEQC_READDUPLICATION } from '../../../../modules/rseqc/readduplication/main.nf' workflow test_rseqc_readduplication { input = [ [ id:'test', single_end: false ], // meta map diff --git a/tests/modules/rseqc/readduplication/nextflow.config b/tests/modules/rseqc/readduplication/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/rseqc/readduplication/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/rseqc/readduplication/test.yml b/tests/modules/rseqc/readduplication/test.yml index 2a4c9546..b0c35071 100644 --- a/tests/modules/rseqc/readduplication/test.yml +++ b/tests/modules/rseqc/readduplication/test.yml @@ -1,5 +1,5 @@ - name: rseqc readduplication test_rseqc_readduplication - command: nextflow run tests/modules/rseqc/readduplication -entry test_rseqc_readduplication -c tests/config/nextflow.config + command: nextflow run ./tests/modules/rseqc/readduplication -entry test_rseqc_readduplication -c ./tests/config/nextflow.config -c ./tests/modules/rseqc/readduplication/nextflow.config tags: - rseqc/readduplication - rseqc diff --git a/tests/modules/rseqc/tin/main.nf b/tests/modules/rseqc/tin/main.nf new file mode 100644 index 00000000..677e1165 --- /dev/null +++ b/tests/modules/rseqc/tin/main.nf @@ -0,0 +1,18 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { RSEQC_TIN } from '../../../../modules/rseqc/tin/main.nf' + +workflow test_rseqc_tin { + + input = [ + [ id:'test' ], // 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) + ] + + bed = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + + RSEQC_TIN ( input, bed ) +} diff --git a/tests/modules/rseqc/tin/nextflow.config b/tests/modules/rseqc/tin/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/rseqc/tin/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/rseqc/tin/test.yml b/tests/modules/rseqc/tin/test.yml new file mode 100644 index 00000000..9faae202 --- /dev/null +++ b/tests/modules/rseqc/tin/test.yml @@ -0,0 +1,10 @@ +- name: rseqc tin + command: nextflow run ./tests/modules/rseqc/tin -entry test_rseqc_tin -c ./tests/config/nextflow.config -c ./tests/modules/rseqc/tin/nextflow.config + tags: + - rseqc + - rseqc/tin + files: + - path: output/rseqc/test.paired_end.sorted.summary.txt + md5sum: 9d98447e178b89a89f6f5aba7a772fe6 + - path: output/rseqc/test.paired_end.sorted.tin.xls + md5sum: 6b1b1b0dc1dc265342ba8c3f27fa60e6 diff --git a/tests/modules/salmon/index/main.nf b/tests/modules/salmon/index/main.nf index d4c87c45..680b4c6e 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' 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/nextflow.config b/tests/modules/salmon/index/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/salmon/index/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/salmon/index/test.yml b/tests/modules/salmon/index/test.yml index 722cd24f..07815e37 100644 --- a/tests/modules/salmon/index/test.yml +++ b/tests/modules/salmon/index/test.yml @@ -1,31 +1,31 @@ - name: salmon index - command: nextflow run ./tests/modules/salmon/index -entry test_salmon_index -c tests/config/nextflow.config + command: nextflow run ./tests/modules/salmon/index -entry test_salmon_index -c ./tests/config/nextflow.config -c ./tests/modules/salmon/index/nextflow.config tags: - 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 - md5sum: 204865f645102587c4953fccb256797c - - path: ./output/index/salmon/complete_ref_lens.bin + - path: ./output/salmon/salmon/versionInfo.json + md5sum: 6c764bd219b7bc17168a99d232c0fe09 + - 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/salmon/quant/main.nf b/tests/modules/salmon/quant/main.nf index ad15870c..a970f6c5 100644 --- a/tests/modules/salmon/quant/main.nf +++ b/tests/modules/salmon/quant/main.nf @@ -2,14 +2,17 @@ nextflow.enable.dsl = 2 -include { SALMON_INDEX } from '../../../../modules/salmon/index/main.nf' addParams( options: [:] ) -include { SALMON_QUANT } from '../../../../modules/salmon/quant/main.nf' addParams( options: [args: '--minAssignedFrags 1'] ) +include { SALMON_INDEX } from '../../../../modules/salmon/index/main.nf' +include { SALMON_QUANT } from '../../../../modules/salmon/quant/main.nf' workflow test_salmon_quant_single_end { - input = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_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) + ] + ] genome_fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) transcript_fasta = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) @@ -21,10 +24,13 @@ workflow test_salmon_quant_single_end { workflow test_salmon_quant_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) ] - ] + 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) + ] + ] genome_fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) transcript_fasta = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) @@ -36,9 +42,12 @@ workflow test_salmon_quant_paired_end { workflow test_salmon_quant_single_end_lib_type_A { - input = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_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) + ] + ] genome_fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) transcript_fasta = file(params.test_data['sarscov2']['genome']['transcriptome_fasta'], checkIfExists: true) gtf = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true) diff --git a/tests/modules/salmon/quant/nextflow.config b/tests/modules/salmon/quant/nextflow.config new file mode 100644 index 00000000..7a8c911a --- /dev/null +++ b/tests/modules/salmon/quant/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SALMON_QUANT { + ext.args = '--minAssignedFrags 1' + } + +} diff --git a/tests/modules/salmon/quant/test.yml b/tests/modules/salmon/quant/test.yml index 5a1ebdd8..514718fa 100644 --- a/tests/modules/salmon/quant/test.yml +++ b/tests/modules/salmon/quant/test.yml @@ -1,5 +1,5 @@ - name: salmon quant single-end - command: nextflow run ./tests/modules/salmon/quant -entry test_salmon_quant_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/salmon/quant -entry test_salmon_quant_single_end -c ./tests/config/nextflow.config -c ./tests/modules/salmon/quant/nextflow.config tags: - salmon - salmon/quant @@ -9,7 +9,7 @@ md5sum: 687368b9963874c1797d210310b38516 - path: ./output/salmon/test/lib_format_counts.json - path: ./output/salmon/test/quant.genes.sf - md5sum: ad4d31437f06db49b2436abeec29c78e + md5sum: af6d88f109e0d0d6a0826bdf2b3b7e97 - path: ./output/salmon/test/logs/salmon_quant.log - path: ./output/salmon/test/aux_info/expected_bias.gz md5sum: 24ee10af39b41ecf4f4e08faaaf537ee @@ -23,34 +23,34 @@ md5sum: ef13c06a538e9c34ca9f84212c82f44e - path: ./output/salmon/test/libParams/flenDist.txt md5sum: 2de170bdc9f6fd237d286429b292bb28 - - 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 - md5sum: 204865f645102587c4953fccb256797c - - path: ./output/index/salmon/complete_ref_lens.bin + - path: ./output/salmon/salmon/versionInfo.json + md5sum: 6c764bd219b7bc17168a99d232c0fe09 + - 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 - name: salmon quant paired end - command: nextflow run ./tests/modules/salmon/quant -entry test_salmon_quant_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/salmon/quant -entry test_salmon_quant_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/salmon/quant/nextflow.config tags: - salmon - salmon/quant @@ -60,7 +60,7 @@ md5sum: 4abd35d0a60b5279b394424f0e6ea42d - path: ./output/salmon/test/lib_format_counts.json - path: ./output/salmon/test/quant.genes.sf - md5sum: d750f8c9f248e30c3a6d0c2678bf9c6a + md5sum: 29c8cd26f609cacd4fb88713df9c71c2 - path: ./output/salmon/test/logs/salmon_quant.log - path: ./output/salmon/test/aux_info/expected_bias.gz md5sum: 24ee10af39b41ecf4f4e08faaaf537ee @@ -74,35 +74,35 @@ md5sum: ef13c06a538e9c34ca9f84212c82f44e - path: ./output/salmon/test/libParams/flenDist.txt md5sum: 221f754ed55dd1e34874f9b7b3f9d240 - - 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 - md5sum: 204865f645102587c4953fccb256797c - - path: ./output/index/salmon/complete_ref_lens.bin + - path: ./output/salmon/salmon/versionInfo.json + md5sum: 6c764bd219b7bc17168a99d232c0fe09 + - 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 - name: salmon quant test_salmon_quant_single_end_lib_type_A - command: nextflow run tests/modules/salmon/quant -entry test_salmon_quant_single_end_lib_type_A -c tests/config/nextflow.config + command: nextflow run ./tests/modules/salmon/quant -entry test_salmon_quant_single_end_lib_type_A -c ./tests/config/nextflow.config -c ./tests/modules/salmon/quant/nextflow.config tags: - salmon/quant - salmon @@ -112,7 +112,7 @@ md5sum: 687368b9963874c1797d210310b38516 - path: ./output/salmon/test/lib_format_counts.json - path: ./output/salmon/test/quant.genes.sf - md5sum: ad4d31437f06db49b2436abeec29c78e + md5sum: af6d88f109e0d0d6a0826bdf2b3b7e97 - path: ./output/salmon/test/logs/salmon_quant.log - path: output/salmon/test/aux_info/expected_bias.gz md5sum: 24ee10af39b41ecf4f4e08faaaf537ee @@ -126,26 +126,26 @@ md5sum: ef13c06a538e9c34ca9f84212c82f44e - path: output/salmon/test/libParams/flenDist.txt md5sum: 2de170bdc9f6fd237d286429b292bb28 - - 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 - md5sum: 204865f645102587c4953fccb256797c - - path: output/index/salmon/complete_ref_lens.bin + - path: output/salmon/salmon/versionInfo.json + md5sum: 6c764bd219b7bc17168a99d232c0fe09 + - 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/duplicate_clusters.tsv + - 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/samblaster/main.nf b/tests/modules/samblaster/main.nf new file mode 100644 index 00000000..5831ecfc --- /dev/null +++ b/tests/modules/samblaster/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SAMBLASTER } from '../../../modules/samblaster/main.nf' + +workflow test_samblaster { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_umi_unsorted_bam'], checkIfExists: true) ] + + SAMBLASTER ( input ) +} diff --git a/tests/modules/samblaster/nextflow.config b/tests/modules/samblaster/nextflow.config new file mode 100644 index 00000000..7ba8b23b --- /dev/null +++ b/tests/modules/samblaster/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SAMBLASTER { + ext.args = '-M --addMateTags' + ext.prefix = { "${meta.id}.processed" } + } + +} diff --git a/tests/modules/samblaster/test.yml b/tests/modules/samblaster/test.yml new file mode 100644 index 00000000..acc6d0f0 --- /dev/null +++ b/tests/modules/samblaster/test.yml @@ -0,0 +1,7 @@ +- name: samblaster test_samblaster + command: nextflow run ./tests/modules/samblaster -entry test_samblaster -c ./tests/config/nextflow.config -c ./tests/modules/samblaster/nextflow.config + tags: + - samblaster + files: + - path: output/samblaster/test.processed.bam + md5sum: 950f23d85f75be1cf872f45c0144bdf4 diff --git a/tests/modules/samtools/ampliconclip/main.nf b/tests/modules/samtools/ampliconclip/main.nf new file mode 100644 index 00000000..eae70b06 --- /dev/null +++ b/tests/modules/samtools/ampliconclip/main.nf @@ -0,0 +1,44 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SAMTOOLS_AMPLICONCLIP } from '../../../../modules/samtools/ampliconclip/main.nf' + +workflow test_samtools_ampliconclip_no_stats_no_rejects { + + input = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + bed = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + save_cliprejects = false + save_clipstats = false + + SAMTOOLS_AMPLICONCLIP ( input, bed, save_cliprejects, save_clipstats ) +} + +workflow test_samtools_ampliconclip_no_stats_with_rejects { + + input = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + bed = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + save_cliprejects = true + save_clipstats = false + + SAMTOOLS_AMPLICONCLIP ( input, bed, save_cliprejects, save_clipstats ) +} + +workflow test_samtools_ampliconclip_with_stats_with_rejects { + + input = [ + [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + bed = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + save_cliprejects = true + save_clipstats = true + + SAMTOOLS_AMPLICONCLIP ( input, bed, save_cliprejects, save_clipstats ) +} diff --git a/tests/modules/samtools/ampliconclip/nextflow.config b/tests/modules/samtools/ampliconclip/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/samtools/ampliconclip/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/samtools/ampliconclip/test.yml b/tests/modules/samtools/ampliconclip/test.yml new file mode 100644 index 00000000..e8fd456c --- /dev/null +++ b/tests/modules/samtools/ampliconclip/test.yml @@ -0,0 +1,32 @@ +- name: samtools ampliconclip no stats no rejects + command: nextflow run ./tests/modules/samtools/ampliconclip -entry test_samtools_ampliconclip_no_stats_no_rejects -c ./tests/config/nextflow.config -c ./tests/modules/samtools/ampliconclip/nextflow.config + tags: + - samtools + - samtools/ampliconclip + files: + - path: output/samtools/test.bam + md5sum: 678f9ab04fbe3206f0f96e170fd833e9 + +- name: samtools ampliconclip no stats with rejects + command: nextflow run ./tests/modules/samtools/ampliconclip -entry test_samtools_ampliconclip_no_stats_with_rejects -c ./tests/config/nextflow.config -c ./tests/modules/samtools/ampliconclip/nextflow.config + tags: + - samtools + - samtools/ampliconclip + files: + - path: output/samtools/test.bam + md5sum: bbf65ea626539d96c8271e17d1fc988b + - path: output/samtools/test.cliprejects.bam + md5sum: a0bee15aead020d16d0c81bd9667df46 + +- name: samtools ampliconclip with stats with rejects + command: nextflow run ./tests/modules/samtools/ampliconclip -entry test_samtools_ampliconclip_with_stats_with_rejects -c ./tests/config/nextflow.config -c ./tests/modules/samtools/ampliconclip/nextflow.config + tags: + - samtools + - samtools/ampliconclip + files: + - path: output/samtools/test.bam + md5sum: f5a3611ecad34ba2dde77096e1c7dd93 + - path: output/samtools/test.cliprejects.bam + md5sum: 90ee7ce908b4bdb89ab41e4410de9012 + - path: output/samtools/test.clipstats.txt + md5sum: fc23355e1743d47f2541f2cb1a7a0cda diff --git a/tests/modules/samtools/bam2fq/main.nf b/tests/modules/samtools/bam2fq/main.nf new file mode 100644 index 00000000..928bfe08 --- /dev/null +++ b/tests/modules/samtools/bam2fq/main.nf @@ -0,0 +1,24 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SAMTOOLS_BAM2FQ } from '../../../../modules/samtools/bam2fq/main.nf' + +workflow test_samtools_bam2fq_nosplit { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_umi_converted_bam'], checkIfExists: true) ] + split = false + + SAMTOOLS_BAM2FQ ( input, split ) +} + + +workflow test_samtools_bam2fq_withsplit { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_umi_converted_bam'], checkIfExists: true) ] + split = true + + SAMTOOLS_BAM2FQ ( input, split ) +} diff --git a/tests/modules/samtools/bam2fq/nextflow.config b/tests/modules/samtools/bam2fq/nextflow.config new file mode 100644 index 00000000..cf886bb2 --- /dev/null +++ b/tests/modules/samtools/bam2fq/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SAMTOOLS_BAM2FQ { + ext.args = '-T RX' + } + +} diff --git a/tests/modules/samtools/bam2fq/test.yml b/tests/modules/samtools/bam2fq/test.yml new file mode 100644 index 00000000..feb994fd --- /dev/null +++ b/tests/modules/samtools/bam2fq/test.yml @@ -0,0 +1,23 @@ +- name: samtools bam2fq test_samtools_bam2fq_nosplit + command: nextflow run ./tests/modules/samtools/bam2fq -entry test_samtools_bam2fq_nosplit -c ./tests/config/nextflow.config -c ./tests/modules/samtools/bam2fq/nextflow.config + tags: + - samtools/bam2fq + - samtools + files: + - path: output/samtools/test_interleaved.fq.gz + md5sum: d733e66d29a4b366bf9df8c42f845256 + +- name: samtools bam2fq test_samtools_bam2fq_withsplit + command: nextflow run ./tests/modules/samtools/bam2fq -entry test_samtools_bam2fq_withsplit -c ./tests/config/nextflow.config -c ./tests/modules/samtools/bam2fq/nextflow.config + tags: + - samtools/bam2fq + - samtools + files: + - path: output/samtools/test_1.fq.gz + md5sum: 4522edbe158ec4804765794569f67493 + - path: output/samtools/test_2.fq.gz + md5sum: 7e00ef40d5cfe272b67461381019dcc1 + - path: output/samtools/test_other.fq.gz + md5sum: 709872fc2910431b1e8b7074bfe38c67 + - path: output/samtools/test_singleton.fq.gz + md5sum: 709872fc2910431b1e8b7074bfe38c67 diff --git a/tests/modules/samtools/depth/main.nf b/tests/modules/samtools/depth/main.nf new file mode 100644 index 00000000..c6d2dc0e --- /dev/null +++ b/tests/modules/samtools/depth/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SAMTOOLS_DEPTH } from '../../../../modules/samtools/depth/main.nf' + +workflow test_samtools_depth { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true) ] + + SAMTOOLS_DEPTH ( input ) +} diff --git a/tests/modules/samtools/depth/nextflow.config b/tests/modules/samtools/depth/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/samtools/depth/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/samtools/depth/test.yml b/tests/modules/samtools/depth/test.yml new file mode 100644 index 00000000..978134ad --- /dev/null +++ b/tests/modules/samtools/depth/test.yml @@ -0,0 +1,8 @@ +- name: samtools depth + command: nextflow run ./tests/modules/samtools/depth -entry test_samtools_depth -c ./tests/config/nextflow.config -c ./tests/modules/samtools/depth/nextflow.config + tags: + - samtools/depth + - samtools + files: + - path: output/samtools/test.tsv + md5sum: aa27ebf69663ebded553b4d6538219d9 diff --git a/tests/modules/samtools/faidx/main.nf b/tests/modules/samtools/faidx/main.nf index 0102af28..bc4dc5e3 100644 --- a/tests/modules/samtools/faidx/main.nf +++ b/tests/modules/samtools/faidx/main.nf @@ -2,10 +2,12 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_FAIDX } from '../../../../modules/samtools/faidx/main.nf' addParams( options: [:] ) +include { SAMTOOLS_FAIDX } from '../../../../modules/samtools/faidx/main.nf' workflow test_samtools_faidx { - fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - SAMTOOLS_FAIDX ( fasta ) + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + SAMTOOLS_FAIDX ( input ) } diff --git a/tests/modules/samtools/faidx/nextflow.config b/tests/modules/samtools/faidx/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/samtools/faidx/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/samtools/faidx/test.yml b/tests/modules/samtools/faidx/test.yml index bcadf955..dc2184ee 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_samtools_faidx command: nextflow run tests/modules/samtools/faidx -entry test_samtools_faidx -c tests/config/nextflow.config tags: - samtools @@ -6,3 +6,5 @@ files: - path: output/samtools/genome.fasta.fai md5sum: 9da2a56e2853dc8c0b86a9e7229c9fe5 + - path: output/samtools/versions.yml + md5sum: d56671a7c8f8058944d3d536c3058f7f diff --git a/tests/modules/samtools/fastq/main.nf b/tests/modules/samtools/fastq/main.nf index 94ad9471..6e7e323c 100644 --- a/tests/modules/samtools/fastq/main.nf +++ b/tests/modules/samtools/fastq/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_FASTQ } from '../../../../modules/samtools/fastq/main.nf' addParams( options: [:] ) +include { SAMTOOLS_FASTQ } from '../../../../modules/samtools/fastq/main.nf' workflow test_samtools_fastq { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/samtools/fastq/nextflow.config b/tests/modules/samtools/fastq/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/samtools/fastq/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/samtools/fastq/test.yml b/tests/modules/samtools/fastq/test.yml index 3fdc0ef6..39da9889 100644 --- a/tests/modules/samtools/fastq/test.yml +++ b/tests/modules/samtools/fastq/test.yml @@ -1,10 +1,10 @@ - name: samtools fastq test_samtools_fastq - command: nextflow run tests/modules/samtools/fastq -entry test_samtools_fastq -c tests/config/nextflow.config + command: nextflow run ./tests/modules/samtools/fastq -entry test_samtools_fastq -c ./tests/config/nextflow.config -c ./tests/modules/samtools/fastq/nextflow.config tags: - samtools - samtools/fastq files: - path: output/samtools/test_2.fastq.gz - md5sum: 229daf1a62d114cae42c65801e8c0114 + md5sum: 3b1c92f33a44a78d82f8360ab4fdfd61 - path: output/samtools/test_1.fastq.gz - md5sum: 4cab81f76e66361611621377f1b69d1d + md5sum: 5a3f9c69a032c4ffd9071ea31a14e6f9 diff --git a/tests/modules/samtools/fixmate/main.nf b/tests/modules/samtools/fixmate/main.nf new file mode 100644 index 00000000..cb7c136d --- /dev/null +++ b/tests/modules/samtools/fixmate/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SAMTOOLS_FIXMATE } from '../../../../modules/samtools/fixmate/main.nf' + +workflow test_samtools_fixmate { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) ] + + SAMTOOLS_FIXMATE ( input ) + +} diff --git a/tests/modules/samtools/fixmate/nextflow.config b/tests/modules/samtools/fixmate/nextflow.config new file mode 100644 index 00000000..b9402bcf --- /dev/null +++ b/tests/modules/samtools/fixmate/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SAMTOOLS_FIXMATE { + ext.args = '-r -c -m' + } + +} diff --git a/tests/modules/samtools/fixmate/test.yml b/tests/modules/samtools/fixmate/test.yml new file mode 100644 index 00000000..8e87e059 --- /dev/null +++ b/tests/modules/samtools/fixmate/test.yml @@ -0,0 +1,8 @@ +- name: samtools fixmate test_samtools_fixmate + command: nextflow run ./tests/modules/samtools/fixmate -entry test_samtools_fixmate -c ./tests/config/nextflow.config -c ./tests/modules/samtools/fixmate/nextflow.config + tags: + - samtools + - samtools/fixmate + files: + - path: output/samtools/test.bam + md5sum: a4092657a4b17170c7702a76cbf192a1 diff --git a/tests/modules/samtools/flagstat/main.nf b/tests/modules/samtools/flagstat/main.nf index a31a7d22..a0e86422 100644 --- a/tests/modules/samtools/flagstat/main.nf +++ b/tests/modules/samtools/flagstat/main.nf @@ -2,13 +2,14 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_FLAGSTAT } from '../../../../modules/samtools/flagstat/main.nf' addParams( options: [:] ) +include { SAMTOOLS_FLAGSTAT } from '../../../../modules/samtools/flagstat/main.nf' workflow test_samtools_flagstat { - 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) - ] + 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) + ] SAMTOOLS_FLAGSTAT ( input ) } diff --git a/tests/modules/samtools/flagstat/nextflow.config b/tests/modules/samtools/flagstat/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/samtools/flagstat/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/samtools/flagstat/test.yml b/tests/modules/samtools/flagstat/test.yml index 18671e25..a5f28b36 100644 --- a/tests/modules/samtools/flagstat/test.yml +++ b/tests/modules/samtools/flagstat/test.yml @@ -1,8 +1,8 @@ - name: samtools flagstat - command: nextflow run ./tests/modules/samtools/flagstat -entry test_samtools_flagstat -c tests/config/nextflow.config + command: nextflow run ./tests/modules/samtools/flagstat -entry test_samtools_flagstat -c ./tests/config/nextflow.config -c ./tests/modules/samtools/flagstat/nextflow.config tags: - samtools - samtools/flagstat files: - path: ./output/samtools/test.paired_end.sorted.bam.flagstat - md5sum: 6d7934c303b15ce473f64d502b79984e + md5sum: 4f7ffd1e6a5e85524d443209ac97d783 diff --git a/tests/modules/samtools/idxstats/main.nf b/tests/modules/samtools/idxstats/main.nf index 9919c3e4..f3de76a0 100644 --- a/tests/modules/samtools/idxstats/main.nf +++ b/tests/modules/samtools/idxstats/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_IDXSTATS } from '../../../../modules/samtools/idxstats/main.nf' addParams( options: [:] ) +include { SAMTOOLS_IDXSTATS } from '../../../../modules/samtools/idxstats/main.nf' workflow test_samtools_idxstats { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/samtools/idxstats/nextflow.config b/tests/modules/samtools/idxstats/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/samtools/idxstats/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/samtools/idxstats/test.yml b/tests/modules/samtools/idxstats/test.yml index 6064ca56..88786eef 100644 --- a/tests/modules/samtools/idxstats/test.yml +++ b/tests/modules/samtools/idxstats/test.yml @@ -1,5 +1,5 @@ - name: samtools idxstats - command: nextflow run ./tests/modules/samtools/idxstats -entry test_samtools_idxstats -c tests/config/nextflow.config + command: nextflow run ./tests/modules/samtools/idxstats -entry test_samtools_idxstats -c ./tests/config/nextflow.config -c ./tests/modules/samtools/idxstats/nextflow.config tags: - samtools - samtools/idxstats diff --git a/tests/modules/samtools/index/main.nf b/tests/modules/samtools/index/main.nf index be9014e0..3592a99a 100644 --- a/tests/modules/samtools/index/main.nf +++ b/tests/modules/samtools/index/main.nf @@ -2,8 +2,9 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_BAI } from '../../../../modules/samtools/index/main.nf' addParams( options: [:] ) -include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_CSI } from '../../../../modules/samtools/index/main.nf' addParams( options: [args:'-c'] ) +include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_BAI } from '../../../../modules/samtools/index/main.nf' +include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_CRAI } from '../../../../modules/samtools/index/main.nf' +include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_CSI } from '../../../../modules/samtools/index/main.nf' workflow test_samtools_index_bai { input = [ [ id:'test', single_end:false ], // meta map @@ -13,6 +14,14 @@ workflow test_samtools_index_bai { SAMTOOLS_INDEX_BAI ( input ) } +workflow test_samtools_index_crai { + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true) + ] + + SAMTOOLS_INDEX_CRAI ( input ) +} + workflow test_samtools_index_csi { input = [ [ id:'test', single_end:false ], // meta map file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) diff --git a/tests/modules/samtools/index/nextflow.config b/tests/modules/samtools/index/nextflow.config new file mode 100644 index 00000000..d3a4c785 --- /dev/null +++ b/tests/modules/samtools/index/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SAMTOOLS_INDEX_CSI { + ext.args = '-c' + } + +} diff --git a/tests/modules/samtools/index/test.yml b/tests/modules/samtools/index/test.yml index 31941dd6..7184be8f 100644 --- a/tests/modules/samtools/index/test.yml +++ b/tests/modules/samtools/index/test.yml @@ -1,5 +1,5 @@ -- name: samtools index bai - command: nextflow run tests/modules/samtools/index -entry test_samtools_index_bai -c tests/config/nextflow.config +- name: samtools index test_samtools_index_bai + command: nextflow run ./tests/modules/samtools/index -entry test_samtools_index_bai -c ./tests/config/nextflow.config -c ./tests/modules/samtools/index/nextflow.config tags: - samtools - samtools/index @@ -7,8 +7,17 @@ - path: output/samtools/test.paired_end.sorted.bam.bai md5sum: 704c10dd1326482448ca3073fdebc2f4 -- name: samtools index csi - command: nextflow run tests/modules/samtools/index -entry test_samtools_index_csi -c tests/config/nextflow.config +- name: samtools index test_samtools_index_crai + command: nextflow run ./tests/modules/samtools/index -entry test_samtools_index_crai -c ./tests/config/nextflow.config -c ./tests/modules/samtools/index/nextflow.config + tags: + - samtools + - samtools/index + files: + - path: output/samtools/test.paired_end.recalibrated.sorted.cram.crai + md5sum: 14bc3bd5c89cacc8f4541f9062429029 + +- name: samtools index test_samtools_index_csi + command: nextflow run ./tests/modules/samtools/index -entry test_samtools_index_csi -c ./tests/config/nextflow.config -c ./tests/modules/samtools/index/nextflow.config tags: - samtools - samtools/index diff --git a/tests/modules/samtools/merge/main.nf b/tests/modules/samtools/merge/main.nf index 75ba886b..ad5c56e3 100644 --- a/tests/modules/samtools/merge/main.nf +++ b/tests/modules/samtools/merge/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_MERGE } from '../../../../modules/samtools/merge/main.nf' addParams( options: [:] ) +include { SAMTOOLS_MERGE } from '../../../../modules/samtools/merge/main.nf' workflow test_samtools_merge { input = [ [ id: 'test' ], // meta map @@ -11,5 +11,15 @@ workflow test_samtools_merge { file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true)] ] - SAMTOOLS_MERGE ( input ) + SAMTOOLS_MERGE ( input, [] ) +} + +workflow test_samtools_merge_cram { + input = [ [ id: 'test' ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_cram'], checkIfExists: true), + ] + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + SAMTOOLS_MERGE ( input, fasta ) } diff --git a/tests/modules/samtools/merge/nextflow.config b/tests/modules/samtools/merge/nextflow.config new file mode 100644 index 00000000..4ac70fa0 --- /dev/null +++ b/tests/modules/samtools/merge/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SAMTOOLS_MERGE { + ext.prefix = { "${meta.id}_merged" } + } + +} diff --git a/tests/modules/samtools/merge/test.yml b/tests/modules/samtools/merge/test.yml index d0674ca4..948c6191 100644 --- a/tests/modules/samtools/merge/test.yml +++ b/tests/modules/samtools/merge/test.yml @@ -1,7 +1,15 @@ -- name: samtools merge - command: nextflow run ./tests/modules/samtools/merge -entry test_samtools_merge -c tests/config/nextflow.config +- name: samtools merge test_samtools_merge + command: nextflow run ./tests/modules/samtools/merge -entry test_samtools_merge -c ./tests/config/nextflow.config -c ./tests/modules/samtools/merge/nextflow.config tags: - samtools - samtools/merge files: - path: output/samtools/test_merged.bam + +- name: samtools merge test_samtools_merge_cram + command: nextflow run ./tests/modules/samtools/merge -entry test_samtools_merge_cram -c ./tests/config/nextflow.config -c ./tests/modules/samtools/merge/nextflow.config + tags: + - samtools + - samtools/merge + files: + - path: output/samtools/test_merged.cram diff --git a/tests/modules/samtools/mpileup/main.nf b/tests/modules/samtools/mpileup/main.nf index b8db0275..dc58cc2c 100644 --- a/tests/modules/samtools/mpileup/main.nf +++ b/tests/modules/samtools/mpileup/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_MPILEUP } from '../../../../modules/samtools/mpileup/main.nf' addParams( options: [:] ) +include { SAMTOOLS_MPILEUP } from '../../../../modules/samtools/mpileup/main.nf' workflow test_samtools_mpileup { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/samtools/mpileup/nextflow.config b/tests/modules/samtools/mpileup/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/samtools/mpileup/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/samtools/mpileup/test.yml b/tests/modules/samtools/mpileup/test.yml index 31d35c0f..53a9c142 100644 --- a/tests/modules/samtools/mpileup/test.yml +++ b/tests/modules/samtools/mpileup/test.yml @@ -1,8 +1,8 @@ - name: samtools mpileup - command: nextflow run ./tests/modules/samtools/mpileup -entry test_samtools_mpileup -c tests/config/nextflow.config + command: nextflow run ./tests/modules/samtools/mpileup -entry test_samtools_mpileup -c ./tests/config/nextflow.config -c ./tests/modules/samtools/mpileup/nextflow.config tags: - samtools - samtools/mpileup files: - path: ./output/samtools/test.mpileup - md5sum: 3608af83ffe3efbb1337f0ffb205337d + md5sum: 958e6bead4103d72026f80153b6b5150 diff --git a/tests/modules/samtools/sort/main.nf b/tests/modules/samtools/sort/main.nf index 91cd4d01..9853b355 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' workflow test_samtools_sort { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/samtools/sort/nextflow.config b/tests/modules/samtools/sort/nextflow.config new file mode 100644 index 00000000..230bec5f --- /dev/null +++ b/tests/modules/samtools/sort/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SAMTOOLS_SORT { + ext.prefix = { "${meta.id}.sorted" } + } + +} diff --git a/tests/modules/samtools/sort/test.yml b/tests/modules/samtools/sort/test.yml index 2ce00247..dfd2eb69 100644 --- a/tests/modules/samtools/sort/test.yml +++ b/tests/modules/samtools/sort/test.yml @@ -1,8 +1,8 @@ - name: samtools sort - command: nextflow run tests/modules/samtools/sort -entry test_samtools_sort -c tests/config/nextflow.config + command: nextflow run ./tests/modules/samtools/sort -entry test_samtools_sort -c ./tests/config/nextflow.config -c ./tests/modules/samtools/sort/nextflow.config tags: - samtools - samtools/sort files: - - path: output/samtools/test.bam - md5sum: 3997667dee6b45d682865c6bf82d0378 + - path: output/samtools/test.sorted.bam + md5sum: 4adc495469724a375d5e1a9f3485e38d diff --git a/tests/modules/samtools/stats/main.nf b/tests/modules/samtools/stats/main.nf index 04a689fe..d83cbf4a 100644 --- a/tests/modules/samtools/stats/main.nf +++ b/tests/modules/samtools/stats/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_STATS } from '../../../../modules/samtools/stats/main.nf' addParams( options: [:] ) +include { SAMTOOLS_STATS } from '../../../../modules/samtools/stats/main.nf' workflow test_samtools_stats { input = [ [ id:'test', single_end:false ], // meta map @@ -10,5 +10,15 @@ workflow test_samtools_stats { file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - SAMTOOLS_STATS ( input ) + SAMTOOLS_STATS ( input, []) +} + +workflow test_samtools_stats_cram { + input = [ [ id: 'test', single_end:true ], // 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) + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + + SAMTOOLS_STATS ( input, fasta ) } diff --git a/tests/modules/samtools/stats/nextflow.config b/tests/modules/samtools/stats/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/samtools/stats/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/samtools/stats/test.yml b/tests/modules/samtools/stats/test.yml index 32854c05..178eba72 100644 --- a/tests/modules/samtools/stats/test.yml +++ b/tests/modules/samtools/stats/test.yml @@ -1,8 +1,17 @@ -- name: samtools stats - command: nextflow run ./tests/modules/samtools/stats -entry test_samtools_stats -c tests/config/nextflow.config +- name: samtools stats test_samtools_stats + command: nextflow run ./tests/modules/samtools/stats -entry test_samtools_stats -c ./tests/config/nextflow.config -c ./tests/modules/samtools/stats/nextflow.config tags: - - samtools - samtools/stats + - samtools files: - - path: ./output/samtools/test.paired_end.sorted.bam.stats - md5sum: 95f7edae5d02c10c4004d9ab1d7d8ef3 + - path: output/samtools/test.paired_end.sorted.bam.stats + md5sum: 09146eeecfcae2a84fb8615c86cd8d64 + +- name: samtools stats test_samtools_stats_cram + command: nextflow run ./tests/modules/samtools/stats -entry test_samtools_stats_cram -c ./tests/config/nextflow.config -c ./tests/modules/samtools/stats/nextflow.config + tags: + - samtools/stats + - samtools + files: + - path: output/samtools/test.paired_end.recalibrated.sorted.cram.stats + md5sum: 62377b29c3f6253e37308a28d13a496d diff --git a/tests/modules/samtools/view/main.nf b/tests/modules/samtools/view/main.nf index c60acb73..8ee27ef8 100644 --- a/tests/modules/samtools/view/main.nf +++ b/tests/modules/samtools/view/main.nf @@ -2,13 +2,22 @@ nextflow.enable.dsl = 2 -include { SAMTOOLS_VIEW } from '../../../../modules/samtools/view/main.nf' addParams( options: [:] ) +include { SAMTOOLS_VIEW } from '../../../../modules/samtools/view/main.nf' workflow test_samtools_view { input = [ [ id:'test', single_end:false ], // meta map file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) - ] - SAMTOOLS_VIEW ( input ) + SAMTOOLS_VIEW ( input, [] ) +} + +workflow test_samtools_view_cram { + input = [ [ id: 'test' ], // 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) + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + + SAMTOOLS_VIEW ( input, fasta ) } diff --git a/tests/modules/samtools/view/nextflow.config b/tests/modules/samtools/view/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/samtools/view/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/samtools/view/test.yml b/tests/modules/samtools/view/test.yml index 383dfa87..1287d455 100644 --- a/tests/modules/samtools/view/test.yml +++ b/tests/modules/samtools/view/test.yml @@ -1,8 +1,16 @@ -- name: samtools view - command: nextflow run tests/modules/samtools/view -entry test_samtools_view -c tests/config/nextflow.config +- name: samtools view test_samtools_view + command: nextflow run ./tests/modules/samtools/view -entry test_samtools_view -c ./tests/config/nextflow.config -c ./tests/modules/samtools/view/nextflow.config tags: - - samtools - samtools/view + - samtools files: - path: output/samtools/test.bam md5sum: 8fb1e82f76416e9e30fc6b2357e2cf13 + +- name: samtools view test_samtools_view_cram + command: nextflow run ./tests/modules/samtools/view -entry test_samtools_view_cram -c ./tests/config/nextflow.config -c ./tests/modules/samtools/view/nextflow.config + tags: + - samtools/view + - samtools + files: + - path: output/samtools/test.cram diff --git a/tests/modules/scoary/main.nf b/tests/modules/scoary/main.nf new file mode 100644 index 00000000..5f080b7d --- /dev/null +++ b/tests/modules/scoary/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SCOARY } from '../../../modules/scoary/main.nf' + +workflow test_scoary { + + input = [ [ id:'test', single_end:false ], // meta map + file("https://github.com/AdmiralenOla/Scoary/raw/master/scoary/exampledata/Gene_presence_absence.csv", checkIfExists: true), + file("https://github.com/AdmiralenOla/Scoary/raw/master/scoary/exampledata/Tetracycline_resistance.csv", checkIfExists: true) ] + + tree = [] + SCOARY ( input, tree) +} diff --git a/tests/modules/scoary/nextflow.config b/tests/modules/scoary/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/scoary/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/scoary/test.yml b/tests/modules/scoary/test.yml new file mode 100644 index 00000000..71344093 --- /dev/null +++ b/tests/modules/scoary/test.yml @@ -0,0 +1,9 @@ +- name: scoary test_scoary + command: nextflow run ./tests/modules/scoary -entry test_scoary -c ./tests/config/nextflow.config -c ./tests/modules/scoary/nextflow.config + tags: + - scoary + files: + - path: output/scoary/Bogus_trait.results.csv + md5sum: 9550c692bbe6ff0ac844357bfabb809b + - path: output/scoary/Tetracycline_resistance.results.csv + md5sum: a87740818ab4de69a758fc75d7b879dd diff --git a/tests/modules/seacr/callpeak/main.nf b/tests/modules/seacr/callpeak/main.nf index 82fd6eb3..230d3a4c 100644 --- a/tests/modules/seacr/callpeak/main.nf +++ b/tests/modules/seacr/callpeak/main.nf @@ -2,13 +2,22 @@ nextflow.enable.dsl = 2 -include { SEACR_CALLPEAK } from '../../../../modules/seacr/callpeak/main.nf' addParams( options: [ args:'norm stringent' ] ) +include { SEACR_CALLPEAK } from '../../../../modules/seacr/callpeak/main.nf' 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) + file(params.test_data['homo_sapiens']['illumina']['cutandrun_bedgraph_test_1'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['cutandrun_bedgraph_test_2'], checkIfExists: true) ] - SEACR_CALLPEAK ( input ) + SEACR_CALLPEAK ( input, 0.05 ) } + +workflow test_seacr_callpeak_threshold { + input = [ [ id:'test_1'], + file(params.test_data['homo_sapiens']['illumina']['cutandrun_bedgraph_test_1'], checkIfExists: true), + [] + ] + + SEACR_CALLPEAK ( input, 0.05 ) +} \ No newline at end of file diff --git a/tests/modules/seacr/callpeak/nextflow.config b/tests/modules/seacr/callpeak/nextflow.config new file mode 100644 index 00000000..54c19e6b --- /dev/null +++ b/tests/modules/seacr/callpeak/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SEACR_CALLPEAK { + ext.args = 'norm stringent' + } + +} diff --git a/tests/modules/seacr/callpeak/test.yml b/tests/modules/seacr/callpeak/test.yml index 4b9790a4..63104bd0 100644 --- a/tests/modules/seacr/callpeak/test.yml +++ b/tests/modules/seacr/callpeak/test.yml @@ -1,8 +1,17 @@ - name: seacr callpeak - command: nextflow run ./tests/modules/seacr/callpeak -entry test_seacr_callpeak -c tests/config/nextflow.config + command: nextflow run ./tests/modules/seacr/callpeak -entry test_seacr_callpeak -c ./tests/config/nextflow.config -c ./tests/modules/seacr/callpeak/nextflow.config tags: - seacr - seacr/callpeak files: - path: output/seacr/test_1.stringent.bed - md5sum: 3ac70475669eb6a7b8ca89e19a08a28e \ No newline at end of file + md5sum: a3cb0c7c4ffa895788da3f0d6371b7df + +- name: seacr callpeak threshold + command: nextflow run ./tests/modules/seacr/callpeak -entry test_seacr_callpeak_threshold -c ./tests/config/nextflow.config -c ./tests/modules/seacr/callpeak/nextflow.config + tags: + - seacr + - seacr/callpeak + files: + - path: output/seacr/test_1.stringent.bed + md5sum: 1d23015c7087f7b48cc3139d53fd3463 \ No newline at end of file diff --git a/tests/modules/seqkit/split2/main.nf b/tests/modules/seqkit/split2/main.nf index 21626cac..acb9d41b 100644 --- a/tests/modules/seqkit/split2/main.nf +++ b/tests/modules/seqkit/split2/main.nf @@ -2,9 +2,9 @@ nextflow.enable.dsl = 2 -include { SEQKIT_SPLIT2 as SEQKIT_SPLIT2_LENGTH } from '../../../../modules/seqkit/split2/main.nf' addParams( options: ['args': '--by-length 8K'] ) -include { SEQKIT_SPLIT2 as SEQKIT_SPLIT2_SIZE } from '../../../../modules/seqkit/split2/main.nf' addParams( options: ['args': '--by-size 50' ] ) -include { SEQKIT_SPLIT2 as SEQKIT_SPLIT2_PART } from '../../../../modules/seqkit/split2/main.nf' addParams( options: ['args': '--by-part 3'] ) +include { SEQKIT_SPLIT2 as SEQKIT_SPLIT2_LENGTH } from '../../../../modules/seqkit/split2/main.nf' +include { SEQKIT_SPLIT2 as SEQKIT_SPLIT2_SIZE } from '../../../../modules/seqkit/split2/main.nf' +include { SEQKIT_SPLIT2 as SEQKIT_SPLIT2_PART } from '../../../../modules/seqkit/split2/main.nf' workflow test_seqkit_split2_single_end_length { input = [ [ id:'test', single_end:true ], // meta map diff --git a/tests/modules/seqkit/split2/nextflow.config b/tests/modules/seqkit/split2/nextflow.config new file mode 100644 index 00000000..e4f64931 --- /dev/null +++ b/tests/modules/seqkit/split2/nextflow.config @@ -0,0 +1,17 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SEQKIT_SPLIT2_LENGTH { + ext.args = '--by-length 8K' + } + + withName: SEQKIT_SPLIT2_SIZE { + ext.args = '--by-size 50' + } + + withName: SEQKIT_SPLIT2_PART { + ext.args = '--by-part 3' + } + +} diff --git a/tests/modules/seqkit/split2/test.yml b/tests/modules/seqkit/split2/test.yml index b3e0e020..00368e22 100644 --- a/tests/modules/seqkit/split2/test.yml +++ b/tests/modules/seqkit/split2/test.yml @@ -1,83 +1,95 @@ -- name: seqkit split2 single-end length - command: nextflow run ./tests/modules/seqkit/split2 -entry test_seqkit_split2_single_end_length -c tests/config/nextflow.config +- name: seqkit split2 test_seqkit_split2_single_end_length + command: nextflow run tests/modules/seqkit/split2 -entry test_seqkit_split2_single_end_length -c tests/config/nextflow.config tags: - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz - md5sum: 6f7d58ba35c254c0817fe9a7c69862e4 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz - md5sum: cf38c51506e45380fe25abdd1bd5ccc6 + - path: output/seqkit/test/test_1.part_001.fastq.gz + md5sum: 7f489b2374c5fcc155a60ce2365a7bb7 + - path: output/seqkit/test/test_1.part_002.fastq.gz + md5sum: 45cccacb4676bca33beb17064322a781 + - path: output/seqkit/versions.yml + md5sum: 2d5a709d129be364687cc0b561efa532 -- name: seqkit split2 single-end size - command: nextflow run ./tests/modules/seqkit/split2 -entry test_seqkit_split2_single_end_size -c tests/config/nextflow.config +- name: seqkit split2 test_seqkit_split2_single_end_size + command: nextflow run tests/modules/seqkit/split2 -entry test_seqkit_split2_single_end_size -c tests/config/nextflow.config tags: - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz - md5sum: bf835e685d597fc1ab5e5ac7dd689619 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz - md5sum: 703d95ff4fbb5b7fb4da8a164ba9aa54 + - path: output/seqkit/test/test_1.part_001.fastq.gz + md5sum: b09324606fb3636b51448d6a007d2c71 + - path: output/seqkit/test/test_1.part_002.fastq.gz + md5sum: f7873475d463e3b4d21dccbf8e859270 + - path: output/seqkit/versions.yml + md5sum: 490d00accd1092a8eca4e83ed809bad3 -- name: seqkit split2 single-end part - command: nextflow run ./tests/modules/seqkit/split2 -entry test_seqkit_split2_single_end_part -c tests/config/nextflow.config +- name: seqkit split2 test_seqkit_split2_single_end_part + command: nextflow run tests/modules/seqkit/split2 -entry test_seqkit_split2_single_end_part -c tests/config/nextflow.config tags: - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz - md5sum: fa25951435471238d5567fd2cae31f55 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz - md5sum: 1dcf631aaaa5e7e0bd6c9668fbc6e04a - - path: output/seqkit/test.split/test_1.part_003.fastq.gz - md5sum: 8bc86ba83a611c54f592f4eae19b680f + - path: output/seqkit/test/test_1.part_001.fastq.gz + md5sum: a9d29d08e27246b6d36e21e5def405e3 + - path: output/seqkit/test/test_1.part_002.fastq.gz + md5sum: 6d547a959adcd027dd1a8734e195dd7d + - path: output/seqkit/test/test_1.part_003.fastq.gz + md5sum: 6d63cc8400dd2a96d808514fb18278ee + - path: output/seqkit/versions.yml + md5sum: 90431cd3d28954f656988230d4481115 -- name: seqkit split2 paired-end length - command: nextflow run ./tests/modules/seqkit/split2 -entry test_seqkit_split2_paired_end_length -c tests/config/nextflow.config +- name: seqkit split2 test_seqkit_split2_paired_end_length + command: nextflow run tests/modules/seqkit/split2 -entry test_seqkit_split2_paired_end_length -c tests/config/nextflow.config tags: - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz - md5sum: 6f7d58ba35c254c0817fe9a7c69862e4 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz - md5sum: cf38c51506e45380fe25abdd1bd5ccc6 - - path: output/seqkit/test.split/test_2.part_001.fastq.gz - md5sum: 6b094b1ba7c439fe44c1bb5e99a02ba4 - - path: output/seqkit/test.split/test_2.part_002.fastq.gz - md5sum: 927097c6ac7522199a9e016333181a8e + - path: output/seqkit/test/test_1.part_001.fastq.gz + md5sum: 7f489b2374c5fcc155a60ce2365a7bb7 + - path: output/seqkit/test/test_1.part_002.fastq.gz + md5sum: 45cccacb4676bca33beb17064322a781 + - path: output/seqkit/test/test_2.part_001.fastq.gz + md5sum: 160b5fd363ff7cad8af9d914269d6426 + - path: output/seqkit/test/test_2.part_002.fastq.gz + md5sum: 18bc5434cf55706394cccb44e6108561 + - path: output/seqkit/versions.yml + md5sum: 9272afc1a126ae997a712edeef317f22 -- name: seqkit split2 paired-end size - command: nextflow run ./tests/modules/seqkit/split2 -entry test_seqkit_split2_paired_end_size -c tests/config/nextflow.config +- name: seqkit split2 test_seqkit_split2_paired_end_size + command: nextflow run tests/modules/seqkit/split2 -entry test_seqkit_split2_paired_end_size -c tests/config/nextflow.config tags: - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz - md5sum: bf835e685d597fc1ab5e5ac7dd689619 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz - md5sum: 703d95ff4fbb5b7fb4da8a164ba9aa54 - - path: output/seqkit/test.split/test_2.part_001.fastq.gz - md5sum: 09d0dd83b5b1b9b95d316eeed79ea5ba - - path: output/seqkit/test.split/test_2.part_002.fastq.gz - md5sum: 8796c3f327b1094244bfcdb36d536526 + - path: output/seqkit/test/test_1.part_001.fastq.gz + md5sum: b09324606fb3636b51448d6a007d2c71 + - path: output/seqkit/test/test_1.part_002.fastq.gz + md5sum: f7873475d463e3b4d21dccbf8e859270 + - path: output/seqkit/test/test_2.part_001.fastq.gz + md5sum: c0602b62aae860dd284c0eb0062c24dd + - path: output/seqkit/test/test_2.part_002.fastq.gz + md5sum: 5bc7a98b618100b29910eb41c4c9ac0d + - path: output/seqkit/versions.yml + md5sum: af66912ae8abc493f77f70e3bf473144 -- name: seqkit split2 paired-end part - command: nextflow run ./tests/modules/seqkit/split2 -entry test_seqkit_split2_paired_end_part -c tests/config/nextflow.config +- name: seqkit split2 test_seqkit_split2_paired_end_part + command: nextflow run tests/modules/seqkit/split2 -entry test_seqkit_split2_paired_end_part -c tests/config/nextflow.config tags: - seqkit - seqkit/split2 files: - - path: output/seqkit/test.split/test_1.part_001.fastq.gz - md5sum: fa25951435471238d5567fd2cae31f55 - - path: output/seqkit/test.split/test_1.part_002.fastq.gz - md5sum: 1dcf631aaaa5e7e0bd6c9668fbc6e04a - - path: output/seqkit/test.split/test_1.part_003.fastq.gz - md5sum: 8bc86ba83a611c54f592f4eae19b680f - - path: output/seqkit/test.split/test_2.part_001.fastq.gz - md5sum: f0055c99cd193fd97466b3cde9dd1b8f - - path: output/seqkit/test.split/test_2.part_002.fastq.gz - md5sum: 8a90df768201785f7a7cd5dbb41e846a - - path: output/seqkit/test.split/test_2.part_003.fastq.gz - md5sum: 890b90083e8e1606bd13ba34149cedd7 + - path: output/seqkit/test/test_1.part_001.fastq.gz + md5sum: a9d29d08e27246b6d36e21e5def405e3 + - path: output/seqkit/test/test_1.part_002.fastq.gz + md5sum: 6d547a959adcd027dd1a8734e195dd7d + - path: output/seqkit/test/test_1.part_003.fastq.gz + md5sum: 6d63cc8400dd2a96d808514fb18278ee + - path: output/seqkit/test/test_2.part_001.fastq.gz + md5sum: b51a1bed106e4ec0c9be7d9e224d0616 + - path: output/seqkit/test/test_2.part_002.fastq.gz + md5sum: 079078a7f86114ae29cda8c00d5a7fc9 + - path: output/seqkit/test/test_2.part_003.fastq.gz + md5sum: 6987941bf8c4a37565e333029ba41ca0 + - path: output/seqkit/versions.yml + md5sum: 193bc5f0c429076f816ab0a529c4c1fc diff --git a/tests/modules/seqsero2/main.nf b/tests/modules/seqsero2/main.nf new file mode 100644 index 00000000..9587bf9f --- /dev/null +++ b/tests/modules/seqsero2/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SEQSERO2 } from '../../../modules/seqsero2/main.nf' + +workflow test_seqsero2 { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + SEQSERO2 ( input ) +} diff --git a/tests/modules/seqsero2/nextflow.config b/tests/modules/seqsero2/nextflow.config new file mode 100644 index 00000000..b46fa7e2 --- /dev/null +++ b/tests/modules/seqsero2/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SEQSERO2 { + ext.args = '-m k -t 4' + } + +} diff --git a/tests/modules/seqsero2/test.yml b/tests/modules/seqsero2/test.yml new file mode 100644 index 00000000..e2dec062 --- /dev/null +++ b/tests/modules/seqsero2/test.yml @@ -0,0 +1,11 @@ +- name: seqsero2 test_seqsero2 + command: nextflow run ./tests/modules/seqsero2 -entry test_seqsero2 -c ./tests/config/nextflow.config -c ./tests/modules/seqsero2/nextflow.config + tags: + - seqsero2 + files: + - path: output/seqsero2/results/SeqSero_log.txt + md5sum: d00242dfa734b5abb3622a6048f0b4fb + - path: output/seqsero2/results/SeqSero_result.tsv + contains: ['Sample', 'Predicted', 'Note'] + - path: output/seqsero2/results/SeqSero_result.txt + contains: ['Sample', 'Predicted', 'Note'] diff --git a/tests/modules/seqtk/mergepe/main.nf b/tests/modules/seqtk/mergepe/main.nf new file mode 100644 index 00000000..b8e12213 --- /dev/null +++ b/tests/modules/seqtk/mergepe/main.nf @@ -0,0 +1,31 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SEQTK_MERGEPE } from '../../../../modules/seqtk/mergepe/main.nf' + +// +// Test with single-end data +// + +workflow test_seqtk_mergepe_single_end { + + input = [ [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] + + SEQTK_MERGEPE ( input ) +} + +// +// Test with paired-end data +// + +workflow test_seqtk_mergepe_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) ] + ] + + SEQTK_MERGEPE ( input ) +} diff --git a/tests/modules/seqtk/mergepe/nextflow.config b/tests/modules/seqtk/mergepe/nextflow.config new file mode 100644 index 00000000..04eeef72 --- /dev/null +++ b/tests/modules/seqtk/mergepe/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SEQTK_MERGEPE { + ext.prefix = { "${meta.id}.processed" } + } + +} diff --git a/tests/modules/seqtk/mergepe/test.yml b/tests/modules/seqtk/mergepe/test.yml new file mode 100644 index 00000000..2a6d4d33 --- /dev/null +++ b/tests/modules/seqtk/mergepe/test.yml @@ -0,0 +1,17 @@ +- name: seqtk mergepe test_seqtk_mergepe_single_end + command: nextflow run ./tests/modules/seqtk/mergepe -entry test_seqtk_mergepe_single_end -c ./tests/config/nextflow.config -c ./tests/modules/seqtk/mergepe/nextflow.config + tags: + - seqtk/mergepe + - seqtk + files: + - path: output/seqtk/test.processed.fastq.gz + md5sum: e325ef7deb4023447a1f074e285761af + +- name: seqtk mergepe test_seqtk_mergepe_paired_end + command: nextflow run ./tests/modules/seqtk/mergepe -entry test_seqtk_mergepe_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/seqtk/mergepe/nextflow.config + tags: + - seqtk/mergepe + - seqtk + files: + - path: output/seqtk/test.processed.fastq.gz + md5sum: 3f094ef62d9bfe06aa25174a06bc7d04 diff --git a/tests/modules/seqtk/sample/main.nf b/tests/modules/seqtk/sample/main.nf index 4508db84..6899ef62 100644 --- a/tests/modules/seqtk/sample/main.nf +++ b/tests/modules/seqtk/sample/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SEQTK_SAMPLE } from '../../../../modules/seqtk/sample/main.nf' addParams( options: [ 'args': '-s100', 'suffix':'.sampled' ] ) +include { SEQTK_SAMPLE } from '../../../../modules/seqtk/sample/main.nf' // // Test with single-end data diff --git a/tests/modules/seqtk/sample/nextflow.config b/tests/modules/seqtk/sample/nextflow.config new file mode 100644 index 00000000..a79ad290 --- /dev/null +++ b/tests/modules/seqtk/sample/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SEQTK_SAMPLE { + ext.args = '-s100' + ext.prefix = { "${meta.id}.sampled" } + } + +} diff --git a/tests/modules/seqtk/sample/test.yml b/tests/modules/seqtk/sample/test.yml index d4cf2ca9..df24b3a4 100644 --- a/tests/modules/seqtk/sample/test.yml +++ b/tests/modules/seqtk/sample/test.yml @@ -1,5 +1,5 @@ - name: seqtk sample test_seqtk_sample_single_end - command: nextflow run tests/modules/seqtk/sample -entry test_seqtk_sample_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/seqtk/sample -entry test_seqtk_sample_single_end -c ./tests/config/nextflow.config -c ./tests/modules/seqtk/sample/nextflow.config tags: - seqtk - seqtk/sample @@ -8,7 +8,7 @@ md5sum: 73c3e8f113860244f3ed3866a8b9d555 - name: seqtk sample test_seqtk_sample_paired_end - command: nextflow run tests/modules/seqtk/sample -entry test_seqtk_sample_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/seqtk/sample -entry test_seqtk_sample_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/seqtk/sample/nextflow.config tags: - seqtk - seqtk/sample diff --git a/tests/modules/seqtk/subseq/main.nf b/tests/modules/seqtk/subseq/main.nf index 7c5dc7b2..608b7c2f 100644 --- a/tests/modules/seqtk/subseq/main.nf +++ b/tests/modules/seqtk/subseq/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SEQTK_SUBSEQ } from '../../../../modules/seqtk/subseq/main.nf' addParams( options: ['suffix':'.filtered'] ) +include { SEQTK_SUBSEQ } from '../../../../modules/seqtk/subseq/main.nf' workflow test_seqtk_subseq { diff --git a/tests/modules/seqtk/subseq/nextflow.config b/tests/modules/seqtk/subseq/nextflow.config new file mode 100644 index 00000000..8a8b9b45 --- /dev/null +++ b/tests/modules/seqtk/subseq/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SEQTK_SUBSEQ { + ext.prefix = { ".filtered" } + } + +} diff --git a/tests/modules/seqtk/subseq/test.yml b/tests/modules/seqtk/subseq/test.yml index fca64804..4003e3ab 100644 --- a/tests/modules/seqtk/subseq/test.yml +++ b/tests/modules/seqtk/subseq/test.yml @@ -1,5 +1,5 @@ - name: seqtk subseq test_seqtk_subseq - command: nextflow run tests/modules/seqtk/subseq -entry test_seqtk_subseq -c tests/config/nextflow.config + command: nextflow run ./tests/modules/seqtk/subseq -entry test_seqtk_subseq -c ./tests/config/nextflow.config -c ./tests/modules/seqtk/subseq/nextflow.config tags: - seqtk - seqtk/subseq diff --git a/tests/modules/sequenzautils/bam2seqz/main.nf b/tests/modules/sequenzautils/bam2seqz/main.nf index ae478b88..fcd4c7c7 100755 --- a/tests/modules/sequenzautils/bam2seqz/main.nf +++ b/tests/modules/sequenzautils/bam2seqz/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SEQUENZAUTILS_BAM2SEQZ } from '../../../../modules/sequenzautils/bam2seqz/main.nf' addParams( options: [:] ) +include { SEQUENZAUTILS_BAM2SEQZ } from '../../../../modules/sequenzautils/bam2seqz/main.nf' workflow test_sequenzautils_bam2seqz { diff --git a/tests/modules/sequenzautils/bam2seqz/nextflow.config b/tests/modules/sequenzautils/bam2seqz/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/sequenzautils/bam2seqz/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/sequenzautils/bam2seqz/test.yml b/tests/modules/sequenzautils/bam2seqz/test.yml index d8a21430..f3ea6cf0 100644 --- a/tests/modules/sequenzautils/bam2seqz/test.yml +++ b/tests/modules/sequenzautils/bam2seqz/test.yml @@ -1,8 +1,8 @@ - name: sequenzautils bam2seqz - command: nextflow run ./tests/modules/sequenzautils/bam2seqz -entry test_sequenzautils_bam2seqz -c tests/config/nextflow.config + command: nextflow run ./tests/modules/sequenzautils/bam2seqz -entry test_sequenzautils_bam2seqz -c ./tests/config/nextflow.config -c ./tests/modules/sequenzautils/bam2seqz/nextflow.config tags: - sequenzautils - sequenzautils/bam2seqz files: - - path: output/sequenzautils/test.seqz.gz + - path: output/sequenzautils/test.gz md5sum: 12b41979a498ac10c0aff162b12e6a6e diff --git a/tests/modules/sequenzautils/gcwiggle/main.nf b/tests/modules/sequenzautils/gcwiggle/main.nf index e314f1e0..b25e037e 100644 --- a/tests/modules/sequenzautils/gcwiggle/main.nf +++ b/tests/modules/sequenzautils/gcwiggle/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SEQUENZAUTILS_GCWIGGLE } from '../../../../modules/sequenzautils/gcwiggle/main.nf' addParams( options: [ 'args': '-w 50' ] ) +include { SEQUENZAUTILS_GCWIGGLE } from '../../../../modules/sequenzautils/gcwiggle/main.nf' workflow test_sequenzautils_gcwiggle { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/sequenzautils/gcwiggle/nextflow.config b/tests/modules/sequenzautils/gcwiggle/nextflow.config new file mode 100644 index 00000000..62e68935 --- /dev/null +++ b/tests/modules/sequenzautils/gcwiggle/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SEQUENZAUTILS_GCWIGGLE { + ext.args = '-w 50' + } + +} diff --git a/tests/modules/sequenzautils/gcwiggle/test.yml b/tests/modules/sequenzautils/gcwiggle/test.yml index aa7a3167..21ddc4ab 100644 --- a/tests/modules/sequenzautils/gcwiggle/test.yml +++ b/tests/modules/sequenzautils/gcwiggle/test.yml @@ -1,7 +1,5 @@ -## TODO nf-core: Please run the following command to build this file: -# nf-core modules create-test-yml sequenzautils/gcwiggle - name: sequenzautils gcwiggle - command: nextflow run ./tests/modules/sequenzautils/gcwiggle -entry test_sequenzautils_gcwiggle -c tests/config/nextflow.config + command: nextflow run ./tests/modules/sequenzautils/gcwiggle -entry test_sequenzautils_gcwiggle -c ./tests/config/nextflow.config -c ./tests/modules/sequenzautils/gcwiggle/nextflow.config tags: - sequenzautils - sequenzautils/gcwiggle diff --git a/tests/modules/seqwish/induce/main.nf b/tests/modules/seqwish/induce/main.nf index 356ca705..6388fea2 100644 --- a/tests/modules/seqwish/induce/main.nf +++ b/tests/modules/seqwish/induce/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SEQWISH_INDUCE } from '../../../../modules/seqwish/induce/main.nf' addParams( options: [:] ) +include { SEQWISH_INDUCE } from '../../../../modules/seqwish/induce/main.nf' workflow test_seqwish_induce { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/seqwish/induce/nextflow.config b/tests/modules/seqwish/induce/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/seqwish/induce/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/seqwish/induce/test.yml b/tests/modules/seqwish/induce/test.yml index d27de3c4..d5a8a7cd 100644 --- a/tests/modules/seqwish/induce/test.yml +++ b/tests/modules/seqwish/induce/test.yml @@ -1,5 +1,5 @@ - name: seqwish induce - command: nextflow run ./tests/modules/seqwish/induce -entry test_seqwish_induce -c tests/config/nextflow.config + command: nextflow run ./tests/modules/seqwish/induce -entry test_seqwish_induce -c ./tests/config/nextflow.config -c ./tests/modules/seqwish/induce/nextflow.config tags: - seqwish - seqwish/induce diff --git a/tests/modules/shovill/main.nf b/tests/modules/shovill/main.nf index acc65169..2416022f 100644 --- a/tests/modules/shovill/main.nf +++ b/tests/modules/shovill/main.nf @@ -2,10 +2,10 @@ nextflow.enable.dsl = 2 -include { SHOVILL } from '../../../modules/shovill/main.nf' addParams( options: [args: '--gsize 2800000 --kmers 31'] ) -include { SHOVILL as SHOVILL_SKESA } from '../../../modules/shovill/main.nf' addParams( options: [args: '--assembler skesa --gsize 2800000'] ) -include { SHOVILL as SHOVILL_MEGAHIT } from '../../../modules/shovill/main.nf' addParams( options: [args: '--assembler megahit --gsize 2800000'] ) -include { SHOVILL as SHOVILL_VELVET } from '../../../modules/shovill/main.nf' addParams( options: [args: '--assembler velvet --gsize 2800000'] ) +include { SHOVILL } from '../../../modules/shovill/main.nf' +include { SHOVILL as SHOVILL_SKESA } from '../../../modules/shovill/main.nf' +include { SHOVILL as SHOVILL_MEGAHIT } from '../../../modules/shovill/main.nf' +include { SHOVILL as SHOVILL_VELVET } from '../../../modules/shovill/main.nf' workflow test_shovill { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/shovill/nextflow.config b/tests/modules/shovill/nextflow.config new file mode 100644 index 00000000..0599f80b --- /dev/null +++ b/tests/modules/shovill/nextflow.config @@ -0,0 +1,21 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SHOVILL { + ext.args = '--gsize 2800000 --kmers 31' + } + + withName: SHOVILL_SKESA { + ext.args = '--assembler skesa --gsize 2800000' + } + + withName: SHOVILL_MEGAHIT { + ext.args = '--assembler megahit --gsize 2800000' + } + + withName: SHOVILL_VELVET { + ext.args = '--assembler velvet --gsize 2800000' + } + +} diff --git a/tests/modules/shovill/test.yml b/tests/modules/shovill/test.yml index a716bc66..6fdd2f3f 100644 --- a/tests/modules/shovill/test.yml +++ b/tests/modules/shovill/test.yml @@ -1,5 +1,5 @@ - name: shovill with spades - command: nextflow run ./tests/modules/shovill -entry test_shovill -c tests/config/nextflow.config + command: nextflow run ./tests/modules/shovill -entry test_shovill -c ./tests/config/nextflow.config -c ./tests/modules/shovill/nextflow.config tags: - shovill files: @@ -13,7 +13,7 @@ - path: output/shovill/shovill.log - name: shovill with megahit - command: nextflow run ./tests/modules/shovill -entry test_shovill_megahit -c tests/config/nextflow.config + command: nextflow run ./tests/modules/shovill -entry test_shovill_megahit -c ./tests/config/nextflow.config -c ./tests/modules/shovill/nextflow.config tags: - shovill files: @@ -26,7 +26,7 @@ - path: output/shovill/shovill.log - name: shovill with skesa - command: nextflow run ./tests/modules/shovill -entry test_shovill_skesa -c tests/config/nextflow.config + command: nextflow run ./tests/modules/shovill -entry test_shovill_skesa -c ./tests/config/nextflow.config -c ./tests/modules/shovill/nextflow.config tags: - shovill files: @@ -39,7 +39,7 @@ - path: output/shovill/shovill.log - name: shovill with velvet - command: nextflow run ./tests/modules/shovill -entry test_shovill_velvet -c tests/config/nextflow.config + command: nextflow run ./tests/modules/shovill -entry test_shovill_velvet -c ./tests/config/nextflow.config -c ./tests/modules/shovill/nextflow.config tags: - shovill files: diff --git a/tests/modules/snpdists/main.nf b/tests/modules/snpdists/main.nf new file mode 100644 index 00000000..be6d745c --- /dev/null +++ b/tests/modules/snpdists/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SNPDISTS } from '../../../modules/snpdists/main.nf' + +workflow test_snpdists { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['genome']['informative_sites_fas'], checkIfExists: true) ] + + SNPDISTS ( input ) +} diff --git a/tests/modules/snpdists/nextflow.config b/tests/modules/snpdists/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/snpdists/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/snpdists/test.yml b/tests/modules/snpdists/test.yml new file mode 100644 index 00000000..c23945ce --- /dev/null +++ b/tests/modules/snpdists/test.yml @@ -0,0 +1,7 @@ +- name: snpdists + command: nextflow run ./tests/modules/snpdists -entry test_snpdists -c ./tests/config/nextflow.config -c ./tests/modules/snpdists/nextflow.config + tags: + - snpdists + files: + - path: output/snpdists/test.tsv + md5sum: 0018e5ec43990eb16abe2411fff4e47e diff --git a/tests/modules/snpeff/main.nf b/tests/modules/snpeff/main.nf index 923f98f4..4e8a982d 100644 --- a/tests/modules/snpeff/main.nf +++ b/tests/modules/snpeff/main.nf @@ -2,11 +2,13 @@ nextflow.enable.dsl = 2 -include { SNPEFF } from '../../../modules/snpeff/main.nf' addParams( snpeff_tag: '5.0.WBcel235', use_cache: false ) +include { SNPEFF } from '../../../modules/snpeff/main.nf' workflow test_snpeff { - input = [ [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] - ] + input = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) + ] + SNPEFF ( input, "WBcel235.99", [] ) } diff --git a/tests/modules/snpeff/nextflow.config b/tests/modules/snpeff/nextflow.config new file mode 100644 index 00000000..f4042ab9 --- /dev/null +++ b/tests/modules/snpeff/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SNPEFF { + container = 'nfcore/snpeff:5.0.WBcel235' + } + +} diff --git a/tests/modules/snpeff/test.yml b/tests/modules/snpeff/test.yml index 44eba200..8f4d980f 100644 --- a/tests/modules/snpeff/test.yml +++ b/tests/modules/snpeff/test.yml @@ -1,5 +1,5 @@ - name: snpeff test_snpeff - command: nextflow run tests/modules/snpeff -entry test_snpeff -c tests/config/nextflow.config + command: nextflow run ./tests/modules/snpeff -entry test_snpeff -c ./tests/config/nextflow.config -c ./tests/modules/snpeff/nextflow.config tags: - snpeff files: diff --git a/tests/modules/snpsift/split/main.nf b/tests/modules/snpsift/split/main.nf new file mode 100644 index 00000000..4579fee3 --- /dev/null +++ b/tests/modules/snpsift/split/main.nf @@ -0,0 +1,32 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SNPSIFT_SPLIT } from '../../../../modules/snpsift/split/main.nf' + +workflow test_snpsift_split_base { + + input = [ [ id:'test', split:true], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_vcf'], checkIfExists: true) ] + + SNPSIFT_SPLIT ( input ) +} + +workflow test_snpsift_split_gz { + + input = [ [ id:'test', split:true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + + SNPSIFT_SPLIT ( input ) +} + +workflow test_snpsift_join { + + input = [ [ id:'test', split:false ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf'], checkIfExists: true) ] + ] + + SNPSIFT_SPLIT ( input ) + +} diff --git a/tests/modules/snpsift/split/nextflow.config b/tests/modules/snpsift/split/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/snpsift/split/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/snpsift/split/test.yml b/tests/modules/snpsift/split/test.yml new file mode 100644 index 00000000..529fbca5 --- /dev/null +++ b/tests/modules/snpsift/split/test.yml @@ -0,0 +1,32 @@ +- name: snpsift split test_snpsift_split_base + command: nextflow run tests/modules/snpsift/split -entry test_snpsift_split_base -c tests/config/nextflow.config + tags: + - snpsift/split + - snpsift + files: + - path: output/snpsift/test.rnaseq.chr22.vcf + md5sum: 1bb8724dcbe6fa3101a814c0be51d1ea + - path: output/snpsift/versions.yml + md5sum: 2b9f6b788db6c4fcbf258db763d8fab7 + +- name: snpsift split test_snpsift_split_gz + command: nextflow run tests/modules/snpsift/split -entry test_snpsift_split_gz -c tests/config/nextflow.config + tags: + - snpsift/split + - snpsift + files: + - path: output/snpsift/test.MT192765.1.vcf + md5sum: 9d491cfa84067450342ba8e66c75e5b8 + - path: output/snpsift/versions.yml + md5sum: 6bd63376670d6c1445caea2f31a3f579 + +- name: snpsift split test_snpsift_join + command: nextflow run tests/modules/snpsift/split -entry test_snpsift_join -c tests/config/nextflow.config + tags: + - snpsift/split + - snpsift + files: + - path: output/snpsift/test.joined.vcf + md5sum: c400c7458524d889e0967b06ed72534f + - path: output/snpsift/versions.yml + md5sum: be54682a73d3b91a17eacc0e533448f5 diff --git a/tests/modules/snpsites/main.nf b/tests/modules/snpsites/main.nf index df2a6852..f7801673 100644 --- a/tests/modules/snpsites/main.nf +++ b/tests/modules/snpsites/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SNPSITES } from '../../../modules/snpsites/main.nf' addParams( options: [:] ) +include { SNPSITES } from '../../../modules/snpsites/main.nf' workflow test_snpsites { diff --git a/tests/modules/snpsites/nextflow.config b/tests/modules/snpsites/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/snpsites/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/snpsites/test.yml b/tests/modules/snpsites/test.yml index 8361cd05..d9c19cd5 100644 --- a/tests/modules/snpsites/test.yml +++ b/tests/modules/snpsites/test.yml @@ -1,5 +1,5 @@ - name: snpsites - command: nextflow run ./tests/modules/snpsites -entry test_snpsites -c tests/config/nextflow.config + command: nextflow run ./tests/modules/snpsites -entry test_snpsites -c ./tests/config/nextflow.config -c ./tests/modules/snpsites/nextflow.config tags: - snpsites files: diff --git a/tests/modules/spades/main.nf b/tests/modules/spades/main.nf index a8518a0e..3710eeb7 100644 --- a/tests/modules/spades/main.nf +++ b/tests/modules/spades/main.nf @@ -2,11 +2,13 @@ nextflow.enable.dsl = 2 -include { SPADES } from '../../../modules/spades/main.nf' addParams( spades_hmm: false ,options: ['args': '--rnaviral'] ) +include { SPADES } from '../../../modules/spades/main.nf' workflow test_spades_single_end { input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + [ file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ], + [], + [] ] SPADES ( input, [] ) } @@ -14,7 +16,32 @@ workflow test_spades_single_end { workflow test_spades_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']['test_2_fastq_gz'], checkIfExists: true) ], + [], + [] + ] + + SPADES ( input, [] ) +} + +workflow test_spades_illumina_nanopore { + 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']['nanopore']['test_fastq_gz'], checkIfExists: true) ] + ] + + SPADES ( input, [] ) +} + +// that isnt perfect, because CCS reads should rather be used with -s instead of --pacbio +workflow test_spades_illumina_pacbio { + input = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true) ], + [ file(params.test_data['homo_sapiens']['pacbio']['ccs_fq_gz'], checkIfExists: true) ], + [] ] SPADES ( input, [] ) diff --git a/tests/modules/spades/nextflow.config b/tests/modules/spades/nextflow.config new file mode 100644 index 00000000..5fabafae --- /dev/null +++ b/tests/modules/spades/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SPADES { + ext.args = '--rnaviral' + } + +} diff --git a/tests/modules/spades/test.yml b/tests/modules/spades/test.yml index eeff24cd..98bc9c8c 100644 --- a/tests/modules/spades/test.yml +++ b/tests/modules/spades/test.yml @@ -1,23 +1,52 @@ -- name: spades single end - command: nextflow run ./tests/modules/spades -entry test_spades_single_end -c tests/config/nextflow.config +- name: spades test_spades_single_end + command: nextflow run ./tests/modules/spades -entry test_spades_single_end -c ./tests/config/nextflow.config -c ./tests/modules/spades/nextflow.config tags: - spades files: - - path: output/spades/test.assembly.gfa - md5sum: b2616d2beba83ab7d361b54778d1e759 - - path: output/spades/test.contigs.fa - md5sum: 2690fefde046bc904e90df09a065257a - - path: output/spades/test.scaffolds.fa - md5sum: 2690fefde046bc904e90df09a065257a + - path: output/spades/test.assembly.gfa.gz + md5sum: e5eab229363a906954a07df00e2495a6 + - path: output/spades/test.contigs.fa.gz + md5sum: 64f6b339872b934138c6efd6baa445f4 + - path: output/spades/test.scaffolds.fa.gz + md5sum: 64f6b339872b934138c6efd6baa445f4 - path: output/spades/test.spades.log -- name: spades paired end - command: nextflow run ./tests/modules/spades -entry test_spades_paired_end -c tests/config/nextflow.config +- name: spades test_spades_paired_end + command: nextflow run ./tests/modules/spades -entry test_spades_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/spades/nextflow.config tags: - spades files: - - path: output/spades/test.assembly.gfa - md5sum: faf76135ee390606b899c0197dc38e04 - - path: output/spades/test.contigs.fa - md5sum: 6148e25b33890c80f176f90f2dd88989 + - path: output/spades/test.assembly.gfa.gz + md5sum: c8614fb69907ae832a1359a054af240f + - path: output/spades/test.contigs.fa.gz + md5sum: eab5165b3cda96c235aaa1388010cb27 - path: output/spades/test.spades.log + - path: output/spades/warnings.log + +- name: spades test_spades_illumina_nanopore + command: nextflow run ./tests/modules/spades -entry test_spades_illumina_nanopore -c ./tests/config/nextflow.config -c ./tests/modules/spades/nextflow.config + tags: + - spades + files: + - path: output/spades/test.assembly.gfa.gz + md5sum: e438534f14e107f005efdd659adeba6a + - path: output/spades/test.contigs.fa.gz + md5sum: 027b0e54bfd8f4bc359e751e094133ef + - path: output/spades/test.scaffolds.fa.gz + md5sum: 027b0e54bfd8f4bc359e751e094133ef + - path: output/spades/test.spades.log + - path: output/spades/warnings.log + +- name: spades test_spades_illumina_pacbio + command: nextflow run ./tests/modules/spades -entry test_spades_illumina_pacbio -c ./tests/config/nextflow.config -c ./tests/modules/spades/nextflow.config + tags: + - spades + files: + - path: output/spades/test.assembly.gfa.gz + md5sum: e12aaf83d8dbfc313339b7636ba43447 + - path: output/spades/test.contigs.fa.gz + md5sum: 78523f66d34ac4d5a4890f353c1a6ec6 + - path: output/spades/test.scaffolds.fa.gz + md5sum: 78523f66d34ac4d5a4890f353c1a6ec6 + - path: output/spades/test.spades.log + - path: output/spades/warnings.log diff --git a/tests/modules/spatyper/main.nf b/tests/modules/spatyper/main.nf new file mode 100644 index 00000000..655845c7 --- /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' +include { SPATYPER as SPATYPER_ENRICH } from '../../../modules/spatyper/main.nf' + +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/nextflow.config b/tests/modules/spatyper/nextflow.config new file mode 100644 index 00000000..ac90a452 --- /dev/null +++ b/tests/modules/spatyper/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SPATYPER_ENRICH { + ext.args = '--do_enrich' + } + +} diff --git a/tests/modules/spatyper/test.yml b/tests/modules/spatyper/test.yml new file mode 100644 index 00000000..6e1f8144 --- /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 -c ./tests/modules/spatyper/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 -c ./tests/modules/spatyper/nextflow.config + tags: + - spatyper + files: + - path: output/spatyper/test.tsv + md5sum: a698352823875171696e5e7ed7015c13 diff --git a/tests/modules/sratools/fasterqdump/main.nf b/tests/modules/sratools/fasterqdump/main.nf new file mode 100644 index 00000000..2f838fd2 --- /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' + +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/nextflow.config b/tests/modules/sratools/fasterqdump/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/sratools/fasterqdump/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/sratools/fasterqdump/test.yml b/tests/modules/sratools/fasterqdump/test.yml new file mode 100644 index 00000000..64cf2404 --- /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 -c ./tests/modules/sratools/fasterqdump/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 -c ./tests/modules/sratools/fasterqdump/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 diff --git a/tests/modules/sratools/prefetch/main.nf b/tests/modules/sratools/prefetch/main.nf new file mode 100644 index 00000000..aa6252a1 --- /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' + +workflow test_sratools_prefetch { + + input = [ + [ id:'test', single_end:false ], // meta map + 'ERR2815334' + ] + + SRATOOLS_PREFETCH ( input ) +} diff --git a/tests/modules/sratools/prefetch/nextflow.config b/tests/modules/sratools/prefetch/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/sratools/prefetch/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/sratools/prefetch/test.yml b/tests/modules/sratools/prefetch/test.yml new file mode 100644 index 00000000..a2efef77 --- /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 -c ./tests/modules/sratools/prefetch/nextflow.config + tags: + - sratools/prefetch + - sratools + files: + - path: output/sratools/ERR2815334/ERR2815334.sra + md5sum: 9a98c7f6f4774b7ef94aa915b92a54ea diff --git a/tests/modules/staphopiasccmec/main.nf b/tests/modules/staphopiasccmec/main.nf new file mode 100644 index 00000000..8ea310ce --- /dev/null +++ b/tests/modules/staphopiasccmec/main.nf @@ -0,0 +1,22 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { STAPHOPIASCCMEC } from '../../../modules/staphopiasccmec/main.nf' +include { STAPHOPIASCCMEC as STAPHOPIASCCMEC_HAMMING } from '../../../modules/staphopiasccmec/main.nf' + +workflow test_staphopiasccmec { + + input = [ [ id:'test' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + STAPHOPIASCCMEC ( input ) +} + +workflow test_staphopiasccmec_hamming { + + input = [ [ id:'test' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + STAPHOPIASCCMEC_HAMMING ( input ) +} diff --git a/tests/modules/staphopiasccmec/nextflow.config b/tests/modules/staphopiasccmec/nextflow.config new file mode 100644 index 00000000..7ee97c2f --- /dev/null +++ b/tests/modules/staphopiasccmec/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: STAPHOPIASCCMEC_HAMMING { + ext.args = '--hamming' + } + +} diff --git a/tests/modules/staphopiasccmec/test.yml b/tests/modules/staphopiasccmec/test.yml new file mode 100644 index 00000000..ac3f66da --- /dev/null +++ b/tests/modules/staphopiasccmec/test.yml @@ -0,0 +1,15 @@ +- name: staphopiasccmec test_staphopiasccmec + command: nextflow run ./tests/modules/staphopiasccmec -entry test_staphopiasccmec -c ./tests/config/nextflow.config -c ./tests/modules/staphopiasccmec/nextflow.config + tags: + - staphopiasccmec + files: + - path: output/staphopiasccmec/test.tsv + md5sum: e6460d4164f3af5b290c5ccdb11343bf + +- name: staphopiasccmec test_staphopiasccmec_hamming + command: nextflow run ./tests/modules/staphopiasccmec -entry test_staphopiasccmec_hamming -c ./tests/config/nextflow.config -c ./tests/modules/staphopiasccmec/nextflow.config + tags: + - staphopiasccmec + files: + - path: output/staphopiasccmec/test.tsv + md5sum: 164cda1b05b3b6814c1f0786d93ca070 diff --git a/tests/modules/star/align/main.nf b/tests/modules/star/align/main.nf index d280aeae..bf305d54 100644 --- a/tests/modules/star/align/main.nf +++ b/tests/modules/star/align/main.nf @@ -2,28 +2,77 @@ nextflow.enable.dsl = 2 -include { STAR_GENOMEGENERATE } from '../../../../modules/star/genomegenerate/main.nf' addParams( options: [args: '--genomeSAindexNbases 9'] ) -include { STAR_ALIGN } from '../../../../modules/star/align/main.nf' addParams( options: [args: '--readFilesCommand zcat'] ) +include { STAR_GENOMEGENERATE } from '../../../../modules/star/genomegenerate/main.nf' +include { STAR_ALIGN } from '../../../../modules/star/align/main.nf' +include { STAR_ALIGN as STAR_FOR_ARRIBA } from '../../../../modules/star/align/main.nf' +include { STAR_ALIGN as STAR_FOR_STARFUSION } from '../../../../modules/star/align/main.nf' workflow test_star_alignment_single_end { - input = [ [ id:'test', single_end:true ], // meta map - [ file("${launchDir}/tests/data/generic/fastq/test_single_end.fastq.gz", checkIfExists: true) ] - ] - fasta = file("${launchDir}/tests/data/generic/fasta/GCF_000019425.1_ASM1942v1_genomic.fna", checkIfExists: true) - gtf = file("${launchDir}/tests/data/generic/gtf/GCF_000019425.1_ASM1942v1_genomic.gtf", checkIfExists: true) - + input = [ + [ id:'test', single_end:true ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_1_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) + star_ignore_sjdbgtf = false + seq_platform = 'illumina' + seq_center = false + STAR_GENOMEGENERATE ( fasta, gtf ) - STAR_ALIGN ( input, STAR_GENOMEGENERATE.out.index, gtf ) + STAR_ALIGN ( input, STAR_GENOMEGENERATE.out.index, gtf, star_ignore_sjdbgtf, seq_platform, seq_center ) } workflow test_star_alignment_paired_end { - input = [ [ id:'test', single_end:false ], // meta map - [ file("${launchDir}/tests/data/generic/fastq/test_R1.fastq.gz", checkIfExists: true), - file("${launchDir}/tests/data/generic/fastq/test_R2.fastq.gz", checkIfExists: true) ] - ] - fasta = file("${launchDir}/tests/data/generic/fasta/GCF_000019425.1_ASM1942v1_genomic.fna", checkIfExists: true) - gtf = file("${launchDir}/tests/data/generic/gtf/GCF_000019425.1_ASM1942v1_genomic.gtf", checkIfExists: true) + input = [ + [ id:'test', single_end:false ], // 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) + star_ignore_sjdbgtf = false + seq_platform = 'illumina' + seq_center = false STAR_GENOMEGENERATE ( fasta, gtf ) - STAR_ALIGN ( input, STAR_GENOMEGENERATE.out.index, gtf ) + STAR_ALIGN ( input, STAR_GENOMEGENERATE.out.index, gtf, star_ignore_sjdbgtf, seq_platform, seq_center ) +} + + +workflow test_star_alignment_paired_end_for_fusion { + input = [ + [ id:'test', single_end:false ], // 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) + star_ignore_sjdbgtf = false + seq_platform = 'illumina' + seq_center = false + + STAR_GENOMEGENERATE ( fasta, gtf ) + STAR_FOR_ARRIBA ( input, STAR_GENOMEGENERATE.out.index, gtf, star_ignore_sjdbgtf, seq_platform, seq_center ) +} + +workflow test_star_alignment_paired_end_for_starfusion { + input = [ + [ id:'test', single_end:false ], // 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) + star_ignore_sjdbgtf = false + seq_platform = false + seq_center = false + + STAR_GENOMEGENERATE ( fasta, gtf ) + STAR_FOR_STARFUSION ( input, STAR_GENOMEGENERATE.out.index, gtf, star_ignore_sjdbgtf, seq_platform, seq_center ) } diff --git a/tests/modules/star/align/nextflow.config b/tests/modules/star/align/nextflow.config new file mode 100644 index 00000000..751f7837 --- /dev/null +++ b/tests/modules/star/align/nextflow.config @@ -0,0 +1,21 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: STAR_GENOMEGENERATE { + ext.args = '--genomeSAindexNbases 9' + } + + withName: STAR_ALIGN { + ext.args = '--readFilesCommand zcat' + } + + withName: STAR_FOR_ARRIBA { + ext.args = '--readFilesCommand zcat --outSAMtype BAM Unsorted --outSAMunmapped Within --outBAMcompression 0 --outFilterMultimapNmax 50 --peOverlapNbasesMin 10 --alignSplicedMateMapLminOverLmate 0.5 --alignSJstitchMismatchNmax 5 -1 5 5 --chimSegmentMin 10 --chimOutType WithinBAM HardClip --chimJunctionOverhangMin 10 --chimScoreDropMax 30 --chimScoreJunctionNonGTAG 0 --chimScoreSeparation 1 --chimSegmentReadGapMax 3 --chimMultimapNmax 50' + } + + withName: STAR_FOR_STARFUSION { + ext.args = '--readFilesCommand zcat --outSAMtype BAM Unsorted --outReadsUnmapped None --twopassMode Basic --outSAMstrandField intronMotif --outSAMunmapped Within --chimSegmentMin 12 --chimJunctionOverhangMin 8 --chimOutJunctionFormat 1 --alignSJDBoverhangMin 10 --alignMatesGapMax 100000 --alignIntronMax 100000 --alignSJstitchMismatchNmax 5 -1 5 5 --chimMultimapScoreRange 3 --chimScoreJunctionNonGTAG -4 --chimMultimapNmax 20 --chimNonchimScoreDropMin 10 --peOverlapNbasesMin 12 --peOverlapMMp 0.1 --alignInsertionFlush Right --alignSplicedMateMapLminOverLmate 0 --alignSplicedMateMapLmin 30' + } + +} diff --git a/tests/modules/star/align/test.yml b/tests/modules/star/align/test.yml index d6bfb7fa..af5bebe5 100644 --- a/tests/modules/star/align/test.yml +++ b/tests/modules/star/align/test.yml @@ -1,73 +1,177 @@ -- name: star align single-end - command: nextflow run ./tests/modules/star/align -entry test_star_alignment_single_end -c tests/config/nextflow.config +- name: star align test_star_alignment_single_end + command: nextflow run ./tests/modules/star/align -entry test_star_alignment_single_end -c ./tests/config/nextflow.config -c ./tests/modules/star/align/nextflow.config tags: - - star - star/align + - star files: - path: output/star/star/Genome - md5sum: 323c992bac354f93073ce0fc43f222f8 + md5sum: a654229fbca6071dcb6b01ce7df704da + - path: output/star/star/Log.out - path: output/star/star/SA - md5sum: 3e70e4fc6d031e1915bb510727f2c559 + md5sum: 8c3edc46697b72c9e92440d4cf43506c - path: output/star/star/SAindex - md5sum: a94198b95a245d4f64af2a7133b6ec7b + md5sum: 2a0c675d8b91d8e5e8c1826d3500482e - path: output/star/star/chrLength.txt - md5sum: f2bea3725fe1c01420c57fb73bdeb31a + md5sum: c81f40f27e72606d7d07097c1d56a5b5 + - path: output/star/star/chrName.txt + md5sum: 5ae68a67b70976ee95342a7451cb5af1 - path: output/star/star/chrNameLength.txt - md5sum: c7ceb0a8827b2ea91c386933bee48742 + md5sum: b190587cae0531f3cf25552d8aa674db - path: output/star/star/chrStart.txt - md5sum: faf5c55020c99eceeef3e34188ac0d2f + md5sum: 8d3291e6bcdbe9902fbd7c887494173f - path: output/star/star/exonGeTrInfo.tab - md5sum: aec6e7a1ae3fc8c638ce5a9ce9c886b6 + md5sum: d04497f69d6ef889efd4d34fe63edcc4 - path: output/star/star/exonInfo.tab - md5sum: 42eca6ebc2dc72d9d6e6b3acd3714343 + md5sum: 0d560290fab688b7268d88d5494bf9fe + - path: output/star/star/geneInfo.tab + md5sum: 8b608537307443ffaee4927d2b428805 - path: output/star/star/genomeParameters.txt - md5sum: 05e1041cbfb7f81686e17bc80b3ddcea + md5sum: 3097677f4d8b2cb66770b9e55d343a7f - path: output/star/star/sjdbInfo.txt - md5sum: 1082ab459363b3f2f7aabcef0979c1ed + md5sum: 5690ea9d9f09f7ff85b7fd47bd234903 - path: output/star/star/sjdbList.fromGTF.out.tab - md5sum: d41d8cd98f00b204e9800998ecf8427e + md5sum: 8760c33e966dad0b39f440301ebbdee4 - path: output/star/star/sjdbList.out.tab - md5sum: d41d8cd98f00b204e9800998ecf8427e + md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1 - path: output/star/star/transcriptInfo.tab - md5sum: 8fbe69abbbef4f89da3854873984dbac + md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/star/test.Aligned.out.bam - md5sum: b7f113f12ff62e09d16fa0ace290d03e + md5sum: b9f5e2f6a624b64c300fe25dc3ac801f + - path: output/star/test.Log.final.out + - path: output/star/test.Log.out + - path: output/star/test.Log.progress.out - path: output/star/test.SJ.out.tab - md5sum: d41d8cd98f00b204e9800998ecf8427e -- name: star align paired-end - command: nextflow run ./tests/modules/star/align -entry test_star_alignment_paired_end -c tests/config/nextflow.config +- name: star align test_star_alignment_paired_end + command: nextflow run ./tests/modules/star/align -entry test_star_alignment_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/star/align/nextflow.config tags: - - star - star/align + - star files: - path: output/star/star/Genome - md5sum: 323c992bac354f93073ce0fc43f222f8 + md5sum: a654229fbca6071dcb6b01ce7df704da + - path: output/star/star/Log.out - path: output/star/star/SA - md5sum: 3e70e4fc6d031e1915bb510727f2c559 + md5sum: 8c3edc46697b72c9e92440d4cf43506c - path: output/star/star/SAindex - md5sum: a94198b95a245d4f64af2a7133b6ec7b + md5sum: 2a0c675d8b91d8e5e8c1826d3500482e - path: output/star/star/chrLength.txt - md5sum: f2bea3725fe1c01420c57fb73bdeb31a + md5sum: c81f40f27e72606d7d07097c1d56a5b5 + - path: output/star/star/chrName.txt + md5sum: 5ae68a67b70976ee95342a7451cb5af1 - path: output/star/star/chrNameLength.txt - md5sum: c7ceb0a8827b2ea91c386933bee48742 + md5sum: b190587cae0531f3cf25552d8aa674db - path: output/star/star/chrStart.txt - md5sum: faf5c55020c99eceeef3e34188ac0d2f + md5sum: 8d3291e6bcdbe9902fbd7c887494173f - path: output/star/star/exonGeTrInfo.tab - md5sum: aec6e7a1ae3fc8c638ce5a9ce9c886b6 + md5sum: d04497f69d6ef889efd4d34fe63edcc4 - path: output/star/star/exonInfo.tab - md5sum: 42eca6ebc2dc72d9d6e6b3acd3714343 + md5sum: 0d560290fab688b7268d88d5494bf9fe + - path: output/star/star/geneInfo.tab + md5sum: 8b608537307443ffaee4927d2b428805 - path: output/star/star/genomeParameters.txt - md5sum: 05e1041cbfb7f81686e17bc80b3ddcea + md5sum: 3097677f4d8b2cb66770b9e55d343a7f - path: output/star/star/sjdbInfo.txt - md5sum: 1082ab459363b3f2f7aabcef0979c1ed + md5sum: 5690ea9d9f09f7ff85b7fd47bd234903 - path: output/star/star/sjdbList.fromGTF.out.tab - md5sum: d41d8cd98f00b204e9800998ecf8427e + md5sum: 8760c33e966dad0b39f440301ebbdee4 - path: output/star/star/sjdbList.out.tab - md5sum: d41d8cd98f00b204e9800998ecf8427e + md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1 - path: output/star/star/transcriptInfo.tab - md5sum: 8fbe69abbbef4f89da3854873984dbac + md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 - path: output/star/test.Aligned.out.bam - md5sum: a1f92e8dbeb954b6b8d3d7cc6b9814fb + md5sum: 38d08f0b944a2a1b981a250d675aa0d9 + - path: output/star/test.Log.final.out + - path: output/star/test.Log.out + - path: output/star/test.Log.progress.out + - path: output/star/test.SJ.out.tab + +- name: star align test_star_alignment_paired_end_for_fusion + command: nextflow run ./tests/modules/star/align -entry test_star_alignment_paired_end_for_fusion -c ./tests/config/nextflow.config -c ./tests/modules/star/align/nextflow.config + tags: + - star/align + - star + files: + - path: output/star/star/Genome + md5sum: a654229fbca6071dcb6b01ce7df704da + - path: output/star/star/Log.out + - path: output/star/star/SA + md5sum: 8c3edc46697b72c9e92440d4cf43506c + - path: output/star/star/SAindex + md5sum: 2a0c675d8b91d8e5e8c1826d3500482e + - path: output/star/star/chrLength.txt + md5sum: c81f40f27e72606d7d07097c1d56a5b5 + - path: output/star/star/chrName.txt + md5sum: 5ae68a67b70976ee95342a7451cb5af1 + - path: output/star/star/chrNameLength.txt + md5sum: b190587cae0531f3cf25552d8aa674db + - path: output/star/star/chrStart.txt + md5sum: 8d3291e6bcdbe9902fbd7c887494173f + - path: output/star/star/exonGeTrInfo.tab + md5sum: d04497f69d6ef889efd4d34fe63edcc4 + - path: output/star/star/exonInfo.tab + md5sum: 0d560290fab688b7268d88d5494bf9fe + - path: output/star/star/geneInfo.tab + md5sum: 8b608537307443ffaee4927d2b428805 + - path: output/star/star/genomeParameters.txt + md5sum: 3097677f4d8b2cb66770b9e55d343a7f + - path: output/star/star/sjdbInfo.txt + md5sum: 5690ea9d9f09f7ff85b7fd47bd234903 + - path: output/star/star/sjdbList.fromGTF.out.tab + md5sum: 8760c33e966dad0b39f440301ebbdee4 + - path: output/star/star/sjdbList.out.tab + md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1 + - path: output/star/star/transcriptInfo.tab + md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 + - path: output/star/test.Aligned.out.bam + md5sum: c740d5177067c1fcc48ab7a16cd639d7 + - path: output/star/test.Log.final.out + - path: output/star/test.Log.out + - path: output/star/test.Log.progress.out + - path: output/star/test.SJ.out.tab + +- name: star align test_star_alignment_paired_end_for_starfusion + command: nextflow run ./tests/modules/star/align -entry test_star_alignment_paired_end_for_starfusion -c ./tests/config/nextflow.config -c ./tests/modules/star/align/nextflow.config + tags: + - star/align + - star + files: + - path: output/star/star/Genome + md5sum: a654229fbca6071dcb6b01ce7df704da + - path: output/star/star/Log.out + - path: output/star/star/SA + md5sum: 8c3edc46697b72c9e92440d4cf43506c + - path: output/star/star/SAindex + md5sum: 2a0c675d8b91d8e5e8c1826d3500482e + - path: output/star/star/chrLength.txt + md5sum: c81f40f27e72606d7d07097c1d56a5b5 + - path: output/star/star/chrName.txt + md5sum: 5ae68a67b70976ee95342a7451cb5af1 + - path: output/star/star/chrNameLength.txt + md5sum: b190587cae0531f3cf25552d8aa674db + - path: output/star/star/chrStart.txt + md5sum: 8d3291e6bcdbe9902fbd7c887494173f + - path: output/star/star/exonGeTrInfo.tab + md5sum: d04497f69d6ef889efd4d34fe63edcc4 + - path: output/star/star/exonInfo.tab + md5sum: 0d560290fab688b7268d88d5494bf9fe + - path: output/star/star/geneInfo.tab + md5sum: 8b608537307443ffaee4927d2b428805 + - path: output/star/star/genomeParameters.txt + md5sum: 3097677f4d8b2cb66770b9e55d343a7f + - path: output/star/star/sjdbInfo.txt + md5sum: 5690ea9d9f09f7ff85b7fd47bd234903 + - path: output/star/star/sjdbList.fromGTF.out.tab + md5sum: 8760c33e966dad0b39f440301ebbdee4 + - path: output/star/star/sjdbList.out.tab + md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1 + - path: output/star/star/transcriptInfo.tab + md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 + - path: output/star/test.Aligned.out.bam + md5sum: a1bd1b40950a58ea2776908076160052 + - path: output/star/test.Chimeric.out.junction + md5sum: 327629eb54032212f29e1c32cbac6975 + - path: output/star/test.Log.final.out + - path: output/star/test.Log.out + - path: output/star/test.Log.progress.out - path: output/star/test.SJ.out.tab - md5sum: d41d8cd98f00b204e9800998ecf8427e diff --git a/tests/modules/star/genomegenerate/main.nf b/tests/modules/star/genomegenerate/main.nf index 4753de9e..31601478 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' workflow test_star_genomegenerate { fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/star/genomegenerate/nextflow.config b/tests/modules/star/genomegenerate/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/star/genomegenerate/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/star/genomegenerate/test.yml b/tests/modules/star/genomegenerate/test.yml index 4e9c2247..0e397009 100644 --- a/tests/modules/star/genomegenerate/test.yml +++ b/tests/modules/star/genomegenerate/test.yml @@ -1,31 +1,37 @@ -- name: star genomegenerate - command: nextflow run ./tests/modules/star/genomegenerate -entry test_star_genomegenerate -c tests/config/nextflow.config +- name: star genomegenerate test_star_genomegenerate + command: nextflow run ./tests/modules/star/genomegenerate -entry test_star_genomegenerate -c ./tests/config/nextflow.config -c ./tests/modules/star/genomegenerate/nextflow.config tags: - star - star/genomegenerate files: - - path: ./output/index/star/Genome - md5sum: 323c992bac354f93073ce0fc43f222f8 - - path: ./output/index/star/SA - md5sum: 3e70e4fc6d031e1915bb510727f2c559 - - path: ./output/index/star/SAindex - md5sum: a94198b95a245d4f64af2a7133b6ec7b - - path: ./output/index/star/chrLength.txt - md5sum: f2bea3725fe1c01420c57fb73bdeb31a - - path: ./output/index/star/chrNameLength.txt - md5sum: c7ceb0a8827b2ea91c386933bee48742 - - path: ./output/index/star/chrStart.txt - md5sum: faf5c55020c99eceeef3e34188ac0d2f - - path: ./output/index/star/exonGeTrInfo.tab - md5sum: aec6e7a1ae3fc8c638ce5a9ce9c886b6 - - path: ./output/index/star/exonInfo.tab - md5sum: 42eca6ebc2dc72d9d6e6b3acd3714343 - - path: ./output/index/star/sjdbInfo.txt - md5sum: 1082ab459363b3f2f7aabcef0979c1ed - - path: ./output/index/star/sjdbList.fromGTF.out.tab - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: ./output/index/star/sjdbList.out.tab - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: ./output/index/star/transcriptInfo.tab - md5sum: 8fbe69abbbef4f89da3854873984dbac - - path: ./output/index/star/genomeParameters.txt + - path: output/star/star/Genome + md5sum: a654229fbca6071dcb6b01ce7df704da + - path: output/star/star/Log.out + - path: output/star/star/SA + md5sum: 8c3edc46697b72c9e92440d4cf43506c + - path: output/star/star/SAindex + md5sum: d0fbf2789ee1e9f60c352ba3655d9de4 + - path: output/star/star/chrLength.txt + md5sum: c81f40f27e72606d7d07097c1d56a5b5 + - path: output/star/star/chrName.txt + md5sum: 5ae68a67b70976ee95342a7451cb5af1 + - path: output/star/star/chrNameLength.txt + md5sum: b190587cae0531f3cf25552d8aa674db + - path: output/star/star/chrStart.txt + md5sum: 8d3291e6bcdbe9902fbd7c887494173f + - path: output/star/star/exonGeTrInfo.tab + md5sum: d04497f69d6ef889efd4d34fe63edcc4 + - path: output/star/star/exonInfo.tab + md5sum: 0d560290fab688b7268d88d5494bf9fe + - path: output/star/star/geneInfo.tab + md5sum: 8b608537307443ffaee4927d2b428805 + - path: output/star/star/genomeParameters.txt + md5sum: 5a1ec027e575c3d7c1851e6b80fb8c5d + - path: output/star/star/sjdbInfo.txt + md5sum: 5690ea9d9f09f7ff85b7fd47bd234903 + - path: output/star/star/sjdbList.fromGTF.out.tab + md5sum: 8760c33e966dad0b39f440301ebbdee4 + - path: output/star/star/sjdbList.out.tab + md5sum: 9e4f991abbbfeb3935a2bb21b9e258f1 + - path: output/star/star/transcriptInfo.tab + md5sum: 0c3a5adb49d15e5feff81db8e29f2e36 diff --git a/tests/modules/strelka/germline/main.nf b/tests/modules/strelka/germline/main.nf index 4ce4699a..c50d76e1 100644 --- a/tests/modules/strelka/germline/main.nf +++ b/tests/modules/strelka/germline/main.nf @@ -2,33 +2,35 @@ nextflow.enable.dsl = 2 -include { STRELKA_GERMLINE } from '../../../../modules/strelka/germline/main.nf' addParams( options: [:] ) +include { STRELKA_GERMLINE } from '../../../../modules/strelka/germline/main.nf' workflow test_strelka_germline { - input = [ + input = [ [ id:'test'], // 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) + 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), ] - - fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) - targets = [] - - STRELKA_GERMLINE ( input, fasta, fai, targets ) + + 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) + target_bed = [] + target_bed_tbi = [] + + STRELKA_GERMLINE ( input, fasta, fai, target_bed, target_bed_tbi ) } workflow test_strelka_germline_target_bed { - input = [ + input = [ [ id:'test'], // 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) + 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), ] - fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) - targets = file(params.test_data['sarscov2']['genome']['test_bed'], 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) + target_bed = file(params.test_data['homo_sapiens']['genome']['genome_bed_gz'], checkIfExists: true) + target_bed_tbi = file(params.test_data['homo_sapiens']['genome']['genome_bed_gz_tbi'], checkIfExists: true) - STRELKA_GERMLINE ( input, fasta, fai, targets ) + STRELKA_GERMLINE ( input, fasta, fai, target_bed, target_bed_tbi ) } diff --git a/tests/modules/strelka/germline/nextflow.config b/tests/modules/strelka/germline/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/strelka/germline/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/strelka/germline/test.yml b/tests/modules/strelka/germline/test.yml index ac654ce8..8db81aa0 100644 --- a/tests/modules/strelka/germline/test.yml +++ b/tests/modules/strelka/germline/test.yml @@ -1,20 +1,21 @@ -- name: strelka germline - command: nextflow run ./tests/modules/strelka/germline -entry test_strelka_germline -c tests/config/nextflow.config +- name: strelka germline test_strelka_germline + command: nextflow run ./tests/modules/strelka/germline -entry test_strelka_germline -c ./tests/config/nextflow.config -c ./tests/modules/strelka/germline/nextflow.config tags: - strelka - strelka/germline files: - - path: output/strelka/test.variants.vcf.gz - - path: output/strelka/test.variants.vcf.gz.tbi - path: output/strelka/test.genome.vcf.gz - path: output/strelka/test.genome.vcf.gz.tbi -- name: strelka germline target bed - command: nextflow run ./tests/modules/strelka/germline -entry test_strelka_germline_target_bed -c tests/config/nextflow.config + - path: output/strelka/test.variants.vcf.gz + - path: output/strelka/test.variants.vcf.gz.tbi + +- name: strelka germline test_strelka_germline_target_bed + command: nextflow run ./tests/modules/strelka/germline -entry test_strelka_germline_target_bed -c ./tests/config/nextflow.config -c ./tests/modules/strelka/germline/nextflow.config tags: - strelka - strelka/germline files: - - path: output/strelka/test.variants.vcf.gz - - path: output/strelka/test.variants.vcf.gz.tbi - path: output/strelka/test.genome.vcf.gz - path: output/strelka/test.genome.vcf.gz.tbi + - path: output/strelka/test.variants.vcf.gz + - path: output/strelka/test.variants.vcf.gz.tbi diff --git a/tests/modules/strelka/somatic/main.nf b/tests/modules/strelka/somatic/main.nf new file mode 100644 index 00000000..b1d4efeb --- /dev/null +++ b/tests/modules/strelka/somatic/main.nf @@ -0,0 +1,44 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { STRELKA_SOMATIC } from '../../../../modules/strelka/somatic/main.nf' + +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 ) +} + +workflow test_strelka__best_practices_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), + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], 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/nextflow.config b/tests/modules/strelka/somatic/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/strelka/somatic/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/strelka/somatic/test.yml b/tests/modules/strelka/somatic/test.yml new file mode 100644 index 00000000..a56f955a --- /dev/null +++ b/tests/modules/strelka/somatic/test.yml @@ -0,0 +1,25 @@ +- name: strelka somatic test_strelka_somatic + command: nextflow run ./tests/modules/strelka/somatic -entry test_strelka_somatic -c ./tests/config/nextflow.config -c ./tests/modules/strelka/somatic/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 + +- name: strelka somatic test_strelka__best_practices_somatic + command: nextflow run ./tests/modules/strelka/somatic -entry test_strelka__best_practices_somatic -c ./tests/config/nextflow.config -c ./tests/modules/strelka/somatic/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 diff --git a/tests/modules/stringtie/merge/main.nf b/tests/modules/stringtie/merge/main.nf index f0202c33..7851e755 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' +include { STRINGTIE_MERGE } from '../../../../modules/stringtie/merge/main.nf' + /* * 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/nextflow.config b/tests/modules/stringtie/merge/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/stringtie/merge/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/stringtie/merge/test.yml b/tests/modules/stringtie/merge/test.yml index 57488377..392a1d7c 100644 --- a/tests/modules/stringtie/merge/test.yml +++ b/tests/modules/stringtie/merge/test.yml @@ -1,17 +1,49 @@ -- name: stringtie forward-strand merge - command: nextflow run ./tests/modules/stringtie/merge/ -entry test_stringtie_forward_merge -c tests/config/nextflow.config +- name: stringtie merge forward-strand + command: nextflow run ./tests/modules/stringtie/merge -entry test_stringtie_forward_merge -c ./tests/config/nextflow.config -c ./tests/modules/stringtie/merge/nextflow.config tags: - stringtie - stringtie/merge files: - - path: ./output/test_stringtie_forward_merge/stringtie.merged.gtf - md5sum: 676aa20a2d7a3db18136cdc7ba183099 + - path: output/stringtie/stringtie.merged.gtf + md5sum: 9fab7049ef2eafdea246fc787d1def40 + - path: output/stringtie/test.ballgown/e2t.ctab + md5sum: 9ae42e056c955a88a883e5e917840d77 + - path: output/stringtie/test.ballgown/e_data.ctab + md5sum: adbedee7b2f84c70362ad6dfa57442b7 + - path: output/stringtie/test.ballgown/i2t.ctab + md5sum: 658131af118cfb416939044fdb5411de + - path: output/stringtie/test.ballgown/i_data.ctab + md5sum: f01d94a7d0dcfad3bfab18ed50dad16c + - path: output/stringtie/test.ballgown/t_data.ctab + md5sum: 92a98902784e7406ffe054d2adbabc7c + - path: output/stringtie/test.coverage.gtf + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/stringtie/test.gene.abundance.txt + md5sum: 9708811bcefe0f6384293d6f419f3250 + - path: output/stringtie/test.transcripts.gtf + md5sum: 0e42709bfe30c2c7f2574ba664f5fa9f -- name: stringtie reverse-strand merge - command: nextflow run ./tests/modules/stringtie/merge/ -entry test_stringtie_reverse_merge -c tests/config/nextflow.config +- name: stringtie merge test_stringtie_reverse_merge + command: nextflow run ./tests/modules/stringtie/merge -entry test_stringtie_reverse_merge -c ./tests/config/nextflow.config -c ./tests/modules/stringtie/merge/nextflow.config tags: - stringtie - stringtie/merge files: - - path: ./output/test_stringtie_reverse_merge/stringtie.merged.gtf - md5sum: 67e5102722ecaeea1fb44d1ec0953474 + - path: output/stringtie/stringtie.merged.gtf + md5sum: afc461bb3cbc368f268a7a45c1b54497 + - path: output/stringtie/test.ballgown/e2t.ctab + md5sum: 9ae42e056c955a88a883e5e917840d77 + - path: output/stringtie/test.ballgown/e_data.ctab + md5sum: fd8496d3957ade3b2c0853155f9a67da + - path: output/stringtie/test.ballgown/i2t.ctab + md5sum: 658131af118cfb416939044fdb5411de + - path: output/stringtie/test.ballgown/i_data.ctab + md5sum: f01d94a7d0dcfad3bfab18ed50dad16c + - path: output/stringtie/test.ballgown/t_data.ctab + md5sum: 92a98902784e7406ffe054d2adbabc7c + - path: output/stringtie/test.coverage.gtf + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/stringtie/test.gene.abundance.txt + md5sum: 94b85145d60ab1b80a7f0f6cf08418b0 + - path: output/stringtie/test.transcripts.gtf + md5sum: 3196e3d50fd461aae6408e0a70acae68 diff --git a/tests/modules/stringtie/stringtie/main.nf b/tests/modules/stringtie/stringtie/main.nf index fc321f8f..ae6abe67 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' // // 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/nextflow.config b/tests/modules/stringtie/stringtie/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/stringtie/stringtie/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/stringtie/stringtie/test.yml b/tests/modules/stringtie/stringtie/test.yml index 14eff6eb..732b9fd1 100644 --- a/tests/modules/stringtie/stringtie/test.yml +++ b/tests/modules/stringtie/stringtie/test.yml @@ -1,43 +1,43 @@ -- name: test_stringtie_forward - command: nextflow run ./tests/modules/stringtie/stringtie/ -entry test_stringtie_forward -c tests/config/nextflow.config +- name: stringtie stringtie forward + command: nextflow run ./tests/modules/stringtie/stringtie/ -entry test_stringtie_forward -c ./tests/config/nextflow.config -c ./tests/modules/stringtie/stringtie/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 - command: nextflow run ./tests/modules/stringtie/stringtie/ -entry test_stringtie_reverse -c tests/config/nextflow.config +- name: stringtie stringtie reverse + command: nextflow run ./tests/modules/stringtie/stringtie/ -entry test_stringtie_reverse -c ./tests/config/nextflow.config -c ./tests/modules/stringtie/stringtie/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 diff --git a/tests/modules/subread/featurecounts/main.nf b/tests/modules/subread/featurecounts/main.nf index eae60f80..a8fa5c75 100644 --- a/tests/modules/subread/featurecounts/main.nf +++ b/tests/modules/subread/featurecounts/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { SUBREAD_FEATURECOUNTS } from '../../../../modules/subread/featurecounts/main.nf' addParams( options: [args:'-t CDS'] ) +include { SUBREAD_FEATURECOUNTS } from '../../../../modules/subread/featurecounts/main.nf' workflow test_subread_featurecounts_forward { diff --git a/tests/modules/subread/featurecounts/nextflow.config b/tests/modules/subread/featurecounts/nextflow.config new file mode 100644 index 00000000..d9fd4fd5 --- /dev/null +++ b/tests/modules/subread/featurecounts/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SUBREAD_FEATURECOUNTS { + ext.args = '-t CDS' + } + +} diff --git a/tests/modules/subread/featurecounts/test.yml b/tests/modules/subread/featurecounts/test.yml index 2cba9e15..7cc24457 100644 --- a/tests/modules/subread/featurecounts/test.yml +++ b/tests/modules/subread/featurecounts/test.yml @@ -1,32 +1,32 @@ - name: subread featurecounts test_subread_featurecounts_forward - command: nextflow run tests/modules/subread/featurecounts -entry test_subread_featurecounts_forward -c tests/config/nextflow.config + command: nextflow run ./tests/modules/subread/featurecounts -entry test_subread_featurecounts_forward -c ./tests/config/nextflow.config -c ./tests/modules/subread/featurecounts/nextflow.config tags: - 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 + command: nextflow run ./tests/modules/subread/featurecounts -entry test_subread_featurecounts_reverse -c ./tests/config/nextflow.config -c ./tests/modules/subread/featurecounts/nextflow.config tags: - 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 + command: nextflow run ./tests/modules/subread/featurecounts -entry test_subread_featurecounts_unstranded -c ./tests/config/nextflow.config -c ./tests/modules/subread/featurecounts/nextflow.config tags: - 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/tabix/bgzip/main.nf b/tests/modules/tabix/bgzip/main.nf index 8756b17d..4d349890 100644 --- a/tests/modules/tabix/bgzip/main.nf +++ b/tests/modules/tabix/bgzip/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { TABIX_BGZIP } from '../../../../modules/tabix/bgzip/main.nf' addParams( options: [:] ) +include { TABIX_BGZIP } from '../../../../modules/tabix/bgzip/main.nf' workflow test_tabix_bgzip { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/tabix/bgzip/nextflow.config b/tests/modules/tabix/bgzip/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/tabix/bgzip/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/tabix/bgzip/test.yml b/tests/modules/tabix/bgzip/test.yml index e254daed..19357655 100644 --- a/tests/modules/tabix/bgzip/test.yml +++ b/tests/modules/tabix/bgzip/test.yml @@ -1,8 +1,8 @@ - name: tabix bgzip - command: nextflow run ./tests/modules/tabix/bgzip -entry test_tabix_bgzip -c tests/config/nextflow.config + command: nextflow run ./tests/modules/tabix/bgzip -entry test_tabix_bgzip -c ./tests/config/nextflow.config -c ./tests/modules/tabix/bgzip/nextflow.config tags: - tabix - tabix/bgzip files: - path: ./output/tabix/test.vcf.gz - md5sum: 0f1c94af3aa3e7e203d9e034ef6f8f4d + md5sum: fc178eb342a91dc0d1d568601ad8f8e2 diff --git a/tests/modules/tabix/bgziptabix/main.nf b/tests/modules/tabix/bgziptabix/main.nf index 51e242fd..b2ff70d0 100644 --- a/tests/modules/tabix/bgziptabix/main.nf +++ b/tests/modules/tabix/bgziptabix/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { TABIX_BGZIPTABIX } from '../../../../modules/tabix/bgziptabix/main.nf' addParams( options: ['args2': '-p vcf'] ) +include { TABIX_BGZIPTABIX } from '../../../../modules/tabix/bgziptabix/main.nf' workflow test_tabix_bgziptabix { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/tabix/bgziptabix/nextflow.config b/tests/modules/tabix/bgziptabix/nextflow.config new file mode 100644 index 00000000..041bfa6a --- /dev/null +++ b/tests/modules/tabix/bgziptabix/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: TABIX_BGZIPTABIX { + ext.args2 = '-p vcf' + } + +} diff --git a/tests/modules/tabix/bgziptabix/test.yml b/tests/modules/tabix/bgziptabix/test.yml index c0b9c247..1bcfa88a 100644 --- a/tests/modules/tabix/bgziptabix/test.yml +++ b/tests/modules/tabix/bgziptabix/test.yml @@ -1,10 +1,10 @@ - name: tabix bgziptabix - command: nextflow run ./tests/modules/tabix/bgziptabix -entry test_tabix_bgziptabix -c tests/config/nextflow.config + command: nextflow run ./tests/modules/tabix/bgziptabix -entry test_tabix_bgziptabix -c ./tests/config/nextflow.config -c ./tests/modules/tabix/bgziptabix/nextflow.config tags: - tabix - tabix/bgziptabix files: - path: ./output/tabix/test.gz - md5sum: 0f1c94af3aa3e7e203d9e034ef6f8f4d + md5sum: fc178eb342a91dc0d1d568601ad8f8e2 - path: ./output/tabix/test.gz.tbi - md5sum: bbec39fd53cf2834909d52094980d094 + md5sum: 36e11bf96ed0af4a92caa91a68612d64 diff --git a/tests/modules/tabix/tabix/main.nf b/tests/modules/tabix/tabix/main.nf index 0963ffcd..993ee812 100644 --- a/tests/modules/tabix/tabix/main.nf +++ b/tests/modules/tabix/tabix/main.nf @@ -2,9 +2,9 @@ nextflow.enable.dsl = 2 -include { TABIX_TABIX as TABIX_BED } from '../../../../modules/tabix/tabix/main.nf' addParams( options: ['args': '-p bed'] ) -include { TABIX_TABIX as TABIX_GFF } from '../../../../modules/tabix/tabix/main.nf' addParams( options: ['args': '-p gff'] ) -include { TABIX_TABIX as TABIX_VCF } from '../../../../modules/tabix/tabix/main.nf' addParams( options: ['args': '-p vcf'] ) +include { TABIX_TABIX as TABIX_BED } from '../../../../modules/tabix/tabix/main.nf' +include { TABIX_TABIX as TABIX_GFF } from '../../../../modules/tabix/tabix/main.nf' +include { TABIX_TABIX as TABIX_VCF } from '../../../../modules/tabix/tabix/main.nf' workflow test_tabix_tabix_bed { input = [ [ id:'B.bed' ], // meta map diff --git a/tests/modules/tabix/tabix/nextflow.config b/tests/modules/tabix/tabix/nextflow.config new file mode 100644 index 00000000..aa97a873 --- /dev/null +++ b/tests/modules/tabix/tabix/nextflow.config @@ -0,0 +1,17 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: TABIX_BED { + ext.args = '-p bed' + } + + withName: TABIX_GFF { + ext.args = '-p gff' + } + + withName: TABIX_VCF { + ext.args = '-p vcf' + } + +} diff --git a/tests/modules/tabix/tabix/test.yml b/tests/modules/tabix/tabix/test.yml index 41c4a940..46be28dd 100644 --- a/tests/modules/tabix/tabix/test.yml +++ b/tests/modules/tabix/tabix/test.yml @@ -1,24 +1,24 @@ - name: tabix tabix bed - command: nextflow run ./tests/modules/tabix/tabix -entry test_tabix_tabix_bed -c tests/config/nextflow.config + command: nextflow run ./tests/modules/tabix/tabix -entry test_tabix_tabix_bed -c ./tests/config/nextflow.config -c ./tests/modules/tabix/tabix/nextflow.config tags: - tabix - tabix/tabix files: - path: ./output/tabix/test.bed.gz.tbi - md5sum: 115922d881d24879b15d20c3734495ac + md5sum: 5b40851ab6b8ccf7946313c86481c0df - name: tabix tabix gff - command: nextflow run ./tests/modules/tabix/tabix -entry test_tabix_tabix_gff -c tests/config/nextflow.config + command: nextflow run ./tests/modules/tabix/tabix -entry test_tabix_tabix_gff -c ./tests/config/nextflow.config -c ./tests/modules/tabix/tabix/nextflow.config tags: - tabix - tabix/tabix files: - path: ./output/tabix/genome.gff3.gz.tbi - md5sum: 4059fe4762568194cf293fc6df7b358b + md5sum: f79a67d95a98076e04fbe0455d825926 - name: tabix tabix vcf - command: nextflow run ./tests/modules/tabix/tabix -entry test_tabix_tabix_vcf -c tests/config/nextflow.config + command: nextflow run ./tests/modules/tabix/tabix -entry test_tabix_tabix_vcf -c ./tests/config/nextflow.config -c ./tests/modules/tabix/tabix/nextflow.config tags: - tabix - tabix/tabix files: - path: output/tabix/test.vcf.gz.tbi - md5sum: bbec39fd53cf2834909d52094980d094 + md5sum: 36e11bf96ed0af4a92caa91a68612d64 diff --git a/tests/modules/tbprofiler/profile/main.nf b/tests/modules/tbprofiler/profile/main.nf new file mode 100644 index 00000000..0141a77f --- /dev/null +++ b/tests/modules/tbprofiler/profile/main.nf @@ -0,0 +1,28 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { TBPROFILER_PROFILE } from '../../../../modules/tbprofiler/profile/main.nf' + +workflow test_tbprofiler_profile_illumina { + + 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) + ] + ] + + TBPROFILER_PROFILE ( input ) +} + +workflow test_tbprofiler_profile_nanopore { + + input = [ + [ id:'test', single_end:true ], // meta map + file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true) + ] + + TBPROFILER_PROFILE ( input ) +} diff --git a/tests/modules/tbprofiler/profile/nextflow.config b/tests/modules/tbprofiler/profile/nextflow.config new file mode 100644 index 00000000..50cb99c6 --- /dev/null +++ b/tests/modules/tbprofiler/profile/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: TBPROFILER_PROFILE_ILLUMINA { + ext.args = '--platform illumina' + } + + withName: TBPROFILER_PROFILE_NANOPORE { + ext.args = '--platform nanopore' + } + +} diff --git a/tests/modules/tbprofiler/profile/test.yml b/tests/modules/tbprofiler/profile/test.yml new file mode 100644 index 00000000..8b40f1fa --- /dev/null +++ b/tests/modules/tbprofiler/profile/test.yml @@ -0,0 +1,21 @@ +- name: tbprofiler profile illumina + command: nextflow run ./tests/modules/tbprofiler/profile -entry test_tbprofiler_profile_illumina -c ./tests/config/nextflow.config -c ./tests/modules/tbprofiler/profile/nextflow.config + tags: + - tbprofiler + - tbprofiler/profile + files: + - path: output/tbprofiler/bam/test.bam + - path: output/tbprofiler/results/test.results.json + contains: ['genome_positions', 'locus_tag', 'tbprofiler_version'] + - path: output/tbprofiler/vcf/test.targets.csq.vcf.gz + +- name: tbprofiler profile nanopore + command: nextflow run ./tests/modules/tbprofiler/profile -entry test_tbprofiler_profile_nanopore -c ./tests/config/nextflow.config -c ./tests/modules/tbprofiler/profile/nextflow.config + tags: + - tbprofiler + - tbprofiler/profile + files: + - path: output/tbprofiler/bam/test.bam + - path: output/tbprofiler/results/test.results.json + contains: ['genome_positions', 'locus_tag', 'tbprofiler_version'] + - path: output/tbprofiler/vcf/test.targets.csq.vcf.gz diff --git a/tests/modules/tiddit/cov/main.nf b/tests/modules/tiddit/cov/main.nf new file mode 100644 index 00000000..1bb35145 --- /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' + +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/nextflow.config b/tests/modules/tiddit/cov/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/tiddit/cov/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/tiddit/cov/test.yml b/tests/modules/tiddit/cov/test.yml new file mode 100644 index 00000000..90c4cbb3 --- /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 -c ./tests/modules/tiddit/cov/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 -c ./tests/modules/tiddit/cov/nextflow.config + tags: + - tiddit + - tiddit/cov + files: + - path: output/tiddit/test.tab + md5sum: f7974948f809f94879d8a60b726194f5 diff --git a/tests/modules/tiddit/sv/main.nf b/tests/modules/tiddit/sv/main.nf index 8a5a8140..8dae4950 100644 --- a/tests/modules/tiddit/sv/main.nf +++ b/tests/modules/tiddit/sv/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { TIDDIT_SV } from '../../../../modules/tiddit/sv/main.nf' addParams( options: [:] ) +include { TIDDIT_SV } from '../../../../modules/tiddit/sv/main.nf' workflow test_tiddit_sv { input = [ diff --git a/tests/modules/tiddit/sv/nextflow.config b/tests/modules/tiddit/sv/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/tiddit/sv/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/tiddit/sv/test.yml b/tests/modules/tiddit/sv/test.yml index ed19bf14..168d21c5 100644 --- a/tests/modules/tiddit/sv/test.yml +++ b/tests/modules/tiddit/sv/test.yml @@ -1,5 +1,5 @@ - name: tiddit sv - command: nextflow run ./tests/modules/tiddit/sv -entry test_tiddit_sv -c tests/config/nextflow.config + command: nextflow run ./tests/modules/tiddit/sv -entry test_tiddit_sv -c ./tests/config/nextflow.config -c ./tests/modules/tiddit/sv/nextflow.config tags: - tiddit - tiddit/sv @@ -11,7 +11,7 @@ - path: output/tiddit/test.vcf - name: tiddit sv no ref - command: nextflow run ./tests/modules/tiddit/sv -entry test_tiddit_sv_no_ref -c tests/config/nextflow.config + command: nextflow run ./tests/modules/tiddit/sv -entry test_tiddit_sv_no_ref -c ./tests/config/nextflow.config -c ./tests/modules/tiddit/sv/nextflow.config tags: - tiddit - tiddit/sv diff --git a/tests/modules/trimgalore/main.nf b/tests/modules/trimgalore/main.nf index 3001469d..adeda539 100644 --- a/tests/modules/trimgalore/main.nf +++ b/tests/modules/trimgalore/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { TRIMGALORE } from '../../../modules/trimgalore/main.nf' addParams( options: [:] ) +include { TRIMGALORE } from '../../../modules/trimgalore/main.nf' // // Test with single-end data diff --git a/tests/modules/trimgalore/nextflow.config b/tests/modules/trimgalore/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/trimgalore/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/trimgalore/test.yml b/tests/modules/trimgalore/test.yml index c176f592..ecbd2b5a 100644 --- a/tests/modules/trimgalore/test.yml +++ b/tests/modules/trimgalore/test.yml @@ -1,5 +1,5 @@ - name: trimgalore single-end - command: nextflow run ./tests/modules/trimgalore/ -entry test_trimgalore_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/trimgalore/ -entry test_trimgalore_single_end -c ./tests/config/nextflow.config -c ./tests/modules/trimgalore/nextflow.config tags: - trimgalore files: @@ -9,7 +9,7 @@ - path: ./output/trimgalore/test_trimmed.fq.gz - name: trimgalore paired-end - command: nextflow run ./tests/modules/trimgalore/ -entry test_trimgalore_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/trimgalore/ -entry test_trimgalore_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/trimgalore/nextflow.config tags: - trimgalore files: diff --git a/tests/modules/ucsc/bed12tobigbed/main.nf b/tests/modules/ucsc/bed12tobigbed/main.nf index 8ed64166..7590fc0e 100644 --- a/tests/modules/ucsc/bed12tobigbed/main.nf +++ b/tests/modules/ucsc/bed12tobigbed/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { UCSC_BED12TOBIGBED } from '../../../../modules/ucsc/bed12tobigbed/main.nf' addParams( options: [:] ) +include { UCSC_BED12TOBIGBED } from '../../../../modules/ucsc/bed12tobigbed/main.nf' workflow test_ucsc_bed12tobigbed { input = [ [ id: 'test' ], // meta map diff --git a/tests/modules/ucsc/bed12tobigbed/nextflow.config b/tests/modules/ucsc/bed12tobigbed/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/ucsc/bed12tobigbed/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/ucsc/bed12tobigbed/test.yml b/tests/modules/ucsc/bed12tobigbed/test.yml index e0ee6f75..6bd4262d 100644 --- a/tests/modules/ucsc/bed12tobigbed/test.yml +++ b/tests/modules/ucsc/bed12tobigbed/test.yml @@ -1,5 +1,5 @@ - name: ucsc bed12tobigbed - command: nextflow run ./tests/modules/ucsc/bed12tobigbed -entry test_ucsc_bed12tobigbed -c tests/config/nextflow.config + command: nextflow run ./tests/modules/ucsc/bed12tobigbed -entry test_ucsc_bed12tobigbed -c ./tests/config/nextflow.config -c ./tests/modules/ucsc/bed12tobigbed/nextflow.config tags: - ucsc/bed12tobigbed files: diff --git a/tests/modules/ucsc/bedclip/main.nf b/tests/modules/ucsc/bedclip/main.nf index 162c2eb4..8ccfd3b0 100755 --- a/tests/modules/ucsc/bedclip/main.nf +++ b/tests/modules/ucsc/bedclip/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { UCSC_BEDCLIP } from '../../../../modules/ucsc/bedclip/main.nf' addParams( options: [suffix:'.clip'] ) +include { UCSC_BEDCLIP } from '../../../../modules/ucsc/bedclip/main.nf' workflow test_ucsc_bedclip { input = [ [ id:'test', single_end:false ], // meta map diff --git a/tests/modules/ucsc/bedclip/nextflow.config b/tests/modules/ucsc/bedclip/nextflow.config new file mode 100644 index 00000000..46af4b0a --- /dev/null +++ b/tests/modules/ucsc/bedclip/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: UCSC_BEDCLIP { + ext.prefix = { "${meta.id}.clip" } + } + +} diff --git a/tests/modules/ucsc/bedclip/test.yml b/tests/modules/ucsc/bedclip/test.yml index 103795da..bcf22c71 100755 --- a/tests/modules/ucsc/bedclip/test.yml +++ b/tests/modules/ucsc/bedclip/test.yml @@ -1,5 +1,5 @@ - name: ucsc bedclip - command: nextflow run ./tests/modules/ucsc/bedclip -entry test_ucsc_bedclip -c tests/config/nextflow.config + command: nextflow run ./tests/modules/ucsc/bedclip -entry test_ucsc_bedclip -c ./tests/config/nextflow.config -c ./tests/modules/ucsc/bedclip/nextflow.config tags: - ucsc - ucsc/bedclip diff --git a/tests/modules/ucsc/bedgraphtobigwig/main.nf b/tests/modules/ucsc/bedgraphtobigwig/main.nf index 8d83e235..c6db7225 100644 --- a/tests/modules/ucsc/bedgraphtobigwig/main.nf +++ b/tests/modules/ucsc/bedgraphtobigwig/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { UCSC_BEDGRAPHTOBIGWIG } from '../../../../modules/ucsc/bedgraphtobigwig/main.nf' addParams( options: [:] ) +include { UCSC_BEDGRAPHTOBIGWIG } from '../../../../modules/ucsc/bedgraphtobigwig/main.nf' workflow test_ucsc_bedgraphtobigwig { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/ucsc/bedgraphtobigwig/nextflow.config b/tests/modules/ucsc/bedgraphtobigwig/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/ucsc/bedgraphtobigwig/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/ucsc/bedgraphtobigwig/test.yml b/tests/modules/ucsc/bedgraphtobigwig/test.yml index 726a07ca..c00a0231 100644 --- a/tests/modules/ucsc/bedgraphtobigwig/test.yml +++ b/tests/modules/ucsc/bedgraphtobigwig/test.yml @@ -1,5 +1,5 @@ - name: ucsc bedgraphtobigwig - command: nextflow run ./tests/modules/ucsc/bedgraphtobigwig -entry test_ucsc_bedgraphtobigwig -c tests/config/nextflow.config + command: nextflow run ./tests/modules/ucsc/bedgraphtobigwig -entry test_ucsc_bedgraphtobigwig -c ./tests/config/nextflow.config -c ./tests/modules/ucsc/bedgraphtobigwig/nextflow.config tags: - ucsc/bedgraphtobigwig files: diff --git a/tests/modules/ucsc/bigwigaverageoverbed/main.nf b/tests/modules/ucsc/bigwigaverageoverbed/main.nf index 88310a0b..3b20dc32 100644 --- a/tests/modules/ucsc/bigwigaverageoverbed/main.nf +++ b/tests/modules/ucsc/bigwigaverageoverbed/main.nf @@ -2,12 +2,13 @@ nextflow.enable.dsl = 2 -include { UCSC_BIGWIGAVERAGEOVERBED } from '../../../../modules/ucsc/bigwigaverageoverbed/main.nf' addParams( options: [:] ) +include { UCSC_BIGWIGAVERAGEOVERBED } from '../../../../modules/ucsc/bigwigaverageoverbed/main.nf' 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/ucsc/bigwigaverageoverbed/nextflow.config b/tests/modules/ucsc/bigwigaverageoverbed/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/ucsc/bigwigaverageoverbed/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/ucsc/bigwigaverageoverbed/test.yml b/tests/modules/ucsc/bigwigaverageoverbed/test.yml index 641e9be5..7344c944 100644 --- a/tests/modules/ucsc/bigwigaverageoverbed/test.yml +++ b/tests/modules/ucsc/bigwigaverageoverbed/test.yml @@ -1,5 +1,5 @@ - name: ucsc bigwigaverageoverbed test_ucsc_bigwigaverageoverbed - command: nextflow run tests/modules/ucsc/bigwigaverageoverbed -entry test_ucsc_bigwigaverageoverbed -c tests/config/nextflow.config + command: nextflow run ./tests/modules/ucsc/bigwigaverageoverbed -entry test_ucsc_bigwigaverageoverbed -c ./tests/config/nextflow.config -c ./tests/modules/ucsc/bigwigaverageoverbed/nextflow.config tags: - ucsc - ucsc/bigwigaverageoverbed diff --git a/tests/modules/ucsc/liftover/main.nf b/tests/modules/ucsc/liftover/main.nf new file mode 100644 index 00000000..168193f4 --- /dev/null +++ b/tests/modules/ucsc/liftover/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UCSC_LIFTOVER } from '../../../../modules/ucsc/liftover/main.nf' + +workflow test_ucsc_liftover { + + input = [ [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true)] + chain = file(params.test_data['homo_sapiens']['genome']['genome_chain_gz'], checkIfExists: true) + + UCSC_LIFTOVER ( input, chain ) +} diff --git a/tests/modules/ucsc/liftover/nextflow.config b/tests/modules/ucsc/liftover/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/ucsc/liftover/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/ucsc/liftover/test.yml b/tests/modules/ucsc/liftover/test.yml new file mode 100644 index 00000000..c3016189 --- /dev/null +++ b/tests/modules/ucsc/liftover/test.yml @@ -0,0 +1,10 @@ +- name: ucsc liftover test_ucsc_liftover + command: nextflow run ./tests/modules/ucsc/liftover -entry test_ucsc_liftover -c ./tests/config/nextflow.config -c ./tests/modules/ucsc/liftover/nextflow.config + tags: + - ucsc + - ucsc/liftover + files: + - path: output/ucsc/test.lifted.bed + md5sum: fd5878470257a8a0edeaa8b9374bd520 + - path: output/ucsc/test.unlifted.bed + md5sum: d41d8cd98f00b204e9800998ecf8427e diff --git a/tests/modules/ucsc/wigtobigwig/main.nf b/tests/modules/ucsc/wigtobigwig/main.nf index 81296ac4..614d4150 100644 --- a/tests/modules/ucsc/wigtobigwig/main.nf +++ b/tests/modules/ucsc/wigtobigwig/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { UCSC_WIGTOBIGWIG } from '../../../../modules/ucsc/wigtobigwig/main.nf' addParams( options: [:] ) +include { UCSC_WIGTOBIGWIG } from '../../../../modules/ucsc/wigtobigwig/main.nf' workflow test_ucsc_wigtobigwig { diff --git a/tests/modules/ucsc/wigtobigwig/nextflow.config b/tests/modules/ucsc/wigtobigwig/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/ucsc/wigtobigwig/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/ucsc/wigtobigwig/test.yml b/tests/modules/ucsc/wigtobigwig/test.yml index 15388adb..08d4bce4 100644 --- a/tests/modules/ucsc/wigtobigwig/test.yml +++ b/tests/modules/ucsc/wigtobigwig/test.yml @@ -1,5 +1,5 @@ - name: ucsc wigtobigwig test_ucsc_wigtobigwig - command: nextflow run tests/modules/ucsc/wigtobigwig -entry test_ucsc_wigtobigwig -c tests/config/nextflow.config + command: nextflow run ./tests/modules/ucsc/wigtobigwig -entry test_ucsc_wigtobigwig -c ./tests/config/nextflow.config -c ./tests/modules/ucsc/wigtobigwig/nextflow.config tags: - ucsc - ucsc/wigtobigwig diff --git a/tests/modules/ultra/pipeline/main.nf b/tests/modules/ultra/pipeline/main.nf new file mode 100644 index 00000000..483d48fc --- /dev/null +++ b/tests/modules/ultra/pipeline/main.nf @@ -0,0 +1,22 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ULTRA_PIPELINE } from '../../../../modules/ultra/pipeline/main.nf' +include { GUNZIP } from '../../../../modules/gunzip/main.nf' +include { GFFREAD } from '../../../../modules/gffread/main.nf' + +workflow test_ultra_pipeline { + + input = [ + [ id:'test', single_end:false ], + file(params.test_data['homo_sapiens']['pacbio']['hifi'], checkIfExists: true) + ] + GUNZIP ( input ) + + gtf = file(params.test_data['homo_sapiens']['genome']['genome_gtf'] , checkIfExists: true) + genome = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + GFFREAD ( gtf ) + + ULTRA_PIPELINE ( GUNZIP.out.gunzip, genome, GFFREAD.out.gtf ) +} diff --git a/tests/modules/ultra/pipeline/nextflow.config b/tests/modules/ultra/pipeline/nextflow.config new file mode 100644 index 00000000..16ed7f9b --- /dev/null +++ b/tests/modules/ultra/pipeline/nextflow.config @@ -0,0 +1,10 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: GFFREAD { + ext.args = '--sort-alpha --keep-genes -T' + ext.prefix = { "${meta.id}_sorted" } + } + +} diff --git a/tests/modules/ultra/pipeline/test.yml b/tests/modules/ultra/pipeline/test.yml new file mode 100644 index 00000000..d424ba73 --- /dev/null +++ b/tests/modules/ultra/pipeline/test.yml @@ -0,0 +1,12 @@ +- name: ultra pipeline test_ultra_pipeline + command: nextflow run ./tests/modules/ultra/pipeline -entry test_ultra_pipeline -c ./tests/config/nextflow.config -c ./tests/modules/ultra/pipeline/nextflow.config + tags: + - ultra + - ultra/pipeline + files: + - path: output/gffread/genome_sorted.gtf + md5sum: c0b034860c679a354cd093109ed90437 + - path: output/gunzip/test_hifi.fastq + md5sum: 20e41c569d5828c1e87337e13a5185d3 + - path: output/ultra/test.sam + md5sum: a37a1f9594a3099522dc1f6a903b2b12 diff --git a/tests/modules/unicycler/main.nf b/tests/modules/unicycler/main.nf index 993310a1..861b139b 100644 --- a/tests/modules/unicycler/main.nf +++ b/tests/modules/unicycler/main.nf @@ -2,11 +2,12 @@ nextflow.enable.dsl = 2 -include { UNICYCLER } from '../../../modules/unicycler/main.nf' addParams( options: [:] ) +include { UNICYCLER } from '../../../modules/unicycler/main.nf' workflow test_unicycler_single_end { input = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true) ] + [ file(params.test_data['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true) ], + [] ] UNICYCLER ( input ) @@ -14,8 +15,19 @@ workflow test_unicycler_single_end { workflow test_unicycler_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['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true), + file(params.test_data['bacteroides_fragilis']['illumina']['test1_2_fastq_gz'], checkIfExists: true) ], + [] + ] + + UNICYCLER ( input ) +} + +workflow test_unicycler_shortreads_longreads { + input = [ [ id:'test', single_end:false ], // meta map + [ file(params.test_data['bacteroides_fragilis']['illumina']['test1_1_fastq_gz'], checkIfExists: true), + file(params.test_data['bacteroides_fragilis']['illumina']['test1_2_fastq_gz'], checkIfExists: true) ], + [ file(params.test_data['bacteroides_fragilis']['nanopore']['test_fastq_gz'], checkIfExists: true) ] ] UNICYCLER ( input ) diff --git a/tests/modules/unicycler/nextflow.config b/tests/modules/unicycler/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/unicycler/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/unicycler/test.yml b/tests/modules/unicycler/test.yml index f12cc1ba..e25845aa 100644 --- a/tests/modules/unicycler/test.yml +++ b/tests/modules/unicycler/test.yml @@ -1,21 +1,32 @@ -- name: unicycler single-end - command: nextflow run ./tests/modules/unicycler -entry test_unicycler_single_end -c tests/config/nextflow.config +- name: unicycler test_unicycler_single_end + command: nextflow run ./tests/modules/unicycler -entry test_unicycler_single_end -c ./tests/config/nextflow.config -c ./tests/modules/unicycler/nextflow.config tags: - unicycler files: - - path: output/unicycler/test.scaffolds.fa - - path: output/unicycler/test.assembly.gfa + - path: output/unicycler/test.assembly.gfa.gz + - path: output/unicycler/test.scaffolds.fa.gz - path: output/unicycler/test.unicycler.log contains: - "Assembly complete" -- name: unicycler paired-end - command: nextflow run ./tests/modules/unicycler -entry test_unicycler_paired_end -c tests/config/nextflow.config +- name: unicycler test_unicycler_paired_end + command: nextflow run ./tests/modules/unicycler -entry test_unicycler_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/unicycler/nextflow.config tags: - unicycler files: - - path: output/unicycler/test.scaffolds.fa - - path: output/unicycler/test.assembly.gfa + - path: output/unicycler/test.assembly.gfa.gz + - path: output/unicycler/test.scaffolds.fa.gz + - path: output/unicycler/test.unicycler.log + contains: + - "Assembly complete" + +- name: unicycler test_unicycler_shortreads_longreads + command: nextflow run ./tests/modules/unicycler -entry test_unicycler_shortreads_longreads -c ./tests/config/nextflow.config -c ./tests/modules/unicycler/nextflow.config + tags: + - unicycler + files: + - path: output/unicycler/test.assembly.gfa.gz + - path: output/unicycler/test.scaffolds.fa.gz - path: output/unicycler/test.unicycler.log contains: - "Assembly complete" diff --git a/tests/modules/untar/main.nf b/tests/modules/untar/main.nf index b7317bd9..056e3ea7 100644 --- a/tests/modules/untar/main.nf +++ b/tests/modules/untar/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { UNTAR } from '../../../modules/untar/main.nf' addParams( options: [:] ) +include { UNTAR } from '../../../modules/untar/main.nf' workflow test_untar { input = file(params.test_data['sarscov2']['genome']['kraken2_tar_gz'], checkIfExists: true) diff --git a/tests/modules/untar/nextflow.config b/tests/modules/untar/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/untar/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/untar/test.yml b/tests/modules/untar/test.yml index 9f48e86c..6d0d1d12 100644 --- a/tests/modules/untar/test.yml +++ b/tests/modules/untar/test.yml @@ -1,5 +1,5 @@ - name: untar - command: nextflow run ./tests/modules/untar -entry test_untar -c tests/config/nextflow.config + command: nextflow run ./tests/modules/untar -entry test_untar -c ./tests/config/nextflow.config -c ./tests/modules/untar/nextflow.config tags: - untar files: diff --git a/tests/modules/unzip/main.nf b/tests/modules/unzip/main.nf new file mode 100644 index 00000000..520fe31e --- /dev/null +++ b/tests/modules/unzip/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UNZIP } from '../../../modules/unzip/main.nf' + +workflow test_unzip { + + archive = file(params.test_data['sarscov2']['genome']['ncbi_taxmap_zip'], checkIfExists: true) + + UNZIP ( archive ) +} diff --git a/tests/modules/unzip/nextflow.config b/tests/modules/unzip/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/unzip/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/unzip/test.yml b/tests/modules/unzip/test.yml new file mode 100644 index 00000000..8016b4fa --- /dev/null +++ b/tests/modules/unzip/test.yml @@ -0,0 +1,10 @@ +- name: unzip + command: nextflow run ./tests/modules/unzip -entry test_unzip -c ./tests/config/nextflow.config -c ./tests/modules/unzip/nextflow.config + tags: + - unzip + files: + - path: output/unzip/ncbi_taxmap/ + - path: output/unzip/ncbi_taxmap/ncbi.map + md5sum: de30dbba85f9070612b632e2a5a95952 + - path: output/unzip/ncbi_taxmap/ncbi.tre + md5sum: 4029dd2091c685b9a86ddd9d0d870db0 diff --git a/tests/modules/variantbam/main.nf b/tests/modules/variantbam/main.nf new file mode 100644 index 00000000..016a9104 --- /dev/null +++ b/tests/modules/variantbam/main.nf @@ -0,0 +1,13 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { VARIANTBAM } from '../../../modules/variantbam/main.nf' + +workflow test_variantbam { + + input = [ [ id:'test', single_end:false ], + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + + VARIANTBAM ( input ) +} diff --git a/tests/modules/variantbam/nextflow.config b/tests/modules/variantbam/nextflow.config new file mode 100644 index 00000000..d0314010 --- /dev/null +++ b/tests/modules/variantbam/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: VARIANTBAM { + ext.args = '-m 1' + } + +} diff --git a/tests/modules/variantbam/test.yml b/tests/modules/variantbam/test.yml new file mode 100644 index 00000000..1c9550ed --- /dev/null +++ b/tests/modules/variantbam/test.yml @@ -0,0 +1,7 @@ +- name: variantbam test_variantbam + command: nextflow run ./tests/modules/variantbam -entry test_variantbam -c ./tests/config/nextflow.config -c ./tests/modules/variantbam/nextflow.config + tags: + - variantbam + files: + - path: output/variantbam/test.bam + md5sum: fc08f065475d60b3b06ee32920564d4b diff --git a/tests/modules/vcftools/main.nf b/tests/modules/vcftools/main.nf index 2d4997de..21f9aa88 100644 --- a/tests/modules/vcftools/main.nf +++ b/tests/modules/vcftools/main.nf @@ -2,8 +2,8 @@ nextflow.enable.dsl = 2 -include { VCFTOOLS as VCFTOOLS_BASE } from '../../../modules/vcftools/main.nf' addParams( options: ['args': '--freq'] ) -include { VCFTOOLS as VCFTOOLS_OPTIONAL } from '../../../modules/vcftools/main.nf' addParams( options: ['args': '--freq --exclude-bed'] ) +include { VCFTOOLS as VCFTOOLS_BASE } from '../../../modules/vcftools/main.nf' +include { VCFTOOLS as VCFTOOLS_OPTIONAL } from '../../../modules/vcftools/main.nf' workflow test_vcftools_vcf_base { input = [ [ id:'test' ], // meta map diff --git a/tests/modules/vcftools/nextflow.config b/tests/modules/vcftools/nextflow.config new file mode 100644 index 00000000..6865bbea --- /dev/null +++ b/tests/modules/vcftools/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: VCFTOOLS_BASE { + ext.args = '--freq' + } + + withName: VCFTOOLS_OPTIONAL { + ext.args = '--freq --exclude-bed' + } + +} diff --git a/tests/modules/vcftools/test.yml b/tests/modules/vcftools/test.yml index 81529be2..5314ea75 100644 --- a/tests/modules/vcftools/test.yml +++ b/tests/modules/vcftools/test.yml @@ -1,5 +1,5 @@ - name: vcftools test_vcftools_vcf_base - command: nextflow run tests/modules/vcftools -entry test_vcftools_vcf_base -c tests/config/nextflow.config + command: nextflow run ./tests/modules/vcftools -entry test_vcftools_vcf_base -c ./tests/config/nextflow.config -c ./tests/modules/vcftools/nextflow.config tags: - vcftools files: @@ -7,7 +7,7 @@ md5sum: 7f126655f17268fd1a338734f62868e9 - name: vcftools test_vcftools_vcfgz_base - command: nextflow run tests/modules/vcftools -entry test_vcftools_vcfgz_base -c tests/config/nextflow.config + command: nextflow run ./tests/modules/vcftools -entry test_vcftools_vcfgz_base -c ./tests/config/nextflow.config -c ./tests/modules/vcftools/nextflow.config tags: - vcftools files: @@ -15,7 +15,7 @@ md5sum: 7f126655f17268fd1a338734f62868e9 - name: vcftools test_vcftools_vcf_optional - command: nextflow run tests/modules/vcftools -entry test_vcftools_vcf_optional -c tests/config/nextflow.config + command: nextflow run ./tests/modules/vcftools -entry test_vcftools_vcf_optional -c ./tests/config/nextflow.config -c ./tests/modules/vcftools/nextflow.config tags: - vcftools files: @@ -23,7 +23,7 @@ md5sum: 7f126655f17268fd1a338734f62868e9 - name: vcftools test_vcftools_vcfgz_optional - command: nextflow run tests/modules/vcftools -entry test_vcftools_vcfgz_optional -c tests/config/nextflow.config + command: nextflow run ./tests/modules/vcftools -entry test_vcftools_vcfgz_optional -c ./tests/config/nextflow.config -c ./tests/modules/vcftools/nextflow.config tags: - vcftools files: diff --git a/tests/modules/yara/index/main.nf b/tests/modules/yara/index/main.nf index dcedc61b..89eb0f7d 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' 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/nextflow.config b/tests/modules/yara/index/nextflow.config new file mode 100644 index 00000000..8730f1c4 --- /dev/null +++ b/tests/modules/yara/index/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/yara/index/test.yml b/tests/modules/yara/index/test.yml index 384aeee8..a8d17866 100644 --- a/tests/modules/yara/index/test.yml +++ b/tests/modules/yara/index/test.yml @@ -1,30 +1,30 @@ - name: yara index test_yara_index - command: nextflow run tests/modules/yara/index -entry test_yara_index -c tests/config/nextflow.config + command: nextflow run ./tests/modules/yara/index -entry test_yara_index -c ./tests/config/nextflow.config -c ./tests/modules/yara/index/nextflow.config tags: - 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 diff --git a/tests/modules/yara/mapper/main.nf b/tests/modules/yara/mapper/main.nf index 06582eb3..18800eb3 100644 --- a/tests/modules/yara/mapper/main.nf +++ b/tests/modules/yara/mapper/main.nf @@ -3,15 +3,18 @@ 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' +include { YARA_MAPPER } from '../../../../modules/yara/mapper/main.nf' workflow test_yara_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) - input = [ [ id:'test', single_end:true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] - YARA_INDEX ( fasta ) YARA_MAPPER ( input, YARA_INDEX.out.index ) @@ -19,12 +22,15 @@ workflow test_yara_single_end { workflow test_yara_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) - 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) ] ] - YARA_INDEX ( fasta ) YARA_MAPPER ( input, YARA_INDEX.out.index ) } diff --git a/tests/modules/yara/mapper/nextflow.config b/tests/modules/yara/mapper/nextflow.config new file mode 100644 index 00000000..a626a8fc --- /dev/null +++ b/tests/modules/yara/mapper/nextflow.config @@ -0,0 +1,13 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: YARA_INDEX { + ext.args = '-e 3' + } + + withName: YARA_MAPPER { + ext.args = '-e 3' + } + +} diff --git a/tests/modules/yara/mapper/test.yml b/tests/modules/yara/mapper/test.yml index 51b056df..186f70b4 100644 --- a/tests/modules/yara/mapper/test.yml +++ b/tests/modules/yara/mapper/test.yml @@ -1,68 +1,68 @@ - name: yara mapper test_yara_single_end - command: nextflow run tests/modules/yara/mapper -entry test_yara_single_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/yara/mapper -entry test_yara_single_end -c ./tests/config/nextflow.config -c ./tests/modules/yara/mapper/nextflow.config tags: - yara/mapper - yara files: - path: output/yara/test.mapped.bam - - path: output/index/yara/yara.txt.size + - path: output/yara/yara/yara.txt.size md5sum: 063987b3c3f747be7d2b8043c9d91000 - - path: output/index/yara/yara.lf.drs + - path: output/yara/yara/yara.lf.drs md5sum: 55a54008ad1ba589aa210d2629c1df41 - - path: output/index/yara/yara.lf.pst + - path: output/yara/yara/yara.lf.pst md5sum: e8daba34298e99e42942435286f9b3f0 - - path: output/index/yara/yara.sa.len + - path: output/yara/yara/yara.sa.len md5sum: 45677f66c28c79c02250ceb8b58645e8 - - 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.sa.val + - path: output/yara/yara/yara.sa.val md5sum: ce57cc82e2d3ae7b9824210f54168ce9 - - path: output/index/yara/yara.sa.ind + - path: output/yara/yara/yara.sa.ind md5sum: 464314583efb5f07260b0efecc29a1ce - - path: output/index/yara/yara.rid.limits + - path: output/yara/yara/yara.rid.limits md5sum: 8b814661f30a0c9e350bfbcb454930ce - - path: output/index/yara/yara.lf.drp + - path: output/yara/yara/yara.lf.drp md5sum: 3ef99a87a4e44513f46d42f4261f7842 - - path: output/index/yara/yara.txt.limits + - path: output/yara/yara/yara.txt.limits md5sum: 4480a068db603e4c9a27bc4fa9ceaf14 - - path: output/index/yara/yara.lf.drv + - path: output/yara/yara/yara.lf.drv md5sum: cf6408307fe9fd7f99c33f521bf95550 - - path: output/index/yara/yara.fasta + - path: output/yara/yara/yara.fasta md5sum: 6e9fe4042a72f2345f644f239272b7e6 - name: yara mapper test_yara_paired_end - command: nextflow run tests/modules/yara/mapper -entry test_yara_paired_end -c tests/config/nextflow.config + command: nextflow run ./tests/modules/yara/mapper -entry test_yara_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/yara/mapper/nextflow.config tags: - yara/mapper - yara files: - path: output/yara/test_2.mapped.bam - path: output/yara/test_1.mapped.bam - - path: output/index/yara/yara.txt.size + - path: output/yara/yara/yara.txt.size md5sum: 063987b3c3f747be7d2b8043c9d91000 - - path: output/index/yara/yara.lf.drs + - path: output/yara/yara/yara.lf.drs md5sum: 55a54008ad1ba589aa210d2629c1df41 - - path: output/index/yara/yara.lf.pst + - path: output/yara/yara/yara.lf.pst md5sum: e8daba34298e99e42942435286f9b3f0 - - path: output/index/yara/yara.sa.len + - path: output/yara/yara/yara.sa.len md5sum: 45677f66c28c79c02250ceb8b58645e8 - - 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.sa.val + - path: output/yara/yara/yara.sa.val md5sum: ce57cc82e2d3ae7b9824210f54168ce9 - - path: output/index/yara/yara.sa.ind + - path: output/yara/yara/yara.sa.ind md5sum: 464314583efb5f07260b0efecc29a1ce - - path: output/index/yara/yara.rid.limits + - path: output/yara/yara/yara.rid.limits md5sum: 8b814661f30a0c9e350bfbcb454930ce - - path: output/index/yara/yara.lf.drp + - path: output/yara/yara/yara.lf.drp md5sum: 3ef99a87a4e44513f46d42f4261f7842 - - path: output/index/yara/yara.txt.limits + - path: output/yara/yara/yara.txt.limits md5sum: 4480a068db603e4c9a27bc4fa9ceaf14 - - path: output/index/yara/yara.lf.drv + - path: output/yara/yara/yara.lf.drv md5sum: cf6408307fe9fd7f99c33f521bf95550 - - path: output/index/yara/yara.fasta + - path: output/yara/yara/yara.fasta md5sum: 6e9fe4042a72f2345f644f239272b7e6 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..beea38c2 --- /dev/null +++ b/tests/subworkflows/nf-core/align_bowtie2/test.yml @@ -0,0 +1,83 @@ +- 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 + # - 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: d9eb909c2cde69d6ae83999a72d770d7 + +- 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 + # - 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: d0c7a1a4fbd2c1aed437ca419a9e344f diff --git a/tests/subworkflows/nf-core/annotation_ensemblvep/main.nf b/tests/subworkflows/nf-core/annotation_ensemblvep/main.nf new file mode 100644 index 00000000..0f00c62e --- /dev/null +++ b/tests/subworkflows/nf-core/annotation_ensemblvep/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ANNOTATION_ENSEMBLVEP } from '../../../../subworkflows/nf-core/annotation_ensemblvep/main' + +workflow annotation_ensemblvep { + input = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) + ] + + ANNOTATION_ENSEMBLVEP ( input, "WBcel235", "caenorhabditis_elegans", "104", [] ) +} diff --git a/tests/subworkflows/nf-core/annotation_ensemblvep/nextflow.config b/tests/subworkflows/nf-core/annotation_ensemblvep/nextflow.config new file mode 100644 index 00000000..4e8d2990 --- /dev/null +++ b/tests/subworkflows/nf-core/annotation_ensemblvep/nextflow.config @@ -0,0 +1,14 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: ENSEMBLVEP { + container = 'nfcore/vep:104.3.WBcel235' + publishDir = [ enabled: false ] + } + + withName: ANNOTATION_BGZIPTABIX { + ext.prefix = { "${meta.id}_VEP.ann.vcf" } + } + +} diff --git a/tests/subworkflows/nf-core/annotation_ensemblvep/test.yml b/tests/subworkflows/nf-core/annotation_ensemblvep/test.yml new file mode 100644 index 00000000..706d9d05 --- /dev/null +++ b/tests/subworkflows/nf-core/annotation_ensemblvep/test.yml @@ -0,0 +1,7 @@ +- name: ensemblvep annotation_ensemblvep + command: nextflow run ./tests/subworkflows/nf-core/annotation_ensemblvep -entry annotation_ensemblvep -c ./tests/config/nextflow.config -c ./tests/subworkflows/nf-core/annotation_ensemblvep/nextflow.config + tags: + - annotation_ensemblvep + files: + - path: output/annotation/test_VEP.ann.vcf.gz + - path: output/annotation/test_VEP.ann.vcf.gz.tbi diff --git a/tests/subworkflows/nf-core/annotation_snpeff/main.nf b/tests/subworkflows/nf-core/annotation_snpeff/main.nf new file mode 100644 index 00000000..c80197ee --- /dev/null +++ b/tests/subworkflows/nf-core/annotation_snpeff/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ANNOTATION_SNPEFF } from '../../../../subworkflows/nf-core/annotation_snpeff/main' + +workflow annotation_snpeff { + input = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) + ] + + ANNOTATION_SNPEFF ( input, "WBcel235.99", [] ) +} diff --git a/tests/subworkflows/nf-core/annotation_snpeff/nextflow.config b/tests/subworkflows/nf-core/annotation_snpeff/nextflow.config new file mode 100644 index 00000000..be76cb4a --- /dev/null +++ b/tests/subworkflows/nf-core/annotation_snpeff/nextflow.config @@ -0,0 +1,14 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SNPEFF { + container = 'nfcore/snpeff:5.0.WBcel235' + publishDir = [ enabled: false ] + } + + withName: ANNOTATION_BGZIPTABIX { + ext.prefix = { "${meta.id}_snpEff.ann.vcf" } + } + +} diff --git a/tests/subworkflows/nf-core/annotation_snpeff/test.yml b/tests/subworkflows/nf-core/annotation_snpeff/test.yml new file mode 100644 index 00000000..943b24e9 --- /dev/null +++ b/tests/subworkflows/nf-core/annotation_snpeff/test.yml @@ -0,0 +1,7 @@ +- name: snpeff annotation_snpeff + command: nextflow run ./tests/subworkflows/nf-core/annotation_snpeff -entry annotation_snpeff -c ./tests/config/nextflow.config -c ./tests/subworkflows/nf-core/annotation_snpeff/nextflow.config + tags: + - annotation_snpeff + files: + - path: output/annotation/test_snpEff.ann.vcf.gz + - path: output/annotation/test_snpEff.ann.vcf.gz.tbi 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..7dc73c80 --- /dev/null +++ b/tests/subworkflows/nf-core/bam_sort_samtools/test.yml @@ -0,0 +1,49 @@ +- 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 + # - 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: 8b56bb7d26ced04112f712250d915aaa + - 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 + # - 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: 4adc495469724a375d5e1a9f3485e38d + - 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..2b2e45d1 --- /dev/null +++ b/tests/subworkflows/nf-core/bam_stats_samtools/test.yml @@ -0,0 +1,33 @@ +- 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 + # - 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 + # - 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/subworkflows/nf-core/fgbio_create_umi_consensus/main.nf b/tests/subworkflows/nf-core/fgbio_create_umi_consensus/main.nf new file mode 100644 index 00000000..6b02bbc8 --- /dev/null +++ b/tests/subworkflows/nf-core/fgbio_create_umi_consensus/main.nf @@ -0,0 +1,33 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CREATE_UMI_CONSENSUS } from '../../../../subworkflows/nf-core/fgbio_create_umi_consensus/main' + +workflow test_fgbio_create_umi_consensus_mem1 { + reads = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_umi_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_umi_2_fastq_gz'], checkIfExists: true) + ] + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + read_structure = "+T 12M11S+T" + + CREATE_UMI_CONSENSUS( reads, fasta, read_structure, "Adjacency", "bwa-mem" ) +} + +workflow test_fgbio_create_umi_consensus_mem2 { + reads = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_umi_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_umi_2_fastq_gz'], checkIfExists: true) + ] + ] + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + read_structure = "+T 12M11S+T" + + CREATE_UMI_CONSENSUS( reads, fasta, read_structure, "Adjacency", "bwa-mem2" ) +} diff --git a/tests/subworkflows/nf-core/fgbio_create_umi_consensus/nextflow.config b/tests/subworkflows/nf-core/fgbio_create_umi_consensus/nextflow.config new file mode 100644 index 00000000..a55a4213 --- /dev/null +++ b/tests/subworkflows/nf-core/fgbio_create_umi_consensus/nextflow.config @@ -0,0 +1,31 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SAMTOOLS_BAM2FQ { + ext.args = '-T RX' + } + + withName: BWA_MEM { + ext.args = '-p -C -M' + } + + withName: BWAMEM2_MEM { + ext.args = '-p -C -M' + } + + withName: FGBIO_CALLMOLECULARCONSENSUSREADS { + ext.args = '-M 1 -S Coordinate' + ext.prefix = { "${meta.id}_umiconsensus" } + } + + withName: SAMTOOLS_BAM2FQ { + ext.args = '-T RX' + } + + withName: SAMBLASTER { + ext.args = '-M --addMateTags' + ext.prefix = { "${meta.id}_processed" } + } + +} diff --git a/tests/subworkflows/nf-core/fgbio_create_umi_consensus/test.yml b/tests/subworkflows/nf-core/fgbio_create_umi_consensus/test.yml new file mode 100644 index 00000000..2db70d3f --- /dev/null +++ b/tests/subworkflows/nf-core/fgbio_create_umi_consensus/test.yml @@ -0,0 +1,22 @@ +- name: fgbio_create_umi_consensus_bwamem1 + command: nextflow run ./tests/subworkflows/nf-core/fgbio_create_umi_consensus -entry test_fgbio_create_umi_consensus_mem1 -c ./tests/config/nextflow.config -c ./tests/subworkflows/nf-core/fgbio_create_umi_consensus/nextflow.config + tags: + - subworkflows/fgbio_create_umi_consensus + files: + - path: ./output/fastqtobam/test_umi_converted.bam + md5sum: 9510735554e5eff29244077a72075fb6 + - path: ./output/groupreadsbyumi/test_umi-grouped.bam + md5sum: 44f31da850d5a8100b43b629426f2e17 + - path: ./output/callumiconsensus/test_umiconsensus.bam + md5sum: 24b48e3543de0ae7e8a95c116d5ca6a6 +- name: fgbio_create_umi_consensus_bwamem2 + command: nextflow run ./tests/subworkflows/nf-core/fgbio_create_umi_consensus -entry test_fgbio_create_umi_consensus_mem2 -c ./tests/config/nextflow.config -c ./tests/subworkflows/nf-core/fgbio_create_umi_consensus/nextflow.config + tags: + - subworkflows/fgbio_create_umi_consensus_bwamem2 + files: + - path: ./output/fastqtobam/test_umi_converted.bam + md5sum: 9510735554e5eff29244077a72075fb6 + - path: ./output/groupreadsbyumi/test_umi-grouped.bam + md5sum: c69333155038b9a968fd096627d4dfb0 + - path: ./output/callumiconsensus/test_umiconsensus.bam + md5sum: 24b48e3543de0ae7e8a95c116d5ca6a6 diff --git a/tests/subworkflows/nf-core/gatk_create_som_pon/main.nf b/tests/subworkflows/nf-core/gatk_create_som_pon/main.nf new file mode 100644 index 00000000..42427a1f --- /dev/null +++ b/tests/subworkflows/nf-core/gatk_create_som_pon/main.nf @@ -0,0 +1,25 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { GATK_CREATE_SOM_PON } from '../../../../subworkflows/nf-core/gatk_create_som_pon/main' addParams( [:] ) + +workflow test_gatk_create_som_pon { + ch_mutect2_in = [ + [[ id:'test1' ], // meta map + [file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true)], + [file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true)], + [] ], + [[ id:'test2' ], // meta map + [file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true)], + [file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], 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) + dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + pon_name = "test_panel" + interval_file = file(params.test_data['homo_sapiens']['genome']['genome_interval_list'], checkIfExists: true) + + GATK_CREATE_SOM_PON ( ch_mutect2_in, fasta, fai, dict, pon_name, interval_file ) +} diff --git a/tests/subworkflows/nf-core/gatk_create_som_pon/test.yml b/tests/subworkflows/nf-core/gatk_create_som_pon/test.yml new file mode 100644 index 00000000..63cf64f8 --- /dev/null +++ b/tests/subworkflows/nf-core/gatk_create_som_pon/test.yml @@ -0,0 +1,37 @@ +- name: gatk_create_som_pon + command: nextflow run ./tests/subworkflows/nf-core/gatk_create_som_pon -entry test_gatk_create_som_pon -c tests/config/nextflow.config + tags: + - subworkflows + # - subworkflows/gatk_create_som_pon + # - gatk4 + # Modules + # - gatk4/genomicsdbimport + # - gatk4/createsomaticpanelofnormals + files: + # gatk4 mutect2 + - path: output/gatk4/test1.vcf.gz + - path: output/gatk4/test1.vcf.gz.stats + md5sum: 4f77301a125913170b8e9e7828b4ca3f + - path: output/gatk4/test1.vcf.gz.tbi + - path: output/gatk4/test2.vcf.gz + - path: output/gatk4/test2.vcf.gz.stats + md5sum: 106c5828b02b906c97922618b6072169 + - path: output/gatk4/test2.vcf.gz.tbi + # gatk4 genomicsdbimport + - path: output/gatk4/test_panel/__tiledb_workspace.tdb + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/gatk4/test_panel/callset.json + md5sum: 2ab411773b7267de61f8c04939de2a99 + - path: output/gatk4/test_panel/chr22$1$40001/.__consolidation_lock + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/gatk4/test_panel/chr22$1$40001/__array_schema.tdb + - path: output/gatk4/test_panel/chr22$1$40001/genomicsdb_meta_dir/genomicsdb_column_bounds.json + md5sum: 2502f79658bc000578ebcfddfc1194c0 + - path: output/gatk4/test_panel/vcfheader.vcf + contains: + - "FORMAT=