diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4ecfbfe335..b290e09017 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,15 +10,7 @@ "vscode": { // Set *default* container specific settings.json values on container create. "settings": { - "python.defaultInterpreterPath": "/opt/conda/bin/python", - "python.linting.enabled": true, - "python.linting.pylintEnabled": true, - "python.formatting.autopep8Path": "/opt/conda/bin/autopep8", - "python.formatting.yapfPath": "/opt/conda/bin/yapf", - "python.linting.flake8Path": "/opt/conda/bin/flake8", - "python.linting.pycodestylePath": "/opt/conda/bin/pycodestyle", - "python.linting.pydocstylePath": "/opt/conda/bin/pydocstyle", - "python.linting.pylintPath": "/opt/conda/bin/pylint" + "python.defaultInterpreterPath": "/opt/conda/bin/python" }, // Add the IDs of extensions you want installed when the container is created. diff --git a/.editorconfig b/.editorconfig index b6b3190776..dd9ffa5387 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,7 +18,20 @@ end_of_line = unset insert_final_newline = unset trim_trailing_whitespace = unset indent_style = unset -indent_size = unset +[/subworkflows/nf-core/**] +charset = unset +end_of_line = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset [/assets/email*] indent_size = unset + +# ignore Readme +[README.md] +indent_style = unset + +# ignore python +[*.{py,md}] +indent_style = unset diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index bc5ca344a3..7d9aa01d08 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -9,9 +9,8 @@ Please use the pre-filled template to save time. However, don't be put off by this template - other more general issues and suggestions are welcome! Contributions to the code are even more welcome ;) -:::info -If you need help using or modifying nf-core/sarek then the best place to ask is on the nf-core Slack [#sarek](https://nfcore.slack.com/channels/sarek) channel ([join our Slack here](https://nf-co.re/join/slack)). -::: +> [!NOTE] +> If you need help using or modifying nf-core/sarek then the best place to ask is on the nf-core Slack [#sarek](https://nfcore.slack.com/channels/sarek) channel ([join our Slack here](https://nf-co.re/join/slack)). ## Contribution workflow @@ -27,6 +26,12 @@ If you're not used to this workflow with git, you can start with some [docs from ## Tests +You have the option to test your changes locally by running the pipeline. For receiving warnings about process selectors and other `debug` information, it is recommended to use the debug profile. Execute all the tests with the following command: + +```bash +nf-test test --profile debug,test,docker --verbose +``` + When you create a pull request with changes, [GitHub Actions](https://github.com/features/actions) will run automatic tests. Typically, pull-requests are only fully reviewed when these tests are passing, though of course we can help out before then. @@ -87,7 +92,7 @@ Once there, use `nf-core schema build` to add to `nextflow_schema.json`. Sensible defaults for process resource requirements (CPUs / memory / time) for a process should be defined in `conf/base.config`. These should generally be specified generic with `withLabel:` selectors so they can be shared across multiple processes/steps of the pipeline. A nf-core standard set of labels that should be followed where possible can be seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/master/nf_core/pipeline-template/conf/base.config), which has the default process as a single core-process, and then different levels of multi-core configurations for increasingly large memory requirements defined with standardised labels. -The process resources can be passed on to the tool dynamically within the process with the `${task.cpu}` and `${task.memory}` variables in the `script:` block. +The process resources can be passed on to the tool dynamically within the process with the `${task.cpus}` and `${task.memory}` variables in the `script:` block. ### Naming schemes diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b3a687b63a..e322567d91 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -18,7 +18,8 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/sare - [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/sarek/tree/master/.github/CONTRIBUTING.md) - [ ] If necessary, also make a PR on the nf-core/sarek _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. - [ ] Make sure your code lints (`nf-core lint`). -- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir `). +- [ ] Ensure the test suite passes (`nf-test test tests/ --verbose --profile +docker`). +- [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir `). - [ ] Usage Documentation in `docs/usage.md` is updated. - [ ] Output Documentation in `docs/output.md` is updated. - [ ] `CHANGELOG.md` is updated. diff --git a/.github/RELEASE_CHECKLIST.md b/.github/RELEASE_CHECKLIST.md index fd15eb72a5..1bd412973e 100644 --- a/.github/RELEASE_CHECKLIST.md +++ b/.github/RELEASE_CHECKLIST.md @@ -3,22 +3,22 @@ > This checklist is for our own reference, to help us prepare a new release 1. Check that everything is ready to go - - Desired [PRs](https://github.com/nf-core/sarek/pulls) are merged - - [GHA CI](https://github.com/nf-core/sarek/actions/workflows/ci.yml) are passing on `dev` - - [GHA linting](https://github.com/nf-core/sarek/actions/workflows/linting.yml) are passing on `dev` + +- Desired [PRs](https://github.com/nf-core/sarek/pulls) are merged +- [GHA CI](https://github.com/nf-core/sarek/actions/workflows/ci.yml) are passing on `dev` +- [GHA linting](https://github.com/nf-core/sarek/actions/workflows/linting.yml) are passing on `dev` + 2. Increase version number following [semantic versioning](http://semver.org/spec/v2.0.0.html) 3. Choose an appropriate codename for the release (if major or minor) - - i.e. Peaks in [Sarek National Park](https://en.wikipedia.org/wiki/Sarek_National_Park#Topography) + +- i.e. Peaks in [Sarek National Park](https://en.wikipedia.org/wiki/Sarek_National_Park#Topography) + 4. Sync `dev` and checkout a new branch for the release 5. Bump version: - - `nf-core bump-version . ` - - edit `docs/images/sarek_indices_subway.svg` - - generate a new `docs/images/sarek_indices_subway.png` - - edit `docs/images/sarek_subway.svg` - - generate a new `docs/images/sarek_subway.png` - - edit `docs/images/sarek_workflow.svg` - - generate a new `docs/images/sarek_workflow.png` - - edit `CHANGELOG` + +- `nf-core bump-version . ` +- edit `CHANGELOG` + 6. Make a PR to `master` 7. Wait for reviews 8. Merge said PR @@ -27,15 +27,19 @@ 11. RT the nf-core automated tweet about the new released version 12. Make a new branch from `dev` 13. Checkout the `CHANGELOG.md` from `master` - - `git checkout upstream/master -- CHANGELOG.md` + +- `git checkout upstream/master -- CHANGELOG.md` + 14. Add a new `Unreleased` section in `CHANGELOG.md` for the `dev` version 15. Checkout figures from `master` - - `git checkout upstream/master -- docs/images/sarek_indices_subway.svg` - - `git checkout upstream/master -- docs/images/sarek_indices_subway.png` - - `git checkout upstream/master -- docs/images/sarek_subway.svg` - - `git checkout upstream/master -- docs/images/sarek_subway.png` - - `git checkout upstream/master -- docs/images/sarek_workflow.svg` - - `git checkout upstream/master -- docs/images/sarek_workflow.png` + +- `git checkout upstream/master -- docs/images/sarek_indices_subway.svg` +- `git checkout upstream/master -- docs/images/sarek_indices_subway.png` +- `git checkout upstream/master -- docs/images/sarek_subway.svg` +- `git checkout upstream/master -- docs/images/sarek_subway.png` +- `git checkout upstream/master -- docs/images/sarek_workflow.svg` +- `git checkout upstream/master -- docs/images/sarek_workflow.png` + 16. Make a PR to `dev` 17. Wait for review 18. Merge said PR diff --git a/.github/workflows/awstest.yml b/.github/workflows/awstest.yml deleted file mode 100644 index 1f2cf7e557..0000000000 --- a/.github/workflows/awstest.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: nf-core AWS test -# This workflow can be triggered manually with the GitHub actions workflow dispatch button. -# It runs the -profile 'test' on AWS batch - -on: - release: - types: [created] - workflow_dispatch: - inputs: - profiletest: - description: "Trigger profile tests (smaller) on AWS" - type: boolean - default: true - somatic: - description: "Trigger somatic full test on AWS" - type: boolean - default: false - germline: - description: "Trigger germline full test on AWS" - type: boolean - default: false - -jobs: - trigger-profile-test: - name: Run AWS tests - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - profile: test - enabled: ${{ ( github.repository == 'nf-core/sarek' ) && ( github.event_name != 'workflow_dispatch' || inputs.profiletest ) }} - - profile: test_full - enabled: ${{ ( github.repository == 'nf-core/sarek' ) && ( github.event_name != 'workflow_dispatch' || inputs.somatic ) }} - - profile: test_full_germline - enabled: ${{ ( github.repository == 'nf-core/sarek' ) && ( github.event_name != 'workflow_dispatch' || inputs.germline ) }} - steps: - # Launch workflow using Tower CLI tool action - - name: Launch workflow via tower - uses: seqeralabs/action-tower-launch@v2 - if: ${{ matrix.enabled }} - with: - workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} - access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} - compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} - revision: ${{ github.sha }} - workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/sarek/work-${{ github.sha }}/${{ matrix.profile }} - parameters: | - { - "hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}", - "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/sarek/results-${{ github.sha }}/${{ matrix.profile }}" - } - profiles: ${{ matrix.profile }} - - - uses: actions/upload-artifact@v3 - if: ${{ matrix.enabled }} - with: - name: tower-${{ matrix.profile }}-log - path: | - tower_action_*.log - tower_action_*.json diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index 70d2466f02..bb13a7c7e7 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -19,7 +19,7 @@ jobs: # NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets - name: Post PR comment if: failure() - uses: mshick/add-pr-comment@v1 + uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 with: message: | ## This PR is against the `master` branch :x: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12ed40b678..48fbb4b6b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: test +name: nf-core CI # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors on: pull_request: @@ -28,7 +28,7 @@ jobs: # Expose matched filters as job 'tags' output variable tags: ${{ steps.filter.outputs.changes }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: frouioui/paths-filter@main id: filter @@ -52,6 +52,17 @@ jobs: NXF_VER: - "23.04.0" - "latest-everything" + exclude: + - tags: "sentieon/bwamem" + - tags: "sentieon/dedup" + - tags: "sentieon/dnascope" + - tags: "sentieon/dnascope_joint_germline" + - tags: "sentieon/dnascope_skip_filter" + - tags: "sentieon/haplotyper" + - tags: "sentieon/haplotyper_joint_germline" + - tags: "sentieon/haplotyper_skip_filter" + - NXF_VER: "latest-everything" + tags: "joint_germline" env: NXF_ANSI_LOG: false TEST_DATA_BASE: "${{ github.workspace }}/test-datasets" @@ -59,7 +70,7 @@ jobs: steps: - name: Check out pipeline code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Hash Github Workspace id: hash_workspace @@ -105,7 +116,7 @@ jobs: - name: Check out test data if: steps.cache-testdata.outputs.cache-hit != 'true' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: nf-core/test-datasets ref: sarek3 @@ -136,6 +147,9 @@ jobs: if: matrix.profile == 'conda' run: conda clean -a + - name: Disk space cleanup + uses: jlumbroso/free-disk-space@v1.3.1 + - name: Run pytest-workflow uses: Wandalen/wretry.action@v1 with: @@ -168,7 +182,7 @@ jobs: tags: ${{ steps.filter.outputs.changes }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Combine all tags.yml files id: get_tags @@ -200,14 +214,47 @@ jobs: - "23.04.0" - "latest-everything" exclude: + - tags: "bcftools/concat" + - tags: "bcftools/mpileup" + - tags: "bcftools/sort" - tags: "bwa/index" - tags: "bwa/mem" + - tags: "bwamem2/index" + - tags: "bwamem2/mem" - tags: "cat/cat" - tags: "cat/fastq" - - tags: "custom/dumpsoftwareversions" + - tags: "cnvkit/batch" + - tags: "deepvariant" + - tags: "dragmap/align" + - tags: "dragmap/hashtable" + - tags: "ensemblvep/download" + - tags: "ensemblvep/vep" - tags: "fastp" - tags: "fastqc" + - tags: "fgbio/fastqtobam" + - tags: "freebayes" + - tags: "gatk4/applybqsr" + - tags: "gatk4/baserecalibrator" + - tags: "gatk4/estimatelibrarycomplexity" + - tags: "gatk4/genomicsdbimport" + - tags: "gatk4/haplotypecaller" + - tags: "gatk4/markduplicates" + - tags: "gatk4/mergevcfs" + - tags: "gatk4/mutect2" + - tags: "gatk4spark/applybqsr" + - tags: "gatk4spark/markduplicates" + - tags: "mosdepth" + - tags: "multiqc" + - tags: "samblaster" + - tags: "samtools/mpileup" - tags: "samtools/stats" + - tags: "snpeff/snpeff" + - tags: "strelka/germline" + - tags: "strelka/somatic" + - tags: "subworkflows/utils_nfvalidation_plugin" + - tags: "tabix/bgziptabix" + - tags: "tabix/tabix" + - tags: "tiddit/sv" - tags: "untar" env: NXF_ANSI_LOG: false @@ -215,14 +262,17 @@ jobs: SENTIEON_LICENSE_BASE64: ${{ secrets.SENTIEON_LICENSE_BASE64 }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: "temurin" java-version: "17" - - name: Setup Nextflow + + - name: Install Nextflow ${{ matrix.NXF_VER }} uses: nf-core/setup-nextflow@v1 + with: + version: "${{ matrix.NXF_VER }}" - name: Cache nf-test installation id: cache-software @@ -277,6 +327,9 @@ jobs: SENTIEON_AUTH_DATA_BASE64=$(echo -n "$SENTIEON_AUTH_DATA" | base64 -w 0) nextflow secrets set SENTIEON_AUTH_DATA_BASE64 $SENTIEON_AUTH_DATA_BASE64 + - name: Disk space cleanup + uses: jlumbroso/free-disk-space@v1.3.1 + # Test the module - name: Run nf-test run: | diff --git a/.github/workflows/clean-up.yml b/.github/workflows/clean-up.yml index 694e90ecb1..0b6b1f2725 100644 --- a/.github/workflows/clean-up.yml +++ b/.github/workflows/clean-up.yml @@ -10,7 +10,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@v7 + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9 with: stale-issue-message: "This issue has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment otherwise this issue will be closed in 20 days." stale-pr-message: "This PR has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment if it is still useful." diff --git a/.github/workflows/cloudtest.yml b/.github/workflows/cloudtest.yml new file mode 100644 index 0000000000..829d870ff5 --- /dev/null +++ b/.github/workflows/cloudtest.yml @@ -0,0 +1,109 @@ +name: nf-core cloud test + +on: + release: + types: [created] + workflow_dispatch: + inputs: + test: + description: "-profile test (smaller)" + type: boolean + default: true + somatic: + description: "Somatic full test" + type: boolean + default: false + germline: + description: "Germline full test" + type: boolean + default: false + germline_ncbench_agilent: + description: "Germline Agilent NCBench test" + type: boolean + default: false + aws: + description: "AWS Batch" + type: boolean + default: true + azure: + description: "Azure Batch" + type: boolean + default: true + +jobs: + trigger-profile-test: + name: Run AWS tests + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - profile: test_aws + enabled: ${{ ( github.repository == 'nf-core/sarek' ) && ( github.event_name != 'workflow_dispatch' || ( inputs.test && inputs.aws ) ) }} + - profile: test_azure + enabled: ${{ ( github.repository == 'nf-core/sarek' ) && ( github.event_name != 'workflow_dispatch' || ( inputs.test && inputs.azure ) ) }} + - profile: test_full_aws + enabled: ${{ ( github.repository == 'nf-core/sarek' ) && ( github.event_name != 'workflow_dispatch' || ( inputs.somatic && inputs.aws ) ) }} + - profile: test_full_azure + enabled: ${{ ( github.repository == 'nf-core/sarek' ) && ( github.event_name != 'workflow_dispatch' || ( inputs.somatic && inputs.azure ) ) }} + - profile: test_full_germline_aws + enabled: ${{ ( github.repository == 'nf-core/sarek' ) && ( github.event_name != 'workflow_dispatch' || ( inputs.germline && inputs.aws ) ) }} + - profile: test_full_germline_azure + enabled: ${{ ( github.repository == 'nf-core/sarek' ) && ( github.event_name != 'workflow_dispatch' || ( inputs.germline && inputs.azure ) ) }} + - profile: test_full_germline_ncbench_agilent_aws + enabled: ${{ ( github.repository == 'nf-core/sarek' ) && ( github.event_name != 'workflow_dispatch' || ( inputs.germline_ncbench_agilent && inputs.aws ) ) }} + + steps: + # Launch workflow on AWS Batch + - name: AWS Launch + uses: seqeralabs/action-tower-launch@v2 + if: ${{ matrix.enabled && ( github.event_name != 'workflow_dispatch' || inputs.aws ) }} + with: + run_name: sarek_${{ matrix.profile }} + workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} + access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} + compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} + revision: ${{ github.sha }} + workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/sarek/work-${{ github.sha }}/${{ matrix.profile }} + parameters: | + { + "hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}", + "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/sarek/results-${{ github.sha }}/${{ matrix.profile }}/" + } + profiles: ${{ matrix.profile }} + + - uses: actions/upload-artifact@v3 + name: Save AWS Logs + if: success() || failure() + with: + name: tower-aws-${{ matrix.profile }}-log + path: | + tower_action_*.log + tower_action_*.json + + # Launch workflow using Tower CLI tool action + - name: Azure Launch + uses: seqeralabs/action-tower-launch@v2 + if: ${{ matrix.enabled && ( github.event_name != 'workflow_dispatch' || inputs.azure ) }} + with: + run_name: sarek_${{ matrix.profile }} + workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} + access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} + compute_env: ${{ secrets.TOWER_CE_AZURE_CPU }} + revision: ${{ github.sha }} + workdir: ${{ secrets.TOWER_BUCKET_AZURE}}/sarek/work-${{ github.sha }}/${{ matrix.profile }} + parameters: | + { + "hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}", + "outdir": "${{ secrets.TOWER_BUCKET_AZURE }}/sarek/results-${{ github.sha }}/${{ matrix.profile }}/" + } + profiles: ${{ matrix.profile }} + + - uses: actions/upload-artifact@v3 + name: Save Azure Logs + if: success() || failure() + with: + name: tower-azure-${{ matrix.profile }}-log + path: | + tower_action_*.log + tower_action_*.json diff --git a/.github/workflows/download_pipeline.yml b/.github/workflows/download_pipeline.yml new file mode 100644 index 0000000000..48fe5d0a94 --- /dev/null +++ b/.github/workflows/download_pipeline.yml @@ -0,0 +1,72 @@ +name: Test successful pipeline download with 'nf-core download' + +# Run the workflow when: +# - dispatched manually +# - when a PR is opened or reopened to master branch +# - the head branch of the pull request is updated, i.e. if fixes for a release are pushed last minute to dev. +on: + workflow_dispatch: + inputs: + testbranch: + description: "The specific branch you wish to utilize for the test execution of nf-core download." + required: true + default: "dev" + pull_request: + types: + - opened + branches: + - master + pull_request_target: + branches: + - master + +env: + NXF_ANSI_LOG: false + +jobs: + download: + runs-on: ubuntu-latest + steps: + - name: Install Nextflow + uses: nf-core/setup-nextflow@v1 + + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 + with: + python-version: "3.11" + architecture: "x64" + - uses: eWaterCycle/setup-singularity@931d4e31109e875b13309ae1d07c70ca8fbc8537 # v7 + with: + singularity-version: 3.8.3 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install git+https://github.com/nf-core/tools.git@dev + + - name: Get the repository name and current branch set as environment variable + run: | + echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} + echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV} + echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> ${GITHUB_ENV} + + - name: Download the pipeline + env: + NXF_SINGULARITY_CACHEDIR: ./ + run: | + nf-core download ${{ env.REPO_LOWERCASE }} \ + --revision ${{ env.REPO_BRANCH }} \ + --outdir ./${{ env.REPOTITLE_LOWERCASE }} \ + --compress "none" \ + --container-system 'singularity' \ + --container-library "quay.io" -l "docker.io" -l "ghcr.io" \ + --container-cache-utilisation 'amend' \ + --download-configuration + + - name: Inspect download + run: tree ./${{ env.REPOTITLE_LOWERCASE }} + + - name: Run the downloaded pipeline + env: + NXF_SINGULARITY_CACHEDIR: ./ + NXF_SINGULARITY_HOME_MOUNT: true + run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -profile test,singularity --outdir ./results diff --git a/.github/workflows/fix-linting.yml b/.github/workflows/fix-linting.yml index 0529d32d0b..d0354d3ef8 100644 --- a/.github/workflows/fix-linting.yml +++ b/.github/workflows/fix-linting.yml @@ -4,7 +4,7 @@ on: types: [created] jobs: - deploy: + fix-linting: # Only run if comment is on a PR with the main repo, and if it contains the magic keywords if: > contains(github.event.comment.html_url, '/pull/') && @@ -13,10 +13,17 @@ jobs: runs-on: ubuntu-latest steps: # Use the @nf-core-bot token to check out so we can push later - - uses: actions/checkout@v3 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: token: ${{ secrets.nf_core_bot_auth_token }} + # indication that the linting is being fixed + - name: React on comment + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 + with: + comment-id: ${{ github.event.comment.id }} + reactions: eyes + # Action runs on the issue comment, so we don't get the PR by default # Use the gh cli to check out the PR - name: Checkout Pull Request @@ -24,32 +31,59 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }} - - uses: actions/setup-node@v3 + # Install and run pre-commit + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 + with: + python-version: 3.11 - - name: Install Prettier - run: npm install -g prettier @prettier/plugin-php + - name: Install pre-commit + run: pip install pre-commit - # Check that we actually need to fix something - - name: Run 'prettier --check' - id: prettier_status - run: | - if prettier --check ${GITHUB_WORKSPACE}; then - echo "result=pass" >> $GITHUB_OUTPUT - else - echo "result=fail" >> $GITHUB_OUTPUT - fi + - name: Run pre-commit + id: pre-commit + run: pre-commit run --all-files + continue-on-error: true - - name: Run 'prettier --write' - if: steps.prettier_status.outputs.result == 'fail' - run: prettier --write ${GITHUB_WORKSPACE} + # indication that the linting has finished + - name: react if linting finished succesfully + if: steps.pre-commit.outcome == 'success' + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 + with: + comment-id: ${{ github.event.comment.id }} + reactions: "+1" - name: Commit & push changes - if: steps.prettier_status.outputs.result == 'fail' + id: commit-and-push + if: steps.pre-commit.outcome == 'failure' run: | git config user.email "core@nf-co.re" git config user.name "nf-core-bot" git config push.default upstream git add . git status - git commit -m "[automated] Fix linting with Prettier" + git commit -m "[automated] Fix code linting" git push + + - name: react if linting errors were fixed + id: react-if-fixed + if: steps.commit-and-push.outcome == 'success' + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 + with: + comment-id: ${{ github.event.comment.id }} + reactions: hooray + + - name: react if linting errors were not fixed + if: steps.commit-and-push.outcome == 'failure' + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 + with: + comment-id: ${{ github.event.comment.id }} + reactions: confused + + - name: react if linting errors were not fixed + if: steps.commit-and-push.outcome == 'failure' + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 + with: + issue-number: ${{ github.event.issue.number }} + body: | + @${{ github.actor }} I tried to fix the linting errors, but it didn't work. Please fix them manually. + See [CI log](https://github.com/nf-core/sarek/actions/runs/${{ github.run_id }}) for more details. diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index b8bdd21432..073e18767e 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -11,72 +11,33 @@ on: types: [published] jobs: - EditorConfig: + pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - uses: actions/setup-node@v3 - - - name: Install editorconfig-checker - run: npm install -g editorconfig-checker - - - name: Run ECLint check - run: editorconfig-checker -exclude README.md $(find .* -type f | grep -v '.git\|.py\|.md\|json\|yml\|yaml\|html\|css\|work\|.nextflow\|build\|nf_core.egg-info\|log.txt\|Makefile') - - Prettier: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - - - name: Install Prettier - run: npm install -g prettier - - - name: Run Prettier --check - run: prettier --check ${GITHUB_WORKSPACE} - - PythonBlack: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Check code lints with Black - uses: psf/black@stable - - # If the above check failed, post a comment on the PR explaining the failure - - name: Post PR comment - if: failure() - uses: mshick/add-pr-comment@v1 + - name: Set up Python 3.11 + uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 with: - message: | - ## Python linting (`black`) is failing - - To keep the code consistent with lots of contributors, we run automated code consistency checks. - To fix this CI test, please run: - - * Install [`black`](https://black.readthedocs.io/en/stable/): `pip install black` - * Fix formatting errors in your pipeline: `black .` - - Once you push these changes the test should pass, and you can hide this comment :+1: + python-version: 3.11 + cache: "pip" - We highly recommend setting up Black in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help! + - name: Install pre-commit + run: pip install pre-commit - Thanks again for your contribution! - repo-token: ${{ secrets.GITHUB_TOKEN }} - allow-repeats: false + - name: Run pre-commit + run: pre-commit run --all-files nf-core: runs-on: ubuntu-latest steps: - name: Check out pipeline code - uses: actions/checkout@v3 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - name: Install Nextflow uses: nf-core/setup-nextflow@v1 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 with: python-version: "3.11" architecture: "x64" @@ -99,7 +60,7 @@ jobs: - name: Upload linting log file artifact if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 with: name: linting-logs path: | diff --git a/.github/workflows/linting_comment.yml b/.github/workflows/linting_comment.yml index 0bbcd30f23..b706875fc0 100644 --- a/.github/workflows/linting_comment.yml +++ b/.github/workflows/linting_comment.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Download lint results - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@f6b0bace624032e30a85a8fd9c1a7f8f611f5737 # v3 with: workflow: linting.yml workflow_conclusion: completed @@ -21,7 +21,7 @@ jobs: run: echo "pr_number=$(cat linting-logs/PR_number.txt)" >> $GITHUB_OUTPUT - name: Post PR comment - uses: marocchino/sticky-pull-request-comment@v2 + uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} number: ${{ steps.pr_number.outputs.pr_number }} diff --git a/.github/workflows/ncbench.yml b/.github/workflows/ncbench.yml new file mode 100644 index 0000000000..efa9682b4e --- /dev/null +++ b/.github/workflows/ncbench.yml @@ -0,0 +1,119 @@ +name: NCBench Zenodo Upload +# This workflow can be triggered manually with the GitHub actions workflow dispatch button. + +on: + # upload can only be triggered manually for now + workflow_dispatch: + inputs: + germline_default_agilent: + description: "Trigger NCBench upload" + type: boolean + default: true + +jobs: + ncbench-upload: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + # TODO: Add in other test profiles + - profile: germline_default_agilent + enabled: ${{ ( github.repository == 'nf-core/sarek' ) && ( github.event_name != 'workflow_dispatch' || inputs.germline_default_agilent ) }} + steps: + - name: Download pipeline + uses: actions/checkout@v4 + + - name: Install Nextflow + uses: nf-core/setup-nextflow@v1 + + - name: Extract Versions + id: extract_versions + run: | + PIPELINE_VERSION=$(awk -F"'" '/manifest {/,/version/ {if(/version/) print $2}' nextflow.config) + echo "PIPELINE_VERSION=${PIPELINE_VERSION}" >> $GITHUB_ENV + echo "PIPELINE_VERSION_NO_DOTS=$(echo $PIPELINE_VERSION | tr -d '.')" >> $GITHUB_ENV + + nextflow inspect -profile test_full_germline_ncbench_agilent . --outdir ./inspect >> inspect.json + + FASTP_VERSION=$(jq -r '.processes[] | select(.name == "NFCORE_SAREK:SAREK:FASTP") | .container' inspect.json | awk -F':' '{print $NF}' | cut -d "-" -f 1) + echo "FASTP_VERSION=${FASTP_VERSION}" >> $GITHUB_ENV + + BWA_VERSION=$(jq -r '.processes[] | select(.name == "NFCORE_SAREK:SAREK:PREPARE_GENOME:BWAMEM1_INDEX") | .container' inspect.json | awk -F':' '{print $NF}' | cut -d "-" -f 1) + echo "BWA_VERSION=${BWA_VERSION}" >> $GITHUB_ENV + + BQSR_VERSION=$(jq -r '.processes[] | select(.name == "NFCORE_SAREK:SAREK:BAM_BASERECALIBRATOR:GATK4_BASERECALIBRATOR") | .container' inspect.json | awk -F':' '{print $NF}' | cut -d "-" -f 1) + echo "BQSR_VERSION=${BQSR_VERSION}" >> $GITHUB_ENV + + DEEPVARIANT_VERSION=$(jq -r '.processes[] | select(.name == "NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_DEEPVARIANT:DEEPVARIANT") | .container' inspect.json | awk -F':' '{print $NF}' | cut -d "-" -f 1) + echo "DEEPVARIANT_VERSION=${DEEPVARIANT_VERSION}" >> $GITHUB_ENV + + FREEBAYES_VERSION=$(jq -r '.processes[] | select(.name == "NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_FREEBAYES:FREEBAYES") | .container' inspect.json | awk -F':' '{print $NF}' | cut -d "-" -f 1) + echo "FREEBAYES_VERSION=${FREEBAYES_VERSION}" >> $GITHUB_ENV + + HAPLOTYPECALLER_VERSION=$(jq -r '.processes[] | select(.name == "NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_HAPLOTYPECALLER:GATK4_HAPLOTYPECALLER") | .container' inspect.json | awk -F':' '{print $NF}' | cut -d "-" -f 1) + echo "HAPLOTYPECALLER_VERSION=${HAPLOTYPECALLER_VERSION}" >> $GITHUB_ENV + + STRELKA_VERSION=$(jq -r '.processes[] | select(.name == "NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_SINGLE_STRELKA:STRELKA_SINGLE") | .container' inspect.json | awk -F':' '{print $NF}' | cut -d "-" -f 1) + echo "STRELKA_VERSION=${STRELKA_VERSION}" >> $GITHUB_ENV + + - name: Download files from AWS + uses: keithweaver/aws-s3-github-action@v1.0.0 + if: ${{ matrix.enabled }} + with: + source: "s3://${{ secrets.AWS_S3_BUCKET }}/sarek/results-${{ github.sha }}/test_full_germline_ncbench_agilent/variant_calling" + command: sync + aws_region: eu-west-1 + destination: ./variant_calling + flags: --no-sign-request --include ".vcf.gz" --exclude "g.vcf.gz" + + - name: Install requests + run: pip install requests + + - name: Upload to zenodo + id: upload_zenodo + env: + # TODO ATTENTION: Use SANDBOX TOKEN during development: ${{ secrets.NCBENCH_CI_TOKEN_SANDBOX }} + ACCESS_TOKEN: ${{ secrets.ZENODO_DEPOSIT }} + PIPELINE_VERSION: ${{ env.PIPELINE_VERSION }} + run: python .github/workflows/upload.py + + - name: Store Zenodo deposition ID + run: | + echo "DEPOSITION_ID=$(cat deposition_id.txt)" >> $GITHUB_ENV + + # update ncbench config yml + - name: NCBench set config + uses: actions/checkout@v4 + with: + token: ${{ secrets.NCBENCH_CI_TOKEN }} + repository: FriederikeHanssen/ncbench-workflow + path: ncbench-workflow/ + ref: main + + - name: Install yq + uses: mikefarah/yq@master + + - name: Add entry to config + env: + PIPELINE_VERSION_NO_DOTS: ${{ env.PIPELINE_VERSION_NO_DOTS}} + PIPELINE_VERSION: ${{ env.PIPELINE_VERSION }} + FASTP_VERSION: ${{ env.FASTP_VERSION }} + BWA_VERSION: ${{ env.BWA_VERSION }} + BQSR_VERSION: ${{ env.BQSR_VERSION }} + DEEPVARIANT_VERSION: ${{ env.DEEPVARIANT_VERSION }} + FREEBAYES_VERSION: ${{ env.FREEBAYES_VERSION }} + HAPLOTYPECALLER_VERSION: ${{ env.HAPLOTYPECALLER_VERSION }} + STRELKA_VERSION: ${{ env.STRELKA_VERSION }} + DEPOSITION_ID: ${{ env.DEPOSITION_ID }} + run: bash .github/workflows/set_ncbench_config.sh + + - name: Commit files + uses: EndBug/add-and-commit@v9 + with: + cwd: "./ncbench-workflow" + author_name: "FriederikeHanssen" + author_email: "FriederikeHanssen@users.noreply.github.com" + new_branch: "sarek_${{ env.PIPELINE_VERSION }}" + message: "Add changes" + add: "config/config.yaml" diff --git a/.github/workflows/release-announcments.yml b/.github/workflows/release-announcements.yml similarity index 80% rename from .github/workflows/release-announcments.yml rename to .github/workflows/release-announcements.yml index 6ad339277f..d468aeaaec 100644 --- a/.github/workflows/release-announcments.yml +++ b/.github/workflows/release-announcements.yml @@ -9,6 +9,11 @@ jobs: toot: runs-on: ubuntu-latest steps: + - name: get topics and convert to hashtags + id: get_topics + run: | + curl -s https://nf-co.re/pipelines.json | jq -r '.remote_workflows[] | select(.full_name == "${{ github.repository }}") | .topics[]' | awk '{print "#"$0}' | tr '\n' ' ' >> $GITHUB_OUTPUT + - uses: rzr/fediverse-action@master with: access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} @@ -20,11 +25,13 @@ jobs: Please see the changelog: ${{ github.event.release.html_url }} + ${{ steps.get_topics.outputs.GITHUB_OUTPUT }} #nfcore #openscience #nextflow #bioinformatics + send-tweet: runs-on: ubuntu-latest steps: - - uses: actions/setup-python@v4 + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 with: python-version: "3.10" - name: Install dependencies @@ -56,7 +63,7 @@ jobs: bsky-post: runs-on: ubuntu-latest steps: - - uses: zentered/bluesky-post-action@v0.0.2 + - uses: zentered/bluesky-post-action@80dbe0a7697de18c15ad22f4619919ceb5ccf597 # v0.1.0 with: post: | Pipeline release! ${{ github.repository }} v${{ github.event.release.tag_name }} - ${{ github.event.release.name }}! diff --git a/.github/workflows/set_ncbench_config.sh b/.github/workflows/set_ncbench_config.sh new file mode 100644 index 0000000000..be32a86d7d --- /dev/null +++ b/.github/workflows/set_ncbench_config.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# This script updates the config.yml in the NCBench repository. +# The config file is needed to trigger the subsequent benchmarking workflow. +# For each variant caller and each input file a new entry needs to be created. + +declare -A variant_callers=( + ["deepvariant"]="NA12878_%sM.deepvariant.vcf.gz" + ["freebayes"]="NA12878_%sM.freebayes.vcf.gz" + ["haplotypecaller"]="NA12878_%sM.haplotypecaller.filtered.vcf.gz" + ["strelka2"]="NA12878_%sM.strelka.variants.vcf.gz" +) + +declare -A variant_versions=( + ["deepvariant"]="${DEEPVARIANT_VERSION}" + ["freebayes"]="${FREEBAYES_VERSION}" + ["haplotypecaller"]="${HAPLOTYPECALLER_VERSION}" + ["strelka2"]="${STRELKA_VERSION}" +) + +for READS in 75 200; do + for variant_caller in "${!variant_callers[@]}"; do + filename=$(printf "${variant_callers[$variant_caller]}" $READS $READS) + yq --inplace ' + with(.variant-calls.nf-core-sarek-'"${PIPELINE_VERSION_NO_DOTS}"'-'"${variant_caller}"'-agilent-'"${READS}"'M.labels; + .site = "nf-core" | + .pipeline = "nf-core/sarek v'"${PIPELINE_VERSION}"'" | + .trimming = "FastP v'"${FASTP_VERSION}"'" | + .read-mapping = "bwa mem v'"${BWA_VERSION}"'" | + .base-quality-recalibration = "gatk4 v'"${BQSR_VERSION}"'" | + .realignment = "none" | + .variant-detection = "'${variant_caller}' v'"${variant_versions[$variant_caller]}"'" | + .genotyping = "none" | + .reads = "'"${READS}"'M" ) | + with(.variant-calls.nf-core-sarek-'"${PIPELINE_VERSION_NO_DOTS}"'-'"${variant_caller}"'-agilent-'"${READS}"'M.subcategory; + . = "NA12878-agilent" ) | + with(.variant-calls.nf-core-sarek-'"${PIPELINE_VERSION_NO_DOTS}"'-'"${variant_caller}"'-agilent-'"${READS}"'M.zenodo; + .deposition = '"${DEPOSITION_ID}"' | + .filename= "'"${filename}"'" ) | + with(.variant-calls.nf-core-sarek-'"${PIPELINE_VERSION_NO_DOTS}"'-'"${variant_caller}"'-agilent-'"${READS}"'M.benchmark; + . = "giab-NA12878-agilent-'"${READS}"'M" ) | + with(.variant-calls.nf-core-sarek-'"${PIPELINE_VERSION_NO_DOTS}"'-'"${variant_caller}"'-agilent-'"${READS}"'M.rename-contigs; + . = "resources/rename-contigs/ucsc-to-ensembl.txt" ) + ' ncbench-workflow/config/config.yaml + done +done + diff --git a/.github/workflows/upload.py b/.github/workflows/upload.py new file mode 100644 index 0000000000..fcd7eeb1e9 --- /dev/null +++ b/.github/workflows/upload.py @@ -0,0 +1,101 @@ +import logging +import requests +import os +import json + +""" +This scripts collects all variant calling files and uploads them to Zenodo. +1. A new Zenodo entry is created +2. All files are uploaded +3. Meta data is added: Pipeline version, authors +4. Entry is published. + +ATTENTION: Use sandbox links during development! They are set in each affected line as comment. + If you need to use the production Zenodo links, turn off publishing (see bottom). +""" + +headers = {"Content-Type": "application/json"} +access_token = os.environ["ACCESS_TOKEN"] +params = {"access_token": access_token} +workspace_directory = os.environ["GITHUB_WORKSPACE"] +pipeline_version = os.environ["PIPELINE_VERSION"] + +# TODO: replace sandbox link f"https://sandbox.zenodo.org/api/deposit/depositions" +url = f"https://zenodo.org/api/deposit/depositions" + +# Create empty upload +try: + r = requests.post(url, params=params, json={}, headers=headers) + r.raise_for_status() +except requests.exceptions.RequestException as e: + raise SystemExit(e) + +logging.info("Create empty upload:\n") +logging.info(r.json()) +logging.info(r.status_code) + +deposition_id = r.json()["id"] + +## Store deposition ID +with open("deposition_id.txt", "w") as f: + f.write(str(deposition_id)) + +# Upload a new file +bucket_url = r.json()["links"]["bucket"] + +filenames = [ + "deepvariant/NA12878_75M/NA12878_75M.deepvariant.vcf.gz", + "freebayes/NA12878_75M/NA12878_75M.freebayes.vcf.gz", + "haplotypecaller/NA12878_75M/NA12878_75M.haplotypecaller.filtered.vcf.gz", + "strelka/NA12878_75M/NA12878_75M.strelka.variants.vcf.gz", + "deepvariant/NA12878_200M/NA12878_200M.deepvariant.vcf.gz", + "freebayes/NA12878_200M/NA12878_200M.freebayes.vcf.gz", + "haplotypecaller/NA12878_200M/NA12878_200M.haplotypecaller.filtered.vcf.gz", + "strelka/NA12878_200M/NA12878_200M.strelka.variants.vcf.gz", +] + +for file in filenames: + path = "./variant_calling/%s" % file + with open(path, "rb") as fp: + r = requests.put( + "%s/%s" % (bucket_url, os.path.basename(file)), + data=fp, + params=params, + ) + logging.info(r.json()) + +# Add metadata to uploaded file +title = "WES benchmark results nf-core/sarek v{}".format(pipeline_version) +data = { + "metadata": { + "title": title, + "upload_type": "dataset", + "description": "Variant calling results on benchmarking datasets produced with nf-core/sarek", + "creators": [ + {"name": "Garcia, Maxime Ulysse", "affiliation": "Seqera, Barcelona"}, + {"name": "Hanssen, Friederike", "affiliation": "Quantitative Biology Center, Tuebingen"}, + ], + } +} + +# TODO replace sandbox link https://sandbox.zenodo.org/api/deposit/depositions/ https://zenodo.org/api/deposit/depositions/ +r = requests.put( + "https://zenodo.org/api/deposit/depositions/%s" % deposition_id, + params=params, + data=json.dumps(data), + headers=headers, +) + +logging.info("Add metadata: ") +logging.info(r.status_code) +logging.info(r.json()) + +# TODO only uncomment once everything works, replace sandbox link: "https://sandbox.zenodo.org/api/deposit/depositions/%s/actions/publish" +# Publish this +try: + r = requests.post("https://zenodo.org/api/deposit/depositions/%s/actions/publish" % deposition_id, params=params) + r.raise_for_status() +except requests.exceptions.RequestException as e: + raise SystemExit(e) +logging.info("Publish data status code: ") +logging.info(r.status_code) diff --git a/.gitignore b/.gitignore index f3bc0d64f3..9bd5a6ee00 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,12 @@ -*.code-workspace -*.pyc .nextflow* +work/ +data/ +results/ .DS_Store +testing/ +testing* +*.pyc +*.code-workspace .nf-test* .nf-test/ -data/ -testing* -testing/ test-datasets/ -results/ -work/ diff --git a/.gitpod.yml b/.gitpod.yml index 25488dcc08..105a1821a1 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -4,16 +4,17 @@ tasks: command: | pre-commit install --install-hooks nextflow self-update + - name: unset JAVA_TOOL_OPTIONS + command: | + unset JAVA_TOOL_OPTIONS vscode: extensions: # based on nf-core.nf-core-extensionpack - - codezombiech.gitignore # Language support for .gitignore files - # - cssho.vscode-svgviewer # SVG viewer - esbenp.prettier-vscode # Markdown/CommonMark linting and style checking for Visual Studio Code - - eamodio.gitlens # Quickly glimpse into whom, why, and when a line or code block was changed - EditorConfig.EditorConfig # override user/workspace settings with settings found in .editorconfig files - Gruntfuggly.todo-tree # Display TODO and FIXME in a tree view in the activity bar - mechatroner.rainbow-csv # Highlight columns in csv files in different colors - # - nextflow.nextflow # Nextflow syntax highlighting + # - nextflow.nextflow # Nextflow syntax highlighting - oderwat.indent-rainbow # Highlight indentation level - streetsidesoftware.code-spell-checker # Spelling checker for source code + - charliermarsh.ruff # Code linter Ruff diff --git a/.nf-core.yml b/.nf-core.yml index 36189e1fcb..c54e86853c 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -3,9 +3,14 @@ lint: actions_ci: False files_exist: - .github/workflows/awsfulltest.yml + - .github/workflows/awstest.yml - conf/modules.config + - lib/WorkflowMain.groovy + - lib/NfcoreTemplate.groovy + - lib/WorkflowSarek.groovy files_unchanged: - .gitignore + - .github/PULL_REQUEST_TEMPLATE.md - assets/nf-core-sarek_logo_light.png - docs/images/nf-core-sarek_logo_dark.png - docs/images/nf-core-sarek_logo_light.png diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0c31cdb99f..af57081f60 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,10 @@ repos: - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v2.7.1" + rev: "v3.1.0" hooks: - id: prettier + - repo: https://github.com/editorconfig-checker/editorconfig-checker.python + rev: "2.7.3" + hooks: + - id: editorconfig-checker + alias: ec diff --git a/.prettierignore b/.prettierignore index 437d763d0c..57a974e9aa 100644 --- a/.prettierignore +++ b/.prettierignore @@ -10,3 +10,5 @@ testing/ testing* *.pyc bin/ +modules/nf-core/ +subworkflows/nf-core/ diff --git a/CHANGELOG.md b/CHANGELOG.md index b686bd5ed7..7d1434d995 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,94 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.4.1](https://github.com/nf-core/sarek/releases/tag/3.4.1) - Balgattjåhkkå + +Balgattjåhkkå is the other top peak (over 2k m) in the Pårte massif, the other one being Pårtetjåkko (Bårddetjåhkkå). + +### Added + +- [#1272](https://github.com/nf-core/sarek/pull/1372) - Add integration with NCBench: Automatic submission of latest benchmarking runs +- [#1333](https://github.com/nf-core/sarek/pull/1333) - Back to dev +- [#1335](https://github.com/nf-core/sarek/pull/1335) - Add index computation of `bcftools_annotations`, if not provided +- [#1340](https://github.com/nf-core/sarek/pull/1340) - Adds Azure test profiles and megatests +- [#1372](https://github.com/nf-core/sarek/pull/1372) - Add NCBench test profile for Agilent datasets +- [#1409](https://github.com/nf-core/sarek/pull/1409) - Add params `modules_testdata_base_path` to test profile + +### Changed + +- [#1339](https://githu.com/nf-core/sarek/pull/1339), [#1401](https://github.com/nf-core/sarek/pull/1401) - Update sentieon-modules to Sentieon `202308.01` and adding support for running Sentieon with Conda and Apptainer +- [#1344](https://github.com/nf-core/sarek/pull/1344) - Enable CRAM QC, when starting from variantcalling +- [#1359](https://github.com/nf-core/sarek/pull/1359) - Removing params usage from local modules +- [#1359](https://github.com/nf-core/sarek/pull/1359) - Removing params usage from local subworkflows +- [#1360](https://github.com/nf-core/sarek/pull/1360) - Sync `TEMPLATE` with `tools` `2.11` +- [#1385](https://github.com/nf-core/sarek/pull/1385), [#1436](https://github.com/nf-core/sarek/pull/1436) - Sync `TEMPLATE` with `tools` `2.12` +- [#1408](https://github.com/nf-core/sarek/pull/1408), [#1412](https://github.com/nf-core/sarek/pull/1412) - Updating samtools to v1.19.2 - except in GATK/markduplicates. (Temporarily disabled nf-test for bwamem2/mem.) +- [#1411](https://github.com/nf-core/sarek/pull/1411) - Temporarily disable sentieon related tests +- [#1414](https://github.com/nf-core/sarek/pull/1414) - Sync `TEMPLATE` with `tools` `2.13` +- [#1419](https://github.com/nf-core/sarek/pull/1419) - Updating GATK to v4.5, and updating samtools to v1.19.2 in GATK/markduplicates +- [#1426](https://github.com/nf-core/sarek/pull/1426) - Updating certain modules in order to fix the testdata-path in the nf-tests of those modules. Setting Docker runOptions for params.use_gatk_spark +- [#1428](https://github.com/nf-core/sarek/pull/1428) - Sync `TEMPLATE` with `tools` `2.13.1` +- [#1422](https://github.com/nf-core/sarek/pull/1422) - Refactoring following `TEMPLATE` sync with `tools` `2.13` +- [#1431](https://github.com/nf-core/sarek/pull/1431) - Using docker.containerOptions instead of docker.runOptions. Clearing containerOptions for SPARK modules for any kind of supported container engine +- [#1439](https://github.com/nf-core/sarek/pull/1439) - Replacing the local module `BUILD_INTERVALS` with the nf-core module `GAWK` +- [#1456](https://github.com/nf-core/sarek/pull/1456), [#1472](https://github.com/nf-core/sarek/pull/1472), [#1473](https://github.com/nf-core/sarek/pull/1473) - Revert usage of docker.runOptions. Add an empty docker.runOptions when using the new `spark` profile +- [#1457](https://github.com/nf-core/sarek/pull/1457) - Update all modules +- [#1466](https://github.com/nf-core/sarek/pull/1466) - Update `VEP` + +### Fixed + +- [#1334](https://github.com/nf-core/sarek/pull/1334) - Remove extra v, when reporting tower runs on slack +- [#1335](https://github.com/nf-core/sarek/pull/1335) - Add docs and validation for bcftools annotation parameters +- [#1345](https://github.com/nf-core/sarek/pull/1345) - Preserve STDERR for easier debugging +- [#1351](https://github.com/nf-core/sarek/pull/1351) - Fix params name for test profiles (`bcftools_annotations`) +- [#1357](https://github.com/nf-core/sarek/pull/1364) - Fixed bug where samples were dropped while reconstituting BAM files +- [#1373](https://github.com/nf-core/sarek/pull/1373) - Add `chr` prefix to NCBench bed file & enable trimming +- [#1381](https://github.com/nf-core/sarek/pull/1381) - Swap NGSCheckMate bed file for GATK.GRCh37 to one without the `chr` prefix +- [#1383](https://github.com/nf-core/sarek/pull/1383) - Fix `--three_prime_clip_r{1,2}` parameter documentation +- [#1390](https://github.com/nf-core/sarek/pull/1390) - Fix badges in README +- [#1400](https://github.com/nf-core/sarek/pull/1400) - Fixed input channel for ASSESS_SIGNIFICANCE module, updated makegraph to makegraph2 +- [#1403](https://github.com/nf-core/sarek/pull/1403) - Fix intervals usage with dot in chromosome names +- [#1407](https://github.com/nf-core/sarek/pull/1407) - Fix CI tests name +- [#1420](https://github.com/nf-core/sarek/pull/1420) - Make `-a` a default argument for `bcftools` concat +- [#1422](https://github.com/nf-core/sarek/pull/1422) - Fix `Cannot serialize context map` warning +- [#1462](https://github.com/nf-core/sarek/pull/1462) - Fix ascat input channels +- [#1463](https://github.com/nf-core/sarek/pull/1463) - Add `spark` profile to all gatk4spark tests +- [#1465](https://github.com/nf-core/sarek/pull/1465), [#1469](https://github.com/nf-core/sarek/pull/1469) - Fix input channels and tests of Sentieon workflows +- [#1470](https://github.com/nf-core/sarek/pull/1470) - Fix channels for `MultiQC` +- [#1471](https://github.com/nf-core/sarek/pull/1471) - Add `snpeff_db` params to `validationSchemaIgnoreParams` to fix issues with Seqera Platform +- [#1471](https://github.com/nf-core/sarek/pull/1471) - Add `vep_cache_version` params to `validationSchemaIgnoreParams` to fix [#1454](https://github.com/nf-core/sarek/issues/1454) +- [#1471](https://github.com/nf-core/sarek/pull/1471) - Update `vep_version` params match the actual tool version +- [#1472](https://github.com/nf-core/sarek/pull/1472) - Cast `snpeff_db` params as a string to fix issues with Seqera Platform, as [#1471](https://github.com/nf-core/sarek/pull/1471) was not working as expected +- [#1472](https://github.com/nf-core/sarek/pull/1472) - Load `spark` profile last to avoid issues with `test` profiles + +### Removed + +- [#1405](https://github.com/nf-core/sarek/pull/1405) - Removing docker.userEmulation + +### Dependencies + +| Dependency | Old version | New version | +| ---------- | ----------- | ----------- | +| bcftools | 1.17 | 1.18 | +| ensemblvep | 110.0 | 111.0 | +| fgbio | 2.0.2 | 2.1.0 | +| gatk | 4.4.0.0 | 4.5.0.0 | +| gatk-spark | 4.4.0.0 | 4.5.0.0 | +| mosdepth | 0.3.3 | 0.3.6 | +| multiqc | 1.17 | 1.18 | +| samtools | 1.17 | 1.19.2 | + +### Modules / Subworkflows + +| script | Old name | New name | +| ------ | -------- | -------- | + +### Parameter + +| Old name | New name | +| -------------------------- | ------------------------ | +| bcftools_annotations_index | bcftools_annotations_tbi | + ## [3.4.0](https://github.com/nf-core/sarek/releases/tag/3.4.0) - Pårtetjåkko Pårtetjåkko is a mountain in the south of the park. @@ -72,7 +160,7 @@ Ráhpajávvre is the Lule Sámi spelling of Rapaselet. - [#1246](https://github.com/nf-core/sarek/pull/1246) - Back to dev - [#1259](https://github.com/nf-core/sarek/pull/1259) - nf-prov plugin -- [#1288](https://github.com/nf-core/sarek/pull/1288) - Add nf-test continuous integration. +- [#1288](https://github.com/nf-core/sarek/pull/1288) - Add nf-test continuous integration ### Changed @@ -203,7 +291,7 @@ Gällivare is a small lake next to Pierikjaure. - [#1112](https://github.com/nf-core/sarek/pull/1112) - Back to dev - [#1119](https://github.com/nf-core/sarek/pull/1119) - Added `help_text` for `input_output_options` group in schema -- [#1044](https://github.com/nf-core/sarek/pull/1044) - Adding support for several tools from Sentieon's DNAseq package. The standard fastq-to-vcf processing can now be done using Sentieon's DNAseq tools `ApplyVarCal`, `bwa mem`, `Dedup`, `GVCFtyper`, `Haplotyper`, `LocusCollector` and `VarCal`. +- [#1044](https://github.com/nf-core/sarek/pull/1044) - Adding support for several tools from Sentieon's DNAseq package. The standard fastq-to-vcf processing can now be done using Sentieon's DNAseq tools `ApplyVarCal`, `bwa mem`, `Dedup`, `GVCFtyper`, `Haplotyper`, `LocusCollector` and `VarCal` ### Changed @@ -234,7 +322,7 @@ Vuoinesluobbalah is a lake close to Bierikjávrre. - [#1087](https://github.com/nf-core/sarek/pull/1087) - Fix wrong default memory in GATK4_CREATESEQUENCEDICTIONARY [#1085](https://github.com/nf-core/sarek/pull/1085) - [#1089](https://github.com/nf-core/sarek/pull/1089) - Remove duplicated code -- [#1093](https://github.com/nf-core/sarek/pull/1093) - Fixing Ascat by reverting meta.id in channels allele_files, loci_files, gc_file and rt_file to baseName. +- [#1093](https://github.com/nf-core/sarek/pull/1093) - Fixing Ascat by reverting meta.id in channels allele_files, loci_files, gc_file and rt_file to baseName - [#1098](https://github.com/nf-core/sarek/pull/1098) - Fix Channel issue in Mutect2 subworkflow [#1094](https://github.com/nf-core/sarek/pull/1094) - [#1100](https://github.com/nf-core/sarek/pull/1100) - Remove duplicate index with deepvariant when no_intervals [#1069](https://github.com/nf-core/sarek/pull/1069) - [#1101](https://github.com/nf-core/sarek/pull/1101) - Remove duplicate index computation for GATK4 Markduplicates & [#1065](https://github.com/nf-core/sarek/issues/1065) diff --git a/README.md b/README.md index c128e04955..fc283ba454 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,27 @@ -# ![nf-core/sarek](docs/images/nf-core-sarek_logo_light.png#gh-light-mode-only) ![nf-core/sarek](docs/images/nf-core-sarek_logo_dark.png#gh-dark-mode-only) - -[![GitHub Actions CI Status](https://github.com/nf-core/sarek/workflows/nf-core%20CI/badge.svg)](https://github.com/nf-core/sarek/actions?query=workflow%3A%22nf-core+CI%22) -[![GitHub Actions Linting Status](https://github.com/nf-core/sarek/workflows/nf-core%20linting/badge.svg)](https://github.com/nf-core/sarek/actions?query=workflow%3A%22nf-core+linting%22) +

+ + + nf-core/sarek + +

+ +[![GitHub Actions CI Status](https://github.com/nf-core/sarek/actions/workflows/ci.yml/badge.svg)](https://github.com/nf-core/sarek/actions/workflows/ci.yml) +[![GitHub Actions Linting Status](https://github.com/nf-core/sarek/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-core/sarek/actions/workflows/linting.yml) [![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/sarek/results) +[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com) [![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.3476425-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.3476425) +[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com) [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A523.04.0-23aa62.svg)](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/) -[![Launch on Nextflow Tower](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Nextflow%20Tower-%234256e7)](https://tower.nf/launch?pipeline=https://github.com/nf-core/sarek) +[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://tower.nf/launch?pipeline=https://github.com/nf-core/sarek) -[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23sarek-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/sarek)[![Follow on Twitter](http://img.shields.io/badge/twitter-%40nf__core-1DA1F2?labelColor=000000&logo=twitter)](https://twitter.com/nf_core)[![Follow on Mastodon](https://img.shields.io/badge/mastodon-nf__core-6364ff?labelColor=FFFFFF&logo=mastodon)](https://mstdn.science/@nf_core)[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core) +[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23sarek-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/sarek) +[![Follow on Twitter](http://img.shields.io/badge/twitter-%40nf__core-1DA1F2?labelColor=000000&logo=twitter)](https://twitter.com/nf_core) +[![Follow on Mastodon](https://img.shields.io/badge/mastodon-nf__core-6364ff?labelColor=FFFFFF&logo=mastodon)](https://mstdn.science/@nf_core) +[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core) ## Introduction @@ -36,7 +46,7 @@ Depending on the options and samples provided, the pipeline can currently perfor - Map Reads to Reference (`BWA-mem`, `BWA-mem2`, `dragmap` or `Sentieon BWA-mem`) - Process BAM file (`GATK MarkDuplicates`, `GATK BaseRecalibrator` and `GATK ApplyBQSR` or `Sentieon LocusCollector` and `Sentieon Dedup`) - Summarise alignment statistics (`samtools stats`, `mosdepth`) -- Variant calling (enabled by `--tools`, see [compatibility](#which-variant-calling-tool-is-implemented-for-which-data-type)): +- Variant calling (enabled by `--tools`, see [compatibility](https://nf-co.re/sarek/latest/docs/usage#which-variant-calling-tool-is-implemented-for-which-data-type)): - `ASCAT` - `CNVkit` - `Control-FREEC` @@ -59,11 +69,8 @@ Depending on the options and samples provided, the pipeline can currently perfor ## Usage -:::note -If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how -to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) -with `-profile test` before running the workflow on actual data. -::: +> [!NOTE] +> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) with `-profile test` before running the workflow on actual data. First, prepare a samplesheet with your input data that looks as follows: @@ -85,11 +92,9 @@ nextflow run nf-core/sarek \ --outdir ``` -:::warning -Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those -provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; -see [docs](https://nf-co.re/usage/configuration#custom-configuration-files). -::: +> [!WARNING] +> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; +> see [docs](https://nf-co.re/usage/configuration#custom-configuration-files). For more details and further functionality, please refer to the [usage documentation](https://nf-co.re/sarek/usage) and the [parameter documentation](https://nf-co.re/sarek/parameters). @@ -99,6 +104,14 @@ To see the results of an example test run with a full size dataset refer to the For more details about the output files and reports, please refer to the [output documentation](https://nf-co.re/sarek/output). +## Benchmarking + +On each release, the pipeline is run on 3 full size tests: + +- `test_full` runs tumor-normal data for one patient from the SEQ2C consortium +- `test_full_germline` runs a WGS 30X Genome-in-a-Bottle(NA12878) dataset +- `test_full_germline_ncbench_agilent` runs two WES samples with 75M and 200M reads (data available [here](https://github.com/ncbench/ncbench-workflow#contributing-callsets)). The results are uploaded to Zenodo, evaluated against a truth dataset, and results are made available via the [NCBench dashboard](https://ncbench.github.io/report/report.html#). + ## Credits Sarek was originally written by Maxime U Garcia and Szilveszter Juhos at the [National Genomics Infastructure](https://ngisweden.scilifelab.se) and [National Bioinformatics Infastructure Sweden](https://nbis.se) which are both platforms at [SciLifeLab](https://scilifelab.se), with the support of [The Swedish Childhood Tumor Biobank (Barntumörbanken)](https://ki.se/forskning/barntumorbanken). @@ -128,6 +141,7 @@ We thank the following people for their extensive assistance in the development - [cgpu](https://github.com/cgpu) - [Chela James](https://github.com/chelauk) - [David Mas-Ponte](https://github.com/davidmasp) +- [Edmund Miller](https://github.com/edmundmiller) - [Francesco Lescai](https://github.com/lescai) - [Gavin Mackenzie](https://github.com/GCJMackenzie) - [Gisela Gabernet](https://github.com/ggabernet) @@ -144,6 +158,7 @@ We thank the following people for their extensive assistance in the development - [Malin Larsson](https://github.com/malinlarsson) - [Marcel Martin](https://github.com/marcelm) - [Nick Smith](https://github.com/nickhsmith) +- [Nicolas Schcolnicov](https://github.com/nschcolnicov) - [Nilesh Tawari](https://github.com/nilesh-tawari) - [Olga Botvinnik](https://github.com/olgabot) - [Oskar Wacker](https://github.com/WackerO) @@ -151,6 +166,7 @@ We thank the following people for their extensive assistance in the development - [Paul Cantalupo](https://github.com/pcantalupo) - [Phil Ewels](https://github.com/ewels) - [Sabrina Krakau](https://github.com/skrakau) +- [Sam Minot](https://github.com/sminot) - [Sebastian-D](https://github.com/Sebastian-D) - [Silvia Morini](https://github.com/silviamorins) - [Solenne Correard](https://github.com/scorreard) diff --git a/assets/email_template.html b/assets/email_template.html index 36a9983efd..8340c9a2e4 100644 --- a/assets/email_template.html +++ b/assets/email_template.html @@ -12,7 +12,7 @@ -

nf-core/sarek v${version}

+

nf-core/sarek ${version}

Run Name: $runName

<% if (!success){ diff --git a/assets/email_template.txt b/assets/email_template.txt index 6a5d28bb03..18a7e3e722 100644 --- a/assets/email_template.txt +++ b/assets/email_template.txt @@ -4,7 +4,7 @@ |\\ | |__ __ / ` / \\ |__) |__ } { | \\| | \\__, \\__/ | \\ |___ \\`-._,-`-, `._,._,' - nf-core/sarek v${version} + nf-core/sarek ${version} ---------------------------------------------------- Run Name: $runName diff --git a/assets/multiqc_config.yml b/assets/multiqc_config.yml index e175753b62..20fec4d67b 100644 --- a/assets/multiqc_config.yml +++ b/assets/multiqc_config.yml @@ -3,9 +3,9 @@ custom_logo_url: https://github.com/nf-core/sarek/ custom_logo_title: "nf-core/sarek" report_comment: > - This report has been generated by the nf-core/sarek + This report has been generated by the nf-core/sarek analysis pipeline. For information about how to interpret these results, please see the - documentation. + documentation. report_section_order: "nf-core-sarek-methods-description": order: -1000 @@ -16,6 +16,8 @@ report_section_order: export_plots: true +disable_version_detection: true + # Run only these modules run_modules: - custom_content diff --git a/assets/slackreport.json b/assets/slackreport.json index de941028ea..6d735f5f6c 100644 --- a/assets/slackreport.json +++ b/assets/slackreport.json @@ -3,7 +3,7 @@ { "fallback": "Plain-text summary of the attachment.", "color": "<% if (success) { %>good<% } else { %>danger<%} %>", - "author_name": "nf-core/sarek v${version} - ${runName}", + "author_name": "nf-core/sarek ${version} - ${runName}", "author_icon": "https://www.nextflow.io/docs/latest/_static/favicon.ico", "text": "<% if (success) { %>Pipeline completed successfully!<% } else { %>Pipeline completed with errors<% } %>", "fields": [ diff --git a/conf/igenomes.config b/conf/igenomes.config index 1ae02673d7..5aa3e69805 100644 --- a/conf/igenomes.config +++ b/conf/igenomes.config @@ -35,10 +35,10 @@ params { known_indels_tbi = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Annotation/GATKBundle/{1000G_phase1,Mills_and_1000G_gold_standard}.indels.b37.vcf.gz.tbi" known_indels_vqsr = '--resource:1000G,known=false,training=true,truth=true,prior=10.0 1000G_phase1.indels.b37.vcf.gz --resource:mills,known=false,training=true,truth=true,prior=10.0 Mills_and_1000G_gold_standard.indels.b37.vcf.gz' mappability = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Annotation/Control-FREEC/out100m2_hg19.gem" - ngscheckmate_bed = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Annotation/NGSCheckMate/SNP_GRCh37_hg19_wChr.bed" - snpeff_db = 87 + ngscheckmate_bed = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Annotation/NGSCheckMate/SNP_GRCh37_hg19_woChr.bed" + snpeff_db = '87' snpeff_genome = 'GRCh37' - vep_cache_version = 110 + vep_cache_version = '111' vep_genome = 'GRCh37' vep_species = 'homo_sapiens' } @@ -73,9 +73,9 @@ params { pon = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/1000g_pon.hg38.vcf.gz" pon_tbi = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/1000g_pon.hg38.vcf.gz.tbi" sentieon_dnascope_model = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Annotation/Sentieon/SentieonDNAscopeModel1.1.model" - snpeff_db = 105 + snpeff_db = '105' snpeff_genome = 'GRCh38' - vep_cache_version = 110 + vep_cache_version = '110' vep_genome = 'GRCh38' vep_species = 'homo_sapiens' } @@ -84,9 +84,9 @@ params { fasta = "${params.igenomes_base}/Homo_sapiens/Ensembl/GRCh37/Sequence/WholeGenomeFasta/genome.fa" ngscheckmate_bed = "${params.igenomes_base}/Homo_sapiens/Ensembl/GRCh37/Annotation/NGSCheckMate/SNP_GRCh37_hg19_woChr.bed" readme = "${params.igenomes_base}/Homo_sapiens/Ensembl/GRCh37/Annotation/README.txt" - snpeff_db = 87 + snpeff_db = '87' snpeff_genome = 'GRCh37' - vep_cache_version = 110 + vep_cache_version = '111' vep_genome = 'GRCh37' vep_species = 'homo_sapiens' } @@ -94,9 +94,9 @@ params { bwa = "${params.igenomes_base}/Homo_sapiens/NCBI/GRCh38/Sequence/BWAIndex/version0.6.0/" fasta = "${params.igenomes_base}/Homo_sapiens/NCBI/GRCh38/Sequence/WholeGenomeFasta/genome.fa" ngscheckmate_bed ="${params.igenomes_base}/Homo_sapiens/NCBI/GRCh38/Annotation/NGSCheckMate/SNP_GRCh38_hg38_wChr.bed" - snpeff_db = 105 + snpeff_db = '105' snpeff_genome = 'GRCh38' - vep_cache_version = 110 + vep_cache_version = '111' vep_genome = 'GRCh38' vep_species = 'homo_sapiens' } @@ -118,9 +118,9 @@ params { known_indels_tbi = "${params.igenomes_base}/Mus_musculus/Ensembl/GRCm38/MouseGenomeProject/mgp.v5.merged.indels.dbSNP142.normed.vcf.gz.tbi" mappability = "${params.igenomes_base}/Mus_musculus/Ensembl/GRCm38/Annotation/Control-FREEC/GRCm38_68_mm10.gem" readme = "${params.igenomes_base}/Mus_musculus/Ensembl/GRCm38/Annotation/README.txt" - snpeff_db = 99 + snpeff_db = '99' snpeff_genome = 'GRCm38' - vep_cache_version = 102 + vep_cache_version = '102' vep_genome = 'GRCm38' vep_species = 'mus_musculus' } @@ -138,18 +138,18 @@ params { bwa = "${params.igenomes_base}/Bos_taurus/Ensembl/UMD3.1/Sequence/BWAIndex/version0.6.0/" fasta = "${params.igenomes_base}/Bos_taurus/Ensembl/UMD3.1/Sequence/WholeGenomeFasta/genome.fa" readme = "${params.igenomes_base}/Bos_taurus/Ensembl/UMD3.1/Annotation/README.txt" - snpeff_db = 75 + snpeff_db = '75' snpeff_genome = 'UMD3.1' - vep_cache_version = 94 + vep_cache_version = '94' vep_genome = 'UMD3.1' vep_species = 'bos_taurus' } 'WBcel235' { bwa = "${params.igenomes_base}/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/BWAIndex/version0.6.0/" fasta = "${params.igenomes_base}/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/WholeGenomeFasta/genome.fa" - snpeff_db = 105 + snpeff_db = '105' snpeff_genome = 'WBcel235' - vep_cache_version = 110 + vep_cache_version = '111' vep_genome = 'WBcel235' vep_species = 'caenorhabditis_elegans' } @@ -157,9 +157,9 @@ params { bwa = "${params.igenomes_base}/Canis_familiaris/Ensembl/CanFam3.1/Sequence/BWAIndex/version0.6.0/" fasta = "${params.igenomes_base}/Canis_familiaris/Ensembl/CanFam3.1/Sequence/WholeGenomeFasta/genome.fa" readme = "${params.igenomes_base}/Canis_familiaris/Ensembl/CanFam3.1/Annotation/README.txt" - snpeff_db = 99 + snpeff_db = '99' snpeff_genome = 'CanFam3.1' - vep_cache_version = 104 + vep_cache_version = '104' vep_genome = 'CanFam3.1' vep_species = 'canis_lupus_familiaris' } @@ -215,9 +215,9 @@ params { 'R64-1-1' { bwa = "${params.igenomes_base}/Saccharomyces_cerevisiae/Ensembl/R64-1-1/Sequence/BWAIndex/version0.6.0/" fasta = "${params.igenomes_base}/Saccharomyces_cerevisiae/Ensembl/R64-1-1/Sequence/WholeGenomeFasta/genome.fa" - snpeff_db = 105 + snpeff_db = '105' snpeff_genome = 'R64-1-1' - vep_cache_version = 110 + vep_cache_version = '111' vep_genome = 'R64-1-1' vep_species = 'saccharomyces_cerevisiae' } @@ -243,9 +243,9 @@ params { 'hg38' { bwa = "${params.igenomes_base}/Homo_sapiens/UCSC/hg38/Sequence/BWAIndex/version0.6.0/" fasta = "${params.igenomes_base}/Homo_sapiens/UCSC/hg38/Sequence/WholeGenomeFasta/genome.fa" - snpeff_db = 105 + snpeff_db = '105' snpeff_genome = 'GRCh38' - vep_cache_version = 110 + vep_cache_version = '111' vep_genome = 'GRCh38' vep_species = 'homo_sapiens' } @@ -253,9 +253,9 @@ params { bwa = "${params.igenomes_base}/Homo_sapiens/UCSC/hg19/Sequence/BWAIndex/version0.6.0/" fasta = "${params.igenomes_base}/Homo_sapiens/UCSC/hg19/Sequence/WholeGenomeFasta/genome.fa" readme = "${params.igenomes_base}/Homo_sapiens/UCSC/hg19/Annotation/README.txt" - snpeff_db = 87 + snpeff_db = '87' snpeff_genome = 'GRCh37' - vep_cache_version = 110 + vep_cache_version = '111' vep_genome = 'GRCh37' vep_species = 'homo_sapiens' } @@ -263,9 +263,9 @@ params { bwa = "${params.igenomes_base}/Mus_musculus/UCSC/mm10/Sequence/BWAIndex/version0.6.0/" fasta = "${params.igenomes_base}/Mus_musculus/UCSC/mm10/Sequence/WholeGenomeFasta/genome.fa" readme = "${params.igenomes_base}/Mus_musculus/UCSC/mm10/Annotation/README.txt" - snpeff_db = 99 + snpeff_db = '99' snpeff_genome = 'GRCm38' - vep_cache_version = 102 + vep_cache_version = '102' vep_genome = 'GRCm38' vep_species = 'mus_musculus' } diff --git a/conf/modules/annotate.config b/conf/modules/annotate.config index ff046ca843..b02c1b3ef3 100644 --- a/conf/modules/annotate.config +++ b/conf/modules/annotate.config @@ -35,6 +35,7 @@ process { if (params.tools && (params.tools.split(',').contains('vep') || params.tools.split(',').contains('merge'))) { withName: 'ENSEMBLVEP_VEP' { ext.args = { [ + "--stats_file ${vcf.baseName - '.vcf' + '_VEP.ann'}.summary.html", (params.vep_dbnsfp && params.dbnsfp && !params.dbnsfp_consequence) ? "--plugin dbNSFP,${params.dbnsfp.split("/")[-1]},${params.dbnsfp_fields}" : '', (params.vep_dbnsfp && params.dbnsfp && params.dbnsfp_consequence) ? "--plugin dbNSFP,'consequence=${params.dbnsfp_consequence}',${params.dbnsfp.split("/")[-1]},${params.dbnsfp_fields}" : '', (params.vep_loftee) ? "--plugin LoF,loftee_path:/usr/local/share/ensembl-vep-${params.vep_version}" : '', @@ -76,6 +77,16 @@ process { // SNPEFF THEN VEP if (params.tools && params.tools.split(',').contains('merge')) { withName: 'NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:VCF_ANNOTATE_MERGE:ENSEMBLVEP_VEP' { + ext.args = { [ + "--stats_file ${vcf.baseName - '.ann.vcf' + '_VEP.ann'}.summary.html", + (params.vep_dbnsfp && params.dbnsfp && !params.dbnsfp_consequence) ? "--plugin dbNSFP,${params.dbnsfp.split("/")[-1]},${params.dbnsfp_fields}" : '', + (params.vep_dbnsfp && params.dbnsfp && params.dbnsfp_consequence) ? "--plugin dbNSFP,'consequence=${params.dbnsfp_consequence}',${params.dbnsfp.split("/")[-1]},${params.dbnsfp_fields}" : '', + (params.vep_loftee) ? "--plugin LoF,loftee_path:/usr/local/share/ensembl-vep-${params.vep_version}" : '', + (params.vep_spliceai && params.spliceai_snv && params.spliceai_indel) ? "--plugin SpliceAI,snv=${params.spliceai_snv.split("/")[-1]},indel=${params.spliceai_indel.split("/")[-1]}" : '', + (params.vep_spliceregion) ? '--plugin SpliceRegion' : '', + (params.vep_out_format) ? "--${params.vep_out_format}" : '--vcf', + (params.vep_custom_args) ?: '' + ].join(' ').trim() } // If merge: Output file will have format *_snpEff_VEP.ann.vcf, *_snpEff_VEP.ann.json or *_snpEff_VEP.ann.tab ext.prefix = { vcf.baseName - '.ann.vcf' + '_VEP.ann' } } diff --git a/conf/modules/controlfreec.config b/conf/modules/controlfreec.config index 8ed3920c43..b6fa043d0e 100644 --- a/conf/modules/controlfreec.config +++ b/conf/modules/controlfreec.config @@ -50,8 +50,7 @@ process { ] } - withName: 'MAKEGRAPH' { - ext.args = { "${params.cf_ploidy}" } + withName: 'MAKEGRAPH2' { publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/controlfreec/${meta.id}/" }, diff --git a/conf/modules/deepvariant.config b/conf/modules/deepvariant.config index ff67bc1a4b..021990f7f6 100644 --- a/conf/modules/deepvariant.config +++ b/conf/modules/deepvariant.config @@ -17,7 +17,7 @@ process { withName: 'DEEPVARIANT' { ext.args = { params.wes ? "--model_type WES" : "--model_type WGS" } - ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.deepvariant" : "${meta.id}.deepvariant.${intervals.simpleName}" } + ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.deepvariant" : "${meta.id}.deepvariant.${intervals.baseName}" } ext.when = { params.tools && params.tools.split(',').contains('deepvariant') } publishDir = [ mode: params.publish_dir_mode, diff --git a/conf/modules/freebayes.config b/conf/modules/freebayes.config index a30ec62308..2c224aeffd 100644 --- a/conf/modules/freebayes.config +++ b/conf/modules/freebayes.config @@ -27,7 +27,7 @@ process { withName: 'FREEBAYES' { ext.args = { '--min-alternate-fraction 0.1 --min-mapping-quality 1' } //To make sure no naming conflicts ensure with module BCFTOOLS_SORT & the naming being correct in the output folder - ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}" : "${meta.id}.${target_bed.simpleName}" } + ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}" : "${meta.id}.${target_bed.baseName}" } ext.when = { params.tools && params.tools.split(',').contains('freebayes') } publishDir = [ enabled: false diff --git a/conf/modules/haplotypecaller.config b/conf/modules/haplotypecaller.config index f376f4f41d..d5b8a3db40 100644 --- a/conf/modules/haplotypecaller.config +++ b/conf/modules/haplotypecaller.config @@ -17,7 +17,7 @@ process { withName: 'GATK4_HAPLOTYPECALLER' { ext.args = { params.joint_germline ? "-ERC GVCF" : "" } - ext.prefix = { meta.num_intervals <= 1 ? ( params.joint_germline ? "${meta.id}.haplotypecaller.g" : "${meta.id}.haplotypecaller" ) : ( params.joint_germline ? "${meta.id}.haplotypecaller.${intervals.simpleName}.g" :"${meta.id}.haplotypecaller.${intervals.simpleName}" ) } + ext.prefix = { meta.num_intervals <= 1 ? ( params.joint_germline ? "${meta.id}.haplotypecaller.g" : "${meta.id}.haplotypecaller" ) : ( params.joint_germline ? "${meta.id}.haplotypecaller.${intervals.baseName}.g" :"${meta.id}.haplotypecaller.${intervals.baseName}" ) } ext.when = { params.tools && params.tools.split(',').contains('haplotypecaller') } publishDir = [ mode: params.publish_dir_mode, diff --git a/conf/modules/markduplicates.config b/conf/modules/markduplicates.config index c33b6a3a2a..55f29ede51 100644 --- a/conf/modules/markduplicates.config +++ b/conf/modules/markduplicates.config @@ -91,6 +91,7 @@ process { } withName: 'GATK4SPARK_MARKDUPLICATES' { + containerOptions = '' ext.args = { '--remove-sequencing-duplicates false -VS LENIENT' } ext.prefix = { "${meta.id}.md.cram" } publishDir = [ diff --git a/conf/modules/modules.config b/conf/modules/modules.config index a0411793a6..f24cb481b7 100644 --- a/conf/modules/modules.config +++ b/conf/modules/modules.config @@ -78,12 +78,12 @@ process { ] } - if ((params.step == 'mapping' || params.step == 'markduplicates'|| params.step == 'prepare_recalibration'|| params.step == 'recalibrate') && (!(params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator')))) { - withName: 'NFCORE_SAREK:SAREK:CRAM_QC_RECAL:MOSDEPTH' { + if (!(params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator'))) { + withName: 'NFCORE_SAREK:SAREK:CRAM_SAMPLEQC:CRAM_QC_RECAL:MOSDEPTH' { ext.prefix = { "${meta.id}.recal" } } - withName: 'NFCORE_SAREK:SAREK:CRAM_QC_RECAL:SAMTOOLS_STATS' { + withName: 'NFCORE_SAREK:SAREK:CRAM_SAMPLEQC:CRAM_QC_RECAL:SAMTOOLS_STATS' { ext.prefix = { "${meta.id}.recal.cram" } ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('samtools')) } publishDir = [ diff --git a/conf/modules/mpileup.config b/conf/modules/mpileup.config index 43cae7f1bd..dbdfa27fec 100644 --- a/conf/modules/mpileup.config +++ b/conf/modules/mpileup.config @@ -24,7 +24,7 @@ process { withName: 'BCFTOOLS_MPILEUP' { ext.args2 = { '--multiallelic-caller' } ext.args3 = { "-i 'count(GT==\"RR\")==0'" } // only report non homozygous reference variants - ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.bcftools" : "${meta.id}_${intervals.simpleName}.bcftools" } + ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.bcftools" : "${meta.id}_${intervals.baseName}.bcftools" } ext.when = { params.tools && params.tools.split(',').contains('mpileup') } publishDir = [ mode: params.publish_dir_mode, diff --git a/conf/modules/mutect2.config b/conf/modules/mutect2.config index 2f74ee6327..5892437ddc 100644 --- a/conf/modules/mutect2.config +++ b/conf/modules/mutect2.config @@ -18,7 +18,7 @@ process { withName: 'GATK4_MUTECT2' { ext.args = { params.ignore_soft_clipped_bases ? "--dont-use-soft-clipped-bases true --f1r2-tar-gz ${task.ext.prefix}.f1r2.tar.gz" : "--f1r2-tar-gz ${task.ext.prefix}.f1r2.tar.gz" } - ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.simpleName}" } + ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.baseName}" } ext.when = { params.tools && params.tools.split(',').contains('mutect2') } publishDir = [ mode: params.publish_dir_mode, @@ -91,7 +91,7 @@ process { } withName: 'GETPILEUPSUMMARIES.*' { - ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.simpleName}" } + ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.baseName}" } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/" }, diff --git a/conf/modules/post_variant_calling.config b/conf/modules/post_variant_calling.config index ee29a656ce..3354d4671f 100644 --- a/conf/modules/post_variant_calling.config +++ b/conf/modules/post_variant_calling.config @@ -17,6 +17,7 @@ process { withName: 'GERMLINE_VCFS_CONCAT'{ + ext.args = { "-a" } ext.when = { params.concatenate_vcfs } publishDir = [ //specify to avoid publishing, overwritten otherwise diff --git a/conf/modules/prepare_genome.config b/conf/modules/prepare_genome.config index 241c164e7e..e54138538c 100644 --- a/conf/modules/prepare_genome.config +++ b/conf/modules/prepare_genome.config @@ -96,6 +96,16 @@ process { ] } + withName: 'TABIX_BCFTOOLS_ANNOTATIONS' { + ext.when = { !params.bcftools_annotations_tbi && params.bcftools_annotations && params.tools && params.tools.split(',').contains('bcfann') } + publishDir = [ + mode: params.publish_dir_mode, + path: { "${params.outdir}/reference/bcfann" }, + pattern: "*vcf.gz.tbi", + saveAs: { params.save_reference || params.build_only_index ? it : null } + ] + } + withName: 'TABIX_DBSNP' { ext.when = { !params.dbsnp_tbi && params.dbsnp && ((params.step == "mapping" || params.step == "markduplicates" || params.step == "prepare_recalibration") || params.tools && (params.tools.split(',').contains('controlfreec') || params.tools.split(',').contains('haplotypecaller') || params.tools.split(',').contains('sentieon_haplotyper') || params.tools.split(',').contains('sentieon_dnascope') || params.tools.split(',').contains('mutect2'))) } publishDir = [ @@ -154,6 +164,12 @@ process { } withName: 'UNTAR_CHR_DIR' { + ext.prefix = 'chr_dir' ext.when = { params.tools && params.tools.split(',').contains('controlfreec')} + publishDir = [ + mode: params.publish_dir_mode, + path: { "${params.outdir}/reference/" }, + saveAs: { (params.save_reference || params.build_only_index) && !it.equals('versions.yml') ? it : null } + ] } } diff --git a/conf/modules/prepare_intervals.config b/conf/modules/prepare_intervals.config index 655a227f8a..77814b5d42 100644 --- a/conf/modules/prepare_intervals.config +++ b/conf/modules/prepare_intervals.config @@ -15,6 +15,11 @@ process { + withName: 'BUILD_INTERVALS' { + ext.args = { "-v FS='\t' -v OFS='\t' '{ print \$1, \"0\", \$2 }'" } + ext.suffix = { "bed" } + } + withName: 'CREATE_INTERVALS_BED' { publishDir = [ mode: params.publish_dir_mode, @@ -33,7 +38,7 @@ process { ] } - withName: 'TABIX_BGZIPTABIX_INTERVAL_SPLIT' { + withName: 'TABIX_BGZIPTABIX_INTERVAL_SPLIT|TABIX_BGZIPTABIX_INTERVAL_COMBINED' { ext.prefix = {"${meta.id}"} publishDir = [ mode: params.publish_dir_mode, diff --git a/conf/modules/prepare_recalibration.config b/conf/modules/prepare_recalibration.config index 915075d5b4..a0f7bfbdb2 100644 --- a/conf/modules/prepare_recalibration.config +++ b/conf/modules/prepare_recalibration.config @@ -16,6 +16,9 @@ process { withName: 'GATK4_BASERECALIBRATOR|GATK4SPARK_BASERECALIBRATOR' { + if (params.use_gatk_spark) { + containerOptions = '' + } ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.recal" : "${meta.id}_${intervals.simpleName}.recal" } publishDir = [ mode: params.publish_dir_mode, diff --git a/conf/modules/recalibrate.config b/conf/modules/recalibrate.config index 7ca0a476f1..19bbb17d35 100644 --- a/conf/modules/recalibrate.config +++ b/conf/modules/recalibrate.config @@ -16,7 +16,10 @@ process { withName: 'GATK4_APPLYBQSR|GATK4SPARK_APPLYBQSR' { - ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.recal" : "${meta.id}_${intervals.simpleName}.recal" } + if (params.use_gatk_spark) { + containerOptions = '' + } + ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.recal" : "${meta.id}_${intervals.baseName}.recal" } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/preprocessing/" }, diff --git a/conf/modules/sentieon_dnascope.config b/conf/modules/sentieon_dnascope.config index 224c33c89c..50cf373ea8 100644 --- a/conf/modules/sentieon_dnascope.config +++ b/conf/modules/sentieon_dnascope.config @@ -16,7 +16,7 @@ process { withName: 'SENTIEON_DNASCOPE' { - ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.dnascope" : "${meta.id}.dnascope.${intervals.simpleName}" } + ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.dnascope" : "${meta.id}.dnascope.${intervals.baseName}" } ext.when = { params.tools && params.tools.split(',').contains('sentieon_dnascope') } publishDir = [ mode: params.publish_dir_mode, diff --git a/conf/modules/sentieon_haplotyper.config b/conf/modules/sentieon_haplotyper.config index 8b01b04c22..c2b9582223 100644 --- a/conf/modules/sentieon_haplotyper.config +++ b/conf/modules/sentieon_haplotyper.config @@ -16,7 +16,7 @@ process { withName: 'SENTIEON_HAPLOTYPER' { - ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.haplotyper" : "${meta.id}.haplotyper.${intervals.simpleName}" } + ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.haplotyper" : "${meta.id}.haplotyper.${intervals.baseName}" } ext.when = { params.tools && params.tools.split(',').contains('sentieon_haplotyper') } publishDir = [ mode: params.publish_dir_mode, diff --git a/conf/modules/strelka.config b/conf/modules/strelka.config index 23620dfdaf..badffb5df8 100644 --- a/conf/modules/strelka.config +++ b/conf/modules/strelka.config @@ -17,7 +17,7 @@ process { withName: 'STRELKA_.*' { ext.args = { params.wes ? '--exome' : '' } - ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.strelka" : "${meta.id}.strelka.${target_bed.simpleName}" } + ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.strelka" : "${meta.id}.strelka.${target_bed.baseName}" } ext.when = { params.tools && params.tools.split(',').contains('strelka') } publishDir = [ mode: params.publish_dir_mode, diff --git a/conf/modules/tiddit.config b/conf/modules/tiddit.config index 6a6060ba61..335ecf0951 100644 --- a/conf/modules/tiddit.config +++ b/conf/modules/tiddit.config @@ -47,7 +47,7 @@ process { // SVDB withName: 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_SOMATIC_TIDDIT:SVDB_MERGE' { - ext.prefix = { "${meta.id}.tiddit" } + ext.prefix = { "${meta.id}.tiddit_sv_merge" } publishDir = [ mode: params.publish_dir_mode, path: { "${params.outdir}/variant_calling/tiddit/${meta.id}/" }, diff --git a/conf/test.config b/conf/test.config index 999c3140b0..0366015081 100644 --- a/conf/test.config +++ b/conf/test.config @@ -26,22 +26,22 @@ params { igenomes_ignore = true // Small reference genome - bcftools_annotations = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/vcf/test2.vcf.gz" - bcftools_annotations_index = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi" - bcftools_header_lines = "${projectDir}/tests/config/bcfann_test_header.txt" - dbsnp = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz" - fasta = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/genome.fasta" - germline_resource = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/vcf/gnomAD.r2.1.1.vcf.gz" - intervals = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/genome.interval_list" - known_indels = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/vcf/mills_and_1000G.indels.vcf.gz" - ngscheckmate_bed = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/chr21/germlineresources/SNP_GRCh38_hg38_wChr.bed" - snpeff_cache = null - snpeff_db = 105 - snpeff_genome = 'WBcel235' - vep_cache = null - vep_cache_version = 110 - vep_genome = 'WBcel235' - vep_species = 'caenorhabditis_elegans' + bcftools_annotations = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/vcf/test2.vcf.gz" + bcftools_annotations_tbi = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi" + bcftools_header_lines = "${projectDir}/tests/config/bcfann_test_header.txt" + dbsnp = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz" + fasta = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/genome.fasta" + germline_resource = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/vcf/gnomAD.r2.1.1.vcf.gz" + intervals = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/genome.interval_list" + known_indels = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/vcf/mills_and_1000G.indels.vcf.gz" + ngscheckmate_bed = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/chr21/germlineresources/SNP_GRCh38_hg38_wChr.bed" + snpeff_cache = null + snpeff_db = '105' + snpeff_genome = 'WBcel235' + vep_cache = null + vep_cache_version = '110' + vep_genome = 'WBcel235' + vep_species = 'caenorhabditis_elegans' // Sentieon sentieon_dnascope_model = "s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh38/Annotation/Sentieon/SentieonDNAscopeModel1.1.model" @@ -52,6 +52,9 @@ params { // Ignore params that will throw warning through params validation validationSchemaIgnoreParams = 'genomes' + + // Base directory for nf-core/modules test data + modules_testdata_base_path = 's3://ngi-igenomes/testdata/nf-core/modules/' } process { @@ -105,7 +108,7 @@ if (System.getenv('PROFILE')) { } else if ("$PROFILE" == "docker") { conda.enabled = false docker.enabled = true - docker.userEmulation = { params.use_gatk_spark ? false : true }.call() + docker.runOptions = '-u $(id -u):$(id -g)' charliecloud.enabled = false podman.enabled = false shifter.enabled = false diff --git a/conf/test/cache.config b/conf/test/cache.config index cf63315acb..5e5145b6bc 100644 --- a/conf/test/cache.config +++ b/conf/test/cache.config @@ -38,22 +38,22 @@ params { igenomes_ignore = true // Small reference genome - bcftools_annotations = params.test_data['sarscov2']['illumina']['test2_vcf_gz'] - bcftools_annotations_index = params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'] - bcftools_header_lines = "${projectDir}/tests/config/bcfann_test_header.txt" - dbsnp = params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'] - fasta = params.test_data['homo_sapiens']['genome']['genome_fasta'] - germline_resource = params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_vcf_gz'] - intervals = params.test_data['homo_sapiens']['genome']['genome_interval_list'] - known_indels = params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_vcf_gz'] - ngscheckmate_bed = params.test_data['homo_sapiens']['genome']['ngscheckmate_bed'] - snpeff_cache = null - snpeff_db = 105 - snpeff_genome = 'WBcel235' - vep_cache = null - vep_cache_version = 110 - vep_genome = 'WBcel235' - vep_species = 'caenorhabditis_elegans' + bcftools_annotations = params.test_data['sarscov2']['illumina']['test2_vcf_gz'] + bcftools_annotations_tbi = params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'] + bcftools_header_lines = "${projectDir}/tests/config/bcfann_test_header.txt" + dbsnp = params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'] + fasta = params.test_data['homo_sapiens']['genome']['genome_fasta'] + germline_resource = params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_vcf_gz'] + intervals = params.test_data['homo_sapiens']['genome']['genome_interval_list'] + known_indels = params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_vcf_gz'] + ngscheckmate_bed = params.test_data['homo_sapiens']['genome']['ngscheckmate_bed'] + snpeff_cache = null + snpeff_db = 105 + snpeff_genome = 'WBcel235' + vep_cache = null + vep_cache_version = 110 + vep_genome = 'WBcel235' + vep_species = 'caenorhabditis_elegans' // Sentieon sentieon_dnascope_model = "s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh38/Annotation/Sentieon/SentieonDNAscopeModel1.1.model" @@ -116,7 +116,7 @@ if (System.getenv('PROFILE')) { } else if ("$PROFILE" == "docker") { conda.enabled = false docker.enabled = true - docker.userEmulation = { params.use_gatk_spark ? false : true }.call() + docker.runOptions = '-u $(id -u):$(id -g)' charliecloud.enabled = false podman.enabled = false shifter.enabled = false diff --git a/conf/test_full_germline_ncbench_agilent.config b/conf/test_full_germline_ncbench_agilent.config new file mode 100644 index 0000000000..209a01c641 --- /dev/null +++ b/conf/test_full_germline_ncbench_agilent.config @@ -0,0 +1,25 @@ +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Nextflow config file for running full-size tests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Defines input files and everything required to run a full size pipeline test. + + Use as follows: + nextflow run nf-core/sarek -profile test_full_germline_ncbench_agilent, --outdir + +---------------------------------------------------------------------------------------- +*/ + +params { + config_profile_name = 'Test profile for germline VC' + config_profile_description = 'Agilent test datasets to benchmark germline VC pipeline function using the NCBench framework' + + // Input data for full size test + input = 'https://raw.githubusercontent.com/nf-core/test-datasets/sarek/testdata/csv/NA12878_Agilent_full_test.csv' + + // Other params + tools = 'strelka,freebayes,haplotypecaller,deepvariant,manta,vep,snpeff' + intervals = 's3://ngi-igenomes/test-data/sarek/Agilent_v7.bed' + wes = true + trim_fastq = true +} diff --git a/docs/abstracts/2018-07-JOBIM.md b/docs/abstracts/2018-07-JOBIM.md index aa902caeb4..ee32b17d22 100644 --- a/docs/abstracts/2018-07-JOBIM.md +++ b/docs/abstracts/2018-07-JOBIM.md @@ -16,7 +16,7 @@ Björn Nystedt 95A, Monica Nistér 13, Max Käller 2D - Max Käller +Max Käller 1. Barntumörbanken, Dept. of Oncology Pathology; 2. Science for Life Laboratory; diff --git a/docs/images/sarek_subway.png b/docs/images/sarek_subway.png index ff73d272d9..02937f57e5 100644 Binary files a/docs/images/sarek_subway.png and b/docs/images/sarek_subway.png differ diff --git a/docs/images/sarek_subway.svg b/docs/images/sarek_subway.svg index d6d1653c12..2a7831b02b 100644 --- a/docs/images/sarek_subway.svg +++ b/docs/images/sarek_subway.svg @@ -8,7 +8,7 @@ version="1.1" id="svg5" inkscape:version="1.3 (0e150ed, 2023-07-21)" - sodipodi:docname="sarek_subway.svg" + sodipodi:docname="sarek_subway(2).svg" inkscape:export-filename="sarek_subway.png" inkscape:export-xdpi="600" inkscape:export-ydpi="600" @@ -33,13 +33,13 @@ inkscape:document-units="mm" showgrid="false" inkscape:zoom="1.4142136" - inkscape:cx="521.49124" - inkscape:cy="291.68154" - inkscape:window-width="2544" - inkscape:window-height="826" - inkscape:window-x="12" - inkscape:window-y="37" - inkscape:window-maximized="0" + inkscape:cx="521.84479" + inkscape:cy="348.60363" + inkscape:window-width="2560" + inkscape:window-height="1027" + inkscape:window-x="0" + inkscape:window-y="25" + inkscape:window-maximized="1" inkscape:current-layer="layer4" width="211mm" fit-margin-top="0" @@ -52,7 +52,7 @@ inkscape:deskcolor="#d1d1d1" showguides="false" inkscape:clip-to-page="false" - inkscape:export-bgcolor="#ffffff00">mosdepth, samtoolsmosdepth, samtoolsmosdepth, samtoolsngscheckmatengscheckmate ``` @@ -638,14 +638,14 @@ rm *chrstring* rm 1kg.phase3.v5a_GRCh38nounref_loci_chr23.txt for i in {1..22} X do - awk '{ print $1 "\t" $2-1 "\t" $2 }' 1kg.phase3.v5a_GRCh38nounref_loci_chr${i}.txt > chr${i}.bed - grep "^${i}_" GC_G1000_on_target_hg38.txt | awk '{ print "chr" $1 }' > chr${i}.txt - bedtools intersect -a chr${i}.bed -b targets_with_chr.bed | awk '{ print $1 "_" $3 }' > chr${i}_on_target.txt - n=`wc -l chr${i}_on_target.txt | awk '{ print $1 }'` - count=$((n * 3 / 10)) - grep -xf chr${i}.txt chr${i}_on_target.txt > chr${i}.temp - shuf -n $count chr${i}_on_target.txt >> chr${i}.temp - sort -n -k2 -t '_' chr${i}.temp | uniq | awk 'BEGIN { FS="_" } ; { print $1 "\t" $2 }' > battenberg_loci_on_target_hg38_chr${i}.txt + awk '{ print $1 "\t" $2-1 "\t" $2 }' 1kg.phase3.v5a_GRCh38nounref_loci_chr${i}.txt > chr${i}.bed + grep "^${i}_" GC_G1000_on_target_hg38.txt | awk '{ print "chr" $1 }' > chr${i}.txt + bedtools intersect -a chr${i}.bed -b targets_with_chr.bed | awk '{ print $1 "_" $3 }' > chr${i}_on_target.txt + n=`wc -l chr${i}_on_target.txt | awk '{ print $1 }'` + count=$((n * 3 / 10)) + grep -xf chr${i}.txt chr${i}_on_target.txt > chr${i}.temp + shuf -n $count chr${i}_on_target.txt >> chr${i}.temp + sort -n -k2 -t '_' chr${i}.temp | uniq | awk 'BEGIN { FS="_" } ; { print $1 "\t" $2 }' > battenberg_loci_on_target_hg38_chr${i}.txt done zip battenberg_loci_on_target_hg38.zip battenberg_loci_on_target_hg38_chr*.txt ``` @@ -769,10 +769,6 @@ Re-start your session. Note that the way to increase the open file limit in your system may be slightly different or require additional steps. -### Cannot delete work folder when using docker + Spark - -Currently, when running spark-based tools in combination with docker, it is required to set `docker.userEmulation = false`. This can unfortunately causes permission issues when `work/` is being written with root permissions. In case this happens, you might need to configure docker to run without `userEmulation` (see [here](https://github.com/Midnighter/nf-core-adr/blob/main/docs/adr/0008-refrain-from-using-docker-useremulation-in-nextflow.md)). - ## How to handle UMIs Sarek can process UMI-reads, using [fgbio](http://fulcrumgenomics.github.io/fgbio/tools/latest/) tools. diff --git a/lib/NfcoreTemplate.groovy b/lib/NfcoreTemplate.groovy deleted file mode 100755 index 755ee64d44..0000000000 --- a/lib/NfcoreTemplate.groovy +++ /dev/null @@ -1,364 +0,0 @@ -// -// This file holds several functions used within the nf-core pipeline template. -// - -import org.yaml.snakeyaml.Yaml -import groovy.json.JsonOutput -import nextflow.extension.FilesEx - -class NfcoreTemplate { - - // - // Check AWS Batch related parameters have been specified correctly - // - public static void awsBatch(workflow, params) { - if (workflow.profile.contains('awsbatch')) { - // Check params.awsqueue and params.awsregion have been set if running on AWSBatch - assert (params.awsqueue && params.awsregion) : "Specify correct --awsqueue and --awsregion parameters on AWSBatch!" - // Check outdir paths to be S3 buckets if running on AWSBatch - assert params.outdir.startsWith('s3:') : "Outdir not on S3 - specify S3 Bucket to run on AWSBatch!" - } - } - - // - // Warn if a -profile or Nextflow config has not been provided to run the pipeline - // - public static void checkConfigProvided(workflow, log) { - if (workflow.profile == 'standard' && workflow.configFiles.size() <= 1) { - log.warn "[$workflow.manifest.name] You are attempting to run the pipeline without any custom configuration!\n\n" + - "This will be dependent on your local compute environment but can be achieved via one or more of the following:\n" + - " (1) Using an existing pipeline profile e.g. `-profile docker` or `-profile singularity`\n" + - " (2) Using an existing nf-core/configs for your Institution e.g. `-profile crick` or `-profile uppmax`\n" + - " (3) Using your own local custom config e.g. `-c /path/to/your/custom.config`\n\n" + - "Please refer to the quick start section and usage docs for the pipeline.\n " - } - } - - // - // Generate version string - // - public static String version(workflow) { - String version_string = "" - - if (workflow.manifest.version) { - def prefix_v = workflow.manifest.version[0] != 'v' ? 'v' : '' - version_string += "${prefix_v}${workflow.manifest.version}" - } - - if (workflow.commitId) { - def git_shortsha = workflow.commitId.substring(0, 7) - version_string += "-g${git_shortsha}" - } - - return version_string - } - - // - // Construct and send completion email - // - public static void email(workflow, params, summary_params, projectDir, log, multiqc_report=[]) { - - // Set up the e-mail variables - def subject = "[$workflow.manifest.name] Successful: $workflow.runName" - if (!workflow.success) { - subject = "[$workflow.manifest.name] FAILED: $workflow.runName" - } - - def summary = [:] - for (group in summary_params.keySet()) { - summary << summary_params[group] - } - - def misc_fields = [:] - misc_fields['Date Started'] = workflow.start - misc_fields['Date Completed'] = workflow.complete - misc_fields['Pipeline script file path'] = workflow.scriptFile - misc_fields['Pipeline script hash ID'] = workflow.scriptId - if (workflow.repository) misc_fields['Pipeline repository Git URL'] = workflow.repository - if (workflow.commitId) misc_fields['Pipeline repository Git Commit'] = workflow.commitId - if (workflow.revision) misc_fields['Pipeline Git branch/tag'] = workflow.revision - misc_fields['Nextflow Version'] = workflow.nextflow.version - misc_fields['Nextflow Build'] = workflow.nextflow.build - misc_fields['Nextflow Compile Timestamp'] = workflow.nextflow.timestamp - - def email_fields = [:] - email_fields['version'] = NfcoreTemplate.version(workflow) - email_fields['runName'] = workflow.runName - email_fields['success'] = workflow.success - email_fields['dateComplete'] = workflow.complete - email_fields['duration'] = workflow.duration - email_fields['exitStatus'] = workflow.exitStatus - email_fields['errorMessage'] = (workflow.errorMessage ?: 'None') - email_fields['errorReport'] = (workflow.errorReport ?: 'None') - email_fields['commandLine'] = workflow.commandLine - email_fields['projectDir'] = workflow.projectDir - email_fields['summary'] = summary << misc_fields - - // On success try attach the multiqc report - def mqc_report = null - try { - if (workflow.success) { - mqc_report = multiqc_report.getVal() - if (mqc_report.getClass() == ArrayList && mqc_report.size() >= 1) { - if (mqc_report.size() > 1) { - log.warn "[$workflow.manifest.name] Found multiple reports from process 'MULTIQC', will use only one" - } - mqc_report = mqc_report[0] - } - } - } catch (all) { - if (multiqc_report) { - log.warn "[$workflow.manifest.name] Could not attach MultiQC report to summary email" - } - } - - // Check if we are only sending emails on failure - def email_address = params.email - if (!params.email && params.email_on_fail && !workflow.success) { - email_address = params.email_on_fail - } - - // Render the TXT template - def engine = new groovy.text.GStringTemplateEngine() - def tf = new File("$projectDir/assets/email_template.txt") - def txt_template = engine.createTemplate(tf).make(email_fields) - def email_txt = txt_template.toString() - - // Render the HTML template - def hf = new File("$projectDir/assets/email_template.html") - def html_template = engine.createTemplate(hf).make(email_fields) - def email_html = html_template.toString() - - // Render the sendmail template - def max_multiqc_email_size = (params.containsKey('max_multiqc_email_size') ? params.max_multiqc_email_size : 0) as nextflow.util.MemoryUnit - def smail_fields = [ email: email_address, subject: subject, email_txt: email_txt, email_html: email_html, projectDir: "$projectDir", mqcFile: mqc_report, mqcMaxSize: max_multiqc_email_size.toBytes() ] - def sf = new File("$projectDir/assets/sendmail_template.txt") - def sendmail_template = engine.createTemplate(sf).make(smail_fields) - def sendmail_html = sendmail_template.toString() - - // Send the HTML e-mail - Map colors = logColours(params.monochrome_logs) - if (email_address) { - try { - if (params.plaintext_email) { throw GroovyException('Send plaintext e-mail, not HTML') } - // Try to send HTML e-mail using sendmail - def sendmail_tf = new File(workflow.launchDir.toString(), ".sendmail_tmp.html") - sendmail_tf.withWriter { w -> w << sendmail_html } - [ 'sendmail', '-t' ].execute() << sendmail_html - log.info "-${colors.purple}[$workflow.manifest.name]${colors.green} Sent summary e-mail to $email_address (sendmail)-" - } catch (all) { - // Catch failures and try with plaintext - def mail_cmd = [ 'mail', '-s', subject, '--content-type=text/html', email_address ] - if ( mqc_report != null && mqc_report.size() <= max_multiqc_email_size.toBytes() ) { - mail_cmd += [ '-A', mqc_report ] - } - mail_cmd.execute() << email_html - log.info "-${colors.purple}[$workflow.manifest.name]${colors.green} Sent summary e-mail to $email_address (mail)-" - } - } - - // Write summary e-mail HTML to a file - def output_hf = new File(workflow.launchDir.toString(), ".pipeline_report.html") - output_hf.withWriter { w -> w << email_html } - FilesEx.copyTo(output_hf.toPath(), "${params.outdir}/pipeline_info/pipeline_report.html"); - output_hf.delete() - - // Write summary e-mail TXT to a file - def output_tf = new File(workflow.launchDir.toString(), ".pipeline_report.txt") - output_tf.withWriter { w -> w << email_txt } - FilesEx.copyTo(output_tf.toPath(), "${params.outdir}/pipeline_info/pipeline_report.txt"); - output_tf.delete() - } - - // - // Construct and send a notification to a web server as JSON - // e.g. Microsoft Teams and Slack - // - public static void IM_notification(workflow, params, summary_params, projectDir, log) { - def hook_url = params.hook_url - - def summary = [:] - for (group in summary_params.keySet()) { - summary << summary_params[group] - } - - def misc_fields = [:] - misc_fields['start'] = workflow.start - misc_fields['complete'] = workflow.complete - misc_fields['scriptfile'] = workflow.scriptFile - misc_fields['scriptid'] = workflow.scriptId - if (workflow.repository) misc_fields['repository'] = workflow.repository - if (workflow.commitId) misc_fields['commitid'] = workflow.commitId - if (workflow.revision) misc_fields['revision'] = workflow.revision - misc_fields['nxf_version'] = workflow.nextflow.version - misc_fields['nxf_build'] = workflow.nextflow.build - misc_fields['nxf_timestamp'] = workflow.nextflow.timestamp - - def msg_fields = [:] - msg_fields['version'] = NfcoreTemplate.version(workflow) - msg_fields['runName'] = workflow.runName - msg_fields['success'] = workflow.success - msg_fields['dateComplete'] = workflow.complete - msg_fields['duration'] = workflow.duration - msg_fields['exitStatus'] = workflow.exitStatus - msg_fields['errorMessage'] = (workflow.errorMessage ?: 'None') - msg_fields['errorReport'] = (workflow.errorReport ?: 'None') - msg_fields['commandLine'] = workflow.commandLine.replaceFirst(/ +--hook_url +[^ ]+/, "") - msg_fields['projectDir'] = workflow.projectDir - msg_fields['summary'] = summary << misc_fields - - // Render the JSON template - def engine = new groovy.text.GStringTemplateEngine() - // Different JSON depending on the service provider - // Defaults to "Adaptive Cards" (https://adaptivecards.io), except Slack which has its own format - def json_path = hook_url.contains("hooks.slack.com") ? "slackreport.json" : "adaptivecard.json" - def hf = new File("$projectDir/assets/${json_path}") - def json_template = engine.createTemplate(hf).make(msg_fields) - def json_message = json_template.toString() - - // POST - def post = new URL(hook_url).openConnection(); - post.setRequestMethod("POST") - post.setDoOutput(true) - post.setRequestProperty("Content-Type", "application/json") - post.getOutputStream().write(json_message.getBytes("UTF-8")); - def postRC = post.getResponseCode(); - if (! postRC.equals(200)) { - log.warn(post.getErrorStream().getText()); - } - } - - // - // Dump pipeline parameters in a json file - // - public static void dump_parameters(workflow, params) { - def timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss') - def filename = "params_${timestamp}.json" - def temp_pf = new File(workflow.launchDir.toString(), ".${filename}") - def jsonStr = JsonOutput.toJson(params) - temp_pf.text = JsonOutput.prettyPrint(jsonStr) - - FilesEx.copyTo(temp_pf.toPath(), "${params.outdir}/pipeline_info/params_${timestamp}.json") - temp_pf.delete() - } - - - // - // Print pipeline summary on completion - // - public static void summary(workflow, params, log) { - Map colors = logColours(params.monochrome_logs) - if (workflow.success) { - if (workflow.stats.ignoredCount == 0) { - log.info "-${colors.purple}[$workflow.manifest.name]${colors.green} Pipeline completed successfully${colors.reset}-" - } else { - log.info "-${colors.purple}[$workflow.manifest.name]${colors.yellow} Pipeline completed successfully, but with errored process(es) ${colors.reset}-" - } - } else { - log.info "-${colors.purple}[$workflow.manifest.name]${colors.red} Pipeline completed with errors${colors.reset}-" - } - } - - // - // ANSII Colours used for terminal logging - // - public static Map logColours(Boolean monochrome_logs) { - Map colorcodes = [:] - - // Reset / Meta - colorcodes['reset'] = monochrome_logs ? '' : "\033[0m" - colorcodes['bold'] = monochrome_logs ? '' : "\033[1m" - colorcodes['dim'] = monochrome_logs ? '' : "\033[2m" - colorcodes['underlined'] = monochrome_logs ? '' : "\033[4m" - colorcodes['blink'] = monochrome_logs ? '' : "\033[5m" - colorcodes['reverse'] = monochrome_logs ? '' : "\033[7m" - colorcodes['hidden'] = monochrome_logs ? '' : "\033[8m" - - // Regular Colors - colorcodes['black'] = monochrome_logs ? '' : "\033[0;30m" - colorcodes['red'] = monochrome_logs ? '' : "\033[0;31m" - colorcodes['green'] = monochrome_logs ? '' : "\033[0;32m" - colorcodes['yellow'] = monochrome_logs ? '' : "\033[0;33m" - colorcodes['blue'] = monochrome_logs ? '' : "\033[0;34m" - colorcodes['purple'] = monochrome_logs ? '' : "\033[0;35m" - colorcodes['cyan'] = monochrome_logs ? '' : "\033[0;36m" - colorcodes['white'] = monochrome_logs ? '' : "\033[0;37m" - - // Bold - colorcodes['bblack'] = monochrome_logs ? '' : "\033[1;30m" - colorcodes['bred'] = monochrome_logs ? '' : "\033[1;31m" - colorcodes['bgreen'] = monochrome_logs ? '' : "\033[1;32m" - colorcodes['byellow'] = monochrome_logs ? '' : "\033[1;33m" - colorcodes['bblue'] = monochrome_logs ? '' : "\033[1;34m" - colorcodes['bpurple'] = monochrome_logs ? '' : "\033[1;35m" - colorcodes['bcyan'] = monochrome_logs ? '' : "\033[1;36m" - colorcodes['bwhite'] = monochrome_logs ? '' : "\033[1;37m" - - // Underline - colorcodes['ublack'] = monochrome_logs ? '' : "\033[4;30m" - colorcodes['ured'] = monochrome_logs ? '' : "\033[4;31m" - colorcodes['ugreen'] = monochrome_logs ? '' : "\033[4;32m" - colorcodes['uyellow'] = monochrome_logs ? '' : "\033[4;33m" - colorcodes['ublue'] = monochrome_logs ? '' : "\033[4;34m" - colorcodes['upurple'] = monochrome_logs ? '' : "\033[4;35m" - colorcodes['ucyan'] = monochrome_logs ? '' : "\033[4;36m" - colorcodes['uwhite'] = monochrome_logs ? '' : "\033[4;37m" - - // High Intensity - colorcodes['iblack'] = monochrome_logs ? '' : "\033[0;90m" - colorcodes['ired'] = monochrome_logs ? '' : "\033[0;91m" - colorcodes['igreen'] = monochrome_logs ? '' : "\033[0;92m" - colorcodes['iyellow'] = monochrome_logs ? '' : "\033[0;93m" - colorcodes['iblue'] = monochrome_logs ? '' : "\033[0;94m" - colorcodes['ipurple'] = monochrome_logs ? '' : "\033[0;95m" - colorcodes['icyan'] = monochrome_logs ? '' : "\033[0;96m" - colorcodes['iwhite'] = monochrome_logs ? '' : "\033[0;97m" - - // Bold High Intensity - colorcodes['biblack'] = monochrome_logs ? '' : "\033[1;90m" - colorcodes['bired'] = monochrome_logs ? '' : "\033[1;91m" - colorcodes['bigreen'] = monochrome_logs ? '' : "\033[1;92m" - colorcodes['biyellow'] = monochrome_logs ? '' : "\033[1;93m" - colorcodes['biblue'] = monochrome_logs ? '' : "\033[1;94m" - colorcodes['bipurple'] = monochrome_logs ? '' : "\033[1;95m" - colorcodes['bicyan'] = monochrome_logs ? '' : "\033[1;96m" - colorcodes['biwhite'] = monochrome_logs ? '' : "\033[1;97m" - - return colorcodes - } - - // - // Does what is says on the tin - // - public static String dashedLine(monochrome_logs) { - Map colors = logColours(monochrome_logs) - return "-${colors.dim}----------------------------------------------------${colors.reset}-" - } - - // - // nf-core logo - // - public static String logo(workflow, monochrome_logs) { - Map colors = logColours(monochrome_logs) - String workflow_version = NfcoreTemplate.version(workflow) - String.format( - """\n - ${dashedLine(monochrome_logs)} - ${colors.green},--.${colors.black}/${colors.green},-.${colors.reset} - ${colors.blue} ___ __ __ __ ___ ${colors.green}/,-._.--~\'${colors.reset} - ${colors.blue} |\\ | |__ __ / ` / \\ |__) |__ ${colors.yellow}} {${colors.reset} - ${colors.blue} | \\| | \\__, \\__/ | \\ |___ ${colors.green}\\`-._,-`-,${colors.reset} - ${colors.green}`._,._,\'${colors.reset} - ${colors.white} ____${colors.reset} - ${colors.white} .´ _ `.${colors.reset} - ${colors.white} / ${colors.green}|\\${colors.reset}`-_ \\${colors.reset} ${colors.blue} __ __ ___ ${colors.reset} - ${colors.white} | ${colors.green}| \\${colors.reset} `-|${colors.reset} ${colors.blue}|__` /\\ |__) |__ |__/${colors.reset} - ${colors.white} \\ ${colors.green}| \\${colors.reset} /${colors.reset} ${colors.blue}.__| /¯¯\\ | \\ |___ | \\${colors.reset} - ${colors.white} `${colors.green}|${colors.reset}____${colors.green}\\${colors.reset}´${colors.reset} - - ${colors.purple} ${workflow.manifest.name} ${workflow_version}${colors.reset} - ${dashedLine(monochrome_logs)} - """.stripIndent() - ) - } -} diff --git a/lib/Utils.groovy b/lib/Utils.groovy deleted file mode 100644 index 8d030f4e84..0000000000 --- a/lib/Utils.groovy +++ /dev/null @@ -1,47 +0,0 @@ -// -// This file holds several Groovy functions that could be useful for any Nextflow pipeline -// - -import org.yaml.snakeyaml.Yaml - -class Utils { - - // - // When running with -profile conda, warn if channels have not been set-up appropriately - // - public static void checkCondaChannels(log) { - Yaml parser = new Yaml() - def channels = [] - try { - def config = parser.load("conda config --show channels".execute().text) - channels = config.channels - } catch(NullPointerException | IOException e) { - log.warn "Could not verify conda channel configuration." - return - } - - // Check that all channels are present - // This channel list is ordered by required channel priority. - def required_channels_in_order = ['conda-forge', 'bioconda', 'defaults'] - def channels_missing = ((required_channels_in_order as Set) - (channels as Set)) as Boolean - - // Check that they are in the right order - def channel_priority_violation = false - def n = required_channels_in_order.size() - for (int i = 0; i < n - 1; i++) { - channel_priority_violation |= !(channels.indexOf(required_channels_in_order[i]) < channels.indexOf(required_channels_in_order[i+1])) - } - - if (channels_missing | channel_priority_violation) { - log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + - " There is a problem with your Conda configuration!\n\n" + - " You will need to set-up the conda-forge and bioconda channels correctly.\n" + - " Please refer to https://bioconda.github.io/\n" + - " The observed channel order is \n" + - " ${channels}\n" + - " but the following channel order is required:\n" + - " ${required_channels_in_order}\n" + - "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - } - } -} diff --git a/lib/WorkflowMain.groovy b/lib/WorkflowMain.groovy deleted file mode 100755 index bd412e58c8..0000000000 --- a/lib/WorkflowMain.groovy +++ /dev/null @@ -1,62 +0,0 @@ -// -// This file holds several functions specific to the main.nf workflow in the nf-core/sarek pipeline -// - -import nextflow.Nextflow - -class WorkflowMain { - - // - // Citation string for pipeline - // - public static String citation(workflow) { - return "If you use ${workflow.manifest.name} for your analysis please cite:\n\n" + - "* The pipeline\n" + - " https://doi.org/10.12688/f1000research.16665.2\n" + - " https://doi.org/10.5281/zenodo.3476425\n\n" + - "* The nf-core framework\n" + - " https://doi.org/10.1038/s41587-020-0439-x\n\n" + - "* Software dependencies\n" + - " https://github.com/${workflow.manifest.name}/blob/master/CITATIONS.md" - } - - // - // Validate parameters and print summary to screen - // - public static void initialise(workflow, params, log) { - - // Print workflow version and exit on --version - if (params.version) { - String workflow_version = NfcoreTemplate.version(workflow) - log.info "${workflow.manifest.name} ${workflow_version}" - System.exit(0) - } - - // Check that a -profile or Nextflow config has been provided to run the pipeline - NfcoreTemplate.checkConfigProvided(workflow, log) - - // Check that conda channels are set-up correctly - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - Utils.checkCondaChannels(log) - } - - // Check AWS batch settings - NfcoreTemplate.awsBatch(workflow, params) - - // Warn that no input was provided - if (!params.input && !params.build_only_index) { - log.warn "No samplesheet specified, attempting to restart from csv files present in ${params.outdir}" - } - } - // - // Get attribute from genome config file e.g. fasta - // - public static Object getGenomeAttribute(params, attribute) { - if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) { - if (params.genomes[ params.genome ].containsKey(attribute)) { - return params.genomes[ params.genome ][ attribute ] - } - } - return null - } -} diff --git a/lib/WorkflowSarek.groovy b/lib/WorkflowSarek.groovy deleted file mode 100755 index 12f001c251..0000000000 --- a/lib/WorkflowSarek.groovy +++ /dev/null @@ -1,149 +0,0 @@ -// -// This file holds several functions specific to the workflow/sarek.nf in the nf-core/sarek pipeline -// - -import nextflow.Nextflow -import groovy.text.SimpleTemplateEngine - -class WorkflowSarek { - - // - // Check and validate parameters - // - public static void initialise(params, log) { - - genomeExistsError(params, log) - - if (!params.fasta && params.step == 'annotate') { - Nextflow.error "Genome fasta file not specified with e.g. '--fasta genome.fa' or via a detectable config file." - } - } - - // - // Get workflow summary for MultiQC - // - public static String paramsSummaryMultiqc(workflow, summary) { - String summary_section = '' - for (group in summary.keySet()) { - def group_params = summary.get(group) // This gets the parameters of that particular group - if (group_params) { - summary_section += "

$group

\n" - summary_section += "
\n" - for (param in group_params.keySet()) { - summary_section += "
$param
${group_params.get(param) ?: 'N/A'}
\n" - } - summary_section += "
\n" - } - } - - String yaml_file_text = "id: '${workflow.manifest.name.replace('/','-')}-summary'\n" - yaml_file_text += "description: ' - this information is collected when the pipeline is started.'\n" - yaml_file_text += "section_name: '${workflow.manifest.name} Workflow Summary'\n" - yaml_file_text += "section_href: 'https://github.com/${workflow.manifest.name}'\n" - yaml_file_text += "plot_type: 'html'\n" - yaml_file_text += "data: |\n" - yaml_file_text += "${summary_section}" - return yaml_file_text - } - - // - // Generate methods description for MultiQC - // - - public static String toolCitationText(params) { - - // TODO nf-core: Optionally add in-text citation tools to this list. - // Can use ternary operators to dynamically construct based conditions, e.g. params["run_xyz"] ? "Tool (Foo et al. 2023)" : "", - // Uncomment function in methodsDescriptionText to render in MultiQC report - def citation_text = [ - "Tools used in the workflow included:", - "FastQC (Andrews 2010),", - "MultiQC (Ewels et al. 2016)", - "." - ].join(' ').trim() - - return citation_text - } - - public static String toolBibliographyText(params) { - - // TODO Optionally add bibliographic entries to this list. - // Can use ternary operators to dynamically construct based conditions, e.g. params["run_xyz"] ? "
  • Author (2023) Pub name, Journal, DOI
  • " : "", - // Uncomment function in methodsDescriptionText to render in MultiQC report - def reference_text = [ - "
  • Andrews S, (2010) FastQC, URL: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/).
  • ", - "
  • Ewels, P., Magnusson, M., Lundin, S., & Käller, M. (2016). MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics , 32(19), 3047–3048. doi: /10.1093/bioinformatics/btw354
  • " - ].join(' ').trim() - - return reference_text - } - - public static String methodsDescriptionText(run_workflow, mqc_methods_yaml, params) { - // Convert to a named map so can be used as with familar NXF ${workflow} variable syntax in the MultiQC YML file - def meta = [:] - meta.workflow = run_workflow.toMap() - meta["manifest_map"] = run_workflow.manifest.toMap() - - // Pipeline DOI - meta["doi_text"] = meta.manifest_map.doi ? "(doi: ${meta.manifest_map.doi})" : "" - meta["nodoi_text"] = meta.manifest_map.doi ? "": "
  • If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used.
  • " - - // Tool references - meta["tool_citations"] = "" - meta["tool_bibliography"] = "" - - // TODO Only uncomment below if logic in toolCitationText/toolBibliographyText has been filled! - //meta["tool_citations"] = toolCitationText(params).replaceAll(", \\.", ".").replaceAll("\\. \\.", ".").replaceAll(", \\.", ".") - //meta["tool_bibliography"] = toolBibliographyText(params) - - def methods_text = mqc_methods_yaml.text - - def engine = new SimpleTemplateEngine() - def description_html = engine.createTemplate(methods_text).make(meta) - - return description_html - } - - // - // Exit pipeline if incorrect --genome key provided - // - private static void genomeExistsError(params, log) { - if (params.genomes && params.genome && !params.genomes.containsKey(params.genome)) { - def error_string = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + - " Genome '${params.genome}' not found in any config files provided to the pipeline.\n" + - " Currently, the available genome keys are:\n" + - " ${params.genomes.keySet().join(", ")}\n" + - "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - Nextflow.error(error_string) - } - } - - public static String retrieveInput(params, log){ - def input = null - if (!params.input && !params.build_only_index) { - switch (params.step) { - case 'mapping': Nextflow.error("Can't start with step $params.step without samplesheet") - break - case 'markduplicates': log.warn("Using file ${params.outdir}/csv/mapped.csv"); - input = params.outdir + "/csv/mapped.csv" - break - case 'prepare_recalibration': log.warn("Using file ${params.outdir}/csv/markduplicates_no_table.csv"); - input = params.outdir + "/csv/markduplicates_no_table.csv" - break - case 'recalibrate': log.warn("Using file ${params.outdir}/csv/markduplicates.csv"); - input = params.outdir + "/csv/markduplicates.csv" - break - case 'variant_calling': log.warn("Using file ${params.outdir}/csv/recalibrated.csv"); - input = params.outdir + "/csv/recalibrated.csv" - break - // case 'controlfreec': csv_file = file("${params.outdir}/variant_calling/csv/control-freec_mpileup.csv", checkIfExists: true); break - case 'annotate': log.warn("Using file ${params.outdir}/csv/variantcalled.csv"); - input = params.outdir + "/csv/variantcalled.csv" - break - default: log.warn("Please provide an input samplesheet to the pipeline e.g. '--input samplesheet.csv'") - Nextflow.error("Unknown step $params.step") - } - } - return input - } -} diff --git a/lib/nfcore_external_java_deps.jar b/lib/nfcore_external_java_deps.jar deleted file mode 100644 index 805c8bb5e4..0000000000 Binary files a/lib/nfcore_external_java_deps.jar and /dev/null differ diff --git a/main.nf b/main.nf old mode 100644 new mode 100755 index 101db87a36..8b7940a558 --- a/main.nf +++ b/main.nf @@ -20,103 +20,357 @@ */ nextflow.enable.dsl = 2 - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GENOME PARAMETER VALUES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -params.ascat_alleles = WorkflowMain.getGenomeAttribute(params, 'ascat_alleles') -params.ascat_genome = WorkflowMain.getGenomeAttribute(params, 'ascat_genome') -params.ascat_loci = WorkflowMain.getGenomeAttribute(params, 'ascat_loci') -params.ascat_loci_gc = WorkflowMain.getGenomeAttribute(params, 'ascat_loci_gc') -params.ascat_loci_rt = WorkflowMain.getGenomeAttribute(params, 'ascat_loci_rt') -params.bwa = WorkflowMain.getGenomeAttribute(params, 'bwa') -params.bwamem2 = WorkflowMain.getGenomeAttribute(params, 'bwamem2') -params.cf_chrom_len = WorkflowMain.getGenomeAttribute(params, 'cf_chrom_len') -params.chr_dir = WorkflowMain.getGenomeAttribute(params, 'chr_dir') -params.dbsnp = WorkflowMain.getGenomeAttribute(params, 'dbsnp') -params.dbsnp_tbi = WorkflowMain.getGenomeAttribute(params, 'dbsnp_tbi') -params.dbsnp_vqsr = WorkflowMain.getGenomeAttribute(params, 'dbsnp_vqsr') -params.dict = WorkflowMain.getGenomeAttribute(params, 'dict') -params.dragmap = WorkflowMain.getGenomeAttribute(params, 'dragmap') -params.fasta = WorkflowMain.getGenomeAttribute(params, 'fasta') -params.fasta_fai = WorkflowMain.getGenomeAttribute(params, 'fasta_fai') -params.germline_resource = WorkflowMain.getGenomeAttribute(params, 'germline_resource') -params.germline_resource_tbi = WorkflowMain.getGenomeAttribute(params, 'germline_resource_tbi') -params.intervals = WorkflowMain.getGenomeAttribute(params, 'intervals') -params.known_indels = WorkflowMain.getGenomeAttribute(params, 'known_indels') -params.known_indels_tbi = WorkflowMain.getGenomeAttribute(params, 'known_indels_tbi') -params.known_indels_vqsr = WorkflowMain.getGenomeAttribute(params, 'known_indels_vqsr') -params.known_snps = WorkflowMain.getGenomeAttribute(params, 'known_snps') -params.known_snps_tbi = WorkflowMain.getGenomeAttribute(params, 'known_snps_tbi') -params.known_snps_vqsr = WorkflowMain.getGenomeAttribute(params, 'known_snps_vqsr') -params.mappability = WorkflowMain.getGenomeAttribute(params, 'mappability') -params.ngscheckmate_bed = WorkflowMain.getGenomeAttribute(params, 'ngscheckmate_bed') -params.pon = WorkflowMain.getGenomeAttribute(params, 'pon') -params.pon_tbi = WorkflowMain.getGenomeAttribute(params, 'pon_tbi') -params.sentieon_dnascope_model = WorkflowMain.getGenomeAttribute(params, 'sentieon_dnascope_model') -params.snpeff_db = WorkflowMain.getGenomeAttribute(params, 'snpeff_db') -params.snpeff_genome = WorkflowMain.getGenomeAttribute(params, 'snpeff_genome') -params.vep_cache_version = WorkflowMain.getGenomeAttribute(params, 'vep_cache_version') -params.vep_genome = WorkflowMain.getGenomeAttribute(params, 'vep_genome') -params.vep_species = WorkflowMain.getGenomeAttribute(params, 'vep_species') +params.ascat_alleles = getGenomeAttribute('ascat_alleles') +params.ascat_genome = getGenomeAttribute('ascat_genome') +params.ascat_loci = getGenomeAttribute('ascat_loci') +params.ascat_loci_gc = getGenomeAttribute('ascat_loci_gc') +params.ascat_loci_rt = getGenomeAttribute('ascat_loci_rt') +params.bwa = getGenomeAttribute('bwa') +params.bwamem2 = getGenomeAttribute('bwamem2') +params.cf_chrom_len = getGenomeAttribute('cf_chrom_len') +params.chr_dir = getGenomeAttribute('chr_dir') +params.dbsnp = getGenomeAttribute('dbsnp') +params.dbsnp_tbi = getGenomeAttribute('dbsnp_tbi') +params.dbsnp_vqsr = getGenomeAttribute('dbsnp_vqsr') +params.dict = getGenomeAttribute('dict') +params.dragmap = getGenomeAttribute('dragmap') +params.fasta = getGenomeAttribute('fasta') +params.fasta_fai = getGenomeAttribute('fasta_fai') +params.germline_resource = getGenomeAttribute('germline_resource') +params.germline_resource_tbi = getGenomeAttribute('germline_resource_tbi') +params.intervals = getGenomeAttribute('intervals') +params.known_indels = getGenomeAttribute('known_indels') +params.known_indels_tbi = getGenomeAttribute('known_indels_tbi') +params.known_indels_vqsr = getGenomeAttribute('known_indels_vqsr') +params.known_snps = getGenomeAttribute('known_snps') +params.known_snps_tbi = getGenomeAttribute('known_snps_tbi') +params.known_snps_vqsr = getGenomeAttribute('known_snps_vqsr') +params.mappability = getGenomeAttribute('mappability') +params.ngscheckmate_bed = getGenomeAttribute('ngscheckmate_bed') +params.pon = getGenomeAttribute('pon') +params.pon_tbi = getGenomeAttribute('pon_tbi') +params.sentieon_dnascope_model = getGenomeAttribute('sentieon_dnascope_model') +params.snpeff_db = getGenomeAttribute('snpeff_db') +params.snpeff_genome = getGenomeAttribute('snpeff_genome') +params.vep_cache_version = getGenomeAttribute('vep_cache_version') +params.vep_genome = getGenomeAttribute('vep_genome') +params.vep_species = getGenomeAttribute('vep_species') + +aligner = params.aligner /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ALTERNATIVE INPUT FILE ON RESTART + IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -params.input_restart = WorkflowSarek.retrieveInput(params, log) +include { SAREK } from './workflows/sarek' +include { ANNOTATION_CACHE_INITIALISATION } from './subworkflows/local/annotation_cache_initialisation' +include { DOWNLOAD_CACHE_SNPEFF_VEP } from './subworkflows/local/download_cache_snpeff_vep' +include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_sarek_pipeline' +include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_sarek_pipeline' +include { PREPARE_GENOME } from './subworkflows/local/prepare_genome' +include { PREPARE_INTERVALS } from './subworkflows/local/prepare_intervals' +include { PREPARE_REFERENCE_CNVKIT } from './subworkflows/local/prepare_reference_cnvkit' + +// Initialize fasta file with meta map: +fasta = params.fasta ? Channel.fromPath(params.fasta).map{ it -> [ [id:it.baseName], it ] }.collect() : Channel.empty() + +// Initialize file channels based on params, defined in the params.genomes[params.genome] scope +bcftools_annotations = params.bcftools_annotations ? Channel.fromPath(params.bcftools_annotations).collect() : Channel.empty() +bcftools_header_lines = params.bcftools_header_lines ? Channel.fromPath(params.bcftools_header_lines).collect() : Channel.empty() +cf_chrom_len = params.cf_chrom_len ? Channel.fromPath(params.cf_chrom_len).collect() : [] +dbsnp = params.dbsnp ? Channel.fromPath(params.dbsnp).collect() : Channel.value([]) +fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).collect() : Channel.empty() +germline_resource = params.germline_resource ? Channel.fromPath(params.germline_resource).collect() : Channel.value([]) // Mutect2 does not require a germline resource, so set to optional input +known_indels = params.known_indels ? Channel.fromPath(params.known_indels).collect() : Channel.value([]) +known_snps = params.known_snps ? Channel.fromPath(params.known_snps).collect() : Channel.value([]) +mappability = params.mappability ? Channel.fromPath(params.mappability).collect() : Channel.value([]) +pon = params.pon ? Channel.fromPath(params.pon).collect() : Channel.value([]) // PON is optional for Mutect2 (but highly recommended) +sentieon_dnascope_model = params.sentieon_dnascope_model ? Channel.fromPath(params.sentieon_dnascope_model).collect() : Channel.value([]) + +// Initialize value channels based on params, defined in the params.genomes[params.genome] scope +ascat_genome = params.ascat_genome ?: Channel.empty() +dbsnp_vqsr = params.dbsnp_vqsr ? Channel.value(params.dbsnp_vqsr) : Channel.empty() +known_indels_vqsr = params.known_indels_vqsr ? Channel.value(params.known_indels_vqsr) : Channel.empty() +known_snps_vqsr = params.known_snps_vqsr ? Channel.value(params.known_snps_vqsr) : Channel.empty() +ngscheckmate_bed = params.ngscheckmate_bed ? Channel.value(params.ngscheckmate_bed) : Channel.empty() +snpeff_db = params.snpeff_db ?: Channel.empty() +vep_cache_version = params.vep_cache_version ?: Channel.empty() +vep_genome = params.vep_genome ?: Channel.empty() +vep_species = params.vep_species ?: Channel.empty() + +vep_extra_files = [] + +if (params.dbnsfp && params.dbnsfp_tbi) { + vep_extra_files.add(file(params.dbnsfp, checkIfExists: true)) + vep_extra_files.add(file(params.dbnsfp_tbi, checkIfExists: true)) +} + +if (params.spliceai_snv && params.spliceai_snv_tbi && params.spliceai_indel && params.spliceai_indel_tbi) { + vep_extra_files.add(file(params.spliceai_indel, checkIfExists: true)) + vep_extra_files.add(file(params.spliceai_indel_tbi, checkIfExists: true)) + vep_extra_files.add(file(params.spliceai_snv, checkIfExists: true)) + vep_extra_files.add(file(params.spliceai_snv_tbi, checkIfExists: true)) +} /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - VALIDATE & PRINT PARAMETER SUMMARY + NAMED WORKFLOW FOR PIPELINE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -include { validateParameters; paramsHelp } from 'plugin/nf-validation' +// WORKFLOW: Run main nf-core/sarek analysis pipeline +workflow NFCORE_SAREK { + take: + samplesheet -// Print help message if needed -if (params.help) { - def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs) - def citation = '\n' + WorkflowMain.citation(workflow) + '\n' - def String command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --genome GATK.GRCh38 -profile docker --outdir results" - log.info logo + paramsHelp(command) + citation + NfcoreTemplate.dashedLine(params.monochrome_logs) - System.exit(0) -} + main: + versions = Channel.empty() -// Validate input parameters -if (params.validate_params) { - validateParameters() -} + // build indexes if needed + PREPARE_GENOME( + params.ascat_alleles, + params.ascat_loci, + params.ascat_loci_gc, + params.ascat_loci_rt, + bcftools_annotations, + params.chr_dir, + dbsnp, + fasta, + germline_resource, + known_indels, + known_snps, + pon) + + // Gather built indices or get them from the params + // Built from the fasta file: + dict = params.dict ? Channel.fromPath(params.dict).map{ it -> [ [id:'dict'], it ] }.collect() + : PREPARE_GENOME.out.dict + fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).map{ it -> [ [id:'fai'], it ] }.collect() + : PREPARE_GENOME.out.fasta_fai + bwa = params.bwa ? Channel.fromPath(params.bwa).map{ it -> [ [id:'bwa'], it ] }.collect() + : PREPARE_GENOME.out.bwa + bwamem2 = params.bwamem2 ? Channel.fromPath(params.bwamem2).map{ it -> [ [id:'bwamem2'], it ] }.collect() + : PREPARE_GENOME.out.bwamem2 + dragmap = params.dragmap ? Channel.fromPath(params.dragmap).map{ it -> [ [id:'dragmap'], it ] }.collect() + : PREPARE_GENOME.out.hashtable + + // Gather index for mapping given the chosen aligner + index_alignement = (aligner == "bwa-mem" || aligner == "sentieon-bwamem") ? bwa : + aligner == "bwa-mem2" ? bwamem2 : + dragmap + + // TODO: add a params for msisensorpro_scan + msisensorpro_scan = PREPARE_GENOME.out.msisensorpro_scan + + // For ASCAT, extracted from zip or tar.gz files + allele_files = PREPARE_GENOME.out.allele_files + chr_files = PREPARE_GENOME.out.chr_files + gc_file = PREPARE_GENOME.out.gc_file + loci_files = PREPARE_GENOME.out.loci_files + rt_file = PREPARE_GENOME.out.rt_file -WorkflowMain.initialise(workflow, params, log) + // Tabix indexed vcf files + bcftools_annotations_tbi = params.bcftools_annotations ? params.bcftools_annotations_tbi ? Channel.fromPath(params.bcftools_annotations_tbi) : PREPARE_GENOME.out.bcftools_annotations_tbi : Channel.empty([]) + dbsnp_tbi = params.dbsnp ? params.dbsnp_tbi ? Channel.fromPath(params.dbsnp_tbi) : PREPARE_GENOME.out.dbsnp_tbi : Channel.value([]) + germline_resource_tbi = params.germline_resource ? params.germline_resource_tbi ? Channel.fromPath(params.germline_resource_tbi) : PREPARE_GENOME.out.germline_resource_tbi : [] //do not change to Channel.value([]), the check for its existence then fails for Getpileupsumamries + known_indels_tbi = params.known_indels ? params.known_indels_tbi ? Channel.fromPath(params.known_indels_tbi).collect() : PREPARE_GENOME.out.known_indels_tbi : Channel.value([]) + known_snps_tbi = params.known_snps ? params.known_snps_tbi ? Channel.fromPath(params.known_snps_tbi) : PREPARE_GENOME.out.known_snps_tbi : Channel.value([]) + pon_tbi = params.pon ? params.pon_tbi ? Channel.fromPath(params.pon_tbi) : PREPARE_GENOME.out.pon_tbi : Channel.value([]) + // known_sites is made by grouping both the dbsnp and the known snps/indels resources + // Which can either or both be optional + known_sites_indels = dbsnp.concat(known_indels).collect() + known_sites_indels_tbi = dbsnp_tbi.concat(known_indels_tbi).collect() + known_sites_snps = dbsnp.concat(known_snps).collect() + known_sites_snps_tbi = dbsnp_tbi.concat(known_snps_tbi).collect() + + // Build intervals if needed + PREPARE_INTERVALS(fasta_fai, params.intervals, params.no_intervals, params.nucleotides_per_second, params.outdir, params.step) + + // Intervals for speed up preprocessing/variant calling by spread/gather + // [interval.bed] all intervals in one file + intervals_bed_combined = params.no_intervals ? Channel.value([]) : PREPARE_INTERVALS.out.intervals_bed_combined + intervals_bed_gz_tbi_combined = params.no_intervals ? Channel.value([]) : PREPARE_INTERVALS.out.intervals_bed_gz_tbi_combined + intervals_bed_combined_for_variant_calling = PREPARE_INTERVALS.out.intervals_bed_combined + + // For QC during preprocessing, we don't need any intervals (MOSDEPTH doesn't take them for WGS) + intervals_for_preprocessing = params.wes ? + intervals_bed_combined.map{it -> [ [ id:it.baseName ], it ]}.collect() : + Channel.value([ [ id:'null' ], [] ]) + intervals = PREPARE_INTERVALS.out.intervals_bed // [ interval, num_intervals ] multiple interval.bed files, divided by useful intervals for scatter/gather + intervals_bed_gz_tbi = PREPARE_INTERVALS.out.intervals_bed_gz_tbi // [ interval_bed, tbi, num_intervals ] multiple interval.bed.gz/.tbi files, divided by useful intervals for scatter/gather + intervals_and_num_intervals = intervals.map{ interval, num_intervals -> + if ( num_intervals < 1 ) [ [], num_intervals ] + else [ interval, num_intervals ] + } + intervals_bed_gz_tbi_and_num_intervals = intervals_bed_gz_tbi.map{ intervals, num_intervals -> + if ( num_intervals < 1 ) [ [], [], num_intervals ] + else [ intervals[0], intervals[1], num_intervals ] + } + if (params.tools && params.tools.split(',').contains('cnvkit')) { + if (params.cnvkit_reference) { + cnvkit_reference = Channel.fromPath(params.cnvkit_reference).collect() + } else { + PREPARE_REFERENCE_CNVKIT(fasta, intervals_bed_combined) + cnvkit_reference = PREPARE_REFERENCE_CNVKIT.out.cnvkit_reference + versions = versions.mix(PREPARE_REFERENCE_CNVKIT.out.versions) + } + } else { + cnvkit_reference = Channel.value([]) + } + // Gather used softwares versions + versions = versions.mix(PREPARE_GENOME.out.versions) + versions = versions.mix(PREPARE_INTERVALS.out.versions) + + vep_fasta = (params.vep_include_fasta) ? fasta.map{ fasta -> [ [ id:fasta.baseName ], fasta ] } : [[id: 'null'], []] + + // Download cache + if (params.download_cache) { + // Assuming that even if the cache is provided, if the user specify download_cache, sarek will download the cache + ensemblvep_info = Channel.of([ [ id:"${params.vep_cache_version}_${params.vep_genome}" ], params.vep_genome, params.vep_species, params.vep_cache_version ]) + snpeff_info = Channel.of([ [ id:"${params.snpeff_genome}.${params.snpeff_db}" ], params.snpeff_genome, params.snpeff_db ]) + DOWNLOAD_CACHE_SNPEFF_VEP(ensemblvep_info, snpeff_info) + snpeff_cache = DOWNLOAD_CACHE_SNPEFF_VEP.out.snpeff_cache + vep_cache = DOWNLOAD_CACHE_SNPEFF_VEP.out.ensemblvep_cache.map{ meta, cache -> [ cache ] } + + versions = versions.mix(DOWNLOAD_CACHE_SNPEFF_VEP.out.versions) + } else { + // Looks for cache information either locally or on the cloud + ANNOTATION_CACHE_INITIALISATION( + (params.snpeff_cache && params.tools && (params.tools.split(',').contains("snpeff") || params.tools.split(',').contains('merge'))), + params.snpeff_cache, + params.snpeff_genome, + params.snpeff_db, + (params.vep_cache && params.tools && (params.tools.split(',').contains("vep") || params.tools.split(',').contains('merge'))), + params.vep_cache, + params.vep_species, + params.vep_cache_version, + params.vep_genome, + "Please refer to https://nf-co.re/sarek/docs/usage/#how-to-customise-snpeff-and-vep-annotation for more information.") + + snpeff_cache = ANNOTATION_CACHE_INITIALISATION.out.snpeff_cache + vep_cache = ANNOTATION_CACHE_INITIALISATION.out.ensemblvep_cache + } + + // + // WORKFLOW: Run pipeline + // + SAREK(samplesheet, + allele_files, + bcftools_annotations, + bcftools_annotations_tbi, + bcftools_header_lines, + cf_chrom_len, + chr_files, + cnvkit_reference, + dbsnp, + dbsnp_tbi, + dbsnp_vqsr, + dict, + fasta, + fasta_fai, + gc_file, + germline_resource, + germline_resource_tbi, + index_alignement, + intervals_and_num_intervals, + intervals_bed_combined, + intervals_bed_combined_for_variant_calling, + intervals_bed_gz_tbi_and_num_intervals, + intervals_bed_gz_tbi_combined, + intervals_for_preprocessing, + known_indels_vqsr, + known_sites_indels, + known_sites_indels_tbi, + known_sites_snps, + known_sites_snps_tbi, + known_snps_vqsr, + loci_files, + mappability, + msisensorpro_scan, + ngscheckmate_bed, + pon, + pon_tbi, + rt_file, + sentieon_dnascope_model, + snpeff_cache, + vep_cache, + vep_cache_version, + vep_extra_files, + vep_fasta, + vep_genome, + vep_species + ) + + emit: + multiqc_report = SAREK.out.multiqc_report // channel: /path/to/multiqc_report.html +} /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - NAMED WORKFLOW FOR PIPELINE + RUN MAIN WORKFLOW ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -include { SAREK } from './workflows/sarek' +workflow { -// WORKFLOW: Run main nf-core/sarek analysis pipeline -workflow NFCORE_SAREK { - SAREK () + main: + + // + // SUBWORKFLOW: Run initialisation tasks + // + PIPELINE_INITIALISATION( + params.version, + params.help, + params.validate_params, + params.monochrome_logs, + args, + params.outdir, + params.input + ) + + // + // WORKFLOW: Run main workflow + // + NFCORE_SAREK(PIPELINE_INITIALISATION.out.samplesheet) + + // + // SUBWORKFLOW: Run completion tasks + // + PIPELINE_COMPLETION( + params.email, + params.email_on_fail, + params.plaintext_email, + params.outdir, + params.monochrome_logs, + params.hook_url, + NFCORE_SAREK.out.multiqc_report + ) } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RUN ALL WORKFLOWS + FUNCTIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -// WORKFLOW: Execute a single named workflow for the pipeline -// See: https://github.com/nf-core/rnaseq/issues/619 -workflow { - NFCORE_SAREK () +// +// Get attribute from genome config file e.g. fasta +// + +def getGenomeAttribute(attribute) { + if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) { + if (params.genomes[ params.genome ].containsKey(attribute)) { + return params.genomes[ params.genome ][ attribute ] + } + } + return null } /* diff --git a/modules.json b/modules.json index dd5387fbb8..a3f3a8fd65 100644 --- a/modules.json +++ b/modules.json @@ -12,146 +12,141 @@ }, "bcftools/annotate": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", "installed_by": ["modules"], "patch": "modules/nf-core/bcftools/annotate/bcftools-annotate.diff" }, "bcftools/concat": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", "installed_by": ["modules"] }, "bcftools/mpileup": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", "installed_by": ["bam_ngscheckmate"] }, "bcftools/sort": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "487d92367b4d7bb9f1ca694bf72736be90720b15", "installed_by": ["modules"] }, "bcftools/stats": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "618364f55cb88f6c283f6c6c45c24d5f9f08f998", "installed_by": ["modules"] }, "bwa/index": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "6278bf9afd4a4b2d00fa6052250e73da3d91546f", "installed_by": ["modules"] }, "bwa/mem": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "b97197968ac12dde2463fa54541f6350c46f2035", "installed_by": ["modules"] }, "bwamem2/index": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "7081e04c18de9480948d34513a1c1e2d0fa9126d", "installed_by": ["modules"] }, "bwamem2/mem": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "3afb95b2e15fc4a2347470255a7ef654f650c8ec", "installed_by": ["modules"] }, "cat/cat": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "9437e6053dccf4aafa022bfd6e7e9de67e625af8", "installed_by": ["modules"] }, "cat/fastq": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "0997b47c93c06b49aa7b3fefda87e728312cf2ca", "installed_by": ["modules"] }, "cnvkit/antitarget": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", "installed_by": ["modules"] }, "cnvkit/batch": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "f53b071421340e6fac0806c86ba030e578e94826", "installed_by": ["modules"] }, "cnvkit/genemetrics": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", "installed_by": ["modules"] }, "cnvkit/reference": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", "installed_by": ["modules"] }, "controlfreec/assesssignificance": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "e6c5689c1d4c7f255a7cc042b0a2fa25a9b3c4fa", "installed_by": ["modules"], "patch": "modules/nf-core/controlfreec/assesssignificance/controlfreec-assesssignificance.diff" }, "controlfreec/freec": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "7b5827ac89358ad6dd3e8f328f6d1427d7f14a68", "installed_by": ["modules"] }, "controlfreec/freec2bed": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "0c7fd5488d43188ee801c800461d259389d34c19", "installed_by": ["modules"] }, "controlfreec/freec2circos": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "b626cd7bf99db4f42de314ee8b70d1c389a7b9f4", "installed_by": ["modules"] }, - "controlfreec/makegraph": { + "controlfreec/makegraph2": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["modules"], - "patch": "modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff" - }, - "custom/dumpsoftwareversions": { - "branch": "master", - "git_sha": "bba7e362e4afead70653f84d8700588ea28d0f9e", + "git_sha": "c3f338377c177a01847eeea2f77da33ce89f92e6", "installed_by": ["modules"] }, "deepvariant": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "199ba086a259e1933d6e0ab7596e4a977bbd483a", "installed_by": ["modules"] }, "dragmap/align": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["modules"] + "git_sha": "dd2757cc22c5de8943fa38ba7cd6f8cc1eb65ac1", + "installed_by": ["modules"], + "patch": "modules/nf-core/dragmap/align/dragmap-align.diff" }, "dragmap/hashtable": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "ae9e01cb5e77faada314047e78423b22b4f5bbc5", "installed_by": ["modules"], "patch": "modules/nf-core/dragmap/hashtable/dragmap-hashtable.diff" }, "ensemblvep/download": { "branch": "master", - "git_sha": "214d575774c172062924ad3564b4f66655600730", + "git_sha": "3db4f8488315cd7d7cf3fcb64251f6603210e831", "installed_by": ["modules"] }, "ensemblvep/vep": { "branch": "master", - "git_sha": "214d575774c172062924ad3564b4f66655600730", - "installed_by": ["vcf_annotate_ensemblvep", "modules"] + "git_sha": "3db4f8488315cd7d7cf3fcb64251f6603210e831", + "installed_by": ["modules", "vcf_annotate_ensemblvep"] }, "fastp": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "95cf5fe0194c7bf5cb0e3027a2eb7e7c89385080", "installed_by": ["modules"] }, "fastqc": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "285a50500f9e02578d90b3ce6382ea3c30216acd", "installed_by": ["modules"] }, "fgbio/callmolecularconsensusreads": { @@ -161,7 +156,7 @@ }, "fgbio/fastqtobam": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "19f81cab3b2a08f37c4f3727ddb30c01ebf07be6", "installed_by": ["modules"] }, "fgbio/groupreadsbyumi": { @@ -171,152 +166,157 @@ }, "freebayes": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "77978839bef6d437f21edb900b49bcbc04f9f735", "installed_by": ["modules"] }, "gatk4/applybqsr": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "af273ea6618c50e82c372abe18b0a225e84fe6f7", "installed_by": ["modules"] }, "gatk4/applyvqsr": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/baserecalibrator": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "8a223e11d4e6deb36484e01891eae9c1cacb5f5d", "installed_by": ["modules"] }, "gatk4/calculatecontamination": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/cnnscorevariants": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "60a7dbae179bcfa24c10294cc9a07423a239c19a", "installed_by": ["modules"] }, "gatk4/createsequencedictionary": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/estimatelibrarycomplexity": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "1943aa60f7490c3d6740e8872e6e69122ccc8087", "installed_by": ["modules"] }, "gatk4/filtermutectcalls": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/filtervarianttranches": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/gatherbqsrreports": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/gatherpileupsummaries": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/genomicsdbimport": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", "installed_by": ["modules"] }, "gatk4/genotypegvcfs": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/getpileupsummaries": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/haplotypecaller": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/intervallisttobed": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/learnreadorientationmodel": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/markduplicates": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "194fca815cf594646e638fa5476acbcc296f1850", "installed_by": ["modules"] }, "gatk4/mergemutectstats": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4/mergevcfs": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "194fca815cf594646e638fa5476acbcc296f1850", "installed_by": ["modules"] }, "gatk4/mutect2": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "5fd04feb37b58caa6a54d41e38c80066bdf71056", "installed_by": ["modules"] }, "gatk4/variantrecalibrator": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4spark/applybqsr": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "3b928d02096f928ef224d89f2a502afaa6e06556", "installed_by": ["modules"] }, "gatk4spark/baserecalibrator": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", "installed_by": ["modules"] }, "gatk4spark/markduplicates": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "3b928d02096f928ef224d89f2a502afaa6e06556", + "installed_by": ["modules"] + }, + "gawk": { + "branch": "master", + "git_sha": "da4d05d04e65227d4307e87940842f1a14de62c7", "installed_by": ["modules"] }, "manta/germline": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "ebc1733b77c702f19fe42076a5edfcbaa0d84f66", "installed_by": ["modules"] }, "manta/somatic": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "ab693fbb906b3a1151ad21e270129a9d48437ab6", "installed_by": ["modules"] }, "manta/tumoronly": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "8731a6221dd10fd9039e18518b390b43e14ef9ae", "installed_by": ["modules"] }, "mosdepth": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "30d3ca4346ae38f0de821c57a9c517b8b0b135d6", "installed_by": ["modules"] }, "msisensorpro/msisomatic": { @@ -331,7 +331,7 @@ }, "multiqc": { "branch": "master", - "git_sha": "214d575774c172062924ad3564b4f66655600730", + "git_sha": "b7ebe95761cd389603f9cc0e0dc384c0f663815a", "installed_by": ["modules"] }, "ngscheckmate/ncm": { @@ -341,92 +341,92 @@ }, "samblaster": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "310850152f3e1dec6ba28b28e1f1cb9ab8660a49", "installed_by": ["modules"] }, "samtools/bam2fq": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", "installed_by": ["modules"] }, "samtools/collatefastq": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", "installed_by": ["modules"] }, "samtools/convert": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "1b93e06140e6807cc408519759f68bd26da63a00", "installed_by": ["modules"] }, "samtools/faidx": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "f153f1f10e1083c49935565844cccb7453021682", "installed_by": ["modules"] }, "samtools/index": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", "installed_by": ["modules"] }, "samtools/merge": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", "installed_by": ["modules"] }, "samtools/mpileup": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", "installed_by": ["modules"] }, "samtools/stats": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", "installed_by": ["modules"] }, "samtools/view": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "0bd7d2333a88483aa0476acea172e9f5f6dd83bb", "installed_by": ["modules"] }, "sentieon/applyvarcal": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "220da1aa7d6ab6555817035041dd2fc05cb518d3", "installed_by": ["modules"] }, "sentieon/bwamem": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "220da1aa7d6ab6555817035041dd2fc05cb518d3", "installed_by": ["modules"] }, "sentieon/dedup": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "220da1aa7d6ab6555817035041dd2fc05cb518d3", "installed_by": ["modules"] }, "sentieon/dnamodelapply": { "branch": "master", - "git_sha": "214d575774c172062924ad3564b4f66655600730", + "git_sha": "220da1aa7d6ab6555817035041dd2fc05cb518d3", "installed_by": ["modules"] }, "sentieon/dnascope": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "220da1aa7d6ab6555817035041dd2fc05cb518d3", "installed_by": ["modules"] }, "sentieon/gvcftyper": { "branch": "master", - "git_sha": "214d575774c172062924ad3564b4f66655600730", + "git_sha": "220da1aa7d6ab6555817035041dd2fc05cb518d3", "installed_by": ["modules"] }, "sentieon/haplotyper": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "220da1aa7d6ab6555817035041dd2fc05cb518d3", "installed_by": ["modules"] }, "sentieon/varcal": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "220da1aa7d6ab6555817035041dd2fc05cb518d3", "installed_by": ["modules"] }, "snpeff/download": { @@ -436,42 +436,42 @@ }, "snpeff/snpeff": { "branch": "master", - "git_sha": "214d575774c172062924ad3564b4f66655600730", + "git_sha": "2f3db6f45147ebbb56b371536e31bdf622b5bfee", "installed_by": ["modules", "vcf_annotate_snpeff"] }, "strelka/germline": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "e8f2c77a6e4174ee0a48d073d4cc8ff06c44bb4c", "installed_by": ["modules"] }, "strelka/somatic": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "a626d7c63cb0ee675686a2f47b26cdc53266e186", "installed_by": ["modules"] }, "svdb/merge": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "ba3f3df395d2719dcef5c67189042a1dc555c701", "installed_by": ["modules"] }, "tabix/bgziptabix": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "09d3c8c29b31a2dfd610305b10550f0e1dbcd4a9", "installed_by": ["modules", "vcf_annotate_snpeff"] }, "tabix/tabix": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["vcf_annotate_ensemblvep", "modules"] + "git_sha": "9502adb23c0b97ed8e616bbbdfa73b4585aec9a1", + "installed_by": ["modules", "vcf_annotate_ensemblvep"] }, "tiddit/sv": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "6af4979ee1a57c986102175d9e1bb7ab834f3ae8", "installed_by": ["modules"] }, "untar": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", "installed_by": ["modules"] }, "unzip": { @@ -481,7 +481,7 @@ }, "vcftools": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "624ecdc43b72e0a45bf05d9b57215d18dcd538f8", "installed_by": ["modules"] } } @@ -493,6 +493,21 @@ "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", "installed_by": ["subworkflows"] }, + "utils_nextflow_pipeline": { + "branch": "master", + "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", + "installed_by": ["subworkflows"] + }, + "utils_nfcore_pipeline": { + "branch": "master", + "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", + "installed_by": ["subworkflows"] + }, + "utils_nfvalidation_plugin": { + "branch": "master", + "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", + "installed_by": ["subworkflows"] + }, "vcf_annotate_ensemblvep": { "branch": "master", "git_sha": "cfd937a668919d948f6fcbf4218e79de50c2f36f", diff --git a/modules/local/build_intervals/main.nf b/modules/local/build_intervals/main.nf deleted file mode 100644 index 9c562f5c17..0000000000 --- a/modules/local/build_intervals/main.nf +++ /dev/null @@ -1,29 +0,0 @@ -process BUILD_INTERVALS { - tag "$meta.id" - label 'process_single' - - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gawk:5.1.0' : - 'biocontainers/gawk:5.1.0' }" - - input: - tuple val(meta), path(fasta_fai) - - output: - tuple val(meta), path("${fasta_fai.baseName}.bed") , emit: bed - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - """ - awk -v FS='\t' -v OFS='\t' '{ print \$1, \"0\", \$2 }' ${fasta_fai} > ${fasta_fai.baseName}.bed - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - gawk: \$(awk -Wversion | sed '1!d; s/.*Awk //; s/,.*//') - END_VERSIONS - """ -} diff --git a/modules/local/create_intervals_bed/main.nf b/modules/local/create_intervals_bed/main.nf index 88160ccbf4..6a3c9c5a47 100644 --- a/modules/local/create_intervals_bed/main.nf +++ b/modules/local/create_intervals_bed/main.nf @@ -9,6 +9,7 @@ process CREATE_INTERVALS_BED { input: path(intervals) + val(nucleotides_per_second) output: path("*.bed") , emit: bed @@ -27,7 +28,7 @@ process CREATE_INTERVALS_BED { t = \$5 # runtime estimate if (t == "") { # no runtime estimate in this row, assume default value - t = (\$3 - \$2) / ${params.nucleotides_per_second} + t = (\$3 - \$2) / ${nucleotides_per_second} } if (name == "" || (chunk > 600 && (chunk + t) > longest * 1.05)) { # start a new chunk diff --git a/modules/nf-core/bcftools/annotate/bcftools-annotate.diff b/modules/nf-core/bcftools/annotate/bcftools-annotate.diff index 4376af5172..34a9e2c381 100644 --- a/modules/nf-core/bcftools/annotate/bcftools-annotate.diff +++ b/modules/nf-core/bcftools/annotate/bcftools-annotate.diff @@ -2,7 +2,7 @@ Changes in module 'nf-core/bcftools/annotate' --- modules/nf-core/bcftools/annotate/main.nf +++ modules/nf-core/bcftools/annotate/main.nf @@ -8,7 +8,10 @@ - 'biocontainers/bcftools:1.17--haef29d1_0' }" + 'biocontainers/bcftools:1.18--h8b25389_0' }" input: - tuple val(meta), path(input), path(index), path(annotations), path(annotations_index), path(header_lines) diff --git a/modules/nf-core/bcftools/annotate/environment.yml b/modules/nf-core/bcftools/annotate/environment.yml index 273ffff4c2..e0abc8d23c 100644 --- a/modules/nf-core/bcftools/annotate/environment.yml +++ b/modules/nf-core/bcftools/annotate/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::bcftools=1.17 + - bioconda::bcftools=1.18 diff --git a/modules/nf-core/bcftools/annotate/main.nf b/modules/nf-core/bcftools/annotate/main.nf index f00c5fe2d7..7d9dba4255 100644 --- a/modules/nf-core/bcftools/annotate/main.nf +++ b/modules/nf-core/bcftools/annotate/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_ANNOTATE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.17--haef29d1_0': - 'biocontainers/bcftools:1.17--haef29d1_0' }" + 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': + 'biocontainers/bcftools:1.18--h8b25389_0' }" input: tuple val(meta), path(input) diff --git a/modules/nf-core/bcftools/concat/environment.yml b/modules/nf-core/bcftools/concat/environment.yml index be2539990b..ff0200dfab 100644 --- a/modules/nf-core/bcftools/concat/environment.yml +++ b/modules/nf-core/bcftools/concat/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::bcftools=1.17 + - bioconda::bcftools=1.18 diff --git a/modules/nf-core/bcftools/concat/main.nf b/modules/nf-core/bcftools/concat/main.nf index 2ff690b1be..a5830a251a 100644 --- a/modules/nf-core/bcftools/concat/main.nf +++ b/modules/nf-core/bcftools/concat/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_CONCAT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.17--haef29d1_0': - 'biocontainers/bcftools:1.17--haef29d1_0' }" + 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': + 'biocontainers/bcftools:1.18--h8b25389_0' }" input: tuple val(meta), path(vcfs), path(tbi) diff --git a/modules/nf-core/bcftools/concat/meta.yml b/modules/nf-core/bcftools/concat/meta.yml index 8731b17bc8..91cb54d5c7 100644 --- a/modules/nf-core/bcftools/concat/meta.yml +++ b/modules/nf-core/bcftools/concat/meta.yml @@ -20,12 +20,12 @@ input: Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - vcfs: - type: files + type: list description: | List containing 2 or more vcf files e.g. [ 'file1.vcf', 'file2.vcf' ] - tbi: - type: files + type: list description: | List containing 2 or more index files (optional) e.g. [ 'file1.tbi', 'file2.tbi' ] diff --git a/modules/nf-core/bcftools/concat/tests/main.nf.test b/modules/nf-core/bcftools/concat/tests/main.nf.test new file mode 100644 index 0000000000..bf1a5f3fae --- /dev/null +++ b/modules/nf-core/bcftools/concat/tests/main.nf.test @@ -0,0 +1,108 @@ +nextflow_process { + + name "Test Process BCFTOOLS_CONCAT" + script "../main.nf" + process "BCFTOOLS_CONCAT" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/concat" + + config "./nextflow.config" + + test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]]") { + + when { + process { + """ + input[0] = [ + [ id:'test3' ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], 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), + file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - [[vcf1, vcf2], []]") { + + when { + process { + """ + input[0] = [ + [ id:'test3' ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + ], + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - stub") { + + options "-stub" + when { + process { + """ + input[0] = [ + [ id:'test3' ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], 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), + file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.vcf[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/bcftools/concat/tests/main.nf.test.snap b/modules/nf-core/bcftools/concat/tests/main.nf.test.snap new file mode 100644 index 0000000000..7344e6e38c --- /dev/null +++ b/modules/nf-core/bcftools/concat/tests/main.nf.test.snap @@ -0,0 +1,43 @@ +{ + "sarscov2 - [[vcf1, vcf2], []]": { + "content": [ + [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,4bcd0afd89f56c5d433f6b6abc44d0a6" + ] + ], + [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + ] + ], + "timestamp": "2023-11-29T13:52:27.03724666" + }, + "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]]": { + "content": [ + [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,4bcd0afd89f56c5d433f6b6abc44d0a6" + ] + ], + [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + ] + ], + "timestamp": "2023-11-29T13:52:21.468988293" + }, + "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - stub": { + "content": [ + "test3.vcf.gz", + [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + ] + ], + "timestamp": "2023-11-29T13:41:04.716017811" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/concat/tests/nextflow.config b/modules/nf-core/bcftools/concat/tests/nextflow.config new file mode 100644 index 0000000000..f3e1e98c63 --- /dev/null +++ b/modules/nf-core/bcftools/concat/tests/nextflow.config @@ -0,0 +1,3 @@ +process { + ext.args = "--no-version" +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/concat/tests/tags.yml b/modules/nf-core/bcftools/concat/tests/tags.yml new file mode 100644 index 0000000000..21710d4ebd --- /dev/null +++ b/modules/nf-core/bcftools/concat/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/concat: + - "modules/nf-core/bcftools/concat/**" diff --git a/modules/nf-core/bcftools/mpileup/environment.yml b/modules/nf-core/bcftools/mpileup/environment.yml index 346d187fec..114390be1f 100644 --- a/modules/nf-core/bcftools/mpileup/environment.yml +++ b/modules/nf-core/bcftools/mpileup/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::bcftools=1.17 + - bioconda::bcftools=1.18 diff --git a/modules/nf-core/bcftools/mpileup/main.nf b/modules/nf-core/bcftools/mpileup/main.nf index 83bec8ef5f..5e57644af7 100644 --- a/modules/nf-core/bcftools/mpileup/main.nf +++ b/modules/nf-core/bcftools/mpileup/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_MPILEUP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.17--haef29d1_0': - 'biocontainers/bcftools:1.17--haef29d1_0' }" + 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': + 'biocontainers/bcftools:1.18--h8b25389_0' }" input: tuple val(meta), path(bam), path(intervals) diff --git a/modules/nf-core/bcftools/mpileup/tests/main.nf.test b/modules/nf-core/bcftools/mpileup/tests/main.nf.test new file mode 100644 index 0000000000..6478bbc2d3 --- /dev/null +++ b/modules/nf-core/bcftools/mpileup/tests/main.nf.test @@ -0,0 +1,116 @@ +nextflow_process { + + name "Test Process BCFTOOLS_MPILEUP" + script "../main.nf" + process "BCFTOOLS_MPILEUP" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/mpileup" + + config "./nextflow.config" + + test("sarscov2 - [bam, []], fasta, false") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + [] + ] + input[1] = [ + [ id:'sarscov2' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.tbi, + process.out.stats, + process.out.mpileup, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - [bam, []], fasta, true") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + [] + ] + input[1] = [ + [ id:'sarscov2' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.tbi, + process.out.stats, + process.out.mpileup, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - [bam, bed], fasta, false") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + input[1] = [ + [ id:'sarscov2' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.tbi, + process.out.stats, + process.out.mpileup, + process.out.versions + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap b/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap new file mode 100644 index 0000000000..ef80ab1b7f --- /dev/null +++ b/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap @@ -0,0 +1,112 @@ +{ + "sarscov2 - [bam, []], fasta, true": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,0f2f2c8488e97e7f13979380d5d3b6b5" + ] + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,34cb2eeb73f4d2b98218acecebd92704" + ] + ], + [ + [ + { + "id": "test" + }, + "test.bcftools_stats.txt:md5,a988fbcd2ea5d1ce30970dcb60a77ed7" + ] + ], + [ + [ + { + "id": "test" + }, + "test.mpileup.gz:md5,73b4a00398bddab2cd065b40d17ca4dc" + ] + ], + [ + "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" + ] + ], + "timestamp": "2023-11-29T14:11:54.549517279" + }, + "sarscov2 - [bam, bed], fasta, false": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,687244dbf71d05b3b973ab08ecf05310" + ] + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,3785df15f3d7faf35f3ad70d167a50f7" + ] + ], + [ + [ + { + "id": "test" + }, + "test.bcftools_stats.txt:md5,f8c5ab149c4bf0e5f51c518346cb87b5" + ] + ], + [ + + ], + [ + "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" + ] + ], + "timestamp": "2023-11-29T14:12:00.865439661" + }, + "sarscov2 - [bam, []], fasta, false": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,0f2f2c8488e97e7f13979380d5d3b6b5" + ] + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,34cb2eeb73f4d2b98218acecebd92704" + ] + ], + [ + [ + { + "id": "test" + }, + "test.bcftools_stats.txt:md5,a988fbcd2ea5d1ce30970dcb60a77ed7" + ] + ], + [ + + ], + [ + "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" + ] + ], + "timestamp": "2023-11-29T14:11:47.814900494" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/mpileup/tests/nextflow.config b/modules/nf-core/bcftools/mpileup/tests/nextflow.config new file mode 100644 index 0000000000..a7ba19fe62 --- /dev/null +++ b/modules/nf-core/bcftools/mpileup/tests/nextflow.config @@ -0,0 +1,4 @@ +process { + ext.args2 = '--no-version --ploidy 1 --multiallelic-caller' + ext.args3 = '--no-version' +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/mpileup/tests/tags.yml b/modules/nf-core/bcftools/mpileup/tests/tags.yml new file mode 100644 index 0000000000..07b91f982c --- /dev/null +++ b/modules/nf-core/bcftools/mpileup/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/mpileup: + - "modules/nf-core/bcftools/mpileup/**" diff --git a/modules/nf-core/bcftools/sort/environment.yml b/modules/nf-core/bcftools/sort/environment.yml index 26d3644501..89cf911d61 100644 --- a/modules/nf-core/bcftools/sort/environment.yml +++ b/modules/nf-core/bcftools/sort/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::bcftools=1.17 + - bioconda::bcftools=1.18 diff --git a/modules/nf-core/bcftools/sort/main.nf b/modules/nf-core/bcftools/sort/main.nf index c842daf232..c982944c52 100644 --- a/modules/nf-core/bcftools/sort/main.nf +++ b/modules/nf-core/bcftools/sort/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_SORT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.17--haef29d1_0': - 'biocontainers/bcftools:1.17--haef29d1_0' }" + 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': + 'biocontainers/bcftools:1.18--h8b25389_0' }" input: tuple val(meta), path(vcf) diff --git a/modules/nf-core/bcftools/sort/tests/main.nf.test b/modules/nf-core/bcftools/sort/tests/main.nf.test new file mode 100644 index 0000000000..fec59cfe57 --- /dev/null +++ b/modules/nf-core/bcftools/sort/tests/main.nf.test @@ -0,0 +1,32 @@ +nextflow_process { + + name "Test Process BCFTOOLS_SORT" + script "../main.nf" + process "BCFTOOLS_SORT" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/sort" + + test("SarsCov2 VCF") { + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } +} diff --git a/modules/nf-core/bcftools/sort/tests/main.nf.test.snap b/modules/nf-core/bcftools/sort/tests/main.nf.test.snap new file mode 100644 index 0000000000..7f599559fc --- /dev/null +++ b/modules/nf-core/bcftools/sort/tests/main.nf.test.snap @@ -0,0 +1,35 @@ +{ + "SarsCov2 VCF": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "1": [ + "versions.yml:md5,622bd32d4ff0fac3360cd534ae0f0168" + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions": [ + "versions.yml:md5,622bd32d4ff0fac3360cd534ae0f0168" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-03-18T12:50:10.340362246" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/sort/tests/tags.yml b/modules/nf-core/bcftools/sort/tests/tags.yml new file mode 100644 index 0000000000..6e9520dd38 --- /dev/null +++ b/modules/nf-core/bcftools/sort/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/sort: + - "modules/nf-core/bcftools/sort/**" diff --git a/modules/nf-core/bcftools/stats/environment.yml b/modules/nf-core/bcftools/stats/environment.yml index a937a10a7f..7bb40dc0be 100644 --- a/modules/nf-core/bcftools/stats/environment.yml +++ b/modules/nf-core/bcftools/stats/environment.yml @@ -4,4 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::bcftools=1.17 + - bioconda::bcftools=1.18 + - bioconda::htslib=1.18 diff --git a/modules/nf-core/bcftools/stats/main.nf b/modules/nf-core/bcftools/stats/main.nf index b3a5f23ba6..ffa1df6430 100644 --- a/modules/nf-core/bcftools/stats/main.nf +++ b/modules/nf-core/bcftools/stats/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_STATS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.17--haef29d1_0': - 'biocontainers/bcftools:1.17--haef29d1_0' }" + 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': + 'biocontainers/bcftools:1.18--h8b25389_0' }" input: tuple val(meta), path(vcf), path(tbi) diff --git a/modules/nf-core/bcftools/stats/tests/main.nf.test b/modules/nf-core/bcftools/stats/tests/main.nf.test new file mode 100644 index 0000000000..f027f6b12f --- /dev/null +++ b/modules/nf-core/bcftools/stats/tests/main.nf.test @@ -0,0 +1,182 @@ +nextflow_process { + + name "Test Process BCFTOOLS_STATS" + script "../main.nf" + process "BCFTOOLS_STATS" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/stats" + + test("sarscov2 - vcf_gz") { + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + []] + input[1] = [ [], [] ] + input[2] = [ [], [] ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match("version") }, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, + ) + } + + } + + test("sarscov2 - vcf_gz - regions") { + + when { + process { + """ + input[0] = [ [ id:'regions_test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true)] + input[1] = [ [id:'regions_test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) ] + input[2] = [ [], [] ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match("regions_version") }, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, + ) + } + + } + + test("sarscov2 - vcf_gz - targets") { + + when { + process { + """ + input[0] = [ [ id:'targets_test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] ] + input[1] = [ [], [] ] + input[2] = [ [id:'targets_test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.targets.tsv.gz', checkIfExists: true) + ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match("targets_version") }, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, + ) + } + + } + + test("sarscov2 - vcf_gz - exons") { + + when { + process { + """ + input[0] = [ [ id:'exon_test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] ] + input[1] = [ [], [] ] + input[2] = [ [], [] ] + input[3] = [ [], [] ] + input[4] = [ [id: "exon_test"], + file(params.modules_testdata_base_path + 'delete_me/bcftools/stats/exons.tsv.gz', checkIfExists: true) ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match("exon_version") }, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, + ) + } + + } + + test("sarscov2 - vcf_gz - reference") { + + when { + process { + """ + input[0] = [ [ id:'ref_test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] ] + input[1] = [ [], [] ] + input[2] = [ [], [] ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [id: 'ref_test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match("ref_version") }, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, + ) + } + + } + + + test("sarscov2 - vcf_gz - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + []] + input[1] = [ [], [] ] + input[2] = [ [], [] ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/stats/tests/main.nf.test.snap b/modules/nf-core/bcftools/stats/tests/main.nf.test.snap new file mode 100644 index 0000000000..30691c32f0 --- /dev/null +++ b/modules/nf-core/bcftools/stats/tests/main.nf.test.snap @@ -0,0 +1,160 @@ +{ + "sarscov2 - vcf_gz - reference": { + "content": [ + [ + "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# The command line was:\tbcftools stats --fasta-ref genome.fasta test.vcf.gz", + "#", + "# Definition of sets:", + "# ID\t[2]id\t[3]tab-separated file names", + "ID\t0\ttest.vcf.gz" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-20T11:46:24.34147" + }, + "sarscov2 - vcf_gz - exons": { + "content": [ + [ + "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# The command line was:\tbcftools stats --exons exons.tsv.gz test.vcf.gz", + "#", + "# Definition of sets:", + "# ID\t[2]id\t[3]tab-separated file names", + "ID\t0\ttest.vcf.gz" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-20T11:46:18.378716" + }, + "exon_version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T10:02:02.530551189" + }, + "ref_version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T10:02:06.885381764" + }, + "sarscov2 - vcf_gz - targets": { + "content": [ + [ + "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# The command line was:\tbcftools stats --targets-file test2.targets.tsv.gz test.vcf.gz", + "#", + "# Definition of sets:", + "# ID\t[2]id\t[3]tab-separated file names", + "ID\t0\ttest.vcf.gz" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-20T11:46:12.48194" + }, + "targets_version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T10:01:58.412147664" + }, + "sarscov2 - vcf_gz - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bcftools_stats.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,5909d472a49b0aa2bfbbb1094c129e48" + ], + "stats": [ + [ + { + "id": "test" + }, + "test.bcftools_stats.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,5909d472a49b0aa2bfbbb1094c129e48" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-19T16:26:21.450513562" + }, + "version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T09:57:04.317347424" + }, + "regions_version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T10:01:54.349855366" + }, + "sarscov2 - vcf_gz": { + "content": [ + [ + "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# The command line was:\tbcftools stats test.vcf.gz", + "#", + "# Definition of sets:", + "# ID\t[2]id\t[3]tab-separated file names", + "ID\t0\ttest.vcf.gz" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-20T11:46:01.862297" + }, + "sarscov2 - vcf_gz - regions": { + "content": [ + [ + "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# The command line was:\tbcftools stats --regions-file test3.vcf.gz test.vcf.gz", + "#", + "# Definition of sets:", + "# ID\t[2]id\t[3]tab-separated file names", + "ID\t0\ttest.vcf.gz" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-20T11:46:07.296109" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/stats/tests/tags.yml b/modules/nf-core/bcftools/stats/tests/tags.yml new file mode 100644 index 0000000000..53c12d92a9 --- /dev/null +++ b/modules/nf-core/bcftools/stats/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/stats: + - "modules/nf-core/bcftools/stats/**" diff --git a/modules/nf-core/bwa/index/tests/main.nf.test b/modules/nf-core/bwa/index/tests/main.nf.test index 5fc8d49662..af33e73ca1 100644 --- a/modules/nf-core/bwa/index/tests/main.nf.test +++ b/modules/nf-core/bwa/index/tests/main.nf.test @@ -15,7 +15,7 @@ nextflow_process { """ input[0] = [ [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -29,5 +29,5 @@ nextflow_process { } } - + } diff --git a/modules/nf-core/bwa/mem/environment.yml b/modules/nf-core/bwa/mem/environment.yml index 401a0d06ce..3f136d0a3f 100644 --- a/modules/nf-core/bwa/mem/environment.yml +++ b/modules/nf-core/bwa/mem/environment.yml @@ -6,4 +6,5 @@ channels: dependencies: - bwa=0.7.17 # renovate: datasource=conda depName=bioconda/samtools - - samtools=1.16.1 + - samtools=1.19.2 + - htslib=1.19.1 diff --git a/modules/nf-core/bwa/mem/main.nf b/modules/nf-core/bwa/mem/main.nf index 17e6fbd06c..d8bd281519 100644 --- a/modules/nf-core/bwa/mem/main.nf +++ b/modules/nf-core/bwa/mem/main.nf @@ -4,17 +4,21 @@ process BWA_MEM { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:219b6c272b25e7e642ae3ff0bf0c5c81a5135ab4-0' : - 'biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:219b6c272b25e7e642ae3ff0bf0c5c81a5135ab4-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:a34558545ae1413d94bde4578787ebef08027945-0' : + 'biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:a34558545ae1413d94bde4578787ebef08027945-0' }" input: - tuple val(meta), path(reads) + tuple val(meta) , path(reads) tuple val(meta2), path(index) + tuple val(meta3), path(fasta) val sort_bam output: - tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: versions + tuple val(meta), path("*.bam") , emit: bam, optional: true + tuple val(meta), path("*.cram") , emit: cram, optional: true + tuple val(meta), path("*.csi") , emit: csi, optional: true + tuple val(meta), path("*.crai") , emit: crai, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -24,6 +28,13 @@ process BWA_MEM { def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def samtools_command = sort_bam ? 'sort' : 'view' + def extension = args2.contains("--output-fmt sam") ? "sam" : + args2.contains("--output-fmt cram") ? "cram": + sort_bam && args2.contains("-O cram")? "cram": + !sort_bam && args2.contains("-C") ? "cram": + "bam" + def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" + if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" """ INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'` @@ -32,7 +43,7 @@ process BWA_MEM { -t $task.cpus \\ \$INDEX \\ $reads \\ - | samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam - + | samtools $samtools_command $args2 ${reference} --threads $task.cpus -o ${prefix}.${extension} - cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -42,9 +53,19 @@ process BWA_MEM { """ stub: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def samtools_command = sort_bam ? 'sort' : 'view' + def extension = args2.contains("--output-fmt sam") ? "sam" : + args2.contains("--output-fmt cram") ? "cram": + sort_bam && args2.contains("-O cram")? "cram": + !sort_bam && args2.contains("-C") ? "cram": + "bam" """ - touch ${prefix}.bam + touch ${prefix}.${extension} + touch ${prefix}.csi + touch ${prefix}.crai cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bwa/mem/meta.yml b/modules/nf-core/bwa/mem/meta.yml index 440fb1f9cf..1532c2615d 100644 --- a/modules/nf-core/bwa/mem/meta.yml +++ b/modules/nf-core/bwa/mem/meta.yml @@ -37,6 +37,10 @@ input: type: file description: BWA genome index files pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" + - fasta: + type: file + description: Reference genome in FASTA format + pattern: "*.{fasta,fa}" - sort_bam: type: boolean description: use samtools sort (true) or samtools view (false) @@ -46,6 +50,18 @@ output: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" + - cram: + type: file + description: Output CRAM file containing read alignments + pattern: "*.{cram}" + - csi: + type: file + description: Optional index file for BAM file + pattern: "*.{csi}" + - crai: + type: file + description: Optional index file for CRAM file + pattern: "*.{crai}" - versions: type: file description: File containing software versions @@ -53,6 +69,8 @@ output: authors: - "@drpatelh" - "@jeremy1805" + - "@matthdsm" maintainers: - "@drpatelh" - "@jeremy1805" + - "@matthdsm" diff --git a/modules/nf-core/bwa/mem/tests/main.nf.test b/modules/nf-core/bwa/mem/tests/main.nf.test index b199bb70f6..1fa9b56dc7 100644 --- a/modules/nf-core/bwa/mem/tests/main.nf.test +++ b/modules/nf-core/bwa/mem/tests/main.nf.test @@ -5,6 +5,7 @@ nextflow_process { tag "modules" tag "bwa" tag "bwa/mem" + tag "bwa/index" script "../main.nf" process "BWA_MEM" @@ -17,7 +18,7 @@ nextflow_process { """ input[0] = [ [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -30,11 +31,12 @@ nextflow_process { input[0] = [ [ id:'test', single_end:true ], // meta map [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] ] input[1] = BWA_INDEX.out.index - input[2] = false + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = false """ } } @@ -57,7 +59,7 @@ nextflow_process { """ input[0] = [ [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -70,11 +72,12 @@ nextflow_process { input[0] = [ [ id:'test', single_end:true ], // meta map [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] ] input[1] = BWA_INDEX.out.index - input[2] = true + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = true """ } } @@ -97,7 +100,7 @@ nextflow_process { """ input[0] = [ [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -110,12 +113,13 @@ nextflow_process { input[0] = [ [ 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.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] ] input[1] = BWA_INDEX.out.index - input[2] = false + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = false """ } } @@ -138,7 +142,7 @@ nextflow_process { """ input[0] = [ [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -151,12 +155,13 @@ nextflow_process { input[0] = [ [ 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.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] ] input[1] = BWA_INDEX.out.index - input[2] = true + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = true """ } } @@ -169,4 +174,133 @@ nextflow_process { } } + + test("Paired-End - no fasta") { + + setup { + run("BWA_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + input[1] = BWA_INDEX.out.index + input[2] = [[:],[]] + input[3] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("Single-end - stub") { + options "-stub" + setup { + run("BWA_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + ] + input[1] = BWA_INDEX.out.index + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.csi[0][1]).name, + process.out.versions + ).match() } + ) + } + } + + test("Paired-end - stub") { + options "-stub" + setup { + run("BWA_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + input[1] = BWA_INDEX.out.index + input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.csi[0][1]).name, + process.out.versions + ).match() } + ) + } + } } diff --git a/modules/nf-core/bwa/mem/tests/main.nf.test.snap b/modules/nf-core/bwa/mem/tests/main.nf.test.snap index ea3bfed4fd..0d1bdb416d 100644 --- a/modules/nf-core/bwa/mem/tests/main.nf.test.snap +++ b/modules/nf-core/bwa/mem/tests/main.nf.test.snap @@ -8,11 +8,20 @@ "id": "test", "single_end": true }, - "test.bam:md5,3d43027d4163ada97911b814001511e5" + "test.bam:md5,a74710a0345b4717bb4431bf9c257120" ] ], "1": [ - "versions.yml:md5,809f4a8c7f0c8497a9099dab9d6cc71e" + + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" ], "bam": [ [ @@ -20,15 +29,28 @@ "id": "test", "single_end": true }, - "test.bam:md5,3d43027d4163ada97911b814001511e5" + "test.bam:md5,a74710a0345b4717bb4431bf9c257120" ] + ], + "crai": [ + + ], + "cram": [ + + ], + "csi": [ + ], "versions": [ - "versions.yml:md5,809f4a8c7f0c8497a9099dab9d6cc71e" + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" ] } ], - "timestamp": "2023-10-18T11:02:55.420631681" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-14T14:14:56.820798254" }, "Single-End Sort": { "content": [ @@ -39,11 +61,20 @@ "id": "test", "single_end": true }, - "test.bam:md5,61eac1213d2bf5e88e225e545010e9b8" + "test.bam:md5,cb1e038bc4d990683fa485d632550b54" ] ], "1": [ - "versions.yml:md5,809f4a8c7f0c8497a9099dab9d6cc71e" + + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" ], "bam": [ [ @@ -51,15 +82,28 @@ "id": "test", "single_end": true }, - "test.bam:md5,61eac1213d2bf5e88e225e545010e9b8" + "test.bam:md5,cb1e038bc4d990683fa485d632550b54" ] + ], + "crai": [ + + ], + "cram": [ + + ], + "csi": [ + ], "versions": [ - "versions.yml:md5,809f4a8c7f0c8497a9099dab9d6cc71e" + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" ] } ], - "timestamp": "2023-10-18T11:03:02.646869498" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-14T14:15:20.271428534" }, "Paired-End": { "content": [ @@ -70,11 +114,20 @@ "id": "test", "single_end": false }, - "test.bam:md5,809ccfe4300fa5005a9d0d4dc09b1a36" + "test.bam:md5,aea123a3828a99da1906126355f15a12" ] ], "1": [ - "versions.yml:md5,809f4a8c7f0c8497a9099dab9d6cc71e" + + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" ], "bam": [ [ @@ -82,15 +135,28 @@ "id": "test", "single_end": false }, - "test.bam:md5,809ccfe4300fa5005a9d0d4dc09b1a36" + "test.bam:md5,aea123a3828a99da1906126355f15a12" ] + ], + "crai": [ + + ], + "cram": [ + + ], + "csi": [ + ], "versions": [ - "versions.yml:md5,809f4a8c7f0c8497a9099dab9d6cc71e" + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" ] } ], - "timestamp": "2023-10-18T11:03:09.793041294" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-14T14:15:38.264256823" }, "Paired-End Sort": { "content": [ @@ -101,11 +167,20 @@ "id": "test", "single_end": false }, - "test.bam:md5,2622f4380f992c505af7dab8c256313f" + "test.bam:md5,4682087bcdc3617384b375093fecd8dd" ] ], "1": [ - "versions.yml:md5,809f4a8c7f0c8497a9099dab9d6cc71e" + + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" ], "bam": [ [ @@ -113,14 +188,108 @@ "id": "test", "single_end": false }, - "test.bam:md5,2622f4380f992c505af7dab8c256313f" + "test.bam:md5,4682087bcdc3617384b375093fecd8dd" ] + ], + "crai": [ + + ], + "cram": [ + + ], + "csi": [ + ], "versions": [ - "versions.yml:md5,809f4a8c7f0c8497a9099dab9d6cc71e" + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" ] } ], - "timestamp": "2023-10-18T11:04:43.662093286" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-14T14:16:00.528642686" + }, + "Single-end - stub": { + "content": [ + "test.bam", + "test.csi", + [ + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-15T09:50:33.238543011" + }, + "Paired-End - no fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,aea123a3828a99da1906126355f15a12" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,aea123a3828a99da1906126355f15a12" + ] + ], + "crai": [ + + ], + "cram": [ + + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-14T14:40:16.345342005" + }, + "Paired-end - stub": { + "content": [ + "test.bam", + "test.csi", + [ + "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-15T09:50:42.268673302" } } \ No newline at end of file diff --git a/modules/nf-core/bwamem2/index/tests/main.nf.test b/modules/nf-core/bwamem2/index/tests/main.nf.test new file mode 100644 index 0000000000..dbf11132c7 --- /dev/null +++ b/modules/nf-core/bwamem2/index/tests/main.nf.test @@ -0,0 +1,31 @@ +nextflow_process { + + name "Test Process BWAMEM2_INDEX" + tag "modules_nfcore" + tag "modules" + tag "bwamem2" + tag "bwamem2/index" + script "../main.nf" + process "BWAMEM2_INDEX" + + test("BWAMEM2 index") { + + when { + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/bwamem2/index/tests/main.nf.test.snap b/modules/nf-core/bwamem2/index/tests/main.nf.test.snap new file mode 100644 index 0000000000..69b268ee46 --- /dev/null +++ b/modules/nf-core/bwamem2/index/tests/main.nf.test.snap @@ -0,0 +1,47 @@ +{ + "BWAMEM2 index": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "genome.fasta.0123:md5,b02870de80106104abcb03cd9463e7d8", + "genome.fasta.amb:md5,3a68b8b2287e07dd3f5f95f4344ba76e", + "genome.fasta.ann:md5,c32e11f6c859f166c7525a9c1d583567", + "genome.fasta.bwt.2bit.64:md5,d097a1b82dee375d41a1ea69895a9216", + "genome.fasta.pac:md5,983e3d2cd6f36e2546e6d25a0da78d66" + ] + ] + ], + "1": [ + "versions.yml:md5,9ffd13d12e7108ed15c58566bc4717d6" + ], + "index": [ + [ + { + "id": "test" + }, + [ + "genome.fasta.0123:md5,b02870de80106104abcb03cd9463e7d8", + "genome.fasta.amb:md5,3a68b8b2287e07dd3f5f95f4344ba76e", + "genome.fasta.ann:md5,c32e11f6c859f166c7525a9c1d583567", + "genome.fasta.bwt.2bit.64:md5,d097a1b82dee375d41a1ea69895a9216", + "genome.fasta.pac:md5,983e3d2cd6f36e2546e6d25a0da78d66" + ] + ] + ], + "versions": [ + "versions.yml:md5,9ffd13d12e7108ed15c58566bc4717d6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-03-18T12:59:39.132616" + } +} \ No newline at end of file diff --git a/modules/nf-core/bwamem2/index/tests/tags.yml b/modules/nf-core/bwamem2/index/tests/tags.yml new file mode 100644 index 0000000000..3953018eec --- /dev/null +++ b/modules/nf-core/bwamem2/index/tests/tags.yml @@ -0,0 +1,2 @@ +bwamem2/index: + - modules/nf-core/bwamem2/index/** diff --git a/modules/nf-core/bwamem2/mem/environment.yml b/modules/nf-core/bwamem2/mem/environment.yml index 67989071e3..cbf06d3993 100644 --- a/modules/nf-core/bwamem2/mem/environment.yml +++ b/modules/nf-core/bwamem2/mem/environment.yml @@ -6,4 +6,5 @@ channels: dependencies: - bwa-mem2=2.2.1 # renovate: datasource=conda depName=bioconda/samtools - - samtools=1.16.1 + - samtools=1.19.2 + - htslib=1.19.1 diff --git a/modules/nf-core/bwamem2/mem/main.nf b/modules/nf-core/bwamem2/mem/main.nf index cbec7eef50..729428c4e0 100644 --- a/modules/nf-core/bwamem2/mem/main.nf +++ b/modules/nf-core/bwamem2/mem/main.nf @@ -4,17 +4,22 @@ process BWAMEM2_MEM { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:2cdf6bf1e92acbeb9b2834b1c58754167173a410-0' : - 'biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:2cdf6bf1e92acbeb9b2834b1c58754167173a410-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:2d15960ccea84e249a150b7f5d4db3a42fc2d6c3-0' : + 'biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:2d15960ccea84e249a150b7f5d4db3a42fc2d6c3-0' }" input: tuple val(meta), path(reads) tuple val(meta2), path(index) + tuple val(meta3), path(fasta) val sort_bam output: - tuple val(meta), path("*.bam"), emit: bam - path "versions.yml" , emit: versions + tuple val(meta), path("*.sam") , emit: sam , optional:true + tuple val(meta), path("*.bam") , emit: bam , optional:true + tuple val(meta), path("*.cram") , emit: cram, optional:true + tuple val(meta), path("*.crai") , emit: crai, optional:true + tuple val(meta), path("*.csi") , emit: csi , optional:true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -24,6 +29,13 @@ process BWAMEM2_MEM { def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def samtools_command = sort_bam ? 'sort' : 'view' + + def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/ + def extension_matcher = (args2 =~ extension_pattern) + def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam" + def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" + if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" + """ INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'` @@ -33,7 +45,7 @@ process BWAMEM2_MEM { -t $task.cpus \\ \$INDEX \\ $reads \\ - | samtools $samtools_command $args2 -@ $task.cpus -o ${prefix}.bam - + | samtools $samtools_command $args2 -@ $task.cpus ${reference} -o ${prefix}.${extension} - cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -43,9 +55,28 @@ process BWAMEM2_MEM { """ stub: + + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def samtools_command = sort_bam ? 'sort' : 'view' + def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/ + def extension_matcher = (args2 =~ extension_pattern) + def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam" + def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" + if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" + + def create_index = "" + if (extension == "cram") { + create_index = "touch ${prefix}.crai" + } else if (extension == "bam") { + create_index = "touch ${prefix}.csi" + } + """ - touch ${prefix}.bam + touch ${prefix}.${extension} + ${create_index} + cat <<-END_VERSIONS > versions.yml "${task.process}": bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') diff --git a/modules/nf-core/bwamem2/mem/meta.yml b/modules/nf-core/bwamem2/mem/meta.yml index 04891b26a9..931f712943 100644 --- a/modules/nf-core/bwamem2/mem/meta.yml +++ b/modules/nf-core/bwamem2/mem/meta.yml @@ -37,6 +37,15 @@ input: type: file description: BWA genome index files pattern: "Directory containing BWA index *.{0132,amb,ann,bwt.2bit.64,pac}" + - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fasta: + type: file + description: Reference genome in FASTA format + pattern: "*.{fa,fasta,fna}" - sort_bam: type: boolean description: use samtools sort (true) or samtools view (false) @@ -47,15 +56,33 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + - sam: + type: file + description: Output SAM file containing read alignments + pattern: "*.{sam}" - bam: type: file description: Output BAM file containing read alignments pattern: "*.{bam}" + - cram: + type: file + description: Output CRAM file containing read alignments + pattern: "*.{cram}" + - crai: + type: file + description: Index file for CRAM file + pattern: "*.{crai}" + - csi: + type: file + description: Index file for BAM file + pattern: "*.{csi}" - versions: type: file description: File containing software versions pattern: "versions.yml" authors: - "@maxulysse" + - "@matthdsm" maintainers: - "@maxulysse" + - "@matthdsm" diff --git a/modules/nf-core/bwamem2/mem/tests/main.nf.test b/modules/nf-core/bwamem2/mem/tests/main.nf.test new file mode 100644 index 0000000000..5e67f70b6a --- /dev/null +++ b/modules/nf-core/bwamem2/mem/tests/main.nf.test @@ -0,0 +1,234 @@ +nextflow_process { + + name "Test Process BWAMEM2_MEM" + script "../main.nf" + process "BWAMEM2_MEM" + + tag "modules" + tag "modules_nfcore" + tag "bwamem2" + tag "bwamem2/mem" + tag "bwamem2/index" + + test("sarscov2 - fastq, index, fasta, false") { + + setup { + run("BWAMEM2_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = Channel.of([ + [:], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)] + ]) + input[1] = BWAMEM2_INDEX.out.index + input[2] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[3] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - fastq, index, fasta, true") { + + setup { + run("BWAMEM2_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = Channel.of([ + [:], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)] + ]) + input[1] = BWAMEM2_INDEX.out.index + input[2] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[3] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - [fastq1, fastq2], index, fasta, false") { + + setup { + run("BWAMEM2_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = Channel.of([ + [:], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ]) + input[1] = BWAMEM2_INDEX.out.index + input[2] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[3] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - [fastq1, fastq2], index, fasta, true") { + + setup { + run("BWAMEM2_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = Channel.of([ + [:], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ]) + input[1] = BWAMEM2_INDEX.out.index + input[2] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[3] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - [fastq1, fastq2], index, fasta, true - stub") { + + options "-stub" + + setup { + run("BWAMEM2_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = Channel.of([ + [:], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ]) + input[1] = BWAMEM2_INDEX.out.index + input[2] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[3] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/bwamem2/mem/tests/main.nf.test.snap b/modules/nf-core/bwamem2/mem/tests/main.nf.test.snap new file mode 100644 index 0000000000..9fb1e69d07 --- /dev/null +++ b/modules/nf-core/bwamem2/mem/tests/main.nf.test.snap @@ -0,0 +1,67 @@ +{ + "sarscov2 - [fastq1, fastq2], index, fasta, false": { + "content": [ + "test.bam", + [ + "versions.yml:md5,1c1a9566f189ec077b5179bbf453c51a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-19T13:13:18.890289958" + }, + "sarscov2 - [fastq1, fastq2], index, fasta, true - stub": { + "content": [ + "test.bam", + [ + "versions.yml:md5,1c1a9566f189ec077b5179bbf453c51a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-19T13:45:51.821633029" + }, + "sarscov2 - [fastq1, fastq2], index, fasta, true": { + "content": [ + "test.bam", + [ + "versions.yml:md5,1c1a9566f189ec077b5179bbf453c51a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-19T13:13:36.458291078" + }, + "sarscov2 - fastq, index, fasta, false": { + "content": [ + "test.bam", + [ + "versions.yml:md5,1c1a9566f189ec077b5179bbf453c51a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-19T13:12:44.084654507" + }, + "sarscov2 - fastq, index, fasta, true": { + "content": [ + "test.bam", + [ + "versions.yml:md5,1c1a9566f189ec077b5179bbf453c51a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-19T13:13:01.763341681" + } +} \ No newline at end of file diff --git a/modules/nf-core/bwamem2/mem/tests/tags.yml b/modules/nf-core/bwamem2/mem/tests/tags.yml new file mode 100644 index 0000000000..134efb2b3d --- /dev/null +++ b/modules/nf-core/bwamem2/mem/tests/tags.yml @@ -0,0 +1,2 @@ +bwamem2/mem: + - "modules/nf-core/bwamem2/mem/**" diff --git a/modules/nf-core/cat/cat/main.nf b/modules/nf-core/cat/cat/main.nf index 4264a92ccc..adbdbd7ba6 100644 --- a/modules/nf-core/cat/cat/main.nf +++ b/modules/nf-core/cat/cat/main.nf @@ -22,6 +22,8 @@ process CAT_CAT { def args2 = task.ext.args2 ?: '' def file_list = files_in.collect { it.toString() } + // choose appropriate concatenation tool depending on input and output format + // | input | output | command1 | command2 | // |-----------|------------|----------|----------| // | gzipped | gzipped | cat | | @@ -30,11 +32,15 @@ process CAT_CAT { // | ungzipped | gzipped | cat | pigz | // Use input file ending as default - prefix = task.ext.prefix ?: "${meta.id}${file_list[0].substring(file_list[0].lastIndexOf('.'))}" + prefix = task.ext.prefix ?: "${meta.id}${getFileSuffix(file_list[0])}" out_zip = prefix.endsWith('.gz') in_zip = file_list[0].endsWith('.gz') command1 = (in_zip && !out_zip) ? 'zcat' : 'cat' command2 = (!in_zip && out_zip) ? "| pigz -c -p $task.cpus $args2" : '' + if(file_list.contains(prefix.trim())) { + error "The name of the input file can't be the same as for the output prefix in the " + + "module CAT_CAT (currently `$prefix`). Please choose a different one." + } """ $command1 \\ $args \\ @@ -49,8 +55,12 @@ process CAT_CAT { """ stub: - def file_list = files_in.collect { it.toString() } - prefix = task.ext.prefix ?: "${meta.id}${file_list[0].substring(file_list[0].lastIndexOf('.'))}" + def file_list = files_in.collect { it.toString() } + prefix = task.ext.prefix ?: "${meta.id}${file_list[0].substring(file_list[0].lastIndexOf('.'))}" + if(file_list.contains(prefix.trim())) { + error "The name of the input file can't be the same as for the output prefix in the " + + "module CAT_CAT (currently `$prefix`). Please choose a different one." + } """ touch $prefix @@ -60,3 +70,10 @@ process CAT_CAT { END_VERSIONS """ } + +// for .gz files also include the second to last extension if it is present. E.g., .fasta.gz +def getFileSuffix(filename) { + def match = filename =~ /^.*?((\.\w{1,5})?(\.\w{1,5}\.gz$))/ + return match ? match[0][1] : filename.substring(filename.lastIndexOf('.')) +} + diff --git a/modules/nf-core/cat/cat/tests/main.nf.test b/modules/nf-core/cat/cat/tests/main.nf.test index 5766daafbe..fcee2d19f2 100644 --- a/modules/nf-core/cat/cat/tests/main.nf.test +++ b/modules/nf-core/cat/cat/tests/main.nf.test @@ -8,6 +8,32 @@ nextflow_process { tag "cat" tag "cat/cat" + test("test_cat_name_conflict") { + when { + params { + outdir = "${outputDir}" + } + process { + """ + input[0] = + [ + [ id:'genome', single_end:true ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.sizes', checkIfExists: true) + ] + ] + """ + } + } + then { + assertAll( + { assert !process.success }, + { assert process.stdout.toString().contains("The name of the input file can't be the same as for the output prefix") } + ) + } + } + test("test_cat_unzipped_unzipped") { when { params { @@ -19,8 +45,8 @@ nextflow_process { [ [ id:'test', single_end:true ], [ - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.sizes', checkIfExists: true) ] ] """ @@ -46,8 +72,8 @@ nextflow_process { [ [ id:'test', single_end:true ], [ - file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['contigs_genome_maf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/last/contigs.genome.maf.gz', checkIfExists: true) ] ] """ @@ -76,8 +102,8 @@ nextflow_process { [ [ id:'test', single_end:true ], [ - file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['contigs_genome_maf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/last/contigs.genome.maf.gz', checkIfExists: true) ] ] """ @@ -105,8 +131,8 @@ nextflow_process { [ [ id:'test', single_end:true ], [ - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['genome_sizes'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.sizes', checkIfExists: true) ] ] """ @@ -134,7 +160,7 @@ nextflow_process { [ [ id:'test', single_end:true ], [ - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] ] """ @@ -150,4 +176,3 @@ nextflow_process { } } } - diff --git a/modules/nf-core/cat/fastq/environment.yml b/modules/nf-core/cat/fastq/environment.yml index bff93add01..8c69b121f7 100644 --- a/modules/nf-core/cat/fastq/environment.yml +++ b/modules/nf-core/cat/fastq/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - conda-forge::sed=4.7 + - conda-forge::coreutils=8.30 diff --git a/modules/nf-core/cat/fastq/main.nf b/modules/nf-core/cat/fastq/main.nf index 3d963784cb..f132b2adc1 100644 --- a/modules/nf-core/cat/fastq/main.nf +++ b/modules/nf-core/cat/fastq/main.nf @@ -76,5 +76,4 @@ process CAT_FASTQ { """ } } - } diff --git a/modules/nf-core/cat/fastq/tests/main.nf.test b/modules/nf-core/cat/fastq/tests/main.nf.test index f5f941825c..dab2e14c02 100644 --- a/modules/nf-core/cat/fastq/tests/main.nf.test +++ b/modules/nf-core/cat/fastq/tests/main.nf.test @@ -16,11 +16,11 @@ nextflow_process { } process { """ - input[0] = [ - [ 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[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)] + ]) """ } } @@ -28,8 +28,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.reads).match() }, - { assert path(process.out.versions.get(0)).getText().contains("cat") } + { assert snapshot(process.out).match() } ) } } @@ -42,13 +41,13 @@ nextflow_process { } process { """ - input[0] = [ + input[0] = Channel.of([ [ 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) ] - ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_2.fastq.gz', checkIfExists: true)] + ]) """ } } @@ -56,8 +55,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.reads).match() }, - { assert path(process.out.versions.get(0)).getText().contains("cat") } + { assert snapshot(process.out).match() } ) } } @@ -70,11 +68,11 @@ nextflow_process { } process { """ - input[0] = [ + input[0] = Channel.of([ [ 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) ] - ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)] + ]) """ } } @@ -82,8 +80,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.reads).match() }, - { assert path(process.out.versions.get(0)).getText().contains("cat") } + { assert snapshot(process.out).match() } ) } } @@ -96,13 +93,13 @@ nextflow_process { } process { """ - input[0] = [ + input[0] = Channel.of([ [ 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) ] - ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)] + ]) """ } } @@ -110,8 +107,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.reads).match() }, - { assert path(process.out.versions.get(0)).getText().contains("cat") } + { assert snapshot(process.out).match() } ) } } @@ -124,10 +120,10 @@ nextflow_process { } process { """ - input[0] = [ + input[0] = Channel.of([ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] - ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)] + ]) """ } } @@ -135,8 +131,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.reads).match() }, - { assert path(process.out.versions.get(0)).getText().contains("cat") } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/cat/fastq/tests/main.nf.test.snap b/modules/nf-core/cat/fastq/tests/main.nf.test.snap index ec2342e549..43dfe28fc7 100644 --- a/modules/nf-core/cat/fastq/tests/main.nf.test.snap +++ b/modules/nf-core/cat/fastq/tests/main.nf.test.snap @@ -1,78 +1,169 @@ { "test_cat_fastq_single_end": { "content": [ - [ - [ - { - "id": "test", - "single_end": true - }, - "test.merged.fastq.gz:md5,f9cf5e375f7de81a406144a2c70cc64d" + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,ee314a9bd568d06617171b0c85f508da" + ] + ], + "1": [ + "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,ee314a9bd568d06617171b0c85f508da" + ] + ], + "versions": [ + "versions.yml:md5,d42d6e24d67004608495883e00bd501b" ] - ] + } ], - "timestamp": "2023-10-17T23:19:12.990284837" + "timestamp": "2024-01-17T17:30:39.816981" }, "test_cat_fastq_single_end_same_name": { "content": [ - [ - [ - { - "id": "test", - "single_end": true - }, - "test.merged.fastq.gz:md5,63f817db7a29a03eb538104495556f66" + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,3ad9406595fafec8172368f9cd0b6a22" + ] + ], + "1": [ + "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,3ad9406595fafec8172368f9cd0b6a22" + ] + ], + "versions": [ + "versions.yml:md5,d42d6e24d67004608495883e00bd501b" ] - ] + } ], - "timestamp": "2023-10-17T23:19:31.554568147" + "timestamp": "2024-01-17T17:32:35.229332" }, "test_cat_fastq_single_end_single_file": { "content": [ - [ - [ - { - "id": "test", - "single_end": true - }, - "test.merged.fastq.gz:md5,e325ef7deb4023447a1f074e285761af" + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "1": [ + "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "versions": [ + "versions.yml:md5,d42d6e24d67004608495883e00bd501b" ] - ] + } ], - "timestamp": "2023-10-17T23:19:49.629360033" + "timestamp": "2024-01-17T17:34:00.058829" }, "test_cat_fastq_paired_end_same_name": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, + { + "0": [ [ - "test_1.merged.fastq.gz:md5,63f817db7a29a03eb538104495556f66", - "test_2.merged.fastq.gz:md5,fe9f266f43a6fc3dcab690a18419a56e" + { + "id": "test", + "single_end": false + }, + [ + "test_1.merged.fastq.gz:md5,3ad9406595fafec8172368f9cd0b6a22", + "test_2.merged.fastq.gz:md5,a52cab0b840c7178b0ea83df1fdbe8d5" + ] ] + ], + "1": [ + "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.merged.fastq.gz:md5,3ad9406595fafec8172368f9cd0b6a22", + "test_2.merged.fastq.gz:md5,a52cab0b840c7178b0ea83df1fdbe8d5" + ] + ] + ], + "versions": [ + "versions.yml:md5,d42d6e24d67004608495883e00bd501b" ] - ] + } ], - "timestamp": "2023-10-17T23:19:40.711617539" + "timestamp": "2024-01-17T17:33:33.031555" }, "test_cat_fastq_paired_end": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.merged.fastq.gz:md5,3ad9406595fafec8172368f9cd0b6a22", + "test_2.merged.fastq.gz:md5,a52cab0b840c7178b0ea83df1fdbe8d5" + ] + ] + ], + "1": [ + "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + ], + "reads": [ [ - "test_1.merged.fastq.gz:md5,f9cf5e375f7de81a406144a2c70cc64d", - "test_2.merged.fastq.gz:md5,77c8e966e130d8c6b6ec9be52fcb2bda" + { + "id": "test", + "single_end": false + }, + [ + "test_1.merged.fastq.gz:md5,3ad9406595fafec8172368f9cd0b6a22", + "test_2.merged.fastq.gz:md5,a52cab0b840c7178b0ea83df1fdbe8d5" + ] ] + ], + "versions": [ + "versions.yml:md5,d42d6e24d67004608495883e00bd501b" ] - ] + } ], - "timestamp": "2023-10-18T07:53:20.923560211" + "timestamp": "2024-01-17T17:32:02.270935" } } \ No newline at end of file diff --git a/modules/nf-core/cnvkit/antitarget/environment.yml b/modules/nf-core/cnvkit/antitarget/environment.yml index 08a0b27cea..d40626a56e 100644 --- a/modules/nf-core/cnvkit/antitarget/environment.yml +++ b/modules/nf-core/cnvkit/antitarget/environment.yml @@ -5,4 +5,3 @@ channels: - defaults dependencies: - bioconda::cnvkit=0.9.10 - - bioconda::samtools=1.17 diff --git a/modules/nf-core/cnvkit/batch/environment.yml b/modules/nf-core/cnvkit/batch/environment.yml index eb9ed375b7..10c5d6b753 100644 --- a/modules/nf-core/cnvkit/batch/environment.yml +++ b/modules/nf-core/cnvkit/batch/environment.yml @@ -1,8 +1,11 @@ name: cnvkit_batch + channels: - conda-forge - bioconda - defaults + dependencies: - bioconda::cnvkit=0.9.10 - - bioconda::samtools=1.17 + - bioconda::htslib=1.19.1 + - bioconda::samtools=1.19.2 diff --git a/modules/nf-core/cnvkit/batch/main.nf b/modules/nf-core/cnvkit/batch/main.nf index 3ccc9faa44..9e8aafac65 100644 --- a/modules/nf-core/cnvkit/batch/main.nf +++ b/modules/nf-core/cnvkit/batch/main.nf @@ -32,6 +32,7 @@ process CNVKIT_BATCH { def tumor_exists = tumor ? true : false def normal_exists = normal ? true : false + def reference_exists = reference ? true : false // execute samtools only when cram files are input, cnvkit runs natively on bam but is prohibitively slow def tumor_cram = tumor_exists && tumor.Extension == "cram" ? true : false @@ -62,6 +63,10 @@ process CNVKIT_BATCH { else { normal_args = normal_prefix ? "--normal $normal_out" : "" } + if (reference_exists){ + fasta_args = "" + normal_args = "" + } } // generation of panel of normals @@ -73,7 +78,7 @@ process CNVKIT_BATCH { tumor_out = "" } - def target_args = targets ? "--targets $targets" : "" + def target_args = targets && !reference_exists ? "--targets $targets" : "" def reference_args = reference ? "--reference $reference" : "" def samtools_cram_convert = '' diff --git a/modules/nf-core/cnvkit/batch/meta.yml b/modules/nf-core/cnvkit/batch/meta.yml index 4f88ba3f9b..f14efe553c 100644 --- a/modules/nf-core/cnvkit/batch/meta.yml +++ b/modules/nf-core/cnvkit/batch/meta.yml @@ -18,7 +18,7 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - tumour: + - tumor: type: file description: | Input tumour sample bam file (or cram) @@ -49,7 +49,7 @@ input: description: | Groovy Map containing information about target file e.g. [ id:'test' ] - - targetfile: + - targets: type: file description: | Input target bed file @@ -62,6 +62,10 @@ input: type: file description: | Input reference cnn-file (only for germline and tumor-only running) + - panel_of_normals: + type: file + description: | + Input panel of normals file output: - meta: type: map diff --git a/modules/nf-core/cnvkit/batch/tests/batch_hybrid.config b/modules/nf-core/cnvkit/batch/tests/batch_hybrid.config new file mode 100644 index 0000000000..07a21b1a73 --- /dev/null +++ b/modules/nf-core/cnvkit/batch/tests/batch_hybrid.config @@ -0,0 +1,6 @@ +process { + + withName: CNVKIT_BATCH { + ext.args = '--output-reference reference.cnn' + } +} diff --git a/modules/nf-core/cnvkit/batch/tests/batch_pon.config b/modules/nf-core/cnvkit/batch/tests/batch_pon.config new file mode 100644 index 0000000000..3897370788 --- /dev/null +++ b/modules/nf-core/cnvkit/batch/tests/batch_pon.config @@ -0,0 +1,6 @@ +process { + + withName: CNVKIT_BATCH { + ext.args = '--method wgs --output-reference panel_of_normals.cnn' + } +} diff --git a/modules/nf-core/cnvkit/batch/tests/batch_tumouronly.config b/modules/nf-core/cnvkit/batch/tests/batch_tumouronly.config new file mode 100644 index 0000000000..91074ff0be --- /dev/null +++ b/modules/nf-core/cnvkit/batch/tests/batch_tumouronly.config @@ -0,0 +1,6 @@ +process { + + withName: CNVKIT_BATCH { + ext.args = '--method wgs' + } +} diff --git a/modules/nf-core/cnvkit/batch/tests/batch_wgs.config b/modules/nf-core/cnvkit/batch/tests/batch_wgs.config new file mode 100644 index 0000000000..48fc879535 --- /dev/null +++ b/modules/nf-core/cnvkit/batch/tests/batch_wgs.config @@ -0,0 +1,6 @@ +process { + + withName: CNVKIT_BATCH { + ext.args = '--output-reference reference.cnn --method wgs' + } +} diff --git a/modules/nf-core/cnvkit/batch/tests/main.nf.test b/modules/nf-core/cnvkit/batch/tests/main.nf.test new file mode 100644 index 0000000000..b2c0a9b720 --- /dev/null +++ b/modules/nf-core/cnvkit/batch/tests/main.nf.test @@ -0,0 +1,284 @@ +nextflow_process { + + name "Test Process CNVKIT_BATCH" + script "../main.nf" + process "CNVKIT_BATCH" + + tag "modules" + tag "modules_nfcore" + tag "cnvkit" + tag "cnvkit/batch" + + test("cnvkit batch hybrid mode - bam") { + + config "./batch_hybrid.config" + + when { + process { + """ + input[0] = [ + [ 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) + ] + input[1] = [[:],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[:],[]] + input[3] = [[:],file(params.test_data['sarscov2']['genome']['baits_bed'], checkIfExists: true)] + input[4] = [[:],[]] + input[5] = false + """ + } + } + + then { + println process.out.bed[0][1] + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match() } + ) + } + + } + + test("cnvkit batch wgs - bam") { + + config "./batch_wgs.config" + + when { + process { + """ + input[0] = [ + [ 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) + ] + input[1] = [[:],file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[:],[]] + input[3] = [[:],[]] + input[4] = [[:],[]] + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match() } + ) + } + + } + + test("cnvkit batch wgs - cram") { + + config "./batch_wgs.config" + + when { + process { + """ + input[0] = [ + [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) + ] + input[1] = [[:],file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[:],file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)] + input[3] = [[:],[]] + input[4] = [[:],[]] + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match() } + ) + } + + } + + test("cnvkit batch tumouronly mode - bam") { + + config "./batch_tumouronly.config" + + when { + process { + """ + input[0] = [ + [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + [] + ] + input[1] = [[:],[]] + input[2] = [[:],[]] + input[3] = [[:],[]] + input[4] = [[:],file(params.test_data['homo_sapiens']['genome']['genome_21_reference_cnn'], checkIfExists: true)] + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match() } + ) + } + + } + + test("cnvkit batch tumouronly mode - cram") { + + config "./batch_tumouronly.config" + + when { + process { + """ + input[0] = [ + [ id:'test'], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_cram'], checkIfExists: true), + [] + ] + input[1] = [[:],file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[:],[]] + input[3] = [[:],[]] + input[4] = [[:],file(params.test_data['homo_sapiens']['genome']['genome_21_reference_cnn'], checkIfExists: true)] + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match() } + ) + } + + } + + test("cnvkit batch germline mode - cram") { + + when { + process { + """ + input[0] = [ + [ id:'test'], // meta map + [], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_cram'], checkIfExists: true) + ] + input[1] = [[:],file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)] + input[2] = [[:],file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)] + input[3] = [[:],file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)] + input[4] = [[:],[]] + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match() } + ) + } + + } + + + test("cnvkit batch germline hybrid mode - bam") { + + when { + process { + """ + input[0] = [ + [ 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) + ] + input[1] = [[:],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[:],[]] + input[3] = [[:],file(params.test_data['sarscov2']['genome']['baits_bed'], checkIfExists: true)] + input[4] = [[:],[]] + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match() } + ) + } + + } + + + test("cnvkit batch pon mode - bam") { + + config "./batch_pon.config" + + when { + process { + """ + input[0] = [ + [ id:'test'], // meta map + [], + [file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true) + ] + ] + input[1] = [[:],file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[:],[]] + input[3] = [[:],[]] + input[4] = [[:],[]] + input[5] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.version).match() } + ) + } + + } + + + test("cnvkit batch - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ 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) + ] + input[1] = [[:],file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[:],[]] + input[3] = [[:],file(params.test_data['sarscov2']['genome']['baits_bed'], checkIfExists: true)] + input[4] = [[:],[]] + input[5] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.bed).match() } + ) + } + + } + +} diff --git a/modules/nf-core/cnvkit/batch/tests/main.nf.test.snap b/modules/nf-core/cnvkit/batch/tests/main.nf.test.snap new file mode 100644 index 0000000000..5d7cb143e9 --- /dev/null +++ b/modules/nf-core/cnvkit/batch/tests/main.nf.test.snap @@ -0,0 +1,86 @@ +{ + "cnvkit batch tumouronly mode - bam": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:30:55.150317561" + }, + "cnvkit batch tumouronly mode - cram": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:31:31.039652656" + }, + "cnvkit batch - bam - stub": { + "content": [ + [ + [ + { + "id": "test" + }, + [ + "baits.antitarget.bed:md5,d41d8cd98f00b204e9800998ecf8427e", + "baits.target.bed:md5,26d25ff2d6c45b6d92169b3559c6acdb" + ] + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:33:25.790391941" + }, + "cnvkit batch wgs - bam": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:30:10.677690173" + }, + "cnvkit batch germline hybrid mode - bam": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:32:50.217076532" + }, + "cnvkit batch hybrid mode - bam": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T13:54:41.69602289" + }, + "cnvkit batch wgs - cram": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:30:27.271060826" + }, + "cnvkit batch pon mode - bam": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:33:06.391306794" + }, + "cnvkit batch germline mode - cram": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:32:23.38326412" + } +} \ No newline at end of file diff --git a/modules/nf-core/cnvkit/batch/tests/tags.yml b/modules/nf-core/cnvkit/batch/tests/tags.yml new file mode 100644 index 0000000000..1c8565c829 --- /dev/null +++ b/modules/nf-core/cnvkit/batch/tests/tags.yml @@ -0,0 +1,2 @@ +cnvkit/batch: + - "modules/nf-core/cnvkit/batch/**" diff --git a/modules/nf-core/cnvkit/genemetrics/environment.yml b/modules/nf-core/cnvkit/genemetrics/environment.yml index 2d00f762e2..14deb0ef73 100644 --- a/modules/nf-core/cnvkit/genemetrics/environment.yml +++ b/modules/nf-core/cnvkit/genemetrics/environment.yml @@ -5,4 +5,3 @@ channels: - defaults dependencies: - bioconda::cnvkit=0.9.10 - - bioconda::samtools=1.17 diff --git a/modules/nf-core/cnvkit/reference/environment.yml b/modules/nf-core/cnvkit/reference/environment.yml index 6bb62f9054..35e890e541 100644 --- a/modules/nf-core/cnvkit/reference/environment.yml +++ b/modules/nf-core/cnvkit/reference/environment.yml @@ -5,4 +5,3 @@ channels: - defaults dependencies: - bioconda::cnvkit=0.9.10 - - bioconda::samtools=1.17 diff --git a/modules/nf-core/controlfreec/assesssignificance/controlfreec-assesssignificance.diff b/modules/nf-core/controlfreec/assesssignificance/controlfreec-assesssignificance.diff index c8dc392666..96691730cd 100644 --- a/modules/nf-core/controlfreec/assesssignificance/controlfreec-assesssignificance.diff +++ b/modules/nf-core/controlfreec/assesssignificance/controlfreec-assesssignificance.diff @@ -1,13 +1,4 @@ Changes in module 'nf-core/controlfreec/assesssignificance' ---- modules/nf-core/controlfreec/assesssignificance/environment.yml -+++ modules/nf-core/controlfreec/assesssignificance/environment.yml -@@ -4,4 +4,4 @@ - - bioconda - - defaults - dependencies: -- - bioconda::control-freec=11.6b -+ - bioconda::control-freec=11.6 - --- modules/nf-core/controlfreec/assesssignificance/main.nf +++ modules/nf-core/controlfreec/assesssignificance/main.nf @@ -4,8 +4,8 @@ @@ -21,5 +12,76 @@ Changes in module 'nf-core/controlfreec/assesssignificance' input: tuple val(meta), path(cnvs), path(ratio) +@@ -20,7 +20,7 @@ + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" +- def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. ++ def VERSION = '11.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + """ + cat \$(which assess_significance.R) | R --slave --args ${cnvs} ${ratio} + +@@ -34,7 +34,7 @@ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" +- def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. ++ def VERSION = '11.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + """ + touch ${prefix}.p.value.txt + + +--- modules/nf-core/controlfreec/assesssignificance/environment.yml ++++ modules/nf-core/controlfreec/assesssignificance/environment.yml +@@ -4,4 +4,4 @@ + - bioconda + - defaults + dependencies: +- - bioconda::control-freec=11.6b ++ - bioconda::control-freec=11.6 +--- modules/nf-core/controlfreec/assesssignificance/tests/main.nf.test.snap ++++ modules/nf-core/controlfreec/assesssignificance/tests/main.nf.test.snap +@@ -13,7 +13,7 @@ + ] + ], + "1": [ +- "versions.yml:md5,81750d0b4c0e563bd392720d09ae024f" ++ "versions.yml:md5,0a11399a3318a7c75460c4eb71d58766" + ], + "p_value_txt": [ + [ +@@ -26,26 +26,26 @@ + ] + ], + "versions": [ +- "versions.yml:md5,81750d0b4c0e563bd392720d09ae024f" ++ "versions.yml:md5,0a11399a3318a7c75460c4eb71d58766" + ] + } + ], + "meta": { + "nf-test": "0.8.4", +- "nextflow": "23.10.0" ++ "nextflow": "24.02.0" + }, +- "timestamp": "2024-03-26T16:24:34.84551" ++ "timestamp": "2024-04-05T16:15:36.357267" + }, + "version": { + "content": [ + [ +- "versions.yml:md5,81750d0b4c0e563bd392720d09ae024f" ++ "versions.yml:md5,0a11399a3318a7c75460c4eb71d58766" + ] + ], + "meta": { + "nf-test": "0.8.4", +- "nextflow": "23.10.0" ++ "nextflow": "24.02.0" + }, +- "timestamp": "2024-03-26T17:23:22.833417" ++ "timestamp": "2024-04-05T16:14:54.943475" + } + } ************************************************************ diff --git a/modules/nf-core/controlfreec/assesssignificance/main.nf b/modules/nf-core/controlfreec/assesssignificance/main.nf index 4be70b176d..1adfd6084a 100644 --- a/modules/nf-core/controlfreec/assesssignificance/main.nf +++ b/modules/nf-core/controlfreec/assesssignificance/main.nf @@ -20,6 +20,7 @@ process CONTROLFREEC_ASSESSSIGNIFICANCE { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '11.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ cat \$(which assess_significance.R) | R --slave --args ${cnvs} ${ratio} @@ -27,18 +28,19 @@ process CONTROLFREEC_ASSESSSIGNIFICANCE { cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '11.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch ${prefix}.p.value.txt cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ } diff --git a/modules/nf-core/controlfreec/assesssignificance/tests/main.nf.test b/modules/nf-core/controlfreec/assesssignificance/tests/main.nf.test new file mode 100644 index 0000000000..b44e3b36ab --- /dev/null +++ b/modules/nf-core/controlfreec/assesssignificance/tests/main.nf.test @@ -0,0 +1,159 @@ +nextflow_process { + + name "Test Process CONTROLFREEC_ASSESSSIGNIFICANCE" + script "../main.nf" + process "CONTROLFREEC_ASSESSSIGNIFICANCE" + + tag "modules" + tag "modules_nfcore" + tag "controlfreec" + tag "controlfreec/assesssignificance" + tag "controlfreec/freec" + tag "untar" + + setup { + + run("UNTAR") { + script "../../../../nf-core/untar/main.nf" + process { + """ + input[0] = [ [], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/chromosomes.tar.gz', checkIfExists: true) + ] + """ + } + } + + run("CONTROLFREEC_FREEC") { + script "../../../../nf-core/controlfreec/freec/main.nf" + process { + """ + input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test.mpileup.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), + [],[],[],[] + ] + // fasta + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + // fai + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + // snp_position + input[3] = [] + // known_snps + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) + // known_snps_tbi + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) + // chr_directory + input[6] = UNTAR.out.untar.map{ it[1] } + // mappability + input[7] = [] + // target_bed + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + // gccontent_profile + input[9] = [] + """ + } + } + + } + + test("human - freec_ratio") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = CONTROLFREEC_FREEC.out.CNV.join(CONTROLFREEC_FREEC.out.ratio) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.p_value_txt.get(0).get(1)).readLines().contains("chr start end copy number status genotype uncertainty WilcoxonRankSumTestPvalue KolmogorovSmirnovPvalue") }, + { assert snapshot(process.out.versions).match("version") } + ) + } + + } + + // test("human - freec_ratio - single") { + + // config "./nextflow.config" + + // setup { + + // run("CONTROLFREEC_FREEC") { + // script "../../../../nf-core/controlfreec/freec/main.nf" + // process { + // """ + // input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map + // [], + // file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), + // [],[],[],[] + // ] + // // fasta + // input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + // // fai + // input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + // // snp_position + // input[3] = [] + // // known_snps + // input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) + // // known_snps_tbi + // input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) + // // chr_directory + // input[6] = UNTAR.out.untar.map{ it[1] } + // // mappability + // input[7] = [] + // // target_bed + // input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + // // gccontent_profile + // input[9] = [] + // """ + // } + // } + + // } + + // when { + // process { + // """ + // input[0] = CONTROLFREEC_FREEC.out.CNV.join(CONTROLFREEC_FREEC.out.ratio) + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot(process.out).match() } + // ) + // } + + // } + + test("human - freec_ratio - stub") { + + options "-stub" + + when { + process { + """ + input[0] = CONTROLFREEC_FREEC.out.CNV.join(CONTROLFREEC_FREEC.out.ratio) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/controlfreec/assesssignificance/tests/main.nf.test.snap b/modules/nf-core/controlfreec/assesssignificance/tests/main.nf.test.snap new file mode 100644 index 0000000000..0498b9c5be --- /dev/null +++ b/modules/nf-core/controlfreec/assesssignificance/tests/main.nf.test.snap @@ -0,0 +1,51 @@ +{ + "human - freec_ratio - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test.p.value.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,0a11399a3318a7c75460c4eb71d58766" + ], + "p_value_txt": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test.p.value.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,0a11399a3318a7c75460c4eb71d58766" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-04-05T16:15:36.357267" + }, + "version": { + "content": [ + [ + "versions.yml:md5,0a11399a3318a7c75460c4eb71d58766" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-04-05T16:14:54.943475" + } +} \ No newline at end of file diff --git a/modules/nf-core/controlfreec/assesssignificance/tests/nextflow.config b/modules/nf-core/controlfreec/assesssignificance/tests/nextflow.config new file mode 100644 index 0000000000..ca9c22369c --- /dev/null +++ b/modules/nf-core/controlfreec/assesssignificance/tests/nextflow.config @@ -0,0 +1,23 @@ +process { + withName:CONTROLFREEC_FREEC{ + ext.args = { [ + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + noisydata: "TRUE", + minexpectedgc: "0", + readcountthreshold: "1", + sex: meta.sex, + window: "10", + ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ] + ] + } + } +} diff --git a/modules/nf-core/controlfreec/assesssignificance/tests/tags.yml b/modules/nf-core/controlfreec/assesssignificance/tests/tags.yml new file mode 100644 index 0000000000..35dad632b5 --- /dev/null +++ b/modules/nf-core/controlfreec/assesssignificance/tests/tags.yml @@ -0,0 +1,2 @@ +controlfreec/assesssignificance: + - "modules/nf-core/controlfreec/assesssignificance/**" diff --git a/modules/nf-core/controlfreec/freec/main.nf b/modules/nf-core/controlfreec/freec/main.nf index 65cae5cba8..0f03cbea8f 100644 --- a/modules/nf-core/controlfreec/freec/main.nf +++ b/modules/nf-core/controlfreec/freec/main.nf @@ -89,6 +89,8 @@ process CONTROLFREEC_FREEC { //"Target" configuration def target_bed = target_bed ? "captureRegions = ${target_bed}" : "" + + def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch config.txt @@ -152,12 +154,13 @@ process CONTROLFREEC_FREEC { cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch ${prefix}_ratio.BedGraph touch ${prefix}_sample.cpn @@ -170,7 +173,7 @@ process CONTROLFREEC_FREEC { cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ } diff --git a/modules/nf-core/controlfreec/freec/tests/main.nf.test b/modules/nf-core/controlfreec/freec/tests/main.nf.test new file mode 100644 index 0000000000..90312aebc8 --- /dev/null +++ b/modules/nf-core/controlfreec/freec/tests/main.nf.test @@ -0,0 +1,165 @@ +nextflow_process { + + name "Test Process CONTROLFREEC_FREEC" + script "../main.nf" + process "CONTROLFREEC_FREEC" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "controlfreec" + tag "controlfreec/freec" + tag "untar" + + setup { + + run("UNTAR") { + script "../../../../nf-core/untar/main.nf" + process { + """ + input[0] = [ [], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/chromosomes.tar.gz', checkIfExists: true) + ] + """ + } + } + + } + + test("human - mpileup") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test.mpileup.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), + [],[],[],[] + ] + // fasta + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + // fai + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + // snp_position + input[3] = [] + // known_snps + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) + // known_snps_tbi + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) + // chr_directory + input[6] = UNTAR.out.untar.map{ it[1] } + // mappability + input[7] = [] + // target_bed + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + // gccontent_profile + input[9] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + // not asserting optional outputs [bedgraph, control_cpn, gcprofile_cpn] + { assert snapshot( + // match file names + file(process.out.sample_cpn.get(0).get(1)).name, + file(process.out.CNV.get(0).get(1)).name, + // match first line + path(process.out.BAF.get(0).get(1)).readLines()[0], + path(process.out.ratio.get(0).get(1)).readLines()[0], + path(process.out.config.get(0).get(1)).readLines()[0], + path(process.out.info.get(0).get(1)).readLines()[0] + ).match() }, + { assert snapshot(process.out.versions).match("version") } + ) + } + + } + + // test("human - mpileup - single") { + + // when { + // process { + // """ + // input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map + // [], + // file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), + // [],[],[],[] + // ] + // // fasta + // input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + // // fai + // input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + // // snp_position + // input[3] = [] + // // known_snps + // input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) + // // known_snps_tbi + // input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) + // // chr_directory + // input[6] = UNTAR.out.untar.map{ it[1] } + // // mappability + // input[7] = [] + // // target_bed + // input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + // // gccontent_profile + // input[9] = [] + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot(process.out).match() } + // ) + // } + + // } + + test("human - mpileup - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test.mpileup.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), + [],[],[],[] + ] + // fasta + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + // fai + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + // snp_position + input[3] = [] + // known_snps + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) + // known_snps_tbi + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) + // chr_directory + input[6] = UNTAR.out.untar.map{ it[1] } + // mappability + input[7] = [] + // target_bed + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + // gccontent_profile + input[9] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/controlfreec/freec/tests/main.nf.test.snap b/modules/nf-core/controlfreec/freec/tests/main.nf.test.snap new file mode 100644 index 0000000000..39850d0256 --- /dev/null +++ b/modules/nf-core/controlfreec/freec/tests/main.nf.test.snap @@ -0,0 +1,212 @@ +{ + "human - mpileup - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_ratio.BedGraph:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_sample.cpn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "GC_profile.test.cpn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_BAF.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_CNVs:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_info.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_ratio.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "config.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "9": [ + "versions.yml:md5,e704fc0e6d1ac333dc419498fa128769" + ], + "BAF": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_BAF.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "CNV": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_CNVs:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bedgraph": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_ratio.BedGraph:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "config": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "config.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "control_cpn": [ + + ], + "gcprofile_cpn": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "GC_profile.test.cpn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "info": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_info.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "ratio": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_ratio.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "sample_cpn": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test_sample.cpn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e704fc0e6d1ac333dc419498fa128769" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-26T13:42:56.629043" + }, + "version": { + "content": [ + [ + "versions.yml:md5,e704fc0e6d1ac333dc419498fa128769" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-27T10:01:40.977048" + }, + "human - mpileup": { + "content": [ + "test2.mpileup.gz_sample.cpn", + "test2.mpileup.gz_CNVs", + "Chromosome\tPosition\tBAF\tFittedA\tFittedB\tA\tB\tuncertainty", + "Chromosome\tStart\tRatio\tMedianRatio\tCopyNumber\tBAF\testimatedBAF\tGenotype\tUncertaintyOfGT", + "[general]", + "Program_Version\tv11.6" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-27T10:14:50.936823" + } +} \ No newline at end of file diff --git a/modules/nf-core/controlfreec/freec/tests/nextflow.config b/modules/nf-core/controlfreec/freec/tests/nextflow.config new file mode 100644 index 0000000000..ca9c22369c --- /dev/null +++ b/modules/nf-core/controlfreec/freec/tests/nextflow.config @@ -0,0 +1,23 @@ +process { + withName:CONTROLFREEC_FREEC{ + ext.args = { [ + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + noisydata: "TRUE", + minexpectedgc: "0", + readcountthreshold: "1", + sex: meta.sex, + window: "10", + ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ] + ] + } + } +} diff --git a/modules/nf-core/controlfreec/freec/tests/tags.yml b/modules/nf-core/controlfreec/freec/tests/tags.yml new file mode 100644 index 0000000000..585f06a523 --- /dev/null +++ b/modules/nf-core/controlfreec/freec/tests/tags.yml @@ -0,0 +1,2 @@ +controlfreec/freec: + - "modules/nf-core/controlfreec/freec/**" diff --git a/modules/nf-core/controlfreec/freec2bed/main.nf b/modules/nf-core/controlfreec/freec2bed/main.nf index d2649cf95b..0cb4418484 100644 --- a/modules/nf-core/controlfreec/freec2bed/main.nf +++ b/modules/nf-core/controlfreec/freec2bed/main.nf @@ -20,23 +20,25 @@ process CONTROLFREEC_FREEC2BED { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ freec2bed.pl -f ${ratio} ${args} > ${prefix}.bed cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch ${prefix}.bed cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ } diff --git a/modules/nf-core/controlfreec/freec2bed/tests/main.nf.test b/modules/nf-core/controlfreec/freec2bed/tests/main.nf.test new file mode 100644 index 0000000000..a2ad4b2f95 --- /dev/null +++ b/modules/nf-core/controlfreec/freec2bed/tests/main.nf.test @@ -0,0 +1,158 @@ +nextflow_process { + + name "Test Process CONTROLFREEC_FREEC2BED" + script "../main.nf" + process "CONTROLFREEC_FREEC2BED" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "controlfreec" + tag "controlfreec/freec2bed" + tag "controlfreec/freec" + tag "untar" + + setup { + + run("UNTAR") { + script "../../../../nf-core/untar/main.nf" + process { + """ + input[0] = [ [], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/chromosomes.tar.gz', checkIfExists: true) + ] + """ + } + } + + run("CONTROLFREEC_FREEC") { + script "../../../../nf-core/controlfreec/freec/main.nf" + process { + """ + input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test.mpileup.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), + [],[],[],[] + ] + // fasta + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + // fai + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + // snp_position + input[3] = [] + // known_snps + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) + // known_snps_tbi + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) + // chr_directory + input[6] = UNTAR.out.untar.map{ it[1] } + // mappability + input[7] = [] + // target_bed + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + // gccontent_profile + input[9] = [] + """ + } + } + + } + + test("human - freec_ratio") { + + when { + process { + """ + input[0] = CONTROLFREEC_FREEC.out.ratio + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(path(process.out.bed.get(0).get(1)).readLines()[0]).match() }, + { assert snapshot(process.out.versions).match("version") } + ) + } + + } +// test("human - freec_ratio - single") { + +// config "./nextflow.config" + +// setup { + +// run("CONTROLFREEC_FREEC") { +// script "../../../../nf-core/controlfreec/freec/main.nf" +// process { +// """ +// input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map +// [], +// file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), +// [],[],[],[] +// ] +// // fasta +// input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) +// // fai +// input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) +// // snp_position +// input[3] = [] +// // known_snps +// input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) +// // known_snps_tbi +// input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) +// // chr_directory +// input[6] = UNTAR.out.untar.map{ it[1] } +// // mappability +// input[7] = [] +// // target_bed +// input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) +// // gccontent_profile +// input[9] = [] +// """ +// } +// } + +// } + +// when { +// process { +// """ +// input[0] = CONTROLFREEC_FREEC.out.ratio +// """ +// } +// } + +// then { +// assertAll( +// { assert process.success }, +// { assert snapshot(process.out).match() } +// ) +// } + +// } + + test("human - freec_ratio - stub") { + + options "-stub" + + when { + process { + """ + input[0] = CONTROLFREEC_FREEC.out.ratio + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} + diff --git a/modules/nf-core/controlfreec/freec2bed/tests/main.nf.test.snap b/modules/nf-core/controlfreec/freec2bed/tests/main.nf.test.snap new file mode 100644 index 0000000000..654221f538 --- /dev/null +++ b/modules/nf-core/controlfreec/freec2bed/tests/main.nf.test.snap @@ -0,0 +1,61 @@ +{ + "human - freec_ratio - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,89c8c39d2cb3353505c30c1e0b0cf507" + ], + "bed": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,89c8c39d2cb3353505c30c1e0b0cf507" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T13:36:39.937132" + }, + "human - freec_ratio": { + "content": [ + "chr21 5011211 6115911 1.758106" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T13:39:44.568689" + }, + "version": { + "content": [ + [ + "versions.yml:md5,89c8c39d2cb3353505c30c1e0b0cf507" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T13:35:55.158307" + } +} \ No newline at end of file diff --git a/modules/nf-core/controlfreec/freec2bed/tests/nextflow.config b/modules/nf-core/controlfreec/freec2bed/tests/nextflow.config new file mode 100644 index 0000000000..ca9c22369c --- /dev/null +++ b/modules/nf-core/controlfreec/freec2bed/tests/nextflow.config @@ -0,0 +1,23 @@ +process { + withName:CONTROLFREEC_FREEC{ + ext.args = { [ + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + noisydata: "TRUE", + minexpectedgc: "0", + readcountthreshold: "1", + sex: meta.sex, + window: "10", + ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ] + ] + } + } +} diff --git a/modules/nf-core/controlfreec/freec2bed/tests/tags.yml b/modules/nf-core/controlfreec/freec2bed/tests/tags.yml new file mode 100644 index 0000000000..0316bd2b28 --- /dev/null +++ b/modules/nf-core/controlfreec/freec2bed/tests/tags.yml @@ -0,0 +1,2 @@ +controlfreec/freec2bed: + - "modules/nf-core/controlfreec/freec2bed/**" diff --git a/modules/nf-core/controlfreec/freec2circos/main.nf b/modules/nf-core/controlfreec/freec2circos/main.nf index f80116799c..ecccfde458 100644 --- a/modules/nf-core/controlfreec/freec2circos/main.nf +++ b/modules/nf-core/controlfreec/freec2circos/main.nf @@ -20,23 +20,25 @@ process CONTROLFREEC_FREEC2CIRCOS { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ freec2circos.pl -f ${ratio} ${args} > ${prefix}.circos.txt cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch ${prefix}.circos.txt cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ } diff --git a/modules/nf-core/controlfreec/freec2circos/tests/main.nf.test b/modules/nf-core/controlfreec/freec2circos/tests/main.nf.test new file mode 100644 index 0000000000..2eb5936ad9 --- /dev/null +++ b/modules/nf-core/controlfreec/freec2circos/tests/main.nf.test @@ -0,0 +1,158 @@ +nextflow_process { + + name "Test Process CONTROLFREEC_FREEC2CIRCOS" + script "../main.nf" + process "CONTROLFREEC_FREEC2CIRCOS" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "controlfreec" + tag "controlfreec/freec2circos" + tag "controlfreec/freec" + tag "untar" + + setup { + + run("UNTAR") { + script "../../../../nf-core/untar/main.nf" + process { + """ + input[0] = [ [], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/chromosomes.tar.gz', checkIfExists: true) + ] + """ + } + } + + run("CONTROLFREEC_FREEC") { + script "../../../../nf-core/controlfreec/freec/main.nf" + process { + """ + input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test.mpileup.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), + [],[],[],[] + ] + // fasta + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + // fai + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + // snp_position + input[3] = [] + // known_snps + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) + // known_snps_tbi + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) + // chr_directory + input[6] = UNTAR.out.untar.map{ it[1] } + // mappability + input[7] = [] + // target_bed + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + // gccontent_profile + input[9] = [] + """ + } + } + + } + + test("human - freec_ratio") { + + when { + process { + """ + input[0] = CONTROLFREEC_FREEC.out.ratio + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(path(process.out.circos.get(0).get(1)).readLines()[0]).match() }, + { assert snapshot(process.out.versions).match("version") } + ) + } + + } + + // test("human - freec_ratio - single") { + + // config "./nextflow.config" + + // setup { + + // run("CONTROLFREEC_FREEC") { + // script "../../../../nf-core/controlfreec/freec/main.nf" + // process { + // """ + // input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map + // [], + // file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), + // [],[],[],[] + // ] + // // fasta + // input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + // // fai + // input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + // // snp_position + // input[3] = [] + // // known_snps + // input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) + // // known_snps_tbi + // input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) + // // chr_directory + // input[6] = UNTAR.out.untar.map{ it[1] } + // // mappability + // input[7] = [] + // // target_bed + // input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + // // gccontent_profile + // input[9] = [] + // """ + // } + // } + + // } + + // when { + // process { + // """ + // input[0] = CONTROLFREEC_FREEC.out.ratio + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot(process.out).match() } + // ) + // } + + // } + + test("human - freec_ratio - stub") { + + options "-stub" + + when { + process { + """ + input[0] = CONTROLFREEC_FREEC.out.ratio + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/controlfreec/freec2circos/tests/main.nf.test.snap b/modules/nf-core/controlfreec/freec2circos/tests/main.nf.test.snap new file mode 100644 index 0000000000..91357e7a38 --- /dev/null +++ b/modules/nf-core/controlfreec/freec2circos/tests/main.nf.test.snap @@ -0,0 +1,61 @@ +{ + "human - freec_ratio - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test.circos.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,4f1feb9a79f9bac014447bdcd6571c30" + ], + "circos": [ + [ + { + "id": "test", + "single_end": false, + "sex": "XX" + }, + "test.circos.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,4f1feb9a79f9bac014447bdcd6571c30" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T13:18:29.093673" + }, + "human - freec_ratio": { + "content": [ + "hs21 5011211 5012210 1.758106" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T13:18:10.147735" + }, + "version": { + "content": [ + [ + "versions.yml:md5,4f1feb9a79f9bac014447bdcd6571c30" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T13:18:10.153107" + } +} \ No newline at end of file diff --git a/modules/nf-core/controlfreec/freec2circos/tests/nextflow.config b/modules/nf-core/controlfreec/freec2circos/tests/nextflow.config new file mode 100644 index 0000000000..ca9c22369c --- /dev/null +++ b/modules/nf-core/controlfreec/freec2circos/tests/nextflow.config @@ -0,0 +1,23 @@ +process { + withName:CONTROLFREEC_FREEC{ + ext.args = { [ + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + noisydata: "TRUE", + minexpectedgc: "0", + readcountthreshold: "1", + sex: meta.sex, + window: "10", + ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ] + ] + } + } +} diff --git a/modules/nf-core/controlfreec/freec2circos/tests/tags.yml b/modules/nf-core/controlfreec/freec2circos/tests/tags.yml new file mode 100644 index 0000000000..2f86e3a54d --- /dev/null +++ b/modules/nf-core/controlfreec/freec2circos/tests/tags.yml @@ -0,0 +1,2 @@ +controlfreec/freec2circos: + - "modules/nf-core/controlfreec/freec2circos/**" diff --git a/modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff b/modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff deleted file mode 100644 index 13f4208a05..0000000000 --- a/modules/nf-core/controlfreec/makegraph/controlfreec-makegraph.diff +++ /dev/null @@ -1,23 +0,0 @@ -Changes in module 'nf-core/controlfreec/makegraph' ---- modules/nf-core/controlfreec/makegraph/main.nf -+++ modules/nf-core/controlfreec/makegraph/main.nf -@@ -8,7 +8,7 @@ - 'biocontainers/control-freec:11.6b--hdbdd923_0' }" - - input: -- tuple val(meta), path(ratio), path(baf), val(ploidy) -+ tuple val(meta), path(ratio), path(baf) - - output: - tuple val(meta), path("*_BAF.png") , emit: png_baf -@@ -25,7 +25,7 @@ - def prefix = task.ext.prefix ?: "${meta.id}" - def baf = baf ?: "" - """ -- cat \$(which makeGraph.R) | R --slave --args ${ploidy} ${args} ${ratio} ${baf} -+ cat \$(which makeGraph.R) | R --slave --args ${args} ${ratio} ${baf} - - mv *_BAF.txt.png ${prefix}_BAF.png - mv *_ratio.txt.log2.png ${prefix}_ratio.log2.png - -************************************************************ diff --git a/modules/nf-core/controlfreec/makegraph/environment.yml b/modules/nf-core/controlfreec/makegraph2/environment.yml similarity index 76% rename from modules/nf-core/controlfreec/makegraph/environment.yml rename to modules/nf-core/controlfreec/makegraph2/environment.yml index 897eadf3bd..720c2e950e 100644 --- a/modules/nf-core/controlfreec/makegraph/environment.yml +++ b/modules/nf-core/controlfreec/makegraph2/environment.yml @@ -1,4 +1,4 @@ -name: controlfreec_makegraph +name: controlfreec_makegraph2 channels: - conda-forge - bioconda diff --git a/modules/nf-core/controlfreec/makegraph/main.nf b/modules/nf-core/controlfreec/makegraph2/main.nf similarity index 72% rename from modules/nf-core/controlfreec/makegraph/main.nf rename to modules/nf-core/controlfreec/makegraph2/main.nf index 8d489f71f7..a85589d6f7 100644 --- a/modules/nf-core/controlfreec/makegraph/main.nf +++ b/modules/nf-core/controlfreec/makegraph2/main.nf @@ -1,10 +1,10 @@ -process CONTROLFREEC_MAKEGRAPH { +process CONTROLFREEC_MAKEGRAPH2 { tag "$meta.id" label 'process_low' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/control-freec:11.6b--hdbdd923_0' : + 'https://depot.galaxyproject.org/singularity/control-freec:11.6b--hdbdd923_0': 'biocontainers/control-freec:11.6b--hdbdd923_0' }" input: @@ -24,8 +24,9 @@ process CONTROLFREEC_MAKEGRAPH { def args = task.ext.args ?: "" def prefix = task.ext.prefix ?: "${meta.id}" def baf = baf ?: "" + def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ - cat \$(which makeGraph.R) | R --slave --args ${args} ${ratio} ${baf} + cat \$(which makeGraph2.0.R) | R --slave --args ${args} ${ratio} ${baf} mv *_BAF.txt.png ${prefix}_BAF.png mv *_ratio.txt.log2.png ${prefix}_ratio.log2.png @@ -33,12 +34,13 @@ process CONTROLFREEC_MAKEGRAPH { cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '11.6b' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch ${prefix}_BAF.png touch ${prefix}_ratio.log2.png @@ -46,7 +48,7 @@ process CONTROLFREEC_MAKEGRAPH { cat <<-END_VERSIONS > versions.yml "${task.process}": - controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" ) + controlfreec: $VERSION END_VERSIONS """ } diff --git a/modules/nf-core/controlfreec/makegraph/meta.yml b/modules/nf-core/controlfreec/makegraph2/meta.yml similarity index 89% rename from modules/nf-core/controlfreec/makegraph/meta.yml rename to modules/nf-core/controlfreec/makegraph2/meta.yml index 6f91db38aa..1325da4a8b 100644 --- a/modules/nf-core/controlfreec/makegraph/meta.yml +++ b/modules/nf-core/controlfreec/makegraph2/meta.yml @@ -1,4 +1,4 @@ -name: controlfreec_makegraph +name: controlfreec_makegraph2 description: Plot Freec output keywords: - cna @@ -14,6 +14,7 @@ tools: tool_dev_url: https://github.com/BoevaLab/FREEC/ doi: "10.1093/bioinformatics/btq635" licence: ["GPL >=2"] + input: # Only when we have meta - meta: @@ -29,9 +30,7 @@ input: type: file description: .BAF file generated by FREEC pattern: "*.BAF" - - ploidy: - type: integer - description: Ploidy value for which graph should be created + output: - meta: type: map @@ -54,7 +53,6 @@ output: type: file description: Image of ratio plot pattern: "*_ratio.png" + authors: - "@FriederikeHanssen" -maintainers: - - "@FriederikeHanssen" diff --git a/modules/nf-core/controlfreec/makegraph2/tests/main.nf.test b/modules/nf-core/controlfreec/makegraph2/tests/main.nf.test new file mode 100644 index 0000000000..aed63f02aa --- /dev/null +++ b/modules/nf-core/controlfreec/makegraph2/tests/main.nf.test @@ -0,0 +1,161 @@ +nextflow_process { + + name "Test Process CONTROLFREEC_MAKEGRAPH2" + script "../main.nf" + process "CONTROLFREEC_MAKEGRAPH2" + + tag "modules" + tag "modules_nfcore" + tag "controlfreec" + tag "controlfreec/makegraph2" + tag "controlfreec/freec" + tag "untar" + + setup { + + run("UNTAR") { + script "../../../../nf-core/untar/main.nf" + process { + """ + input[0] = [ [], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/chromosomes.tar.gz', checkIfExists: true) + ] + """ + } + } + + run("CONTROLFREEC_FREEC") { + script "../../../../nf-core/controlfreec/freec/main.nf" + process { + """ + input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test.mpileup.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), + [],[],[],[] + ] + // fasta + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + // fai + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + // snp_position + input[3] = [] + // known_snps + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) + // known_snps_tbi + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) + // chr_directory + input[6] = UNTAR.out.untar.map{ it[1] } + // mappability + input[7] = [] + // target_bed + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + // gccontent_profile + input[9] = [] + """ + } + } + + } + + test("human - freec_ratio") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = CONTROLFREEC_FREEC.out.ratio.join(CONTROLFREEC_FREEC.out.BAF) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("version") } + ) + } + + } + + // test("human - freec_ratio - single") { + + // config "./nextflow.config" + + // setup { + + // run("CONTROLFREEC_FREEC") { + // script "../../../../nf-core/controlfreec/freec/main.nf" + // process { + // """ + // input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map + // [], + // file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), + // [],[],[],[] + // ] + // // fasta + // input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + // // fai + // input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + // // snp_position + // input[3] = [] + // // known_snps + // input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) + // // known_snps_tbi + // input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) + // // chr_directory + // input[6] = UNTAR.out.untar.map{ it[1] } + // // mappability + // input[7] = [] + // // target_bed + // input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + // // gccontent_profile + // input[9] = [] + // """ + // } + // } + + // } + + // when { + // process { + // """ + // input[0] = CONTROLFREEC_FREEC.out.ratio.join(CONTROLFREEC_FREEC.out.BAF) + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot(process.out).match() } + // ) + // } + + // } + + test("human - freec_ratio - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], + [], [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/controlfreec/makegraph2/tests/main.nf.test.snap b/modules/nf-core/controlfreec/makegraph2/tests/main.nf.test.snap new file mode 100644 index 0000000000..81d67b93bb --- /dev/null +++ b/modules/nf-core/controlfreec/makegraph2/tests/main.nf.test.snap @@ -0,0 +1,79 @@ +{ + "human - freec_ratio - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_BAF.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_ratio.log2.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test_ratio.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,2d7885bddfa4a981cd1ed78963d5f514" + ], + "png_baf": [ + [ + { + "id": "test" + }, + "test_BAF.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "png_ratio": [ + [ + { + "id": "test" + }, + "test_ratio.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "png_ratio_log2": [ + [ + { + "id": "test" + }, + "test_ratio.log2.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,2d7885bddfa4a981cd1ed78963d5f514" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-26T16:36:29.963449" + }, + "version": { + "content": [ + [ + "versions.yml:md5,2d7885bddfa4a981cd1ed78963d5f514" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-26T17:14:23.354467" + } +} \ No newline at end of file diff --git a/modules/nf-core/controlfreec/makegraph2/tests/nextflow.config b/modules/nf-core/controlfreec/makegraph2/tests/nextflow.config new file mode 100644 index 0000000000..ca9c22369c --- /dev/null +++ b/modules/nf-core/controlfreec/makegraph2/tests/nextflow.config @@ -0,0 +1,23 @@ +process { + withName:CONTROLFREEC_FREEC{ + ext.args = { [ + "sample":[ + inputformat: 'pileup', + mateorientation: 'FR' + ], + "general" :[ + bedgraphoutput: "TRUE", + noisydata: "TRUE", + minexpectedgc: "0", + readcountthreshold: "1", + sex: meta.sex, + window: "10", + ], + "control":[ + inputformat: "pileup", + mateorientation: "FR" + ] + ] + } + } +} diff --git a/modules/nf-core/controlfreec/makegraph2/tests/tags.yml b/modules/nf-core/controlfreec/makegraph2/tests/tags.yml new file mode 100644 index 0000000000..f787f72aa5 --- /dev/null +++ b/modules/nf-core/controlfreec/makegraph2/tests/tags.yml @@ -0,0 +1,2 @@ +controlfreec/makegraph2: + - "modules/nf-core/controlfreec/makegraph2/**" diff --git a/modules/nf-core/custom/dumpsoftwareversions/environment.yml b/modules/nf-core/custom/dumpsoftwareversions/environment.yml deleted file mode 100644 index f0c63f6984..0000000000 --- a/modules/nf-core/custom/dumpsoftwareversions/environment.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: custom_dumpsoftwareversions -channels: - - conda-forge - - bioconda - - defaults -dependencies: - - bioconda::multiqc=1.17 diff --git a/modules/nf-core/custom/dumpsoftwareversions/main.nf b/modules/nf-core/custom/dumpsoftwareversions/main.nf deleted file mode 100644 index 7685b33cde..0000000000 --- a/modules/nf-core/custom/dumpsoftwareversions/main.nf +++ /dev/null @@ -1,24 +0,0 @@ -process CUSTOM_DUMPSOFTWAREVERSIONS { - label 'process_single' - - // Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.17--pyhdfd78af_0' : - 'biocontainers/multiqc:1.17--pyhdfd78af_0' }" - - input: - path versions - - output: - path "software_versions.yml" , emit: yml - path "software_versions_mqc.yml", emit: mqc_yml - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - template 'dumpsoftwareversions.py' -} diff --git a/modules/nf-core/custom/dumpsoftwareversions/meta.yml b/modules/nf-core/custom/dumpsoftwareversions/meta.yml deleted file mode 100644 index 5f15a5fde0..0000000000 --- a/modules/nf-core/custom/dumpsoftwareversions/meta.yml +++ /dev/null @@ -1,37 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json -name: custom_dumpsoftwareversions -description: Custom module used to dump software versions within the nf-core pipeline template -keywords: - - custom - - dump - - version -tools: - - custom: - description: Custom module used to dump software versions within the nf-core pipeline template - homepage: https://github.com/nf-core/tools - documentation: https://github.com/nf-core/tools - licence: ["MIT"] -input: - - versions: - type: file - description: YML file containing software versions - pattern: "*.yml" -output: - - yml: - type: file - description: Standard YML file containing software versions - pattern: "software_versions.yml" - - mqc_yml: - type: file - description: MultiQC custom content YML file containing software versions - pattern: "software_versions_mqc.yml" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" -authors: - - "@drpatelh" - - "@grst" -maintainers: - - "@drpatelh" - - "@grst" diff --git a/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py b/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py deleted file mode 100755 index da03340857..0000000000 --- a/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python - - -"""Provide functions to merge multiple versions.yml files.""" - - -import yaml -import platform -from textwrap import dedent - - -def _make_versions_html(versions): - """Generate a tabular HTML output of all versions for MultiQC.""" - html = [ - dedent( - """\\ - - - - - - - - - - """ - ) - ] - for process, tmp_versions in sorted(versions.items()): - html.append("") - for i, (tool, version) in enumerate(sorted(tmp_versions.items())): - html.append( - dedent( - f"""\\ - - - - - - """ - ) - ) - html.append("") - html.append("
    Process Name Software Version
    {process if (i == 0) else ''}{tool}{version}
    ") - return "\\n".join(html) - - -def main(): - """Load all version files and generate merged output.""" - versions_this_module = {} - versions_this_module["${task.process}"] = { - "python": platform.python_version(), - "yaml": yaml.__version__, - } - - with open("$versions") as f: - versions_by_process = yaml.load(f, Loader=yaml.BaseLoader) | versions_this_module - - # aggregate versions by the module name (derived from fully-qualified process name) - versions_by_module = {} - for process, process_versions in versions_by_process.items(): - module = process.split(":")[-1] - try: - if versions_by_module[module] != process_versions: - raise AssertionError( - "We assume that software versions are the same between all modules. " - "If you see this error-message it means you discovered an edge-case " - "and should open an issue in nf-core/tools. " - ) - except KeyError: - versions_by_module[module] = process_versions - - versions_by_module["Workflow"] = { - "Nextflow": "$workflow.nextflow.version", - "$workflow.manifest.name": "$workflow.manifest.version", - } - - versions_mqc = { - "id": "software_versions", - "section_name": "${workflow.manifest.name} Software Versions", - "section_href": "https://github.com/${workflow.manifest.name}", - "plot_type": "html", - "description": "are collected at run time from the software output.", - "data": _make_versions_html(versions_by_module), - } - - with open("software_versions.yml", "w") as f: - yaml.dump(versions_by_module, f, default_flow_style=False) - with open("software_versions_mqc.yml", "w") as f: - yaml.dump(versions_mqc, f, default_flow_style=False) - - with open("versions.yml", "w") as f: - yaml.dump(versions_this_module, f, default_flow_style=False) - - -if __name__ == "__main__": - main() diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test deleted file mode 100644 index eec1db10a2..0000000000 --- a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test +++ /dev/null @@ -1,38 +0,0 @@ -nextflow_process { - - name "Test Process CUSTOM_DUMPSOFTWAREVERSIONS" - script "../main.nf" - process "CUSTOM_DUMPSOFTWAREVERSIONS" - tag "modules" - tag "modules_nfcore" - tag "custom" - tag "dumpsoftwareversions" - tag "custom/dumpsoftwareversions" - - test("Should run without failures") { - when { - process { - """ - def tool1_version = ''' - TOOL1: - tool1: 0.11.9 - '''.stripIndent() - - def tool2_version = ''' - TOOL2: - tool2: 1.9 - '''.stripIndent() - - input[0] = Channel.of(tool1_version, tool2_version).collectFile() - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } -} diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap b/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap deleted file mode 100644 index 4274ed57aa..0000000000 --- a/modules/nf-core/custom/dumpsoftwareversions/tests/main.nf.test.snap +++ /dev/null @@ -1,27 +0,0 @@ -{ - "Should run without failures": { - "content": [ - { - "0": [ - "software_versions.yml:md5,1c851188476409cda5752ce971b20b58" - ], - "1": [ - "software_versions_mqc.yml:md5,2570f4ba271ad08357b0d3d32a9cf84d" - ], - "2": [ - "versions.yml:md5,3843ac526e762117eedf8825b40683df" - ], - "mqc_yml": [ - "software_versions_mqc.yml:md5,2570f4ba271ad08357b0d3d32a9cf84d" - ], - "versions": [ - "versions.yml:md5,3843ac526e762117eedf8825b40683df" - ], - "yml": [ - "software_versions.yml:md5,1c851188476409cda5752ce971b20b58" - ] - } - ], - "timestamp": "2023-11-03T14:43:22.157011" - } -} diff --git a/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml b/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml deleted file mode 100644 index 405aa24ae3..0000000000 --- a/modules/nf-core/custom/dumpsoftwareversions/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -custom/dumpsoftwareversions: - - modules/nf-core/custom/dumpsoftwareversions/** diff --git a/modules/nf-core/deepvariant/README.md b/modules/nf-core/deepvariant/README.md new file mode 100644 index 0000000000..ca112a7d33 --- /dev/null +++ b/modules/nf-core/deepvariant/README.md @@ -0,0 +1,9 @@ +# Conda is not supported at the moment + +The [bioconda](https://bioconda.github.io/recipes/deepvariant/README.html) recipe is not fully working as expected + +Hence, we are using the docker container provided by the authors of the tool: + +- [google/deepvariant](https://hub.docker.com/r/google/deepvariant) + +This image is mirrored on the [nf-core quay.io](https://quay.io/repository/nf-core/deepvariant) for convenience. diff --git a/modules/nf-core/deepvariant/environment.yml b/modules/nf-core/deepvariant/environment.yml deleted file mode 100644 index 648a76dea6..0000000000 --- a/modules/nf-core/deepvariant/environment.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: deepvariant -channels: - - conda-forge - - bioconda - - defaults diff --git a/modules/nf-core/deepvariant/main.nf b/modules/nf-core/deepvariant/main.nf index 2d5c480c4d..507b6c1174 100644 --- a/modules/nf-core/deepvariant/main.nf +++ b/modules/nf-core/deepvariant/main.nf @@ -2,6 +2,7 @@ process DEEPVARIANT { tag "$meta.id" label 'process_high' + //Conda is not supported at the moment container "nf-core/deepvariant:1.5.0" input: diff --git a/modules/nf-core/deepvariant/tests/main.nf.test b/modules/nf-core/deepvariant/tests/main.nf.test new file mode 100644 index 0000000000..91612c1e28 --- /dev/null +++ b/modules/nf-core/deepvariant/tests/main.nf.test @@ -0,0 +1,117 @@ +nextflow_process { + + name "Test Process DEEPVARIANT" + script "../main.nf" + process "DEEPVARIANT" + + tag "deepvariant" + tag "modules" + tag "modules_nfcore" + + test("homo_sapiens - [bam, bai] - fasta - fai") { + when { + config "./nextflow.config" + + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ + [],[] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [cram, crai, genome_bed] - fasta - fai") { + config "./nextflow-intervals.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) + ] + input[1] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ + [],[] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [bam, bai] - fasta_gz - fasta_gz_fai") { + when { + config "./nextflow.config" + + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.gz', checkIfExists: true) + ] + input[2] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.gz.fai', checkIfExists: true) + ] + input[3] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.gz.gzi', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} \ No newline at end of file diff --git a/modules/nf-core/deepvariant/tests/main.nf.test.snap b/modules/nf-core/deepvariant/tests/main.nf.test.snap new file mode 100644 index 0000000000..6ad76ae4c3 --- /dev/null +++ b/modules/nf-core/deepvariant/tests/main.nf.test.snap @@ -0,0 +1,269 @@ +{ + "homo_sapiens - [bam, bai] - fasta_gz - fasta_gz_fai": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "4": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ], + "gvcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "gvcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "vcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "versions": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T13:54:42.757335334" + }, + "homo_sapiens - [bam, bai] - fasta - fai": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "4": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ], + "gvcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "gvcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "vcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "versions": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T13:54:18.409489045" + }, + "homo_sapiens - [cram, crai, genome_bed] - fasta - fai": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "4": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ], + "gvcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "gvcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "vcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "versions": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T13:54:30.523871801" + } +} diff --git a/modules/nf-core/deepvariant/tests/nextflow-intervals.config b/modules/nf-core/deepvariant/tests/nextflow-intervals.config new file mode 100644 index 0000000000..6d135f9f10 --- /dev/null +++ b/modules/nf-core/deepvariant/tests/nextflow-intervals.config @@ -0,0 +1,8 @@ +process { + + withName: DEEPVARIANT { + ext.args = '--model_type=WGS ' + ext.prefix = { "${meta.id}_out" } + } + +} diff --git a/modules/nf-core/deepvariant/tests/nextflow.config b/modules/nf-core/deepvariant/tests/nextflow.config new file mode 100644 index 0000000000..d335d30b54 --- /dev/null +++ b/modules/nf-core/deepvariant/tests/nextflow.config @@ -0,0 +1,8 @@ +process { + + withName: DEEPVARIANT { + ext.args = ' --regions=\"chr22:0-40001\" --model_type=WGS ' + ext.prefix = { "${meta.id}_out" } + } + +} diff --git a/modules/nf-core/deepvariant/tests/tags.yml b/modules/nf-core/deepvariant/tests/tags.yml new file mode 100644 index 0000000000..8e838c7ba2 --- /dev/null +++ b/modules/nf-core/deepvariant/tests/tags.yml @@ -0,0 +1,2 @@ +deepvariant: + - modules/nf-core/deepvariant/** diff --git a/modules/nf-core/dragmap/align/dragmap-align.diff b/modules/nf-core/dragmap/align/dragmap-align.diff new file mode 100644 index 0000000000..18a36816d3 --- /dev/null +++ b/modules/nf-core/dragmap/align/dragmap-align.diff @@ -0,0 +1,30 @@ +Changes in module 'nf-core/dragmap/align' +--- modules/nf-core/dragmap/align/main.nf ++++ modules/nf-core/dragmap/align/main.nf +@@ -4,8 +4,8 @@ + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? +- 'https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:7eed251370ac7f3537c3d9472cdb2f9f5d8da1c5-0': +- 'biocontainers/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:7eed251370ac7f3537c3d9472cdb2f9f5d8da1c5-0' }" ++ 'https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:df80ed8d23d0a2c43181a2b3dd1b39f2d00fab5c-0': ++ 'biocontainers/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:df80ed8d23d0a2c43181a2b3dd1b39f2d00fab5c-0' }" + + input: + tuple val(meta) , path(reads) + +--- modules/nf-core/dragmap/align/environment.yml ++++ modules/nf-core/dragmap/align/environment.yml +@@ -4,7 +4,7 @@ + - bioconda + - defaults + dependencies: +- - dragmap=1.3.0 ++ - dragmap=1.2.1 + # renovate: datasource=conda depName=bioconda/samtools +- - samtools=1.18 +- - pigz=2.8 ++ - samtools=1.19.2 ++ - pigz=2.3.4 + +************************************************************ diff --git a/modules/nf-core/dragmap/align/environment.yml b/modules/nf-core/dragmap/align/environment.yml index b00e62f435..a443ce4455 100644 --- a/modules/nf-core/dragmap/align/environment.yml +++ b/modules/nf-core/dragmap/align/environment.yml @@ -6,5 +6,5 @@ channels: dependencies: - dragmap=1.2.1 # renovate: datasource=conda depName=bioconda/samtools - - samtools=1.15.1 + - samtools=1.19.2 - pigz=2.3.4 diff --git a/modules/nf-core/dragmap/align/main.nf b/modules/nf-core/dragmap/align/main.nf index 6eddb2d6c0..30e47992f3 100644 --- a/modules/nf-core/dragmap/align/main.nf +++ b/modules/nf-core/dragmap/align/main.nf @@ -4,17 +4,22 @@ process DRAGMAP_ALIGN { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:5ebebbc128cd624282eaa37d2c7fe01505a91a69-0': - 'biocontainers/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:5ebebbc128cd624282eaa37d2c7fe01505a91a69-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:df80ed8d23d0a2c43181a2b3dd1b39f2d00fab5c-0': + 'biocontainers/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:df80ed8d23d0a2c43181a2b3dd1b39f2d00fab5c-0' }" input: tuple val(meta) , path(reads) tuple val(meta2), path(hashmap) + tuple val(meta3), path(fasta) val sort_bam output: - tuple val(meta), path("*.bam"), emit: bam - tuple val(meta), path('*.log'), emit: log + tuple val(meta), path("*.sam") , emit: sam , optional: true + tuple val(meta), path("*.bam") , emit: bam , optional: true + tuple val(meta), path("*.cram") , emit: cram , optional: true + tuple val(meta), path("*.crai") , emit: crai , optional: true + tuple val(meta), path("*.csi") , emit: csi , optional: true + tuple val(meta), path('*.log') , emit: log path "versions.yml" , emit: versions when: @@ -24,8 +29,13 @@ process DRAGMAP_ALIGN { def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def reads_command = meta.single_end ? "-1 $reads" : "-1 ${reads[0]} -2 ${reads[1]}" - def samtools_command = sort_bam ? 'sort' : 'view' + def reads_command = meta.single_end ? "-1 $reads" : "-1 ${reads[0]} -2 ${reads[1]}" + def samtools_command = sort_bam ? 'sort' : 'view' + def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/ + def extension_matcher = (args2 =~ extension_pattern) + def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam" + def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" + if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" """ dragen-os \\ @@ -33,8 +43,40 @@ process DRAGMAP_ALIGN { $args \\ --num-threads $task.cpus \\ $reads_command \\ - 2> ${prefix}.dragmap.log \\ - | samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam - + 2> >(tee ${prefix}.dragmap.log >&2) \\ + | samtools $samtools_command $args2 --threads $task.cpus ${reference} -o ${prefix}.${extension} - + + 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 + """ + + stub: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def reads_command = meta.single_end ? "-1 $reads" : "-1 ${reads[0]} -2 ${reads[1]}" + def samtools_command = sort_bam ? 'sort' : 'view' + def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/ + def extension_matcher = (args2 =~ extension_pattern) + def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam" + def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" + if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" + + def create_index = "" + if (extension == "cram") { + create_index = "touch ${prefix}.crai" + } else if (extension == "bam") { + create_index = "touch ${prefix}.csi" + } + + """ + touch ${prefix}.${extension} + ${create_index} + touch ${prefix}.log cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/dragmap/align/meta.yml b/modules/nf-core/dragmap/align/meta.yml index f0def75567..2270bd3397 100644 --- a/modules/nf-core/dragmap/align/meta.yml +++ b/modules/nf-core/dragmap/align/meta.yml @@ -33,6 +33,15 @@ input: type: file description: DRAGMAP hash table pattern: "Directory containing DRAGMAP hash table *.{cmp,.bin,.txt}" + - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome'] + - fasta: + type: file + description: Genome fasta reference files + pattern: "*.{fa,fasta,fna}" output: - bam: type: file @@ -43,6 +52,6 @@ output: description: File containing software versions pattern: "versions.yml" authors: - - "@Emiller88" + - "@edmundmiller" maintainers: - - "@Emiller88" + - "@edmundmiller" diff --git a/modules/nf-core/dragmap/align/tests/main.nf.test b/modules/nf-core/dragmap/align/tests/main.nf.test new file mode 100644 index 0000000000..d688c291c1 --- /dev/null +++ b/modules/nf-core/dragmap/align/tests/main.nf.test @@ -0,0 +1,283 @@ +nextflow_process { + + name "Test Process DRAGMAP_ALIGN" + script "../main.nf" + process "DRAGMAP_ALIGN" + tag "modules" + tag "modules_nfcore" + tag "dragmap" + tag "dragmap/align" + tag "dragmap/hashtable" + + test("sarscov2 - fastq, hashtable, fasta, false") { + + setup { + run("DRAGMAP_HASHTABLE") { + script "../../hashtable/main.nf" + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + input[1] = DRAGMAP_HASHTABLE.out.hashmap + input[2] = [[id:'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = false //sort + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") }, + file(process.out.versions[0]).name + ).match() } + ) + } + + } + + test("sarscov2 - fastq, hashtable, fasta, true") { + + setup { + run("DRAGMAP_HASHTABLE") { + script "../../hashtable/main.nf" + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + input[1] = DRAGMAP_HASHTABLE.out.hashmap + input[2] = [[id:'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = true //sort + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") }, + file(process.out.versions[0]).name + ).match() } + ) + } + + } + + test("sarscov2 - [fastq1, fastq2], hashtable, fasta, false") { + + setup { + run("DRAGMAP_HASHTABLE") { + script "../../hashtable/main.nf" + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + input[1] = DRAGMAP_HASHTABLE.out.hashmap + input[2] = [[id:'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = false //sort + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") }, + file(process.out.versions[0]).name + ).match() } + ) + } + + } + + test("sarscov2 - [fastq1, fastq2], hashtable, fasta, true") { + + setup { + run("DRAGMAP_HASHTABLE") { + script "../../hashtable/main.nf" + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + input[1] = DRAGMAP_HASHTABLE.out.hashmap + input[2] = [[id:'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = true //sort + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") }, + file(process.out.versions[0]).name + ).match() } + ) + } + + } + + test("homo_sapiens - [fastq1, fastq2], hashtable, fasta, true") { + + setup { + run("DRAGMAP_HASHTABLE") { + script "../../hashtable/main.nf" + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + input[1] = DRAGMAP_HASHTABLE.out.hashmap + input[2] = [[id:'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = true //sort + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") }, + file(process.out.versions[0]).name + ).match() } + ) + } + + } + + test("sarscov2 - [fastq1, fastq2], hashtable, fasta, true - stub") { + + options "-stub" + setup { + run("DRAGMAP_HASHTABLE") { + script "../../hashtable/main.nf" + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + input[1] = DRAGMAP_HASHTABLE.out.hashmap + input[2] = [[id:'test'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + input[3] = true //sort + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.log[0][1]).name, + file(process.out.versions[0]).name + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/dragmap/align/tests/main.nf.test.snap b/modules/nf-core/dragmap/align/tests/main.nf.test.snap new file mode 100644 index 0000000000..4bd60ebf49 --- /dev/null +++ b/modules/nf-core/dragmap/align/tests/main.nf.test.snap @@ -0,0 +1,109 @@ +{ + "sarscov2 - [fastq1, fastq2], hashtable, fasta, false": { + "content": [ + "test.bam", + [ + "decompHashTableCtxInit...", + "decompHashTableHeader...", + "decompHashTableLiterals...", + "decompHashTableExtIndex...", + "decompHashTableAutoHits...", + "decompHashTableSetFlags..." + ], + "versions.yml" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T10:46:54.961203552" + }, + "homo_sapiens - [fastq1, fastq2], hashtable, fasta, true": { + "content": [ + "test.bam", + [ + "decompHashTableCtxInit...", + "decompHashTableHeader...", + "decompHashTableLiterals...", + "decompHashTableExtIndex...", + "decompHashTableAutoHits...", + "decompHashTableSetFlags..." + ], + "versions.yml" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T10:47:24.495131137" + }, + "sarscov2 - fastq, hashtable, fasta, true": { + "content": [ + "test.bam", + [ + "decompHashTableCtxInit...", + "decompHashTableHeader...", + "decompHashTableLiterals...", + "decompHashTableExtIndex...", + "decompHashTableAutoHits...", + "decompHashTableSetFlags..." + ], + "versions.yml" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T10:46:42.57679755" + }, + "sarscov2 - [fastq1, fastq2], hashtable, fasta, true": { + "content": [ + "test.bam", + [ + "decompHashTableCtxInit...", + "decompHashTableHeader...", + "decompHashTableLiterals...", + "decompHashTableExtIndex...", + "decompHashTableAutoHits...", + "decompHashTableSetFlags..." + ], + "versions.yml" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T10:47:08.943445149" + }, + "sarscov2 - [fastq1, fastq2], hashtable, fasta, true - stub": { + "content": [ + "test.bam", + "test.log", + "versions.yml" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T10:47:38.346392133" + }, + "sarscov2 - fastq, hashtable, fasta, false": { + "content": [ + "test.bam", + [ + "decompHashTableCtxInit...", + "decompHashTableHeader...", + "decompHashTableLiterals...", + "decompHashTableExtIndex...", + "decompHashTableAutoHits...", + "decompHashTableSetFlags..." + ], + "versions.yml" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T10:46:28.406548681" + } +} \ No newline at end of file diff --git a/modules/nf-core/dragmap/align/tests/tags.yml b/modules/nf-core/dragmap/align/tests/tags.yml new file mode 100644 index 0000000000..a2a388af37 --- /dev/null +++ b/modules/nf-core/dragmap/align/tests/tags.yml @@ -0,0 +1,2 @@ +dragmap/align: + - modules/nf-core/dragmap/align/** diff --git a/modules/nf-core/dragmap/hashtable/dragmap-hashtable.diff b/modules/nf-core/dragmap/hashtable/dragmap-hashtable.diff index a5823ce8bc..c2fba762b8 100644 --- a/modules/nf-core/dragmap/hashtable/dragmap-hashtable.diff +++ b/modules/nf-core/dragmap/hashtable/dragmap-hashtable.diff @@ -1,25 +1,25 @@ Changes in module 'nf-core/dragmap/hashtable' ---- modules/nf-core/dragmap/hashtable/environment.yml -+++ modules/nf-core/dragmap/hashtable/environment.yml -@@ -4,4 +4,4 @@ - - bioconda - - defaults - dependencies: -- - bioconda::dragmap=1.3.0 -+ - bioconda::dragmap=1.2.1 - --- modules/nf-core/dragmap/hashtable/main.nf +++ modules/nf-core/dragmap/hashtable/main.nf @@ -4,8 +4,8 @@ conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? -- 'https://depot.galaxyproject.org/singularity/dragmap:1.3.0--h72d16da_1': -- 'biocontainers/dragmap:1.3.0--h72d16da_1' }" +- 'https://depot.galaxyproject.org/singularity/dragmap:1.3.0--h91baf5a_3': +- 'biocontainers/dragmap:1.3.0--h91baf5a_3' }" + 'https://depot.galaxyproject.org/singularity/dragmap:1.2.1--h72d16da_1': + 'biocontainers/dragmap:1.2.1--h72d16da_1' }" input: tuple val(meta), path(fasta) +--- modules/nf-core/dragmap/hashtable/environment.yml ++++ modules/nf-core/dragmap/hashtable/environment.yml +@@ -4,4 +4,4 @@ + - bioconda + - defaults + dependencies: +- - bioconda::dragmap=1.3.0 ++ - bioconda::dragmap=1.2.1 + ************************************************************ diff --git a/modules/nf-core/dragmap/hashtable/main.nf b/modules/nf-core/dragmap/hashtable/main.nf index 604052f33f..d7f0692061 100644 --- a/modules/nf-core/dragmap/hashtable/main.nf +++ b/modules/nf-core/dragmap/hashtable/main.nf @@ -33,4 +33,15 @@ process DRAGMAP_HASHTABLE { dragmap: \$(echo \$(dragen-os --version 2>&1)) END_VERSIONS """ + + stub: + """ + mkdir dragmap + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + dragmap: \$(echo \$(dragen-os --version 2>&1)) + END_VERSIONS + """ + } diff --git a/modules/nf-core/dragmap/hashtable/meta.yml b/modules/nf-core/dragmap/hashtable/meta.yml index 8daca83273..1d1f92f522 100644 --- a/modules/nf-core/dragmap/hashtable/meta.yml +++ b/modules/nf-core/dragmap/hashtable/meta.yml @@ -36,6 +36,6 @@ output: description: File containing software versions pattern: "versions.yml" authors: - - "@Emiller88" + - "@edmundmiller" maintainers: - - "@Emiller88" + - "@edmundmiller" diff --git a/modules/nf-core/dragmap/hashtable/tests/main.nf.test b/modules/nf-core/dragmap/hashtable/tests/main.nf.test new file mode 100644 index 0000000000..474039911f --- /dev/null +++ b/modules/nf-core/dragmap/hashtable/tests/main.nf.test @@ -0,0 +1,69 @@ +nextflow_process { + + name "Test Process DRAGMAP_HASHTABLE" + script "../main.nf" + process "DRAGMAP_HASHTABLE" + tag "modules" + tag "modules_nfcore" + tag "dragmap" + tag "dragmap/hashtable" + + test("sarscov2 - fasta") { + + when { + + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.hashmap[0][1]).name, + file(process.out.versions[0]).name + ).match() + } + ) + } + + } + + test("sarscov2 - fasta - stub") { + + options "-stub" + when { + + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.hashmap[0][1]).name, + file(process.out.versions[0]).name + ).match() + } + ) + } + + } + + // 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/modules/nf-core/dragmap/hashtable/tests/main.nf.test.snap b/modules/nf-core/dragmap/hashtable/tests/main.nf.test.snap new file mode 100644 index 0000000000..9b4b90d8a3 --- /dev/null +++ b/modules/nf-core/dragmap/hashtable/tests/main.nf.test.snap @@ -0,0 +1,16 @@ +{ + "sarscov2 - fasta - stub": { + "content": [ + "dragmap", + "versions.yml" + ], + "timestamp": "2023-11-22T13:42:22.53412378" + }, + "sarscov2 - fasta": { + "content": [ + "dragmap", + "versions.yml" + ], + "timestamp": "2023-11-22T12:53:25.493202451" + } +} \ No newline at end of file diff --git a/modules/nf-core/dragmap/hashtable/tests/tags.yml b/modules/nf-core/dragmap/hashtable/tests/tags.yml new file mode 100644 index 0000000000..cd26117b29 --- /dev/null +++ b/modules/nf-core/dragmap/hashtable/tests/tags.yml @@ -0,0 +1,2 @@ +dragmap/hashtable: + - modules/nf-core/dragmap/hashtable/** diff --git a/modules/nf-core/ensemblvep/download/environment.yml b/modules/nf-core/ensemblvep/download/environment.yml index beebaca634..2ea8642fe4 100644 --- a/modules/nf-core/ensemblvep/download/environment.yml +++ b/modules/nf-core/ensemblvep/download/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::ensembl-vep=110.0 + - bioconda::ensembl-vep=111.0 diff --git a/modules/nf-core/ensemblvep/download/main.nf b/modules/nf-core/ensemblvep/download/main.nf index a770cbfc6f..f9e025a552 100644 --- a/modules/nf-core/ensemblvep/download/main.nf +++ b/modules/nf-core/ensemblvep/download/main.nf @@ -4,24 +4,25 @@ process ENSEMBLVEP_DOWNLOAD { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ensembl-vep:110.0--pl5321h2a3209d_0' : - 'biocontainers/ensembl-vep:110.0--pl5321h2a3209d_0' }" + 'https://depot.galaxyproject.org/singularity/ensembl-vep:111.0--pl5321h2a3209d_0' : + 'biocontainers/ensembl-vep:111.0--pl5321h2a3209d_0' }" input: tuple val(meta), val(assembly), val(species), val(cache_version) output: - tuple val(meta), path("vep_cache"), emit: cache - path "versions.yml" , emit: versions + tuple val(meta), path(prefix), emit: cache + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: 'vep_cache' """ vep_install \\ - --CACHEDIR vep_cache \\ + --CACHEDIR $prefix \\ --SPECIES $species \\ --ASSEMBLY $assembly \\ --CACHE_VERSION $cache_version \\ @@ -34,8 +35,9 @@ process ENSEMBLVEP_DOWNLOAD { """ stub: + prefix = task.ext.prefix ?: 'vep_cache' """ - mkdir vep_cache + mkdir $prefix cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/ensemblvep/download/tests/main.nf.test b/modules/nf-core/ensemblvep/download/tests/main.nf.test new file mode 100644 index 0000000000..760c9d5643 --- /dev/null +++ b/modules/nf-core/ensemblvep/download/tests/main.nf.test @@ -0,0 +1,60 @@ +nextflow_process { + + name "Test Process ENSEMBLVEP_DOWNLOAD" + script "../main.nf" + process "ENSEMBLVEP_DOWNLOAD" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "ensemblvep" + tag "ensemblvep/download" + + test("celegans - download") { + + when { + process { + """ + input[0] = Channel.of([ + [id:"111_WBcel235"], + params.vep_genome, + params.vep_species, + params.vep_cache_version + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("celegans - download - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [id:"111_WBcel235"], + params.vep_genome, + params.vep_species, + params.vep_cache_version + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/ensemblvep/download/tests/main.nf.test.snap b/modules/nf-core/ensemblvep/download/tests/main.nf.test.snap new file mode 100644 index 0000000000..6ea596fbde --- /dev/null +++ b/modules/nf-core/ensemblvep/download/tests/main.nf.test.snap @@ -0,0 +1,322 @@ +{ + "celegans - download": { + "content": [ + { + "0": [ + [ + { + "id": "111_WBcel235" + }, + [ + [ + [ + [ + "1-1000000.gz:md5,4da54db2f781d08975630811fd831585", + "10000001-11000000.gz:md5,7bee73e51d08f5e6de1796614105c5de", + "1000001-2000000.gz:md5,e8beff9020e261d78988c37e804cc89a", + "11000001-12000000.gz:md5,1a31b2dcf58822e837cd91b7a74a8b4f", + "12000001-13000000.gz:md5,34522be2ee5bd3cf51a9b151c877fe35", + "13000001-14000000.gz:md5,4e5a7b604f8aea2ad9de79b75ed89a6b", + "14000001-15000000.gz:md5,65146be110ea58b64ab8518bcbfbde9d", + "15000001-16000000.gz:md5,a39fdb7b0b056c0254574353351722eb", + "2000001-3000000.gz:md5,b72a04531477615dc4d2c530d09e60df", + "3000001-4000000.gz:md5,50dae46f370e1468c8f8f2c97cc75f0b", + "4000001-5000000.gz:md5,e58e124073689212e5311fbd8ccce415", + "5000001-6000000.gz:md5,db27434dc8be9557f97aa09a95126836", + "6000001-7000000.gz:md5,a5131e3ee41b329eb55fb3849ddb1471", + "7000001-8000000.gz:md5,61e1fbe1a82892a0f9f6ee0380fa60bc", + "8000001-9000000.gz:md5,48166dd4518ec21f597b6acca73809bb", + "9000001-10000000.gz:md5,3e416c856f40f36ec0ed3f42a93b2267" + ], + [ + "1-1000000.gz:md5,06b83c3bd2c651c5a8a96f0865d54a53", + "10000001-11000000.gz:md5,79b3348f860370d1697e6d4de128fca3", + "1000001-2000000.gz:md5,f98e31f3e25c0a419ebeee5b17527b00", + "11000001-12000000.gz:md5,5f23214fdef1f7637f6046dc751155ed", + "12000001-13000000.gz:md5,9a4422905679e543a92d47142b1acba1", + "13000001-14000000.gz:md5,c5db99e7d56f2115f8da8fe3af83314a", + "14000001-15000000.gz:md5,66b65af3732c0495dc74f3071203ac2f", + "15000001-16000000.gz:md5,d4c30dc42925cc92dc594d4145544f33", + "2000001-3000000.gz:md5,ff9b3fd1235468c738e9201e2fa98e08", + "3000001-4000000.gz:md5,c649308c7d3b4891a8c6f95e583f3a08", + "4000001-5000000.gz:md5,c53d2fa6695248d0a725ef70325aae91", + "5000001-6000000.gz:md5,5481fb4b60ebd97256f5d52c42aee0bd", + "6000001-7000000.gz:md5,94b82e096bacb091e0ef55bcd08b8ab8", + "7000001-8000000.gz:md5,83f571dfaf8b891bf27208466e6f7d8c", + "8000001-9000000.gz:md5,4f07e30c7d772544bc6e99bac371b97b", + "9000001-10000000.gz:md5,f1439765f6428ae99516d95dc5df3926" + ], + [ + "1-1000000.gz:md5,dab3bbb82e7ecc5430319b7723b88436", + "10000001-11000000.gz:md5,a1af0b4ce9c2ff301ac0a935a4189c58", + "1000001-2000000.gz:md5,8a70e4d08b14a4cf19b03a0556a6cae8", + "11000001-12000000.gz:md5,e866bb880cd79e612dc2081635368017", + "12000001-13000000.gz:md5,1b5be2ca310afd8289561331d19ddf07", + "13000001-14000000.gz:md5,907d2bb3f6b9b75fca9e40f1220c0cb4", + "2000001-3000000.gz:md5,783bcc5957ca4853853c5cda0418dbcd", + "3000001-4000000.gz:md5,cb2df81caa4a20215bb793ca2a792e01", + "4000001-5000000.gz:md5,2046030a187c0a86c9be02531aea0ed7", + "5000001-6000000.gz:md5,395a977401540eb90607b31ecc786a0f", + "6000001-7000000.gz:md5,e6a97128bc38649fcfa5dcb0032a570e", + "7000001-8000000.gz:md5,08804df16d4cdeb5a733d2d6b07b058e", + "8000001-9000000.gz:md5,bba084d260c12613403d144073105d9b", + "9000001-10000000.gz:md5,c0775c413018ed7964f3042112fe4e26" + ], + [ + "1-1000000.gz:md5,710a2c1ad83c3c9751a0f152cd98f02c", + "10000001-11000000.gz:md5,ac93a92e62043bddaa59973e26dac8e0", + "1000001-2000000.gz:md5,232ee5ab6c7295007ffc760f361e4c07", + "11000001-12000000.gz:md5,07e49ac7b78fbc29cd920b11a4d21afc", + "12000001-13000000.gz:md5,7849822cf3df022e9f273fb6a928aa8b", + "13000001-14000000.gz:md5,e3d3f0ee264694c72b3b989a542c5694", + "14000001-15000000.gz:md5,e5771b6c2fefe9f62b23c71ab873f94f", + "15000001-16000000.gz:md5,fa02114035f63a504c48005c498f8ec3", + "16000001-17000000.gz:md5,ef0fd03281afc2e636a64fd61df8c4dc", + "17000001-18000000.gz:md5,4483a6d74a07b1101dccee71a22213ed", + "2000001-3000000.gz:md5,f164cbfdc8bc12efd7c26df3935fe190", + "3000001-4000000.gz:md5,ff05a42801004994a4f30f081bc8945a", + "4000001-5000000.gz:md5,b63f51d54dc3cb4b214b54527dfa4234", + "5000001-6000000.gz:md5,6945f59a1fd50f1dfa8a2f1e55fecc12", + "6000001-7000000.gz:md5,3f27a3cb19ece2a9e87da6fe6476faaa", + "7000001-8000000.gz:md5,05bffc6e8af7a80fdd6cbc53e5512d0c", + "8000001-9000000.gz:md5,8a3594ee1eb15d7aa8edeb325e485dce", + "9000001-10000000.gz:md5,338bce56200690d450d5fcac65a91be7" + ], + [ + "1-1000000.gz:md5,779fda1352c0b1d635aa752c185e6ce2" + ], + [ + "1-1000000.gz:md5,267b3134411641d12bb6efcfd5e9d48d", + "10000001-11000000.gz:md5,4f7473abf622b57ca3c8d6de098759f7", + "1000001-2000000.gz:md5,5587d56269638b9cc88bdb7ae5dacc58", + "11000001-12000000.gz:md5,3da928f2caf09b9e3df58f9d1be2c541", + "12000001-13000000.gz:md5,eae3125082e1674f40fcfb8bb7da23e3", + "13000001-14000000.gz:md5,6a91eccbe0cf05737e2d2971d5618876", + "14000001-15000000.gz:md5,60c9b08ad4f674c0394a7c16dee2713e", + "15000001-16000000.gz:md5,b36c052923f3d3e3cc8db9c2852e1e16", + "16000001-17000000.gz:md5,0d0d7a8735aadda492912d032fd8733b", + "17000001-18000000.gz:md5,cf57648ef4cbc3325cff87e6b4b89653", + "18000001-19000000.gz:md5,5c649205050bfcbb4414db329659dadc", + "19000001-20000000.gz:md5,48838329ef3e8c26dd8b1ba82f925704", + "20000001-21000000.gz:md5,c7e1643d2880881fe5d44f718b8e6755", + "2000001-3000000.gz:md5,94849146caeca44e256aec58f1a914b8", + "3000001-4000000.gz:md5,4601fbb22fda2cbc4ed397707f8f7afd", + "4000001-5000000.gz:md5,7c8617d40b6d2e9a37802691f64f775e", + "5000001-6000000.gz:md5,0e81ba81f807f8429351e46dd8385e0e", + "6000001-7000000.gz:md5,6e86fccda1dc539e291bd5768ffd0dad", + "7000001-8000000.gz:md5,f0bf0306012d738fc71f7a26d7af2d81", + "8000001-9000000.gz:md5,0f3da0d0c714760bc2c39bc6696b74d1", + "9000001-10000000.gz:md5,4e0e2ba92378f6e1f261d5e59d8e3d9f" + ], + [ + "1-1000000.gz:md5,83a0a200cb053b1f28e41fe62068d49a", + "10000001-11000000.gz:md5,2f84058256242378b7d14ef526ed42ea", + "1000001-2000000.gz:md5,c655f70a1d16eef55a5003cdb63434ab", + "11000001-12000000.gz:md5,6d5c34d7a61fa4764c546d1b46a5c90d", + "12000001-13000000.gz:md5,84fceee383bb28edb8d749c744a10932", + "13000001-14000000.gz:md5,aadd01464ca36c813a831f5c2016ba02", + "14000001-15000000.gz:md5,94a5325ca01192d5eea218b30f933ec4", + "15000001-16000000.gz:md5,de84954b08d570585a448d8831c12e6d", + "16000001-17000000.gz:md5,be4954afe2236d62226307f8c9f95820", + "17000001-18000000.gz:md5,8fdacfb47fc5728eb27b22bbb8c9b301", + "2000001-3000000.gz:md5,83552c17d88c3986c56c681b0b49bb97", + "3000001-4000000.gz:md5,deb3bc27c8d431d60fc89a6fe49bcbc6", + "4000001-5000000.gz:md5,98de5bbb694c73f7ffde16fb92069117", + "5000001-6000000.gz:md5,7c5a116261bf41309b18c22b0cba5f52", + "6000001-7000000.gz:md5,fb0d2dc71bd0c9263ff23825d8a4ef64", + "7000001-8000000.gz:md5,2375dcd7787e7ca5d26442cea0ff6710", + "8000001-9000000.gz:md5,979f986c27b91a62873e639e3ebeae43", + "9000001-10000000.gz:md5,b80f6906a724e4b0d6c21dd4c77663fd" + ], + "chr_synonyms.txt:md5,8a6fce00cc7817ec727c49b7954f10bc", + "info.txt:md5,33ccb74a030a9a345051628c337cb8af" + ] + ] + ] + ] + ], + "1": [ + "versions.yml:md5,954fd177c394ba167d575a6aac47390b" + ], + "cache": [ + [ + { + "id": "111_WBcel235" + }, + [ + [ + [ + [ + "1-1000000.gz:md5,4da54db2f781d08975630811fd831585", + "10000001-11000000.gz:md5,7bee73e51d08f5e6de1796614105c5de", + "1000001-2000000.gz:md5,e8beff9020e261d78988c37e804cc89a", + "11000001-12000000.gz:md5,1a31b2dcf58822e837cd91b7a74a8b4f", + "12000001-13000000.gz:md5,34522be2ee5bd3cf51a9b151c877fe35", + "13000001-14000000.gz:md5,4e5a7b604f8aea2ad9de79b75ed89a6b", + "14000001-15000000.gz:md5,65146be110ea58b64ab8518bcbfbde9d", + "15000001-16000000.gz:md5,a39fdb7b0b056c0254574353351722eb", + "2000001-3000000.gz:md5,b72a04531477615dc4d2c530d09e60df", + "3000001-4000000.gz:md5,50dae46f370e1468c8f8f2c97cc75f0b", + "4000001-5000000.gz:md5,e58e124073689212e5311fbd8ccce415", + "5000001-6000000.gz:md5,db27434dc8be9557f97aa09a95126836", + "6000001-7000000.gz:md5,a5131e3ee41b329eb55fb3849ddb1471", + "7000001-8000000.gz:md5,61e1fbe1a82892a0f9f6ee0380fa60bc", + "8000001-9000000.gz:md5,48166dd4518ec21f597b6acca73809bb", + "9000001-10000000.gz:md5,3e416c856f40f36ec0ed3f42a93b2267" + ], + [ + "1-1000000.gz:md5,06b83c3bd2c651c5a8a96f0865d54a53", + "10000001-11000000.gz:md5,79b3348f860370d1697e6d4de128fca3", + "1000001-2000000.gz:md5,f98e31f3e25c0a419ebeee5b17527b00", + "11000001-12000000.gz:md5,5f23214fdef1f7637f6046dc751155ed", + "12000001-13000000.gz:md5,9a4422905679e543a92d47142b1acba1", + "13000001-14000000.gz:md5,c5db99e7d56f2115f8da8fe3af83314a", + "14000001-15000000.gz:md5,66b65af3732c0495dc74f3071203ac2f", + "15000001-16000000.gz:md5,d4c30dc42925cc92dc594d4145544f33", + "2000001-3000000.gz:md5,ff9b3fd1235468c738e9201e2fa98e08", + "3000001-4000000.gz:md5,c649308c7d3b4891a8c6f95e583f3a08", + "4000001-5000000.gz:md5,c53d2fa6695248d0a725ef70325aae91", + "5000001-6000000.gz:md5,5481fb4b60ebd97256f5d52c42aee0bd", + "6000001-7000000.gz:md5,94b82e096bacb091e0ef55bcd08b8ab8", + "7000001-8000000.gz:md5,83f571dfaf8b891bf27208466e6f7d8c", + "8000001-9000000.gz:md5,4f07e30c7d772544bc6e99bac371b97b", + "9000001-10000000.gz:md5,f1439765f6428ae99516d95dc5df3926" + ], + [ + "1-1000000.gz:md5,dab3bbb82e7ecc5430319b7723b88436", + "10000001-11000000.gz:md5,a1af0b4ce9c2ff301ac0a935a4189c58", + "1000001-2000000.gz:md5,8a70e4d08b14a4cf19b03a0556a6cae8", + "11000001-12000000.gz:md5,e866bb880cd79e612dc2081635368017", + "12000001-13000000.gz:md5,1b5be2ca310afd8289561331d19ddf07", + "13000001-14000000.gz:md5,907d2bb3f6b9b75fca9e40f1220c0cb4", + "2000001-3000000.gz:md5,783bcc5957ca4853853c5cda0418dbcd", + "3000001-4000000.gz:md5,cb2df81caa4a20215bb793ca2a792e01", + "4000001-5000000.gz:md5,2046030a187c0a86c9be02531aea0ed7", + "5000001-6000000.gz:md5,395a977401540eb90607b31ecc786a0f", + "6000001-7000000.gz:md5,e6a97128bc38649fcfa5dcb0032a570e", + "7000001-8000000.gz:md5,08804df16d4cdeb5a733d2d6b07b058e", + "8000001-9000000.gz:md5,bba084d260c12613403d144073105d9b", + "9000001-10000000.gz:md5,c0775c413018ed7964f3042112fe4e26" + ], + [ + "1-1000000.gz:md5,710a2c1ad83c3c9751a0f152cd98f02c", + "10000001-11000000.gz:md5,ac93a92e62043bddaa59973e26dac8e0", + "1000001-2000000.gz:md5,232ee5ab6c7295007ffc760f361e4c07", + "11000001-12000000.gz:md5,07e49ac7b78fbc29cd920b11a4d21afc", + "12000001-13000000.gz:md5,7849822cf3df022e9f273fb6a928aa8b", + "13000001-14000000.gz:md5,e3d3f0ee264694c72b3b989a542c5694", + "14000001-15000000.gz:md5,e5771b6c2fefe9f62b23c71ab873f94f", + "15000001-16000000.gz:md5,fa02114035f63a504c48005c498f8ec3", + "16000001-17000000.gz:md5,ef0fd03281afc2e636a64fd61df8c4dc", + "17000001-18000000.gz:md5,4483a6d74a07b1101dccee71a22213ed", + "2000001-3000000.gz:md5,f164cbfdc8bc12efd7c26df3935fe190", + "3000001-4000000.gz:md5,ff05a42801004994a4f30f081bc8945a", + "4000001-5000000.gz:md5,b63f51d54dc3cb4b214b54527dfa4234", + "5000001-6000000.gz:md5,6945f59a1fd50f1dfa8a2f1e55fecc12", + "6000001-7000000.gz:md5,3f27a3cb19ece2a9e87da6fe6476faaa", + "7000001-8000000.gz:md5,05bffc6e8af7a80fdd6cbc53e5512d0c", + "8000001-9000000.gz:md5,8a3594ee1eb15d7aa8edeb325e485dce", + "9000001-10000000.gz:md5,338bce56200690d450d5fcac65a91be7" + ], + [ + "1-1000000.gz:md5,779fda1352c0b1d635aa752c185e6ce2" + ], + [ + "1-1000000.gz:md5,267b3134411641d12bb6efcfd5e9d48d", + "10000001-11000000.gz:md5,4f7473abf622b57ca3c8d6de098759f7", + "1000001-2000000.gz:md5,5587d56269638b9cc88bdb7ae5dacc58", + "11000001-12000000.gz:md5,3da928f2caf09b9e3df58f9d1be2c541", + "12000001-13000000.gz:md5,eae3125082e1674f40fcfb8bb7da23e3", + "13000001-14000000.gz:md5,6a91eccbe0cf05737e2d2971d5618876", + "14000001-15000000.gz:md5,60c9b08ad4f674c0394a7c16dee2713e", + "15000001-16000000.gz:md5,b36c052923f3d3e3cc8db9c2852e1e16", + "16000001-17000000.gz:md5,0d0d7a8735aadda492912d032fd8733b", + "17000001-18000000.gz:md5,cf57648ef4cbc3325cff87e6b4b89653", + "18000001-19000000.gz:md5,5c649205050bfcbb4414db329659dadc", + "19000001-20000000.gz:md5,48838329ef3e8c26dd8b1ba82f925704", + "20000001-21000000.gz:md5,c7e1643d2880881fe5d44f718b8e6755", + "2000001-3000000.gz:md5,94849146caeca44e256aec58f1a914b8", + "3000001-4000000.gz:md5,4601fbb22fda2cbc4ed397707f8f7afd", + "4000001-5000000.gz:md5,7c8617d40b6d2e9a37802691f64f775e", + "5000001-6000000.gz:md5,0e81ba81f807f8429351e46dd8385e0e", + "6000001-7000000.gz:md5,6e86fccda1dc539e291bd5768ffd0dad", + "7000001-8000000.gz:md5,f0bf0306012d738fc71f7a26d7af2d81", + "8000001-9000000.gz:md5,0f3da0d0c714760bc2c39bc6696b74d1", + "9000001-10000000.gz:md5,4e0e2ba92378f6e1f261d5e59d8e3d9f" + ], + [ + "1-1000000.gz:md5,83a0a200cb053b1f28e41fe62068d49a", + "10000001-11000000.gz:md5,2f84058256242378b7d14ef526ed42ea", + "1000001-2000000.gz:md5,c655f70a1d16eef55a5003cdb63434ab", + "11000001-12000000.gz:md5,6d5c34d7a61fa4764c546d1b46a5c90d", + "12000001-13000000.gz:md5,84fceee383bb28edb8d749c744a10932", + "13000001-14000000.gz:md5,aadd01464ca36c813a831f5c2016ba02", + "14000001-15000000.gz:md5,94a5325ca01192d5eea218b30f933ec4", + "15000001-16000000.gz:md5,de84954b08d570585a448d8831c12e6d", + "16000001-17000000.gz:md5,be4954afe2236d62226307f8c9f95820", + "17000001-18000000.gz:md5,8fdacfb47fc5728eb27b22bbb8c9b301", + "2000001-3000000.gz:md5,83552c17d88c3986c56c681b0b49bb97", + "3000001-4000000.gz:md5,deb3bc27c8d431d60fc89a6fe49bcbc6", + "4000001-5000000.gz:md5,98de5bbb694c73f7ffde16fb92069117", + "5000001-6000000.gz:md5,7c5a116261bf41309b18c22b0cba5f52", + "6000001-7000000.gz:md5,fb0d2dc71bd0c9263ff23825d8a4ef64", + "7000001-8000000.gz:md5,2375dcd7787e7ca5d26442cea0ff6710", + "8000001-9000000.gz:md5,979f986c27b91a62873e639e3ebeae43", + "9000001-10000000.gz:md5,b80f6906a724e4b0d6c21dd4c77663fd" + ], + "chr_synonyms.txt:md5,8a6fce00cc7817ec727c49b7954f10bc", + "info.txt:md5,33ccb74a030a9a345051628c337cb8af" + ] + ] + ] + ] + ], + "versions": [ + "versions.yml:md5,954fd177c394ba167d575a6aac47390b" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-04-15T17:20:01.921038" + }, + "celegans - download - stub": { + "content": [ + { + "0": [ + [ + { + "id": "111_WBcel235" + }, + [ + + ] + ] + ], + "1": [ + "versions.yml:md5,954fd177c394ba167d575a6aac47390b" + ], + "cache": [ + [ + { + "id": "111_WBcel235" + }, + [ + + ] + ] + ], + "versions": [ + "versions.yml:md5,954fd177c394ba167d575a6aac47390b" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-04-15T18:09:54.909036" + } +} \ No newline at end of file diff --git a/modules/nf-core/ensemblvep/download/tests/nextflow.config b/modules/nf-core/ensemblvep/download/tests/nextflow.config new file mode 100644 index 0000000000..882bce41a0 --- /dev/null +++ b/modules/nf-core/ensemblvep/download/tests/nextflow.config @@ -0,0 +1,12 @@ +params { + vep_cache_version = "111" + vep_genome = "WBcel235" + vep_species = "caenorhabditis_elegans" +} + +process { + withName: ENSEMBLVEP_DOWNLOAD { + ext.args = '--AUTO c --CONVERT --NO_BIOPERL --NO_HTSLIB --NO_TEST --NO_UPDATE' + ext.prefix = { "${params.vep_cache_version}_${params.vep_genome}" } + } +} diff --git a/modules/nf-core/ensemblvep/download/tests/tags.yml b/modules/nf-core/ensemblvep/download/tests/tags.yml new file mode 100644 index 0000000000..26671f3d31 --- /dev/null +++ b/modules/nf-core/ensemblvep/download/tests/tags.yml @@ -0,0 +1,2 @@ +ensemblvep/download: + - "modules/nf-core/ensemblvep/download/**" diff --git a/modules/nf-core/ensemblvep/vep/environment.yml b/modules/nf-core/ensemblvep/vep/environment.yml index 7a12774608..91457c0508 100644 --- a/modules/nf-core/ensemblvep/vep/environment.yml +++ b/modules/nf-core/ensemblvep/vep/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::ensembl-vep=110.0 + - bioconda::ensembl-vep=111.0 diff --git a/modules/nf-core/ensemblvep/vep/main.nf b/modules/nf-core/ensemblvep/vep/main.nf index 3a2b742348..885efcedb6 100644 --- a/modules/nf-core/ensemblvep/vep/main.nf +++ b/modules/nf-core/ensemblvep/vep/main.nf @@ -4,8 +4,8 @@ process ENSEMBLVEP_VEP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ensembl-vep:110.0--pl5321h2a3209d_0' : - 'biocontainers/ensembl-vep:110.0--pl5321h2a3209d_0' }" + 'https://depot.galaxyproject.org/singularity/ensembl-vep:111.0--pl5321h2a3209d_0' : + 'biocontainers/ensembl-vep:111.0--pl5321h2a3209d_0' }" input: tuple val(meta), path(vcf), path(custom_extra_files) @@ -20,7 +20,7 @@ process ENSEMBLVEP_VEP { tuple val(meta), path("*.vcf.gz") , optional:true, emit: vcf tuple val(meta), path("*.tab.gz") , optional:true, emit: tab tuple val(meta), path("*.json.gz") , optional:true, emit: json - path "*.summary.html" , emit: report + path "*.summary.html" , optional:true, emit: report path "versions.yml" , emit: versions when: @@ -45,8 +45,7 @@ process ENSEMBLVEP_VEP { --cache \\ --cache_version $cache_version \\ --dir_cache $dir_cache \\ - --fork $task.cpus \\ - --stats_file ${prefix}.summary.html \\ + --fork $task.cpus cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/ensemblvep/vep/tests/main.nf.test b/modules/nf-core/ensemblvep/vep/tests/main.nf.test new file mode 100644 index 0000000000..4aff84a3c1 --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/main.nf.test @@ -0,0 +1,114 @@ +nextflow_process { + + name "Test Process ENSEMBLVEP_VEP" + script "../main.nf" + process "ENSEMBLVEP_VEP" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "ensemblvep" + tag "ensemblvep/vep" + tag "ensemblvep/download" + + test("test_ensemblvep_vep_fasta_vcf") { + config "./vcf.config" + + setup { + run("ENSEMBLVEP_DOWNLOAD") { + script "../../download/main.nf" + + process { + """ + input[0] = Channel.of([ + [id:"111_WBcel235"], + params.vep_genome, + params.vep_species, + params.vep_cache_version + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + [] + ]) + input[1] = params.vep_genome + input[2] = params.vep_species + input[3] = params.vep_cache_version + input[4] = ENSEMBLVEP_DOWNLOAD.out.cache.map{ meta, cache -> [cache] } + input[5] = Channel.value([ + [id:"fasta"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[6] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match() }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.2") } + ) + } + + } + + test("test_ensemblvep_vep_fasta_tab_gz") { + config "./tab.gz.config" + + setup { + run("ENSEMBLVEP_DOWNLOAD") { + script "../../download/main.nf" + + process { + """ + input[0] = Channel.of([ + [id:"111_WBcel235"], + params.vep_genome, + params.vep_species, + params.vep_cache_version + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + [] + ]) + input[1] = params.vep_genome + input[2] = params.vep_species + input[3] = params.vep_cache_version + input[4] = ENSEMBLVEP_DOWNLOAD.out.cache.map{ meta, cache -> [cache] } + input[5] = Channel.value([ + [id:"fasta"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[6] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match() }, + { assert path(process.out.tab.get(0).get(1)).linesGzip.contains("## ENSEMBL VARIANT EFFECT PREDICTOR v111.0") } + ) + } + } +} diff --git a/modules/nf-core/ensemblvep/vep/tests/main.nf.test.snap b/modules/nf-core/ensemblvep/vep/tests/main.nf.test.snap new file mode 100644 index 0000000000..f937b29949 --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/main.nf.test.snap @@ -0,0 +1,26 @@ +{ + "test_ensemblvep_vep_fasta_tab_gz": { + "content": [ + [ + "versions.yml:md5,bd2ba1b4741a7d0a224160b50859f4ba" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-04-15T17:35:20.694114" + }, + "test_ensemblvep_vep_fasta_vcf": { + "content": [ + [ + "versions.yml:md5,bd2ba1b4741a7d0a224160b50859f4ba" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-04-15T17:34:41.093843" + } +} \ No newline at end of file diff --git a/modules/nf-core/ensemblvep/vep/tests/nextflow.config b/modules/nf-core/ensemblvep/vep/tests/nextflow.config new file mode 100644 index 0000000000..882bce41a0 --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/nextflow.config @@ -0,0 +1,12 @@ +params { + vep_cache_version = "111" + vep_genome = "WBcel235" + vep_species = "caenorhabditis_elegans" +} + +process { + withName: ENSEMBLVEP_DOWNLOAD { + ext.args = '--AUTO c --CONVERT --NO_BIOPERL --NO_HTSLIB --NO_TEST --NO_UPDATE' + ext.prefix = { "${params.vep_cache_version}_${params.vep_genome}" } + } +} diff --git a/modules/nf-core/ensemblvep/vep/tests/tab.gz.config b/modules/nf-core/ensemblvep/vep/tests/tab.gz.config new file mode 100644 index 0000000000..40eb03e594 --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/tab.gz.config @@ -0,0 +1,5 @@ +process { + withName: ENSEMBLVEP_VEP { + ext.args = '--tab --compress_output bgzip' + } +} diff --git a/modules/nf-core/ensemblvep/vep/tests/tags.yml b/modules/nf-core/ensemblvep/vep/tests/tags.yml new file mode 100644 index 0000000000..4aa4aa458a --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/tags.yml @@ -0,0 +1,2 @@ +ensemblvep/vep: + - "modules/nf-core/ensemblvep/vep/**" diff --git a/modules/nf-core/ensemblvep/vep/tests/vcf.config b/modules/nf-core/ensemblvep/vep/tests/vcf.config new file mode 100644 index 0000000000..ad8955a37e --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/vcf.config @@ -0,0 +1,5 @@ +process { + withName: ENSEMBLVEP_VEP { + ext.args = '--vcf' + } +} diff --git a/modules/nf-core/fastp/main.nf b/modules/nf-core/fastp/main.nf index c8e815aead..4fc19b7443 100644 --- a/modules/nf-core/fastp/main.nf +++ b/modules/nf-core/fastp/main.nf @@ -29,7 +29,7 @@ process FASTP { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def adapter_list = adapter_fasta ? "--adapter_fasta ${adapter_fasta}" : "" - def fail_fastq = save_trimmed_fail && meta.single_end ? "--failed_out ${prefix}.fail.fastq.gz" : save_trimmed_fail && !meta.single_end ? "--unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : '' + def fail_fastq = save_trimmed_fail && meta.single_end ? "--failed_out ${prefix}.fail.fastq.gz" : save_trimmed_fail && !meta.single_end ? "--failed_out ${prefix}.paired.fail.fastq.gz --unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : '' // Added soft-links to original fastqs for consistent naming in MultiQC // Use single ended for interleaved. Add --interleaved_in in config. if ( task.ext.args?.contains('--interleaved_in') ) { @@ -45,7 +45,7 @@ process FASTP { $adapter_list \\ $fail_fastq \\ $args \\ - 2> ${prefix}.fastp.log \\ + 2> >(tee ${prefix}.fastp.log >&2) \\ | gzip -c > ${prefix}.fastp.fastq.gz cat <<-END_VERSIONS > versions.yml @@ -66,7 +66,7 @@ process FASTP { $adapter_list \\ $fail_fastq \\ $args \\ - 2> ${prefix}.fastp.log + 2> >(tee ${prefix}.fastp.log >&2) cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -91,7 +91,7 @@ process FASTP { --thread $task.cpus \\ --detect_adapter_for_pe \\ $args \\ - 2> ${prefix}.fastp.log + 2> >(tee ${prefix}.fastp.log >&2) cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -99,4 +99,22 @@ process FASTP { END_VERSIONS """ } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + def is_single_output = task.ext.args?.contains('--interleaved_in') || meta.single_end + def touch_reads = is_single_output ? "${prefix}.fastp.fastq.gz" : "${prefix}_1.fastp.fastq.gz ${prefix}_2.fastp.fastq.gz" + def touch_merged = (!is_single_output && save_merged) ? "touch ${prefix}.merged.fastq.gz" : "" + """ + touch $touch_reads + touch "${prefix}.fastp.json" + touch "${prefix}.fastp.html" + touch "${prefix}.fastp.log" + $touch_merged + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastp: \$(fastp --version 2>&1 | sed -e "s/fastp //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/fastp/tests/main.nf.test b/modules/nf-core/fastp/tests/main.nf.test index f610b735e2..6f1f489785 100644 --- a/modules/nf-core/fastp/tests/main.nf.test +++ b/modules/nf-core/fastp/tests/main.nf.test @@ -19,11 +19,10 @@ nextflow_process { save_trimmed_fail = false save_merged = false - input[0] = [ + input[0] = Channel.of([ [ id:'test', single_end:true ], - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] - ] - + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + ]) input[1] = adapter_fasta input[2] = save_trimmed_fail input[3] = save_merged @@ -57,7 +56,67 @@ nextflow_process { { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } } }, - { assert snapshot(process.out.versions).match("versions") } + { + assert snapshot( + ( + [process.out.reads[0][0].toString()] + // meta + process.out.reads.collect { file(it[1]).getName() } + + process.out.json.collect { file(it[1]).getName() } + + process.out.html.collect { file(it[1]).getName() } + + process.out.log.collect { file(it[1]).getName() } + + process.out.reads_fail.collect { file(it[1]).getName() } + + process.out.reads_merged.collect { file(it[1]).getName() } + ).sort() + ).match("test_fastp_single_end-_match") + }, + { assert snapshot(process.out.versions).match("versions_single_end") } + ) + } + } + + test("test_fastp_single_end-stub") { + + options '-stub' + + when { + params { + outdir = "$outputDir" + } + process { + """ + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + + input[0] = Channel.of([ + [ id:'test', single_end:true ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + ]) + input[1] = adapter_fasta + input[2] = save_trimmed_fail + input[3] = save_merged + """ + } + } + + then { + + assertAll( + { assert process.success }, + { + assert snapshot( + ( + [process.out.reads[0][0].toString()] + // meta + process.out.reads.collect { file(it[1]).getName() } + + process.out.json.collect { file(it[1]).getName() } + + process.out.html.collect { file(it[1]).getName() } + + process.out.log.collect { file(it[1]).getName() } + + process.out.reads_fail.collect { file(it[1]).getName() } + + process.out.reads_merged.collect { file(it[1]).getName() } + ).sort() + ).match("test_fastp_single_end-for_stub_match") + }, + { assert snapshot(process.out.versions).match("versions_single_end_stub") } ) } } @@ -74,12 +133,11 @@ nextflow_process { save_trimmed_fail = false save_merged = false - input[0] = [ + input[0] = Channel.of([ [ 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.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] + ]) input[1] = adapter_fasta input[2] = save_trimmed_fail input[3] = save_merged @@ -127,13 +185,28 @@ nextflow_process { { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } } }, - { assert snapshot(process.out.versions).match("versions") } + { + assert snapshot( + ( + [process.out.reads[0][0].toString()] + // meta + process.out.reads.collect { it[1].collect { item -> file(item).getName() } } + + process.out.json.collect { file(it[1]).getName() } + + process.out.html.collect { file(it[1]).getName() } + + process.out.log.collect { file(it[1]).getName() } + + process.out.reads_fail.collect { file(it[1]).getName() } + + process.out.reads_merged.collect { file(it[1]).getName() } + ).sort() + ).match("test_fastp_paired_end_match") + }, + { assert snapshot(process.out.versions).match("versions_paired_end") } ) } } - test("fastp test_fastp_interleaved") { - config './nextflow.config' + test("test_fastp_paired_end-stub") { + + options '-stub' + when { params { outdir = "$outputDir" @@ -144,10 +217,56 @@ nextflow_process { save_trimmed_fail = false save_merged = false - input[0] = [ [ id:'test', single_end:true ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_interleaved_fastq_gz'], checkIfExists: true) ] - ] + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] + ]) + input[1] = adapter_fasta + input[2] = save_trimmed_fail + input[3] = save_merged + """ + } + } + then { + assertAll( + { assert process.success }, + { + assert snapshot( + ( + [process.out.reads[0][0].toString()] + // meta + process.out.reads.collect { it[1].collect { item -> file(item).getName() } } + + process.out.json.collect { file(it[1]).getName() } + + process.out.html.collect { file(it[1]).getName() } + + process.out.log.collect { file(it[1]).getName() } + + process.out.reads_fail.collect { file(it[1]).getName() } + + process.out.reads_merged.collect { file(it[1]).getName() } + ).sort() + ).match("test_fastp_paired_end-for_stub_match") + }, + { assert snapshot(process.out.versions).match("versions_paired_end-stub") } + ) + } + } + + test("fastp test_fastp_interleaved") { + + config './nextflow.interleaved.config' + when { + params { + outdir = "$outputDir" + } + process { + """ + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true) ] + ]) input[1] = adapter_fasta input[2] = save_trimmed_fail input[3] = save_merged @@ -159,7 +278,7 @@ nextflow_process { def html_text = [ "Q20 bases:25.719000 K (93.033098%)", "paired end (151 cycles + 151 cycles)"] def log_text = [ "Q20 bases: 12922(92.9841%)", - "reads passed filter: 198"] + "reads passed filter: 162"] def read_lines = [ "@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1", "TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT", "AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE - { assert path(process.out.reads_fail.get(0).get(1).get(1)).linesGzip.contains(failed_read2_line) } + { assert path(process.out.reads_fail.get(0).get(1).get(2)).linesGzip.contains(failed_read2_line) } } }, { html_text.each { html_part -> @@ -321,7 +500,7 @@ nextflow_process { { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } } }, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot(process.out.versions).match("versions_paired_end_trim_fail") } ) } } @@ -337,11 +516,11 @@ nextflow_process { adapter_fasta = [] save_trimmed_fail = false save_merged = true - - input[0] = [ [ 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[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] + ]) input[1] = adapter_fasta input[2] = save_trimmed_fail input[3] = save_merged @@ -399,7 +578,67 @@ nextflow_process { { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } } }, - { assert snapshot(process.out.versions).match("versions") } + { + assert snapshot( + ( + [process.out.reads[0][0].toString()] + // meta + process.out.reads.collect { it[1].collect { item -> file(item).getName() } } + + process.out.json.collect { file(it[1]).getName() } + + process.out.html.collect { file(it[1]).getName() } + + process.out.log.collect { file(it[1]).getName() } + + process.out.reads_fail.collect { file(it[1]).getName() } + + process.out.reads_merged.collect { file(it[1]).getName() } + ).sort() + ).match("test_fastp_paired_end_merged_match") + }, + { assert snapshot(process.out.versions).match("versions_paired_end_merged") } + ) + } + } + + test("test_fastp_paired_end_merged-stub") { + + options '-stub' + + when { + params { + outdir = "$outputDir" + } + process { + """ + adapter_fasta = [] + save_trimmed_fail = false + save_merged = true + + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] + ]) + input[1] = adapter_fasta + input[2] = save_trimmed_fail + input[3] = save_merged + """ + } + } + + then { + assertAll( + { assert process.success }, + { + assert snapshot( + ( + [process.out.reads[0][0].toString()] + // meta + process.out.reads.collect { it[1].collect { item -> file(item).getName() } } + + process.out.json.collect { file(it[1]).getName() } + + process.out.html.collect { file(it[1]).getName() } + + process.out.log.collect { file(it[1]).getName() } + + process.out.reads_fail.collect { file(it[1]).getName() } + + process.out.reads_merged.collect { file(it[1]).getName() } + ).sort() + ).match("test_fastp_paired_end_merged-for_stub_match") + }, + { assert snapshot(process.out.versions).match("versions_paired_end_merged_stub") } ) } } @@ -412,14 +651,15 @@ nextflow_process { } process { """ - adapter_fasta = file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/fastp/adapters.fasta", checkIfExists: true) + adapter_fasta = Channel.of([ file(params.modules_testdata_base_path + 'delete_me/fastp/adapters.fasta', checkIfExists: true) ]) save_trimmed_fail = false save_merged = true - input[0] = [ [ 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[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] + ]) input[1] = adapter_fasta input[2] = save_trimmed_fail input[3] = save_merged @@ -478,7 +718,7 @@ nextflow_process { { assert path(process.out.log.get(0).get(1)).getText().contains(log_part) } } }, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot(process.out.versions).match("versions_paired_end_merged_adapterlist") } ) } } diff --git a/modules/nf-core/fastp/tests/main.nf.test.snap b/modules/nf-core/fastp/tests/main.nf.test.snap index 0fa68c7d71..3e87628898 100644 --- a/modules/nf-core/fastp/tests/main.nf.test.snap +++ b/modules/nf-core/fastp/tests/main.nf.test.snap @@ -7,11 +7,47 @@ "id": "test", "single_end": true }, - "test.fastp.json:md5,168f516f7bd4b7b6c32da7cba87299a4" + "test.fastp.json:md5,b24e0624df5cc0b11cd5ba21b726fb22" ] ] ], - "timestamp": "2023-10-17T11:04:45.794175881" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-18T16:19:15.063001" + }, + "test_fastp_paired_end_merged-for_stub_match": { + "content": [ + [ + [ + "test_1.fastp.fastq.gz", + "test_2.fastp.fastq.gz" + ], + "test.fastp.html", + "test.fastp.json", + "test.fastp.log", + "test.merged.fastq.gz", + "{id=test, single_end=false}" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-17T18:10:13.467574" + }, + "versions_interleaved": { + "content": [ + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T11:56:24.615634793" }, "test_fastp_single_end_json": { "content": [ @@ -25,15 +61,253 @@ ] ] ], - "timestamp": "2023-10-17T11:04:10.566343705" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-18T16:18:43.526412" + }, + "versions_paired_end": { + "content": [ + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T11:55:42.333545689" + }, + "test_fastp_paired_end_match": { + "content": [ + [ + [ + "test_1.fastp.fastq.gz", + "test_2.fastp.fastq.gz" + ], + "test.fastp.html", + "test.fastp.json", + "test.fastp.log", + "{id=test, single_end=false}" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T12:03:06.431833729" + }, + "test_fastp_interleaved-_match": { + "content": [ + [ + "test.fastp.fastq.gz", + "test.fastp.html", + "test.fastp.json", + "test.fastp.log", + "{id=test, single_end=true}" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-18T16:19:15.111894" + }, + "test_fastp_paired_end_merged_match": { + "content": [ + [ + [ + "test_1.fastp.fastq.gz", + "test_2.fastp.fastq.gz" + ], + "test.fastp.html", + "test.fastp.json", + "test.fastp.log", + "test.merged.fastq.gz", + "{id=test, single_end=false}" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T12:08:44.496251446" + }, + "versions_single_end_stub": { + "content": [ + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T11:55:27.354051299" + }, + "versions_interleaved-stub": { + "content": [ + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T11:56:46.535528418" + }, + "versions_single_end_trim_fail": { + "content": [ + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T11:59:03.724591407" + }, + "test_fastp_paired_end-for_stub_match": { + "content": [ + [ + [ + "test_1.fastp.fastq.gz", + "test_2.fastp.fastq.gz" + ], + "test.fastp.html", + "test.fastp.json", + "test.fastp.log", + "{id=test, single_end=false}" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-17T18:07:15.398827" + }, + "versions_paired_end-stub": { + "content": [ + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T11:56:06.50017282" + }, + "versions_single_end": { + "content": [ + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T11:55:07.67921647" + }, + "versions_paired_end_merged_stub": { + "content": [ + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T11:59:47.350653154" + }, + "test_fastp_interleaved-for_stub_match": { + "content": [ + [ + "test.fastp.fastq.gz", + "test.fastp.html", + "test.fastp.json", + "test.fastp.log", + "{id=test, single_end=true}" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-17T18:08:06.127974" + }, + "versions_paired_end_trim_fail": { + "content": [ + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T11:59:18.140484878" + }, + "test_fastp_single_end-for_stub_match": { + "content": [ + [ + "test.fastp.fastq.gz", + "test.fastp.html", + "test.fastp.json", + "test.fastp.log", + "{id=test, single_end=true}" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-17T18:06:00.244202" + }, + "test_fastp_single_end-_match": { + "content": [ + [ + "test.fastp.fastq.gz", + "test.fastp.html", + "test.fastp.json", + "test.fastp.log", + "{id=test, single_end=true}" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-18T16:18:43.580336" + }, + "versions_paired_end_merged_adapterlist": { + "content": [ + [ + "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T12:05:37.845370554" }, - "versions": { + "versions_paired_end_merged": { "content": [ [ "versions.yml:md5,48ffc994212fb1fc9f83a74fa69c9f02" ] ], - "timestamp": "2023-10-17T11:04:10.582076024" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-01T11:59:32.860543858" }, "test_fastp_single_end_trim_fail_json": { "content": [ @@ -47,6 +321,10 @@ ] ] ], - "timestamp": "2023-10-17T11:05:00.379878948" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-17T18:08:41.942317" } } \ No newline at end of file diff --git a/modules/nf-core/fastp/tests/nextflow.interleaved.config b/modules/nf-core/fastp/tests/nextflow.interleaved.config new file mode 100644 index 0000000000..4be8dbd2c8 --- /dev/null +++ b/modules/nf-core/fastp/tests/nextflow.interleaved.config @@ -0,0 +1,5 @@ +process { + withName: FASTP { + ext.args = "--interleaved_in -e 30" + } +} diff --git a/modules/nf-core/fastp/tests/nextflow.config b/modules/nf-core/fastp/tests/nextflow.save_failed.config similarity index 50% rename from modules/nf-core/fastp/tests/nextflow.config rename to modules/nf-core/fastp/tests/nextflow.save_failed.config index 0f7849ad96..53b61b0c15 100644 --- a/modules/nf-core/fastp/tests/nextflow.config +++ b/modules/nf-core/fastp/tests/nextflow.save_failed.config @@ -1,6 +1,5 @@ process { - withName: FASTP { - ext.args = "--interleaved_in" + ext.args = "-e 30" } } diff --git a/modules/nf-core/fastqc/main.nf b/modules/nf-core/fastqc/main.nf index 50e59f2b8c..d79f1c862d 100644 --- a/modules/nf-core/fastqc/main.nf +++ b/modules/nf-core/fastqc/main.nf @@ -25,6 +25,11 @@ process FASTQC { def old_new_pairs = reads instanceof Path || reads.size() == 1 ? [[ reads, "${prefix}.${reads.extension}" ]] : reads.withIndex().collect { entry, index -> [ entry, "${prefix}_${index + 1}.${entry.extension}" ] } def rename_to = old_new_pairs*.join(' ').join(' ') def renamed_files = old_new_pairs.collect{ old_name, new_name -> new_name }.join(' ') + + def memory_in_mb = MemoryUnit.of("${task.memory}").toUnit('MB') + // FastQC memory value allowed range (100 - 10000) + def fastqc_memory = memory_in_mb > 10000 ? 10000 : (memory_in_mb < 100 ? 100 : memory_in_mb) + """ printf "%s %s\\n" $rename_to | while read old_name new_name; do [ -f "\${new_name}" ] || ln -s \$old_name \$new_name @@ -33,11 +38,12 @@ process FASTQC { fastqc \\ $args \\ --threads $task.cpus \\ + --memory $fastqc_memory \\ $renamed_files cat <<-END_VERSIONS > versions.yml "${task.process}": - fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + fastqc: \$( fastqc --version | sed '/FastQC v/!d; s/.*v//' ) END_VERSIONS """ @@ -49,7 +55,7 @@ process FASTQC { cat <<-END_VERSIONS > versions.yml "${task.process}": - fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + fastqc: \$( fastqc --version | sed '/FastQC v/!d; s/.*v//' ) END_VERSIONS """ } diff --git a/modules/nf-core/fastqc/tests/main.nf.test b/modules/nf-core/fastqc/tests/main.nf.test index 6437a144d9..70edae4d99 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test +++ b/modules/nf-core/fastqc/tests/main.nf.test @@ -3,24 +3,20 @@ nextflow_process { name "Test Process FASTQC" script "../main.nf" process "FASTQC" + tag "modules" tag "modules_nfcore" tag "fastqc" - test("Single-Read") { + test("sarscov2 single-end [fastq]") { when { - params { - outdir = "$outputDir" - } process { """ - input[0] = [ + input[0] = Channel.of([ [ id: 'test', single_end:true ], - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + ]) """ } } @@ -28,14 +24,189 @@ nextflow_process { then { assertAll ( { assert process.success }, + // NOTE The report contains the date inside it, which means that the md5sum is stable per day, but not longer than that. So you can't md5sum it. // looks like this:
    Mon 2 Oct 2023
    test.gz
    // https://github.com/nf-core/modules/pull/3903#issuecomment-1743620039 - { assert process.out.html.get(0).get(1) ==~ ".*/test_fastqc.html" }, - { assert path(process.out.html.get(0).get(1)).getText().contains("File typeConventional base calls") }, - { assert snapshot(process.out.versions).match("versions") }, - { assert process.out.zip.get(0).get(1) ==~ ".*/test_fastqc.zip" } + + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("fastqc_versions_single") } + ) + } + } + + test("sarscov2 paired-end [fastq]") { + + when { + process { + """ + input[0] = Channel.of([ + [id: 'test', single_end: false], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + + { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, + { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, + { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, + { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, + { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("fastqc_versions_paired") } + ) + } + } + + test("sarscov2 interleaved [fastq]") { + + when { + process { + """ + input[0] = Channel.of([ + [id: 'test', single_end: false], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("fastqc_versions_interleaved") } ) } } + + test("sarscov2 paired-end [bam]") { + + when { + process { + """ + input[0] = Channel.of([ + [id: 'test', single_end: false], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("fastqc_versions_bam") } + ) + } + } + + test("sarscov2 multiple [fastq]") { + + when { + process { + """ + input[0] = Channel.of([ + [id: 'test', single_end: false], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_2.fastq.gz', checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + + { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, + { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, + { assert process.out.html[0][1][2] ==~ ".*/test_3_fastqc.html" }, + { assert process.out.html[0][1][3] ==~ ".*/test_4_fastqc.html" }, + { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, + { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, + { assert process.out.zip[0][1][2] ==~ ".*/test_3_fastqc.zip" }, + { assert process.out.zip[0][1][3] ==~ ".*/test_4_fastqc.zip" }, + { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][2]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][3]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("fastqc_versions_multiple") } + ) + } + } + + test("sarscov2 custom_prefix") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'mysample', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + + { assert process.out.html[0][1] ==~ ".*/mysample_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/mysample_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + + { assert snapshot(process.out.versions).match("fastqc_versions_custom_prefix") } + ) + } + } + + test("sarscov2 single-end [fastq] - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id: 'test', single_end:true ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.html.collect { file(it[1]).getName() } + + process.out.zip.collect { file(it[1]).getName() } + + process.out.versions ).match("fastqc_stub") } + ) + } + } + } diff --git a/modules/nf-core/fastqc/tests/main.nf.test.snap b/modules/nf-core/fastqc/tests/main.nf.test.snap index 636a32cead..86f7c31154 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test.snap +++ b/modules/nf-core/fastqc/tests/main.nf.test.snap @@ -1,10 +1,88 @@ { - "versions": { + "fastqc_versions_interleaved": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], - "timestamp": "2023-10-09T23:40:54+0000" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-31T17:40:07.293713" + }, + "fastqc_stub": { + "content": [ + [ + "test.html", + "test.zip", + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-31T17:31:01.425198" + }, + "fastqc_versions_multiple": { + "content": [ + [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-31T17:40:55.797907" + }, + "fastqc_versions_bam": { + "content": [ + [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-31T17:40:26.795862" + }, + "fastqc_versions_single": { + "content": [ + [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-31T17:39:27.043675" + }, + "fastqc_versions_paired": { + "content": [ + [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-31T17:39:47.584191" + }, + "fastqc_versions_custom_prefix": { + "content": [ + [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-01-31T17:41:14.576531" } } \ No newline at end of file diff --git a/modules/nf-core/fgbio/fastqtobam/environment.yml b/modules/nf-core/fgbio/fastqtobam/environment.yml index f5f1992581..4b1b9e6ecf 100644 --- a/modules/nf-core/fgbio/fastqtobam/environment.yml +++ b/modules/nf-core/fgbio/fastqtobam/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::fgbio=2.0.2 + - bioconda::fgbio=2.1.0 diff --git a/modules/nf-core/fgbio/fastqtobam/main.nf b/modules/nf-core/fgbio/fastqtobam/main.nf index f7302171b8..f50545c442 100644 --- a/modules/nf-core/fgbio/fastqtobam/main.nf +++ b/modules/nf-core/fgbio/fastqtobam/main.nf @@ -2,10 +2,12 @@ process FGBIO_FASTQTOBAM { tag "$meta.id" label 'process_low' + // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + // --version argument gives the wrong version conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/fgbio:2.0.2--hdfd78af_0' : - 'biocontainers/fgbio:2.0.2--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/fgbio:2.1.0--hdfd78af_0' : + 'biocontainers/fgbio:2.1.0--hdfd78af_0' }" input: tuple val(meta), path(reads) @@ -21,9 +23,11 @@ process FGBIO_FASTQTOBAM { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = task.ext.suffix ?: "bam" def sample_name = args.contains("--sample") ? "" : "--sample ${prefix}" def library_name = args.contains("--library") ? "" : "--library ${prefix}" - def output = prefix =~ /\.(bam|cram)$/ ? prefix : "${prefix}.bam" + + def VERSION = '2.1.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ fgbio \\ @@ -31,13 +35,29 @@ process FGBIO_FASTQTOBAM { FastqToBam \\ ${args} \\ --input ${reads} \\ - --output ${output} \\ + --output ${prefix}.${suffix} \\ ${sample_name} \\ ${library_name} cat <<-END_VERSIONS > versions.yml "${task.process}": - fgbio: \$( echo \$(fgbio --version 2>&1 | tr -d '[:cntrl:]' ) | sed -e 's/^.*Version: //;s/\\[.*\$//') + fgbio: $VERSION + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = task.ext.suffix ?: "bam" + + def VERSION = '2.1.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + + """ + touch ${prefix}.${suffix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fgbio: $VERSION END_VERSIONS """ } diff --git a/modules/nf-core/fgbio/fastqtobam/meta.yml b/modules/nf-core/fgbio/fastqtobam/meta.yml index 4b37cd530f..f26f29da29 100644 --- a/modules/nf-core/fgbio/fastqtobam/meta.yml +++ b/modules/nf-core/fgbio/fastqtobam/meta.yml @@ -2,8 +2,9 @@ name: fgbio_fastqtobam description: | Using the fgbio tools, converts FASTQ files sequenced into unaligned BAM or CRAM files possibly moving the UMI barcode into the RX field of the reads keywords: - - fastqtobam - - fgbio + - unaligned + - bam + - cram tools: - fgbio: description: A set of tools for working with genomic and high throughput sequencing data, including UMIs @@ -37,6 +38,8 @@ output: authors: - "@lescai" - "@matthdsm" + - "@nvnieuwk" maintainers: - "@lescai" - "@matthdsm" + - "@nvnieuwk" diff --git a/modules/nf-core/fgbio/fastqtobam/tests/bam.config b/modules/nf-core/fgbio/fastqtobam/tests/bam.config new file mode 100644 index 0000000000..014ba9205a --- /dev/null +++ b/modules/nf-core/fgbio/fastqtobam/tests/bam.config @@ -0,0 +1,3 @@ +process { + ext.suffix = "bam" +} \ No newline at end of file diff --git a/modules/nf-core/fgbio/fastqtobam/tests/cram.config b/modules/nf-core/fgbio/fastqtobam/tests/cram.config new file mode 100644 index 0000000000..2406cb99e1 --- /dev/null +++ b/modules/nf-core/fgbio/fastqtobam/tests/cram.config @@ -0,0 +1,3 @@ +process { + ext.suffix = "cram" +} \ No newline at end of file diff --git a/modules/nf-core/fgbio/fastqtobam/tests/custom_sample.config b/modules/nf-core/fgbio/fastqtobam/tests/custom_sample.config new file mode 100644 index 0000000000..2ed567b4db --- /dev/null +++ b/modules/nf-core/fgbio/fastqtobam/tests/custom_sample.config @@ -0,0 +1,3 @@ +process { + ext.args = "--sample CustomSample --library CustomLibrary" +} \ No newline at end of file diff --git a/modules/nf-core/fgbio/fastqtobam/tests/main.nf.test b/modules/nf-core/fgbio/fastqtobam/tests/main.nf.test new file mode 100644 index 0000000000..da90b17ce4 --- /dev/null +++ b/modules/nf-core/fgbio/fastqtobam/tests/main.nf.test @@ -0,0 +1,216 @@ +nextflow_process { + + name "Test Process FGBIO_FASTQTOBAM" + script "../main.nf" + process "FGBIO_FASTQTOBAM" + + tag "modules" + tag "modules_nfcore" + tag "fgbio" + tag "fgbio/fastqtobam" + + test("homo_sapiens - [fastq1, fastq2] - default") { + + when { + process { + """ + input[0] = [ + [ 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) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.cram, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - [fastq1, fastq2] - cram") { + + config "./cram.config" + when { + process { + """ + input[0] = [ + [ 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) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.bam, + file(process.out.cram[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - [fastq1, fastq2] - bam") { + + config "./bam.config" + when { + process { + """ + input[0] = [ + [ 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) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.cram, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - fastq1") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_umi_1_fastq_gz'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.cram, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - [fastq1, fastq2] - umi") { + + config "./umi.config" + when { + process { + """ + input[0] = [ + [ 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) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.cram, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - [fastq1, fastq2] - custom sample") { + + config "./custom_sample.config" + when { + process { + """ + input[0] = [ + [ 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) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.cram, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - [fastq1, fastq2] - stub") { + + options "-stub" + when { + process { + """ + input[0] = [ + [ 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) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + process.out.cram, + process.out.versions + ).match() } + ) + } + + } +} diff --git a/modules/nf-core/fgbio/fastqtobam/tests/main.nf.test.snap b/modules/nf-core/fgbio/fastqtobam/tests/main.nf.test.snap new file mode 100644 index 0000000000..00831f0c5f --- /dev/null +++ b/modules/nf-core/fgbio/fastqtobam/tests/main.nf.test.snap @@ -0,0 +1,86 @@ +{ + "homo_sapiens - [fastq1, fastq2] - cram": { + "content": [ + [ + + ], + "test.cram", + [ + "versions.yml:md5,f4e3de8480e34bd985000ee28a1f2405" + ] + ], + "timestamp": "2023-11-27T14:13:21.972159804" + }, + "homo_sapiens - fastq1": { + "content": [ + "test.bam", + [ + + ], + [ + "versions.yml:md5,f4e3de8480e34bd985000ee28a1f2405" + ] + ], + "timestamp": "2023-11-27T14:13:42.872247708" + }, + "homo_sapiens - [fastq1, fastq2] - default": { + "content": [ + "test.bam", + [ + + ], + [ + "versions.yml:md5,f4e3de8480e34bd985000ee28a1f2405" + ] + ], + "timestamp": "2023-11-27T14:13:10.377114559" + }, + "homo_sapiens - [fastq1, fastq2] - umi": { + "content": [ + "test.bam", + [ + + ], + [ + "versions.yml:md5,f4e3de8480e34bd985000ee28a1f2405" + ] + ], + "timestamp": "2023-11-27T14:13:53.4971996" + }, + "homo_sapiens - [fastq1, fastq2] - bam": { + "content": [ + "test.bam", + [ + + ], + [ + "versions.yml:md5,f4e3de8480e34bd985000ee28a1f2405" + ] + ], + "timestamp": "2023-11-27T14:13:32.920615998" + }, + "homo_sapiens - [fastq1, fastq2] - custom sample": { + "content": [ + "test.bam", + [ + + ], + [ + "versions.yml:md5,f4e3de8480e34bd985000ee28a1f2405" + ] + ], + "timestamp": "2023-11-27T14:14:03.897969056" + }, + "homo_sapiens - [fastq1, fastq2] - stub": { + "content": [ + "test.bam", + [ + + ], + [ + "versions.yml:md5,f4e3de8480e34bd985000ee28a1f2405" + ] + ], + "timestamp": "2023-11-27T14:14:11.765938243" + } +} \ No newline at end of file diff --git a/modules/nf-core/fgbio/fastqtobam/tests/tags.yml b/modules/nf-core/fgbio/fastqtobam/tests/tags.yml new file mode 100644 index 0000000000..0e40ba3563 --- /dev/null +++ b/modules/nf-core/fgbio/fastqtobam/tests/tags.yml @@ -0,0 +1,2 @@ +fgbio/fastqtobam: + - "modules/nf-core/fgbio/fastqtobam/**" diff --git a/modules/nf-core/fgbio/fastqtobam/tests/umi.config b/modules/nf-core/fgbio/fastqtobam/tests/umi.config new file mode 100644 index 0000000000..7b668aa939 --- /dev/null +++ b/modules/nf-core/fgbio/fastqtobam/tests/umi.config @@ -0,0 +1,3 @@ +process { + ext.args = "--read-structures +T 12M11S+T" +} \ No newline at end of file diff --git a/modules/nf-core/freebayes/main.nf b/modules/nf-core/freebayes/main.nf index 8a1c641ded..c07895c051 100644 --- a/modules/nf-core/freebayes/main.nf +++ b/modules/nf-core/freebayes/main.nf @@ -9,11 +9,11 @@ process FREEBAYES { input: tuple val(meta), path(input_1), path(input_1_index), path(input_2), path(input_2_index), path(target_bed) - path fasta - path fasta_fai - path samples - path populations - path cnv + tuple val(ref_meta), path(fasta) + tuple val(ref_idx_meta), path(fasta_fai) + tuple val(samples_meta), path(samples) + tuple val(populations_meta), path(populations) + tuple val(cnv_meta), path(cnv) output: tuple val(meta), path("*.vcf.gz"), emit: vcf diff --git a/modules/nf-core/freebayes/meta.yml b/modules/nf-core/freebayes/meta.yml index e2cf1a175c..1803b2b319 100644 --- a/modules/nf-core/freebayes/meta.yml +++ b/modules/nf-core/freebayes/meta.yml @@ -22,11 +22,19 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - input: + - input_1: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" - - input_index: + - input_1_index: + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai}" + - input_2: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - input_2_index: type: file description: BAM/CRAM/SAM index file pattern: "*.{bai,crai}" @@ -34,22 +42,47 @@ input: type: file description: Optional - Limit analysis to targets listed in this BED-format FILE. pattern: "*.bed" + - ref_meta: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test_reference' ] - fasta: type: file description: reference fasta file pattern: ".{fa,fa.gz,fasta,fasta.gz}" + - ref_idx_meta: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test_reference' ] - fasta_fai: type: file description: reference fasta file index pattern: "*.{fa,fasta}.fai" + - samples_meta: + type: map + description: | + Groovy Map containing meta information for the samples file. + e.g. [ id:'test_samples' ] - samples: type: file description: Optional - Limit analysis to samples listed (one per line) in the FILE. pattern: "*.txt" + - populations_meta: + type: map + description: | + Groovy Map containing meta information for the populations file. + e.g. [ id:'test_populations' ] - populations: type: file description: Optional - Each line of FILE should list a sample and a population which it is part of. pattern: "*.txt" + - cnv_meta: + type: map + description: | + Groovy Map containing meta information for the cnv file. + e.g. [ id:'test_cnv' ] - cnv: type: file description: | @@ -64,10 +97,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}" + pattern: "versions.yml" - vcf: type: file description: Compressed VCF file diff --git a/modules/nf-core/freebayes/tests/main.nf.test b/modules/nf-core/freebayes/tests/main.nf.test new file mode 100644 index 0000000000..bee25a8e78 --- /dev/null +++ b/modules/nf-core/freebayes/tests/main.nf.test @@ -0,0 +1,179 @@ +nextflow_process { + + name "Test Process FREEBAYES" + script "../main.nf" + process "FREEBAYES" + + tag "modules" + tag "modules_nfcore" + tag "freebayes" + + test("sarscov2 - [ bam, bai ] - fasta - fai") { + + when { + process { + """ + input[0] = [ + [ 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[1] = [ [ id: 'test_fasta' ], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + input[2] = [ [ id: 'test_fai' ], file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + // { assert snapshot(process.out).match() }, // Output VCF includes a timestamp, so snapshot not consistent past a day. + { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("test.vcf.gz") }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.toString().contains('MT192765.1\t10214\t.\tATTTAC\tATTAC\t29.8242') }, + { assert snapshot(process.out.versions).match() }, + ) + } + + } + + test("sarscov2 - [ bam, bai, bed ] - fasta - fai") { + + when { + process { + """ + input[0] = [ + [ 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']['test_bed'], checkIfExists: true), + ] + input[1] = [ [ id: 'fasta' ], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + input[2] = [ [ id: 'fai' ], file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + // { assert snapshot(process.out).match() }, // Output VCF includes a timestamp, so snapshot not consistent past a day. + { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("test.vcf.gz") }, + { assert snapshot(process.out.versions).match() }, + ) + } + + } + + test("sarscov2 - [ cram, crai ] - fasta - fai") { + + when { + process { + """ + input[0] = [ + [ 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), + [], + [], + [], + ] + input[1] = [ [ id: 'fasta' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + input[2] = [ [ id: 'fai' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + // { assert snapshot(process.out).match() }, // Output VCF includes a timestamp, so snapshot not consistent past a day. + { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("test.vcf.gz") }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.toString().contains("chr22\t1982\t.\tA\tG\t459.724") }, + { assert snapshot(process.out.versions).match() }, + ) + } + + } + + test("sarscov2 - [ bam, bai, bam, bai ] - fasta - fai") { + + when { + process { + """ + input[0] = [ + [ 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), + [], + ] + input[1] = [ [ id: 'fasta' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + input[2] = [ [ id: 'fai' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + // { assert snapshot(process.out).match() }, // Output VCF includes a timestamp, so snapshot not consistent past a day. + { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("test.vcf.gz") }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.toString().contains("chr22\t1982\t.\tA\tG\t670.615") }, + { assert snapshot(process.out.versions).match() }, + ) + } + + } + + test("sarscov2 - [ cram, crai, cram, crai, bed ] - fasta - fai") { + + when { + process { + """ + input[0] = [ + [ 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), + file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true), + ] + input[1] = [ [ id: 'fasta' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + input[2] = [ [ id: 'fai' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + // { assert snapshot(process.out).match() }, // Output VCF includes a timestamp, so snapshot not consistent past a day. + { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("test.vcf.gz") }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.toString().contains("chr22\t1982\t.\tA\tG\t670.615") }, + { assert snapshot(process.out.versions).match() }, + ) + } + + } +} diff --git a/modules/nf-core/freebayes/tests/main.nf.test.snap b/modules/nf-core/freebayes/tests/main.nf.test.snap new file mode 100644 index 0000000000..9760a680e8 --- /dev/null +++ b/modules/nf-core/freebayes/tests/main.nf.test.snap @@ -0,0 +1,48 @@ +{ + "sarscov2 - [ cram, crai, cram, crai, bed ] - fasta - fai": { + "content": [ + [ + "versions.yml:md5,4d24a735eabf2f037ab935511a2bc99c" + ] + ], + "timestamp": "2023-12-13T12:20:01.263906" + }, + "sarscov2 - [ bam, bai ] - fasta - fai": { + "content": [ + [ + "versions.yml:md5,4d24a735eabf2f037ab935511a2bc99c" + ] + ], + "timestamp": "2023-12-13T12:19:37.06375" + }, + "test.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "timestamp": "2023-12-13T12:19:37.050165" + }, + "sarscov2 - [ cram, crai ] - fasta - fai": { + "content": [ + [ + "versions.yml:md5,4d24a735eabf2f037ab935511a2bc99c" + ] + ], + "timestamp": "2023-12-13T12:19:48.797103" + }, + "sarscov2 - [ bam, bai, bed ] - fasta - fai": { + "content": [ + [ + "versions.yml:md5,4d24a735eabf2f037ab935511a2bc99c" + ] + ], + "timestamp": "2023-12-13T12:19:43.147912" + }, + "sarscov2 - [ bam, bai, bam, bai ] - fasta - fai": { + "content": [ + [ + "versions.yml:md5,4d24a735eabf2f037ab935511a2bc99c" + ] + ], + "timestamp": "2023-12-13T12:19:55.186773" + } +} \ No newline at end of file diff --git a/modules/nf-core/freebayes/tests/tags.yml b/modules/nf-core/freebayes/tests/tags.yml new file mode 100644 index 0000000000..5563fb3267 --- /dev/null +++ b/modules/nf-core/freebayes/tests/tags.yml @@ -0,0 +1,2 @@ +freebayes: + - "modules/nf-core/freebayes/**" diff --git a/modules/nf-core/gatk4/applybqsr/environment.yml b/modules/nf-core/gatk4/applybqsr/environment.yml index a690099123..80c811e6c1 100644 --- a/modules/nf-core/gatk4/applybqsr/environment.yml +++ b/modules/nf-core/gatk4/applybqsr/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/applybqsr/main.nf b/modules/nf-core/gatk4/applybqsr/main.nf index 7e49563739..78db9d7f00 100644 --- a/modules/nf-core/gatk4/applybqsr/main.nf +++ b/modules/nf-core/gatk4/applybqsr/main.nf @@ -4,8 +4,8 @@ process GATK4_APPLYBQSR { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(input), path(input_index), path(bqsr_table), path(intervals) diff --git a/modules/nf-core/gatk4/applybqsr/tests/main.nf.test b/modules/nf-core/gatk4/applybqsr/tests/main.nf.test new file mode 100644 index 0000000000..3d9c6204f7 --- /dev/null +++ b/modules/nf-core/gatk4/applybqsr/tests/main.nf.test @@ -0,0 +1,95 @@ +nextflow_process { + + name "Test Process GATK4_APPLYBQSR" + script "../main.nf" + process "GATK4_APPLYBQSR" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/applybqsr" + + test("sarscov2 - bam") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/gatk/test.baserecalibrator.table', checkIfExists: true), + [] + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.dict', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - bam - intervals") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/gatk/test.baserecalibrator.table', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.dict', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 - cram") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test.baserecalibrator.table', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match() }, + { assert snapshot(file(process.out.cram[0][1]).name).match("test.cram") } + ) + } + } + +} diff --git a/modules/nf-core/gatk4/applybqsr/tests/main.nf.test.snap b/modules/nf-core/gatk4/applybqsr/tests/main.nf.test.snap new file mode 100644 index 0000000000..a387039d6a --- /dev/null +++ b/modules/nf-core/gatk4/applybqsr/tests/main.nf.test.snap @@ -0,0 +1,102 @@ +{ + "sarscov2 - bam - intervals": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bam:md5,096d269e17f4ae53f765013479240db8" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,bb2a060a0280c812fba3c74b1707b350" + ], + "bam": [ + [ + { + "id": "test" + }, + "test.bam:md5,096d269e17f4ae53f765013479240db8" + ] + ], + "cram": [ + + ], + "versions": [ + "versions.yml:md5,bb2a060a0280c812fba3c74b1707b350" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T16:21:48.144461" + }, + "sarscov2 - cram": { + "content": [ + [ + "versions.yml:md5,bb2a060a0280c812fba3c74b1707b350" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T16:22:09.308602" + }, + "test.cram": { + "content": [ + "test.cram" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2023-12-09T03:10:46.70859771" + }, + "sarscov2 - bam": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bam:md5,022271b9ce0a07579282a2a5c1186513" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,bb2a060a0280c812fba3c74b1707b350" + ], + "bam": [ + [ + { + "id": "test" + }, + "test.bam:md5,022271b9ce0a07579282a2a5c1186513" + ] + ], + "cram": [ + + ], + "versions": [ + "versions.yml:md5,bb2a060a0280c812fba3c74b1707b350" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T16:21:28.719225" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/applybqsr/tests/tags.yml b/modules/nf-core/gatk4/applybqsr/tests/tags.yml new file mode 100644 index 0000000000..8da9292df7 --- /dev/null +++ b/modules/nf-core/gatk4/applybqsr/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/applybqsr: + - "modules/nf-core/gatk4/applybqsr/**" diff --git a/modules/nf-core/gatk4/applyvqsr/environment.yml b/modules/nf-core/gatk4/applyvqsr/environment.yml index e640768957..c043cd632a 100644 --- a/modules/nf-core/gatk4/applyvqsr/environment.yml +++ b/modules/nf-core/gatk4/applyvqsr/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/applyvqsr/main.nf b/modules/nf-core/gatk4/applyvqsr/main.nf index 21afe9a528..0506e28185 100644 --- a/modules/nf-core/gatk4/applyvqsr/main.nf +++ b/modules/nf-core/gatk4/applyvqsr/main.nf @@ -4,8 +4,8 @@ process GATK4_APPLYVQSR { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(vcf), path(vcf_tbi), path(recal), path(recal_index), path(tranches) diff --git a/modules/nf-core/gatk4/baserecalibrator/environment.yml b/modules/nf-core/gatk4/baserecalibrator/environment.yml index 6863fb1712..365e5c6319 100644 --- a/modules/nf-core/gatk4/baserecalibrator/environment.yml +++ b/modules/nf-core/gatk4/baserecalibrator/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/baserecalibrator/main.nf b/modules/nf-core/gatk4/baserecalibrator/main.nf index e893b65036..1a29986265 100644 --- a/modules/nf-core/gatk4/baserecalibrator/main.nf +++ b/modules/nf-core/gatk4/baserecalibrator/main.nf @@ -4,8 +4,8 @@ process GATK4_BASERECALIBRATOR { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(input), path(input_index), path(intervals) @@ -50,4 +50,14 @@ process GATK4_BASERECALIBRATOR { gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${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/nf-core/gatk4/baserecalibrator/tests/main.nf.test b/modules/nf-core/gatk4/baserecalibrator/tests/main.nf.test new file mode 100644 index 0000000000..fbd91beae2 --- /dev/null +++ b/modules/nf-core/gatk4/baserecalibrator/tests/main.nf.test @@ -0,0 +1,166 @@ +nextflow_process { + + name "Test Process GATK4_BASERECALIBRATOR" + script "../main.nf" + process "GATK4_BASERECALIBRATOR" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/baserecalibrator" + + test("sarscov2 - bam") { + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + [] + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.dict', checkIfExists: true) + input[4] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) + input[5] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - bam - intervals") { + when { + process { + """ + + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.dict', checkIfExists: true) + input[4] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) + input[5] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - bam - multiple sites") { + when { + process { + """ + + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + [] + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.dict', checkIfExists: true) + input[4] = [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true) + ] + input[5] = [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - bam - stub") { + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [], + [], + [] + ] + input[1] = [] + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - cram ") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + [] + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz', checkIfExists: true) + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz.tbi', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/baserecalibrator/tests/main.nf.test.snap b/modules/nf-core/gatk4/baserecalibrator/tests/main.nf.test.snap new file mode 100644 index 0000000000..8291304ba8 --- /dev/null +++ b/modules/nf-core/gatk4/baserecalibrator/tests/main.nf.test.snap @@ -0,0 +1,167 @@ +{ + "sarscov2 - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.table:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,4ff697a3a05bb4d30701e6750c246ed2" + ], + "table": [ + [ + { + "id": "test" + }, + "test.table:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,4ff697a3a05bb4d30701e6750c246ed2" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T16:16:00.04396" + }, + "sarscov2 - bam - intervals": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.table:md5,9ecb5f00a2229291705addc09c0ec231" + ] + ], + "1": [ + "versions.yml:md5,4ff697a3a05bb4d30701e6750c246ed2" + ], + "table": [ + [ + { + "id": "test" + }, + "test.table:md5,9ecb5f00a2229291705addc09c0ec231" + ] + ], + "versions": [ + "versions.yml:md5,4ff697a3a05bb4d30701e6750c246ed2" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T16:15:17.899391" + }, + "sarscov2 - bam - multiple sites": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.table:md5,e2e43abdc0c943c1a54dae816d0b9ea7" + ] + ], + "1": [ + "versions.yml:md5,4ff697a3a05bb4d30701e6750c246ed2" + ], + "table": [ + [ + { + "id": "test" + }, + "test.table:md5,e2e43abdc0c943c1a54dae816d0b9ea7" + ] + ], + "versions": [ + "versions.yml:md5,4ff697a3a05bb4d30701e6750c246ed2" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T16:15:47.770383" + }, + "homo_sapiens - cram ": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.table:md5,35d89a3811aa31711fc9815b6b80e6ec" + ] + ], + "1": [ + "versions.yml:md5,4ff697a3a05bb4d30701e6750c246ed2" + ], + "table": [ + [ + { + "id": "test" + }, + "test.table:md5,35d89a3811aa31711fc9815b6b80e6ec" + ] + ], + "versions": [ + "versions.yml:md5,4ff697a3a05bb4d30701e6750c246ed2" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T16:16:42.135898" + }, + "sarscov2 - bam": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.table:md5,e2e43abdc0c943c1a54dae816d0b9ea7" + ] + ], + "1": [ + "versions.yml:md5,4ff697a3a05bb4d30701e6750c246ed2" + ], + "table": [ + [ + { + "id": "test" + }, + "test.table:md5,e2e43abdc0c943c1a54dae816d0b9ea7" + ] + ], + "versions": [ + "versions.yml:md5,4ff697a3a05bb4d30701e6750c246ed2" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T16:14:57.629443" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/baserecalibrator/tests/tags.yml b/modules/nf-core/gatk4/baserecalibrator/tests/tags.yml new file mode 100644 index 0000000000..648b462695 --- /dev/null +++ b/modules/nf-core/gatk4/baserecalibrator/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/baserecalibrator: + - "modules/nf-core/gatk4/baserecalibrator/**" diff --git a/modules/nf-core/gatk4/calculatecontamination/environment.yml b/modules/nf-core/gatk4/calculatecontamination/environment.yml index d5e45ebe42..5ec9c48293 100644 --- a/modules/nf-core/gatk4/calculatecontamination/environment.yml +++ b/modules/nf-core/gatk4/calculatecontamination/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/calculatecontamination/main.nf b/modules/nf-core/gatk4/calculatecontamination/main.nf index 8d43c4ee6b..80070e5ff3 100644 --- a/modules/nf-core/gatk4/calculatecontamination/main.nf +++ b/modules/nf-core/gatk4/calculatecontamination/main.nf @@ -4,8 +4,8 @@ process GATK4_CALCULATECONTAMINATION { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(pileup), path(matched) diff --git a/modules/nf-core/gatk4/cnnscorevariants/README.md b/modules/nf-core/gatk4/cnnscorevariants/README.md new file mode 100644 index 0000000000..c6a4545655 --- /dev/null +++ b/modules/nf-core/gatk4/cnnscorevariants/README.md @@ -0,0 +1,9 @@ +# Conda is not supported at the moment + +The [bioconda](https://bioconda.github.io/recipes/gatk4/README.html) recipe is not fully working as expected, cf [github issue](https://github.com/broadinstitute/gatk/issues/7811) + +Hence, we are using the docker container provided by the authors of the tool: + +- [broadinstitute/gatk](https://hub.docker.com/r/broadinstitute/gatk) + +This image is mirrored on the [nf-core quay.io](https://quay.io/repository/nf-core/gatk) for convenience. diff --git a/modules/nf-core/gatk4/cnnscorevariants/environment.yml b/modules/nf-core/gatk4/cnnscorevariants/environment.yml deleted file mode 100644 index 12cc34ba66..0000000000 --- a/modules/nf-core/gatk4/cnnscorevariants/environment.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: gatk4_cnnscorevariants -channels: - - conda-forge - - bioconda - - defaults diff --git a/modules/nf-core/gatk4/cnnscorevariants/main.nf b/modules/nf-core/gatk4/cnnscorevariants/main.nf index 71efe9b12d..92de2267e0 100644 --- a/modules/nf-core/gatk4/cnnscorevariants/main.nf +++ b/modules/nf-core/gatk4/cnnscorevariants/main.nf @@ -3,7 +3,7 @@ process GATK4_CNNSCOREVARIANTS { label 'process_low' //Conda is not supported at the moment: https://github.com/broadinstitute/gatk/issues/7811 - container "nf-core/gatk:4.4.0.0" //Biocontainers is missing a package + container "nf-core/gatk:4.5.0.0" //Biocontainers is missing a package input: tuple val(meta), path(vcf), path(tbi), path(aligned_input), path(intervals) @@ -40,6 +40,8 @@ process GATK4_CNNSCOREVARIANTS { avail_mem = (task.memory.mega*0.8).intValue() } """ + export THEANO_FLAGS="base_compiledir=\$PWD" + gatk --java-options "-Xmx${avail_mem}M -XX:-UsePerfData" \\ CNNScoreVariants \\ --variant $vcf \\ diff --git a/modules/nf-core/gatk4/createsequencedictionary/environment.yml b/modules/nf-core/gatk4/createsequencedictionary/environment.yml index db663e148f..78822ad03f 100644 --- a/modules/nf-core/gatk4/createsequencedictionary/environment.yml +++ b/modules/nf-core/gatk4/createsequencedictionary/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/createsequencedictionary/main.nf b/modules/nf-core/gatk4/createsequencedictionary/main.nf index b47ad16221..c7f1d75b3c 100644 --- a/modules/nf-core/gatk4/createsequencedictionary/main.nf +++ b/modules/nf-core/gatk4/createsequencedictionary/main.nf @@ -4,8 +4,8 @@ process GATK4_CREATESEQUENCEDICTIONARY { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(fasta) diff --git a/modules/nf-core/gatk4/estimatelibrarycomplexity/environment.yml b/modules/nf-core/gatk4/estimatelibrarycomplexity/environment.yml index fabb6f2ba4..5fdd85af80 100644 --- a/modules/nf-core/gatk4/estimatelibrarycomplexity/environment.yml +++ b/modules/nf-core/gatk4/estimatelibrarycomplexity/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf b/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf index c0eef7b327..e0744e16f7 100644 --- a/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf +++ b/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf @@ -4,8 +4,8 @@ process GATK4_ESTIMATELIBRARYCOMPLEXITY { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(input) @@ -24,6 +24,7 @@ process GATK4_ESTIMATELIBRARYCOMPLEXITY { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def input_list = input.collect(){"--INPUT $it"}.join(" ") + def reference = fasta ? "--REFERENCE_SEQUENCE ${fasta}" : "" def avail_mem = 3072 if (!task.memory) { @@ -36,7 +37,7 @@ process GATK4_ESTIMATELIBRARYCOMPLEXITY { EstimateLibraryComplexity \\ $input_list \\ --OUTPUT ${prefix}.metrics \\ - --REFERENCE_SEQUENCE ${fasta} \\ + $reference \\ --TMP_DIR . \\ $args diff --git a/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test new file mode 100644 index 0000000000..e23b65573c --- /dev/null +++ b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test @@ -0,0 +1,113 @@ +nextflow_process { + + name "Test Process GATK4_ESTIMATELIBRARYCOMPLEXITY" + script "../main.nf" + process "GATK4_ESTIMATELIBRARYCOMPLEXITY" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/estimatelibrarycomplexity" + + test("homo_sapiens - bam") { + + when { + process { + """ + // [ meta, input ] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true) + ] + // fasta + input[1] = [] + // fai + input[2] = [] + // dict + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict' , checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.metrics[0][1]).name, + process.out.versions + ).match() + } + ) + } + + } + + test("homo_sapiens - cram") { + + when { + process { + """ + // [ meta, input ] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true) + ] + // fasta + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta' , checkIfExists: true) + // fai + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai' , checkIfExists: true) + // dict + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict' , checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.metrics[0][1]).name, + process.out.versions + ).match() + } + ) + } + + } + + test("sarscov2 - bam - stub") { + + options "-stub" + + when { + process { + """ + // [ meta, input ] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true) + ] + // fasta + input[1] = [] + // fai + input[2] = [] + // dict + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict' , checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.metrics[0][1]).name, + process.out.versions + ).match() + } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test.snap b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test.snap new file mode 100644 index 0000000000..bbcef1471e --- /dev/null +++ b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test.snap @@ -0,0 +1,41 @@ +{ + "homo_sapiens - cram": { + "content": [ + "test.metrics", + [ + "versions.yml:md5,1d9c175d88b6c50c7dc999c1f70261a8" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:41:39.857566" + }, + "sarscov2 - bam - stub": { + "content": [ + "test.metrics", + [ + "versions.yml:md5,1d9c175d88b6c50c7dc999c1f70261a8" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:27:55.337569" + }, + "homo_sapiens - bam": { + "content": [ + "test.metrics", + [ + "versions.yml:md5,1d9c175d88b6c50c7dc999c1f70261a8" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:24:41.460191" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/tags.yml b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/tags.yml new file mode 100644 index 0000000000..0949d08563 --- /dev/null +++ b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/estimatelibrarycomplexity: + - "modules/nf-core/gatk4/estimatelibrarycomplexity/**" diff --git a/modules/nf-core/gatk4/filtermutectcalls/environment.yml b/modules/nf-core/gatk4/filtermutectcalls/environment.yml index 8057d765d5..7494d84dbc 100644 --- a/modules/nf-core/gatk4/filtermutectcalls/environment.yml +++ b/modules/nf-core/gatk4/filtermutectcalls/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/filtermutectcalls/main.nf b/modules/nf-core/gatk4/filtermutectcalls/main.nf index fa6b46ab3c..38dd44c786 100644 --- a/modules/nf-core/gatk4/filtermutectcalls/main.nf +++ b/modules/nf-core/gatk4/filtermutectcalls/main.nf @@ -4,8 +4,8 @@ process GATK4_FILTERMUTECTCALLS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(vcf), path(vcf_tbi), path(stats), path(orientationbias), path(segmentation), path(table), val(estimate) diff --git a/modules/nf-core/gatk4/filtervarianttranches/environment.yml b/modules/nf-core/gatk4/filtervarianttranches/environment.yml index faeea8ddb0..9763cf1eff 100644 --- a/modules/nf-core/gatk4/filtervarianttranches/environment.yml +++ b/modules/nf-core/gatk4/filtervarianttranches/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/filtervarianttranches/main.nf b/modules/nf-core/gatk4/filtervarianttranches/main.nf index 9da47ab739..05489e179b 100644 --- a/modules/nf-core/gatk4/filtervarianttranches/main.nf +++ b/modules/nf-core/gatk4/filtervarianttranches/main.nf @@ -4,8 +4,8 @@ process GATK4_FILTERVARIANTTRANCHES { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(vcf), path(tbi), path(intervals) diff --git a/modules/nf-core/gatk4/gatherbqsrreports/environment.yml b/modules/nf-core/gatk4/gatherbqsrreports/environment.yml index 928ac76e6b..4248a29812 100644 --- a/modules/nf-core/gatk4/gatherbqsrreports/environment.yml +++ b/modules/nf-core/gatk4/gatherbqsrreports/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/gatherbqsrreports/main.nf b/modules/nf-core/gatk4/gatherbqsrreports/main.nf index e783701017..79667a2994 100644 --- a/modules/nf-core/gatk4/gatherbqsrreports/main.nf +++ b/modules/nf-core/gatk4/gatherbqsrreports/main.nf @@ -4,8 +4,8 @@ process GATK4_GATHERBQSRREPORTS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(table) diff --git a/modules/nf-core/gatk4/gatherpileupsummaries/environment.yml b/modules/nf-core/gatk4/gatherpileupsummaries/environment.yml index 1a2ebf5761..217387f9c0 100644 --- a/modules/nf-core/gatk4/gatherpileupsummaries/environment.yml +++ b/modules/nf-core/gatk4/gatherpileupsummaries/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/gatherpileupsummaries/main.nf b/modules/nf-core/gatk4/gatherpileupsummaries/main.nf index 1863133d2c..561e9bb8b8 100644 --- a/modules/nf-core/gatk4/gatherpileupsummaries/main.nf +++ b/modules/nf-core/gatk4/gatherpileupsummaries/main.nf @@ -4,8 +4,8 @@ process GATK4_GATHERPILEUPSUMMARIES { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: diff --git a/modules/nf-core/gatk4/genomicsdbimport/environment.yml b/modules/nf-core/gatk4/genomicsdbimport/environment.yml index ce3f941694..a3a13636c6 100644 --- a/modules/nf-core/gatk4/genomicsdbimport/environment.yml +++ b/modules/nf-core/gatk4/genomicsdbimport/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/genomicsdbimport/main.nf b/modules/nf-core/gatk4/genomicsdbimport/main.nf index 916037ebef..6f1d4c5370 100644 --- a/modules/nf-core/gatk4/genomicsdbimport/main.nf +++ b/modules/nf-core/gatk4/genomicsdbimport/main.nf @@ -4,8 +4,8 @@ process GATK4_GENOMICSDBIMPORT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(vcf), path(tbi), path(interval_file), val(interval_value), path(wspace) diff --git a/modules/nf-core/gatk4/genomicsdbimport/meta.yml b/modules/nf-core/gatk4/genomicsdbimport/meta.yml index ca8fe3d076..11e565b104 100644 --- a/modules/nf-core/gatk4/genomicsdbimport/meta.yml +++ b/modules/nf-core/gatk4/genomicsdbimport/meta.yml @@ -33,11 +33,11 @@ input: type: file 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: + - interval_file: type: file description: file containing the intervals to be used when creating the genomicsdb pattern: "*.interval_list" - - intervalval: + - interval_value: 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" diff --git a/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test b/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test new file mode 100644 index 0000000000..9c207b3074 --- /dev/null +++ b/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test @@ -0,0 +1,155 @@ +nextflow_process { + + name "Test Process GATK4_GENOMICSDBIMPORT" + script "../main.nf" + process "GATK4_GENOMICSDBIMPORT" + + tag "modules" + tag "modules_nfcore" + tag "untar" + tag "gatk4" + tag "gatk4/genomicsdbimport" + + test("test_gatk4_genomicsdbimport_create_genomicsdb") { + + when { + process { + """ + // [meta, vcf, tbi, interval, interval_value, workspace ] + input[0] = [ [ id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) , + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true) , + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.interval_list', checkIfExists: true) , + [] , + [] ] + // run_intlist + input[1] = false + // run_updatewspace + input[2] = false + // input_map + input[3] = false + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.genomicsdb.get(0).get(1)).list().sort()).match() } + //{ assert snapshot(file(process.out.updatedb.get(0).get(1)).list().sort()).match() } + //{ assert snapshot(process.out.intervallist.get(0).get(1)).match() } + ) + } + + } + + test("test_gatk4_genomicsdbimport_get_intervalslist") { + + setup { + run("UNTAR") { + script "../../../untar/main.nf" + process { + """ + input[0] = Channel.of([ [], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test_genomicsdb.tar.gz', checkIfExists: true) ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ [id:"test"], [], [], [], []]).combine(UNTAR.out.untar.map{ it[1] }) + // run_intlist + input[1] = true + // run_updatewspace + input[2] = false + // input_map + input[3] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + //{ assert snapshot(file(process.out.genomicsdb.get(0).get(1)).list().sort()).match() } + //{ assert snapshot(file(process.out.updatedb.get(0).get(1)).list().sort()).match() } + { assert snapshot(process.out.intervallist.get(0).get(1)).match() } + ) + } + + } + + test("test_gatk4_genomicsdbimport_update_genomicsdb") { + + setup { + run("UNTAR") { + script "../../../untar/main.nf" + process { + """ + input[0] = Channel.of([ [], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test_genomicsdb.tar.gz', checkIfExists: true) ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ [id:"test"], file( params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz' , checkIfExists: true), file( params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz.tbi' , checkIfExists: true), [], []]).combine(UNTAR.out.untar.map{ it[1] }) + // run_intlist + input[1] = false + // run_updatewspace + input[2] = true + // input_map + input[3] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + //{ assert snapshot(file(process.out.genomicsdb.get(0).get(1)).list().sort()).match() } + { assert snapshot(file(process.out.updatedb.get(0).get(1)).list().sort()).match() } + //{ assert snapshot(process.out.intervallist.get(0).get(1)).match() } + ) + } + + } + + test("test_gatk4_genomicsdbimport_stub") { + + options "-stub" + + when { + process { + """ + // [meta, vcf, tbi, interval, interval_value, workspace ] + input[0] = [ [ id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) , + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true) , + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.interval_list', checkIfExists: true) , + [] , + [] ] + // run_intlist + input[1] = false + // run_updatewspace + input[2] = false + // input_map + input[3] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test.snap b/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test.snap new file mode 100644 index 0000000000..a633bbdc16 --- /dev/null +++ b/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test.snap @@ -0,0 +1,40 @@ +{ + "test_gatk4_genomicsdbimport_get_intervalslist": { + "content": [ + "test.interval_list:md5,4c85812ac15fc1cd29711a851d23c0bf" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-28T17:55:03.846241" + }, + "test_gatk4_genomicsdbimport_create_genomicsdb": { + "content": [ + "__tiledb_workspace.tdb", + "callset.json", + "chr22$1$40001", + "vcfheader.vcf", + "vidmap.json" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-14T11:22:10.11423157" + }, + "test_gatk4_genomicsdbimport_update_genomicsdb": { + "content": [ + "__tiledb_workspace.tdb", + "callset.json", + "chr22$1$40001", + "vcfheader.vcf", + "vidmap.json" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-14T12:46:42.403794676" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/genomicsdbimport/tests/nextflow.config b/modules/nf-core/gatk4/genomicsdbimport/tests/nextflow.config new file mode 100644 index 0000000000..e177a144f4 --- /dev/null +++ b/modules/nf-core/gatk4/genomicsdbimport/tests/nextflow.config @@ -0,0 +1,2 @@ +process { +} diff --git a/modules/nf-core/gatk4/genomicsdbimport/tests/tags.yml b/modules/nf-core/gatk4/genomicsdbimport/tests/tags.yml new file mode 100644 index 0000000000..8a0085731f --- /dev/null +++ b/modules/nf-core/gatk4/genomicsdbimport/tests/tags.yml @@ -0,0 +1,3 @@ +gatk4/genomicsdbimport: + - "modules/nf-core/gatk4/genomicsdbimport/**" + - "modules/nf-core/untar/**" diff --git a/modules/nf-core/gatk4/genotypegvcfs/environment.yml b/modules/nf-core/gatk4/genotypegvcfs/environment.yml index 49f213790d..6e1b7c04a0 100644 --- a/modules/nf-core/gatk4/genotypegvcfs/environment.yml +++ b/modules/nf-core/gatk4/genotypegvcfs/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/genotypegvcfs/main.nf b/modules/nf-core/gatk4/genotypegvcfs/main.nf index c6c0ba501d..3a9fbb4e07 100644 --- a/modules/nf-core/gatk4/genotypegvcfs/main.nf +++ b/modules/nf-core/gatk4/genotypegvcfs/main.nf @@ -4,8 +4,8 @@ process GATK4_GENOTYPEGVCFS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(gvcf), path(gvcf_index), path(intervals), path(intervals_index) diff --git a/modules/nf-core/gatk4/getpileupsummaries/environment.yml b/modules/nf-core/gatk4/getpileupsummaries/environment.yml index d650467cf8..b99a28c177 100644 --- a/modules/nf-core/gatk4/getpileupsummaries/environment.yml +++ b/modules/nf-core/gatk4/getpileupsummaries/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/getpileupsummaries/main.nf b/modules/nf-core/gatk4/getpileupsummaries/main.nf index d509cdf3bb..6006e8dd42 100644 --- a/modules/nf-core/gatk4/getpileupsummaries/main.nf +++ b/modules/nf-core/gatk4/getpileupsummaries/main.nf @@ -4,8 +4,8 @@ process GATK4_GETPILEUPSUMMARIES { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(input), path(index), path(intervals) diff --git a/modules/nf-core/gatk4/haplotypecaller/environment.yml b/modules/nf-core/gatk4/haplotypecaller/environment.yml index 0c8f32fa63..d4e8d36026 100644 --- a/modules/nf-core/gatk4/haplotypecaller/environment.yml +++ b/modules/nf-core/gatk4/haplotypecaller/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/haplotypecaller/main.nf b/modules/nf-core/gatk4/haplotypecaller/main.nf index fdecf5f830..3043ee07ab 100644 --- a/modules/nf-core/gatk4/haplotypecaller/main.nf +++ b/modules/nf-core/gatk4/haplotypecaller/main.nf @@ -4,16 +4,16 @@ process GATK4_HAPLOTYPECALLER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: - tuple val(meta), path(input), path(input_index), path(intervals), path(dragstr_model) - path fasta - path fai - path dict - path dbsnp - path dbsnp_tbi + tuple val(meta), path(input), path(input_index), path(intervals), path(dragstr_model) + tuple val(meta2), path(fasta) + tuple val(meta3), path(fai) + tuple val(meta4), path(dict) + tuple val(meta5), path(dbsnp) + tuple val(meta6), path(dbsnp_tbi) output: tuple val(meta), path("*.vcf.gz") , emit: vcf diff --git a/modules/nf-core/gatk4/haplotypecaller/meta.yml b/modules/nf-core/gatk4/haplotypecaller/meta.yml index f38dc37dd0..703b99a098 100644 --- a/modules/nf-core/gatk4/haplotypecaller/meta.yml +++ b/modules/nf-core/gatk4/haplotypecaller/meta.yml @@ -35,21 +35,46 @@ input: type: file description: Text file containing the DragSTR model of the used BAM/CRAM file (optional) pattern: "*.txt" + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test_reference' ] - fasta: type: file description: The reference fasta file pattern: "*.fasta" + - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test_reference' ] - fai: type: file description: Index of reference fasta file pattern: "fasta.fai" + - meta4: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test_reference' ] - dict: type: file description: GATK sequence dictionary pattern: "*.dict" + - meta5: + type: map + description: | + Groovy Map containing dbsnp information + e.g. [ id:'test_dbsnp' ] - dbsnp: type: file description: VCF file containing known sites (optional) + - meta6: + type: map + description: | + Groovy Map containing dbsnp information + e.g. [ id:'test_dbsnp' ] - dbsnp_tbi: type: file description: VCF index of dbsnp (optional) diff --git a/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test b/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test new file mode 100644 index 0000000000..a124bff530 --- /dev/null +++ b/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test @@ -0,0 +1,142 @@ +// nf-core modules test gatk4/haplotypecaller +nextflow_process { + + name "Test Process GATK4_HAPLOTYPECALLER" + script "../main.nf" + process "GATK4_HAPLOTYPECALLER" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/haplotypecaller" + + test("homo_sapiens - [bam, bai] - fasta - fai - dict") { + + when { + process { + """ + input[0] = [ + [ id:'test_bam' ], // 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), + [], + [] + ] + input[1] = [ [ id:'test_fa' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + input[2] = [ [ id:'test_fai' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) ] + input[3] = [ [ id:'test_dict' ], file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + // { assert snapshot(process.out).match() }, // Unstable hashes + { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("gatk_hc_vcf_bam_input") }, + { assert snapshot(file(process.out.tbi.get(0).get(1)).name).match("gatk_hc_vcf_tbi_bam_input") }, + ) + } + + } + + test("homo_sapiens - [cram, crai] - fasta - fai - dict") { + + when { + process { + """ + input[0] = [ + [ id:'test_cram' ], // 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), + [], + [] + ] + input[1] = [ [ id:'test_fa' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + input[2] = [ [ id:'test_fai' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) ] + input[3] = [ [ id:'test_dict' ], file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + // { assert snapshot(process.out).match() }, // Unstable hashes + { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("gatk_hc_vcf_cram_input") }, + { assert snapshot(file(process.out.tbi.get(0).get(1)).name).match("gatk_hc_vcf_tbi_cram_input") }, + ) + } + + } + + test("homo_sapiens - [cram, crai] - fasta - fai - dict - sites - sites_tbi") { + + when { + process { + """ + input[0] = [ + [ id:'test_cram_sites' ], // 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), + [], + [] + ] + input[1] = [ [ id:'test_fa' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + input[2] = [ [ id:'test_fai' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) ] + input[3] = [ [ id:'test_dict' ], file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) ] + input[4] = [ [ id:'test_sites' ], file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true) ] + input[5] = [ [ id:'test_sites_tbi' ], file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz_tbi'], checkIfExists: true) ] + """ + } + } + + then { + assertAll( + { assert process.success }, + // { assert snapshot(process.out).match() }, // Unstable hashes + { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("gatk_hc_vcf_cram_input_with_sites") }, + { assert snapshot(file(process.out.tbi.get(0).get(1)).name).match("gatk_hc_vcf_tbi_cram_input_with_sites") }, + ) + } + + } + + test("homo_sapiens - [cram, crai, dragstr_model] - fasta - fai - dict - sites - sites_tbi") { + + when { + process { + """ + input[0] = [ + [ id:'test_cram_sites_dragstr' ], // 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_paired_end_sorted_dragstrmodel'], checkIfExists: true) + ] + input[1] = [ [ id:'test_fa' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] + input[2] = [ [ id:'test_fai' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) ] + input[3] = [ [ id:'test_dict' ], file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) ] + input[4] = [ [ id:'test_sites' ], file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true) ] + input[5] = [ [ id:'test_sites_tbi' ], file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz_tbi'], checkIfExists: true) ] + """ + } + } + + then { + assertAll( + { assert process.success }, + // { assert snapshot(process.out).match() }, // Unstable hashes + { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("gatk_hc_vcf_cram_dragstr_input_with_sites") }, + { assert snapshot(file(process.out.tbi.get(0).get(1)).name).match("gatk_hc_vcf_tbi_cram_dragstr_input_with_sites") }, + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test.snap b/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test.snap new file mode 100644 index 0000000000..375025ee3c --- /dev/null +++ b/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test.snap @@ -0,0 +1,82 @@ +{ + "gatk_hc_vcf_cram_dragstr_input_with_sites": { + "content": [ + "test_cram_sites_dragstr.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-20T13:24:45.142682" + }, + "gatk_hc_vcf_bam_input": { + "content": [ + "test_bam.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-20T13:23:19.203837" + }, + "gatk_hc_vcf_cram_input": { + "content": [ + "test_cram.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-20T13:23:48.434615" + }, + "gatk_hc_vcf_cram_input_with_sites": { + "content": [ + "test_cram_sites.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-20T13:24:17.147745" + }, + "gatk_hc_vcf_tbi_bam_input": { + "content": [ + "test_bam.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-20T13:23:19.23048" + }, + "gatk_hc_vcf_tbi_cram_input": { + "content": [ + "test_cram.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-20T13:23:48.45958" + }, + "gatk_hc_vcf_tbi_cram_dragstr_input_with_sites": { + "content": [ + "test_cram_sites_dragstr.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-20T13:24:45.154818" + }, + "gatk_hc_vcf_tbi_cram_input_with_sites": { + "content": [ + "test_cram_sites.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-20T13:24:17.158138" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/haplotypecaller/tests/tags.yml b/modules/nf-core/gatk4/haplotypecaller/tests/tags.yml new file mode 100644 index 0000000000..d05bb65548 --- /dev/null +++ b/modules/nf-core/gatk4/haplotypecaller/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/haplotypecaller: + - "modules/nf-core/gatk4/haplotypecaller/**" diff --git a/modules/nf-core/gatk4/intervallisttobed/environment.yml b/modules/nf-core/gatk4/intervallisttobed/environment.yml index 06d9f0e9c7..d4d2eba24c 100644 --- a/modules/nf-core/gatk4/intervallisttobed/environment.yml +++ b/modules/nf-core/gatk4/intervallisttobed/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/intervallisttobed/main.nf b/modules/nf-core/gatk4/intervallisttobed/main.nf index 89772081e0..2f6893c0ca 100644 --- a/modules/nf-core/gatk4/intervallisttobed/main.nf +++ b/modules/nf-core/gatk4/intervallisttobed/main.nf @@ -4,8 +4,8 @@ process GATK4_INTERVALLISTTOBED { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(intervals) diff --git a/modules/nf-core/gatk4/learnreadorientationmodel/environment.yml b/modules/nf-core/gatk4/learnreadorientationmodel/environment.yml index d1c35caf83..a4c2a764dd 100644 --- a/modules/nf-core/gatk4/learnreadorientationmodel/environment.yml +++ b/modules/nf-core/gatk4/learnreadorientationmodel/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/learnreadorientationmodel/main.nf b/modules/nf-core/gatk4/learnreadorientationmodel/main.nf index c4e39db74a..a61b292812 100644 --- a/modules/nf-core/gatk4/learnreadorientationmodel/main.nf +++ b/modules/nf-core/gatk4/learnreadorientationmodel/main.nf @@ -4,8 +4,8 @@ process GATK4_LEARNREADORIENTATIONMODEL { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(f1r2) diff --git a/modules/nf-core/gatk4/markduplicates/environment.yml b/modules/nf-core/gatk4/markduplicates/environment.yml index 9adad104d8..7362eea6f2 100644 --- a/modules/nf-core/gatk4/markduplicates/environment.yml +++ b/modules/nf-core/gatk4/markduplicates/environment.yml @@ -4,5 +4,6 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 - - bioconda::samtools=1.17 + - bioconda::gatk4=4.5.0.0 + - bioconda::samtools=1.19.2 + - bioconda::htslib=1.19.1 diff --git a/modules/nf-core/gatk4/markduplicates/main.nf b/modules/nf-core/gatk4/markduplicates/main.nf index 564b86d3dd..baadefef41 100644 --- a/modules/nf-core/gatk4/markduplicates/main.nf +++ b/modules/nf-core/gatk4/markduplicates/main.nf @@ -4,8 +4,8 @@ process GATK4_MARKDUPLICATES { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-d9e7bad0f7fbc8f4458d5c3ab7ffaaf0235b59fb:f857e2d6cc88d35580d01cf39e0959a68b83c1d9-0': - 'biocontainers/mulled-v2-d9e7bad0f7fbc8f4458d5c3ab7ffaaf0235b59fb:f857e2d6cc88d35580d01cf39e0959a68b83c1d9-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-d9e7bad0f7fbc8f4458d5c3ab7ffaaf0235b59fb:7cc3d06cbf42e28c5e2ebfc7c858654c7340a9d5-0': + 'biocontainers/mulled-v2-d9e7bad0f7fbc8f4458d5c3ab7ffaaf0235b59fb:7cc3d06cbf42e28c5e2ebfc7c858654c7340a9d5-0' }" input: tuple val(meta), path(bam) diff --git a/modules/nf-core/gatk4/markduplicates/tests/bam.config b/modules/nf-core/gatk4/markduplicates/tests/bam.config new file mode 100644 index 0000000000..0bbfbac353 --- /dev/null +++ b/modules/nf-core/gatk4/markduplicates/tests/bam.config @@ -0,0 +1,8 @@ +process { + + withName: GATK4_MARKDUPLICATES { + ext.args = '--CREATE_INDEX true' + ext.prefix = { "${meta.id}.bam" } + } + +} diff --git a/modules/nf-core/gatk4/markduplicates/tests/cram.config b/modules/nf-core/gatk4/markduplicates/tests/cram.config new file mode 100644 index 0000000000..04a9b0745a --- /dev/null +++ b/modules/nf-core/gatk4/markduplicates/tests/cram.config @@ -0,0 +1,8 @@ +process { + + withName: GATK4_MARKDUPLICATES { + ext.args = '--CREATE_INDEX true' + ext.prefix = { "${meta.id}.cram" } + } + +} diff --git a/modules/nf-core/gatk4/markduplicates/tests/main.nf.test b/modules/nf-core/gatk4/markduplicates/tests/main.nf.test new file mode 100644 index 0000000000..bbcf74db67 --- /dev/null +++ b/modules/nf-core/gatk4/markduplicates/tests/main.nf.test @@ -0,0 +1,126 @@ +nextflow_process { + + name "Test Process GATK4_MARKDUPLICATES" + script "../main.nf" + process "GATK4_MARKDUPLICATES" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/markduplicates" + + test("sarscov2 - bam") { + config "./bam.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) + ] + input[1] = [] + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.bam).match("bam") }, + { assert snapshot(process.out.bai).match("bai") }, + { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot(file(process.out.metrics[0][1]).name).match("test.metrics") } + ) + } + } + + test("homo_sapiens - multiple bam") { + config "./bam.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam', checkIfExists: true) + ] + ] + input[1] = [] + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.bam).match("multi bam") }, + { assert snapshot(process.out.bai).match("multi bai") }, + { assert snapshot(process.out.versions).match("multi versions") }, + { assert snapshot(file(process.out.metrics[0][1]).name).match("multi test.metrics") } + ) + } + + } + + test("homo_sapiens - multiple cram") { + config "./cram.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam', checkIfExists: true) + ] + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.cram[0][1]).name).match("multi cram")}, + { assert snapshot(file(process.out.crai[0][1]).name).match("multi crai") }, + { assert snapshot(process.out.versions).match("multi cram versions") }, + { assert snapshot(file(process.out.metrics[0][1]).name).match("multi cram test.metrics") } + ) + } + + } + + test("stub") { + config "./bam.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + [] + ] + input[1] = [] + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/markduplicates/tests/main.nf.test.snap b/modules/nf-core/gatk4/markduplicates/tests/main.nf.test.snap new file mode 100644 index 0000000000..336bb3735b --- /dev/null +++ b/modules/nf-core/gatk4/markduplicates/tests/main.nf.test.snap @@ -0,0 +1,160 @@ +{ + "multi bam": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,8a808b1a94d2627c4d659a2151c4cb9f" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T15:21:36.059923" + }, + "multi crai": { + "content": [ + "test.cram.crai" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2023-12-12T17:43:37.780426007" + }, + "multi bai": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.bai:md5,38b99c5f771895ecf5324c3186b9d452" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T15:21:36.09642" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,c58bf16c6e3786cc4d17bb7249f9ffe5" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T15:21:08.710549" + }, + "multi test.metrics": { + "content": [ + "test.bam.metrics" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2023-12-12T17:43:11.732892667" + }, + "bai": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.bai:md5,26001bcdbce12e9f07557d8f7b8d360e" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2023-12-12T17:42:39.651888758" + }, + "multi cram versions": { + "content": [ + [ + "versions.yml:md5,c58bf16c6e3786cc4d17bb7249f9ffe5" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T15:21:56.966376" + }, + "multi versions": { + "content": [ + [ + "versions.yml:md5,c58bf16c6e3786cc4d17bb7249f9ffe5" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T15:21:36.138095" + }, + "multi cram test.metrics": { + "content": [ + "test.cram.metrics" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2023-12-12T17:43:37.798977444" + }, + "multi cram": { + "content": [ + "test.cram" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2023-12-12T17:43:37.771137858" + }, + "bam": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,75d914ba8804eaf2acf02ab432197ec9" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-02-13T15:21:08.645892" + }, + "test.metrics": { + "content": [ + "test.bam.metrics" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2023-12-12T17:42:39.672508385" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/markduplicates/tests/tags.yml b/modules/nf-core/gatk4/markduplicates/tests/tags.yml new file mode 100644 index 0000000000..8632e32b37 --- /dev/null +++ b/modules/nf-core/gatk4/markduplicates/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/markduplicates: + - "modules/nf-core/gatk4/markduplicates/**" diff --git a/modules/nf-core/gatk4/mergemutectstats/environment.yml b/modules/nf-core/gatk4/mergemutectstats/environment.yml index dd132c3a3d..756d408301 100644 --- a/modules/nf-core/gatk4/mergemutectstats/environment.yml +++ b/modules/nf-core/gatk4/mergemutectstats/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/mergemutectstats/main.nf b/modules/nf-core/gatk4/mergemutectstats/main.nf index 3a4913220c..af41d61507 100644 --- a/modules/nf-core/gatk4/mergemutectstats/main.nf +++ b/modules/nf-core/gatk4/mergemutectstats/main.nf @@ -4,8 +4,8 @@ process GATK4_MERGEMUTECTSTATS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(stats) diff --git a/modules/nf-core/gatk4/mergevcfs/environment.yml b/modules/nf-core/gatk4/mergevcfs/environment.yml index d6c3e51a9f..efd9faa222 100644 --- a/modules/nf-core/gatk4/mergevcfs/environment.yml +++ b/modules/nf-core/gatk4/mergevcfs/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/mergevcfs/main.nf b/modules/nf-core/gatk4/mergevcfs/main.nf index 3362c2bdad..9e8d43915c 100644 --- a/modules/nf-core/gatk4/mergevcfs/main.nf +++ b/modules/nf-core/gatk4/mergevcfs/main.nf @@ -4,8 +4,8 @@ process GATK4_MERGEVCFS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(vcf) diff --git a/modules/nf-core/gatk4/mergevcfs/meta.yml b/modules/nf-core/gatk4/mergevcfs/meta.yml index 30290a854f..996053fcc6 100644 --- a/modules/nf-core/gatk4/mergevcfs/meta.yml +++ b/modules/nf-core/gatk4/mergevcfs/meta.yml @@ -29,7 +29,7 @@ input: description: | Groovy Map containing reference information e.g. [ id:'genome'] - - ref_dict: + - dict: type: file description: Optional Sequence Dictionary as input pattern: "*.dict" diff --git a/modules/nf-core/gatk4/mergevcfs/tests/main.nf.test b/modules/nf-core/gatk4/mergevcfs/tests/main.nf.test new file mode 100644 index 0000000000..77ace10a21 --- /dev/null +++ b/modules/nf-core/gatk4/mergevcfs/tests/main.nf.test @@ -0,0 +1,87 @@ +nextflow_process { + + name "Test Process GATK4_MERGEVCFS" + script "../main.nf" + process "GATK4_MERGEVCFS" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/mergevcfs" + + test("test_gatk4_mergevcfs") { + when { + process { + """ + input[0] = [ [ id:'test' ], [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) ]] + input[1] = [ [], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true)] + """ + } + } + + then { + assertAll( + { assert process.success }, + { + assert snapshot( + file(process.out.vcf.get(0).get(1)).name, + file(process.out.tbi.get(0).get(1)).name + ).match("test_gatk4_mergevcfs") + }, + ) + } + + } + + test("test_gatk4_mergevcfs_no_dict") { + when { + process { + """ + input[0] = [ [ id:'test' ], [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) ]] + input[1] = [ [],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { + assert snapshot( + file(process.out.vcf.get(0).get(1)).name, + file(process.out.tbi.get(0).get(1)).name + ).match("test_gatk4_mergevcfs_no_dict") + }, + ) + } + + } + + test("test_gatk4_mergevcfs_no_dict_stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test' ], [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) ]] + input[1] = [ [],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { + assert snapshot( + file(process.out.vcf.get(0).get(1)).name, + file(process.out.tbi.get(0).get(1)).name + ).match("test_gatk4_mergevcfs_no_dict_stub") + }, + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/mergevcfs/tests/main.nf.test.snap b/modules/nf-core/gatk4/mergevcfs/tests/main.nf.test.snap new file mode 100644 index 0000000000..62cceed57b --- /dev/null +++ b/modules/nf-core/gatk4/mergevcfs/tests/main.nf.test.snap @@ -0,0 +1,35 @@ +{ + "test_gatk4_mergevcfs_no_dict_stub": { + "content": [ + "test.vcf.gz", + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-14T14:57:40.784590995" + }, + "test_gatk4_mergevcfs": { + "content": [ + "test.vcf.gz", + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-14T14:56:42.178255913" + }, + "test_gatk4_mergevcfs_no_dict": { + "content": [ + "test.vcf.gz", + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-14T14:57:11.404322124" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/mergevcfs/tests/tags.yml b/modules/nf-core/gatk4/mergevcfs/tests/tags.yml new file mode 100644 index 0000000000..d2a74ba2c9 --- /dev/null +++ b/modules/nf-core/gatk4/mergevcfs/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/mergevcfs: + - "modules/nf-core/gatk4/mergevcfs/**" diff --git a/modules/nf-core/gatk4/mutect2/environment.yml b/modules/nf-core/gatk4/mutect2/environment.yml index 54da66ce57..86f4bfae98 100644 --- a/modules/nf-core/gatk4/mutect2/environment.yml +++ b/modules/nf-core/gatk4/mutect2/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/mutect2/main.nf b/modules/nf-core/gatk4/mutect2/main.nf index 721e94f3e4..79d8d2826c 100644 --- a/modules/nf-core/gatk4/mutect2/main.nf +++ b/modules/nf-core/gatk4/mutect2/main.nf @@ -4,8 +4,8 @@ process GATK4_MUTECT2 { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(input), path(input_index), path(intervals) diff --git a/modules/nf-core/gatk4/mutect2/tests/f1r2.config b/modules/nf-core/gatk4/mutect2/tests/f1r2.config new file mode 100644 index 0000000000..2d3c8a1708 --- /dev/null +++ b/modules/nf-core/gatk4/mutect2/tests/f1r2.config @@ -0,0 +1,3 @@ +process { + ext.args = { "--normal-sample $meta.normal_id --f1r2-tar-gz ${meta.id}.f1r2.tar.gz" } +} diff --git a/modules/nf-core/gatk4/mutect2/tests/main.nf.test b/modules/nf-core/gatk4/mutect2/tests/main.nf.test new file mode 100644 index 0000000000..d247ee3571 --- /dev/null +++ b/modules/nf-core/gatk4/mutect2/tests/main.nf.test @@ -0,0 +1,360 @@ +nextflow_process { + + name "Test Process GATK4_MUTECT2" + script "../main.nf" + process "GATK4_MUTECT2" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/mutect2" + + test("tumor_normal_pair") { + config "./pair.config" + when { + process { + """ + input[0] = [ + [ + id:'test', + normal_id:'normal', + tumor_id:'tumour' + ], + [ + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true) + ], + [ + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true) + ], + [] + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) + ] + input[4] = file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz'], checkIfExists: true) + input[5] = file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz_tbi'], checkIfExists: true) + input[6] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) + input[7] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { + assert snapshot( + process.out.vcf.collect { file(it[1]).getName() }, + process.out.tbi.collect { file(it[1]).getName() }, + process.out.stats, + process.out.f1r2, + process.out.versions, + ).match() + } + ) + } + } + + test("tumor_normal_pair_f1r2") { + config "./f1r2.config" + when { + process { + """ + input[0] = [ + [ + id:'test', + normal_id:'normal', + tumor_id:'tumour' + ], + [ + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true) + ], + [ + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true) + ], + [] + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) + ] + input[4] = file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz'], checkIfExists: true) + input[5] = file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz_tbi'], checkIfExists: true) + input[6] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) + input[7] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) + """ + } + } + then { + assertAll( + { assert process.success }, + { + assert snapshot( + process.out.vcf.collect { file(it[1]).getName() }, + process.out.tbi.collect { file(it[1]).getName() }, + process.out.stats, + process.out.f1r2.collect { file(it[1]).getName() }, + process.out.versions + ).match() + } + ) + } + } + test("tumor_single"){ + when { + process { + """ + input[0] = [ + [ id:'test'], + [ 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)], + [] + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) + ] + input[4] = file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz'], checkIfExists: true) + input[5] = file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz_tbi'], checkIfExists: true) + input[6] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) + input[7] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) + """ + } + } + then { + assertAll( + { assert process.success }, + { + assert snapshot( + process.out.vcf.collect { file(it[1]).getName() }, + process.out.tbi.collect { file(it[1]).getName() }, + process.out.stats, + process.out.f1r2, + process.out.versions + ).match() + } + ) + } + } + test("cram_input"){ + when { + process{ + """ + input[0] = [ + [ id:'test'], + [ 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)], + [] + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) + ] + input[4] = file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz'], checkIfExists: true) + input[5] = file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz_tbi'], checkIfExists: true) + input[6] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) + input[7] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) + """ + } + } + then { + assertAll( + { assert process.success }, + { + assert snapshot( + process.out.vcf.collect { file(it[1]).getName() }, + process.out.tbi.collect { file(it[1]).getName() }, + process.out.stats, + process.out.f1r2, + process.out.versions + ).match() + } + ) + } + } + + test("generate_pon") { + when { + process { + """ + input[0] = [ + [ id:'test'], + [ 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)], + [] + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) + ] + input[4] = [] + input[5] = [] + input[6] = [] + input[7] = [] + """ + } + } + then { + assertAll( + { assert process.success }, + { + assert snapshot( + process.out.vcf.collect { file(it[1]).getName() }, + process.out.tbi.collect { file(it[1]).getName() }, + process.out.stats, + process.out.f1r2, + process.out.versions + ).match() + } + ) + } + } + + test("mitochondria"){ + when { + process { + """ + input[0] = [ + [ id:'test'], + [ file(params.test_data['homo_sapiens']['illumina']['mitochon_standin_recalibrated_sorted_bam'], checkIfExists: true)], + [ file(params.test_data['homo_sapiens']['illumina']['mitochon_standin_recalibrated_sorted_bam_bai'], checkIfExists: true)], + [ file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true)] + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + ] + input[4] = [] + input[5] = [] + input[6] = [] + input[7] = [] + """ + } + } + then { + assertAll( + { assert process.success }, + { + assert snapshot( + process.out.vcf.collect { file(it[1]).getName() }, + process.out.tbi.collect { file(it[1]).getName() }, + process.out.stats, + process.out.f1r2, + process.out.versions + ).match() + } + ) + } + } + + test("tumor_normal_pair_f1r2_stubs"){ + options "-stub-run" + when { + process { + """ + input[0] = [ + [ + id:'test', + normal_id:'normal', + tumor_id:'tumour' + ], + [ + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true) + ], + [ + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true) + ], + [] + ] + input[1] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) + ] + input[4] = file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz'], checkIfExists: true) + input[5] = file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz_tbi'], checkIfExists: true) + input[6] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) + input[7] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) + """ + } + } + then { + assertAll( + { assert process.success }, + { + assert snapshot( + process.out.vcf.collect { file(it[1]).getName() }, + process.out.tbi.collect { file(it[1]).getName() }, + process.out.stats.collect { file(it[1]).getName() }, + process.out.f1r2.collect { file(it[1]).getName() }, + process.out.versions.collect { file(it[1]).getName() } + ).match() + } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/mutect2/tests/main.nf.test.snap b/modules/nf-core/gatk4/mutect2/tests/main.nf.test.snap new file mode 100644 index 0000000000..f047af19dd --- /dev/null +++ b/modules/nf-core/gatk4/mutect2/tests/main.nf.test.snap @@ -0,0 +1,204 @@ +{ + "tumor_normal_pair_f1r2_stubs": { + "content": [ + [ + "test.vcf.gz" + ], + [ + "test.vcf.gz.tbi" + ], + [ + "test.vcf.gz.stats" + ], + [ + "test.f1r2.tar.gz" + ], + [ + "h" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-03-21T10:14:45.599103891" + }, + "generate_pon": { + "content": [ + [ + "test.vcf.gz" + ], + [ + "test.vcf.gz.tbi" + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,b569ce66bbffe9588b3d221e821023ee" + ] + ], + [ + + ], + [ + "versions.yml:md5,d94731c50c20569fe9896235a843f382" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-03-20T15:57:18.264453766" + }, + "mitochondria": { + "content": [ + [ + "test.vcf.gz" + ], + [ + "test.vcf.gz.tbi" + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,4f77301a125913170b8e9e7828b4ca3f" + ] + ], + [ + + ], + [ + "versions.yml:md5,d94731c50c20569fe9896235a843f382" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-03-20T16:05:47.668766905" + }, + "cram_input": { + "content": [ + [ + "test.vcf.gz" + ], + [ + "test.vcf.gz.tbi" + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,55ed641e16089afb33cdbc478e202d3d" + ] + ], + [ + + ], + [ + "versions.yml:md5,d94731c50c20569fe9896235a843f382" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-03-20T15:52:27.894730554" + }, + "tumor_single": { + "content": [ + [ + "test.vcf.gz" + ], + [ + "test.vcf.gz.tbi" + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,55ed641e16089afb33cdbc478e202d3d" + ] + ], + [ + + ], + [ + "versions.yml:md5,d94731c50c20569fe9896235a843f382" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-03-20T15:43:28.935723443" + }, + "tumor_normal_pair": { + "content": [ + [ + "test.vcf.gz" + ], + [ + "test.vcf.gz.tbi" + ], + [ + [ + { + "id": "test", + "normal_id": "normal", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,17d2091015d04cbd4a26b7a67dc659e6" + ] + ], + [ + + ], + [ + "versions.yml:md5,d94731c50c20569fe9896235a843f382" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-03-20T15:31:31.913366311" + }, + "tumor_normal_pair_f1r2": { + "content": [ + [ + "test.vcf.gz" + ], + [ + "test.vcf.gz.tbi" + ], + [ + [ + { + "id": "test", + "normal_id": "normal", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,17d2091015d04cbd4a26b7a67dc659e6" + ] + ], + [ + "test.f1r2.tar.gz" + ], + [ + "versions.yml:md5,d94731c50c20569fe9896235a843f382" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-03-21T09:45:52.321385704" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/mutect2/tests/mito.config b/modules/nf-core/gatk4/mutect2/tests/mito.config new file mode 100644 index 0000000000..de61d3e243 --- /dev/null +++ b/modules/nf-core/gatk4/mutect2/tests/mito.config @@ -0,0 +1,3 @@ +process { + ext.args = { "--mitochondria-mode" } +} diff --git a/modules/nf-core/gatk4/mutect2/tests/pair.config b/modules/nf-core/gatk4/mutect2/tests/pair.config new file mode 100644 index 0000000000..2a812b8254 --- /dev/null +++ b/modules/nf-core/gatk4/mutect2/tests/pair.config @@ -0,0 +1,3 @@ +process { + ext.args = { "--normal-sample $meta.normal_id" } +} diff --git a/modules/nf-core/gatk4/mutect2/tests/tags.yml b/modules/nf-core/gatk4/mutect2/tests/tags.yml new file mode 100644 index 0000000000..4618792742 --- /dev/null +++ b/modules/nf-core/gatk4/mutect2/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/mutect2: + - "modules/nf-core/gatk4/mutect2/**" diff --git a/modules/nf-core/gatk4/variantrecalibrator/environment.yml b/modules/nf-core/gatk4/variantrecalibrator/environment.yml index 619208a56d..95b744c46b 100644 --- a/modules/nf-core/gatk4/variantrecalibrator/environment.yml +++ b/modules/nf-core/gatk4/variantrecalibrator/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4=4.4.0.0 + - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/variantrecalibrator/main.nf b/modules/nf-core/gatk4/variantrecalibrator/main.nf index f9cd45ac94..24844ce0c9 100644 --- a/modules/nf-core/gatk4/variantrecalibrator/main.nf +++ b/modules/nf-core/gatk4/variantrecalibrator/main.nf @@ -4,8 +4,8 @@ process GATK4_VARIANTRECALIBRATOR { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': - 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.5.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(vcf), path(tbi) // input vcf and tbi of variants to recalibrate diff --git a/modules/nf-core/gatk4spark/applybqsr/environment.yml b/modules/nf-core/gatk4spark/applybqsr/environment.yml index 709dd488c9..de07029794 100644 --- a/modules/nf-core/gatk4spark/applybqsr/environment.yml +++ b/modules/nf-core/gatk4spark/applybqsr/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4-spark=4.4.0.0 + - bioconda::gatk4-spark=4.5.0.0 diff --git a/modules/nf-core/gatk4spark/applybqsr/main.nf b/modules/nf-core/gatk4spark/applybqsr/main.nf index 170dbeeafd..316ddc0b1d 100644 --- a/modules/nf-core/gatk4spark/applybqsr/main.nf +++ b/modules/nf-core/gatk4spark/applybqsr/main.nf @@ -4,8 +4,8 @@ process GATK4SPARK_APPLYBQSR { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4-spark:4.4.0.0--hdfd78af_0': - 'biocontainers/gatk4-spark:4.4.0.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4-spark:4.5.0.0--hdfd78af_0': + 'biocontainers/gatk4-spark:4.5.0.0--hdfd78af_0' }" input: tuple val(meta), path(input), path(input_index), path(bqsr_table), path(intervals) @@ -50,4 +50,16 @@ process GATK4SPARK_APPLYBQSR { gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bam + touch ${prefix}.cram + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/gatk4spark/applybqsr/tests/main.nf.test b/modules/nf-core/gatk4spark/applybqsr/tests/main.nf.test new file mode 100644 index 0000000000..53f2021613 --- /dev/null +++ b/modules/nf-core/gatk4spark/applybqsr/tests/main.nf.test @@ -0,0 +1,127 @@ +nextflow_process { + + name "Test Process GATK4SPARK_APPLYBQSR" + script "../main.nf" + config "./nextflow.config" + process "GATK4SPARK_APPLYBQSR" + + tag "modules" + tag "modules_nfcore" + tag "gatk4spark" + tag "gatk4spark/applybqsr" + + test("sarscov2 - bam") { + + when { + process { + """ + input[0] = [ + [ 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['sarscov2']['illumina']['test_baserecalibrator_table'], checkIfExists: true), + [] + ] + input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + input[2] = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + input[3] = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - bam intervals") { + + when { + process { + """ + input[0] = [ + [ 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['sarscov2']['illumina']['test_baserecalibrator_table'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + input[2] = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + input[3] = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - bam - stub") { + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [], + [], + [], + [] + ] + input[1] = [] + input[2] = [] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - cram") { + + when { + process { + """ + input[0] = [ + [ 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), + file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + ] + input[1] = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + input[2] = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + input[3] = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + +} diff --git a/modules/nf-core/gatk4spark/applybqsr/tests/main.nf.test.snap b/modules/nf-core/gatk4spark/applybqsr/tests/main.nf.test.snap new file mode 100644 index 0000000000..c4171be861 --- /dev/null +++ b/modules/nf-core/gatk4spark/applybqsr/tests/main.nf.test.snap @@ -0,0 +1,168 @@ +{ + "sarscov2 - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,908022a782ee4e7d9c8264a2aa2c1c9f" + ], + "bam": [ + [ + { + "id": "test" + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ + [ + { + "id": "test" + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,908022a782ee4e7d9c8264a2aa2c1c9f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-15T10:12:13.226593047" + }, + "sarscov2 - cram": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test" + }, + "test.cram:md5,133213fe1e49e30f796e1eb836fb6611" + ] + ], + "2": [ + "versions.yml:md5,908022a782ee4e7d9c8264a2aa2c1c9f" + ], + "bam": [ + + ], + "cram": [ + [ + { + "id": "test" + }, + "test.cram:md5,133213fe1e49e30f796e1eb836fb6611" + ] + ], + "versions": [ + "versions.yml:md5,908022a782ee4e7d9c8264a2aa2c1c9f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-15T11:43:27.971279286" + }, + "sarscov2 - bam": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bam:md5,1901c819fcba0fdd5e2482e6dc8285ef" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,908022a782ee4e7d9c8264a2aa2c1c9f" + ], + "bam": [ + [ + { + "id": "test" + }, + "test.bam:md5,1901c819fcba0fdd5e2482e6dc8285ef" + ] + ], + "cram": [ + + ], + "versions": [ + "versions.yml:md5,908022a782ee4e7d9c8264a2aa2c1c9f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-15T11:40:33.915518205" + }, + "sarscov2 - bam intervals": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bam:md5,2ca2446f0125890280056fd7da822732" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,908022a782ee4e7d9c8264a2aa2c1c9f" + ], + "bam": [ + [ + { + "id": "test" + }, + "test.bam:md5,2ca2446f0125890280056fd7da822732" + ] + ], + "cram": [ + + ], + "versions": [ + "versions.yml:md5,908022a782ee4e7d9c8264a2aa2c1c9f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-15T11:42:52.310003463" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4spark/applybqsr/tests/nextflow.config b/modules/nf-core/gatk4spark/applybqsr/tests/nextflow.config new file mode 100644 index 0000000000..85142680d8 --- /dev/null +++ b/modules/nf-core/gatk4spark/applybqsr/tests/nextflow.config @@ -0,0 +1 @@ +docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64 -e "HOME=${HOME}" -v /etc/passwd:/etc/passwd:ro -v /etc/shadow:/etc/shadow:ro -v /etc/group:/etc/group:ro -v $HOME:$HOME' diff --git a/modules/nf-core/gatk4spark/applybqsr/tests/tags.yml b/modules/nf-core/gatk4spark/applybqsr/tests/tags.yml new file mode 100644 index 0000000000..275670766f --- /dev/null +++ b/modules/nf-core/gatk4spark/applybqsr/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4spark/applybqsr: + - "modules/nf-core/gatk4spark/applybqsr/**" diff --git a/modules/nf-core/gatk4spark/baserecalibrator/environment.yml b/modules/nf-core/gatk4spark/baserecalibrator/environment.yml index bf2568a2a8..84615886c1 100644 --- a/modules/nf-core/gatk4spark/baserecalibrator/environment.yml +++ b/modules/nf-core/gatk4spark/baserecalibrator/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4-spark=4.4.0.0 + - bioconda::gatk4-spark=4.5.0.0 diff --git a/modules/nf-core/gatk4spark/baserecalibrator/main.nf b/modules/nf-core/gatk4spark/baserecalibrator/main.nf index ee44bf7d66..32af761912 100644 --- a/modules/nf-core/gatk4spark/baserecalibrator/main.nf +++ b/modules/nf-core/gatk4spark/baserecalibrator/main.nf @@ -4,8 +4,8 @@ process GATK4SPARK_BASERECALIBRATOR { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4-spark:4.4.0.0--hdfd78af_0': - 'biocontainers/gatk4-spark:4.4.0.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4-spark:4.5.0.0--hdfd78af_0': + 'biocontainers/gatk4-spark:4.5.0.0--hdfd78af_0' }" input: tuple val(meta), path(input), path(input_index), path(intervals) diff --git a/modules/nf-core/gatk4spark/markduplicates/environment.yml b/modules/nf-core/gatk4spark/markduplicates/environment.yml index 3e33d7fe3d..94dd4a3c68 100644 --- a/modules/nf-core/gatk4spark/markduplicates/environment.yml +++ b/modules/nf-core/gatk4spark/markduplicates/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gatk4-spark=4.4.0.0 + - bioconda::gatk4-spark=4.5.0.0 diff --git a/modules/nf-core/gatk4spark/markduplicates/main.nf b/modules/nf-core/gatk4spark/markduplicates/main.nf index 61e295c839..b6a6daffea 100644 --- a/modules/nf-core/gatk4spark/markduplicates/main.nf +++ b/modules/nf-core/gatk4spark/markduplicates/main.nf @@ -4,8 +4,8 @@ process GATK4SPARK_MARKDUPLICATES { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4-spark:4.4.0.0--hdfd78af_0': - 'biocontainers/gatk4-spark:4.4.0.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4-spark:4.5.0.0--hdfd78af_0': + 'biocontainers/gatk4-spark:4.5.0.0--hdfd78af_0' }" input: tuple val(meta), path(bam) @@ -24,7 +24,7 @@ process GATK4SPARK_MARKDUPLICATES { script: def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" + prefix = task.ext.prefix ?: "${meta.id}.bam" def input_list = bam.collect{"--input $it"}.join(' ') def avail_mem = 3072 @@ -46,7 +46,18 @@ process GATK4SPARK_MARKDUPLICATES { cat <<-END_VERSIONS > versions.yml "${task.process}": gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') - openjdk: \$(echo \$(java -version 2>&1) | grep version | sed 's/\"//g' | cut -f3 -d ' ') + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}.bam" + """ + touch ${prefix} + touch ${prefix}.bai + touch ${prefix}.metrics + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ } diff --git a/modules/nf-core/gatk4spark/markduplicates/tests/bam.config b/modules/nf-core/gatk4spark/markduplicates/tests/bam.config new file mode 100644 index 0000000000..7135842481 --- /dev/null +++ b/modules/nf-core/gatk4spark/markduplicates/tests/bam.config @@ -0,0 +1,5 @@ +process { + withName: GATK4SPARK_MARKDUPLICATES { + ext.prefix = { "${meta.id}.bam" } + } +} diff --git a/modules/nf-core/gatk4spark/markduplicates/tests/cram.config b/modules/nf-core/gatk4spark/markduplicates/tests/cram.config new file mode 100644 index 0000000000..03f3302b06 --- /dev/null +++ b/modules/nf-core/gatk4spark/markduplicates/tests/cram.config @@ -0,0 +1,5 @@ +process { + withName: GATK4SPARK_MARKDUPLICATES { + ext.prefix = { "${meta.id}.cram" } + } +} diff --git a/modules/nf-core/gatk4spark/markduplicates/tests/main.nf.test b/modules/nf-core/gatk4spark/markduplicates/tests/main.nf.test new file mode 100644 index 0000000000..2aa2db69ed --- /dev/null +++ b/modules/nf-core/gatk4spark/markduplicates/tests/main.nf.test @@ -0,0 +1,158 @@ +nextflow_process { + + name "Test Process GATK4SPARK_MARKDUPLICATES" + script "../main.nf" + config "./nextflow.config" + process "GATK4SPARK_MARKDUPLICATES" + + tag "modules" + tag "modules_nfcore" + tag "gatk4spark" + tag "gatk4spark/markduplicates" + + test("sarscov2 - bam") { + config "./bam.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + input[2] = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + input[3] = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - bam - multiple") { + config "./bam.config" + + when { + process { + """ + input[0] = [ + [ 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) + ] + ] + input[1] = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + input[2] = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + input[3] = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - bam - metrics") { + config "./metrics.config" + + when { + process { + """ + input[0] = [ + [ 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) + ] + ] + input[1] = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + input[2] = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + input[3] = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("homo_sapiens - bam - metrics - versions") }, + { assert snapshot(process.out.output).match("homo_sapiens - bam - metrics - output") }, + { assert snapshot(process.out.bam_index).match("homo_sapiens - bam - metrics - bam_index") }, + { assert path(process.out.metrics[0][1]).readLines()[5].contains("GATKDuplicationMetrics") }, + { assert path(process.out.metrics[0][1]).readLines().size() == 11 } + ) + } + + } + + test("homo_sapiens - cram") { + config "./cram.config" + + when { + process { + """ + input[0] = [ + [ 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) + ] + ] + input[1] = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + input[2] = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + input[3] = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("stub") { + config "./bam.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [] + ] + input[1] = [] + input[2] = [] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + +} diff --git a/modules/nf-core/gatk4spark/markduplicates/tests/main.nf.test.snap b/modules/nf-core/gatk4spark/markduplicates/tests/main.nf.test.snap new file mode 100644 index 0000000000..4968a1ce65 --- /dev/null +++ b/modules/nf-core/gatk4spark/markduplicates/tests/main.nf.test.snap @@ -0,0 +1,286 @@ +{ + "homo_sapiens - bam - multiple": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,1154a16717d430199f3e9994a87b546a" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d947dccacf3fb7fcf174d364a5f7856d" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9699197d0e667ab368a8c6d2a6893cc6" + ], + "bam_index": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d947dccacf3fb7fcf174d364a5f7856d" + ] + ], + "metrics": [ + + ], + "output": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,1154a16717d430199f3e9994a87b546a" + ] + ], + "versions": [ + "versions.yml:md5,9699197d0e667ab368a8c6d2a6893cc6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-15T11:53:11.621016088" + }, + "homo_sapiens - bam - metrics - output": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,1154a16717d430199f3e9994a87b546a" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-15T11:53:32.254055925" + }, + "homo_sapiens - cram": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cram:md5,e3bcab34b141b0838cd9b6b779e09a7a" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9699197d0e667ab368a8c6d2a6893cc6" + ], + "bam_index": [ + + ], + "metrics": [ + + ], + "output": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cram:md5,e3bcab34b141b0838cd9b6b779e09a7a" + ] + ], + "versions": [ + "versions.yml:md5,9699197d0e667ab368a8c6d2a6893cc6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-15T11:53:53.339811107" + }, + "homo_sapiens - bam - metrics - versions": { + "content": [ + [ + "versions.yml:md5,9699197d0e667ab368a8c6d2a6893cc6" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-15T11:53:32.199010065" + }, + "homo_sapiens - bam - metrics - bam_index": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d947dccacf3fb7fcf174d364a5f7856d" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-15T11:53:32.305216975" + }, + "stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.metrics:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,9699197d0e667ab368a8c6d2a6893cc6" + ], + "bam_index": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "metrics": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.metrics:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "output": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,9699197d0e667ab368a8c6d2a6893cc6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-15T10:56:48.15652292" + }, + "sarscov2 - bam": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,dc1a09ac6371aab7c50d1a554baa06d3" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,253c47e57247a2cee11afcbb414122a4" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9699197d0e667ab368a8c6d2a6893cc6" + ], + "bam_index": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,253c47e57247a2cee11afcbb414122a4" + ] + ], + "metrics": [ + + ], + "output": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,dc1a09ac6371aab7c50d1a554baa06d3" + ] + ], + "versions": [ + "versions.yml:md5,9699197d0e667ab368a8c6d2a6893cc6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-15T11:52:51.5386181" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4spark/markduplicates/tests/metrics.config b/modules/nf-core/gatk4spark/markduplicates/tests/metrics.config new file mode 100644 index 0000000000..b3710223c1 --- /dev/null +++ b/modules/nf-core/gatk4spark/markduplicates/tests/metrics.config @@ -0,0 +1,6 @@ +process { + withName: GATK4SPARK_MARKDUPLICATES { + ext.args = '--metrics-file test.metrics' + ext.prefix = { "${meta.id}.bam" } + } +} diff --git a/modules/nf-core/gatk4spark/markduplicates/tests/nextflow.config b/modules/nf-core/gatk4spark/markduplicates/tests/nextflow.config new file mode 100644 index 0000000000..85142680d8 --- /dev/null +++ b/modules/nf-core/gatk4spark/markduplicates/tests/nextflow.config @@ -0,0 +1 @@ +docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64 -e "HOME=${HOME}" -v /etc/passwd:/etc/passwd:ro -v /etc/shadow:/etc/shadow:ro -v /etc/group:/etc/group:ro -v $HOME:$HOME' diff --git a/modules/nf-core/gatk4spark/markduplicates/tests/tags.yml b/modules/nf-core/gatk4spark/markduplicates/tests/tags.yml new file mode 100644 index 0000000000..fc04bfa576 --- /dev/null +++ b/modules/nf-core/gatk4spark/markduplicates/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4spark/markduplicates: + - "modules/nf-core/gatk4spark/markduplicates/**" diff --git a/modules/local/build_intervals/environment.yml b/modules/nf-core/gawk/environment.yml similarity index 100% rename from modules/local/build_intervals/environment.yml rename to modules/nf-core/gawk/environment.yml diff --git a/modules/nf-core/gawk/main.nf b/modules/nf-core/gawk/main.nf new file mode 100644 index 0000000000..f856a1f82b --- /dev/null +++ b/modules/nf-core/gawk/main.nf @@ -0,0 +1,54 @@ +process GAWK { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gawk:5.1.0' : + 'biocontainers/gawk:5.1.0' }" + + input: + tuple val(meta), path(input) + path(program_file) + + output: + tuple val(meta), path("${prefix}.${suffix}"), emit: output + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' // args is used for the main arguments of the tool + def args2 = task.ext.args2 ?: '' // args2 is used to specify a program when no program file has been given + prefix = task.ext.prefix ?: "${meta.id}" + suffix = task.ext.suffix ?: "${input.getExtension()}" + + program = program_file ? "-f ${program_file}" : "${args2}" + + """ + awk \\ + ${args} \\ + ${program} \\ + ${input} \\ + > ${prefix}.${suffix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gawk: \$(awk -Wversion | sed '1!d; s/.*Awk //; s/,.*//') + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + suffix = task.ext.suffix ?: "${input.getExtension}" + + """ + touch ${prefix}.${suffix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gawk: \$(awk -Wversion | sed '1!d; s/.*Awk //; s/,.*//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/gawk/meta.yml b/modules/nf-core/gawk/meta.yml new file mode 100644 index 0000000000..2b6033b0b5 --- /dev/null +++ b/modules/nf-core/gawk/meta.yml @@ -0,0 +1,50 @@ +name: "gawk" +description: | + If you are like many computer users, you would frequently like to make changes in various text files + wherever certain patterns appear, or extract data from parts of certain lines while discarding the rest. + The job is easy with awk, especially the GNU implementation gawk. +keywords: + - gawk + - awk + - txt + - text + - file parsing +tools: + - "gawk": + description: "GNU awk" + homepage: "https://www.gnu.org/software/gawk/" + documentation: "https://www.gnu.org/software/gawk/manual/" + tool_dev_url: "https://www.gnu.org/prep/ftp.html" + licence: ["GPL v3"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: The input file - Specify the logic that needs to be executed on this file on the `ext.args2` or in the program file + pattern: "*" + - program_file: + type: file + description: Optional file containing logic for awk to execute. If you don't wish to use a file, you can use `ext.args2` to specify the logic. + 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" + - output: + type: file + description: The output file - specify the name of this file using `ext.prefix` and the extension using `ext.suffix` + pattern: "*" +authors: + - "@nvnieuwk" +maintainers: + - "@nvnieuwk" diff --git a/modules/nf-core/gawk/tests/main.nf.test b/modules/nf-core/gawk/tests/main.nf.test new file mode 100644 index 0000000000..fce82ca95a --- /dev/null +++ b/modules/nf-core/gawk/tests/main.nf.test @@ -0,0 +1,56 @@ +nextflow_process { + + name "Test Process GAWK" + script "../main.nf" + process "GAWK" + + tag "modules" + tag "modules_nfcore" + tag "gawk" + + test("convert fasta to bed") { + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("convert fasta to bed with program file") { + config "./nextflow_with_program_file.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[1] = Channel.of('BEGIN {FS="\t"}; {print \$1 FS "0" FS \$2}').collectFile(name:"program.txt") + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/gawk/tests/main.nf.test.snap b/modules/nf-core/gawk/tests/main.nf.test.snap new file mode 100644 index 0000000000..ce20747890 --- /dev/null +++ b/modules/nf-core/gawk/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "convert fasta to bed with program file": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" + ] + ], + "1": [ + "versions.yml:md5,4c320d8c98ca80690afd7651da1ba520" + ], + "output": [ + [ + { + "id": "test" + }, + "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" + ] + ], + "versions": [ + "versions.yml:md5,4c320d8c98ca80690afd7651da1ba520" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-04-05T11:00:28.097563" + }, + "convert fasta to bed": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" + ] + ], + "1": [ + "versions.yml:md5,4c320d8c98ca80690afd7651da1ba520" + ], + "output": [ + [ + { + "id": "test" + }, + "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" + ] + ], + "versions": [ + "versions.yml:md5,4c320d8c98ca80690afd7651da1ba520" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-04-05T10:28:15.625869" + } +} \ No newline at end of file diff --git a/modules/nf-core/gawk/tests/nextflow.config b/modules/nf-core/gawk/tests/nextflow.config new file mode 100644 index 0000000000..6e5d43a35c --- /dev/null +++ b/modules/nf-core/gawk/tests/nextflow.config @@ -0,0 +1,6 @@ +process { + withName: GAWK { + ext.suffix = "bed" + ext.args2 = '\'BEGIN {FS="\t"}; {print \$1 FS "0" FS \$2}\'' + } +} diff --git a/modules/nf-core/gawk/tests/nextflow_with_program_file.config b/modules/nf-core/gawk/tests/nextflow_with_program_file.config new file mode 100644 index 0000000000..693ad41963 --- /dev/null +++ b/modules/nf-core/gawk/tests/nextflow_with_program_file.config @@ -0,0 +1,5 @@ +process { + withName: GAWK { + ext.suffix = "bed" + } +} diff --git a/modules/nf-core/gawk/tests/tags.yml b/modules/nf-core/gawk/tests/tags.yml new file mode 100644 index 0000000000..72e4531d22 --- /dev/null +++ b/modules/nf-core/gawk/tests/tags.yml @@ -0,0 +1,2 @@ +gawk: + - "modules/nf-core/gawk/**" diff --git a/modules/nf-core/manta/germline/main.nf b/modules/nf-core/manta/germline/main.nf index 5d5666c6e5..c1b339a95b 100644 --- a/modules/nf-core/manta/germline/main.nf +++ b/modules/nf-core/manta/germline/main.nf @@ -66,11 +66,11 @@ process MANTA_GERMLINE { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.candidate_small_indels.vcf.gz + echo "" | gzip > ${prefix}.candidate_small_indels.vcf.gz touch ${prefix}.candidate_small_indels.vcf.gz.tbi - touch ${prefix}.candidate_sv.vcf.gz + echo "" | gzip > ${prefix}.candidate_sv.vcf.gz touch ${prefix}.candidate_sv.vcf.gz.tbi - touch ${prefix}.diploid_sv.vcf.gz + echo "" | gzip > ${prefix}.diploid_sv.vcf.gz touch ${prefix}.diploid_sv.vcf.gz.tbi cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/manta/germline/tests/main.nf.test b/modules/nf-core/manta/germline/tests/main.nf.test new file mode 100644 index 0000000000..1d49ad23a1 --- /dev/null +++ b/modules/nf-core/manta/germline/tests/main.nf.test @@ -0,0 +1,162 @@ +nextflow_process { + + name "Test Process MANTA_GERMLINE" + script "../main.nf" + process "MANTA_GERMLINE" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "manta" + tag "manta/germline" + + test("human - cram") { + + when { + process { + """ + input[0] = [ [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + [],[] + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = Channel.of("[manta]", "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes = 0") + .collectFile(name:"manta_options.ini", newLine:true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.diploid_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("version") } + ) + } + + } + + test("human - cram - bed") { + + when { + process { + """ + input[0] = [ [ id:'bed_test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz.tbi', checkIfExists: true) + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.diploid_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("bed_version") } + ) + } + + } + + test("human - cram - bed - jointcalling") { + + when { + process { + """ + input[0] = [ [ id:'bed_test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.sorted.cram', checkIfExists: true) + ], + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.sorted.cram.crai', checkIfExists: true) + ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz.tbi', checkIfExists: true) + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.diploid_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("joint_version") } + ) + } + + } + test("human - cram - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + [],[] + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/manta/germline/tests/main.nf.test.snap b/modules/nf-core/manta/germline/tests/main.nf.test.snap new file mode 100644 index 0000000000..79d5541e32 --- /dev/null +++ b/modules/nf-core/manta/germline/tests/main.nf.test.snap @@ -0,0 +1,139 @@ +{ + "human - cram - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "3": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test" + }, + "test.diploid_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + [ + { + "id": "test" + }, + "test.diploid_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + "versions.yml:md5,18070b443a26855ef64dafa179dfba01" + ], + "candidate_small_indels_vcf": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "candidate_small_indels_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "candidate_sv_vcf": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "candidate_sv_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "diploid_sv_vcf": [ + [ + { + "id": "test" + }, + "test.diploid_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "diploid_sv_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.diploid_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,18070b443a26855ef64dafa179dfba01" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-21T17:54:09.788372" + }, + "joint_version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-21T15:03:07.745972" + }, + "bed_version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-21T13:49:38.745653" + }, + "version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-21T13:49:14.885769" + } +} \ No newline at end of file diff --git a/modules/nf-core/manta/germline/tests/nextflow.config b/modules/nf-core/manta/germline/tests/nextflow.config new file mode 100644 index 0000000000..22acb24265 --- /dev/null +++ b/modules/nf-core/manta/germline/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: MANTA_GERMLINE { + ext.args = '--exome ' + } +} diff --git a/modules/nf-core/manta/germline/tests/tags.yml b/modules/nf-core/manta/germline/tests/tags.yml new file mode 100644 index 0000000000..99d1a73ca3 --- /dev/null +++ b/modules/nf-core/manta/germline/tests/tags.yml @@ -0,0 +1,2 @@ +manta/germline: + - "modules/nf-core/manta/germline/**" diff --git a/modules/nf-core/manta/somatic/main.nf b/modules/nf-core/manta/somatic/main.nf index 07511b2f0b..099d44c90b 100644 --- a/modules/nf-core/manta/somatic/main.nf +++ b/modules/nf-core/manta/somatic/main.nf @@ -71,13 +71,13 @@ process MANTA_SOMATIC { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.candidate_small_indels.vcf.gz + echo "" | gzip > ${prefix}.candidate_small_indels.vcf.gz touch ${prefix}.candidate_small_indels.vcf.gz.tbi - touch ${prefix}.candidate_sv.vcf.gz + echo "" | gzip > ${prefix}.candidate_sv.vcf.gz touch ${prefix}.candidate_sv.vcf.gz.tbi - touch ${prefix}.diploid_sv.vcf.gz + echo "" | gzip > ${prefix}.diploid_sv.vcf.gz touch ${prefix}.diploid_sv.vcf.gz.tbi - touch ${prefix}.somatic_sv.vcf.gz + echo "" | gzip > ${prefix}.somatic_sv.vcf.gz touch ${prefix}.somatic_sv.vcf.gz.tbi cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/manta/somatic/tests/main.nf.test b/modules/nf-core/manta/somatic/tests/main.nf.test new file mode 100644 index 0000000000..121f13849f --- /dev/null +++ b/modules/nf-core/manta/somatic/tests/main.nf.test @@ -0,0 +1,121 @@ +nextflow_process { + + name "Test Process MANTA_SOMATIC" + script "../main.nf" + process "MANTA_SOMATIC" + + tag "modules" + tag "modules_nfcore" + tag "manta" + tag "manta/somatic" + + test("human - cram") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + [], [] + ] + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = Channel.of("[manta]", "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes = 0") + .collectFile(name:"manta_options.ini", newLine:true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.diploid_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.somatic_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("version") } + ) + } + + } + + test("human - cram - bed") { + + when { + process { + """ + input[0] = [ [ id:'bed_test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz.tbi', checkIfExists: true) + ] + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.diploid_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.somatic_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("bed_version") } + ) + } + + } + + test("human - cram - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + [], [] + ] + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = Channel.of("[manta]", "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes = 0") + .collectFile(name:"manta_options.ini", newLine:true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/manta/somatic/tests/main.nf.test.snap b/modules/nf-core/manta/somatic/tests/main.nf.test.snap new file mode 100644 index 0000000000..03af6607a1 --- /dev/null +++ b/modules/nf-core/manta/somatic/tests/main.nf.test.snap @@ -0,0 +1,179 @@ +{ + "human - cram - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.candidate_small_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.candidate_small_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.candidate_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.candidate_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.diploid_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.diploid_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + "versions.yml:md5,816f991f1d88cadebdeff97b0b676932" + ], + "candidate_small_indels_vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.candidate_small_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "candidate_small_indels_vcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.candidate_small_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "candidate_sv_vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.candidate_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "candidate_sv_vcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.candidate_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "diploid_sv_vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.diploid_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "diploid_sv_vcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.diploid_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "somatic_sv_vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "somatic_sv_vcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,816f991f1d88cadebdeff97b0b676932" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T13:15:58.471602141" + }, + "bed_version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T11:38:45.879278746" + }, + "version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T11:38:33.463803355" + } +} \ No newline at end of file diff --git a/modules/nf-core/manta/somatic/tests/tags.yml b/modules/nf-core/manta/somatic/tests/tags.yml new file mode 100644 index 0000000000..0f4e8ea2c8 --- /dev/null +++ b/modules/nf-core/manta/somatic/tests/tags.yml @@ -0,0 +1,2 @@ +manta/somatic: + - "modules/nf-core/manta/somatic/**" diff --git a/modules/nf-core/manta/tumoronly/main.nf b/modules/nf-core/manta/tumoronly/main.nf index b047299571..21459aa952 100644 --- a/modules/nf-core/manta/tumoronly/main.nf +++ b/modules/nf-core/manta/tumoronly/main.nf @@ -64,11 +64,11 @@ process MANTA_TUMORONLY { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.candidate_small_indels.vcf.gz + echo "" | gzip > ${prefix}.candidate_small_indels.vcf.gz touch ${prefix}.candidate_small_indels.vcf.gz.tbi - touch ${prefix}.candidate_sv.vcf.gz + echo "" | gzip > ${prefix}.candidate_sv.vcf.gz touch ${prefix}.candidate_sv.vcf.gz.tbi - touch ${prefix}.tumor_sv.vcf.gz + echo "" | gzip > ${prefix}.tumor_sv.vcf.gz touch ${prefix}.tumor_sv.vcf.gz.tbi cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/manta/tumoronly/tests/main.nf.test b/modules/nf-core/manta/tumoronly/tests/main.nf.test new file mode 100644 index 0000000000..9d57b1d8f7 --- /dev/null +++ b/modules/nf-core/manta/tumoronly/tests/main.nf.test @@ -0,0 +1,121 @@ +nextflow_process { + + name "Test Process MANTA_TUMORONLY" + script "../main.nf" + process "MANTA_TUMORONLY" + + tag "modules" + tag "modules_nfcore" + tag "manta" + tag "manta/tumoronly" + + test("human - cram") { + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + [], [] + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = Channel.of("[manta]", "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes = 0") + .collectFile(name:"manta_options.ini", newLine:true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.tumor_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("version") } + ) + } + + } + + test("human - cram - bed") { + + when { + process { + """ + input[0] = [ [ id:'bed_test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz.tbi', checkIfExists: true) + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.tumor_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("bed_version") } + ) + } + + } + + test("human - cram - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + [], [] + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/manta/tumoronly/tests/main.nf.test.snap b/modules/nf-core/manta/tumoronly/tests/main.nf.test.snap new file mode 100644 index 0000000000..abeccd7ac5 --- /dev/null +++ b/modules/nf-core/manta/tumoronly/tests/main.nf.test.snap @@ -0,0 +1,123 @@ +{ + "human - cram - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "3": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test" + }, + "test.tumor_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + [ + { + "id": "test" + }, + "test.tumor_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + "versions.yml:md5,ebbae8cb2fa4e5227b8358914674523c" + ], + "candidate_small_indels_vcf": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "candidate_small_indels_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "candidate_sv_vcf": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "candidate_sv_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tumor_sv_vcf": [ + [ + { + "id": "test" + }, + "test.tumor_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "tumor_sv_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.tumor_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,ebbae8cb2fa4e5227b8358914674523c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-21T14:44:15.752887" + }, + "version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-21T14:36:52.480477" + } +} \ No newline at end of file diff --git a/modules/nf-core/manta/tumoronly/tests/tags.yml b/modules/nf-core/manta/tumoronly/tests/tags.yml new file mode 100644 index 0000000000..cf38c24225 --- /dev/null +++ b/modules/nf-core/manta/tumoronly/tests/tags.yml @@ -0,0 +1,2 @@ +manta/tumoronly: + - "modules/nf-core/manta/tumoronly/**" diff --git a/modules/nf-core/mosdepth/environment.yml b/modules/nf-core/mosdepth/environment.yml index b12e3cb127..88c7126c05 100644 --- a/modules/nf-core/mosdepth/environment.yml +++ b/modules/nf-core/mosdepth/environment.yml @@ -5,4 +5,4 @@ channels: - defaults dependencies: # renovate: datasource=conda depName=bioconda/mosdepth - - mosdepth=0.3.3 + - mosdepth=0.3.6 diff --git a/modules/nf-core/mosdepth/main.nf b/modules/nf-core/mosdepth/main.nf index 7dd13ffb51..0190a09d80 100644 --- a/modules/nf-core/mosdepth/main.nf +++ b/modules/nf-core/mosdepth/main.nf @@ -4,8 +4,8 @@ process MOSDEPTH { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mosdepth:0.3.3--hdfd78af_1' : - 'biocontainers/mosdepth:0.3.3--hdfd78af_1'}" + 'https://depot.galaxyproject.org/singularity/mosdepth:0.3.6--hd299d5a_0' : + 'biocontainers/mosdepth:0.3.6--hd299d5a_0'}" input: tuple val(meta), path(bam), path(bai), path(bed) @@ -63,13 +63,13 @@ process MOSDEPTH { touch ${prefix}.region.dist.txt touch ${prefix}.summary.txt touch ${prefix}.per-base.d4 - touch ${prefix}.per-base.bed.gz + echo "" | gzip > ${prefix}.per-base.bed.gz touch ${prefix}.per-base.bed.gz.csi - touch ${prefix}.regions.bed.gz + echo "" | gzip > ${prefix}.regions.bed.gz touch ${prefix}.regions.bed.gz.csi - touch ${prefix}.quantized.bed.gz + echo "" | gzip > ${prefix}.quantized.bed.gz touch ${prefix}.quantized.bed.gz.csi - touch ${prefix}.thresholds.bed.gz + echo "" | gzip > ${prefix}.thresholds.bed.gz touch ${prefix}.thresholds.bed.gz.csi cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/mosdepth/meta.yml b/modules/nf-core/mosdepth/meta.yml index 76263b5af9..9caaf2cdbc 100644 --- a/modules/nf-core/mosdepth/meta.yml +++ b/modules/nf-core/mosdepth/meta.yml @@ -26,19 +26,14 @@ input: type: file description: Index for BAM/CRAM file pattern: "*.{bai,crai}" - - meta2: - type: map - description: | - Groovy Map containing bed information - e.g. [ id:'test' ] - bed: type: file description: BED file with intersected intervals pattern: "*.{bed}" - - meta3: + - meta2: type: map description: | - Groovy Map containing reference information + Groovy Map containing bed information e.g. [ id:'test' ] - fasta: type: file diff --git a/modules/nf-core/mosdepth/tests/main.nf.test b/modules/nf-core/mosdepth/tests/main.nf.test new file mode 100644 index 0000000000..21eebc1fa5 --- /dev/null +++ b/modules/nf-core/mosdepth/tests/main.nf.test @@ -0,0 +1,246 @@ +nextflow_process { + + name "Test Process MOSDEPTH" + script "../main.nf" + process "MOSDEPTH" + + tag "modules" + tag "modules_nfcore" + tag "mosdepth" + + test("homo_sapiens - bam, bai, []") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + 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), + [] + ] + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - bam, bai, bed") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + 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']['genome']['genome_bed'], checkIfExists: true) + ] + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - cram, crai, []") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + 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), + [] + ] + input[1] = [ + [ id:'test' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - cram, crai, bed") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + 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']['genome']['genome_bed'], checkIfExists: true) + ] + input[1] = [ + [ id:'test' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - bam, bai, [] - window") { + + config "./window.config" + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + 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), + [] + ] + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - bam, bai, [] - quantized") { + + config "./quantized.config" + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + 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), + [] + ] + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - bam, bai, bed - thresholds") { + + config "./threshold.config" + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + 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']['genome']['genome_bed'], checkIfExists: true) + ] + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - bam, bai, bed - fail") { + + config "./window.config" + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + 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']['genome']['genome_bed'], checkIfExists: true) + ] + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.failed } + ) + } + + } + + test("homo_sapiens - bam, bai, [] - stub") { + + options "-stub" + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + 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']['genome']['genome_bed'], checkIfExists: true) + ] + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/mosdepth/tests/main.nf.test.snap b/modules/nf-core/mosdepth/tests/main.nf.test.snap new file mode 100644 index 0000000000..00f4cd974b --- /dev/null +++ b/modules/nf-core/mosdepth/tests/main.nf.test.snap @@ -0,0 +1,1386 @@ +{ + "homo_sapiens - bam, bai, [] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.global.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.summary.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.region.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.d4:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "9": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "global_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.global.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "per_base_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "per_base_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "per_base_d4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.d4:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "quantized_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "quantized_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "regions_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "regions_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "regions_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.region.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.summary.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "thresholds_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "thresholds_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:29:04.084192" + }, + "homo_sapiens - cram, crai, bed": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,96c037f769974b904beb53edc4f56d82" + ] + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.region.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + ] + ], + "8": [ + + ], + "9": [ + + ], + "global_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "per_base_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "per_base_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "per_base_d4": [ + + ], + "quantized_bed": [ + + ], + "quantized_csi": [ + + ], + "regions_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" + ] + ], + "regions_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + ] + ], + "regions_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.region.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "summary_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,96c037f769974b904beb53edc4f56d82" + ] + ], + "thresholds_bed": [ + + ], + "thresholds_csi": [ + + ], + "versions": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:28:16.664319" + }, + "homo_sapiens - bam, bai, [] - quantized": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,4f0d231060cbde4efdd673863bd2fb59" + ] + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "6": [ + + ], + "7": [ + + ], + "8": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz:md5,f037c215449d361112efc10108fcc17c" + ] + ], + "9": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz.csi:md5,be9617f551f19a33923f1e886eaefb93" + ] + ], + "global_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "per_base_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "per_base_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "per_base_d4": [ + + ], + "quantized_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz:md5,f037c215449d361112efc10108fcc17c" + ] + ], + "quantized_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz.csi:md5,be9617f551f19a33923f1e886eaefb93" + ] + ], + "regions_bed": [ + + ], + "regions_csi": [ + + ], + "regions_txt": [ + + ], + "summary_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,4f0d231060cbde4efdd673863bd2fb59" + ] + ], + "thresholds_bed": [ + + ], + "thresholds_csi": [ + + ], + "versions": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:28:35.978752" + }, + "homo_sapiens - bam, bai, bed": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,96c037f769974b904beb53edc4f56d82" + ] + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.region.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + ] + ], + "8": [ + + ], + "9": [ + + ], + "global_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "per_base_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "per_base_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "per_base_d4": [ + + ], + "quantized_bed": [ + + ], + "quantized_csi": [ + + ], + "regions_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" + ] + ], + "regions_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + ] + ], + "regions_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.region.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "summary_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,96c037f769974b904beb53edc4f56d82" + ] + ], + "thresholds_bed": [ + + ], + "thresholds_csi": [ + + ], + "versions": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:27:55.598384" + }, + "homo_sapiens - bam, bai, [] - window": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,96c037f769974b904beb53edc4f56d82" + ] + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.region.dist.txt:md5,39e0e707ec32feb5176fd20a95f1f468" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,34f48d16fcdd61e44d812e29e02c77b8" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,257d67678136963d9dd904330079609d" + ] + ], + "8": [ + + ], + "9": [ + + ], + "global_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "per_base_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "per_base_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "per_base_d4": [ + + ], + "quantized_bed": [ + + ], + "quantized_csi": [ + + ], + "regions_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,34f48d16fcdd61e44d812e29e02c77b8" + ] + ], + "regions_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,257d67678136963d9dd904330079609d" + ] + ], + "regions_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.region.dist.txt:md5,39e0e707ec32feb5176fd20a95f1f468" + ] + ], + "summary_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,96c037f769974b904beb53edc4f56d82" + ] + ], + "thresholds_bed": [ + + ], + "thresholds_csi": [ + + ], + "versions": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:28:26.37386" + }, + "homo_sapiens - bam, bai, []": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,4f0d231060cbde4efdd673863bd2fb59" + ] + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "6": [ + + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "global_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "per_base_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "per_base_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "per_base_d4": [ + + ], + "quantized_bed": [ + + ], + "quantized_csi": [ + + ], + "regions_bed": [ + + ], + "regions_csi": [ + + ], + "regions_txt": [ + + ], + "summary_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,4f0d231060cbde4efdd673863bd2fb59" + ] + ], + "thresholds_bed": [ + + ], + "thresholds_csi": [ + + ], + "versions": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:27:44.658599" + }, + "homo_sapiens - cram, crai, []": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,4f0d231060cbde4efdd673863bd2fb59" + ] + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "6": [ + + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "global_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "per_base_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "per_base_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "per_base_d4": [ + + ], + "quantized_bed": [ + + ], + "quantized_csi": [ + + ], + "regions_bed": [ + + ], + "regions_csi": [ + + ], + "regions_txt": [ + + ], + "summary_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,4f0d231060cbde4efdd673863bd2fb59" + ] + ], + "thresholds_bed": [ + + ], + "thresholds_csi": [ + + ], + "versions": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:28:06.482838" + }, + "homo_sapiens - bam, bai, bed - thresholds": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,96c037f769974b904beb53edc4f56d82" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz:md5,fe70ae728cd10726c42a2bcd44adfc9d" + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz.csi:md5,912055ee9452229439df6fae95644196" + ] + ], + "12": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.region.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + ] + ], + "8": [ + + ], + "9": [ + + ], + "global_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.global.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "per_base_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" + ] + ], + "per_base_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + ] + ], + "per_base_d4": [ + + ], + "quantized_bed": [ + + ], + "quantized_csi": [ + + ], + "regions_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" + ] + ], + "regions_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + ] + ], + "regions_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.region.dist.txt:md5,e82e90c7d508a135b5a8a7cd6933452e" + ] + ], + "summary_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.mosdepth.summary.txt:md5,96c037f769974b904beb53edc4f56d82" + ] + ], + "thresholds_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz:md5,fe70ae728cd10726c42a2bcd44adfc9d" + ] + ], + "thresholds_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz.csi:md5,912055ee9452229439df6fae95644196" + ] + ], + "versions": [ + "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-28T12:28:45.918241" + } +} \ No newline at end of file diff --git a/modules/nf-core/mosdepth/tests/quantized.config b/modules/nf-core/mosdepth/tests/quantized.config new file mode 100644 index 0000000000..63c5535066 --- /dev/null +++ b/modules/nf-core/mosdepth/tests/quantized.config @@ -0,0 +1,3 @@ +process { + ext.args = "--quantize 0:1:4:100:200" +} \ No newline at end of file diff --git a/modules/nf-core/mosdepth/tests/tags.yml b/modules/nf-core/mosdepth/tests/tags.yml new file mode 100644 index 0000000000..5cd2e08e2c --- /dev/null +++ b/modules/nf-core/mosdepth/tests/tags.yml @@ -0,0 +1,2 @@ +mosdepth: + - "modules/nf-core/mosdepth/**" diff --git a/modules/nf-core/mosdepth/tests/threshold.config b/modules/nf-core/mosdepth/tests/threshold.config new file mode 100644 index 0000000000..9b014ddf53 --- /dev/null +++ b/modules/nf-core/mosdepth/tests/threshold.config @@ -0,0 +1,3 @@ +process { + ext.args = "--thresholds 1,10,20,30" +} \ No newline at end of file diff --git a/modules/nf-core/mosdepth/tests/window.config b/modules/nf-core/mosdepth/tests/window.config new file mode 100644 index 0000000000..7a0f755ce9 --- /dev/null +++ b/modules/nf-core/mosdepth/tests/window.config @@ -0,0 +1,3 @@ +process { + ext.args = "--by 100" +} \ No newline at end of file diff --git a/modules/nf-core/multiqc/environment.yml b/modules/nf-core/multiqc/environment.yml index d2a9f21a74..ca39fb67e2 100644 --- a/modules/nf-core/multiqc/environment.yml +++ b/modules/nf-core/multiqc/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::multiqc=1.17 + - bioconda::multiqc=1.21 diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 2bbc3983fa..47ac352f94 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -3,8 +3,8 @@ process MULTIQC { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.17--pyhdfd78af_0' : - 'biocontainers/multiqc:1.17--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/multiqc:1.21--pyhdfd78af_0' : + 'biocontainers/multiqc:1.21--pyhdfd78af_0' }" input: path multiqc_files, stageAs: "?/*" @@ -25,12 +25,14 @@ process MULTIQC { def args = task.ext.args ?: '' def config = multiqc_config ? "--config $multiqc_config" : '' def extra_config = extra_multiqc_config ? "--config $extra_multiqc_config" : '' + def logo = multiqc_logo ? /--cl-config 'custom_logo: "${multiqc_logo}"'/ : '' """ multiqc \\ --force \\ $args \\ $config \\ $extra_config \\ + $logo \\ . cat <<-END_VERSIONS > versions.yml @@ -41,7 +43,7 @@ process MULTIQC { stub: """ - touch multiqc_data + mkdir multiqc_data touch multiqc_plots touch multiqc_report.html diff --git a/modules/nf-core/multiqc/meta.yml b/modules/nf-core/multiqc/meta.yml index f1aa660eb7..45a9bc35e1 100644 --- a/modules/nf-core/multiqc/meta.yml +++ b/modules/nf-core/multiqc/meta.yml @@ -1,4 +1,3 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: multiqc description: Aggregate results from bioinformatics analyses across many samples into a single report keywords: diff --git a/modules/nf-core/multiqc/tests/main.nf.test b/modules/nf-core/multiqc/tests/main.nf.test new file mode 100644 index 0000000000..f1c4242ef2 --- /dev/null +++ b/modules/nf-core/multiqc/tests/main.nf.test @@ -0,0 +1,84 @@ +nextflow_process { + + name "Test Process MULTIQC" + script "../main.nf" + process "MULTIQC" + + tag "modules" + tag "modules_nfcore" + tag "multiqc" + + test("sarscov2 single-end [fastqc]") { + + when { + process { + """ + input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true)) + input[1] = [] + input[2] = [] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.report[0] ==~ ".*/multiqc_report.html" }, + { assert process.out.data[0] ==~ ".*/multiqc_data" }, + { assert snapshot(process.out.versions).match("multiqc_versions_single") } + ) + } + + } + + test("sarscov2 single-end [fastqc] [config]") { + + when { + process { + """ + input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true)) + input[1] = Channel.of(file("https://github.com/nf-core/tools/raw/dev/nf_core/pipeline-template/assets/multiqc_config.yml", checkIfExists: true)) + input[2] = [] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.report[0] ==~ ".*/multiqc_report.html" }, + { assert process.out.data[0] ==~ ".*/multiqc_data" }, + { assert snapshot(process.out.versions).match("multiqc_versions_config") } + ) + } + } + + test("sarscov2 single-end [fastqc] - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastqc/test_fastqc.zip', checkIfExists: true)) + input[1] = [] + input[2] = [] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.report.collect { file(it).getName() } + + process.out.data.collect { file(it).getName() } + + process.out.plots.collect { file(it).getName() } + + process.out.versions ).match("multiqc_stub") } + ) + } + + } +} diff --git a/modules/nf-core/multiqc/tests/main.nf.test.snap b/modules/nf-core/multiqc/tests/main.nf.test.snap new file mode 100644 index 0000000000..bfebd80298 --- /dev/null +++ b/modules/nf-core/multiqc/tests/main.nf.test.snap @@ -0,0 +1,41 @@ +{ + "multiqc_versions_single": { + "content": [ + [ + "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-29T08:48:55.657331" + }, + "multiqc_stub": { + "content": [ + [ + "multiqc_report.html", + "multiqc_data", + "multiqc_plots", + "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-29T08:49:49.071937" + }, + "multiqc_versions_config": { + "content": [ + [ + "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-29T08:49:25.457567" + } +} \ No newline at end of file diff --git a/modules/nf-core/multiqc/tests/tags.yml b/modules/nf-core/multiqc/tests/tags.yml new file mode 100644 index 0000000000..bea6c0d37f --- /dev/null +++ b/modules/nf-core/multiqc/tests/tags.yml @@ -0,0 +1,2 @@ +multiqc: + - modules/nf-core/multiqc/** diff --git a/modules/nf-core/samblaster/environment.yml b/modules/nf-core/samblaster/environment.yml index f956283ec0..ac83824150 100644 --- a/modules/nf-core/samblaster/environment.yml +++ b/modules/nf-core/samblaster/environment.yml @@ -1,8 +1,11 @@ name: samblaster + channels: - conda-forge - bioconda - defaults + dependencies: + - bioconda::htslib=1.19.1 - bioconda::samblaster=0.1.26 - - bioconda::samtools=1.16.1 + - bioconda::samtools=1.19.2 diff --git a/modules/nf-core/samblaster/main.nf b/modules/nf-core/samblaster/main.nf index 4622d3691d..c9e89af06a 100644 --- a/modules/nf-core/samblaster/main.nf +++ b/modules/nf-core/samblaster/main.nf @@ -4,8 +4,8 @@ process SAMBLASTER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-19fa9f1a5c3966b63a24166365e81da35738c5ab:cee56b506ceb753d4bbef7e05b81e1bfc25d937f-0' : - 'biocontainers/mulled-v2-19fa9f1a5c3966b63a24166365e81da35738c5ab:cee56b506ceb753d4bbef7e05b81e1bfc25d937f-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-19fa9f1a5c3966b63a24166365e81da35738c5ab:60ebac4ad9c6530c0d7bf6844f52ec6916e1e0b1-0' : + 'biocontainers/mulled-v2-19fa9f1a5c3966b63a24166365e81da35738c5ab:60ebac4ad9c6530c0d7bf6844f52ec6916e1e0b1-0' }" input: tuple val(meta), path(bam) @@ -34,4 +34,17 @@ process SAMBLASTER { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + if( "$bam" == "${prefix}.bam" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + """ + touch "${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/nf-core/samblaster/meta.yml b/modules/nf-core/samblaster/meta.yml index ccb48320c1..5c1e5a9700 100644 --- a/modules/nf-core/samblaster/meta.yml +++ b/modules/nf-core/samblaster/meta.yml @@ -51,3 +51,4 @@ authors: - "@lescai" maintainers: - "@lescai" + - "@gallvp" diff --git a/modules/nf-core/samblaster/tests/main.nf.test b/modules/nf-core/samblaster/tests/main.nf.test new file mode 100644 index 0000000000..0179430715 --- /dev/null +++ b/modules/nf-core/samblaster/tests/main.nf.test @@ -0,0 +1,57 @@ +nextflow_process { + + name "Test Process SAMBLASTER" + script "../main.nf" + process "SAMBLASTER" + + tag "modules" + tag "modules_nfcore" + tag "samblaster" + + test("homo_sapiens-test_paired_end_umi_unsorted_bam") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_umi_unsorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_umi_unsorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/samblaster/tests/main.nf.test.snap b/modules/nf-core/samblaster/tests/main.nf.test.snap new file mode 100644 index 0000000000..917c8f1fb1 --- /dev/null +++ b/modules/nf-core/samblaster/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,8a70467f2dfc2e0d8e81787223d2fc77" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,8a70467f2dfc2e0d8e81787223d2fc77" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-26T14:04:42.510824" + }, + "homo_sapiens-test_paired_end_umi_unsorted_bam": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,634a6bd541478e970f0a4c279f399889" + ] + ], + "1": [ + "versions.yml:md5,8a70467f2dfc2e0d8e81787223d2fc77" + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,634a6bd541478e970f0a4c279f399889" + ] + ], + "versions": [ + "versions.yml:md5,8a70467f2dfc2e0d8e81787223d2fc77" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-26T14:04:38.118875" + } +} \ No newline at end of file diff --git a/modules/nf-core/samblaster/tests/nextflow.config b/modules/nf-core/samblaster/tests/nextflow.config new file mode 100644 index 0000000000..605e74eb9c --- /dev/null +++ b/modules/nf-core/samblaster/tests/nextflow.config @@ -0,0 +1,6 @@ +process { + withName: SAMBLASTER { + ext.args = '-M --addMateTags' + ext.prefix = { "${meta.id}.processed" } + } +} diff --git a/modules/nf-core/samblaster/tests/tags.yml b/modules/nf-core/samblaster/tests/tags.yml new file mode 100644 index 0000000000..3882ee54ff --- /dev/null +++ b/modules/nf-core/samblaster/tests/tags.yml @@ -0,0 +1,2 @@ +samblaster: + - "modules/nf-core/samblaster/**" diff --git a/modules/nf-core/samtools/bam2fq/environment.yml b/modules/nf-core/samtools/bam2fq/environment.yml index b59ea8e050..6f3c6d8b1b 100644 --- a/modules/nf-core/samtools/bam2fq/environment.yml +++ b/modules/nf-core/samtools/bam2fq/environment.yml @@ -4,4 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::samtools=1.17 + - bioconda::samtools=1.19.2 + - bioconda::htslib=1.19.1 diff --git a/modules/nf-core/samtools/bam2fq/main.nf b/modules/nf-core/samtools/bam2fq/main.nf index 016d91d992..463c6ae20b 100644 --- a/modules/nf-core/samtools/bam2fq/main.nf +++ b/modules/nf-core/samtools/bam2fq/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_BAM2FQ { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : + 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" input: tuple val(meta), path(inputbam) diff --git a/modules/nf-core/samtools/bam2fq/tests/main.nf.test b/modules/nf-core/samtools/bam2fq/tests/main.nf.test new file mode 100644 index 0000000000..0601af8bc7 --- /dev/null +++ b/modules/nf-core/samtools/bam2fq/tests/main.nf.test @@ -0,0 +1,67 @@ +nextflow_process { + + name "Test Process SAMTOOLS_BAM2FQ" + script "../main.nf" + process "SAMTOOLS_BAM2FQ" + + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/bam2fq" + + config "./nextflow.config" + + test("bam") { + + when { + process { + """ + split = false + + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_converted.bam', checkIfExists: true) + ]) + input[1] = split + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(path(process.out.reads[0][1]).linesGzip[0..6]).match("bam_reads") }, + { assert snapshot(process.out.versions).match("bam_versions") } + ) + } + + } + + test("bam_split") { + + when { + process { + """ + split = true + + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/umi/test.paired_end.umi_converted.bam', checkIfExists: true) + ]) + input[1] = split + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.reads[0][1].collect{ + if (it ==~ /.*(other|singleton)\.fq\.gz$/) return file(it).name + return path(it).linesGzip[0..6] + }).match("bam_split_reads") }, + { assert snapshot(process.out.versions).match("bam_split_versions") } + ) + } + } +} diff --git a/modules/nf-core/samtools/bam2fq/tests/main.nf.test.snap b/modules/nf-core/samtools/bam2fq/tests/main.nf.test.snap new file mode 100644 index 0000000000..84da35bae4 --- /dev/null +++ b/modules/nf-core/samtools/bam2fq/tests/main.nf.test.snap @@ -0,0 +1,75 @@ +{ + "bam_reads": { + "content": [ + [ + "@922332/1\tRX:Z:ATTTCAG-TATTATT", + "GAGAGGATCTCGTGTAGAAATTGCTTTGAGCTGTTCTTTGTCATTTTCCCTTAATTCATTGTCTCTAGCTAGTCTGTTACTCTGTAAAATAAAATAATAAGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTTAAGGTCAGTG", + "+", + "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE versions.yml "${task.process}": diff --git a/modules/nf-core/samtools/merge/tests/index.config b/modules/nf-core/samtools/merge/tests/index.config new file mode 100644 index 0000000000..8c5668cf34 --- /dev/null +++ b/modules/nf-core/samtools/merge/tests/index.config @@ -0,0 +1,3 @@ +process { + ext.args = "--write-index" +} \ No newline at end of file diff --git a/modules/nf-core/samtools/merge/tests/main.nf.test b/modules/nf-core/samtools/merge/tests/main.nf.test new file mode 100644 index 0000000000..40b36e82b1 --- /dev/null +++ b/modules/nf-core/samtools/merge/tests/main.nf.test @@ -0,0 +1,137 @@ +nextflow_process { + + name "Test Process SAMTOOLS_MERGE" + script "../main.nf" + process "SAMTOOLS_MERGE" + + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/merge" + + test("bams") { + + config "./index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true) ] + ]) + input[1] = [[],[]] + input[2] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.bam[0][1]).name).match("bams_bam") }, + { assert snapshot(process.out.cram).match("bams_cram") }, + { assert snapshot(file(process.out.csi[0][1]).name).match("bams_csi") }, + { assert snapshot(process.out.crai).match("bams_crai") }, + { assert snapshot(process.out.versions).match("bams_versions") } + ) + } + } + + test("crams") { + + config "./index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true) ] + ]) + input[1] = Channel.of([ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = Channel.of([ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.cram[0][1]).name).match("crams_cram") }, + { assert snapshot(process.out.bam).match("crams_bam") }, + { assert snapshot(file(process.out.crai[0][1]).name).match("crams_crai") }, + { assert snapshot(process.out.csi).match("crams_csi") }, + { assert snapshot(process.out.versions).match("crams_versions") } + ) + } + } + + test("bam") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true) ] + ]) + input[1] = [[],[]] + input[2] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.bam[0][1]).name).match("bam_bam") }, + { assert snapshot(process.out.cram).match("bam_cram") }, + { assert snapshot(process.out.crai).match("bam_crai") }, + { assert snapshot(process.out.csi).match("bam_csi") }, + { assert snapshot(process.out.versions).match("bam_versions") } + ) + } + } + + test("bams_stub") { + + config "./index.config" + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true) ] + ]) + input[1] = [[],[]] + input[2] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.bam[0][1]).name).match("bams_stub_bam") }, + { assert snapshot(process.out.cram).match("bams_stub_cram") }, + { assert snapshot(file(process.out.csi[0][1]).name).match("bams_stub_csi") }, + { assert snapshot(process.out.crai).match("bams_stub_crai") }, + { assert snapshot(process.out.versions).match("bams_stub_versions") } + ) + } + } +} diff --git a/modules/nf-core/samtools/merge/tests/main.nf.test.snap b/modules/nf-core/samtools/merge/tests/main.nf.test.snap new file mode 100644 index 0000000000..f7da7699b4 --- /dev/null +++ b/modules/nf-core/samtools/merge/tests/main.nf.test.snap @@ -0,0 +1,228 @@ +{ + "crams_cram": { + "content": [ + "test.cram" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:00.647389" + }, + "bams_stub_cram": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:19.937013" + }, + "bams_crai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:49:24.928616" + }, + "bams_bam": { + "content": [ + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:49:24.923289" + }, + "bams_cram": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:49:24.925716" + }, + "crams_csi": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:00.655959" + }, + "bam_bam": { + "content": [ + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:10.319539" + }, + "bam_versions": { + "content": [ + [ + "versions.yml:md5,52c62d4712f7af00eb962d090ca32fe4" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:16:33.782637377" + }, + "bams_csi": { + "content": [ + "test.bam.csi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:49:24.92719" + }, + "bams_stub_csi": { + "content": [ + "test.csi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:19.940498" + }, + "bam_crai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:10.328852" + }, + "bams_stub_versions": { + "content": [ + [ + "versions.yml:md5,52c62d4712f7af00eb962d090ca32fe4" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:16:42.594476052" + }, + "bam_cram": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:10.324219" + }, + "bams_stub_bam": { + "content": [ + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:19.933153" + }, + "bams_versions": { + "content": [ + [ + "versions.yml:md5,52c62d4712f7af00eb962d090ca32fe4" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:16:04.805335656" + }, + "crams_bam": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:00.650652" + }, + "crams_versions": { + "content": [ + [ + "versions.yml:md5,52c62d4712f7af00eb962d090ca32fe4" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:16:25.889394689" + }, + "bam_csi": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:10.33292" + }, + "crams_crai": { + "content": [ + "test.cram.crai" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:00.653512" + }, + "bams_stub_crai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T18:50:19.943839" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/merge/tests/tags.yml b/modules/nf-core/samtools/merge/tests/tags.yml new file mode 100644 index 0000000000..b869abcb81 --- /dev/null +++ b/modules/nf-core/samtools/merge/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/merge: + - "modules/nf-core/samtools/merge/**" diff --git a/modules/nf-core/samtools/mpileup/environment.yml b/modules/nf-core/samtools/mpileup/environment.yml index 5f06050d19..6628f5dc05 100644 --- a/modules/nf-core/samtools/mpileup/environment.yml +++ b/modules/nf-core/samtools/mpileup/environment.yml @@ -4,4 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::samtools=1.17 + - bioconda::samtools=1.19.2 + - bioconda::htslib=1.19.1 diff --git a/modules/nf-core/samtools/mpileup/main.nf b/modules/nf-core/samtools/mpileup/main.nf index ed102582c4..cb96181ff1 100644 --- a/modules/nf-core/samtools/mpileup/main.nf +++ b/modules/nf-core/samtools/mpileup/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_MPILEUP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : + 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" input: tuple val(meta), path(input), path(intervals) path fasta diff --git a/modules/nf-core/samtools/mpileup/tests/main.nf.test b/modules/nf-core/samtools/mpileup/tests/main.nf.test new file mode 100644 index 0000000000..d9cd6d804d --- /dev/null +++ b/modules/nf-core/samtools/mpileup/tests/main.nf.test @@ -0,0 +1,59 @@ +nextflow_process { + + name "Test Process SAMTOOLS_MPILEUP" + script "../main.nf" + process "SAMTOOLS_MPILEUP" + + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/mpileup" + + test("bam_bed") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ]) + input[1] = Channel.of([ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(path(process.out.mpileup[0][1]).linesGzip[0..6]).match("bam_bed_mpileup") }, + { assert snapshot(process.out.versions).match("bam_bed_versions") } + ) + } + } + + test("bam_bed_fasta") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + ]) + input[1] = Channel.of([ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(path(process.out.mpileup[0][1]).linesGzip[0..6]).match("bam_bed_fasta_mpileup") }, + { assert snapshot(process.out.versions).match("bam_bed_fasta_versions") } + ) + } + } +} diff --git a/modules/nf-core/samtools/mpileup/tests/main.nf.test.snap b/modules/nf-core/samtools/mpileup/tests/main.nf.test.snap new file mode 100644 index 0000000000..fc891c1b74 --- /dev/null +++ b/modules/nf-core/samtools/mpileup/tests/main.nf.test.snap @@ -0,0 +1,62 @@ +{ + "bam_bed_versions": { + "content": [ + [ + "versions.yml:md5,c617148132c6a529bdf506fd58ce6a9d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:13:40.600861147" + }, + "bam_bed_fasta_versions": { + "content": [ + [ + "versions.yml:md5,c617148132c6a529bdf506fd58ce6a9d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:13:48.271482127" + }, + "bam_bed_mpileup": { + "content": [ + [ + "MT192765.1\t121\tT\t1\t^].\tA", + "MT192765.1\t122\tA\t1\t.\tA", + "MT192765.1\t123\tT\t1\t.\tA", + "MT192765.1\t124\tA\t1\t.\t/", + "MT192765.1\t125\tA\t1\t.\tE", + "MT192765.1\t126\tT\t1\t.\t/", + "MT192765.1\t127\tT\t1\t.\tE" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:14:14.778949" + }, + "bam_bed_fasta_mpileup": { + "content": [ + [ + "MT192765.1\t1255\tA\t1\t^],\tE", + "MT192765.1\t1256\tC\t1\t,\t/", + "MT192765.1\t1257\tG\t1\t,\t/", + "MT192765.1\t1258\tG\t1\tt\t/", + "MT192765.1\t1259\tG\t1\t,\t/", + "MT192765.1\t1260\tC\t1\t,\tE", + "MT192765.1\t1261\tG\t1\t,\t/" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:15:18.571262" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/mpileup/tests/tags.yml b/modules/nf-core/samtools/mpileup/tests/tags.yml new file mode 100644 index 0000000000..40332674a1 --- /dev/null +++ b/modules/nf-core/samtools/mpileup/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/mpileup: + - "modules/nf-core/samtools/mpileup/**" diff --git a/modules/nf-core/samtools/stats/environment.yml b/modules/nf-core/samtools/stats/environment.yml index ed4e8961af..67bb0ca408 100644 --- a/modules/nf-core/samtools/stats/environment.yml +++ b/modules/nf-core/samtools/stats/environment.yml @@ -4,4 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::samtools=1.17 + - bioconda::samtools=1.19.2 + - bioconda::htslib=1.19.1 diff --git a/modules/nf-core/samtools/stats/main.nf b/modules/nf-core/samtools/stats/main.nf index 07286ef410..52b00f4b6f 100644 --- a/modules/nf-core/samtools/stats/main.nf +++ b/modules/nf-core/samtools/stats/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_STATS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : + 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" input: tuple val(meta), path(input), path(input_index) diff --git a/modules/nf-core/samtools/stats/tests/main.nf.test b/modules/nf-core/samtools/stats/tests/main.nf.test index e037132ca2..e3d5cb14ce 100644 --- a/modules/nf-core/samtools/stats/tests/main.nf.test +++ b/modules/nf-core/samtools/stats/tests/main.nf.test @@ -4,75 +4,62 @@ nextflow_process { script "../main.nf" process "SAMTOOLS_STATS" tag "modules" - tag "modules/nf-core" + tag "modules_nfcore" tag "samtools" tag "samtools/stats" - test("SAMTOOLS STATS Should run without failures") { + test("bam") { when { params { - outdir = "$outputDir" } process { """ - // define inputs of the process here. - input[0] = [ - [ 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[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ]) input[1] = [[],[]] """ - } } then { assertAll( - {assert process.success}, - {assert snapshot(process.out).match()} + {assert process.success}, + {assert snapshot(process.out).match()} ) } - } - test("SAMTOOLS CRAM Should run without failures") { + test("cram") { when { params { - outdir = "$outputDir" } process { """ - // define inputs of the process here - input[0] = [ - [ 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) - - ] - input[1] = [ - [ id:'genome' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true) + ]) + input[1] = Channel.of([ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) """ } - - } then { assertAll( - {assert process.success}, - {assert snapshot(process.out).match()} + {assert process.success}, + {assert snapshot(process.out).match()} ) } - } - - } diff --git a/modules/nf-core/samtools/stats/tests/main.nf.test.snap b/modules/nf-core/samtools/stats/tests/main.nf.test.snap index 516b2b0192..1b7c9ba44e 100644 --- a/modules/nf-core/samtools/stats/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/stats/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "SAMTOOLS STATS Should run without failures": { + "cram": { "content": [ { "0": [ @@ -8,11 +8,11 @@ "id": "test", "single_end": false }, - "test.stats:md5,6e768486d5df0257351c5419a79f9c9b" + "test.stats:md5,01812900aa4027532906c5d431114233" ] ], "1": [ - "versions.yml:md5,08035f3409d934d47a416150884bb0df" + "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" ], "stats": [ [ @@ -20,17 +20,21 @@ "id": "test", "single_end": false }, - "test.stats:md5,6e768486d5df0257351c5419a79f9c9b" + "test.stats:md5,01812900aa4027532906c5d431114233" ] ], "versions": [ - "versions.yml:md5,08035f3409d934d47a416150884bb0df" + "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" ] } ], - "timestamp": "2023-10-18T12:12:42.998746" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:15:25.562429714" }, - "SAMTOOLS CRAM Should run without failures": { + "bam": { "content": [ { "0": [ @@ -39,11 +43,11 @@ "id": "test", "single_end": false }, - "test.stats:md5,7c9ee5747793cceb9d6f4d733345641a" + "test.stats:md5,5d8681bf541199898c042bf400391d59" ] ], "1": [ - "versions.yml:md5,08035f3409d934d47a416150884bb0df" + "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" ], "stats": [ [ @@ -51,14 +55,18 @@ "id": "test", "single_end": false }, - "test.stats:md5,7c9ee5747793cceb9d6f4d733345641a" + "test.stats:md5,5d8681bf541199898c042bf400391d59" ] ], "versions": [ - "versions.yml:md5,08035f3409d934d47a416150884bb0df" + "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" ] } ], - "timestamp": "2023-10-18T12:13:30.747222" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:15:07.857611509" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/view/environment.yml b/modules/nf-core/samtools/view/environment.yml index 141e7bd829..b0676f338e 100644 --- a/modules/nf-core/samtools/view/environment.yml +++ b/modules/nf-core/samtools/view/environment.yml @@ -4,4 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::samtools=1.17 + - bioconda::samtools=1.19.2 + - bioconda::htslib=1.19.1 diff --git a/modules/nf-core/samtools/view/main.nf b/modules/nf-core/samtools/view/main.nf index ddf3f88ae5..5a8989d697 100644 --- a/modules/nf-core/samtools/view/main.nf +++ b/modules/nf-core/samtools/view/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_VIEW { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : - 'biocontainers/samtools:1.17--h00cdaf9_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : + 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" input: tuple val(meta), path(input), path(index) @@ -53,10 +53,19 @@ process SAMTOOLS_VIEW { """ stub: + def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def file_type = args.contains("--output-fmt sam") ? "sam" : + args.contains("--output-fmt bam") ? "bam" : + args.contains("--output-fmt cram") ? "cram" : + input.getExtension() + if ("$input" == "${prefix}.${file_type}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + + def index = args.contains("--write-index") ? "touch ${prefix}.csi" : "" + """ - touch ${prefix}.bam - touch ${prefix}.cram + touch ${prefix}.${file_type} + ${index} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/samtools/view/tests/bam.config b/modules/nf-core/samtools/view/tests/bam.config new file mode 100644 index 0000000000..c10d108116 --- /dev/null +++ b/modules/nf-core/samtools/view/tests/bam.config @@ -0,0 +1,3 @@ +process { + ext.args = "--output-fmt bam" +} \ No newline at end of file diff --git a/modules/nf-core/samtools/view/tests/bam_index.config b/modules/nf-core/samtools/view/tests/bam_index.config new file mode 100644 index 0000000000..771ae033a3 --- /dev/null +++ b/modules/nf-core/samtools/view/tests/bam_index.config @@ -0,0 +1,3 @@ +process { + ext.args = "--output-fmt bam --write-index" +} \ No newline at end of file diff --git a/modules/nf-core/samtools/view/tests/main.nf.test b/modules/nf-core/samtools/view/tests/main.nf.test new file mode 100644 index 0000000000..45a0defbae --- /dev/null +++ b/modules/nf-core/samtools/view/tests/main.nf.test @@ -0,0 +1,212 @@ +nextflow_process { + + name "Test Process SAMTOOLS_VIEW" + script "../main.nf" + process "SAMTOOLS_VIEW" + + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/view" + + test("bam") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true), + [] + ]) + input[1] = [[],[]] + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.bam[0][1]).name).match("bam_bam") }, + { assert snapshot(process.out.bai).match("bam_bai") }, + { assert snapshot(process.out.crai).match("bam_crai") }, + { assert snapshot(process.out.cram).match("bam_cram") }, + { assert snapshot(process.out.csi).match("bam_csi") }, + { assert snapshot(process.out.sam).match("bam_sam") }, + { assert snapshot(process.out.versions).match("bam_versions") } + ) + } + } + + test("cram") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true) + ]) + input[1] = Channel.of([ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.cram[0][1]).name).match("cram_cram") }, + { assert snapshot(process.out.bai).match("cram_bai") }, + { assert snapshot(process.out.bam).match("cram_bam") }, + { assert snapshot(process.out.crai).match("cram_crai") }, + { assert snapshot(process.out.csi).match("cram_csi") }, + { assert snapshot(process.out.sam).match("cram_sam") }, + { assert snapshot(process.out.versions).match("cram_versions") } + ) + } + } + + test("cram_to_bam") { + + config "./bam.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + [] + ]) + input[1] = Channel.of([ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.bam[0][1]).name).match("cram_to_bam_bam") }, + { assert snapshot(process.out.bai).match("cram_to_bam_bai") }, + { assert snapshot(process.out.crai).match("cram_to_bam_crai") }, + { assert snapshot(process.out.cram).match("cram_to_bam_cram") }, + { assert snapshot(process.out.csi).match("cram_to_bam_csi") }, + { assert snapshot(process.out.sam).match("cram_to_bam_sam") }, + { assert snapshot(process.out.versions).match("cram_to_bam_versions") } + ) + } + } + + test("cram_to_bam_index") { + + config "./bam_index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + [] + ]) + input[1] = Channel.of([ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.bam[0][1]).name).match("cram_to_bam_index_bam") }, + { assert snapshot(file(process.out.csi[0][1]).name).match("cram_to_bam_index_csi") }, + { assert snapshot(process.out.bai).match("cram_to_bam_index_bai") }, + { assert snapshot(process.out.crai).match("cram_to_bam_index_crai") }, + { assert snapshot(process.out.cram).match("cram_to_bam_index_cram") }, + { assert snapshot(process.out.sam).match("cram_to_bam_index_sam") }, + { assert snapshot(process.out.versions).match("cram_to_bam_index_versions") } + ) + } + } + + test("cram_to_bam_index_qname") { + + config "./bam_index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + [] + ]) + input[1] = Channel.of([ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = Channel.of("testN:2817", "testN:2814").collectFile(name: "readnames.list", newLine: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.bam[0][1]).name).match("cram_to_bam_index_qname_bam") }, + { assert snapshot(file(process.out.csi[0][1]).name).match("cram_to_bam_index_qname_csi") }, + { assert snapshot(process.out.bai).match("cram_to_bam_index_qname_bai") }, + { assert snapshot(process.out.crai).match("cram_to_bam_index_qname_crai") }, + { assert snapshot(process.out.cram).match("cram_to_bam_index_qname_cram") }, + { assert snapshot(process.out.sam).match("cram_to_bam_index_qname_sam") }, + { assert snapshot(process.out.versions).match("cram_to_bam_index_qname_versions") } + ) + } + } + + test("bam_stub") { + + options "-stub" + config "./bam_index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true), + [] + ]) + input[1] = [[],[]] + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.bam[0][1]).name).match("bam_stub_bam") }, + { assert snapshot(file(process.out.csi[0][1]).name).match("bam_stub_csi") }, + { assert snapshot(process.out.bai).match("bam_stub_bai") }, + { assert snapshot(process.out.crai).match("bam_stub_crai") }, + { assert snapshot(process.out.cram).match("bam_stub_cram") }, + { assert snapshot(process.out.sam).match("bam_stub_sam") }, + { assert snapshot(process.out.versions).match("bam_stub_versions") } + ) + } + } +} diff --git a/modules/nf-core/samtools/view/tests/main.nf.test.snap b/modules/nf-core/samtools/view/tests/main.nf.test.snap new file mode 100644 index 0000000000..f55943a7ae --- /dev/null +++ b/modules/nf-core/samtools/view/tests/main.nf.test.snap @@ -0,0 +1,488 @@ +{ + "bam_bam": { + "content": [ + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:51.256068" + }, + "cram_to_bam_index_csi": { + "content": [ + "test.bam.csi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:12.958617" + }, + "bam_stub_bam": { + "content": [ + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:32.065301" + }, + "bam_bai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:51.258578" + }, + "bam_stub_bai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:32.071284" + }, + "bam_stub_versions": { + "content": [ + [ + "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:13:09.713353823" + }, + "cram_to_bam_index_cram": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:12.972288" + }, + "cram_to_bam_sam": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:04.999247" + }, + "cram_to_bam_index_sam": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:12.976457" + }, + "cram_crai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:56.497581" + }, + "cram_csi": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:56.50038" + }, + "cram_to_bam_cram": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:04.992239" + }, + "cram_to_bam_index_qname_csi": { + "content": [ + "test.bam.csi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:23.325496" + }, + "bam_stub_sam": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:32.079529" + }, + "cram_cram": { + "content": [ + "test.cram" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:56.490286" + }, + "bam_csi": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:51.262882" + }, + "cram_to_bam_crai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:04.989247" + }, + "cram_to_bam_index_crai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:12.967681" + }, + "cram_to_bam_index_qname_versions": { + "content": [ + [ + "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:13:03.935041046" + }, + "cram_to_bam_bam": { + "content": [ + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:04.982361" + }, + "cram_to_bam_index_bam": { + "content": [ + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:12.95456" + }, + "cram_to_bam_index_versions": { + "content": [ + [ + "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:12:55.910685496" + }, + "cram_to_bam_bai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:04.98601" + }, + "cram_to_bam_versions": { + "content": [ + [ + "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:12:47.715221169" + }, + "cram_bam": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:56.495512" + }, + "bam_stub_cram": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:32.076908" + }, + "cram_to_bam_index_qname_bai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:23.328458" + }, + "cram_to_bam_index_qname_crai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:23.330789" + }, + "cram_bai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:56.493129" + }, + "bam_stub_crai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:32.074313" + }, + "cram_to_bam_index_qname_bam": { + "content": [ + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:23.322874" + }, + "bam_versions": { + "content": [ + [ + "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:12:31.692607421" + }, + "cram_to_bam_index_qname_cram": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:23.333248" + }, + "bam_crai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:51.259774" + }, + "bam_cram": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:51.261287" + }, + "cram_to_bam_csi": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:04.995454" + }, + "cram_sam": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:56.502625" + }, + "cram_versions": { + "content": [ + [ + "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.01.0" + }, + "timestamp": "2024-02-13T16:12:39.913411036" + }, + "bam_sam": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:37:51.264651" + }, + "cram_to_bam_index_bai": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:12.962863" + }, + "cram_to_bam_index_qname_sam": { + "content": [ + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:23.337634" + }, + "bam_stub_csi": { + "content": [ + "test.csi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:32.068596" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/view/tests/tags.yml b/modules/nf-core/samtools/view/tests/tags.yml new file mode 100644 index 0000000000..4fdf1dd12e --- /dev/null +++ b/modules/nf-core/samtools/view/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/view: + - "modules/nf-core/samtools/view/**" diff --git a/modules/nf-core/sentieon/applyvarcal/environment.yml b/modules/nf-core/sentieon/applyvarcal/environment.yml index b7b5169a89..c4c11b1f85 100644 --- a/modules/nf-core/sentieon/applyvarcal/environment.yml +++ b/modules/nf-core/sentieon/applyvarcal/environment.yml @@ -3,3 +3,5 @@ channels: - conda-forge - bioconda - defaults +dependencies: + - bioconda::sentieon=202308.01 diff --git a/modules/nf-core/sentieon/applyvarcal/main.nf b/modules/nf-core/sentieon/applyvarcal/main.nf index 4e63b94ce4..d1d3435dc9 100644 --- a/modules/nf-core/sentieon/applyvarcal/main.nf +++ b/modules/nf-core/sentieon/applyvarcal/main.nf @@ -5,7 +5,10 @@ process SENTIEON_APPLYVARCAL { secret 'SENTIEON_LICENSE_BASE64' - container 'nf-core/sentieon:202112.06' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : + 'biocontainers/sentieon:202308.01--h43eeafb_0' }" input: tuple val(meta), path(vcf), path(vcf_tbi), path(recal), path(recal_index), path(tranches) @@ -21,10 +24,15 @@ process SENTIEON_APPLYVARCAL { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: '' @@ -47,6 +55,8 @@ process SENTIEON_APPLYVARCAL { echo "Decoded and exported Sentieon test-license system environment variables" fi + $fix_ld_library_path + sentieon driver -r ${fasta} --algo ApplyVarCal \\ -v $vcf \\ --recal $recal \\ @@ -61,12 +71,19 @@ process SENTIEON_APPLYVARCAL { """ stub: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + def prefix = task.ext.prefix ?: "${meta.id}" """ + $fix_ld_library_path + touch ${prefix}.vcf.gz touch ${prefix}.vcf.gz.tbi diff --git a/modules/nf-core/sentieon/bwamem/environment.yml b/modules/nf-core/sentieon/bwamem/environment.yml index efd460cfa4..c090bfa5ae 100644 --- a/modules/nf-core/sentieon/bwamem/environment.yml +++ b/modules/nf-core/sentieon/bwamem/environment.yml @@ -3,3 +3,5 @@ channels: - conda-forge - bioconda - defaults +dependencies: + - bioconda::sentieon=202308.01 diff --git a/modules/nf-core/sentieon/bwamem/main.nf b/modules/nf-core/sentieon/bwamem/main.nf index b58835fda5..230297d087 100644 --- a/modules/nf-core/sentieon/bwamem/main.nf +++ b/modules/nf-core/sentieon/bwamem/main.nf @@ -5,7 +5,10 @@ process SENTIEON_BWAMEM { secret 'SENTIEON_LICENSE_BASE64' - container 'nf-core/sentieon:202112.06' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : + 'biocontainers/sentieon:202308.01--h43eeafb_0' }" input: tuple val(meta), path(reads) @@ -21,10 +24,15 @@ process SENTIEON_BWAMEM { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: '' @@ -47,6 +55,8 @@ process SENTIEON_BWAMEM { echo "Decoded and exported Sentieon test-license system environment variables" fi + $fix_ld_library_path + INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` sentieon bwa mem \\ @@ -64,8 +74,19 @@ process SENTIEON_BWAMEM { """ stub: + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' + } + def prefix = task.ext.prefix ?: "${meta.id}" """ + $fix_ld_library_path + touch ${prefix}.bam touch ${prefix}.bam.bai diff --git a/modules/nf-core/sentieon/dedup/environment.yml b/modules/nf-core/sentieon/dedup/environment.yml index bda2b1385a..622cf73909 100644 --- a/modules/nf-core/sentieon/dedup/environment.yml +++ b/modules/nf-core/sentieon/dedup/environment.yml @@ -3,3 +3,5 @@ channels: - conda-forge - bioconda - defaults +dependencies: + - bioconda::sentieon=202308.01 diff --git a/modules/nf-core/sentieon/dedup/main.nf b/modules/nf-core/sentieon/dedup/main.nf index c83d5e552a..fbcd595f47 100644 --- a/modules/nf-core/sentieon/dedup/main.nf +++ b/modules/nf-core/sentieon/dedup/main.nf @@ -5,7 +5,10 @@ process SENTIEON_DEDUP { secret 'SENTIEON_LICENSE_BASE64' - container 'nf-core/sentieon:202112.06' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : + 'biocontainers/sentieon:202308.01--h43eeafb_0' }" input: tuple val(meta), path(bam), path(bai) @@ -26,10 +29,15 @@ process SENTIEON_DEDUP { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def args3 = task.ext.args3 ?: '' @@ -58,6 +66,8 @@ process SENTIEON_DEDUP { echo "Decoded and exported Sentieon test-license system environment variables" fi + $fix_ld_library_path + sentieon driver $args $input_list -r ${fasta} --algo LocusCollector $args2 --fun score_info ${prefix}.score sentieon driver $args3 -t $task.cpus $input_list -r ${fasta} --algo Dedup $args4 --score_info ${prefix}.score --metrics ${metrics} ${prefix}${suffix} # This following tsv-file is produced in order to get a proper tsv-file with Dedup-metrics for importing in MultiQC as "custom content". @@ -71,12 +81,25 @@ process SENTIEON_DEDUP { """ stub: + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' + } def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = task.ext.suffix ?: ".cram" // The suffix should be either ".cram" or ".bam". + def metrics = task.ext.metrics ?: "${prefix}${suffix}.metrics" """ - touch ${prefix}.cram - touch ${prefix}.cram.crai - touch ${prefix}.metrics - touch ${prefix}.score + $fix_ld_library_path + + touch "${prefix}${suffix}" + touch "${prefix}${suffix}\$(echo ${suffix} | sed 's/m\$/i/')" + touch "${metrics}" + touch "${metrics}.multiqc.tsv" + touch "${prefix}.score" cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/sentieon/dnamodelapply/environment.yml b/modules/nf-core/sentieon/dnamodelapply/environment.yml index 3f92a79ab8..6d27d44a1d 100644 --- a/modules/nf-core/sentieon/dnamodelapply/environment.yml +++ b/modules/nf-core/sentieon/dnamodelapply/environment.yml @@ -3,3 +3,5 @@ channels: - conda-forge - bioconda - defaults +dependencies: + - bioconda::sentieon=202308.01 diff --git a/modules/nf-core/sentieon/dnamodelapply/main.nf b/modules/nf-core/sentieon/dnamodelapply/main.nf index 3fe9a28f19..b728a5ec31 100644 --- a/modules/nf-core/sentieon/dnamodelapply/main.nf +++ b/modules/nf-core/sentieon/dnamodelapply/main.nf @@ -5,7 +5,10 @@ process SENTIEON_DNAMODELAPPLY { secret 'SENTIEON_LICENSE_BASE64' - container 'nf-core/sentieon:202112.06' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : + 'biocontainers/sentieon:202308.01--h43eeafb_0' }" input: tuple val(meta), path(vcf), path(idx) @@ -22,10 +25,15 @@ process SENTIEON_DNAMODELAPPLY { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: '' @@ -48,6 +56,8 @@ process SENTIEON_DNAMODELAPPLY { echo "Decoded and exported Sentieon test-license system environment variables" fi + $fix_ld_library_path + sentieon driver \\ -t $task.cpus \\ -r $fasta \\ @@ -64,12 +74,20 @@ process SENTIEON_DNAMODELAPPLY { """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + + def prefix = task.ext.prefix ?: "${meta.id}" + """ + $fix_ld_library_path + touch ${prefix}.vcf.gz touch ${prefix}.vcf.gz.tbi diff --git a/modules/nf-core/sentieon/dnascope/environment.yml b/modules/nf-core/sentieon/dnascope/environment.yml index 2c5b4937bf..45c2116c04 100644 --- a/modules/nf-core/sentieon/dnascope/environment.yml +++ b/modules/nf-core/sentieon/dnascope/environment.yml @@ -3,3 +3,5 @@ channels: - conda-forge - bioconda - defaults +dependencies: + - bioconda::sentieon=202308.01 diff --git a/modules/nf-core/sentieon/dnascope/main.nf b/modules/nf-core/sentieon/dnascope/main.nf index 6be42a1728..6adea35eea 100644 --- a/modules/nf-core/sentieon/dnascope/main.nf +++ b/modules/nf-core/sentieon/dnascope/main.nf @@ -5,7 +5,10 @@ process SENTIEON_DNASCOPE { secret 'SENTIEON_LICENSE_BASE64' - container 'nf-core/sentieon:202112.06' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : + 'biocontainers/sentieon:202308.01--h43eeafb_0' }" input: tuple val(meta), path(bam), path(bai), path(intervals) @@ -29,10 +32,15 @@ process SENTIEON_DNASCOPE { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + def args = task.ext.args ?: '' // options for the driver def args2 = task.ext.args2 ?: '' // options for the vcf generation def args3 = task.ext.args3 ?: '' // options for the gvcf generation @@ -72,6 +80,8 @@ process SENTIEON_DNASCOPE { echo "Decoded and exported Sentieon test-license system environment variables" fi + $fix_ld_library_path + sentieon driver $args -r $fasta -t $task.cpus -i $bam $interval $vcf_cmd $gvcf_cmd cat <<-END_VERSIONS > versions.yml @@ -81,12 +91,20 @@ process SENTIEON_DNASCOPE { """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + + def prefix = task.ext.prefix ?: "${meta.id}" + """ + $fix_ld_library_path + touch ${prefix}.unfiltered.vcf.gz touch ${prefix}.unfiltered.vcf.gz.tbi touch ${prefix}.g.vcf.gz diff --git a/modules/nf-core/sentieon/gvcftyper/environment.yml b/modules/nf-core/sentieon/gvcftyper/environment.yml index 5af2aaa8e8..9a8143068a 100644 --- a/modules/nf-core/sentieon/gvcftyper/environment.yml +++ b/modules/nf-core/sentieon/gvcftyper/environment.yml @@ -3,3 +3,5 @@ channels: - conda-forge - bioconda - defaults +dependencies: + - bioconda::sentieon=202308.01 diff --git a/modules/nf-core/sentieon/gvcftyper/main.nf b/modules/nf-core/sentieon/gvcftyper/main.nf index 134faa6835..4b5c9df4e3 100644 --- a/modules/nf-core/sentieon/gvcftyper/main.nf +++ b/modules/nf-core/sentieon/gvcftyper/main.nf @@ -5,7 +5,10 @@ process SENTIEON_GVCFTYPER { secret 'SENTIEON_LICENSE_BASE64' - container 'nf-core/sentieon:202112.06' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : + 'biocontainers/sentieon:202308.01--h43eeafb_0' }" input: tuple val(meta), path(gvcfs), path(tbis), path(intervals) @@ -23,10 +26,15 @@ process SENTIEON_GVCFTYPER { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + def prefix = task.ext.prefix ?: "${meta.id}" def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: '' def sentieon_auth_data_base64 = task.ext.sentieon_auth_data_base64 ?: '' @@ -50,6 +58,8 @@ process SENTIEON_GVCFTYPER { echo "Decoded and exported Sentieon test-license system environment variables" fi + $fix_ld_library_path + sentieon driver -r ${fasta} --algo GVCFtyper ${gvcfs_input} ${dbsnp_cmd} ${prefix}.vcf.gz cat <<-END_VERSIONS > versions.yml @@ -59,13 +69,20 @@ process SENTIEON_GVCFTYPER { """ stub: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + def prefix = task.ext.prefix ?: "${meta.id}" """ + $fix_ld_library_path + touch ${prefix}.vcf.gz touch ${prefix}.vcf.gz.tbi diff --git a/modules/nf-core/sentieon/haplotyper/environment.yml b/modules/nf-core/sentieon/haplotyper/environment.yml index 5d8e4c58f9..a3a721cf1d 100644 --- a/modules/nf-core/sentieon/haplotyper/environment.yml +++ b/modules/nf-core/sentieon/haplotyper/environment.yml @@ -3,3 +3,5 @@ channels: - conda-forge - bioconda - defaults +dependencies: + - bioconda::sentieon=202308.01 diff --git a/modules/nf-core/sentieon/haplotyper/main.nf b/modules/nf-core/sentieon/haplotyper/main.nf index f83a137122..87a9343474 100644 --- a/modules/nf-core/sentieon/haplotyper/main.nf +++ b/modules/nf-core/sentieon/haplotyper/main.nf @@ -5,7 +5,10 @@ process SENTIEON_HAPLOTYPER { secret 'SENTIEON_LICENSE_BASE64' - container 'nf-core/sentieon:202112.06' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : + 'biocontainers/sentieon:202308.01--h43eeafb_0' }" input: tuple val(meta), path(input), path(input_index), path(intervals) @@ -27,10 +30,15 @@ process SENTIEON_HAPLOTYPER { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + def args = task.ext.args ?: '' // options for the driver def args2 = task.ext.args2 ?: '' // options for the vcf generation def args3 = task.ext.args3 ?: '' // options for the gvcf generation @@ -68,6 +76,8 @@ process SENTIEON_HAPLOTYPER { echo "Decoded and exported Sentieon test-license system environment variables" fi + $fix_ld_library_path + sentieon driver $args -r $fasta -t $task.cpus -i $input $interval_command $vcf_cmd $gvcf_cmd cat <<-END_VERSIONS > versions.yml @@ -77,8 +87,19 @@ process SENTIEON_HAPLOTYPER { """ stub: + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' + } + def prefix = task.ext.prefix ?: "${meta.id}" """ + $fix_ld_library_path + touch ${prefix}.unfiltered.vcf.gz touch ${prefix}.unfiltered.vcf.gz.tbi touch ${prefix}.g.vcf.gz diff --git a/modules/nf-core/sentieon/varcal/environment.yml b/modules/nf-core/sentieon/varcal/environment.yml index f04a8b78ce..93921ff046 100644 --- a/modules/nf-core/sentieon/varcal/environment.yml +++ b/modules/nf-core/sentieon/varcal/environment.yml @@ -3,3 +3,5 @@ channels: - conda-forge - bioconda - defaults +dependencies: + - bioconda::sentieon=202308.01 diff --git a/modules/nf-core/sentieon/varcal/main.nf b/modules/nf-core/sentieon/varcal/main.nf index 41e0ea40f5..17a3b71845 100644 --- a/modules/nf-core/sentieon/varcal/main.nf +++ b/modules/nf-core/sentieon/varcal/main.nf @@ -5,7 +5,10 @@ process SENTIEON_VARCAL { secret 'SENTIEON_LICENSE_BASE64' - container 'nf-core/sentieon:202112.06' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sentieon:202308.01--h43eeafb_0' : + 'biocontainers/sentieon:202308.01--h43eeafb_0' }" input: tuple val(meta), path(vcf), path(tbi) // input vcf and tbi of variants to recalibrate @@ -26,10 +29,15 @@ process SENTIEON_VARCAL { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def reference_command = fasta ? "--reference $fasta " : '' @@ -69,6 +77,8 @@ process SENTIEON_VARCAL { echo "Decoded and exported Sentieon test-license system environment variables" fi + $fix_ld_library_path + sentieon driver -r ${fasta} --algo VarCal \\ -v $vcf \\ --tranches_file ${prefix}.tranches \\ @@ -83,12 +93,19 @@ process SENTIEON_VARCAL { """ stub: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead." + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' } + def prefix = task.ext.prefix ?: "${meta.id}" """ + $fix_ld_library_path + touch ${prefix}.recal touch ${prefix}.idx touch ${prefix}.tranches diff --git a/modules/nf-core/snpeff/snpeff/main.nf b/modules/nf-core/snpeff/snpeff/main.nf index cc4f2ccb36..28d1382666 100644 --- a/modules/nf-core/snpeff/snpeff/main.nf +++ b/modules/nf-core/snpeff/snpeff/main.nf @@ -13,11 +13,11 @@ process SNPEFF_SNPEFF { tuple val(meta2), path(cache) output: - tuple val(meta), path("*.ann.vcf"), emit: vcf - path "*.csv" , emit: report - path "*.html" , emit: summary_html - path "*.genes.txt" , emit: genes_txt - path "versions.yml" , emit: versions + tuple val(meta), path("*.ann.vcf"), emit: vcf + tuple val(meta), path("*.csv"), emit: report + tuple val(meta), path("*.html"), emit: summary_html + tuple val(meta), path("*.genes.txt"), emit: genes_txt + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/snpeff/snpeff/tests/main.nf.test b/modules/nf-core/snpeff/snpeff/tests/main.nf.test new file mode 100644 index 0000000000..dd37f275ad --- /dev/null +++ b/modules/nf-core/snpeff/snpeff/tests/main.nf.test @@ -0,0 +1,50 @@ +nextflow_process { + + name "Test Process SNPEFF_SNPEFF" + script "../main.nf" + process "SNPEFF_SNPEFF" + config "./nextflow.config" + tag "modules" + tag "modules_nfcore" + tag "snpeff" + tag "snpeff/download" + tag "snpeff/snpeff" + + test("test_SNPEFF_SNPEFF") { + + setup { + run("SNPEFF_DOWNLOAD") { + script "../../download/main.nf" + process { + """ + input[0] = Channel.of([[id:params.snpeff_genome + '.' + params.snpeff_cache_version], params.snpeff_genome, params.snpeff_cache_version]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) + ]) + input[1] = params.snpeff_genome + '.' + params.snpeff_cache_version + input[2] = SNPEFF_DOWNLOAD.out.cache + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.report[0][1]).exists() }, + { assert path(process.out.summary_html[0][1]).exists() }, + { assert path(process.out.vcf[0][1]).exists() }, + { assert snapshot(process.out.genes_txt).match("genes_txt") }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + } +} diff --git a/modules/nf-core/snpeff/snpeff/tests/main.nf.test.snap b/modules/nf-core/snpeff/snpeff/tests/main.nf.test.snap new file mode 100644 index 0000000000..0891b844ca --- /dev/null +++ b/modules/nf-core/snpeff/snpeff/tests/main.nf.test.snap @@ -0,0 +1,31 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,25d44a118d558b331d51ec00be0d997c" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-03-18T17:37:18.879477" + }, + "genes_txt": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.genes.txt:md5,130536bf0237d7f3f746d32aaa32840a" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-03-18T17:37:18.874822" + } +} \ No newline at end of file diff --git a/modules/nf-core/snpeff/snpeff/tests/nextflow.config b/modules/nf-core/snpeff/snpeff/tests/nextflow.config new file mode 100644 index 0000000000..d31ebf6b7c --- /dev/null +++ b/modules/nf-core/snpeff/snpeff/tests/nextflow.config @@ -0,0 +1,4 @@ +params { + snpeff_cache_version = "105" + snpeff_genome = "WBcel235" +} diff --git a/modules/nf-core/snpeff/snpeff/tests/tags.yml b/modules/nf-core/snpeff/snpeff/tests/tags.yml new file mode 100644 index 0000000000..427b588dfe --- /dev/null +++ b/modules/nf-core/snpeff/snpeff/tests/tags.yml @@ -0,0 +1,2 @@ +snpeff/snpeff: + - "modules/nf-core/snpeff/snpeff/**" diff --git a/modules/nf-core/strelka/germline/main.nf b/modules/nf-core/strelka/germline/main.nf index 8f93356160..dc38d1ce30 100644 --- a/modules/nf-core/strelka/germline/main.nf +++ b/modules/nf-core/strelka/germline/main.nf @@ -9,7 +9,7 @@ process STRELKA_GERMLINE { 'biocontainers/strelka:2.9.10--h9ee0642_1' }" input: - tuple val(meta), path(input), path(input_index), path (target_bed), path (target_bed_tbi) + tuple val(meta), path(input), path(input_index), path (target_bed), path (target_bed_index) path fasta path fai @@ -48,4 +48,18 @@ process STRELKA_GERMLINE { strelka: \$( configureStrelkaGermlineWorkflow.py --version ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + echo "" | gzip > ${prefix}.genome.vcf.gz + touch ${prefix}.genome.vcf.gz.tbi + echo "" | gzip > ${prefix}.variants.vcf.gz + touch ${prefix}.variants.vcf.gz.tbi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + strelka: \$( configureStrelkaSomaticWorkflow.py --version ) + END_VERSIONS + """ } diff --git a/modules/nf-core/strelka/germline/meta.yml b/modules/nf-core/strelka/germline/meta.yml index 6ee656683e..9a597ef01f 100644 --- a/modules/nf-core/strelka/germline/meta.yml +++ b/modules/nf-core/strelka/germline/meta.yml @@ -28,10 +28,22 @@ input: type: file description: BAM/CRAI index file pattern: "*.{bai,crai}" + - 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: An optional bed file + description: BED file containing target regions for variant calling pattern: "*.{bed}" + - target_bed_index: + type: file + description: Index for BED file containing target regions for variant calling + pattern: "*.{bed.tbi}" output: - meta: type: map diff --git a/modules/nf-core/strelka/germline/tests/main.nf.test b/modules/nf-core/strelka/germline/tests/main.nf.test new file mode 100644 index 0000000000..d662016898 --- /dev/null +++ b/modules/nf-core/strelka/germline/tests/main.nf.test @@ -0,0 +1,94 @@ +nextflow_process { + + name "Test Process STRELKA_GERMLINE" + script "../main.nf" + process "STRELKA_GERMLINE" + + tag "modules" + tag "modules_nfcore" + tag "strelka" + tag "strelka/germline" + + test("human - cram") { + + when { + process { + """ + input[0] = [ [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + [], [] + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.genome_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("version") } + ) + } + + } + + test("human - cram - target") { + config "./nextflow.config" + when { + process { + """ + input[0] = [ [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz.tbi', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.genome_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("target_version") } + ) + } + + } + + test("human - cram - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + [], [] + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/strelka/germline/tests/main.nf.test.snap b/modules/nf-core/strelka/germline/tests/main.nf.test.snap new file mode 100644 index 0000000000..2604707f81 --- /dev/null +++ b/modules/nf-core/strelka/germline/tests/main.nf.test.snap @@ -0,0 +1,99 @@ +{ + "human - cram - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.variants.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.variants.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.genome.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "3": [ + [ + { + "id": "test" + }, + "test.genome.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,5f72393fd2ab4358e3f0ad16d1937f65" + ], + "genome_vcf": [ + [ + { + "id": "test" + }, + "test.genome.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "genome_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.genome.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.variants.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "vcf_tbi": [ + [ + { + "id": "test" + }, + "test.variants.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,5f72393fd2ab4358e3f0ad16d1937f65" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-20T16:07:30.81195" + }, + "version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-20T16:05:34.583702" + }, + "target_version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-20T16:11:37.54108" + } +} \ No newline at end of file diff --git a/modules/nf-core/strelka/germline/tests/nextflow.config b/modules/nf-core/strelka/germline/tests/nextflow.config new file mode 100644 index 0000000000..7e1bcab953 --- /dev/null +++ b/modules/nf-core/strelka/germline/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: STRELKA_GERMLINE { + ext.args = '--exome' + } +} diff --git a/modules/nf-core/strelka/germline/tests/tags.yml b/modules/nf-core/strelka/germline/tests/tags.yml new file mode 100644 index 0000000000..4a72ab31a4 --- /dev/null +++ b/modules/nf-core/strelka/germline/tests/tags.yml @@ -0,0 +1,2 @@ +strelka/germline: + - "modules/nf-core/strelka/germline/**" diff --git a/modules/nf-core/strelka/somatic/main.nf b/modules/nf-core/strelka/somatic/main.nf index dd975bd563..1c27696c77 100644 --- a/modules/nf-core/strelka/somatic/main.nf +++ b/modules/nf-core/strelka/somatic/main.nf @@ -52,4 +52,18 @@ process STRELKA_SOMATIC { strelka: \$( configureStrelkaSomaticWorkflow.py --version ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + echo "" | gzip > ${prefix}.somatic_indels.vcf.gz + touch ${prefix}.somatic_indels.vcf.gz.tbi + echo "" | gzip > ${prefix}.somatic_snvs.vcf.gz + touch ${prefix}.somatic_snvs.vcf.gz.tbi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + strelka: \$( configureStrelkaSomaticWorkflow.py --version ) + END_VERSIONS + """ } diff --git a/modules/nf-core/strelka/somatic/meta.yml b/modules/nf-core/strelka/somatic/meta.yml index 6032cd6d5f..428bcb3f84 100644 --- a/modules/nf-core/strelka/somatic/meta.yml +++ b/modules/nf-core/strelka/somatic/meta.yml @@ -56,7 +56,7 @@ input: type: file description: BED file containing target regions for variant calling pattern: "*.{bed}" - - target_bed_tbi: + - target_bed_index: type: file description: Index for BED file containing target regions for variant calling pattern: "*.{bed.tbi}" diff --git a/modules/nf-core/strelka/somatic/tests/main.nf.test b/modules/nf-core/strelka/somatic/tests/main.nf.test new file mode 100644 index 0000000000..2203e6eea4 --- /dev/null +++ b/modules/nf-core/strelka/somatic/tests/main.nf.test @@ -0,0 +1,106 @@ +nextflow_process { + + name "Test Process STRELKA_SOMATIC" + script "../main.nf" + process "STRELKA_SOMATIC" + + tag "modules" + tag "modules_nfcore" + tag "strelka" + tag "strelka/somatic" + + test("human - cram") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + [],[], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz.tbi', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf_indels.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.vcf_snvs.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("version") } + ) + } + + } + + test("human - cram - best-practise") { + config "./nextflow.config" + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.genome_21.somatic_sv.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.genome_21.somatic_sv.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz.tbi', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf_indels.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.vcf_snvs.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("bp_version") } + ) + } + + } + + test("human - cram - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + [],[], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz.tbi', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/strelka/somatic/tests/main.nf.test.snap b/modules/nf-core/strelka/somatic/tests/main.nf.test.snap new file mode 100644 index 0000000000..2594277d9b --- /dev/null +++ b/modules/nf-core/strelka/somatic/tests/main.nf.test.snap @@ -0,0 +1,107 @@ +{ + "bp_version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T15:14:10.142709768" + }, + "human - cram - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_snvs.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_snvs.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,97860fb8f9cda9494819160f7cf6e35b" + ], + "vcf_indels": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "vcf_indels_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf_snvs": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_snvs.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "vcf_snvs_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somatic_snvs.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,97860fb8f9cda9494819160f7cf6e35b" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T15:08:42.361540303" + }, + "version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T15:11:29.631209445" + } +} \ No newline at end of file diff --git a/modules/nf-core/strelka/somatic/tests/nextflow.config b/modules/nf-core/strelka/somatic/tests/nextflow.config new file mode 100644 index 0000000000..3ee62247a5 --- /dev/null +++ b/modules/nf-core/strelka/somatic/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: STRELKA_SOMATIC { + ext.args = '--exome' + } +} diff --git a/modules/nf-core/strelka/somatic/tests/tags.yml b/modules/nf-core/strelka/somatic/tests/tags.yml new file mode 100644 index 0000000000..23d3f34173 --- /dev/null +++ b/modules/nf-core/strelka/somatic/tests/tags.yml @@ -0,0 +1,2 @@ +strelka/somatic: + - "modules/nf-core/strelka/somatic/**" diff --git a/modules/nf-core/svdb/merge/environment.yml b/modules/nf-core/svdb/merge/environment.yml index 4aad50da52..e6fec08877 100644 --- a/modules/nf-core/svdb/merge/environment.yml +++ b/modules/nf-core/svdb/merge/environment.yml @@ -6,4 +6,5 @@ channels: dependencies: - svdb=2.8.1 # renovate: datasource=conda depName=bioconda/samtools - - samtools=1.16.1 + - samtools=1.19.2 + - htslib=1.19.1 diff --git a/modules/nf-core/svdb/merge/main.nf b/modules/nf-core/svdb/merge/main.nf index 0d9967dda9..c24a9a7c38 100644 --- a/modules/nf-core/svdb/merge/main.nf +++ b/modules/nf-core/svdb/merge/main.nf @@ -3,15 +3,15 @@ process SVDB_MERGE { label 'process_medium' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-c8daa8f9d69d3c5a1a4ff08283a166c18edb0000:af6f8534cd538a85ff43a2eae1b52b143e7abd05-0': - 'biocontainers/mulled-v2-c8daa8f9d69d3c5a1a4ff08283a166c18edb0000:af6f8534cd538a85ff43a2eae1b52b143e7abd05-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-c8daa8f9d69d3c5a1a4ff08283a166c18edb0000:511069f65a53621c5503e5cfee319aa3c735abfa-0': + 'biocontainers/mulled-v2-c8daa8f9d69d3c5a1a4ff08283a166c18edb0000:511069f65a53621c5503e5cfee319aa3c735abfa-0' }" input: tuple val(meta), path(vcfs) val (priority) output: - tuple val(meta), path("*_sv_merge.vcf.gz"), emit: vcf + tuple val(meta), path("*.vcf.gz"), emit: vcf path "versions.yml" , emit: versions when: @@ -35,8 +35,8 @@ process SVDB_MERGE { $args \\ $prio \\ --vcf $input \\ - > ${prefix}_sv_merge.vcf - bgzip ${prefix}_sv_merge.vcf + > ${prefix}.vcf + bgzip ${prefix}.vcf cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -48,7 +48,7 @@ process SVDB_MERGE { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}_sv_merge.vcf.gz + touch ${prefix}.vcf.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/svdb/merge/meta.yml b/modules/nf-core/svdb/merge/meta.yml index 84265acb84..e53e61fe74 100644 --- a/modules/nf-core/svdb/merge/meta.yml +++ b/modules/nf-core/svdb/merge/meta.yml @@ -36,7 +36,7 @@ output: - vcf: type: file description: merged VCF file - pattern: "*_sv_merge.vcf.gz" + pattern: "*.vcf.gz" authors: - "@ramprasadn" maintainers: diff --git a/modules/nf-core/svdb/merge/tests/main.nf.test b/modules/nf-core/svdb/merge/tests/main.nf.test new file mode 100644 index 0000000000..42f7c57067 --- /dev/null +++ b/modules/nf-core/svdb/merge/tests/main.nf.test @@ -0,0 +1,59 @@ +nextflow_process { + + name "Test Process SVDB_MERGE" + script "modules/nf-core/svdb/merge/main.nf" + process "SVDB_MERGE" + tag "modules" + tag "modules_nfcore" + tag "svdb" + tag "svdb/merge" + + test("test_svdb_merge") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf', checkIfExists: true) ] + ]) + input[1] = [ 'tiddit', 'cnvnator'] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") } + ) + } + + } + + test("test_svdb_merge_noprio") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf', checkIfExists: true) ] + ]) + input[1] = [] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") } + ) + } + + } + +} diff --git a/modules/nf-core/svdb/merge/tests/tags.yml b/modules/nf-core/svdb/merge/tests/tags.yml new file mode 100644 index 0000000000..8501d90729 --- /dev/null +++ b/modules/nf-core/svdb/merge/tests/tags.yml @@ -0,0 +1,2 @@ +svdb/merge: + - modules/nf-core/svdb/merge/** diff --git a/modules/nf-core/tabix/bgziptabix/environment.yml b/modules/nf-core/tabix/bgziptabix/environment.yml index 028461c987..c4235872e3 100644 --- a/modules/nf-core/tabix/bgziptabix/environment.yml +++ b/modules/nf-core/tabix/bgziptabix/environment.yml @@ -5,3 +5,4 @@ channels: - defaults dependencies: - bioconda::tabix=1.11 + - bioconda::htslib=1.19.1 diff --git a/modules/nf-core/tabix/bgziptabix/main.nf b/modules/nf-core/tabix/bgziptabix/main.nf index f9482690ba..bcdcf2a689 100644 --- a/modules/nf-core/tabix/bgziptabix/main.nf +++ b/modules/nf-core/tabix/bgziptabix/main.nf @@ -4,8 +4,8 @@ process TABIX_BGZIPTABIX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' : - 'biocontainers/tabix:1.11--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/htslib:1.19.1--h81da01d_1' : + 'biocontainers/htslib:1.19.1--h81da01d_1' }" input: tuple val(meta), path(input) @@ -35,7 +35,7 @@ process TABIX_BGZIPTABIX { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.${input.getExtension()}.gz + echo "" | gzip > ${prefix}.${input.getExtension()}.gz touch ${prefix}.${input.getExtension()}.gz.tbi touch ${prefix}.${input.getExtension()}.gz.csi diff --git a/modules/nf-core/tabix/bgziptabix/tests/main.nf.test b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test new file mode 100644 index 0000000000..87ea2c84f9 --- /dev/null +++ b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test @@ -0,0 +1,94 @@ +nextflow_process { + + name "Test Process TABIX_BGZIPTABIX" + script "modules/nf-core/tabix/bgziptabix/main.nf" + process "TABIX_BGZIPTABIX" + + tag "modules" + tag "modules_nfcore" + tag "tabix" + tag "tabix/bgziptabix" + + test("sarscov2_bed_tbi") { + config "./tabix_tbi.config" + + when { + process { + """ + input[0] = [ + [ id:'tbi_test' ], + [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.gz_tbi[0][1]).name + ).match("tbi_test") + } + ) + } + } + + test("sarscov2_bed_csi") { + config "./tabix_csi.config" + + when { + process { + """ + input[0] = [ + [ id:'csi_test' ], + [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.gz_csi[0][1]).name + ).match("csi_test") + } + ) + } + + } + + test("sarscov2_bed_csi_stub") { + config "./tabix_csi.config" + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], + [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.gz_csi[0][1]).name + ).match("csi_stub") + } + ) + } + + } + +} diff --git a/modules/nf-core/tabix/bgziptabix/tests/main.nf.test.snap b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test.snap new file mode 100644 index 0000000000..fcecb2e492 --- /dev/null +++ b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test.snap @@ -0,0 +1,143 @@ +{ + "sarscov2_bed_tbi": { + "content": [ + { + "0": [ + [ + { + "id": "tbi_test" + }, + "tbi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", + "tbi_test.bed.gz.tbi:md5,24908545311cf2b7c803c41d716872c4" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,b4765e4d896ce4a4cdd6c896d12555fc" + ], + "gz_csi": [ + + ], + "gz_tbi": [ + [ + { + "id": "tbi_test" + }, + "tbi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", + "tbi_test.bed.gz.tbi:md5,24908545311cf2b7c803c41d716872c4" + ] + ], + "versions": [ + "versions.yml:md5,b4765e4d896ce4a4cdd6c896d12555fc" + ] + } + ], + "timestamp": "2024-02-19T14:50:51.513838" + }, + "sarscov2_bed_csi": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "csi_test" + }, + "csi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", + "csi_test.bed.gz.csi:md5,e06165ddd34640783728cb07f2558b43" + ] + ], + "2": [ + "versions.yml:md5,b4765e4d896ce4a4cdd6c896d12555fc" + ], + "gz_csi": [ + [ + { + "id": "csi_test" + }, + "csi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", + "csi_test.bed.gz.csi:md5,e06165ddd34640783728cb07f2558b43" + ] + ], + "gz_tbi": [ + + ], + "versions": [ + "versions.yml:md5,b4765e4d896ce4a4cdd6c896d12555fc" + ] + } + ], + "timestamp": "2024-02-19T14:51:00.513777" + }, + "csi_test": { + "content": [ + "csi_test.bed.gz" + ], + "timestamp": "2024-02-19T14:51:00.548801" + }, + "csi_stub": { + "content": [ + "test.bed.gz" + ], + "timestamp": "2024-02-19T14:51:09.218454" + }, + "tbi_test": { + "content": [ + "tbi_test.bed.gz" + ], + "timestamp": "2024-02-19T14:50:51.579654" + }, + "sarscov2_bed_csi_stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,b4765e4d896ce4a4cdd6c896d12555fc" + ], + "gz_csi": [ + [ + { + "id": "test" + }, + "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gz_tbi": [ + [ + { + "id": "test" + }, + "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,b4765e4d896ce4a4cdd6c896d12555fc" + ] + } + ], + "timestamp": "2024-02-19T14:51:09.164254" + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/bgziptabix/tests/tabix_csi.config b/modules/nf-core/tabix/bgziptabix/tests/tabix_csi.config new file mode 100644 index 0000000000..fb41a31424 --- /dev/null +++ b/modules/nf-core/tabix/bgziptabix/tests/tabix_csi.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_BGZIPTABIX { + ext.args2 = '-p vcf --csi' + } +} diff --git a/modules/nf-core/tabix/bgziptabix/tests/tabix_tbi.config b/modules/nf-core/tabix/bgziptabix/tests/tabix_tbi.config new file mode 100644 index 0000000000..c1915dc4b0 --- /dev/null +++ b/modules/nf-core/tabix/bgziptabix/tests/tabix_tbi.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_BGZIPTABIX { + ext.args2 = '-p vcf' + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/bgziptabix/tests/tags.yml b/modules/nf-core/tabix/bgziptabix/tests/tags.yml new file mode 100644 index 0000000000..5052b4d708 --- /dev/null +++ b/modules/nf-core/tabix/bgziptabix/tests/tags.yml @@ -0,0 +1,2 @@ +tabix/bgziptabix: + - "modules/nf-core/tabix/bgziptabix/**" diff --git a/modules/nf-core/tabix/tabix/environment.yml b/modules/nf-core/tabix/tabix/environment.yml index 7167fb87d6..76b45e16c8 100644 --- a/modules/nf-core/tabix/tabix/environment.yml +++ b/modules/nf-core/tabix/tabix/environment.yml @@ -5,3 +5,4 @@ channels: - defaults dependencies: - bioconda::tabix=1.11 + - bioconda::htslib=1.19.1 diff --git a/modules/nf-core/tabix/tabix/main.nf b/modules/nf-core/tabix/tabix/main.nf index c304a8a34b..1737141d7f 100644 --- a/modules/nf-core/tabix/tabix/main.nf +++ b/modules/nf-core/tabix/tabix/main.nf @@ -4,8 +4,8 @@ process TABIX_TABIX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' : - 'biocontainers/tabix:1.11--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/htslib:1.19.1--h81da01d_1' : + 'biocontainers/htslib:1.19.1--h81da01d_1' }" input: tuple val(meta), path(tab) @@ -30,9 +30,9 @@ process TABIX_TABIX { """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${tab}.tbi + touch ${tab}.csi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/tabix/tabix/tests/main.nf.test b/modules/nf-core/tabix/tabix/tests/main.nf.test new file mode 100644 index 0000000000..3a150c708f --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/main.nf.test @@ -0,0 +1,142 @@ +nextflow_process { + + name "Test Process TABIX_TABIX" + script "modules/nf-core/tabix/tabix/main.nf" + process "TABIX_TABIX" + + tag "modules" + tag "modules_nfcore" + tag "tabix" + tag "tabix/tabix" + + test("sarscov2_bedgz_tbi") { + config "./tabix_bed.config" + when { + process { + """ + input[0] = [ + [ id:'tbi_bed' ], + [ file(params.test_data['sarscov2']['genome']['test_bed_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.tbi[0][1]).name + ).match("tbi_bed") + } + ) + } + } + + test("sarscov2_gff_tbi") { + config "./tabix_gff.config" + when { + process { + """ + input[0] = [ + [ id:'tbi_gff' ], + [ file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.tbi[0][1]).name + ).match("tbi_gff") + } + ) + } + + } + + test("sarscov2_vcf_tbi") { + config "./tabix_vcf_tbi.config" + when { + process { + """ + input[0] = [ + [ id:'tbi_vcf' ], + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.tbi[0][1]).name + ).match("tbi_vcf") + } + ) + } + + } + + test("sarscov2_vcf_csi") { + config "./tabix_vcf_csi.config" + when { + process { + """ + input[0] = [ + [ id:'vcf_csi' ], + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.csi[0][1]).name + ).match("vcf_csi") + } + ) + } + + } + + test("sarscov2_vcf_csi_stub") { + config "./tabix_vcf_csi.config" + options "-stub" + when { + process { + """ + input[0] = [ + [ id:'vcf_csi_stub' ], + [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.csi[0][1]).name + ).match("vcf_csi_stub") + } + ) + } + + } + +} diff --git a/modules/nf-core/tabix/tabix/tests/main.nf.test.snap b/modules/nf-core/tabix/tabix/tests/main.nf.test.snap new file mode 100644 index 0000000000..034e38b688 --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/main.nf.test.snap @@ -0,0 +1,217 @@ +{ + "vcf_csi_stub": { + "content": [ + "test.vcf.gz.csi" + ], + "timestamp": "2024-03-04T14:51:59.788002" + }, + "tbi_gff": { + "content": [ + "genome.gff3.gz.tbi" + ], + "timestamp": "2024-02-19T14:53:37.420216" + }, + "sarscov2_gff_tbi": { + "content": [ + { + "0": [ + [ + { + "id": "tbi_gff" + }, + "genome.gff3.gz.tbi:md5,53fc683fd217aae47ef10d23c52a9178" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "tbi_gff" + }, + "genome.gff3.gz.tbi:md5,53fc683fd217aae47ef10d23c52a9178" + ] + ], + "versions": [ + "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + ] + } + ], + "timestamp": "2024-02-19T14:53:37.388157" + }, + "sarscov2_bedgz_tbi": { + "content": [ + { + "0": [ + [ + { + "id": "tbi_bed" + }, + "test.bed.gz.tbi:md5,0f17d85e7f0a042b2aa367b70df224f8" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "tbi_bed" + }, + "test.bed.gz.tbi:md5,0f17d85e7f0a042b2aa367b70df224f8" + ] + ], + "versions": [ + "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + ] + } + ], + "timestamp": "2024-02-19T14:53:28.879408" + }, + "tbi_vcf": { + "content": [ + "test.vcf.gz.tbi" + ], + "timestamp": "2024-02-19T14:53:46.402522" + }, + "vcf_csi": { + "content": [ + "test.vcf.gz.csi" + ], + "timestamp": "2024-02-19T14:53:54.921189" + }, + "sarscov2_vcf_tbi": { + "content": [ + { + "0": [ + [ + { + "id": "tbi_vcf" + }, + "test.vcf.gz.tbi:md5,897f3f378a811b90e6dee56ce08d2bcf" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "tbi_vcf" + }, + "test.vcf.gz.tbi:md5,897f3f378a811b90e6dee56ce08d2bcf" + ] + ], + "versions": [ + "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + ] + } + ], + "timestamp": "2024-02-19T14:53:46.370358" + }, + "sarscov2_vcf_csi_stub": { + "content": [ + { + "0": [ + [ + { + "id": "vcf_csi_stub" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "vcf_csi_stub" + }, + "test.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,3d45df6d80883bad358631069a2940fd" + ], + "csi": [ + [ + { + "id": "vcf_csi_stub" + }, + "test.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + [ + { + "id": "vcf_csi_stub" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,3d45df6d80883bad358631069a2940fd" + ] + } + ], + "timestamp": "2024-03-04T14:51:59.766184" + }, + "sarscov2_vcf_csi": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "vcf_csi" + }, + "test.vcf.gz.csi:md5,0731ad6f40104d2bbb1a2cc478ef8f03" + ] + ], + "2": [ + "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + ], + "csi": [ + [ + { + "id": "vcf_csi" + }, + "test.vcf.gz.csi:md5,0731ad6f40104d2bbb1a2cc478ef8f03" + ] + ], + "tbi": [ + + ], + "versions": [ + "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + ] + } + ], + "timestamp": "2024-02-19T14:53:54.886876" + }, + "tbi_bed": { + "content": [ + "test.bed.gz.tbi" + ], + "timestamp": "2024-02-19T14:53:28.947628" + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/tabix/tests/tabix_bed.config b/modules/nf-core/tabix/tabix/tests/tabix_bed.config new file mode 100644 index 0000000000..7ff0590566 --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/tabix_bed.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_TABIX { + ext.args = '-p bed' + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/tabix/tests/tabix_gff.config b/modules/nf-core/tabix/tabix/tests/tabix_gff.config new file mode 100644 index 0000000000..20c0a1e349 --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/tabix_gff.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_TABIX { + ext.args = '-p gff' + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/tabix/tests/tabix_vcf_csi.config b/modules/nf-core/tabix/tabix/tests/tabix_vcf_csi.config new file mode 100644 index 0000000000..eb4f2d7e2a --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/tabix_vcf_csi.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_TABIX { + ext.args = '-p vcf --csi' + } +} diff --git a/modules/nf-core/tabix/tabix/tests/tabix_vcf_tbi.config b/modules/nf-core/tabix/tabix/tests/tabix_vcf_tbi.config new file mode 100644 index 0000000000..2774c8a906 --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/tabix_vcf_tbi.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_TABIX { + ext.args = '-p vcf' + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/tabix/tests/tags.yml b/modules/nf-core/tabix/tabix/tests/tags.yml new file mode 100644 index 0000000000..6eda065377 --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/tags.yml @@ -0,0 +1,2 @@ +tabix/tabix: + - "modules/nf-core/tabix/tabix/**" diff --git a/modules/nf-core/tiddit/sv/main.nf b/modules/nf-core/tiddit/sv/main.nf index 0f4bc7cb52..f350e31443 100644 --- a/modules/nf-core/tiddit/sv/main.nf +++ b/modules/nf-core/tiddit/sv/main.nf @@ -31,6 +31,7 @@ process TIDDIT_SV { tiddit \\ --sv \\ $args \\ + --threads $task.cpus \\ --bam $input \\ --ref $fasta \\ -o $prefix diff --git a/modules/nf-core/tiddit/sv/meta.yml b/modules/nf-core/tiddit/sv/meta.yml index b13ae5cdcb..bfcbc4e3fd 100644 --- a/modules/nf-core/tiddit/sv/meta.yml +++ b/modules/nf-core/tiddit/sv/meta.yml @@ -21,14 +21,24 @@ input: type: file description: BAM/CRAM file pattern: "*.{bam,cram}" - - index: + - input_index: type: file description: BAM/CRAM index file pattern: "*.{bai,crai}" + - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test_fasta']` - fasta: type: file description: Input FASTA file pattern: "*.{fasta,fa}" + - meta3: + type: map + description: | + Groovy Map containing sample information from bwa index + e.g. `[ id:'test_bwa-index' ]` - bwa_index: type: file description: BWA genome index files diff --git a/modules/nf-core/tiddit/sv/tests/main.nf.test b/modules/nf-core/tiddit/sv/tests/main.nf.test new file mode 100644 index 0000000000..6e32b9e1cf --- /dev/null +++ b/modules/nf-core/tiddit/sv/tests/main.nf.test @@ -0,0 +1,193 @@ +nextflow_process { + + name "Test Process TIDDIT_SV" + script "../main.nf" + process "TIDDIT_SV" + + tag "modules" + tag "modules_nfcore" + tag "tiddit" + tag "tiddit/sv" + tag "bwa/index" + + test("sarscov2 - bam - bwa") { + + setup { + + run("BWA_INDEX") { + script "../../../../nf-core/bwa/index/main.nf" + process { + """ + input[0] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + // fasta + input[1] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + // bwa_index + input[2] = BWA_INDEX.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.1") }, + { assert path(process.out.ploidy.get(0).get(1)).readLines().contains("Chromosome Ploidy Ploidy_rounded Mean_coverage") }, + { assert snapshot(process.out.versions).match("bam_bwa_version") } + ) + } + + } + + test("sarscov2 - bam - no_bwa") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + // fasta + input[1] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + // bwa_index + input[2] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.1") }, + { assert path(process.out.ploidy.get(0).get(1)).readLines().contains("Chromosome Ploidy Ploidy_rounded Mean_coverage") }, + { assert snapshot(process.out.versions).match("bam_version") } + ) + } + + } + + test("human - cram - bwa") { + + setup { + + run("BWA_INDEX") { + script "../../../../nf-core/bwa/index/main.nf" + process { + """ + input[0] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true) + ] + // fasta + input[1] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // bwa_index + input[2] = BWA_INDEX.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.1") }, + { assert path(process.out.ploidy.get(0).get(1)).readLines().contains("Chromosome Ploidy Ploidy_rounded Mean_coverage") }, + { assert snapshot(process.out.versions).match("cram_bwa_version") }) + } + + } + + test("human - cram - no_bwa") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true) + ] + // fasta + input[1] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // bwa_index + input[2] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.1") }, + { assert path(process.out.ploidy.get(0).get(1)).readLines().contains("Chromosome Ploidy Ploidy_rounded Mean_coverage") }, + { assert snapshot(process.out.versions).match("cram_version") }) + } + + } + + test("sarscov2 - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + // fasta + input[1] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + // bwa_index + input[2] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/tiddit/sv/tests/main.nf.test.snap b/modules/nf-core/tiddit/sv/tests/main.nf.test.snap new file mode 100644 index 0000000000..541c48bbdd --- /dev/null +++ b/modules/nf-core/tiddit/sv/tests/main.nf.test.snap @@ -0,0 +1,99 @@ +{ + "cram_bwa_version": { + "content": [ + [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T10:33:01.300519" + }, + "cram_version": { + "content": [ + [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T10:27:12.52902" + }, + "sarscov2 - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.ploidies.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ], + "ploidy": [ + [ + { + "id": "test" + }, + "test.ploidies.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T10:21:51.950503" + }, + "bam_bwa_version": { + "content": [ + [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T10:31:40.918479" + }, + "bam_version": { + "content": [ + [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T10:21:38.449053" + } +} \ No newline at end of file diff --git a/modules/nf-core/tiddit/sv/tests/nextflow.config b/modules/nf-core/tiddit/sv/tests/nextflow.config new file mode 100644 index 0000000000..9bbd0bee51 --- /dev/null +++ b/modules/nf-core/tiddit/sv/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'TIDDIT_SV' { + ext.args = '--skip_assembly' + } +} diff --git a/modules/nf-core/tiddit/sv/tests/tags.yml b/modules/nf-core/tiddit/sv/tests/tags.yml new file mode 100644 index 0000000000..aac5351ecc --- /dev/null +++ b/modules/nf-core/tiddit/sv/tests/tags.yml @@ -0,0 +1,2 @@ +tiddit/sv: + - "modules/nf-core/tiddit/sv/**" diff --git a/modules/nf-core/untar/environment.yml b/modules/nf-core/untar/environment.yml index d6917da326..0c9cbb101d 100644 --- a/modules/nf-core/untar/environment.yml +++ b/modules/nf-core/untar/environment.yml @@ -1,9 +1,11 @@ name: untar + channels: - conda-forge - bioconda - defaults + dependencies: - - conda-forge::sed=4.7 - conda-forge::grep=3.11 + - conda-forge::sed=4.7 - conda-forge::tar=1.34 diff --git a/modules/nf-core/untar/tests/main.nf.test b/modules/nf-core/untar/tests/main.nf.test index d40db13d82..2a7c97bf81 100644 --- a/modules/nf-core/untar/tests/main.nf.test +++ b/modules/nf-core/untar/tests/main.nf.test @@ -3,20 +3,15 @@ nextflow_process { name "Test Process UNTAR" script "../main.nf" process "UNTAR" - tag "modules" tag "modules_nfcore" tag "untar" - test("test_untar") { when { - params { - outdir = "$outputDir" - } process { """ - input[0] = [ [], file(params.test_data['sarscov2']['genome']['kraken2_tar_gz'], checkIfExists: true) ] + input[0] = [ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kraken2.tar.gz', checkIfExists: true) ] """ } } @@ -30,37 +25,12 @@ nextflow_process { } - test("test_untar_different_output_path") { - - when { - params { - outdir = "$outputDir" - } - process { - """ - input[0] = [ [], file(params.test_data['homo_sapiens']['illumina']['test_flowcell'], checkIfExists: true) ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out.untar).match("test_untar_different_output_path") }, - ) - } - - } - test("test_untar_onlyfiles") { when { - params { - outdir = "$outputDir" - } process { """ - input[0] = [ [], file(params.test_data['generic']['tar']['tar_gz'], checkIfExists: true) ] + input[0] = [ [], file(params.modules_testdata_base_path + 'generic/tar/hello.tar.gz', checkIfExists: true) ] """ } } diff --git a/modules/nf-core/untar/tests/main.nf.test.snap b/modules/nf-core/untar/tests/main.nf.test.snap index 146c8678a7..64550292f3 100644 --- a/modules/nf-core/untar/tests/main.nf.test.snap +++ b/modules/nf-core/untar/tests/main.nf.test.snap @@ -1,483 +1,4 @@ { - "test_untar_different_output_path": { - "content": [ - [ - [ - [ - - ], - [ - [ - [ - [ - [ - [ - "s_1_1101.bcl:md5,ad01889e2ff43e2f194224e20bdb600c", - "s_1_1101.stats:md5,4bbbf103454b37fbc3138fadf1b4446b" - ], - [ - "s_1_1101.bcl:md5,565384bbe67a694dfd690bae6d1d30c2", - "s_1_1101.stats:md5,55e5abd8f129ff38ef169873547abdb8" - ], - [ - "s_1_1101.bcl:md5,650fa58a630a9148835ba79e323d4237", - "s_1_1101.stats:md5,77403669ca1b05340c390dff64425c1e" - ], - [ - "s_1_1101.bcl:md5,54471c9e97299cd141e202e204637702", - "s_1_1101.stats:md5,67b14c9a89b7f8556674a7524d5cfb2d" - ], - [ - "s_1_1101.bcl:md5,74e4f929fc7476c380fd9d741ddb6700", - "s_1_1101.stats:md5,5730a4c35463eaa12a06b6758710b98c" - ], - [ - "s_1_1101.bcl:md5,c785f472f4350c120c02c888c8189590", - "s_1_1101.stats:md5,fee4ec63895ea81007e06ee6a36ba5e0" - ], - [ - "s_1_1101.bcl:md5,b7ea50bb25f08d43c301741d77050a9b", - "s_1_1101.stats:md5,fa7c68f3122c74d14364e6f7b011af70" - ], - [ - "s_1_1101.bcl:md5,9d5087dc4bcae39d66486363d4f68ecf", - "s_1_1101.stats:md5,23cdceee4d82c4b8e7c60018b9276ace" - ], - [ - "s_1_1101.bcl:md5,581e0c5ee94e8f2de14b2b1d8e777530", - "s_1_1101.stats:md5,9a3536d573c97f66bb56b49463612607" - ], - [ - "s_1_1101.bcl:md5,296fc026bb34c67bbe2b44845fe0d1de", - "s_1_1101.stats:md5,a7f57a7770fb9c5ae2a0fb1ef403ec4f" - ], - [ - "s_1_1101.bcl:md5,2a3ca15531556c36d10d132a9e051de8", - "s_1_1101.stats:md5,2d0bcdb0a1b51d3d79e415db2ab2d3b1" - ], - [ - "s_1_1101.bcl:md5,1150d46a2ccd4ac58aee0585d3e4ffd7", - "s_1_1101.stats:md5,2e97550bd5b5864ffd0565bb7a3f6d40" - ], - [ - "s_1_1101.bcl:md5,0b85c4b3da0de95e7b862d849c5333ae", - "s_1_1101.stats:md5,6eab9746fbeb783b0cd70398f44e0c1a" - ], - [ - "s_1_1101.bcl:md5,e0e9c91f4698804d7a6d1058ef68b34f", - "s_1_1101.stats:md5,790022cdc7878a02b2ebd166e1ddf0a7" - ], - [ - "s_1_1101.bcl:md5,38cd0ad4de359e651c8ac0d5777ea625", - "s_1_1101.stats:md5,a1b1d5ea5371d326abb029774483c5e6" - ], - [ - "s_1_1101.bcl:md5,b0ddc05c4012ccba24e712a1cfec748f", - "s_1_1101.stats:md5,af3d232f839d720f76f40ba06caa2987" - ], - [ - "s_1_1101.bcl:md5,af32fcc5dc3b836cf7a5ba3db85a75dd", - "s_1_1101.stats:md5,f93f2c09bd4e486c74a5f6e2040f7296" - ], - [ - "s_1_1101.bcl:md5,54b7428e037ca87816107647d4a3d9db", - "s_1_1101.stats:md5,e5ac77a72cd7bed5e9bf03cccda0e48c" - ], - [ - "s_1_1101.bcl:md5,fc8b4eacd493bf3d0b20bc23998dc7ff", - "s_1_1101.stats:md5,190315e159e2f4bc4c057ded7470dc52" - ], - [ - "s_1_1101.bcl:md5,9484ecffda489927fce424ac6a44fa9d", - "s_1_1101.stats:md5,0825feeb457ecc9efcf6f8526ba32311" - ], - [ - "s_1_1101.bcl:md5,eec59e21036e31c95ce1e847bfb0a9c4", - "s_1_1101.stats:md5,9acc13f63c98e5a8445e7be70d49222b" - ], - [ - "s_1_1101.bcl:md5,a9fb24476f87cba4fba68e2b3c3f2c07", - "s_1_1101.stats:md5,dc0aa7db9790733291c3e6480ca2a0fc" - ], - [ - "s_1_1101.bcl:md5,ed950b3e82c500927c2e236c9df005c6", - "s_1_1101.stats:md5,dccb71ec47d1f9d33a192da6d5660a45" - ], - [ - "s_1_1101.bcl:md5,b3e992025e995ca56b5ea2820144ef47", - "s_1_1101.stats:md5,a6a829bf2cffb26ac5d9dc3012057699" - ], - [ - "s_1_1101.bcl:md5,89edc726a5a4e0b4ff8ca3899ed0232b", - "s_1_1101.stats:md5,5b9b4fd8110577a59b82d0c419519d29" - ], - [ - "s_1_1101.bcl:md5,4dc696149169f232c451225f563cb5cd", - "s_1_1101.stats:md5,d3514a71ea3adc60e2943c6b8f6e2598" - ], - [ - "s_1_1101.bcl:md5,35b992d0318afb7c825ceaa31b0755e6", - "s_1_1101.stats:md5,2826093acc175c16c3795de7c4ca8f07" - ], - [ - "s_1_1101.bcl:md5,7bc927f56a362e49c00b5d76ee048901", - "s_1_1101.stats:md5,e47d862b795fd6b88a31d7d482ab22f6" - ], - [ - "s_1_1101.bcl:md5,84742233ff2a651626fe9036f27f7cb2", - "s_1_1101.stats:md5,b78fad11d3c50bc76b722cdc03e3028b" - ], - [ - "s_1_1101.bcl:md5,3935341c86263a7938e8c49620ef39f8", - "s_1_1101.stats:md5,cc6585b2daac5354073d150874da9704" - ], - [ - "s_1_1101.bcl:md5,3627f4fd548bf6e64aaf08fba3a342be", - "s_1_1101.stats:md5,120ae4831ae004ff7d16728aef36e82f" - ], - [ - "s_1_1101.bcl:md5,07631014bc35124149fabd80ef19f933", - "s_1_1101.stats:md5,eadd63d91f47cc6db6b6f0a967a23927" - ], - [ - "s_1_1101.bcl:md5,a1149c80415dc2f34d768eeb397c43fb", - "s_1_1101.stats:md5,ca89a9def67611a9151c6ce685b7cce1" - ], - [ - "s_1_1101.bcl:md5,eb5f71d4741d2f40618756bc72eaf8b4", - "s_1_1101.stats:md5,90f48501e735e5915b843478e23d1ae2" - ], - [ - "s_1_1101.bcl:md5,9bf270fe3f6add1a591ebc24fff10078", - "s_1_1101.stats:md5,a4e429671d4098034293c638aa655e16" - ], - [ - "s_1_1101.bcl:md5,219bedcbd24bae54fe4cf05dae05282c", - "s_1_1101.stats:md5,dd97525b65b68207137d51fcf19132c7" - ], - [ - "s_1_1101.bcl:md5,5163bc00a68fd57ae50cae0b76350892", - "s_1_1101.stats:md5,b606a5368eff1f012f3ea5d11ccdf2e0" - ], - [ - "s_1_1101.bcl:md5,fc429195a5af59a59e0cc4c48e6c05ea", - "s_1_1101.stats:md5,d809aa19698053f90d639da4dcad8008" - ], - [ - "s_1_1101.bcl:md5,383340219a1dd77076a092a64a71a7e4", - "s_1_1101.stats:md5,b204a5cf256378679ffc906c15cc1bae" - ], - [ - "s_1_1101.bcl:md5,0c369540d3e24696cf1f9c55bab69315", - "s_1_1101.stats:md5,a2bc69a4031a22ce9621dcc623a0bf4b" - ], - [ - "s_1_1101.bcl:md5,3127abc8016ba8eb954f8f8015dff387", - "s_1_1101.stats:md5,5deafff31150b7bf757f814e49a53bc2" - ], - [ - "s_1_1101.bcl:md5,045f40c82de676bafec3d59f91376a7a", - "s_1_1101.stats:md5,890700edc20687c090ef52248c7884b1" - ], - [ - "s_1_1101.bcl:md5,78af269aa2b39a1d765703f0a4739a86", - "s_1_1101.stats:md5,303cf457aa1543a8208544f694cbc531" - ], - [ - "s_1_1101.bcl:md5,0ab8c781959b783b62888e9274364a46", - "s_1_1101.stats:md5,2605b0e8322f83aa4d0dae5da4ec7a7a" - ], - [ - "s_1_1101.bcl:md5,d0cf823ffe352e8b3f75d589544ab617", - "s_1_1101.stats:md5,efa3c0e01e3db71e12fd961cb2d03739" - ], - [ - "s_1_1101.bcl:md5,db4ca4ab7a01e03c246f9160c3758d82", - "s_1_1101.stats:md5,f61550d9e4a90df6b860e68f41f82f60" - ], - [ - "s_1_1101.bcl:md5,1af39a2c7e5ff20ece91cb8160b51d17", - "s_1_1101.stats:md5,d0e20879afcaf6dfcd88c73f1c5c78cf" - ], - [ - "s_1_1101.bcl:md5,4cf7123bb0fffcd79266df03aef01665", - "s_1_1101.stats:md5,29bff4075109a121b087116b58d7e927" - ], - [ - "s_1_1101.bcl:md5,aa9980428cb60cd6320f4b48f4dd0d74", - "s_1_1101.stats:md5,6b0e20bde93133117a8d1a6df3d6f37b" - ], - [ - "s_1_1101.bcl:md5,0f6e440374e15b9b491d52fb83a8adfe", - "s_1_1101.stats:md5,55cb5eb0ecdabd23dca39ab8c4607598" - ], - [ - "s_1_1101.bcl:md5,2c645d7bdaddaa403f6e304d36df9e4b", - "s_1_1101.stats:md5,53acf33d21f832779b400c2447386ce4" - ], - [ - "s_1_1101.bcl:md5,3bbf0863b423b770c879203644420206", - "s_1_1101.stats:md5,579bdc7293cac8c3d7407249cacf4c25" - ], - [ - "s_1_1101.bcl:md5,6658a08409e81d29cfeb2d096b491985", - "s_1_1101.stats:md5,bb559ffbea46d612f9933cefa84c4c03" - ], - [ - "s_1_1101.bcl:md5,1700d9a13d3d4f7643af2943ef838acb", - "s_1_1101.stats:md5,f01cb6050ebfb15da1e0399ebd791eb4" - ], - [ - "s_1_1101.bcl:md5,1ac7aa9ffae25eb103f755f33e4a39c6", - "s_1_1101.stats:md5,0b9d45d7929ccf336d5e5b95373ed3c2" - ], - [ - "s_1_1101.bcl:md5,812a97af2e983a53226e18c75190b06c", - "s_1_1101.stats:md5,d2410c7b0e506dab2972e77e2398de1e" - ], - [ - "s_1_1101.bcl:md5,c981e8e4dcc434956c2b86159da268bc", - "s_1_1101.stats:md5,e9c826e85361ce673f1f248786c9a611" - ], - [ - "s_1_1101.bcl:md5,88e09e99a0a4ef3357b203a41b22f77c", - "s_1_1101.stats:md5,ef06f2e5ad667bbd383f9ed6a05b7b42" - ], - [ - "s_1_1101.bcl:md5,461c8b146fc8a7938be38689978ecd09", - "s_1_1101.stats:md5,65115693935da66f9791b27136e22fb0" - ], - [ - "s_1_1101.bcl:md5,c7b827df5ce20e0f21916fe60860ca3f", - "s_1_1101.stats:md5,87be73613aeb507847f94d3cac5bb30a" - ], - [ - "s_1_1101.bcl:md5,7c4cc3dc9c8a1b0f15917b282dfb40ce", - "s_1_1101.stats:md5,bdd9181fa89debbfafe7b6ea3e064065" - ], - [ - "s_1_1101.bcl:md5,19f4debaf91e118aca8934517179ac33", - "s_1_1101.stats:md5,1143082719e136241d21b14a6b19b8a2" - ], - [ - "s_1_1101.bcl:md5,38aa256ad2d697d84b0b2c0e876a3eba", - "s_1_1101.stats:md5,64dd82f03df23f7f437eede2671ed4fe" - ], - [ - "s_1_1101.bcl:md5,b7929970378949571fed922c1b8cab32", - "s_1_1101.stats:md5,3d6d7985a41629fe196e4342d7fe36aa" - ], - [ - "s_1_1101.bcl:md5,fb2ed0bf6e89d79624ee78754e773491", - "s_1_1101.stats:md5,f34940810ff255aee79953496a12716d" - ], - [ - "s_1_1101.bcl:md5,4f8a8311f5f9c3a7629c1a973a7b280e", - "s_1_1101.stats:md5,4fd7cd28c09f4e152e7c2ad1ab541cd2" - ], - [ - "s_1_1101.bcl:md5,9eb46c903d0344e25af51f88cc311d60", - "s_1_1101.stats:md5,df3abd5f620d9e7f99496098d9fd3f7f" - ], - [ - "s_1_1101.bcl:md5,3ecbc17f3660e2014b58d7fe70ae62d5", - "s_1_1101.stats:md5,8e89a13c85a6d6ab3ccd251b66d1f165" - ], - [ - "s_1_1101.bcl:md5,5d59cc2499a77791233a64f73fe82894", - "s_1_1101.stats:md5,32ec99cd400f4b80cb26e2fa8e07ece0" - ], - [ - "s_1_1101.bcl:md5,1c052da47b9ae8554388f0fa3aade482", - "s_1_1101.stats:md5,d23f438772673688aa7bc92421dc6dce" - ], - [ - "s_1_1101.bcl:md5,1a52bd4f23130c0c96bc967ccd448a2b", - "s_1_1101.stats:md5,9b597e3388d59ef1f61aba30ac90ea79" - ], - [ - "s_1_1101.bcl:md5,8a1e84b79cf3f80794c20e3a0cc84688", - "s_1_1101.stats:md5,9561f7b6ef4b1849afc72b2bb49792bd" - ], - [ - "s_1_1101.bcl:md5,75c00111051f3fa95d04286823cb9109", - "s_1_1101.stats:md5,1fe786cdf8181767deafbd60b3c76610" - ], - [ - "s_1_1101.bcl:md5,529255d8deee0873ed5565e6d1a2ebda", - "s_1_1101.stats:md5,3fa7f467e97a75880f32d17b7429d316" - ], - [ - "s_1_1101.bcl:md5,ea4d960e3d9355d2149da71b88a21df4", - "s_1_1101.stats:md5,2540fe65586e8e800c1ddd8cddd1e8cd" - ], - [ - "s_1_1101.bcl:md5,0dfe1fd92a2dce2f23119aa483429744", - "s_1_1101.stats:md5,78257b2169fb9f0cf40966e06e847e86" - ], - [ - "s_1_1101.bcl:md5,f692ddc9aa3ab849271d07c666d0b3b9", - "s_1_1101.stats:md5,aa2ec6a3e3a9c116e34fe74a21e6459e" - ], - [ - "s_1_1101.bcl:md5,29cc4c239eae7c871c9a1adf92ebdb98", - "s_1_1101.stats:md5,263184813090acd740a5bf25304aed3a" - ], - [ - "s_1_1101.bcl:md5,e005af6a84925e326afbfe264241f047", - "s_1_1101.stats:md5,b6fb20868eebaffcc19daa694a449795" - ], - [ - "s_1_1101.bcl:md5,02f1a699b1ba9967accccf99a7af3d24", - "s_1_1101.stats:md5,4f007efacecaf26dc0e0231aede28754" - ], - [ - "s_1_1101.bcl:md5,df308c72a2dcc655cd95e98f5457187a", - "s_1_1101.stats:md5,130c4b07f4c14030bab012824cbe34da" - ], - [ - "s_1_1101.bcl:md5,f3ce10d8d2406b72355023bfa8c96822", - "s_1_1101.stats:md5,2638f4db393ed5b699ec2ce59ff0ec19" - ], - [ - "s_1_1101.bcl:md5,cc2f6d675ad1593ff96f734b172d249e", - "s_1_1101.stats:md5,f5b13f1e1ababc9e1a7a73b0b993cbf1" - ], - [ - "s_1_1101.bcl:md5,7938a0b21448305a951b023b1845b3a7", - "s_1_1101.stats:md5,fcd57511adabfc3ba1ac045165330006" - ], - [ - "s_1_1101.bcl:md5,44879bc6a38df1fee8def61868115041", - "s_1_1101.stats:md5,517e20e4b58a8023a37f9af62e0e2036" - ], - [ - "s_1_1101.bcl:md5,8749611e62406a7d2f34c610a55e56af", - "s_1_1101.stats:md5,8ccf24b3676ef84f2e513be8f2a9f3d1" - ], - [ - "s_1_1101.bcl:md5,a9846a037611cda3721958088f714c0e", - "s_1_1101.stats:md5,6438fa5a1892f328cab1605a95d80a3b" - ], - [ - "s_1_1101.bcl:md5,d6c4a2a726496476eb826532f974ed5f", - "s_1_1101.stats:md5,8c2c65b5e8b00dbf61ada65252aeb266" - ], - [ - "s_1_1101.bcl:md5,be3dde6cae7dd85855a6bf295ebfacfe", - "s_1_1101.stats:md5,93bc13f3b0749b2b8d8bcb0b1199f4f0" - ], - [ - "s_1_1101.bcl:md5,7c64514735a6cf1565b60647edd17d20", - "s_1_1101.stats:md5,4a0aa6c49b24f876415e5878cef7f805" - ], - [ - "s_1_1101.bcl:md5,3983b4043bc9df4b505202a5134ccf03", - "s_1_1101.stats:md5,1c9d9a8558adc1279ca27c96bc1b9758" - ], - [ - "s_1_1101.bcl:md5,a0b8d77f116ec95975f9253dcb768136", - "s_1_1101.stats:md5,c3992b786756e7ec42f65ef4b13b50d4" - ], - [ - "s_1_1101.bcl:md5,43c95ba35d06bb7c57fbd16f3d1cfd6c", - "s_1_1101.stats:md5,3cb69d04698c39f97f962e5bf1eea7f0" - ], - [ - "s_1_1101.bcl:md5,3dbeea0cad7052f19f53ff6f19dd4d90", - "s_1_1101.stats:md5,58bbc8254f0f5f4a244531e8e9c12a04" - ], - [ - "s_1_1101.bcl:md5,da56d088996376c898d855b6cd0a7dfc", - "s_1_1101.stats:md5,9f2d78af6908ce1576b89cdc059844ff" - ], - [ - "s_1_1101.bcl:md5,7b641a5565f095e9a6ffcad9e4305033", - "s_1_1101.stats:md5,3ada06c59b4fb41b83ab6abd0979e9fc" - ], - [ - "s_1_1101.bcl:md5,a3843d397a01d51657825bb652c191e5", - "s_1_1101.stats:md5,19341e52a4bfc7d9d48e9d2acc68c519" - ], - [ - "s_1_1101.bcl:md5,048e3ebfc8efeb8012def6b741c9060d", - "s_1_1101.stats:md5,88bd38deca1e87d700effab1fd099565" - ], - [ - "s_1_1101.bcl:md5,b340db0e07e829dd5da22371916a1a9e", - "s_1_1101.stats:md5,e44cfaddcc4ffb968e5b1a2f41ac48a5" - ], - [ - "s_1_1101.bcl:md5,e6011ec6eabbc2b8792deb283c621ce0", - "s_1_1101.stats:md5,090875dcd1a431af24bc631333f089c4" - ], - [ - "s_1_1101.bcl:md5,a08f216e3352345031ed100ec4245082", - "s_1_1101.stats:md5,97b949ef4b96219e1369f673cf5f8a6c" - ], - [ - "s_1_1101.bcl:md5,b43337c76fb037dfcf5f8f7bcb3618e5", - "s_1_1101.stats:md5,ddef585805e79951f69d23ab7354f69b" - ], - [ - "s_1_1101.bcl:md5,8c61fd004104397b360855e058bbf1bf", - "s_1_1101.stats:md5,0f8d253816d594dcfea3ccf48c826401" - ], - [ - "s_1_1101.bcl:md5,594d06310d328b188aa0b3edfff22cb2", - "s_1_1101.stats:md5,3160bf271b39aeb7590e4fd2984710ba" - ], - [ - "s_1_1101.bcl:md5,4c9eada67c9d55437211d83e111961d5", - "s_1_1101.stats:md5,2901b46ab16ec4863d30e4c84ec29c97" - ], - [ - "s_1_1101.bcl:md5,e03971ae5282f0accc0c1b7374d9ef1b", - "s_1_1101.stats:md5,60d2a19ce59bf70a21a28555484cead8" - ], - [ - "s_1_1101.bcl:md5,e1c6f7a06e63d149895d3e48e63df155", - "s_1_1101.stats:md5,44beb10af847ea3dddaf06dda7031126" - ], - [ - "s_1_1101.bcl:md5,960a99bf29a8f9d936e9b8582d46c9c6", - "s_1_1101.stats:md5,544cd1a7aaaa841914b40ece43399334" - ], - [ - "s_1_1101.bcl:md5,5706679f349fd4a6b6313bc2c41c7a42", - "s_1_1101.stats:md5,627eea844b26dae033848c2f9f69177b" - ], - [ - "s_1_1101.bcl:md5,21da5abc4b0402bbac14b5ab998b0b4f", - "s_1_1101.stats:md5,515bd140b095ad90473ca7a9a69877ab" - ], - "s_1_1101.control:md5,08a72e2198ae95150718e8adf011d105", - "s_1_1101.filter:md5,3a72bc73b323c8cb0ac5bfeb62d98989" - ] - ], - [ - "s_1_1101.locs:md5,0827ea802e5257cc5b20e757a33d4c98" - ], - "RTAConfiguration.xml:md5,c7d6e257bc374f142dc64b9d2281d4c9", - "config.xml:md5,9a4cc7ec01fefa2f1ce9bcb45bbad6e9" - ] - ], - [ - "ControlMetricsOut.bin:md5,6d77b38d0793a6e1ce1e85706e488953", - "CorrectedIntMetricsOut.bin:md5,2bbf84d3be72734addaa2fe794711434", - "ErrorMetricsOut.bin:md5,38c88def138e9bb832539911affdb286", - "ExtractionMetricsOut.bin:md5,7497c3178837eea8f09350b5cd252e99", - "IndexMetricsOut.bin:md5,d41d8cd98f00b204e9800998ecf8427e", - "QMetricsOut.bin:md5,7e9f198d53ebdfbb699a5f94cf1ed51c", - "TileMetricsOut.bin:md5,83891751ec1c91a425a524b476b6ca3c" - ], - "RunInfo.xml:md5,03038959f4dd181c86bc97ae71fe270a" - ] - ] - ] - ], - "timestamp": "2023-10-18T11:56:39.562418" - }, "test_untar_onlyfiles": { "content": [ [ @@ -491,7 +12,11 @@ ] ] ], - "timestamp": "2023-10-18T11:56:46.878844" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T11:49:41.320643" }, "test_untar": { "content": [ @@ -508,6 +33,10 @@ ] ] ], - "timestamp": "2023-10-18T11:56:08.16574" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T11:49:33.795172" } } \ No newline at end of file diff --git a/modules/nf-core/vcftools/main.nf b/modules/nf-core/vcftools/main.nf index 0153a60891..475ef58f7a 100644 --- a/modules/nf-core/vcftools/main.nf +++ b/modules/nf-core/vcftools/main.nf @@ -91,10 +91,14 @@ process VCFTOOLS { def bed_arg = (args.contains('--bed')) ? "--bed ${bed}" : (args.contains('--exclude-bed')) ? "--exclude-bed ${bed}" : - (args.contains('--hapcount')) ? "--hapcount ${bed}" : '' + (args.contains('--hapcount')) ? "--hapcount ${bed}" : + (args.contains('--positions')) ? "--positions ${bed}" : + (args.contains('--exclude-positions')) ? "--exclude-positions ${bed}" : '' args_list.removeIf { it.contains('--bed') } args_list.removeIf { it.contains('--exclude-bed') } args_list.removeIf { it.contains('--hapcount') } + args_list.removeIf { it.contains('--positions') } + args_list.removeIf { it.contains('--exclude-positions') } def diff_variant_arg = (args.contains('--diff')) ? "--diff ${diff_variant_file}" : (args.contains('--gzdiff')) ? "--gzdiff ${diff_variant_file}" : @@ -120,4 +124,12 @@ process VCFTOOLS { vcftools: \$(echo \$(vcftools --version 2>&1) | sed 's/^.*VCFtools (//;s/).*//') END_VERSIONS """ + + stub: + """ + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vcftools: \$(echo \$(vcftools --version 2>&1) | sed 's/^.*VCFtools (//;s/).*//') + END_VERSIONS + """ } diff --git a/modules/nf-core/vcftools/meta.yml b/modules/nf-core/vcftools/meta.yml index f361db4a8f..09ad5908ab 100644 --- a/modules/nf-core/vcftools/meta.yml +++ b/modules/nf-core/vcftools/meta.yml @@ -1,6 +1,7 @@ name: vcftools description: A set of tools written in Perl and C++ for working with VCF files keywords: + - VCFtools - VCF - sort tools: diff --git a/modules/nf-core/vcftools/tests/base.config b/modules/nf-core/vcftools/tests/base.config new file mode 100644 index 0000000000..2b749b66c8 --- /dev/null +++ b/modules/nf-core/vcftools/tests/base.config @@ -0,0 +1,5 @@ +process { + withName: VCFTOOLS { + ext.args = '--freq' + } +} diff --git a/modules/nf-core/vcftools/tests/bed.config b/modules/nf-core/vcftools/tests/bed.config new file mode 100644 index 0000000000..14c0aea867 --- /dev/null +++ b/modules/nf-core/vcftools/tests/bed.config @@ -0,0 +1,5 @@ +process { + withName: VCFTOOLS { + ext.args = '--freq --exclude-bed' + } +} diff --git a/modules/nf-core/vcftools/tests/main.nf.test b/modules/nf-core/vcftools/tests/main.nf.test new file mode 100644 index 0000000000..d8f578dac1 --- /dev/null +++ b/modules/nf-core/vcftools/tests/main.nf.test @@ -0,0 +1,151 @@ +nextflow_process { + + name "Test Process VCFTOOLS" + script "../main.nf" + process "VCFTOOLS" + + tag "modules" + tag "modules_nfcore" + tag "vcftools" + + test("sarscov2 - vcf") { + + config "./base.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) + ] + // bed + input[1] = [] + // diff_variant_file + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - vcfgz") { + + config "./base.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) + ] + // bed + input[1] = [] + // diff_variant_file + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - vcf - bed") { + + config "./bed.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) + ] + // bed + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + // diff_variant_file + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - vcfgz - bed") { + + config "./bed.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) + ] + // bed + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + // diff_variant_file + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - vcfgz - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) + ] + // bed + input[1] = [] + // diff_variant_file + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/vcftools/tests/main.nf.test.snap b/modules/nf-core/vcftools/tests/main.nf.test.snap new file mode 100644 index 0000000000..77669aadc4 --- /dev/null +++ b/modules/nf-core/vcftools/tests/main.nf.test.snap @@ -0,0 +1,1987 @@ +{ + "sarscov2 - vcfgz - bed": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + + ], + "13": [ + + ], + "14": [ + + ], + "15": [ + + ], + "16": [ + + ], + "17": [ + + ], + "18": [ + + ], + "19": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "20": [ + + ], + "21": [ + + ], + "22": [ + + ], + "23": [ + + ], + "24": [ + + ], + "25": [ + + ], + "26": [ + + ], + "27": [ + + ], + "28": [ + + ], + "29": [ + + ], + "3": [ + + ], + "30": [ + + ], + "31": [ + + ], + "32": [ + + ], + "33": [ + + ], + "34": [ + + ], + "35": [ + + ], + "36": [ + + ], + "37": [ + + ], + "38": [ + + ], + "39": [ + + ], + "4": [ + + ], + "40": [ + + ], + "41": [ + + ], + "42": [ + + ], + "43": [ + + ], + "44": [ + + ], + "45": [ + + ], + "46": [ + + ], + "47": [ + + ], + "48": [ + + ], + "49": [ + + ], + "5": [ + + ], + "50": [ + + ], + "51": [ + + ], + "52": [ + + ], + "53": [ + + ], + "54": [ + + ], + "55": [ + + ], + "56": [ + + ], + "57": [ + + ], + "58": [ + + ], + "59": [ + + ], + "6": [ + + ], + "60": [ + + ], + "61": [ + + ], + "62": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "bcf": [ + + ], + "beagle_gl": [ + + ], + "beagle_pl": [ + + ], + "diff_discd_matrix": [ + + ], + "diff_indv": [ + + ], + "diff_indv_in_files": [ + + ], + "diff_sites": [ + + ], + "diff_sites_in_files": [ + + ], + "diff_switch_error": [ + + ], + "filter_summary": [ + + ], + "format": [ + + ], + "freq_burden": [ + + ], + "frq": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "frq_count": [ + + ], + "gdepth": [ + + ], + "geno_chisq": [ + + ], + "geno_ld": [ + + ], + "genotypes_matrix": [ + + ], + "genotypes_matrix_individual": [ + + ], + "genotypes_matrix_position": [ + + ], + "hap_ld": [ + + ], + "hapcount": [ + + ], + "heterozygosity": [ + + ], + "hwe": [ + + ], + "idepth": [ + + ], + "impute_hap": [ + + ], + "impute_hap_indv": [ + + ], + "impute_hap_legend": [ + + ], + "indel_hist": [ + + ], + "info": [ + + ], + "interchrom_geno_ld": [ + + ], + "interchrom_hap_ld": [ + + ], + "kept_sites": [ + + ], + "ldepth": [ + + ], + "ldepth_mean": [ + + ], + "ldhat_locs": [ + + ], + "ldhat_sites": [ + + ], + "list_geno_ld": [ + + ], + "list_hap_ld": [ + + ], + "lqual": [ + + ], + "lroh": [ + + ], + "map_": [ + + ], + "mendel": [ + + ], + "missing_individual": [ + + ], + "missing_site": [ + + ], + "ped": [ + + ], + "relatedness": [ + + ], + "relatedness2": [ + + ], + "removed_sites": [ + + ], + "singeltons": [ + + ], + "sites_pi": [ + + ], + "snp_density": [ + + ], + "tajima_d": [ + + ], + "tfam": [ + + ], + "tped": [ + + ], + "tstv": [ + + ], + "tstv_count": [ + + ], + "tstv_qual": [ + + ], + "tstv_summary": [ + + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "weir_fst": [ + + ], + "windowed_pi": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T13:07:26.598512" + }, + "sarscov2 - vcf": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + + ], + "13": [ + + ], + "14": [ + + ], + "15": [ + + ], + "16": [ + + ], + "17": [ + + ], + "18": [ + + ], + "19": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "20": [ + + ], + "21": [ + + ], + "22": [ + + ], + "23": [ + + ], + "24": [ + + ], + "25": [ + + ], + "26": [ + + ], + "27": [ + + ], + "28": [ + + ], + "29": [ + + ], + "3": [ + + ], + "30": [ + + ], + "31": [ + + ], + "32": [ + + ], + "33": [ + + ], + "34": [ + + ], + "35": [ + + ], + "36": [ + + ], + "37": [ + + ], + "38": [ + + ], + "39": [ + + ], + "4": [ + + ], + "40": [ + + ], + "41": [ + + ], + "42": [ + + ], + "43": [ + + ], + "44": [ + + ], + "45": [ + + ], + "46": [ + + ], + "47": [ + + ], + "48": [ + + ], + "49": [ + + ], + "5": [ + + ], + "50": [ + + ], + "51": [ + + ], + "52": [ + + ], + "53": [ + + ], + "54": [ + + ], + "55": [ + + ], + "56": [ + + ], + "57": [ + + ], + "58": [ + + ], + "59": [ + + ], + "6": [ + + ], + "60": [ + + ], + "61": [ + + ], + "62": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "bcf": [ + + ], + "beagle_gl": [ + + ], + "beagle_pl": [ + + ], + "diff_discd_matrix": [ + + ], + "diff_indv": [ + + ], + "diff_indv_in_files": [ + + ], + "diff_sites": [ + + ], + "diff_sites_in_files": [ + + ], + "diff_switch_error": [ + + ], + "filter_summary": [ + + ], + "format": [ + + ], + "freq_burden": [ + + ], + "frq": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "frq_count": [ + + ], + "gdepth": [ + + ], + "geno_chisq": [ + + ], + "geno_ld": [ + + ], + "genotypes_matrix": [ + + ], + "genotypes_matrix_individual": [ + + ], + "genotypes_matrix_position": [ + + ], + "hap_ld": [ + + ], + "hapcount": [ + + ], + "heterozygosity": [ + + ], + "hwe": [ + + ], + "idepth": [ + + ], + "impute_hap": [ + + ], + "impute_hap_indv": [ + + ], + "impute_hap_legend": [ + + ], + "indel_hist": [ + + ], + "info": [ + + ], + "interchrom_geno_ld": [ + + ], + "interchrom_hap_ld": [ + + ], + "kept_sites": [ + + ], + "ldepth": [ + + ], + "ldepth_mean": [ + + ], + "ldhat_locs": [ + + ], + "ldhat_sites": [ + + ], + "list_geno_ld": [ + + ], + "list_hap_ld": [ + + ], + "lqual": [ + + ], + "lroh": [ + + ], + "map_": [ + + ], + "mendel": [ + + ], + "missing_individual": [ + + ], + "missing_site": [ + + ], + "ped": [ + + ], + "relatedness": [ + + ], + "relatedness2": [ + + ], + "removed_sites": [ + + ], + "singeltons": [ + + ], + "sites_pi": [ + + ], + "snp_density": [ + + ], + "tajima_d": [ + + ], + "tfam": [ + + ], + "tped": [ + + ], + "tstv": [ + + ], + "tstv_count": [ + + ], + "tstv_qual": [ + + ], + "tstv_summary": [ + + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "weir_fst": [ + + ], + "windowed_pi": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T13:07:10.654082" + }, + "sarscov2 - vcfgz": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + + ], + "13": [ + + ], + "14": [ + + ], + "15": [ + + ], + "16": [ + + ], + "17": [ + + ], + "18": [ + + ], + "19": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "20": [ + + ], + "21": [ + + ], + "22": [ + + ], + "23": [ + + ], + "24": [ + + ], + "25": [ + + ], + "26": [ + + ], + "27": [ + + ], + "28": [ + + ], + "29": [ + + ], + "3": [ + + ], + "30": [ + + ], + "31": [ + + ], + "32": [ + + ], + "33": [ + + ], + "34": [ + + ], + "35": [ + + ], + "36": [ + + ], + "37": [ + + ], + "38": [ + + ], + "39": [ + + ], + "4": [ + + ], + "40": [ + + ], + "41": [ + + ], + "42": [ + + ], + "43": [ + + ], + "44": [ + + ], + "45": [ + + ], + "46": [ + + ], + "47": [ + + ], + "48": [ + + ], + "49": [ + + ], + "5": [ + + ], + "50": [ + + ], + "51": [ + + ], + "52": [ + + ], + "53": [ + + ], + "54": [ + + ], + "55": [ + + ], + "56": [ + + ], + "57": [ + + ], + "58": [ + + ], + "59": [ + + ], + "6": [ + + ], + "60": [ + + ], + "61": [ + + ], + "62": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "bcf": [ + + ], + "beagle_gl": [ + + ], + "beagle_pl": [ + + ], + "diff_discd_matrix": [ + + ], + "diff_indv": [ + + ], + "diff_indv_in_files": [ + + ], + "diff_sites": [ + + ], + "diff_sites_in_files": [ + + ], + "diff_switch_error": [ + + ], + "filter_summary": [ + + ], + "format": [ + + ], + "freq_burden": [ + + ], + "frq": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "frq_count": [ + + ], + "gdepth": [ + + ], + "geno_chisq": [ + + ], + "geno_ld": [ + + ], + "genotypes_matrix": [ + + ], + "genotypes_matrix_individual": [ + + ], + "genotypes_matrix_position": [ + + ], + "hap_ld": [ + + ], + "hapcount": [ + + ], + "heterozygosity": [ + + ], + "hwe": [ + + ], + "idepth": [ + + ], + "impute_hap": [ + + ], + "impute_hap_indv": [ + + ], + "impute_hap_legend": [ + + ], + "indel_hist": [ + + ], + "info": [ + + ], + "interchrom_geno_ld": [ + + ], + "interchrom_hap_ld": [ + + ], + "kept_sites": [ + + ], + "ldepth": [ + + ], + "ldepth_mean": [ + + ], + "ldhat_locs": [ + + ], + "ldhat_sites": [ + + ], + "list_geno_ld": [ + + ], + "list_hap_ld": [ + + ], + "lqual": [ + + ], + "lroh": [ + + ], + "map_": [ + + ], + "mendel": [ + + ], + "missing_individual": [ + + ], + "missing_site": [ + + ], + "ped": [ + + ], + "relatedness": [ + + ], + "relatedness2": [ + + ], + "removed_sites": [ + + ], + "singeltons": [ + + ], + "sites_pi": [ + + ], + "snp_density": [ + + ], + "tajima_d": [ + + ], + "tfam": [ + + ], + "tped": [ + + ], + "tstv": [ + + ], + "tstv_count": [ + + ], + "tstv_qual": [ + + ], + "tstv_summary": [ + + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "weir_fst": [ + + ], + "windowed_pi": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T13:07:15.930382" + }, + "sarscov2 - vcf - bed": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + + ], + "13": [ + + ], + "14": [ + + ], + "15": [ + + ], + "16": [ + + ], + "17": [ + + ], + "18": [ + + ], + "19": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "20": [ + + ], + "21": [ + + ], + "22": [ + + ], + "23": [ + + ], + "24": [ + + ], + "25": [ + + ], + "26": [ + + ], + "27": [ + + ], + "28": [ + + ], + "29": [ + + ], + "3": [ + + ], + "30": [ + + ], + "31": [ + + ], + "32": [ + + ], + "33": [ + + ], + "34": [ + + ], + "35": [ + + ], + "36": [ + + ], + "37": [ + + ], + "38": [ + + ], + "39": [ + + ], + "4": [ + + ], + "40": [ + + ], + "41": [ + + ], + "42": [ + + ], + "43": [ + + ], + "44": [ + + ], + "45": [ + + ], + "46": [ + + ], + "47": [ + + ], + "48": [ + + ], + "49": [ + + ], + "5": [ + + ], + "50": [ + + ], + "51": [ + + ], + "52": [ + + ], + "53": [ + + ], + "54": [ + + ], + "55": [ + + ], + "56": [ + + ], + "57": [ + + ], + "58": [ + + ], + "59": [ + + ], + "6": [ + + ], + "60": [ + + ], + "61": [ + + ], + "62": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "bcf": [ + + ], + "beagle_gl": [ + + ], + "beagle_pl": [ + + ], + "diff_discd_matrix": [ + + ], + "diff_indv": [ + + ], + "diff_indv_in_files": [ + + ], + "diff_sites": [ + + ], + "diff_sites_in_files": [ + + ], + "diff_switch_error": [ + + ], + "filter_summary": [ + + ], + "format": [ + + ], + "freq_burden": [ + + ], + "frq": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "frq_count": [ + + ], + "gdepth": [ + + ], + "geno_chisq": [ + + ], + "geno_ld": [ + + ], + "genotypes_matrix": [ + + ], + "genotypes_matrix_individual": [ + + ], + "genotypes_matrix_position": [ + + ], + "hap_ld": [ + + ], + "hapcount": [ + + ], + "heterozygosity": [ + + ], + "hwe": [ + + ], + "idepth": [ + + ], + "impute_hap": [ + + ], + "impute_hap_indv": [ + + ], + "impute_hap_legend": [ + + ], + "indel_hist": [ + + ], + "info": [ + + ], + "interchrom_geno_ld": [ + + ], + "interchrom_hap_ld": [ + + ], + "kept_sites": [ + + ], + "ldepth": [ + + ], + "ldepth_mean": [ + + ], + "ldhat_locs": [ + + ], + "ldhat_sites": [ + + ], + "list_geno_ld": [ + + ], + "list_hap_ld": [ + + ], + "lqual": [ + + ], + "lroh": [ + + ], + "map_": [ + + ], + "mendel": [ + + ], + "missing_individual": [ + + ], + "missing_site": [ + + ], + "ped": [ + + ], + "relatedness": [ + + ], + "relatedness2": [ + + ], + "removed_sites": [ + + ], + "singeltons": [ + + ], + "sites_pi": [ + + ], + "snp_density": [ + + ], + "tajima_d": [ + + ], + "tfam": [ + + ], + "tped": [ + + ], + "tstv": [ + + ], + "tstv_count": [ + + ], + "tstv_qual": [ + + ], + "tstv_summary": [ + + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "weir_fst": [ + + ], + "windowed_pi": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T13:07:21.295463" + }, + "sarscov2 - vcfgz - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + + ], + "13": [ + + ], + "14": [ + + ], + "15": [ + + ], + "16": [ + + ], + "17": [ + + ], + "18": [ + + ], + "19": [ + + ], + "2": [ + + ], + "20": [ + + ], + "21": [ + + ], + "22": [ + + ], + "23": [ + + ], + "24": [ + + ], + "25": [ + + ], + "26": [ + + ], + "27": [ + + ], + "28": [ + + ], + "29": [ + + ], + "3": [ + + ], + "30": [ + + ], + "31": [ + + ], + "32": [ + + ], + "33": [ + + ], + "34": [ + + ], + "35": [ + + ], + "36": [ + + ], + "37": [ + + ], + "38": [ + + ], + "39": [ + + ], + "4": [ + + ], + "40": [ + + ], + "41": [ + + ], + "42": [ + + ], + "43": [ + + ], + "44": [ + + ], + "45": [ + + ], + "46": [ + + ], + "47": [ + + ], + "48": [ + + ], + "49": [ + + ], + "5": [ + + ], + "50": [ + + ], + "51": [ + + ], + "52": [ + + ], + "53": [ + + ], + "54": [ + + ], + "55": [ + + ], + "56": [ + + ], + "57": [ + + ], + "58": [ + + ], + "59": [ + + ], + "6": [ + + ], + "60": [ + + ], + "61": [ + + ], + "62": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "bcf": [ + + ], + "beagle_gl": [ + + ], + "beagle_pl": [ + + ], + "diff_discd_matrix": [ + + ], + "diff_indv": [ + + ], + "diff_indv_in_files": [ + + ], + "diff_sites": [ + + ], + "diff_sites_in_files": [ + + ], + "diff_switch_error": [ + + ], + "filter_summary": [ + + ], + "format": [ + + ], + "freq_burden": [ + + ], + "frq": [ + + ], + "frq_count": [ + + ], + "gdepth": [ + + ], + "geno_chisq": [ + + ], + "geno_ld": [ + + ], + "genotypes_matrix": [ + + ], + "genotypes_matrix_individual": [ + + ], + "genotypes_matrix_position": [ + + ], + "hap_ld": [ + + ], + "hapcount": [ + + ], + "heterozygosity": [ + + ], + "hwe": [ + + ], + "idepth": [ + + ], + "impute_hap": [ + + ], + "impute_hap_indv": [ + + ], + "impute_hap_legend": [ + + ], + "indel_hist": [ + + ], + "info": [ + + ], + "interchrom_geno_ld": [ + + ], + "interchrom_hap_ld": [ + + ], + "kept_sites": [ + + ], + "ldepth": [ + + ], + "ldepth_mean": [ + + ], + "ldhat_locs": [ + + ], + "ldhat_sites": [ + + ], + "list_geno_ld": [ + + ], + "list_hap_ld": [ + + ], + "lqual": [ + + ], + "lroh": [ + + ], + "map_": [ + + ], + "mendel": [ + + ], + "missing_individual": [ + + ], + "missing_site": [ + + ], + "ped": [ + + ], + "relatedness": [ + + ], + "relatedness2": [ + + ], + "removed_sites": [ + + ], + "singeltons": [ + + ], + "sites_pi": [ + + ], + "snp_density": [ + + ], + "tajima_d": [ + + ], + "tfam": [ + + ], + "tped": [ + + ], + "tstv": [ + + ], + "tstv_count": [ + + ], + "tstv_qual": [ + + ], + "tstv_summary": [ + + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "weir_fst": [ + + ], + "windowed_pi": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T13:07:31.866838" + } +} \ No newline at end of file diff --git a/modules/nf-core/vcftools/tests/tags.yml b/modules/nf-core/vcftools/tests/tags.yml new file mode 100644 index 0000000000..f3afd43664 --- /dev/null +++ b/modules/nf-core/vcftools/tests/tags.yml @@ -0,0 +1,2 @@ +vcftools: + - "modules/nf-core/vcftools/**" diff --git a/nextflow.config b/nextflow.config index cc1bdcbd4d..a5526b67ce 100644 --- a/nextflow.config +++ b/nextflow.config @@ -10,8 +10,9 @@ params { // Workflow flags: // Mandatory arguments - input = null // No default input - step = 'mapping' // Starts with mapping + input = null // No default input + input_restart = null // No default automatic input + step = 'mapping' // Starts with mapping // References genome = 'GATK.GRCh38' @@ -77,26 +78,26 @@ params { wes = false // Set to true, if data is exome/targeted sequencing data. Used to use correct models in various variant callers // Annotation - bcftools_annotations = null // No extra annotation file - bcftools_annotations_index = null // No extra annotation file index - bcftools_header_lines = null // No header lines to be added to the VCF file - dbnsfp = null // No dbnsfp processed file - dbnsfp_consequence = null // No default consequence for dbnsfp plugin - dbnsfp_fields = "rs_dbSNP,HGVSc_VEP,HGVSp_VEP,1000Gp3_EAS_AF,1000Gp3_AMR_AF,LRT_score,GERP++_RS,gnomAD_exomes_AF" // Default fields for dbnsfp plugin - dbnsfp_tbi = null // No dbnsfp processed file index - outdir_cache = null // No default outdir cache - spliceai_indel = null // No spliceai_indel file - spliceai_indel_tbi = null // No spliceai_indel file index - spliceai_snv = null // No spliceai_snv file - spliceai_snv_tbi = null // No spliceai_snv file index - vep_custom_args = "--everything --filter_common --per_gene --total_length --offline --format vcf" // Default arguments for VEP - vep_dbnsfp = null // dbnsfp plugin disabled within VEP - vep_include_fasta = false // Don't use fasta file for annotation with VEP - vep_loftee = null // loftee plugin disabled within VEP - vep_out_format = "vcf" - vep_spliceai = null // spliceai plugin disabled within VEP - vep_spliceregion = null // spliceregion plugin disabled within VEP - vep_version = "110.0-0" // Should be updated when we update VEP, needs this to get full path to some plugins + bcftools_annotations = null // No extra annotation file + bcftools_annotations_tbi = null // No extra annotation file index + bcftools_header_lines = null // No header lines to be added to the VCF file + dbnsfp = null // No dbnsfp processed file + dbnsfp_consequence = null // No default consequence for dbnsfp plugin + dbnsfp_fields = "rs_dbSNP,HGVSc_VEP,HGVSp_VEP,1000Gp3_EAS_AF,1000Gp3_AMR_AF,LRT_score,GERP++_RS,gnomAD_exomes_AF" // Default fields for dbnsfp plugin + dbnsfp_tbi = null // No dbnsfp processed file index + outdir_cache = null // No default outdir cache + spliceai_indel = null // No spliceai_indel file + spliceai_indel_tbi = null // No spliceai_indel file index + spliceai_snv = null // No spliceai_snv file + spliceai_snv_tbi = null // No spliceai_snv file index + vep_custom_args = "--everything --filter_common --per_gene --total_length --offline --format vcf" // Default arguments for VEP + vep_dbnsfp = null // dbnsfp plugin disabled within VEP + vep_include_fasta = false // Don't use fasta file for annotation with VEP + vep_loftee = null // loftee plugin disabled within VEP + vep_out_format = "vcf" + vep_spliceai = null // spliceai plugin disabled within VEP + vep_spliceregion = null // spliceregion plugin disabled within VEP + vep_version = "111.0-0" // Should be updated when we update VEP, needs this to get full path to some plugins // MultiQC options multiqc_config = null @@ -124,6 +125,7 @@ params { config_profile_contact = null config_profile_url = null test_data_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/sarek3' + modules_testdata_base_path = null // Max resource options // Defaults only, expecting to be overwritten @@ -134,7 +136,7 @@ params { // Schema validation default options validationFailUnrecognisedParams = false validationLenientMode = true - validationSchemaIgnoreParams = 'cf_ploidy,genomes,igenomes_base' + validationSchemaIgnoreParams = 'cf_ploidy,snpeff_db,vep_cache_version,genomes,igenomes_base' validationShowHiddenParams = false validate_params = true } @@ -161,11 +163,14 @@ profiles { cleanup = false dumpHashes = true process.beforeScript = 'echo $HOSTNAME' + cleanup = false + nextflow.enable.configProcessNamesValidation = true } conda { apptainer.enabled = false charliecloud.enabled = false conda.enabled = true + channels = ['conda-forge', 'bioconda', 'defaults'] docker.enabled = false podman.enabled = false shifter.enabled = false @@ -183,17 +188,17 @@ profiles { singularity.enabled = false } docker { - apptainer.enabled = false - charliecloud.enabled = false - conda.enabled = false - docker.enabled = true - docker.userEmulation = { params.use_gatk_spark ? false : true }.call() - podman.enabled = false - shifter.enabled = false - singularity.enabled = false + apptainer.enabled = false + charliecloud.enabled = false + conda.enabled = false + docker.enabled = true + podman.enabled = false + shifter.enabled = false + docker.runOptions = '-u $(id -u):$(id -g)' + singularity.enabled = false } arm { - docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' + docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' } singularity { apptainer.enabled = false @@ -249,10 +254,42 @@ profiles { } // Basic test profile for CI test { includeConfig 'conf/test.config' } + test_aws { + includeConfig 'conf/test.config' + params.sentieon_dnascope_model = "s3://ngi-igenomes/igenomes/Homo_sapiens/GATK/GRCh38/Annotation/Sentieon/SentieonDNAscopeModel1.1.model" + } + test_azure { + includeConfig 'conf/test.config' + params.sentieon_dnascope_model = "az://igenomes/Homo_sapiens/GATK/GRCh38/Annotation/Sentieon/SentieonDNAscopeModel1.1.model" + } test_cache { includeConfig 'conf/test/cache.config' } // Extra test profiles for full tests on AWS test_full { includeConfig 'conf/test_full.config' } + test_full_aws { + includeConfig 'conf/test_full.config' + } + test_full_azure { + includeConfig 'conf/test_full.config' + params.input = 'https://raw.githubusercontent.com/nf-core/test-datasets/sarek/testdata/csv/HCC1395_WXS_somatic_full_test_azure.csv' + params.intervals = 'az://test-data/sarek/S07604624_Padded_Agilent_SureSelectXT_allexons_V6_UTR.bed' + params.igenomes_base = "az://igenomes" + } test_full_germline { includeConfig 'conf/test_full_germline.config' } + test_full_germline_aws { + includeConfig 'conf/test_full_germline.config' + } + test_full_germline_azure { + includeConfig 'conf/test_full_germline.config' + params.input = 'https://raw.githubusercontent.com/nf-core/test-datasets/sarek/testdata/csv/NA12878_WGS_30x_full_test_azure.csv' + params.igenomes_base = "az://igenomes" + } + test_full_germline_ncbench_agilent { + includeConfig 'conf/test_full_germline_ncbench_agilent.config' + } + spark { + docker.runOptions = '' + } + // Extra test profiles for more complete CI alignment_to_fastq { includeConfig 'conf/test/alignment_to_fastq.config' } annotation { includeConfig 'conf/test/annotation.config' } @@ -292,8 +329,8 @@ singularity.registry = 'quay.io' // Nextflow plugins plugins { - id 'nf-validation' // Validation of pipeline parameters and creation of an input channel from a sample sheet - id 'nf-prov' // Provenance reports for pipeline runs + id 'nf-validation@1.1.3' // Validation of pipeline parameters and creation of an input channel from a sample sheet + id 'nf-prov' // Provenance reports for pipeline runs } // Load igenomes.config if required @@ -317,6 +354,9 @@ env { // Capture exit codes from upstream processes when piping process.shell = ['/bin/bash', '-euo', 'pipefail'] +// Disable process selector warnings by default. Use debug profile to enable warnings. +nextflow.enable.configProcessNamesValidation = false + def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss') timeline { enabled = true @@ -350,7 +390,7 @@ manifest { description = """An open-source analysis pipeline to detect germline or somatic variants from whole genome or targeted sequencing""" mainScript = 'main.nf' nextflowVersion = '!>=23.04.0' - version = '3.4.0' + version = '3.4.1' doi = '10.12688/f1000research.16665.2, 10.1101/2023.07.19.549462, 10.5281/zenodo.3476425' } diff --git a/nextflow_schema.json b/nextflow_schema.json index f585103b28..0c58c57655 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -17,10 +17,10 @@ "description": "Path to comma-separated file containing information about the samples in the experiment.", "help_text": "A design file with information about the samples in your experiment. Use this parameter to specify the location of the input files. It has to be a comma-separated file with a header row. See [usage docs](https://nf-co.re/sarek/usage#input).\n\nIf no input file is specified, sarek will attempt to locate one in the `{outdir}` directory. If no input should be supplied, i.e. when --step is supplied or --build_from_index, then set --input false", "fa_icon": "fas fa-file-csv", - "schema": "assets/schema_input.json", "type": "string", "format": "file-path", "exists": true, + "schema": "assets/schema_input.json", "mimetype": "text/csv", "pattern": "^\\S+\\.csv$" }, @@ -65,11 +65,22 @@ "default": "", "properties": { "split_fastq": { + "oneOf": [ + { + "type": "integer", + "minimum": 250 + }, + { + "type": "integer", + "minimum": 0, + "maximum": 0 + } + ], "type": "integer", "default": 50000000, "fa_icon": "fas fa-clock", "description": "Specify how many reads each split of a FastQ file contains. Set 0 to turn off splitting at all.", - "help_text": "Use the the tool FastP to split FASTQ file by number of reads. This parallelizes across fastq file shards speeding up mapping. " + "help_text": "Use the the tool FastP to split FASTQ file by number of reads. This parallelizes across fastq file shards speeding up mapping. Note although the minimum value is 250 reads, if you have fewer than 250 reads a single FASTQ shard will still be created." }, "wes": { "type": "boolean", @@ -84,7 +95,7 @@ "description": "Path to target bed file in case of whole exome or targeted sequencing or intervals file." }, "nucleotides_per_second": { - "type": "number", + "type": "integer", "fa_icon": "fas fa-clock", "description": "Estimate interval size.", "help_text": "Intervals are parts of the chopped up genome used to speed up preprocessing and variant calling. See `--intervals` for more info. \n\nChanging this parameter, changes the number of intervals that are grouped and processed together. Bed files from target sequencing can contain thousands or small intervals. Spinning up a new process for each can be quite resource intensive. Instead it can be desired to process small intervals together on larger nodes. \nIn order to make use of this parameter, no runtime estimate can be present in the bed file (column 5). ", @@ -100,8 +111,7 @@ "type": "string", "fa_icon": "fas fa-toolbox", "description": "Tools to use for duplicate marking, variant calling and/or for annotation.", - "help_text": "Multiple tools separated with commas.\n\n**Variant Calling:**\n\nGermline variant calling can currently be performed with the following variant callers:\n- SNPs/Indels: DeepVariant, FreeBayes, GATK HaplotypeCaller, mpileup, Sentieon Haplotyper, Strelka\n- Structural Variants: Manta, TIDDIT\n- Copy-number: CNVKit\n\nTumor-only somatic variant calling can currently be performed with the following variant callers:\n- SNPs/Indels: FreeBayes, mpileup, Mutect2, Strelka\n- Structural Variants: Manta, TIDDIT\n- Copy-number: CNVKit, ControlFREEC\n\nSomatic variant calling can currently only be performed with the following variant callers:\n- SNPs/Indels: FreeBayes, Mutect2, Strelka2\n- Structural variants: Manta, TIDDIT\n- Copy-Number: ASCAT, CNVKit, Control-FREEC\n- Microsatellite Instability: MSIsensorpro\n\n> **NB** Mutect2 for somatic variant calling cannot be combined with `--no_intervals`\n\n**Annotation:**\n \n- snpEff, VEP, merge (both consecutively).\n\n> **NB** As Sarek will use bgzip and tabix to compress and index VCF files annotated, it expects VCF files to be sorted when starting from `--step annotate`.", - + "help_text": "Multiple tools separated with commas.\n\n**Variant Calling:**\n\nGermline variant calling can currently be performed with the following variant callers:\n- SNPs/Indels: DeepVariant, FreeBayes, GATK HaplotypeCaller, mpileup, Sentieon Haplotyper, Strelka\n- Structural Variants: Manta, TIDDIT\n- Copy-number: CNVKit\n\nTumor-only somatic variant calling can currently be performed with the following variant callers:\n- SNPs/Indels: FreeBayes, mpileup, Mutect2, Strelka\n- Structural Variants: Manta, TIDDIT\n- Copy-number: CNVKit, ControlFREEC\n\nSomatic variant calling can currently only be performed with the following variant callers:\n- SNPs/Indels: FreeBayes, Mutect2, Strelka2\n- Structural variants: Manta, TIDDIT\n- Copy-Number: ASCAT, CNVKit, Control-FREEC\n- Microsatellite Instability: MSIsensorpro\n\n> **NB** Mutect2 for somatic variant calling cannot be combined with `--no_intervals`\n\n**Annotation:**\n \n- snpEff, VEP, merge (both consecutively), and bcftools annotate (needs `--bcftools_annotation`).\n\n> **NB** As Sarek will use bgzip and tabix to compress and index VCF files annotated, it expects VCF files to be sorted when starting from `--step annotate`.", "pattern": "^((ascat|bcfann|cnvkit|controlfreec|deepvariant|freebayes|haplotypecaller|sentieon_dnascope|sentieon_haplotyper|manta|merge|mpileup|msisensorpro|mutect2|ngscheckmate|sentieon_dedup|snpeff|strelka|tiddit|vep)?,?)*(? [ meta + [ num_intervals:num_intervals ], cram, crai, recal, intervals ] } // RUN APPLYBQSR - GATK4_APPLYBQSR(cram_intervals, fasta, fasta_fai, dict.map{ meta, it -> [ it ] }) + GATK4_APPLYBQSR(cram_intervals, fasta.map{ meta, it -> [ it ] }, fasta_fai.map{ meta, it -> [ it ] }, dict.map{ meta, it -> [ it ] }) // Gather the recalibrated cram files cram_to_merge = GATK4_APPLYBQSR.out.cram.map{ meta, cram -> [ groupKey(meta, meta.num_intervals), cram ] }.groupTuple() // Merge and index the recalibrated cram files - CRAM_MERGE_INDEX_SAMTOOLS(cram_to_merge, fasta, fasta_fai) + CRAM_MERGE_INDEX_SAMTOOLS(cram_to_merge, fasta.map{ meta, it -> [ it ] }, fasta_fai.map{ meta, it -> [ it ] }) cram_recal = CRAM_MERGE_INDEX_SAMTOOLS.out.cram_crai // Remove no longer necessary field: num_intervals diff --git a/subworkflows/local/bam_applybqsr_spark/main.nf b/subworkflows/local/bam_applybqsr_spark/main.nf index cfb86ef6a4..3b75fa74bc 100644 --- a/subworkflows/local/bam_applybqsr_spark/main.nf +++ b/subworkflows/local/bam_applybqsr_spark/main.nf @@ -24,13 +24,13 @@ workflow BAM_APPLYBQSR_SPARK { .map{ meta, cram, crai, recal, intervals, num_intervals -> [ meta + [ num_intervals:num_intervals ], cram, crai, recal, intervals ] } // RUN APPLYBQSR SPARK - GATK4SPARK_APPLYBQSR(cram_intervals, fasta, fasta_fai, dict.map{ meta, it -> [ it ] }) + GATK4SPARK_APPLYBQSR(cram_intervals, fasta.map{ meta, it -> [ it ] }, fasta_fai.map{ meta, it -> [ it ] }, dict.map{ meta, it -> [ it ] }) // Gather the recalibrated cram files cram_to_merge = GATK4SPARK_APPLYBQSR.out.cram.map{ meta, cram -> [ groupKey(meta, meta.num_intervals), cram ] }.groupTuple() // Merge and index the recalibrated cram files - CRAM_MERGE_INDEX_SAMTOOLS(cram_to_merge, fasta, fasta_fai) + CRAM_MERGE_INDEX_SAMTOOLS(cram_to_merge, fasta.map{ meta, it -> [ it ] }, fasta_fai.map{ meta, it -> [ it ] }) cram_recal = CRAM_MERGE_INDEX_SAMTOOLS.out.cram_crai // Remove no longer necessary field: num_intervals diff --git a/subworkflows/local/bam_baserecalibrator/main.nf b/subworkflows/local/bam_baserecalibrator/main.nf index 198b96e4ea..285ad6b856 100644 --- a/subworkflows/local/bam_baserecalibrator/main.nf +++ b/subworkflows/local/bam_baserecalibrator/main.nf @@ -26,7 +26,7 @@ workflow BAM_BASERECALIBRATOR { .map{ meta, cram, crai, intervals, num_intervals -> [ meta + [ num_intervals:num_intervals ], cram, crai, intervals ] } // RUN BASERECALIBRATOR - GATK4_BASERECALIBRATOR(cram_intervals, fasta, fasta_fai, dict.map{ meta, it -> [ it ] }, known_sites, known_sites_tbi) + GATK4_BASERECALIBRATOR(cram_intervals, fasta.map{ meta, it -> [ it ] }, fasta_fai.map{ meta, it -> [ it ] }, dict.map{ meta, it -> [ it ] }, known_sites, known_sites_tbi) // Figuring out if there is one or more table(s) from the same sample table_to_merge = GATK4_BASERECALIBRATOR.out.table.map{ meta, table -> [ groupKey(meta, meta.num_intervals), table ] }.groupTuple().branch{ diff --git a/subworkflows/local/bam_baserecalibrator_spark/main.nf b/subworkflows/local/bam_baserecalibrator_spark/main.nf index d6e12c39e0..c31b1aa383 100644 --- a/subworkflows/local/bam_baserecalibrator_spark/main.nf +++ b/subworkflows/local/bam_baserecalibrator_spark/main.nf @@ -26,7 +26,7 @@ workflow BAM_BASERECALIBRATOR_SPARK { .map{ meta, cram, crai, intervals, num_intervals -> [ meta + [ num_intervals:num_intervals ], cram, crai, intervals ] } // RUN BASERECALIBRATOR SPARK - GATK4SPARK_BASERECALIBRATOR(cram_intervals, fasta, fasta_fai, dict.map{ meta, it -> [ it ] }, known_sites, known_sites_tbi) + GATK4SPARK_BASERECALIBRATOR(cram_intervals, fasta.map{ meta, it -> [ it ] }, fasta_fai.map{ meta, it -> [ it ] }, dict.map{ meta, it -> [ it ] }, known_sites, known_sites_tbi) // Figuring out if there is one or more table(s) from the same sample table_to_merge = GATK4SPARK_BASERECALIBRATOR.out.table.map{ meta, table -> [ groupKey(meta, meta.num_intervals), table ] }.groupTuple().branch{ diff --git a/subworkflows/local/bam_joint_calling_germline_gatk/main.nf b/subworkflows/local/bam_joint_calling_germline_gatk/main.nf index f0d9148c07..4d030ba5c5 100644 --- a/subworkflows/local/bam_joint_calling_germline_gatk/main.nf +++ b/subworkflows/local/bam_joint_calling_germline_gatk/main.nf @@ -37,7 +37,7 @@ workflow BAM_JOINT_CALLING_GERMLINE_GATK { // Rename based on num_intervals, group all samples by their interval_name/interval_file and restructure for channel // Group by [0, 3] to avoid a list of metas and make sure that any intervals gendb_input = input - .map{ meta, gvcf, tbi, intervals -> [ [ id:'joint_variant_calling', intervals_name:intervals.simpleName, num_intervals:meta.num_intervals ], gvcf, tbi, intervals ] } + .map{ meta, gvcf, tbi, intervals -> [ [ id:'joint_variant_calling', intervals_name:intervals.baseName, num_intervals:meta.num_intervals ], gvcf, tbi, intervals ] } .groupTuple(by:3) //join on interval file .map{ meta_list, gvcf, tbi, intervals -> // meta is now a list of [meta1, meta2] but they are all the same. So take the first element. @@ -52,7 +52,7 @@ workflow BAM_JOINT_CALLING_GERMLINE_GATK { // Joint genotyping performed using GenotypeGVCFs // Sort vcfs called by interval within each VCF - GATK4_GENOTYPEGVCFS(genotype_input, fasta, fai, dict.map{ meta, dict -> [ dict ] }, dbsnp, dbsnp_tbi) + GATK4_GENOTYPEGVCFS(genotype_input, fasta.map{ meta, fasta -> [ fasta ] }, fai.map{ meta, fai -> [ fai ] }, dict.map{ meta, dict -> [ dict ] }, dbsnp, dbsnp_tbi) BCFTOOLS_SORT(GATK4_GENOTYPEGVCFS.out.vcf) gvcf_to_merge = BCFTOOLS_SORT.out.vcf.map{ meta, vcf -> [ meta.subMap('num_intervals') + [ id:'joint_variant_calling', patient:'all_samples', variantcaller:'haplotypecaller' ], vcf ]}.groupTuple() @@ -71,8 +71,8 @@ workflow BAM_JOINT_CALLING_GERMLINE_GATK { resource_indels_vcf, resource_indels_tbi, indels_resource_label, - fasta, - fai, + fasta.map{ meta, fasta -> [ fasta ] }, + fai.map{ meta, fai -> [ fai ] }, dict.map{ meta, dict -> [ dict ] }) VARIANTRECALIBRATOR_SNP( @@ -80,8 +80,8 @@ workflow BAM_JOINT_CALLING_GERMLINE_GATK { resource_snps_vcf, resource_snps_tbi, snps_resource_label, - fasta, - fai, + fasta.map{ meta, fasta -> [ fasta ] }, + fai.map{ meta, fai -> [ fai ] }, dict.map{ meta, dict -> [ dict ] }) //Prepare SNPs and INDELs for ApplyVQSR @@ -97,8 +97,8 @@ workflow BAM_JOINT_CALLING_GERMLINE_GATK { GATK4_APPLYVQSR_SNP( vqsr_input_snp, - fasta, - fai, + fasta.map{ meta, fasta -> [ fasta ] }, + fai.map{ meta, fai -> [ fai ] }, dict.map{ meta, dict -> [ dict ] }) // Join results of ApplyVQSR_SNP and use as input for Indels to avoid duplicate entries in the result @@ -111,8 +111,8 @@ workflow BAM_JOINT_CALLING_GERMLINE_GATK { GATK4_APPLYVQSR_INDEL( vqsr_input_indel, - fasta, - fai, + fasta.map{ meta, fasta -> [ fasta ] }, + fai.map{ meta, fai -> [ fai ] }, dict.map{ meta, dict -> [ dict ] }) diff --git a/subworkflows/local/bam_joint_calling_germline_sentieon/main.nf b/subworkflows/local/bam_joint_calling_germline_sentieon/main.nf index 3f19b33d52..23d0d8675a 100644 --- a/subworkflows/local/bam_joint_calling_germline_sentieon/main.nf +++ b/subworkflows/local/bam_joint_calling_germline_sentieon/main.nf @@ -33,10 +33,10 @@ workflow BAM_JOINT_CALLING_GERMLINE_SENTIEON { versions = Channel.empty() sentieon_input = input - .map{ meta, gvcf, tbi, intervals -> [ [ id:'joint_variant_calling', intervals_name:intervals.simpleName, num_intervals:meta.num_intervals ], gvcf, tbi, intervals ] } + .map{ meta, gvcf, tbi, intervals -> [ [ id:'joint_variant_calling', intervals_name:intervals.baseName, num_intervals:meta.num_intervals ], gvcf, tbi, intervals ] } .groupTuple(by:[0, 3]) - SENTIEON_GVCFTYPER(sentieon_input, fasta, fai, dbsnp, dbsnp_tbi) + SENTIEON_GVCFTYPER(sentieon_input, fasta.map{meta, it -> [ it ]}, fai.map{meta, it -> [ it ]}, dbsnp, dbsnp_tbi) BCFTOOLS_SORT(SENTIEON_GVCFTYPER.out.vcf_gz) @@ -68,16 +68,16 @@ workflow BAM_JOINT_CALLING_GERMLINE_SENTIEON { resource_indels_vcf, resource_indels_tbi, indels_resource_label, - fasta, - fai) + fasta.map{meta, it -> [ it ]}, + fai.map{meta, it -> [ it ]}) SENTIEON_VARCAL_SNP( vqsr_input, resource_snps_vcf, resource_snps_tbi, snps_resource_label, - fasta, - fai) + fasta.map{meta, it -> [ it ]}, + fai.map{meta, it -> [ it ]}) //Prepare SNPs and INDELs for Sentieon's applyvarcal // Step 1. : applyvarcal to SNPs @@ -90,10 +90,7 @@ workflow BAM_JOINT_CALLING_GERMLINE_SENTIEON { .join(SENTIEON_VARCAL_SNP.out.tranches, failOnDuplicate: true) .map{ meta, vcf, tbi, recal, index, tranche -> [ meta + [ id:'recalibrated_joint_variant_calling' ], vcf, tbi, recal, index, tranche ] } - SENTIEON_APPLYVARCAL_SNP( - vqsr_input_snp, - fasta.map{ fasta -> [ [ id:fasta.baseName ], fasta ] }, - fai.map{ fai -> [ [ id:fai.baseName ], fai ] }) + SENTIEON_APPLYVARCAL_SNP(vqsr_input_snp, fasta, fai) // Join results of SENTIEON_APPLYVARCAL_SNP and use as input for SENTIEON_APPLYVARCAL_INDEL to avoid duplicate entries in the result // Rework meta for variantscalled.csv and annotation tools @@ -103,10 +100,7 @@ workflow BAM_JOINT_CALLING_GERMLINE_SENTIEON { .join(SENTIEON_VARCAL_INDEL.out.tranches, failOnDuplicate: true) .map{ meta, vcf, tbi, recal, index, tranche -> [ meta + [ id:'recalibrated_joint_variant_calling' ], vcf, tbi, recal, index, tranche ] } - SENTIEON_APPLYVARCAL_INDEL( - vqsr_input_indel, - fasta.map{ fasta -> [ [ id:fasta.baseName ], fasta ] }, - fai.map{ fai -> [ [ id:fai.baseName ], fai ] }) + SENTIEON_APPLYVARCAL_INDEL(vqsr_input_indel, fasta, fai) // The following is an ugly monster to achieve the following: // When MERGE_GENOTYPEGVCFS and SENTIEON_APPLYVARCAL are run, then use output from SENTIEON_APPLYVARCAL diff --git a/subworkflows/local/bam_markduplicates/main.nf b/subworkflows/local/bam_markduplicates/main.nf index b1084f9ce4..9c6f15e0fc 100644 --- a/subworkflows/local/bam_markduplicates/main.nf +++ b/subworkflows/local/bam_markduplicates/main.nf @@ -19,7 +19,7 @@ workflow BAM_MARKDUPLICATES { reports = Channel.empty() // RUN MARKUPDUPLICATES - GATK4_MARKDUPLICATES(bam, fasta, fasta_fai) + GATK4_MARKDUPLICATES(bam, fasta.map{ meta, fasta -> [ fasta ] }, fasta_fai.map{ meta, fasta_fai -> [ fasta_fai ] }) // Join with the crai file cram = GATK4_MARKDUPLICATES.out.cram.join(GATK4_MARKDUPLICATES.out.crai, failOnDuplicate: true, failOnMismatch: true) diff --git a/subworkflows/local/bam_markduplicates_spark/main.nf b/subworkflows/local/bam_markduplicates_spark/main.nf index 8e7d0ee023..75d57b6743 100644 --- a/subworkflows/local/bam_markduplicates_spark/main.nf +++ b/subworkflows/local/bam_markduplicates_spark/main.nf @@ -22,7 +22,7 @@ workflow BAM_MARKDUPLICATES_SPARK { reports = Channel.empty() // RUN MARKUPDUPLICATES SPARK - GATK4SPARK_MARKDUPLICATES(bam, fasta, fasta_fai, dict) + GATK4SPARK_MARKDUPLICATES(bam, fasta.map{ meta, fasta -> [ fasta ] }, fasta_fai.map{ meta, fasta_fai -> [ fasta_fai ] }, dict.map{ meta, dict -> [ dict ] }) // Index cram INDEX_MARKDUPLICATES(GATK4SPARK_MARKDUPLICATES.out.output) @@ -34,7 +34,7 @@ workflow BAM_MARKDUPLICATES_SPARK { CRAM_QC_MOSDEPTH_SAMTOOLS(cram, fasta, intervals_bed_combined) // When running Marduplicates spark, and saving reports - GATK4_ESTIMATELIBRARYCOMPLEXITY(bam, fasta, fasta_fai, dict) + GATK4_ESTIMATELIBRARYCOMPLEXITY(bam, fasta.map{ meta, fasta -> [ fasta ] }, fasta_fai.map{ meta, fasta_fai -> [ fasta_fai ] }, dict.map{ meta, dict -> [ dict ] }) // Gather all reports generated reports = reports.mix(GATK4_ESTIMATELIBRARYCOMPLEXITY.out.metrics) diff --git a/subworkflows/local/bam_sentieon_dedup/main.nf b/subworkflows/local/bam_sentieon_dedup/main.nf index b75ba00cbc..91e531438e 100644 --- a/subworkflows/local/bam_sentieon_dedup/main.nf +++ b/subworkflows/local/bam_sentieon_dedup/main.nf @@ -19,7 +19,7 @@ workflow BAM_SENTIEON_DEDUP { bam = bam.map{ meta, bam -> [ meta - meta.subMap('data_type'), bam ] } bai = bai.map{ meta, bai -> [ meta - meta.subMap('data_type'), bai ] } bam_bai = bam.join(bai, failOnMismatch:true, failOnDuplicate:true) - SENTIEON_DEDUP(bam_bai, fasta.map{fa -> [[:], fa]}, fasta_fai.map{fai -> [[:], fai]}) + SENTIEON_DEDUP(bam_bai, fasta, fasta_fai) // Join with the crai file cram = SENTIEON_DEDUP.out.cram.join(SENTIEON_DEDUP.out.crai, failOnDuplicate: true, failOnMismatch: true) diff --git a/subworkflows/local/bam_variant_calling_deepvariant/main.nf b/subworkflows/local/bam_variant_calling_deepvariant/main.nf index 5c25f24114..feb7c33c08 100644 --- a/subworkflows/local/bam_variant_calling_deepvariant/main.nf +++ b/subworkflows/local/bam_variant_calling_deepvariant/main.nf @@ -25,7 +25,7 @@ workflow BAM_VARIANT_CALLING_DEEPVARIANT { // Move num_intervals to meta map .map{ meta, cram, crai, intervals, num_intervals -> [ meta + [ num_intervals:num_intervals ], cram, crai, intervals ]} - DEEPVARIANT(cram_intervals, fasta.map{ fasta -> [ [ id:fasta.baseName ], fasta ] }, fasta_fai.map{ fasta_fai -> [ [ id:fasta_fai.baseName ], fasta_fai ] }, [ [ id:'null' ], [] ]) + DEEPVARIANT(cram_intervals, fasta, fasta_fai, [ [ id:'null' ], [] ]) // Figuring out if there is one or more vcf(s) from the same sample vcf_out = DEEPVARIANT.out.vcf.branch{ diff --git a/subworkflows/local/bam_variant_calling_freebayes/main.nf b/subworkflows/local/bam_variant_calling_freebayes/main.nf index 81538cd3e0..e196881349 100644 --- a/subworkflows/local/bam_variant_calling_freebayes/main.nf +++ b/subworkflows/local/bam_variant_calling_freebayes/main.nf @@ -13,8 +13,8 @@ workflow BAM_VARIANT_CALLING_FREEBAYES { take: cram // channel: [mandatory] [ meta, cram1, crai1, cram2, crai2 ] or [ meta, cram, crai, [], [] ] dict // channel: [mandatory] [ meta, dict ] - fasta // channel: [mandatory] [ fasta ] - fasta_fai // channel: [mandatory] [ fasta_fai ] + fasta // channel: [mandatory] [ meta, fasta ] + fasta_fai // channel: [mandatory] [ meta, fasta_fai ] intervals // channel: [mandatory] [ intervals, num_intervals ] or [ [], 0 ] if no intervals main: @@ -25,7 +25,7 @@ workflow BAM_VARIANT_CALLING_FREEBAYES { // Move num_intervals to meta map and reorganize channel for FREEBAYES module .map{ meta, cram1, crai1, cram2, crai2, intervals, num_intervals -> [ meta + [ num_intervals:num_intervals ], cram1, crai1, cram2, crai2, intervals ]} - FREEBAYES(cram_intervals, fasta, fasta_fai, [], [], []) + FREEBAYES(cram_intervals, fasta, fasta_fai, [[id:'null'], []], [[id:'null'], []], [[id:'null'], []]) BCFTOOLS_SORT(FREEBAYES.out.vcf) diff --git a/subworkflows/local/bam_variant_calling_germline_all/main.nf b/subworkflows/local/bam_variant_calling_germline_all/main.nf index 1f751c2263..79efd8bf94 100644 --- a/subworkflows/local/bam_variant_calling_germline_all/main.nf +++ b/subworkflows/local/bam_variant_calling_germline_all/main.nf @@ -24,14 +24,14 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL { take: tools // Mandatory, list of tools to apply skip_tools // Mandatory, list of tools to skip - cram // channel: [mandatory] cram - bwa // channel: [mandatory] bwa - dbsnp // channel: [mandatory] dbsnp + cram // channel: [mandatory] meta, cram + bwa // channel: [mandatory] meta, bwa + dbsnp // channel: [mandatory] meta, dbsnp dbsnp_tbi // channel: [mandatory] dbsnp_tbi dbsnp_vqsr - dict // channel: [mandatory] dict - fasta // channel: [mandatory] fasta - fasta_fai // channel: [mandatory] fasta_fai + dict // channel: [mandatory] meta, dict + fasta // channel: [mandatory] meta, fasta + fasta_fai // channel: [mandatory] meta, fasta_fai intervals // channel: [mandatory] [ intervals, num_intervals ] or [ [], 0 ] if no intervals intervals_bed_combined // channel: [mandatory] intervals/target regions in one file unzipped intervals_bed_gz_tbi_combined // channel: [mandatory] intervals/target regions in one file zipped @@ -84,8 +84,8 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL { BAM_VARIANT_CALLING_CNVKIT( // Remap channel to match module/subworkflow cram.map{ meta, cram, crai -> [ meta, [], cram ] }, - fasta.map{ it -> [[id:it[0].baseName], it] }, - fasta_fai.map{ it -> [[id:it[0].baseName], it] }, + fasta, + fasta_fai, intervals_bed_combined.map{ it -> [[id:it[0].baseName], it] }, [[id:"null"], []] ) @@ -129,9 +129,8 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL { fasta, fasta_fai, dict, - dbsnp, - dbsnp_tbi, - dbsnp_vqsr, + dbsnp.map{ it -> [[id:it[0].baseName], it] }, + dbsnp_tbi.map{ it -> [[id:it[0].baseName], it] }, intervals) vcf_haplotypecaller = BAM_VARIANT_CALLING_HAPLOTYPECALLER.out.vcf @@ -164,8 +163,8 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL { VCF_VARIANT_FILTERING_GATK( vcf_haplotypecaller.join(tbi_haplotypecaller, failOnDuplicate: true, failOnMismatch: true), - fasta, - fasta_fai, + fasta.map{ meta, fasta -> [ fasta ] }, + fasta_fai.map{ meta, fasta_fai -> [ fasta_fai ] }, dict.map{ meta, dict -> [ dict ] }, intervals_bed_combined_haplotypec, known_sites_indels.concat(known_sites_snps).flatten().unique().collect(), @@ -182,8 +181,8 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL { if (tools.split(',').contains('manta')) { BAM_VARIANT_CALLING_GERMLINE_MANTA ( cram, - fasta.map{ it -> [ [ id:'fasta' ], it ] }, - fasta_fai.map{ it -> [ [ id:'fasta_fai' ], it ] }, + fasta, + fasta_fai, intervals_bed_gz_tbi_combined ) @@ -239,8 +238,8 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL { SENTIEON_DNAMODELAPPLY( vcf_sentieon_dnascope.join(vcf_tbi_sentieon_dnascope, failOnDuplicate: true, failOnMismatch: true), - fasta.map{ fasta -> [ [ id:fasta.baseName ], fasta ] }, - fasta_fai.map{ fai -> [ [ id:fai.baseName ], fai ] }, + fasta, + fasta_fai, sentieon_dnascope_model.map{ model -> [ [ id:model.baseName ], model ] }) vcf_sentieon_dnascope = SENTIEON_DNAMODELAPPLY.out.vcf @@ -298,8 +297,8 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL { SENTIEON_HAPLOTYPER_VCF_VARIANT_FILTERING_GATK( vcf_sentieon_haplotyper.join(vcf_tbi_sentieon_haplotyper, failOnDuplicate: true, failOnMismatch: true), - fasta, - fasta_fai, + fasta.map{ meta, it -> [ it ] }, + fasta_fai.map{ meta, it -> [ it ] }, dict.map{ meta, dict -> [ dict ] }, intervals_bed_combined_haplotypec, known_sites_indels.concat(known_sites_snps).flatten().unique().collect(), @@ -313,12 +312,14 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL { } // STRELKA + if (tools.split(',').contains('strelka')) { + BAM_VARIANT_CALLING_SINGLE_STRELKA( cram, dict, - fasta, - fasta_fai, + fasta.map{ meta, fasta -> [ fasta ] }, + fasta_fai.map{ meta, fasta_fai -> [ fasta_fai ] }, intervals_bed_gz_tbi ) @@ -331,7 +332,7 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL { BAM_VARIANT_CALLING_SINGLE_TIDDIT( cram, // Remap channel to match module/subworkflow - fasta.map{ it -> [ [ id:'fasta' ], it ] }, + fasta, bwa ) diff --git a/subworkflows/local/bam_variant_calling_haplotypecaller/main.nf b/subworkflows/local/bam_variant_calling_haplotypecaller/main.nf index 1dbef4c613..72d80fd58e 100644 --- a/subworkflows/local/bam_variant_calling_haplotypecaller/main.nf +++ b/subworkflows/local/bam_variant_calling_haplotypecaller/main.nf @@ -16,7 +16,6 @@ workflow BAM_VARIANT_CALLING_HAPLOTYPECALLER { dict // channel: [mandatory] dbsnp // channel: [optional] dbsnp_tbi // channel: [optional] - dbsnp_vqsr // channel: [optional] intervals // channel: [mandatory] [ intervals, num_intervals ] or [ [], 0 ] if no intervals main: @@ -29,9 +28,15 @@ workflow BAM_VARIANT_CALLING_HAPLOTYPECALLER { cram_intervals = cram.combine(intervals) // Move num_intervals to meta map // Add interval_name to allow correct merging with interval files - .map{ meta, cram, crai, intervals, num_intervals -> [ meta + [ interval_name:intervals.simpleName, num_intervals:num_intervals, variantcaller:'haplotypecaller' ], cram, crai, intervals, [] ] } - - GATK4_HAPLOTYPECALLER(cram_intervals, fasta, fasta_fai, dict.map{ meta, dict -> [ dict ] }, dbsnp, dbsnp_tbi) + .map{ meta, cram, crai, intervals, num_intervals -> [ meta + [ interval_name:intervals.baseName, num_intervals:num_intervals, variantcaller:'haplotypecaller' ], cram, crai, intervals, [] ] } + + GATK4_HAPLOTYPECALLER( + cram_intervals, + fasta, + fasta_fai, + dict, + dbsnp, + dbsnp_tbi) // For joint genotyping gvcf_tbi_intervals = GATK4_HAPLOTYPECALLER.out.vcf diff --git a/subworkflows/local/bam_variant_calling_mpileup/main.nf b/subworkflows/local/bam_variant_calling_mpileup/main.nf index 663ed6a0bc..9a3929504d 100644 --- a/subworkflows/local/bam_variant_calling_mpileup/main.nf +++ b/subworkflows/local/bam_variant_calling_mpileup/main.nf @@ -26,10 +26,10 @@ workflow BAM_VARIANT_CALLING_MPILEUP { // Run, if --tools mpileup keep_bcftools_mpileup = false - BCFTOOLS_MPILEUP(cram_intervals, fasta.map{ it -> [[id:it[0].baseName], it] }, keep_bcftools_mpileup) + BCFTOOLS_MPILEUP(cram_intervals, fasta, keep_bcftools_mpileup) //Only run, if --tools ControlFreec - SAMTOOLS_MPILEUP(cram_intervals, fasta) + SAMTOOLS_MPILEUP(cram_intervals, fasta.map{ meta, fasta -> [ fasta ] }) // Figuring out if there is one or more vcf(s) from the same sample vcf_mpileup = BCFTOOLS_MPILEUP.out.vcf.branch{ diff --git a/subworkflows/local/bam_variant_calling_sentieon_dnascope/main.nf b/subworkflows/local/bam_variant_calling_sentieon_dnascope/main.nf index 9eea9b2d61..7a2b3a6b5e 100644 --- a/subworkflows/local/bam_variant_calling_sentieon_dnascope/main.nf +++ b/subworkflows/local/bam_variant_calling_sentieon_dnascope/main.nf @@ -50,8 +50,8 @@ workflow BAM_VARIANT_CALLING_SENTIEON_DNASCOPE { SENTIEON_DNASCOPE( cram_intervals_for_sentieon, - fasta.map{it -> [[:], it]}, - fasta_fai.map{it -> [[:], it]}, + fasta, + fasta_fai, dbsnp.map{it -> [[:], it]}, dbsnp_tbi.map{it -> [[:], it]}, sentieon_dnascope_model.map{it -> [[:], it]}, diff --git a/subworkflows/local/bam_variant_calling_sentieon_haplotyper/main.nf b/subworkflows/local/bam_variant_calling_sentieon_haplotyper/main.nf index 4b280d271c..1f0d59e522 100644 --- a/subworkflows/local/bam_variant_calling_sentieon_haplotyper/main.nf +++ b/subworkflows/local/bam_variant_calling_sentieon_haplotyper/main.nf @@ -34,7 +34,7 @@ workflow BAM_VARIANT_CALLING_SENTIEON_HAPLOTYPER { .map{ meta, cram, crai, intervals, num_intervals -> [ meta + [ num_intervals:num_intervals, - intervals_name:intervals.simpleName, + intervals_name:intervals.baseName, variantcaller:'sentieon_haplotyper'], cram, crai, @@ -49,8 +49,8 @@ workflow BAM_VARIANT_CALLING_SENTIEON_HAPLOTYPER { SENTIEON_HAPLOTYPER( cram_intervals_for_sentieon, - fasta, - fasta_fai, + fasta.map{ meta, it -> it }, + fasta_fai.map{ meta, it -> it }, dbsnp, dbsnp_tbi, emit_vcf, diff --git a/subworkflows/local/bam_variant_calling_somatic_all/main.nf b/subworkflows/local/bam_variant_calling_somatic_all/main.nf index f561ea420c..cdfabfc3ac 100644 --- a/subworkflows/local/bam_variant_calling_somatic_all/main.nf +++ b/subworkflows/local/bam_variant_calling_somatic_all/main.nf @@ -59,8 +59,8 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { cram, allele_files, loci_files, - intervals_bed_combined, - fasta, + (wes ? intervals_bed_combined : []), // No intervals needed if not WES + fasta.map{ meta, fasta -> [ fasta ] }, gc_file, rt_file ) @@ -93,13 +93,13 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { // Remap channel to match module/subworkflow mpileup_pair = mpileup_normal.cross(mpileup_tumor).map{ normal, tumor -> [ normal[0], normal[1], tumor[1], [], [], [], [] ] } - length_file = cf_chrom_len ?: fasta_fai + length_file = cf_chrom_len ?: fasta_fai.map{ meta, fasta_fai -> [ fasta_fai ] } intervals_controlfreec = wes ? intervals_bed_combined : [] BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC( mpileup_pair, - fasta, + fasta.map{ meta, fasta -> [ fasta ] }, length_file, dbsnp, dbsnp_tbi, @@ -118,8 +118,8 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { BAM_VARIANT_CALLING_CNVKIT( // Remap channel to match module/subworkflow cram.map{ meta, normal_cram, normal_crai, tumor_cram, tumor_crai -> [ meta, tumor_cram, normal_cram ] }, - fasta.map{ it -> [[id:it[0].baseName], it] }, - fasta_fai.map{ it -> [[id:it[0].baseName], it] }, + fasta, + fasta_fai, intervals_bed_combined.map{ it -> [[id:it[0].baseName], it] }, [[id:"null"], []] ) @@ -145,8 +145,8 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { if (tools.split(',').contains('manta')) { BAM_VARIANT_CALLING_SOMATIC_MANTA( cram, - fasta.map{ it -> [ [ id:'fasta' ], it ] }, - fasta_fai.map{ it -> [ [ id:'fasta_fai' ], it ] }, + fasta, + fasta_fai, intervals_bed_gz_tbi_combined ) @@ -165,8 +165,8 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { cram_strelka, // Remap channel to match module/subworkflow dict, - fasta, - fasta_fai, + fasta.map{ meta, fasta -> [ fasta ] }, + fasta_fai.map{ meta, fasta_fai -> [ fasta_fai ] }, intervals_bed_gz_tbi ) @@ -176,7 +176,7 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { // MSISENSOR if (tools.split(',').contains('msisensorpro')) { - MSISENSORPRO_MSISOMATIC(cram.combine(intervals_bed_combined), fasta, msisensorpro_scan) + MSISENSORPRO_MSISOMATIC(cram.combine(intervals_bed_combined), fasta.map{ meta, fasta -> [ fasta ] }, msisensorpro_scan) versions = versions.mix(MSISENSORPRO_MSISOMATIC.out.versions) out_msisensorpro = out_msisensorpro.mix(MSISENSORPRO_MSISOMATIC.out.output_report) @@ -194,10 +194,8 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { [ meta + [ id:meta.patient ], [ normal_cram, tumor_cram ], [ normal_crai, tumor_crai ] ] : [ meta, [ normal_cram, tumor_cram ], [ normal_crai, tumor_crai ] ] }, - // Remap channel to match module/subworkflow - fasta.map{ it -> [ [ id:'fasta' ], it ] }, - // Remap channel to match module/subworkflow - fasta_fai.map{ it -> [ [ id:'fasta_fai' ], it ] }, + fasta, + fasta_fai, dict, germline_resource, germline_resource_tbi, @@ -218,9 +216,9 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ALL { cram.map{ meta, normal_cram, normal_crai, tumor_cram, tumor_crai -> [ meta, normal_cram, normal_crai ] }, // Remap channel to match module/subworkflow cram.map{ meta, normal_cram, normal_crai, tumor_cram, tumor_crai -> [ meta, tumor_cram, tumor_crai ] }, - // Remap channel to match module/subworkflow - fasta.map{ it -> [ [ id:'fasta' ], it ] }, + fasta, bwa) + vcf_tiddit = BAM_VARIANT_CALLING_SOMATIC_TIDDIT.out.vcf versions = versions.mix(BAM_VARIANT_CALLING_SOMATIC_TIDDIT.out.versions) } diff --git a/subworkflows/local/bam_variant_calling_somatic_ascat/main.nf b/subworkflows/local/bam_variant_calling_somatic_ascat/main.nf index 64f45508ab..22802cfb58 100644 --- a/subworkflows/local/bam_variant_calling_somatic_ascat/main.nf +++ b/subworkflows/local/bam_variant_calling_somatic_ascat/main.nf @@ -21,7 +21,6 @@ workflow BAM_VARIANT_CALLING_SOMATIC_ASCAT { ch_versions = Channel.empty() - if (!params.wes) intervals_bed = [] // No intervals needed if not WES ASCAT(cram_pair, allele_files, loci_files, intervals_bed, fasta, gc_file, rt_file) ch_versions = ch_versions.mix(ASCAT.out.versions) diff --git a/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf b/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf index a2e7e17cff..3be4da8e45 100644 --- a/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf +++ b/subworkflows/local/bam_variant_calling_somatic_controlfreec/main.nf @@ -8,7 +8,7 @@ include { CONTROLFREEC_FREEC as FREEC_SOMATIC } from '../../. include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../modules/nf-core/controlfreec/assesssignificance/main' include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../modules/nf-core/controlfreec/freec2bed/main' include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../modules/nf-core/controlfreec/freec2circos/main' -include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../modules/nf-core/controlfreec/makegraph/main' +include { CONTROLFREEC_MAKEGRAPH2 as MAKEGRAPH2 } from '../../../modules/nf-core/controlfreec/makegraph2/main' workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC { take: @@ -27,16 +27,39 @@ workflow BAM_VARIANT_CALLING_SOMATIC_CONTROLFREEC { FREEC_SOMATIC(controlfreec_input, fasta, fasta_fai, [], dbsnp, dbsnp_tbi, chr_files, mappability, intervals_bed, []) - ASSESS_SIGNIFICANCE(FREEC_SOMATIC.out.CNV.join(FREEC_SOMATIC.out.ratio, failOnDuplicate: true, failOnMismatch: true)) + //Filter the files that come out of freec somatic as ASSESS_SIGNIFICANCE only takes one cnv and one ratio file + //Creates empty channel if file is missing + cnv_files = FREEC_SOMATIC.out.CNV + .map{ meta, cnv -> + def tumor_file = cnv instanceof List ? cnv.find { it.toString().endsWith("gz_CNVs") } : cnv //only find if its a list, else it returns only the filename without the path + if (!tumor_file){ + error("CNVs tumor file not found for sample $meta.id") + } + [meta,tumor_file] + } + + ratio_files = FREEC_SOMATIC.out.ratio + .map{ meta, ratio -> + def tumor_file = ratio instanceof List ? ratio.find { it.toString().endsWith("gz_ratio.txt") } : ratio //same here as cnv + if (!tumor_file){ + error("Ratio tumor file not found for sample $meta.id") + } + [meta,tumor_file] + } + + //Join the pairs + assess_significance_input = cnv_files.join(ratio_files, failOnDuplicate: true, failOnMismatch: true) + + ASSESS_SIGNIFICANCE(assess_significance_input) FREEC2BED(FREEC_SOMATIC.out.ratio) FREEC2CIRCOS(FREEC_SOMATIC.out.ratio) - MAKEGRAPH(FREEC_SOMATIC.out.ratio.join(FREEC_SOMATIC.out.BAF, failOnDuplicate: true, failOnMismatch: true)) + MAKEGRAPH2(FREEC_SOMATIC.out.ratio.join(FREEC_SOMATIC.out.BAF, failOnDuplicate: true, failOnMismatch: true)) ch_versions = ch_versions.mix(FREEC_SOMATIC.out.versions) ch_versions = ch_versions.mix(ASSESS_SIGNIFICANCE.out.versions) ch_versions = ch_versions.mix(FREEC2BED.out.versions) ch_versions = ch_versions.mix(FREEC2CIRCOS.out.versions) - ch_versions = ch_versions.mix(MAKEGRAPH.out.versions) + ch_versions = ch_versions.mix(MAKEGRAPH2.out.versions) emit: versions = ch_versions diff --git a/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf index 31d968a245..59b14ed898 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf @@ -62,13 +62,13 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { // CONTROLFREEC (depends on MPILEUP) if (tools.split(',').contains('controlfreec')) { - length_file = cf_chrom_len ?: fasta_fai + length_file = cf_chrom_len ?: fasta_fai.map{ meta, fasta_fai -> [ fasta_fai ] } intervals_controlfreec = wes ? intervals_bed_combined : [] BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC( // Remap channel to match module/subworkflow BAM_VARIANT_CALLING_MPILEUP.out.mpileup.map{ meta, pileup_tumor -> [ meta, [], pileup_tumor, [], [], [], [] ] }, - fasta, + fasta.map{ meta, fasta -> [ fasta ] }, length_file, dbsnp, dbsnp_tbi, @@ -85,8 +85,8 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { BAM_VARIANT_CALLING_CNVKIT ( // Remap channel to match module/subworkflow cram.map{ meta, cram, crai -> [ meta, cram, [] ] }, - fasta.map{ it -> [[id:it[0].baseName], it] }, - fasta_fai.map{ it -> [[id:it[0].baseName], it] }, + fasta, + fasta_fai, [[id:"null"], []], cnvkit_reference.map{ it -> [[id:it[0].baseName], it] } ) @@ -119,10 +119,8 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { [ meta - meta.subMap('data_type', 'status') + [ id:meta.patient ], cram, crai ] : [ meta - meta.subMap('data_type', 'status'), cram, crai ] }, - // Remap channel to match module/subworkflow - fasta.map{ it -> [ [ id:'fasta' ], it ] }, - // Remap channel to match module/subworkflow - fasta_fai.map{ it -> [ [ id:'fasta_fai' ], it ] }, + fasta, + fasta_fai, dict, germline_resource, germline_resource_tbi, @@ -141,8 +139,8 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { BAM_VARIANT_CALLING_TUMOR_ONLY_MANTA( cram, // Remap channel to match module/subworkflow - fasta.map{ it -> [ [ id:'fasta' ], it ] }, - fasta_fai.map{ it -> [ [ id:'fasta_fai' ], it ] }, + fasta, + fasta_fai, intervals_bed_gz_tbi_combined ) @@ -156,8 +154,8 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { BAM_VARIANT_CALLING_SINGLE_STRELKA( cram, dict, - fasta, - fasta_fai, + fasta.map{ meta, fasta -> [ fasta ] }, + fasta_fai.map{ meta, fasta_fai -> [ fasta_fai ] }, intervals_bed_gz_tbi ) @@ -169,10 +167,8 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { if (tools.split(',').contains('tiddit')) { BAM_VARIANT_CALLING_SINGLE_TIDDIT( cram, - // Remap channel to match module/subworkflow - fasta.map{ it -> [ [ id:'fasta' ], it ] }, - bwa - ) + fasta, + bwa) vcf_tiddit = BAM_VARIANT_CALLING_SINGLE_TIDDIT.out.vcf versions = versions.mix(BAM_VARIANT_CALLING_SINGLE_TIDDIT.out.versions) diff --git a/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf index 993faf127c..e7178cbaa4 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_controlfreec/main.nf @@ -8,7 +8,7 @@ include { CONTROLFREEC_FREEC as FREEC_TUMORONLY } from '../../. include { CONTROLFREEC_ASSESSSIGNIFICANCE as ASSESS_SIGNIFICANCE } from '../../../modules/nf-core/controlfreec/assesssignificance/main' include { CONTROLFREEC_FREEC2BED as FREEC2BED } from '../../../modules/nf-core/controlfreec/freec2bed/main' include { CONTROLFREEC_FREEC2CIRCOS as FREEC2CIRCOS } from '../../../modules/nf-core/controlfreec/freec2circos/main' -include { CONTROLFREEC_MAKEGRAPH as MAKEGRAPH } from '../../../modules/nf-core/controlfreec/makegraph/main' +include { CONTROLFREEC_MAKEGRAPH2 as MAKEGRAPH2 } from '../../../modules/nf-core/controlfreec/makegraph2/main' workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC { take: @@ -30,13 +30,13 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_CONTROLFREEC { ASSESS_SIGNIFICANCE(FREEC_TUMORONLY.out.CNV.join(FREEC_TUMORONLY.out.ratio, failOnDuplicate: true, failOnMismatch: true)) FREEC2BED(FREEC_TUMORONLY.out.ratio) FREEC2CIRCOS(FREEC_TUMORONLY.out.ratio) - MAKEGRAPH(FREEC_TUMORONLY.out.ratio.join(FREEC_TUMORONLY.out.BAF, failOnDuplicate: true, failOnMismatch: true)) + MAKEGRAPH2(FREEC_TUMORONLY.out.ratio.join(FREEC_TUMORONLY.out.BAF, failOnDuplicate: true, failOnMismatch: true)) ch_versions = ch_versions.mix(FREEC_TUMORONLY.out.versions) ch_versions = ch_versions.mix(ASSESS_SIGNIFICANCE.out.versions) ch_versions = ch_versions.mix(FREEC2BED.out.versions) ch_versions = ch_versions.mix(FREEC2CIRCOS.out.versions) - ch_versions = ch_versions.mix(MAKEGRAPH.out.versions) + ch_versions = ch_versions.mix(MAKEGRAPH2.out.versions) emit: versions = ch_versions diff --git a/subworkflows/local/bam_variant_calling_tumor_only_mutect2/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_mutect2/main.nf index 9da171a4c1..4e45a23ac6 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_mutect2/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_mutect2/main.nf @@ -29,7 +29,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_MUTECT2 { main: versions = Channel.empty() - //If no germline resource is provided, then create an empty channel to avoid GetPileupsummaries from being run + // If no germline resource is provided, then create an empty channel to avoid GetPileupsummaries from being run germline_resource_pileup = germline_resource_tbi ? germline_resource : Channel.empty() germline_resource_pileup_tbi = germline_resource_tbi ?: Channel.empty() diff --git a/subworkflows/local/channel_align_create_csv/main.nf b/subworkflows/local/channel_align_create_csv/main.nf index 692ffa0ef4..965b36d33d 100644 --- a/subworkflows/local/channel_align_create_csv/main.nf +++ b/subworkflows/local/channel_align_create_csv/main.nf @@ -4,20 +4,22 @@ workflow CHANNEL_ALIGN_CREATE_CSV { take: - bam_indexed // channel: [mandatory] meta, bam, bai + bam_indexed // channel: [mandatory] meta, bam, bai + outdir // + save_output_as_bam // main: // Creating csv files to restart from this step - bam_indexed.collectFile(keepHeader: true, skip: 1, sort: true, storeDir: "${params.outdir}/csv") { meta, bam, bai -> + bam_indexed.collectFile(keepHeader: true, skip: 1, sort: true, storeDir: "${outdir}/csv") { meta, bam, bai -> patient = meta.patient sample = meta.sample sex = meta.sex status = meta.status - bam = "${params.outdir}/preprocessing/mapped/${sample}/${bam.name}" - bai = "${params.outdir}/preprocessing/mapped/${sample}/${bai.name}" + bam = "${outdir}/preprocessing/mapped/${sample}/${bam.name}" + bai = "${outdir}/preprocessing/mapped/${sample}/${bai.name}" - type = params.save_output_as_bam ? "bam" : "cram" - type_index = params.save_output_as_bam ? "bai" : "crai" + type = save_output_as_bam ? "bam" : "cram" + type_index = save_output_as_bam ? "bai" : "crai" ["mapped.csv", "patient,sex,status,sample,${type},${type_index}\n${patient},${sex},${status},${sample},${bam},${bai}\n"] } diff --git a/subworkflows/local/channel_applybqsr_create_csv/main.nf b/subworkflows/local/channel_applybqsr_create_csv/main.nf index 2396574ced..faa9aa5293 100644 --- a/subworkflows/local/channel_applybqsr_create_csv/main.nf +++ b/subworkflows/local/channel_applybqsr_create_csv/main.nf @@ -5,19 +5,21 @@ workflow CHANNEL_APPLYBQSR_CREATE_CSV { take: cram_recalibrated_index // channel: [mandatory] meta, cram, crai + outdir // + save_output_as_bam // main: // Creating csv files to restart from this step - cram_recalibrated_index.collectFile(keepHeader: true, skip: 1, sort: true, storeDir: "${params.outdir}/csv") { meta, file, index -> + cram_recalibrated_index.collectFile(keepHeader: true, skip: 1, sort: true, storeDir: "${outdir}/csv") { meta, file, index -> patient = meta.patient sample = meta.sample sex = meta.sex status = meta.status - file = "${params.outdir}/preprocessing/recalibrated/${sample}/${file.name}" - index = "${params.outdir}/preprocessing/recalibrated/${sample}/${index.name}" + file = "${outdir}/preprocessing/recalibrated/${sample}/${file.name}" + index = "${outdir}/preprocessing/recalibrated/${sample}/${index.name}" - type = params.save_output_as_bam ? "bam" : "cram" - type_index = params.save_output_as_bam ? "bai" : "crai" + type = save_output_as_bam ? "bam" : "cram" + type_index = save_output_as_bam ? "bai" : "crai" ["recalibrated.csv", "patient,sex,status,sample,${type},${type_index}\n${patient},${sex},${status},${sample},${file},${index}\n"] } diff --git a/subworkflows/local/channel_baserecalibrator_create_csv/main.nf b/subworkflows/local/channel_baserecalibrator_create_csv/main.nf index 8bbfacc85c..88ff0cfc38 100644 --- a/subworkflows/local/channel_baserecalibrator_create_csv/main.nf +++ b/subworkflows/local/channel_baserecalibrator_create_csv/main.nf @@ -4,11 +4,11 @@ workflow CHANNEL_BASERECALIBRATOR_CREATE_CSV { take: - cram_table_bqsr // channel: [mandatory] meta, cram, crai, table - tools - skip_tools - save_output_as_bam - outdir + cram_table_bqsr // channel: [mandatory] meta, cram, crai, table + tools // + skip_tools // + outdir // + save_output_as_bam // main: // Creating csv files to restart from this step diff --git a/subworkflows/local/channel_markduplicates_create_csv/main.nf b/subworkflows/local/channel_markduplicates_create_csv/main.nf index 06e9a9826b..3cec161c02 100644 --- a/subworkflows/local/channel_markduplicates_create_csv/main.nf +++ b/subworkflows/local/channel_markduplicates_create_csv/main.nf @@ -4,10 +4,10 @@ workflow CHANNEL_MARKDUPLICATES_CREATE_CSV { take: - cram_markduplicates // channel: [mandatory] meta, cram, crai - csv_subfolder - outdir - save_output_as_bam + cram_markduplicates // channel: [mandatory] meta, cram, crai + csv_subfolder // + outdir // + save_output_as_bam // main: // Creating csv files to restart from this step diff --git a/subworkflows/local/channel_variant_calling_create_csv/main.nf b/subworkflows/local/channel_variant_calling_create_csv/main.nf index b8de11bf8b..9de3fa58ba 100644 --- a/subworkflows/local/channel_variant_calling_create_csv/main.nf +++ b/subworkflows/local/channel_variant_calling_create_csv/main.nf @@ -4,15 +4,16 @@ workflow CHANNEL_VARIANT_CALLING_CREATE_CSV { take: - vcf_to_annotate // channel: [mandatory] meta, vcf + vcf_to_annotate // channel: [mandatory] meta, vcf + outdir // main: // Creating csv files to restart from this step - vcf_to_annotate.collectFile(keepHeader: true, skip: 1,sort: true, storeDir: "${params.outdir}/csv"){ meta, vcf -> + vcf_to_annotate.collectFile(keepHeader: true, skip: 1,sort: true, storeDir: "${outdir}/csv"){ meta, vcf -> patient = meta.patient sample = meta.id variantcaller = meta.variantcaller - vcf = "${params.outdir}/variant_calling/${variantcaller}/${meta.id}/${vcf.getName()}" + vcf = "${outdir}/variant_calling/${variantcaller}/${meta.id}/${vcf.getName()}" ["variantcalled.csv", "patient,sample,variantcaller,vcf\n${patient},${sample},${variantcaller},${vcf}\n"] } } diff --git a/subworkflows/local/cram_qc_mosdepth_samtools/main.nf b/subworkflows/local/cram_qc_mosdepth_samtools/main.nf index fd070a6817..4530139f08 100644 --- a/subworkflows/local/cram_qc_mosdepth_samtools/main.nf +++ b/subworkflows/local/cram_qc_mosdepth_samtools/main.nf @@ -18,9 +18,9 @@ workflow CRAM_QC_MOSDEPTH_SAMTOOLS { reports = Channel.empty() // Reports run on cram - SAMTOOLS_STATS(cram, fasta.map{ it -> [ [ id:'fasta' ], it ] }) + SAMTOOLS_STATS(cram, fasta) - MOSDEPTH(cram.combine(intervals.map{ meta, bed -> [ bed?:[] ] }), fasta.map{ it -> [ [ id:'fasta' ], it ] }) + MOSDEPTH(cram.combine(intervals.map{ meta, bed -> [ bed ?: [] ] }), fasta) // Gather all reports generated reports = reports.mix(SAMTOOLS_STATS.out.stats) diff --git a/subworkflows/local/cram_sampleqc/main.nf b/subworkflows/local/cram_sampleqc/main.nf index 3e3b06f008..504dc0a735 100644 --- a/subworkflows/local/cram_sampleqc/main.nf +++ b/subworkflows/local/cram_sampleqc/main.nf @@ -1,22 +1,36 @@ -include { BAM_NGSCHECKMATE } from '../../../subworkflows/nf-core/bam_ngscheckmate/main' +include { BAM_NGSCHECKMATE } from '../../../subworkflows/nf-core/bam_ngscheckmate/main' +include { CRAM_QC_MOSDEPTH_SAMTOOLS as CRAM_QC_RECAL } from '../../../subworkflows/local/cram_qc_mosdepth_samtools/main' workflow CRAM_SAMPLEQC { take: - ch_cram // channel: [ val(meta), cram, crai ] - ngscheckmate_bed // channel: [ ngscheckmate_bed ] - fasta // channel: [ fasta ] + cram // channel: [ val(meta), cram, crai ] + ngscheckmate_bed // channel: [ ngscheckmate_bed ] + fasta // channel: [ fasta ] + skip_baserecalibration // boolean: + intervals_for_preprocessing // channel: main: - ch_versions = Channel.empty() + versions = Channel.empty() + reports = Channel.empty() - ch_ngscheckmate_bed = ngscheckmate_bed.map{bed -> [[id: "ngscheckmate"], bed]} + if (!skip_baserecalibration) { - ch_fasta = fasta.map{fasta -> [[id: "genome"], fasta]} + CRAM_QC_RECAL( + cram, + fasta, + intervals_for_preprocessing) - BAM_NGSCHECKMATE ( ch_cram.map{meta, cram, crai -> [meta, cram]}, ch_ngscheckmate_bed, ch_fasta) - ch_versions = ch_versions.mix(BAM_NGSCHECKMATE.out.versions.first()) + // Gather QC reports + reports = CRAM_QC_RECAL.out.reports.collect{ meta, report -> report } + + // Gather used softwares versions + versions = versions.mix(CRAM_QC_RECAL.out.versions) + } + + BAM_NGSCHECKMATE(cram.map{meta, cram, crai -> [meta, cram]}, ngscheckmate_bed.map{bed -> [[id: "ngscheckmate"], bed]}, fasta) + versions = versions.mix(BAM_NGSCHECKMATE.out.versions.first()) emit: corr_matrix = BAM_NGSCHECKMATE.out.corr_matrix // channel: [ meta, corr_matrix ] @@ -24,7 +38,8 @@ workflow CRAM_SAMPLEQC { all = BAM_NGSCHECKMATE.out.all // channel: [ meta, all ] vcf = BAM_NGSCHECKMATE.out.vcf // channel: [ meta, vcf ] pdf = BAM_NGSCHECKMATE.out.pdf // channel: [ meta, pdf ] + reports - versions = ch_versions // channel: [ versions.yml ] + versions // channel: [ versions.yml ] } diff --git a/subworkflows/local/fastq_align_bwamem_mem2_dragmap_sentieon/main.nf b/subworkflows/local/fastq_align_bwamem_mem2_dragmap_sentieon/main.nf index c61ac7f4cc..0a711afc5e 100644 --- a/subworkflows/local/fastq_align_bwamem_mem2_dragmap_sentieon/main.nf +++ b/subworkflows/local/fastq_align_bwamem_mem2_dragmap_sentieon/main.nf @@ -23,11 +23,11 @@ workflow FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON { reports = Channel.empty() // Only one of the following should be run - BWAMEM1_MEM(reads, index.map{ it -> [ [ id:'index' ], it ] }, sort) // If aligner is bwa-mem - BWAMEM2_MEM(reads, index.map{ it -> [ [ id:'index' ], it ] }, sort) // If aligner is bwa-mem2 - DRAGMAP_ALIGN(reads, index.map{ it -> [ [ id:'index' ], it ] }, sort) // If aligner is dragmap + BWAMEM1_MEM(reads, index, [[id:'no_fasta'], []], sort) // If aligner is bwa-mem + BWAMEM2_MEM(reads, index, [[id:'no_fasta'], []], sort) // If aligner is bwa-mem2 + DRAGMAP_ALIGN(reads, index, [[id:'no_fasta'], []], sort) // If aligner is dragmap // The sentieon-bwamem-module does sorting as part of the conversion from sam to bam. - SENTIEON_BWAMEM(reads, index.map{ it -> [ [ id:'index' ], it ] }, fasta.map{fa -> [[:], fa]}, fasta_fai.map{fai -> [[:], fai]}) // If aligner is sentieon-bwamem + SENTIEON_BWAMEM(reads, index, fasta, fasta_fai) // If aligner is sentieon-bwamem // Get the bam files from the aligner // Only one aligner is run diff --git a/subworkflows/local/post_variantcalling/main.nf b/subworkflows/local/post_variantcalling/main.nf index bf23ff13d4..6b75d2c6b8 100644 --- a/subworkflows/local/post_variantcalling/main.nf +++ b/subworkflows/local/post_variantcalling/main.nf @@ -13,7 +13,7 @@ workflow POST_VARIANTCALLING { main: versions = Channel.empty() - if(concatenate_vcfs){ + if (concatenate_vcfs){ CONCATENATE_GERMLINE_VCFS(vcfs) vcfs = vcfs.mix(CONCATENATE_GERMLINE_VCFS.out.vcfs) diff --git a/subworkflows/local/prepare_genome/main.nf b/subworkflows/local/prepare_genome/main.nf index 4945282d98..772af47b37 100644 --- a/subworkflows/local/prepare_genome/main.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -8,41 +8,41 @@ // Condition is based on params.step and params.tools // If and extra condition exists, it's specified in comments -include { BWA_INDEX as BWAMEM1_INDEX } from '../../../modules/nf-core/bwa/index/main' -include { BWAMEM2_INDEX } from '../../../modules/nf-core/bwamem2/index/main' -include { DRAGMAP_HASHTABLE } from '../../../modules/nf-core/dragmap/hashtable/main' -include { GATK4_CREATESEQUENCEDICTIONARY } from '../../../modules/nf-core/gatk4/createsequencedictionary/main' -include { MSISENSORPRO_SCAN } from '../../../modules/nf-core/msisensorpro/scan/main' -include { SAMTOOLS_FAIDX } from '../../../modules/nf-core/samtools/faidx/main' -include { TABIX_TABIX as TABIX_DBSNP } from '../../../modules/nf-core/tabix/tabix/main' -include { TABIX_TABIX as TABIX_GERMLINE_RESOURCE } from '../../../modules/nf-core/tabix/tabix/main' -include { TABIX_TABIX as TABIX_KNOWN_INDELS } from '../../../modules/nf-core/tabix/tabix/main' -include { TABIX_TABIX as TABIX_KNOWN_SNPS } from '../../../modules/nf-core/tabix/tabix/main' -include { TABIX_TABIX as TABIX_PON } from '../../../modules/nf-core/tabix/tabix/main' -include { UNTAR as UNTAR_CHR_DIR } from '../../../modules/nf-core/untar/main' -include { UNZIP as UNZIP_ALLELES } from '../../../modules/nf-core/unzip/main' -include { UNZIP as UNZIP_GC } from '../../../modules/nf-core/unzip/main' -include { UNZIP as UNZIP_LOCI } from '../../../modules/nf-core/unzip/main' -include { UNZIP as UNZIP_RT } from '../../../modules/nf-core/unzip/main' +include { BWA_INDEX as BWAMEM1_INDEX } from '../../../modules/nf-core/bwa/index/main' +include { BWAMEM2_INDEX } from '../../../modules/nf-core/bwamem2/index/main' +include { DRAGMAP_HASHTABLE } from '../../../modules/nf-core/dragmap/hashtable/main' +include { GATK4_CREATESEQUENCEDICTIONARY } from '../../../modules/nf-core/gatk4/createsequencedictionary/main' +include { MSISENSORPRO_SCAN } from '../../../modules/nf-core/msisensorpro/scan/main' +include { SAMTOOLS_FAIDX } from '../../../modules/nf-core/samtools/faidx/main' +include { TABIX_TABIX as TABIX_BCFTOOLS_ANNOTATIONS } from '../../../modules/nf-core/tabix/tabix/main' +include { TABIX_TABIX as TABIX_DBSNP } from '../../../modules/nf-core/tabix/tabix/main' +include { TABIX_TABIX as TABIX_GERMLINE_RESOURCE } from '../../../modules/nf-core/tabix/tabix/main' +include { TABIX_TABIX as TABIX_KNOWN_INDELS } from '../../../modules/nf-core/tabix/tabix/main' +include { TABIX_TABIX as TABIX_KNOWN_SNPS } from '../../../modules/nf-core/tabix/tabix/main' +include { TABIX_TABIX as TABIX_PON } from '../../../modules/nf-core/tabix/tabix/main' +include { UNTAR as UNTAR_CHR_DIR } from '../../../modules/nf-core/untar/main' +include { UNZIP as UNZIP_ALLELES } from '../../../modules/nf-core/unzip/main' +include { UNZIP as UNZIP_GC } from '../../../modules/nf-core/unzip/main' +include { UNZIP as UNZIP_LOCI } from '../../../modules/nf-core/unzip/main' +include { UNZIP as UNZIP_RT } from '../../../modules/nf-core/unzip/main' workflow PREPARE_GENOME { take: - ascat_alleles // channel: [optional] ascat allele files - ascat_loci // channel: [optional] ascat loci files - ascat_loci_gc // channel: [optional] ascat gc content file - ascat_loci_rt // channel: [optional] ascat replictiming file - chr_dir // channel: [optional] chromosome files - dbsnp // channel: [optional] dbsnp - fasta // channel: [mandatory] fasta - fasta_fai // channel: [optional] fasta_fai - germline_resource // channel: [optional] germline_resource - known_indels // channel: [optional] known_indels - known_snps // channel: [optional] known_snps - pon // channel: [optional] pon + ascat_alleles // params.ascat_alleles + ascat_loci // params.ascat_loci + ascat_loci_gc // params.ascat_loci_gc + ascat_loci_rt // params.ascat_loci_rt + bcftools_annotations // channel: [optional] bcftools annotations file + chr_dir // params.chr_dir + dbsnp // channel: [optional] dbsnp + fasta // channel: [mandatory] fasta + germline_resource // channel: [optional] germline_resource + known_indels // channel: [optional] known_indels + known_snps // channel: [optional] known_snps + pon // channel: [optional] pon main: - fasta = fasta.map{ fasta -> [ [ id:fasta.baseName ], fasta ] } versions = Channel.empty() BWAMEM1_INDEX(fasta) // If aligner is bwa-mem @@ -51,83 +51,88 @@ workflow PREPARE_GENOME { GATK4_CREATESEQUENCEDICTIONARY(fasta) MSISENSORPRO_SCAN(fasta) - SAMTOOLS_FAIDX(fasta, [['id':null], []]) + SAMTOOLS_FAIDX(fasta, [ [ id:'no_fai' ], [] ] ) // the following are flattened and mapped in case the user supplies more than one value for the param // written for KNOWN_INDELS, but preemptively applied to the rest // [ file1, file2 ] becomes [ [ meta1, file1 ], [ meta2, file2 ] ] // outputs are collected to maintain a single channel for relevant TBI files + TABIX_BCFTOOLS_ANNOTATIONS(bcftools_annotations.flatten().map{ it -> [ [ id:it.baseName ], it ] }) TABIX_DBSNP(dbsnp.flatten().map{ it -> [ [ id:it.baseName ], it ] }) TABIX_GERMLINE_RESOURCE(germline_resource.flatten().map{ it -> [ [ id:it.baseName ], it ] }) TABIX_KNOWN_SNPS(known_snps.flatten().map{ it -> [ [ id:it.baseName ], it ] } ) TABIX_KNOWN_INDELS(known_indels.flatten().map{ it -> [ [ id:it.baseName ], it ] } ) TABIX_PON(pon.flatten().map{ it -> [ [ id:it.baseName ], it ] }) - // prepare ascat reference files - allele_files = ascat_alleles - if (params.ascat_alleles && params.ascat_alleles.endsWith('.zip')) { - UNZIP_ALLELES(ascat_alleles.map{ it -> [[id:it[0].baseName], it]}) + // prepare ascat and controlfreec reference files + if (!ascat_alleles) allele_files = Channel.empty() + else if (ascat_alleles.endsWith(".zip")) { + UNZIP_ALLELES(Channel.fromPath(file(ascat_alleles)).collect().map{ it -> [ [ id:it[0].baseName ], it ] }) allele_files = UNZIP_ALLELES.out.unzipped_archive.map{ it[1] } versions = versions.mix(UNZIP_ALLELES.out.versions) - } + } else allele_files = Channel.fromPath(ascat_alleles).collect() - loci_files = ascat_loci - if (params.ascat_loci && params.ascat_loci.endsWith('.zip')) { - UNZIP_LOCI(ascat_loci.map{ it -> [[id:it[0].baseName], it]}) + if (!ascat_loci) loci_files = Channel.empty() + else if (ascat_loci.endsWith(".zip")) { + UNZIP_LOCI(Channel.fromPath(file(ascat_loci)).collect().map{ it -> [ [ id:it[0].baseName ], it ] }) loci_files = UNZIP_LOCI.out.unzipped_archive.map{ it[1] } versions = versions.mix(UNZIP_LOCI.out.versions) - } - gc_file = ascat_loci_gc - if (params.ascat_loci_gc && params.ascat_loci_gc.endsWith('.zip')) { - UNZIP_GC(ascat_loci_gc.map{ it -> [[id:it[0].baseName], it]}) + } else loci_files = Channel.fromPath(ascat_loci).collect() + + if (!ascat_loci_gc) gc_file = Channel.value([]) + else if (ascat_loci_gc.endsWith(".zip")) { + UNZIP_GC(Channel.fromPath(file(ascat_loci_gc)).collect().map{ it -> [ [ id:it[0].baseName ], it ] }) gc_file = UNZIP_GC.out.unzipped_archive.map{ it[1] } versions = versions.mix(UNZIP_GC.out.versions) - } - rt_file = ascat_loci_rt - if (params.ascat_loci_rt && params.ascat_loci_rt.endsWith('.zip')) { - UNZIP_RT(ascat_loci_rt.map{ it -> [[id:it[0].baseName], it]}) + } else gc_file = Channel.fromPath(ascat_loci_gc).collect() + + if (!ascat_loci_rt) rt_file = Channel.value([]) + else if (ascat_loci_rt.endsWith(".zip")) { + UNZIP_RT(Channel.fromPath(file(ascat_loci_rt)).collect().map{ it -> [ [ id:it[0].baseName ], it ] }) rt_file = UNZIP_RT.out.unzipped_archive.map{ it[1] } versions = versions.mix(UNZIP_RT.out.versions) - } - + } else rt_file = Channel.fromPath(ascat_loci_rt).collect() - chr_files = chr_dir - if (params.chr_dir && params.chr_dir.endsWith('tar.gz')) { - UNTAR_CHR_DIR(chr_dir.map{ it -> [ [ id:'chr_dir' ], it ] }) + if (!chr_dir) chr_files = Channel.value([]) + else if (chr_dir.endsWith(".tar.gz")) { + UNTAR_CHR_DIR(Channel.fromPath(file(chr_dir)).collect().map{ it -> [ [ id:it[0].baseName ], it ] }) chr_files = UNTAR_CHR_DIR.out.untar.map{ it[1] } versions = versions.mix(UNTAR_CHR_DIR.out.versions) - } + } else chr_files = Channel.fromPath(chr_dir).collect() // Gather versions of all tools used - versions = versions.mix(SAMTOOLS_FAIDX.out.versions) versions = versions.mix(BWAMEM1_INDEX.out.versions) versions = versions.mix(BWAMEM2_INDEX.out.versions) versions = versions.mix(DRAGMAP_HASHTABLE.out.versions) versions = versions.mix(GATK4_CREATESEQUENCEDICTIONARY.out.versions) versions = versions.mix(MSISENSORPRO_SCAN.out.versions) + versions = versions.mix(SAMTOOLS_FAIDX.out.versions) + versions = versions.mix(TABIX_BCFTOOLS_ANNOTATIONS.out.versions) versions = versions.mix(TABIX_DBSNP.out.versions) versions = versions.mix(TABIX_GERMLINE_RESOURCE.out.versions) - versions = versions.mix(TABIX_KNOWN_SNPS.out.versions) versions = versions.mix(TABIX_KNOWN_INDELS.out.versions) + versions = versions.mix(TABIX_KNOWN_SNPS.out.versions) versions = versions.mix(TABIX_PON.out.versions) emit: - bwa = BWAMEM1_INDEX.out.index.map{ meta, index -> [index] }.collect() // path: bwa/* - bwamem2 = BWAMEM2_INDEX.out.index.map{ meta, index -> [index] }.collect() // path: bwamem2/* - hashtable = DRAGMAP_HASHTABLE.out.hashmap.map{ meta, index -> [index] }.collect() // path: dragmap/* - dbsnp_tbi = TABIX_DBSNP.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: dbsnb.vcf.gz.tbi - dict = GATK4_CREATESEQUENCEDICTIONARY.out.dict // path: genome.fasta.dict - fasta_fai = SAMTOOLS_FAIDX.out.fai.map{ meta, fai -> [fai] } // path: genome.fasta.fai - germline_resource_tbi = TABIX_GERMLINE_RESOURCE.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: germline_resource.vcf.gz.tbi - known_snps_tbi = TABIX_KNOWN_SNPS.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: {known_indels*}.vcf.gz.tbi - known_indels_tbi = TABIX_KNOWN_INDELS.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: {known_indels*}.vcf.gz.tbi - msisensorpro_scan = MSISENSORPRO_SCAN.out.list.map{ meta, list -> [list] } // path: genome_msi.list - pon_tbi = TABIX_PON.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: pon.vcf.gz.tbi - allele_files - chr_files - gc_file - loci_files - rt_file - - versions // channel: [ versions.yml ] + bcftools_annotations_tbi = TABIX_BCFTOOLS_ANNOTATIONS.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: bcftools_annotations.vcf.gz.tbi + bwa = BWAMEM1_INDEX.out.index.collect() // path: bwa/* + bwamem2 = BWAMEM2_INDEX.out.index.collect() // path: bwamem2/* + hashtable = DRAGMAP_HASHTABLE.out.hashmap.collect() // path: dragmap/* + dbsnp_tbi = TABIX_DBSNP.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: dbsnb.vcf.gz.tbi + dict = GATK4_CREATESEQUENCEDICTIONARY.out.dict.collect() // path: genome.fasta.dict + fasta_fai = SAMTOOLS_FAIDX.out.fai.collect() // path: genome.fasta.fai + germline_resource_tbi = TABIX_GERMLINE_RESOURCE.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: germline_resource.vcf.gz.tbi + known_snps_tbi = TABIX_KNOWN_SNPS.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: {known_indels*}.vcf.gz.tbi + known_indels_tbi = TABIX_KNOWN_INDELS.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: {known_indels*}.vcf.gz.tbi + msisensorpro_scan = MSISENSORPRO_SCAN.out.list.map{ meta, list -> [list] } // path: genome_msi.list + pon_tbi = TABIX_PON.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: pon.vcf.gz.tbi + + allele_files // path: allele_files + chr_files // path: chr_files + gc_file // path: gc_file + loci_files // path: loci_files + rt_file // path: rt_file + + versions // channel: [ versions.yml ] } diff --git a/subworkflows/local/prepare_intervals/main.nf b/subworkflows/local/prepare_intervals/main.nf index f4079e3e81..27c4e9c145 100644 --- a/subworkflows/local/prepare_intervals/main.nf +++ b/subworkflows/local/prepare_intervals/main.nf @@ -6,9 +6,9 @@ // For all modules here: // A when clause condition is defined in the conf/modules.config to determine if the module should be run -include { BUILD_INTERVALS } from '../../../modules/local/build_intervals/main' include { CREATE_INTERVALS_BED } from '../../../modules/local/create_intervals_bed/main' include { GATK4_INTERVALLISTTOBED } from '../../../modules/nf-core/gatk4/intervallisttobed/main' +include { GAWK as BUILD_INTERVALS } from '../../../modules/nf-core/gawk/main' include { TABIX_BGZIPTABIX as TABIX_BGZIPTABIX_INTERVAL_SPLIT } from '../../../modules/nf-core/tabix/bgziptabix/main' include { TABIX_BGZIPTABIX as TABIX_BGZIPTABIX_INTERVAL_COMBINED } from '../../../modules/nf-core/tabix/bgziptabix/main' @@ -17,6 +17,9 @@ workflow PREPARE_INTERVALS { fasta_fai // mandatory [ fasta_fai ] intervals // [ params.intervals ] no_intervals // [ params.no_intervals ] + nucleotides_per_second + outdir + step main: versions = Channel.empty() @@ -26,21 +29,21 @@ workflow PREPARE_INTERVALS { intervals_combined = Channel.empty() // Single bed file containing all intervals if (no_intervals) { - file("${params.outdir}/no_intervals.bed").text = "no_intervals\n" - file("${params.outdir}/no_intervals.bed.gz").text = "no_intervals\n" - file("${params.outdir}/no_intervals.bed.gz.tbi").text = "no_intervals\n" - - intervals_bed = Channel.fromPath(file("${params.outdir}/no_intervals.bed")).map{ it -> [ it, 0 ] } - intervals_bed_gz_tbi = Channel.fromPath(file("${params.outdir}/no_intervals.bed.{gz,gz.tbi}")).collect().map{ it -> [ it, 0 ] } - intervals_combined = Channel.fromPath(file("${params.outdir}/no_intervals.bed")).map{ it -> [ [ id:it.simpleName ], it ] } - } else if (params.step != 'annotate' && params.step != 'controlfreec') { + file("${outdir}/no_intervals.bed").text = "no_intervals\n" + file("${outdir}/no_intervals.bed.gz").text = "no_intervals\n" + file("${outdir}/no_intervals.bed.gz.tbi").text = "no_intervals\n" + + intervals_bed = Channel.fromPath(file("${outdir}/no_intervals.bed")).map{ it -> [ it, 0 ] } + intervals_bed_gz_tbi = Channel.fromPath(file("${outdir}/no_intervals.bed.{gz,gz.tbi}")).collect().map{ it -> [ it, 0 ] } + intervals_combined = Channel.fromPath(file("${outdir}/no_intervals.bed")).map{ it -> [ [ id:it.simpleName ], it ] } + } else if (step != 'annotate' && step != 'controlfreec') { // If no interval/target file is provided, then generated intervals from FASTA file if (!intervals) { - BUILD_INTERVALS(fasta_fai.map{it -> [ [ id:it.baseName ], it ] }) + BUILD_INTERVALS(fasta_fai, []) - intervals_combined = BUILD_INTERVALS.out.bed + intervals_combined = BUILD_INTERVALS.out.output - CREATE_INTERVALS_BED(intervals_combined.map{ meta, path -> path }).bed + CREATE_INTERVALS_BED(intervals_combined.map{ meta, path -> path }, nucleotides_per_second) intervals_bed = CREATE_INTERVALS_BED.out.bed @@ -48,7 +51,9 @@ workflow PREPARE_INTERVALS { versions = versions.mix(CREATE_INTERVALS_BED.out.versions) } else { intervals_combined = Channel.fromPath(file(intervals)).map{it -> [ [ id:it.baseName ], it ] } - intervals_bed = CREATE_INTERVALS_BED(file(intervals)).bed + CREATE_INTERVALS_BED(file(intervals), nucleotides_per_second) + + intervals_bed = CREATE_INTERVALS_BED.out.bed versions = versions.mix(CREATE_INTERVALS_BED.out.versions) @@ -74,7 +79,7 @@ workflow PREPARE_INTERVALS { else { start = fields[1].toInteger() end = fields[2].toInteger() - duration += (end - start) / params.nucleotides_per_second + duration += (end - start) / nucleotides_per_second } } [ duration, intervalFile ] diff --git a/subworkflows/local/prepare_reference_cnvkit/main.nf b/subworkflows/local/prepare_reference_cnvkit/main.nf index 87b943dff1..61424d1980 100644 --- a/subworkflows/local/prepare_reference_cnvkit/main.nf +++ b/subworkflows/local/prepare_reference_cnvkit/main.nf @@ -19,7 +19,7 @@ workflow PREPARE_REFERENCE_CNVKIT { // prepare a antitarget reference files for tumor_only mode of cnvkit CNVKIT_ANTITARGET(intervals_bed_combined.flatten().map{ it -> [ [ id:'intervals' ], it ] }) - CNVKIT_REFERENCE(fasta, intervals_bed_combined, CNVKIT_ANTITARGET.out.bed.map{ meta, bed -> [ bed ] } ) + CNVKIT_REFERENCE(fasta.map{ meta, fasta -> [ fasta ] }, intervals_bed_combined, CNVKIT_ANTITARGET.out.bed.map{ meta, bed -> [ bed ] } ) versions = versions.mix(CNVKIT_ANTITARGET.out.versions) versions = versions.mix(CNVKIT_REFERENCE.out.versions) diff --git a/subworkflows/local/samplesheet_to_channel/main.nf b/subworkflows/local/samplesheet_to_channel/main.nf index b3f9b2311a..4de0722aed 100644 --- a/subworkflows/local/samplesheet_to_channel/main.nf +++ b/subworkflows/local/samplesheet_to_channel/main.nf @@ -1,7 +1,35 @@ workflow SAMPLESHEET_TO_CHANNEL{ take: - ch_from_samplesheet + ch_from_samplesheet // + aligner // + ascat_alleles // + ascat_loci // + ascat_loci_gc // + ascat_loci_rt // + bcftools_annotations // + bcftools_annotations_tbi // + bcftools_header_lines // + build_only_index // + dbsnp // + fasta // + germline_resource // + intervals // + joint_germline // + joint_mutect2 // + known_indels // + known_snps // + no_intervals // + pon // + sentieon_dnascope_emit_mode // + sentieon_haplotyper_emit_mode // + seq_center // + seq_platform // + skip_tools // + step // + tools // + umi_read_structure // + wes // main: ch_from_samplesheet.dump(tag:"ch_from_samplesheet") @@ -18,31 +46,31 @@ workflow SAMPLESHEET_TO_CHANNEL{ (meta, fastq_1, fastq_2, table, cram, crai, bam, bai, vcf, variantcaller) = ch_items if (meta.lane && fastq_2) { meta = meta + [id: "${meta.sample}-${meta.lane}".toString()] - def CN = params.seq_center ? "CN:${params.seq_center}\\t" : '' + def CN = seq_center ? "CN:${seq_center}\\t" : '' def flowcell = flowcellLaneFromFastq(fastq_1) // Don't use a random element for ID, it breaks resuming - def read_group = "\"@RG\\tID:${flowcell}.${meta.sample}.${meta.lane}\\t${CN}PU:${meta.lane}\\tSM:${meta.patient}_${meta.sample}\\tLB:${meta.sample}\\tDS:${params.fasta}\\tPL:${params.seq_platform}\"" + def read_group = "\"@RG\\tID:${flowcell}.${meta.sample}.${meta.lane}\\t${CN}PU:${meta.lane}\\tSM:${meta.patient}_${meta.sample}\\tLB:${meta.sample}\\tDS:${fasta}\\tPL:${seq_platform}\"" meta = meta - meta.subMap('lane') + [num_lanes: num_lanes.toInteger(), read_group: read_group.toString(), data_type: 'fastq', size: 1] - if (params.step == 'mapping') return [ meta, [ fastq_1, fastq_2 ] ] + if (step == 'mapping') return [ meta, [ fastq_1, fastq_2 ] ] else { - error("Samplesheet contains fastq files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") + error("Samplesheet contains fastq files but step is `$step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") } // start from BAM } else if (meta.lane && bam) { - if (params.step != 'mapping' && !bai) { + if (step != 'mapping' && !bai) { error("BAM index (bai) should be provided.") } meta = meta + [id: "${meta.sample}-${meta.lane}".toString()] - def CN = params.seq_center ? "CN:${params.seq_center}\\t" : '' - def read_group = "\"@RG\\tID:${meta.sample}_${meta.lane}\\t${CN}PU:${meta.lane}\\tSM:${meta.patient}_${meta.sample}\\tLB:${meta.sample}\\tDS:${params.fasta}\\tPL:${params.seq_platform}\"" + def CN = seq_center ? "CN:${seq_center}\\t" : '' + def read_group = "\"@RG\\tID:${meta.sample}_${meta.lane}\\t${CN}PU:${meta.lane}\\tSM:${meta.patient}_${meta.sample}\\tLB:${meta.sample}\\tDS:${fasta}\\tPL:${seq_platform}\"" meta = meta - meta.subMap('lane') + [num_lanes: num_lanes.toInteger(), read_group: read_group.toString(), data_type: 'bam', size: 1] - if (params.step != 'annotate') return [ meta - meta.subMap('lane'), bam, bai ] + if (step != 'annotate') return [ meta - meta.subMap('lane'), bam, bai ] else { error("Samplesheet contains bam files but step is `annotate`. The pipeline is expecting vcf files for the annotation. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") } @@ -51,72 +79,73 @@ workflow SAMPLESHEET_TO_CHANNEL{ } else if (table && cram) { meta = meta + [id: meta.sample, data_type: 'cram'] - if (!(params.step == 'mapping' || params.step == 'annotate')) return [ meta - meta.subMap('lane'), cram, crai, table ] + if (!(step == 'mapping' || step == 'annotate')) return [ meta - meta.subMap('lane'), cram, crai, table ] else { - error("Samplesheet contains cram files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") + error("Samplesheet contains cram files but step is `$step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") } // recalibration when skipping MarkDuplicates } else if (table && bam) { meta = meta + [id: meta.sample, data_type: 'bam'] - if (!(params.step == 'mapping' || params.step == 'annotate')) return [ meta - meta.subMap('lane'), bam, bai, table ] + if (!(step == 'mapping' || step == 'annotate')) return [ meta - meta.subMap('lane'), bam, bai, table ] else { - error("Samplesheet contains bam files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") + error("Samplesheet contains bam files but step is `$step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") } // prepare_recalibration or variant_calling } else if (cram) { meta = meta + [id: meta.sample, data_type: 'cram'] - if (!(params.step == 'mapping' || params.step == 'annotate')) return [ meta - meta.subMap('lane'), cram, crai ] + if (!(step == 'mapping' || step == 'annotate')) return [ meta - meta.subMap('lane'), cram, crai ] else { - error("Samplesheet contains cram files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") + error("Samplesheet contains cram files but step is `$step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") } // prepare_recalibration when skipping MarkDuplicates or `--step markduplicates` } else if (bam) { meta = meta + [id: meta.sample, data_type: 'bam'] - if (!(params.step == 'mapping' || params.step == 'annotate')) return [ meta - meta.subMap('lane'), bam, bai ] + if (!(step == 'mapping' || step == 'annotate')) return [ meta - meta.subMap('lane'), bam, bai ] else { - error("Samplesheet contains bam files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") + error("Samplesheet contains bam files but step is `$step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") } // annotation } else if (vcf) { meta = meta + [id: meta.sample, data_type: 'vcf', variantcaller: variantcaller ?: ''] - if (params.step == 'annotate') return [ meta - meta.subMap('lane'), vcf ] + if (step == 'annotate') return [ meta - meta.subMap('lane'), vcf ] else { - error("Samplesheet contains vcf files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") + error("Samplesheet contains vcf files but step is `$step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") } } else { error("Missing or unknown field in csv file header. Please check your samplesheet") } } - if (params.step != 'annotate' && params.tools && !params.build_only_index) { + if (step != 'annotate' && tools && !build_only_index) { // Two checks for ensuring that the pipeline stops with a meaningful error message if // 1. the sample-sheet only contains normal-samples, but some of the requested tools require tumor-samples, and // 2. the sample-sheet only contains tumor-samples, but some of the requested tools require normal-samples. input_sample.filter{ it[0].status == 1 }.ifEmpty{ // In this case, the sample-sheet contains no tumor-samples - if (!params.build_only_index) { + if (!build_only_index) { def tools_tumor = ['ascat', 'controlfreec', 'mutect2', 'msisensorpro'] def tools_tumor_asked = [] tools_tumor.each{ tool -> - if (params.tools.split(',').contains(tool)) tools_tumor_asked.add(tool) + if (tools.split(',').contains(tool)) tools_tumor_asked.add(tool) } if (!tools_tumor_asked.isEmpty()) { error('The sample-sheet only contains normal-samples, but the following tools, which were requested with "--tools", expect at least one tumor-sample : ' + tools_tumor_asked.join(", ")) } } } + input_sample.filter{ it[0].status == 0 }.ifEmpty{ // In this case, the sample-sheet contains no normal/germline-samples def tools_requiring_normal_samples = ['ascat', 'deepvariant', 'haplotypecaller', 'msisensorpro'] def requested_tools_requiring_normal_samples = [] tools_requiring_normal_samples.each{ tool_requiring_normal_samples -> - if (params.tools.split(',').contains(tool_requiring_normal_samples)) requested_tools_requiring_normal_samples.add(tool_requiring_normal_samples) + if (tools.split(',').contains(tool_requiring_normal_samples)) requested_tools_requiring_normal_samples.add(tool_requiring_normal_samples) } if (!requested_tools_requiring_normal_samples.isEmpty()) { error('The sample-sheet only contains tumor-samples, but the following tools, which were requested by the option "tools", expect at least one normal-sample : ' + requested_tools_requiring_normal_samples.join(", ")) @@ -125,124 +154,107 @@ workflow SAMPLESHEET_TO_CHANNEL{ } // Fails when wrongfull extension for intervals file - if (params.wes && !params.step == 'annotate') { - if (params.intervals && !params.intervals.endsWith("bed")) error("Target file specified with `--intervals` must be in BED format for targeted data") - else log.warn("Intervals file was provided without parameter `--wes`: Pipeline will assume this is Whole-Genome-Sequencing data.") - } else if (params.intervals && !params.intervals.endsWith("bed") && !params.intervals.endsWith("list")) error("Intervals file must end with .bed, .list, or .interval_list") + if (wes && !step == 'annotate') { + if (intervals && !intervals.endsWith("bed")) error("Target file specified with `--intervals` must be in BED format for targeted data") + else log.warn("Intervals file was provided without parameter `--wes`: Pipeline will assume this is Whole-Genome-Sequencing data.") + } else if (intervals && !intervals.endsWith("bed") && !intervals.endsWith("list")) error("Intervals file must end with .bed, .list, or .interval_list") - if (params.step == 'mapping' && params.aligner.contains("dragmap") && !(params.skip_tools && params.skip_tools.split(',').contains("baserecalibrator"))) { + if (step == 'mapping' && aligner.contains("dragmap") && !(skip_tools && skip_tools.split(',').contains("baserecalibrator"))) { log.warn("DragMap was specified as aligner. Base recalibration is not contained in --skip_tools. It is recommended to skip baserecalibration when using DragMap\nhttps://gatk.broadinstitute.org/hc/en-us/articles/4407897446939--How-to-Run-germline-single-sample-short-variant-discovery-in-DRAGEN-mode") } - if (params.step == 'mapping' && params.aligner.contains("sentieon-bwamem") && params.umi_read_structure) { + if (step == 'mapping' && aligner.contains("sentieon-bwamem") && umi_read_structure) { error("Sentieon BWA is currently not compatible with FGBio UMI handeling. Please choose a different aligner.") } - if (params.tools && params.tools.split(',').contains("sentieon_haplotyper") && params.joint_germline && (!params.sentieon_haplotyper_emit_mode || !(params.sentieon_haplotyper_emit_mode.contains('gvcf')))) { + if (tools && tools.split(',').contains("sentieon_haplotyper") && joint_germline && (!sentieon_haplotyper_emit_mode || !(sentieon_haplotyper_emit_mode.contains('gvcf')))) { error("When setting the option `--joint_germline` and including `sentieon_haplotyper` among the requested tools, please set `--sentieon_haplotyper_emit_mode` to include `gvcf`.") } // Fails or warns when missing files or params for ascat - if (params.tools && params.tools.split(',').contains('ascat')) { - if (!params.ascat_alleles) { + if (tools && tools.split(',').contains('ascat')) { + if (!ascat_alleles) { error("No allele files were provided for running ASCAT. Please provide a zip folder with allele files.") } - if (!params.ascat_loci) { + if (!ascat_loci) { error("No loci files were provided for running ASCAT. Please provide a zip folder with loci files.") } - if (!params.ascat_loci_gc && !params.ascat_loci_rt) { + if (!ascat_loci_gc && !ascat_loci_rt) { log.warn("No LogRCorrection performed in ASCAT. For LogRCorrection to run, please provide either loci gc files or both loci gc files and loci rt files.") } - if (params.wes) { + if (wes) { log.warn("Default reference files not suited for running ASCAT on WES data. It's recommended to use the reference files provided here: https://github.com/Wedge-lab/battenberg#required-reference-files") } } // Warns when missing files or params for mutect2 - if (params.tools && params.tools.split(',').contains('mutect2')) { - if (!params.pon) { + if (tools && tools.split(',').contains('mutect2')) { + if (!pon) { log.warn("No Panel-of-normal was specified for Mutect2.\nIt is highly recommended to use one: https://gatk.broadinstitute.org/hc/en-us/articles/5358911630107-Mutect2\nFor more information on how to create one: https://gatk.broadinstitute.org/hc/en-us/articles/5358921041947-CreateSomaticPanelOfNormals-BETA-") } - if (!params.germline_resource) { + if (!germline_resource) { log.warn("If Mutect2 is specified without a germline resource, no filtering will be done.\nIt is recommended to use one: https://gatk.broadinstitute.org/hc/en-us/articles/5358911630107-Mutect2") } - if (params.pon && params.pon.contains("/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/1000g_pon.hg38.vcf.gz")) { + if (pon && pon.contains("/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/1000g_pon.hg38.vcf.gz")) { log.warn("The default Panel-of-Normals provided by GATK is used for Mutect2.\nIt is highly recommended to generate one from normal samples that are technical similar to the tumor ones.\nFor more information: https://gatk.broadinstitute.org/hc/en-us/articles/360035890631-Panel-of-Normals-PON-") } } // Fails when missing resources for baserecalibrator // Warns when missing resources for haplotypecaller - if (!params.dbsnp && !params.known_indels) { - if (params.step in ['mapping', 'markduplicates', 'prepare_recalibration', 'recalibrate'] && (!params.skip_tools || (params.skip_tools && !params.skip_tools.split(',').contains('baserecalibrator')))) { + if (!dbsnp && !known_indels) { + if (step in ['mapping', 'markduplicates', 'prepare_recalibration', 'recalibrate'] && (!skip_tools || (skip_tools && !skip_tools.split(',').contains('baserecalibrator')))) { error("Base quality score recalibration requires at least one resource file. Please provide at least one of `--dbsnp` or `--known_indels`\nYou can skip this step in the workflow by adding `--skip_tools baserecalibrator` to the command.") } - if (params.tools && (params.tools.split(',').contains('haplotypecaller') || params.tools.split(',').contains('sentieon_haplotyper') || params.tools.split(',').contains('sentieon_dnascope'))) { + if (tools && (tools.split(',').contains('haplotypecaller') || tools.split(',').contains('sentieon_haplotyper') || tools.split(',').contains('sentieon_dnascope'))) { log.warn "If GATK's Haplotypecaller, Sentieon's Dnascope or Sentieon's Haplotyper is specified, without `--dbsnp` or `--known_indels no filtering will be done. For filtering, please provide at least one of `--dbsnp` or `--known_indels`.\nFor more information see FilterVariantTranches (single-sample, default): https://gatk.broadinstitute.org/hc/en-us/articles/5358928898971-FilterVariantTranches\nFor more information see VariantRecalibration (--joint_germline): https://gatk.broadinstitute.org/hc/en-us/articles/5358906115227-VariantRecalibrator\nFor more information on GATK Best practice germline variant calling: https://gatk.broadinstitute.org/hc/en-us/articles/360035535932-Germline-short-variant-discovery-SNPs-Indels-" } } - if (params.joint_germline && (!params.tools || !(params.tools.split(',').contains('haplotypecaller') || params.tools.split(',').contains('sentieon_haplotyper') || params.tools.split(',').contains('sentieon_dnascope')))) { + if (joint_germline && (!tools || !(tools.split(',').contains('haplotypecaller') || tools.split(',').contains('sentieon_haplotyper') || tools.split(',').contains('sentieon_dnascope')))) { error("The GATK's Haplotypecaller, Sentieon's Dnascope or Sentieon's Haplotyper should be specified as one of the tools when doing joint germline variant calling.) ") } if ( - params.tools && + tools && ( - params.tools.split(',').contains('haplotypecaller') || - params.tools.split(',').contains('sentieon_haplotyper') || - params.tools.split(',').contains('sentieon_dnascope') + tools.split(',').contains('haplotypecaller') || + tools.split(',').contains('sentieon_haplotyper') || + tools.split(',').contains('sentieon_dnascope') ) && - params.joint_germline && - ( - !params.dbsnp || - !params.known_indels || - !params.known_snps || - params.no_intervals - ) - ) { - log.warn("""If GATK's Haplotypecaller, Sentieon's Dnascope and/or Sentieon's Haplotyper is specified, \ - but without `--dbsnp`, `--known_snps`, `--known_indels` or the associated resource labels (ie `known_snps_vqsr`), \ - no variant recalibration will be done. For recalibration you must provide all of these resources.\nFor more information \ - see VariantRecalibration: https://gatk.broadinstitute.org/hc/en-us/articles/5358906115227-VariantRecalibrator \n\ - Joint germline variant calling also requires intervals in order to genotype the samples. \ - As a result, if `--no_intervals` is set to `true` the joint germline variant calling will not be performed.""") + joint_germline && + ( !dbsnp || !known_indels || !known_snps || no_intervals ) + ) { + log.warn("""If GATK's Haplotypecaller, Sentieon's Dnascope and/or Sentieon's Haplotyper is specified, but without `--dbsnp`, `--known_snps`, `--known_indels` or the associated resource labels (ie `known_snps_vqsr`), no variant recalibration will be done. For recalibration you must provide all of these resources.\nFor more information see VariantRecalibration: https://gatk.broadinstitute.org/hc/en-us/articles/5358906115227-VariantRecalibrator \n\ +Joint germline variant calling also requires intervals in order to genotype the samples. As a result, if `--no_intervals` is set to `true` the joint germline variant calling will not be performed.""") } - if (params.tools && - params.tools.split(',').contains('sentieon_dnascope') && - params.joint_germline && - ( - !params.sentieon_dnascope_emit_mode || - !params.sentieon_dnascope_emit_mode.split(',').contains('gvcf') - ) - ) { + if (tools && + tools.split(',').contains('sentieon_dnascope') && joint_germline && + ( !sentieon_dnascope_emit_mode || !sentieon_dnascope_emit_mode.split(',').contains('gvcf') ) + ) { error("When using Sentieon Dnascope for joint-germline variant-calling the option `--sentieon_dnascope_emit_mode` has to include `gvcf`.") } - if (params.tools && - params.tools.split(',').contains('sentieon_haplotyper') && - params.joint_germline && - ( - !params.sentieon_haplotyper_emit_mode || - !params.sentieon_haplotyper_emit_mode.split(',').contains('gvcf') - ) - ) { + if (tools && + tools.split(',').contains('sentieon_haplotyper') && joint_germline && + ( !sentieon_haplotyper_emit_mode || !sentieon_haplotyper_emit_mode.split(',').contains('gvcf') ) + ) { error("When using Sentieon Haplotyper for joint-germline variant-calling the option `--sentieon_haplotyper_emit_mode` has to include `gvcf`.") } // Fails when --joint_mutect2 is used without enabling mutect2 - if (params.joint_mutect2 && (!params.tools || !params.tools.split(',').contains('mutect2'))) { + if (joint_mutect2 && (!tools || !tools.split(',').contains('mutect2'))) { error("The mutect2 should be specified as one of the tools when doing joint somatic variant calling with Mutect2. (The mutect2 could be specified by adding `--tools mutect2` to the nextflow command.)") } // Fails when missing tools for variant_calling or annotate - if ((params.step == 'variant_calling' || params.step == 'annotate') && !params.tools) { - error("Please specify at least one tool when using `--step ${params.step}`.\nhttps://nf-co.re/sarek/parameters#tools") + if ((step == 'variant_calling' || step == 'annotate') && !tools) { + error("Please specify at least one tool when using `--step ${step}`.\nhttps://nf-co.re/sarek/parameters#tools") } // Fails when missing sex information for CNV tools - if (params.tools && (params.tools.split(',').contains('ascat') || params.tools.split(',').contains('controlfreec'))) { + if (tools && (tools.split(',').contains('ascat') || tools.split(',').contains('controlfreec'))) { input_sample.map{ if (it[0].sex == 'NA' ) { error("Please specify sex information for each sample in your samplesheet when using '--tools' with 'ascat' or 'controlfreec'.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") @@ -250,6 +262,11 @@ workflow SAMPLESHEET_TO_CHANNEL{ } } + // Fails when bcftools annotate is used but no files are supplied + if (tools && tools.split(',').contains('bcfann') && !(bcftools_annotations && bcftools_annotations_tbi && bcftools_header_lines)) { + error("Please specify --bcftools_annotations, --bcftools_annotations_tbi, and --bcftools_header_lines, when using BCFTools annotations") + } + emit: input_sample } @@ -286,5 +303,3 @@ def flowcellLaneFromFastq(path) { } return fcid } - - diff --git a/subworkflows/local/utils_nfcore_sarek_pipeline/main.nf b/subworkflows/local/utils_nfcore_sarek_pipeline/main.nf new file mode 100644 index 0000000000..afd58a8cc2 --- /dev/null +++ b/subworkflows/local/utils_nfcore_sarek_pipeline/main.nf @@ -0,0 +1,359 @@ +// +// Subworkflow with functionality specific to the nf-core/sarek pipeline +// + +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +include { paramsSummaryMap } from 'plugin/nf-validation' +include { fromSamplesheet } from 'plugin/nf-validation' +include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline' +include { UTILS_NFVALIDATION_PLUGIN } from '../../nf-core/utils_nfvalidation_plugin' +include { UTILS_NFCORE_PIPELINE } from '../../nf-core/utils_nfcore_pipeline' +include { completionEmail } from '../../nf-core/utils_nfcore_pipeline' +include { completionSummary } from '../../nf-core/utils_nfcore_pipeline' +include { dashedLine } from '../../nf-core/utils_nfcore_pipeline' +include { getWorkflowVersion } from '../../nf-core/utils_nfcore_pipeline' +include { imNotification } from '../../nf-core/utils_nfcore_pipeline' +include { logColours } from '../../nf-core/utils_nfcore_pipeline' +include { workflowCitation } from '../../nf-core/utils_nfcore_pipeline' +include { SAMPLESHEET_TO_CHANNEL } from '../samplesheet_to_channel' + +/* +======================================================================================== + SUBWORKFLOW TO INITIALISE PIPELINE +======================================================================================== +*/ + +workflow PIPELINE_INITIALISATION { + + take: + version // boolean: Display version and exit + help // boolean: Display help text + validate_params // boolean: Boolean whether to validate parameters against the schema at runtime + monochrome_logs // boolean: Do not use coloured log outputs + nextflow_cli_args // array: List of positional nextflow CLI args + outdir // string: The output directory where the results will be saved + input // string: Path to input samplesheet + + main: + + versions = Channel.empty() + + // + // Print version and exit if required and dump pipeline parameters to JSON file + // + UTILS_NEXTFLOW_PIPELINE ( + version, + true, + outdir, + workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1 + ) + + // + // Validate parameters and generate parameter summary to stdout + // + pre_help_text = nfCoreLogo(monochrome_logs) + post_help_text = '\n' + workflowCitation() + '\n' + dashedLine(monochrome_logs) + def String workflow_command = "nextflow run ${workflow.manifest.name} -profile --input samplesheet.csv --outdir " + UTILS_NFVALIDATION_PLUGIN ( + help, + workflow_command, + pre_help_text, + post_help_text, + validate_params, + "nextflow_schema.json" + ) + + // + // Check config provided to the pipeline + // + UTILS_NFCORE_PIPELINE(nextflow_cli_args) + + // + // Custom validation for pipeline parameters + // + validateInputParameters() + + // Check input path parameters to see if they exist + def checkPathParamList = [ + params.ascat_alleles, + params.ascat_loci, + params.ascat_loci_gc, + params.ascat_loci_rt, + params.bwa, + params.bwamem2, + params.bcftools_annotations, + params.bcftools_annotations_tbi, + params.bcftools_header_lines, + params.cf_chrom_len, + params.chr_dir, + params.cnvkit_reference, + params.dbnsfp, + params.dbnsfp_tbi, + params.dbsnp, + params.dbsnp_tbi, + params.dict, + params.dragmap, + params.fasta, + params.fasta_fai, + params.germline_resource, + params.germline_resource_tbi, + params.input, + params.intervals, + params.known_indels, + params.known_indels_tbi, + params.known_snps, + params.known_snps_tbi, + params.mappability, + params.multiqc_config, + params.ngscheckmate_bed, + params.pon, + params.pon_tbi, + params.sentieon_dnascope_model, + params.spliceai_indel, + params.spliceai_indel_tbi, + params.spliceai_snv, + params.spliceai_snv_tbi + ] + +// only check if we are using the tools +if (params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('merge'))) checkPathParamList.add(params.snpeff_cache) +if (params.tools && (params.tools.split(',').contains('vep') || params.tools.split(',').contains('merge'))) checkPathParamList.add(params.vep_cache) + + // def retrieveInput(need_input, step, outdir) { + + params.input_restart = retrieveInput((!params.build_only_index && !params.input), params.step, params.outdir) + + ch_from_samplesheet = params.build_only_index ? Channel.empty() : params.input ? Channel.fromSamplesheet("input") : Channel.fromSamplesheet("input_restart") + + SAMPLESHEET_TO_CHANNEL( + ch_from_samplesheet, + params.aligner, + params.ascat_alleles, + params.ascat_loci, + params.ascat_loci_gc, + params.ascat_loci_rt, + params.bcftools_annotations, + params.bcftools_annotations_tbi, + params.bcftools_header_lines, + params.build_only_index, + params.dbsnp, + params.fasta, + params.germline_resource, + params.intervals, + params.joint_germline, + params.joint_mutect2, + params.known_indels, + params.known_snps, + params.no_intervals, + params.pon, + params.sentieon_dnascope_emit_mode, + params.sentieon_haplotyper_emit_mode, + params.seq_center, + params.seq_platform, + params.skip_tools, + params.step, + params.tools, + params.umi_read_structure, + params.wes) + + emit: + samplesheet = SAMPLESHEET_TO_CHANNEL.out.input_sample + versions +} + +/* +======================================================================================== + SUBWORKFLOW FOR PIPELINE COMPLETION +======================================================================================== +*/ + +workflow PIPELINE_COMPLETION { + + take: + email // string: email address + email_on_fail // string: email address sent on pipeline failure + plaintext_email // boolean: Send plain-text email instead of HTML + outdir // path: Path to output directory where results will be published + monochrome_logs // boolean: Disable ANSI colour codes in log output + hook_url // string: hook URL for notifications + multiqc_report // string: Path to MultiQC report + + main: + + summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") + + // + // Completion email and summary + // + workflow.onComplete { + if (email || email_on_fail) { + completionEmail(summary_params, email, email_on_fail, plaintext_email, outdir, monochrome_logs, multiqc_report.toList()) + } + + completionSummary(monochrome_logs) + + if (hook_url) { + imNotification(summary_params, hook_url) + } + } +} + +/* +======================================================================================== + FUNCTIONS +======================================================================================== +*/ +// +// Check and validate pipeline parameters +// +def validateInputParameters() { + genomeExistsError() +} + +// +// Validate channels from input samplesheet +// +def validateInputSamplesheet(input) { + def (metas, fastqs) = input[1..2] + + // Check that multiple runs of the same sample are of the same datatype i.e. single-end / paired-end + def endedness_ok = metas.collect{ it.single_end }.unique().size == 1 + if (!endedness_ok) { + error("Please check input samplesheet -> Multiple runs of a sample must be of the same datatype i.e. single-end or paired-end: ${metas[0].id}") + } + + return [ metas[0], fastqs ] +} + +// +// Exit pipeline if incorrect --genome key provided +// +def genomeExistsError() { + if (params.genomes && params.genome && !params.genomes.containsKey(params.genome)) { + def error_string = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + + " Genome '${params.genome}' not found in any config files provided to the pipeline.\n" + + " Currently, the available genome keys are:\n" + + " ${params.genomes.keySet().join(", ")}\n" + + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + error(error_string) + } +} + +// +// Generate methods description for MultiQC +// +def toolCitationText() { + // TODO nf-core: Optionally add in-text citation tools to this list. + // Can use ternary operators to dynamically construct based conditions, e.g. params["run_xyz"] ? "Tool (Foo et al. 2023)" : "", + // Uncomment function in methodsDescriptionText to render in MultiQC report + def citation_text = [ + "Tools used in the workflow included:", + "FastQC (Andrews 2010),", + "MultiQC (Ewels et al. 2016)", + "." + ].join(' ').trim() + + return citation_text +} + +def toolBibliographyText() { + // TODO nf-core: Optionally add bibliographic entries to this list. + // Can use ternary operators to dynamically construct based conditions, e.g. params["run_xyz"] ? "
  • Author (2023) Pub name, Journal, DOI
  • " : "", + // Uncomment function in methodsDescriptionText to render in MultiQC report + def reference_text = [ + "
  • Andrews S, (2010) FastQC, URL: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/).
  • ", + "
  • Ewels, P., Magnusson, M., Lundin, S., & Käller, M. (2016). MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics , 32(19), 3047–3048. doi: /10.1093/bioinformatics/btw354
  • " + ].join(' ').trim() + + return reference_text +} + +def methodsDescriptionText(mqc_methods_yaml) { + // Convert to a named map so can be used as with familar NXF ${workflow} variable syntax in the MultiQC YML file + def meta = [:] + meta.workflow = workflow.toMap() + meta["manifest_map"] = workflow.manifest.toMap() + + // Pipeline DOI + meta["doi_text"] = meta.manifest_map.doi ? "(doi: ${meta.manifest_map.doi})" : "" + meta["nodoi_text"] = meta.manifest_map.doi ? "": "
  • If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used.
  • " + + // Tool references + meta["tool_citations"] = "" + meta["tool_bibliography"] = "" + + // TODO nf-core: Only uncomment below if logic in toolCitationText/toolBibliographyText has been filled! + // meta["tool_citations"] = toolCitationText().replaceAll(", \\.", ".").replaceAll("\\. \\.", ".").replaceAll(", \\.", ".") + // meta["tool_bibliography"] = toolBibliographyText() + + + def methods_text = mqc_methods_yaml.text + + def engine = new groovy.text.SimpleTemplateEngine() + def description_html = engine.createTemplate(methods_text).make(meta) + + return description_html.toString() +} + +// +// nf-core/sarek logo +// +def nfCoreLogo(monochrome_logs=true) { + Map colors = logColours(monochrome_logs) + String.format( + """\n + ${dashedLine(monochrome_logs)} + ${colors.green},--.${colors.black}/${colors.green},-.${colors.reset} + ${colors.blue} ___ __ __ __ ___ ${colors.green}/,-._.--~\'${colors.reset} + ${colors.blue} |\\ | |__ __ / ` / \\ |__) |__ ${colors.yellow}} {${colors.reset} + ${colors.blue} | \\| | \\__, \\__/ | \\ |___ ${colors.green}\\`-._,-`-,${colors.reset} + ${colors.green}`._,._,\'${colors.reset} + ${colors.white} ____${colors.reset} + ${colors.white} .´ _ `.${colors.reset} + ${colors.white} / ${colors.green}|\\${colors.reset}`-_ \\${colors.reset} ${colors.blue} __ __ ___ ${colors.reset} + ${colors.white} | ${colors.green}| \\${colors.reset} `-|${colors.reset} ${colors.blue}|__` /\\ |__) |__ |__/${colors.reset} + ${colors.white} \\ ${colors.green}| \\${colors.reset} /${colors.reset} ${colors.blue}.__| /¯¯\\ | \\ |___ | \\${colors.reset} + ${colors.white} `${colors.green}|${colors.reset}____${colors.green}\\${colors.reset}´${colors.reset} + + ${colors.purple} ${workflow.manifest.name} ${getWorkflowVersion()}${colors.reset} + ${dashedLine(monochrome_logs)} + """.stripIndent() + ) +} + +// +// retrieveInput +// +def retrieveInput(need_input, step, outdir) { + def input = null + if (!params.input && !params.build_only_index) { + switch (step) { + case 'mapping': Nextflow.error("Can't start with step $step without samplesheet") + break + case 'markduplicates': log.warn("Using file ${outdir}/csv/mapped.csv"); + input = outdir + "/csv/mapped.csv" + break + case 'prepare_recalibration': log.warn("Using file ${outdir}/csv/markduplicates_no_table.csv"); + input = outdir + "/csv/markduplicates_no_table.csv" + break + case 'recalibrate': log.warn("Using file ${outdir}/csv/markduplicates.csv"); + input = outdir + "/csv/markduplicates.csv" + break + case 'variant_calling': log.warn("Using file ${outdir}/csv/recalibrated.csv"); + input = outdir + "/csv/recalibrated.csv" + break + // case 'controlfreec': csv_file = file("${outdir}/variant_calling/csv/control-freec_mpileup.csv", checkIfExists: true); break + case 'annotate': log.warn("Using file ${outdir}/csv/variantcalled.csv"); + input = outdir + "/csv/variantcalled.csv" + break + default: log.warn("Please provide an input samplesheet to the pipeline e.g. '--input samplesheet.csv'") + Nextflow.error("Unknown step $step") + } + } + return input +} diff --git a/subworkflows/local/vcf_annotate_all/main.nf b/subworkflows/local/vcf_annotate_all/main.nf index 89d4b696c3..20cab4be1c 100644 --- a/subworkflows/local/vcf_annotate_all/main.nf +++ b/subworkflows/local/vcf_annotate_all/main.nf @@ -41,7 +41,7 @@ workflow VCF_ANNOTATE_ALL { if (tools.split(',').contains('merge') || tools.split(',').contains('snpeff')) { VCF_ANNOTATE_SNPEFF(vcf, snpeff_db, snpeff_cache) - reports = reports.mix(VCF_ANNOTATE_SNPEFF.out.reports) + reports = reports.mix(VCF_ANNOTATE_SNPEFF.out.reports.map{ meta, reports -> [ reports ] }) vcf_ann = vcf_ann.mix(VCF_ANNOTATE_SNPEFF.out.vcf_tbi) versions = versions.mix(VCF_ANNOTATE_SNPEFF.out.versions) } diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/main.nf b/subworkflows/nf-core/utils_nextflow_pipeline/main.nf new file mode 100644 index 0000000000..ac31f28f66 --- /dev/null +++ b/subworkflows/nf-core/utils_nextflow_pipeline/main.nf @@ -0,0 +1,126 @@ +// +// Subworkflow with functionality that may be useful for any Nextflow pipeline +// + +import org.yaml.snakeyaml.Yaml +import groovy.json.JsonOutput +import nextflow.extension.FilesEx + +/* +======================================================================================== + SUBWORKFLOW DEFINITION +======================================================================================== +*/ + +workflow UTILS_NEXTFLOW_PIPELINE { + + take: + print_version // boolean: print version + dump_parameters // boolean: dump parameters + outdir // path: base directory used to publish pipeline results + check_conda_channels // boolean: check conda channels + + main: + + // + // Print workflow version and exit on --version + // + if (print_version) { + log.info "${workflow.manifest.name} ${getWorkflowVersion()}" + System.exit(0) + } + + // + // Dump pipeline parameters to a JSON file + // + if (dump_parameters && outdir) { + dumpParametersToJSON(outdir) + } + + // + // When running with Conda, warn if channels have not been set-up appropriately + // + if (check_conda_channels) { + checkCondaChannels() + } + + emit: + dummy_emit = true +} + +/* +======================================================================================== + FUNCTIONS +======================================================================================== +*/ + +// +// Generate version string +// +def getWorkflowVersion() { + String version_string = "" + if (workflow.manifest.version) { + def prefix_v = workflow.manifest.version[0] != 'v' ? 'v' : '' + version_string += "${prefix_v}${workflow.manifest.version}" + } + + if (workflow.commitId) { + def git_shortsha = workflow.commitId.substring(0, 7) + version_string += "-g${git_shortsha}" + } + + return version_string +} + +// +// Dump pipeline parameters to a JSON file +// +def dumpParametersToJSON(outdir) { + def timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss') + def filename = "params_${timestamp}.json" + def temp_pf = new File(workflow.launchDir.toString(), ".${filename}") + def jsonStr = JsonOutput.toJson(params) + temp_pf.text = JsonOutput.prettyPrint(jsonStr) + + FilesEx.copyTo(temp_pf.toPath(), "${outdir}/pipeline_info/params_${timestamp}.json") + temp_pf.delete() +} + +// +// When running with -profile conda, warn if channels have not been set-up appropriately +// +def checkCondaChannels() { + Yaml parser = new Yaml() + def channels = [] + try { + def config = parser.load("conda config --show channels".execute().text) + channels = config.channels + } catch(NullPointerException | IOException e) { + log.warn "Could not verify conda channel configuration." + return + } + + // Check that all channels are present + // This channel list is ordered by required channel priority. + def required_channels_in_order = ['conda-forge', 'bioconda', 'defaults'] + def channels_missing = ((required_channels_in_order as Set) - (channels as Set)) as Boolean + + // Check that they are in the right order + def channel_priority_violation = false + def n = required_channels_in_order.size() + for (int i = 0; i < n - 1; i++) { + channel_priority_violation |= !(channels.indexOf(required_channels_in_order[i]) < channels.indexOf(required_channels_in_order[i+1])) + } + + if (channels_missing | channel_priority_violation) { + log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + + " There is a problem with your Conda configuration!\n\n" + + " You will need to set-up the conda-forge and bioconda channels correctly.\n" + + " Please refer to https://bioconda.github.io/\n" + + " The observed channel order is \n" + + " ${channels}\n" + + " but the following channel order is required:\n" + + " ${required_channels_in_order}\n" + + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + } +} diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/meta.yml b/subworkflows/nf-core/utils_nextflow_pipeline/meta.yml new file mode 100644 index 0000000000..e5c3a0a828 --- /dev/null +++ b/subworkflows/nf-core/utils_nextflow_pipeline/meta.yml @@ -0,0 +1,38 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "UTILS_NEXTFLOW_PIPELINE" +description: Subworkflow with functionality that may be useful for any Nextflow pipeline +keywords: + - utility + - pipeline + - initialise + - version +components: [] +input: + - print_version: + type: boolean + description: | + Print the version of the pipeline and exit + - dump_parameters: + type: boolean + description: | + Dump the parameters of the pipeline to a JSON file + - output_directory: + type: directory + description: Path to output dir to write JSON file to. + pattern: "results/" + - check_conda_channel: + type: boolean + description: | + Check if the conda channel priority is correct. +output: + - dummy_emit: + type: boolean + description: | + Dummy emit to make nf-core subworkflows lint happy +authors: + - "@adamrtalbot" + - "@drpatelh" +maintainers: + - "@adamrtalbot" + - "@drpatelh" + - "@maxulysse" diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test b/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test new file mode 100644 index 0000000000..68718e4f59 --- /dev/null +++ b/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test @@ -0,0 +1,54 @@ + +nextflow_function { + + name "Test Functions" + script "subworkflows/nf-core/utils_nextflow_pipeline/main.nf" + config "subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config" + tag 'subworkflows' + tag 'utils_nextflow_pipeline' + tag 'subworkflows/utils_nextflow_pipeline' + + test("Test Function getWorkflowVersion") { + + function "getWorkflowVersion" + + then { + assertAll( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + } + + test("Test Function dumpParametersToJSON") { + + function "dumpParametersToJSON" + + when { + function { + """ + // define inputs of the function here. Example: + input[0] = "$outputDir" + """.stripIndent() + } + } + + then { + assertAll( + { assert function.success } + ) + } + } + + test("Test Function checkCondaChannels") { + + function "checkCondaChannels" + + then { + assertAll( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + } +} diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test.snap b/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test.snap new file mode 100644 index 0000000000..e3f0baf473 --- /dev/null +++ b/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test.snap @@ -0,0 +1,20 @@ +{ + "Test Function getWorkflowVersion": { + "content": [ + "v9.9.9" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T12:02:05.308243" + }, + "Test Function checkCondaChannels": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T12:02:12.425833" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.workflow.nf.test b/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.workflow.nf.test new file mode 100644 index 0000000000..ca964ce8e1 --- /dev/null +++ b/subworkflows/nf-core/utils_nextflow_pipeline/tests/main.workflow.nf.test @@ -0,0 +1,111 @@ +nextflow_workflow { + + name "Test Workflow UTILS_NEXTFLOW_PIPELINE" + script "../main.nf" + config "subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config" + workflow "UTILS_NEXTFLOW_PIPELINE" + tag 'subworkflows' + tag 'utils_nextflow_pipeline' + tag 'subworkflows/utils_nextflow_pipeline' + + test("Should run no inputs") { + + when { + workflow { + """ + print_version = false + dump_parameters = false + outdir = null + check_conda_channels = false + + input[0] = print_version + input[1] = dump_parameters + input[2] = outdir + input[3] = check_conda_channels + """ + } + } + + then { + assertAll( + { assert workflow.success } + ) + } + } + + test("Should print version") { + + when { + workflow { + """ + print_version = true + dump_parameters = false + outdir = null + check_conda_channels = false + + input[0] = print_version + input[1] = dump_parameters + input[2] = outdir + input[3] = check_conda_channels + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.stdout.contains("nextflow_workflow v9.9.9") } + ) + } + } + + test("Should dump params") { + + when { + workflow { + """ + print_version = false + dump_parameters = true + outdir = 'results' + check_conda_channels = false + + input[0] = false + input[1] = true + input[2] = outdir + input[3] = false + """ + } + } + + then { + assertAll( + { assert workflow.success } + ) + } + } + + test("Should not create params JSON if no output directory") { + + when { + workflow { + """ + print_version = false + dump_parameters = true + outdir = null + check_conda_channels = false + + input[0] = false + input[1] = true + input[2] = outdir + input[3] = false + """ + } + } + + then { + assertAll( + { assert workflow.success } + ) + } + } +} diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config b/subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config new file mode 100644 index 0000000000..d0a926bf6d --- /dev/null +++ b/subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config @@ -0,0 +1,9 @@ +manifest { + name = 'nextflow_workflow' + author = """nf-core""" + homePage = 'https://127.0.0.1' + description = """Dummy pipeline""" + nextflowVersion = '!>=23.04.0' + version = '9.9.9' + doi = 'https://doi.org/10.5281/zenodo.5070524' +} diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/tests/tags.yml b/subworkflows/nf-core/utils_nextflow_pipeline/tests/tags.yml new file mode 100644 index 0000000000..f84761125a --- /dev/null +++ b/subworkflows/nf-core/utils_nextflow_pipeline/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/utils_nextflow_pipeline: + - subworkflows/nf-core/utils_nextflow_pipeline/** diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf new file mode 100644 index 0000000000..a8b55d6fe1 --- /dev/null +++ b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf @@ -0,0 +1,440 @@ +// +// Subworkflow with utility functions specific to the nf-core pipeline template +// + +import org.yaml.snakeyaml.Yaml +import nextflow.extension.FilesEx + +/* +======================================================================================== + SUBWORKFLOW DEFINITION +======================================================================================== +*/ + +workflow UTILS_NFCORE_PIPELINE { + + take: + nextflow_cli_args + + main: + valid_config = checkConfigProvided() + checkProfileProvided(nextflow_cli_args) + + emit: + valid_config +} + +/* +======================================================================================== + FUNCTIONS +======================================================================================== +*/ + +// +// Warn if a -profile or Nextflow config has not been provided to run the pipeline +// +def checkConfigProvided() { + valid_config = true + if (workflow.profile == 'standard' && workflow.configFiles.size() <= 1) { + log.warn "[$workflow.manifest.name] You are attempting to run the pipeline without any custom configuration!\n\n" + + "This will be dependent on your local compute environment but can be achieved via one or more of the following:\n" + + " (1) Using an existing pipeline profile e.g. `-profile docker` or `-profile singularity`\n" + + " (2) Using an existing nf-core/configs for your Institution e.g. `-profile crick` or `-profile uppmax`\n" + + " (3) Using your own local custom config e.g. `-c /path/to/your/custom.config`\n\n" + + "Please refer to the quick start section and usage docs for the pipeline.\n " + valid_config = false + } + return valid_config +} + +// +// Exit pipeline if --profile contains spaces +// +def checkProfileProvided(nextflow_cli_args) { + if (workflow.profile.endsWith(',')) { + error "The `-profile` option cannot end with a trailing comma, please remove it and re-run the pipeline!\n" + + "HINT: A common mistake is to provide multiple values separated by spaces e.g. `-profile test, docker`.\n" + } + if (nextflow_cli_args[0]) { + log.warn "nf-core pipelines do not accept positional arguments. The positional argument `${nextflow_cli_args[0]}` has been detected.\n" + + "HINT: A common mistake is to provide multiple values separated by spaces e.g. `-profile test, docker`.\n" + } +} + +// +// Citation string for pipeline +// +def workflowCitation() { + return "If you use ${workflow.manifest.name} for your analysis please cite:\n\n" + + "* The pipeline\n" + + " ${workflow.manifest.doi}\n\n" + + "* The nf-core framework\n" + + " https://doi.org/10.1038/s41587-020-0439-x\n\n" + + "* Software dependencies\n" + + " https://github.com/${workflow.manifest.name}/blob/master/CITATIONS.md" +} + +// +// Generate workflow version string +// +def getWorkflowVersion() { + String version_string = "" + if (workflow.manifest.version) { + def prefix_v = workflow.manifest.version[0] != 'v' ? 'v' : '' + version_string += "${prefix_v}${workflow.manifest.version}" + } + + if (workflow.commitId) { + def git_shortsha = workflow.commitId.substring(0, 7) + version_string += "-g${git_shortsha}" + } + + return version_string +} + +// +// Get software versions for pipeline +// +def processVersionsFromYAML(yaml_file) { + Yaml yaml = new Yaml() + versions = yaml.load(yaml_file).collectEntries { k, v -> [ k.tokenize(':')[-1], v ] } + return yaml.dumpAsMap(versions).trim() +} + +// +// Get workflow version for pipeline +// +def workflowVersionToYAML() { + return """ + Workflow: + $workflow.manifest.name: ${getWorkflowVersion()} + Nextflow: $workflow.nextflow.version + """.stripIndent().trim() +} + +// +// Get channel of software versions used in pipeline in YAML format +// +def softwareVersionsToYAML(ch_versions) { + return ch_versions + .unique() + .map { processVersionsFromYAML(it) } + .unique() + .mix(Channel.of(workflowVersionToYAML())) +} + +// +// Get workflow summary for MultiQC +// +def paramsSummaryMultiqc(summary_params) { + def summary_section = '' + for (group in summary_params.keySet()) { + def group_params = summary_params.get(group) // This gets the parameters of that particular group + if (group_params) { + summary_section += "

    $group

    \n" + summary_section += "
    \n" + for (param in group_params.keySet()) { + summary_section += "
    $param
    ${group_params.get(param) ?: 'N/A'}
    \n" + } + summary_section += "
    \n" + } + } + + String yaml_file_text = "id: '${workflow.manifest.name.replace('/','-')}-summary'\n" + yaml_file_text += "description: ' - this information is collected when the pipeline is started.'\n" + yaml_file_text += "section_name: '${workflow.manifest.name} Workflow Summary'\n" + yaml_file_text += "section_href: 'https://github.com/${workflow.manifest.name}'\n" + yaml_file_text += "plot_type: 'html'\n" + yaml_file_text += "data: |\n" + yaml_file_text += "${summary_section}" + + return yaml_file_text +} + +// +// nf-core logo +// +def nfCoreLogo(monochrome_logs=true) { + Map colors = logColours(monochrome_logs) + String.format( + """\n + ${dashedLine(monochrome_logs)} + ${colors.green},--.${colors.black}/${colors.green},-.${colors.reset} + ${colors.blue} ___ __ __ __ ___ ${colors.green}/,-._.--~\'${colors.reset} + ${colors.blue} |\\ | |__ __ / ` / \\ |__) |__ ${colors.yellow}} {${colors.reset} + ${colors.blue} | \\| | \\__, \\__/ | \\ |___ ${colors.green}\\`-._,-`-,${colors.reset} + ${colors.green}`._,._,\'${colors.reset} + ${colors.purple} ${workflow.manifest.name} ${getWorkflowVersion()}${colors.reset} + ${dashedLine(monochrome_logs)} + """.stripIndent() + ) +} + +// +// Return dashed line +// +def dashedLine(monochrome_logs=true) { + Map colors = logColours(monochrome_logs) + return "-${colors.dim}----------------------------------------------------${colors.reset}-" +} + +// +// ANSII colours used for terminal logging +// +def logColours(monochrome_logs=true) { + Map colorcodes = [:] + + // Reset / Meta + colorcodes['reset'] = monochrome_logs ? '' : "\033[0m" + colorcodes['bold'] = monochrome_logs ? '' : "\033[1m" + colorcodes['dim'] = monochrome_logs ? '' : "\033[2m" + colorcodes['underlined'] = monochrome_logs ? '' : "\033[4m" + colorcodes['blink'] = monochrome_logs ? '' : "\033[5m" + colorcodes['reverse'] = monochrome_logs ? '' : "\033[7m" + colorcodes['hidden'] = monochrome_logs ? '' : "\033[8m" + + // Regular Colors + colorcodes['black'] = monochrome_logs ? '' : "\033[0;30m" + colorcodes['red'] = monochrome_logs ? '' : "\033[0;31m" + colorcodes['green'] = monochrome_logs ? '' : "\033[0;32m" + colorcodes['yellow'] = monochrome_logs ? '' : "\033[0;33m" + colorcodes['blue'] = monochrome_logs ? '' : "\033[0;34m" + colorcodes['purple'] = monochrome_logs ? '' : "\033[0;35m" + colorcodes['cyan'] = monochrome_logs ? '' : "\033[0;36m" + colorcodes['white'] = monochrome_logs ? '' : "\033[0;37m" + + // Bold + colorcodes['bblack'] = monochrome_logs ? '' : "\033[1;30m" + colorcodes['bred'] = monochrome_logs ? '' : "\033[1;31m" + colorcodes['bgreen'] = monochrome_logs ? '' : "\033[1;32m" + colorcodes['byellow'] = monochrome_logs ? '' : "\033[1;33m" + colorcodes['bblue'] = monochrome_logs ? '' : "\033[1;34m" + colorcodes['bpurple'] = monochrome_logs ? '' : "\033[1;35m" + colorcodes['bcyan'] = monochrome_logs ? '' : "\033[1;36m" + colorcodes['bwhite'] = monochrome_logs ? '' : "\033[1;37m" + + // Underline + colorcodes['ublack'] = monochrome_logs ? '' : "\033[4;30m" + colorcodes['ured'] = monochrome_logs ? '' : "\033[4;31m" + colorcodes['ugreen'] = monochrome_logs ? '' : "\033[4;32m" + colorcodes['uyellow'] = monochrome_logs ? '' : "\033[4;33m" + colorcodes['ublue'] = monochrome_logs ? '' : "\033[4;34m" + colorcodes['upurple'] = monochrome_logs ? '' : "\033[4;35m" + colorcodes['ucyan'] = monochrome_logs ? '' : "\033[4;36m" + colorcodes['uwhite'] = monochrome_logs ? '' : "\033[4;37m" + + // High Intensity + colorcodes['iblack'] = monochrome_logs ? '' : "\033[0;90m" + colorcodes['ired'] = monochrome_logs ? '' : "\033[0;91m" + colorcodes['igreen'] = monochrome_logs ? '' : "\033[0;92m" + colorcodes['iyellow'] = monochrome_logs ? '' : "\033[0;93m" + colorcodes['iblue'] = monochrome_logs ? '' : "\033[0;94m" + colorcodes['ipurple'] = monochrome_logs ? '' : "\033[0;95m" + colorcodes['icyan'] = monochrome_logs ? '' : "\033[0;96m" + colorcodes['iwhite'] = monochrome_logs ? '' : "\033[0;97m" + + // Bold High Intensity + colorcodes['biblack'] = monochrome_logs ? '' : "\033[1;90m" + colorcodes['bired'] = monochrome_logs ? '' : "\033[1;91m" + colorcodes['bigreen'] = monochrome_logs ? '' : "\033[1;92m" + colorcodes['biyellow'] = monochrome_logs ? '' : "\033[1;93m" + colorcodes['biblue'] = monochrome_logs ? '' : "\033[1;94m" + colorcodes['bipurple'] = monochrome_logs ? '' : "\033[1;95m" + colorcodes['bicyan'] = monochrome_logs ? '' : "\033[1;96m" + colorcodes['biwhite'] = monochrome_logs ? '' : "\033[1;97m" + + return colorcodes +} + +// +// Attach the multiqc report to email +// +def attachMultiqcReport(multiqc_report) { + def mqc_report = null + try { + if (workflow.success) { + mqc_report = multiqc_report.getVal() + if (mqc_report.getClass() == ArrayList && mqc_report.size() >= 1) { + if (mqc_report.size() > 1) { + log.warn "[$workflow.manifest.name] Found multiple reports from process 'MULTIQC', will use only one" + } + mqc_report = mqc_report[0] + } + } + } catch (all) { + if (multiqc_report) { + log.warn "[$workflow.manifest.name] Could not attach MultiQC report to summary email" + } + } + return mqc_report +} + +// +// Construct and send completion email +// +def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdir, monochrome_logs=true, multiqc_report=null) { + + // Set up the e-mail variables + def subject = "[$workflow.manifest.name] Successful: $workflow.runName" + if (!workflow.success) { + subject = "[$workflow.manifest.name] FAILED: $workflow.runName" + } + + def summary = [:] + for (group in summary_params.keySet()) { + summary << summary_params[group] + } + + def misc_fields = [:] + misc_fields['Date Started'] = workflow.start + misc_fields['Date Completed'] = workflow.complete + misc_fields['Pipeline script file path'] = workflow.scriptFile + misc_fields['Pipeline script hash ID'] = workflow.scriptId + if (workflow.repository) misc_fields['Pipeline repository Git URL'] = workflow.repository + if (workflow.commitId) misc_fields['Pipeline repository Git Commit'] = workflow.commitId + if (workflow.revision) misc_fields['Pipeline Git branch/tag'] = workflow.revision + misc_fields['Nextflow Version'] = workflow.nextflow.version + misc_fields['Nextflow Build'] = workflow.nextflow.build + misc_fields['Nextflow Compile Timestamp'] = workflow.nextflow.timestamp + + def email_fields = [:] + email_fields['version'] = getWorkflowVersion() + email_fields['runName'] = workflow.runName + email_fields['success'] = workflow.success + email_fields['dateComplete'] = workflow.complete + email_fields['duration'] = workflow.duration + email_fields['exitStatus'] = workflow.exitStatus + email_fields['errorMessage'] = (workflow.errorMessage ?: 'None') + email_fields['errorReport'] = (workflow.errorReport ?: 'None') + email_fields['commandLine'] = workflow.commandLine + email_fields['projectDir'] = workflow.projectDir + email_fields['summary'] = summary << misc_fields + + // On success try attach the multiqc report + def mqc_report = attachMultiqcReport(multiqc_report) + + // Check if we are only sending emails on failure + def email_address = email + if (!email && email_on_fail && !workflow.success) { + email_address = email_on_fail + } + + // Render the TXT template + def engine = new groovy.text.GStringTemplateEngine() + def tf = new File("${workflow.projectDir}/assets/email_template.txt") + def txt_template = engine.createTemplate(tf).make(email_fields) + def email_txt = txt_template.toString() + + // Render the HTML template + def hf = new File("${workflow.projectDir}/assets/email_template.html") + def html_template = engine.createTemplate(hf).make(email_fields) + def email_html = html_template.toString() + + // Render the sendmail template + def max_multiqc_email_size = (params.containsKey('max_multiqc_email_size') ? params.max_multiqc_email_size : 0) as nextflow.util.MemoryUnit + def smail_fields = [ email: email_address, subject: subject, email_txt: email_txt, email_html: email_html, projectDir: "${workflow.projectDir}", mqcFile: mqc_report, mqcMaxSize: max_multiqc_email_size.toBytes() ] + def sf = new File("${workflow.projectDir}/assets/sendmail_template.txt") + def sendmail_template = engine.createTemplate(sf).make(smail_fields) + def sendmail_html = sendmail_template.toString() + + // Send the HTML e-mail + Map colors = logColours(monochrome_logs) + if (email_address) { + try { + if (plaintext_email) { throw GroovyException('Send plaintext e-mail, not HTML') } + // Try to send HTML e-mail using sendmail + def sendmail_tf = new File(workflow.launchDir.toString(), ".sendmail_tmp.html") + sendmail_tf.withWriter { w -> w << sendmail_html } + [ 'sendmail', '-t' ].execute() << sendmail_html + log.info "-${colors.purple}[$workflow.manifest.name]${colors.green} Sent summary e-mail to $email_address (sendmail)-" + } catch (all) { + // Catch failures and try with plaintext + def mail_cmd = [ 'mail', '-s', subject, '--content-type=text/html', email_address ] + mail_cmd.execute() << email_html + log.info "-${colors.purple}[$workflow.manifest.name]${colors.green} Sent summary e-mail to $email_address (mail)-" + } + } + + // Write summary e-mail HTML to a file + def output_hf = new File(workflow.launchDir.toString(), ".pipeline_report.html") + output_hf.withWriter { w -> w << email_html } + FilesEx.copyTo(output_hf.toPath(), "${outdir}/pipeline_info/pipeline_report.html"); + output_hf.delete() + + // Write summary e-mail TXT to a file + def output_tf = new File(workflow.launchDir.toString(), ".pipeline_report.txt") + output_tf.withWriter { w -> w << email_txt } + FilesEx.copyTo(output_tf.toPath(), "${outdir}/pipeline_info/pipeline_report.txt"); + output_tf.delete() +} + +// +// Print pipeline summary on completion +// +def completionSummary(monochrome_logs=true) { + Map colors = logColours(monochrome_logs) + if (workflow.success) { + if (workflow.stats.ignoredCount == 0) { + log.info "-${colors.purple}[$workflow.manifest.name]${colors.green} Pipeline completed successfully${colors.reset}-" + } else { + log.info "-${colors.purple}[$workflow.manifest.name]${colors.yellow} Pipeline completed successfully, but with errored process(es) ${colors.reset}-" + } + } else { + log.info "-${colors.purple}[$workflow.manifest.name]${colors.red} Pipeline completed with errors${colors.reset}-" + } +} + +// +// Construct and send a notification to a web server as JSON e.g. Microsoft Teams and Slack +// +def imNotification(summary_params, hook_url) { + def summary = [:] + for (group in summary_params.keySet()) { + summary << summary_params[group] + } + + def misc_fields = [:] + misc_fields['start'] = workflow.start + misc_fields['complete'] = workflow.complete + misc_fields['scriptfile'] = workflow.scriptFile + misc_fields['scriptid'] = workflow.scriptId + if (workflow.repository) misc_fields['repository'] = workflow.repository + if (workflow.commitId) misc_fields['commitid'] = workflow.commitId + if (workflow.revision) misc_fields['revision'] = workflow.revision + misc_fields['nxf_version'] = workflow.nextflow.version + misc_fields['nxf_build'] = workflow.nextflow.build + misc_fields['nxf_timestamp'] = workflow.nextflow.timestamp + + def msg_fields = [:] + msg_fields['version'] = getWorkflowVersion() + msg_fields['runName'] = workflow.runName + msg_fields['success'] = workflow.success + msg_fields['dateComplete'] = workflow.complete + msg_fields['duration'] = workflow.duration + msg_fields['exitStatus'] = workflow.exitStatus + msg_fields['errorMessage'] = (workflow.errorMessage ?: 'None') + msg_fields['errorReport'] = (workflow.errorReport ?: 'None') + msg_fields['commandLine'] = workflow.commandLine.replaceFirst(/ +--hook_url +[^ ]+/, "") + msg_fields['projectDir'] = workflow.projectDir + msg_fields['summary'] = summary << misc_fields + + // Render the JSON template + def engine = new groovy.text.GStringTemplateEngine() + // Different JSON depending on the service provider + // Defaults to "Adaptive Cards" (https://adaptivecards.io), except Slack which has its own format + def json_path = hook_url.contains("hooks.slack.com") ? "slackreport.json" : "adaptivecard.json" + def hf = new File("${workflow.projectDir}/assets/${json_path}") + def json_template = engine.createTemplate(hf).make(msg_fields) + def json_message = json_template.toString() + + // POST + def post = new URL(hook_url).openConnection(); + post.setRequestMethod("POST") + post.setDoOutput(true) + post.setRequestProperty("Content-Type", "application/json") + post.getOutputStream().write(json_message.getBytes("UTF-8")); + def postRC = post.getResponseCode(); + if (! postRC.equals(200)) { + log.warn(post.getErrorStream().getText()); + } +} diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/meta.yml b/subworkflows/nf-core/utils_nfcore_pipeline/meta.yml new file mode 100644 index 0000000000..d08d24342d --- /dev/null +++ b/subworkflows/nf-core/utils_nfcore_pipeline/meta.yml @@ -0,0 +1,24 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "UTILS_NFCORE_PIPELINE" +description: Subworkflow with utility functions specific to the nf-core pipeline template +keywords: + - utility + - pipeline + - initialise + - version +components: [] +input: + - nextflow_cli_args: + type: list + description: | + Nextflow CLI positional arguments +output: + - success: + type: boolean + description: | + Dummy output to indicate success +authors: + - "@adamrtalbot" +maintainers: + - "@adamrtalbot" + - "@maxulysse" diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test new file mode 100644 index 0000000000..1dc317f8f7 --- /dev/null +++ b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test @@ -0,0 +1,134 @@ + +nextflow_function { + + name "Test Functions" + script "../main.nf" + config "subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config" + tag "subworkflows" + tag "subworkflows_nfcore" + tag "utils_nfcore_pipeline" + tag "subworkflows/utils_nfcore_pipeline" + + test("Test Function checkConfigProvided") { + + function "checkConfigProvided" + + then { + assertAll( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + } + + test("Test Function checkProfileProvided") { + + function "checkProfileProvided" + + when { + function { + """ + input[0] = [] + """ + } + } + + then { + assertAll( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + } + + test("Test Function workflowCitation") { + + function "workflowCitation" + + then { + assertAll( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + } + + test("Test Function nfCoreLogo") { + + function "nfCoreLogo" + + when { + function { + """ + input[0] = false + """ + } + } + + then { + assertAll( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + } + + test("Test Function dashedLine") { + + function "dashedLine" + + when { + function { + """ + input[0] = false + """ + } + } + + then { + assertAll( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + } + + test("Test Function without logColours") { + + function "logColours" + + when { + function { + """ + input[0] = true + """ + } + } + + then { + assertAll( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + } + + test("Test Function with logColours") { + function "logColours" + + when { + function { + """ + input[0] = false + """ + } + } + + then { + assertAll( + { assert function.success }, + { assert snapshot(function.result).match() } + ) + } + } +} diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test.snap b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test.snap new file mode 100644 index 0000000000..1037232c9e --- /dev/null +++ b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.function.nf.test.snap @@ -0,0 +1,166 @@ +{ + "Test Function checkProfileProvided": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T12:03:03.360873" + }, + "Test Function checkConfigProvided": { + "content": [ + true + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T12:02:59.729647" + }, + "Test Function nfCoreLogo": { + "content": [ + "\n\n-\u001b[2m----------------------------------------------------\u001b[0m-\n \u001b[0;32m,--.\u001b[0;30m/\u001b[0;32m,-.\u001b[0m\n\u001b[0;34m ___ __ __ __ ___ \u001b[0;32m/,-._.--~'\u001b[0m\n\u001b[0;34m |\\ | |__ __ / ` / \\ |__) |__ \u001b[0;33m} {\u001b[0m\n\u001b[0;34m | \\| | \\__, \\__/ | \\ |___ \u001b[0;32m\\`-._,-`-,\u001b[0m\n \u001b[0;32m`._,._,'\u001b[0m\n\u001b[0;35m nextflow_workflow v9.9.9\u001b[0m\n-\u001b[2m----------------------------------------------------\u001b[0m-\n" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T12:03:10.562934" + }, + "Test Function workflowCitation": { + "content": [ + "If you use nextflow_workflow for your analysis please cite:\n\n* The pipeline\n https://doi.org/10.5281/zenodo.5070524\n\n* The nf-core framework\n https://doi.org/10.1038/s41587-020-0439-x\n\n* Software dependencies\n https://github.com/nextflow_workflow/blob/master/CITATIONS.md" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T12:03:07.019761" + }, + "Test Function without logColours": { + "content": [ + { + "reset": "", + "bold": "", + "dim": "", + "underlined": "", + "blink": "", + "reverse": "", + "hidden": "", + "black": "", + "red": "", + "green": "", + "yellow": "", + "blue": "", + "purple": "", + "cyan": "", + "white": "", + "bblack": "", + "bred": "", + "bgreen": "", + "byellow": "", + "bblue": "", + "bpurple": "", + "bcyan": "", + "bwhite": "", + "ublack": "", + "ured": "", + "ugreen": "", + "uyellow": "", + "ublue": "", + "upurple": "", + "ucyan": "", + "uwhite": "", + "iblack": "", + "ired": "", + "igreen": "", + "iyellow": "", + "iblue": "", + "ipurple": "", + "icyan": "", + "iwhite": "", + "biblack": "", + "bired": "", + "bigreen": "", + "biyellow": "", + "biblue": "", + "bipurple": "", + "bicyan": "", + "biwhite": "" + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T12:03:17.969323" + }, + "Test Function dashedLine": { + "content": [ + "-\u001b[2m----------------------------------------------------\u001b[0m-" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T12:03:14.366181" + }, + "Test Function with logColours": { + "content": [ + { + "reset": "\u001b[0m", + "bold": "\u001b[1m", + "dim": "\u001b[2m", + "underlined": "\u001b[4m", + "blink": "\u001b[5m", + "reverse": "\u001b[7m", + "hidden": "\u001b[8m", + "black": "\u001b[0;30m", + "red": "\u001b[0;31m", + "green": "\u001b[0;32m", + "yellow": "\u001b[0;33m", + "blue": "\u001b[0;34m", + "purple": "\u001b[0;35m", + "cyan": "\u001b[0;36m", + "white": "\u001b[0;37m", + "bblack": "\u001b[1;30m", + "bred": "\u001b[1;31m", + "bgreen": "\u001b[1;32m", + "byellow": "\u001b[1;33m", + "bblue": "\u001b[1;34m", + "bpurple": "\u001b[1;35m", + "bcyan": "\u001b[1;36m", + "bwhite": "\u001b[1;37m", + "ublack": "\u001b[4;30m", + "ured": "\u001b[4;31m", + "ugreen": "\u001b[4;32m", + "uyellow": "\u001b[4;33m", + "ublue": "\u001b[4;34m", + "upurple": "\u001b[4;35m", + "ucyan": "\u001b[4;36m", + "uwhite": "\u001b[4;37m", + "iblack": "\u001b[0;90m", + "ired": "\u001b[0;91m", + "igreen": "\u001b[0;92m", + "iyellow": "\u001b[0;93m", + "iblue": "\u001b[0;94m", + "ipurple": "\u001b[0;95m", + "icyan": "\u001b[0;96m", + "iwhite": "\u001b[0;97m", + "biblack": "\u001b[1;90m", + "bired": "\u001b[1;91m", + "bigreen": "\u001b[1;92m", + "biyellow": "\u001b[1;93m", + "biblue": "\u001b[1;94m", + "bipurple": "\u001b[1;95m", + "bicyan": "\u001b[1;96m", + "biwhite": "\u001b[1;97m" + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T12:03:21.714424" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test new file mode 100644 index 0000000000..8940d32d1e --- /dev/null +++ b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test @@ -0,0 +1,29 @@ +nextflow_workflow { + + name "Test Workflow UTILS_NFCORE_PIPELINE" + script "../main.nf" + config "subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config" + workflow "UTILS_NFCORE_PIPELINE" + tag "subworkflows" + tag "subworkflows_nfcore" + tag "utils_nfcore_pipeline" + tag "subworkflows/utils_nfcore_pipeline" + + test("Should run without failures") { + + when { + workflow { + """ + input[0] = [] + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } +} diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test.snap b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test.snap new file mode 100644 index 0000000000..859d1030fb --- /dev/null +++ b/subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test.snap @@ -0,0 +1,19 @@ +{ + "Should run without failures": { + "content": [ + { + "0": [ + true + ], + "valid_config": [ + true + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-02-28T12:03:25.726491" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config b/subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config new file mode 100644 index 0000000000..d0a926bf6d --- /dev/null +++ b/subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config @@ -0,0 +1,9 @@ +manifest { + name = 'nextflow_workflow' + author = """nf-core""" + homePage = 'https://127.0.0.1' + description = """Dummy pipeline""" + nextflowVersion = '!>=23.04.0' + version = '9.9.9' + doi = 'https://doi.org/10.5281/zenodo.5070524' +} diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/tests/tags.yml b/subworkflows/nf-core/utils_nfcore_pipeline/tests/tags.yml new file mode 100644 index 0000000000..ac8523c9a2 --- /dev/null +++ b/subworkflows/nf-core/utils_nfcore_pipeline/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/utils_nfcore_pipeline: + - subworkflows/nf-core/utils_nfcore_pipeline/** diff --git a/subworkflows/nf-core/utils_nfvalidation_plugin/main.nf b/subworkflows/nf-core/utils_nfvalidation_plugin/main.nf new file mode 100644 index 0000000000..2585b65d1b --- /dev/null +++ b/subworkflows/nf-core/utils_nfvalidation_plugin/main.nf @@ -0,0 +1,62 @@ +// +// Subworkflow that uses the nf-validation plugin to render help text and parameter summary +// + +/* +======================================================================================== + IMPORT NF-VALIDATION PLUGIN +======================================================================================== +*/ + +include { paramsHelp } from 'plugin/nf-validation' +include { paramsSummaryLog } from 'plugin/nf-validation' +include { validateParameters } from 'plugin/nf-validation' + +/* +======================================================================================== + SUBWORKFLOW DEFINITION +======================================================================================== +*/ + +workflow UTILS_NFVALIDATION_PLUGIN { + + take: + print_help // boolean: print help + workflow_command // string: default commmand used to run pipeline + pre_help_text // string: string to be printed before help text and summary log + post_help_text // string: string to be printed after help text and summary log + validate_params // boolean: validate parameters + schema_filename // path: JSON schema file, null to use default value + + main: + + log.debug "Using schema file: ${schema_filename}" + + // Default values for strings + pre_help_text = pre_help_text ?: '' + post_help_text = post_help_text ?: '' + workflow_command = workflow_command ?: '' + + // + // Print help message if needed + // + if (print_help) { + log.info pre_help_text + paramsHelp(workflow_command, parameters_schema: schema_filename) + post_help_text + System.exit(0) + } + + // + // Print parameter summary to stdout + // + log.info pre_help_text + paramsSummaryLog(workflow, parameters_schema: schema_filename) + post_help_text + + // + // Validate parameters relative to the parameter JSON schema + // + if (validate_params){ + validateParameters(parameters_schema: schema_filename) + } + + emit: + dummy_emit = true +} diff --git a/subworkflows/nf-core/utils_nfvalidation_plugin/meta.yml b/subworkflows/nf-core/utils_nfvalidation_plugin/meta.yml new file mode 100644 index 0000000000..3d4a6b04f5 --- /dev/null +++ b/subworkflows/nf-core/utils_nfvalidation_plugin/meta.yml @@ -0,0 +1,44 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "UTILS_NFVALIDATION_PLUGIN" +description: Use nf-validation to initiate and validate a pipeline +keywords: + - utility + - pipeline + - initialise + - validation +components: [] +input: + - print_help: + type: boolean + description: | + Print help message and exit + - workflow_command: + type: string + description: | + The command to run the workflow e.g. "nextflow run main.nf" + - pre_help_text: + type: string + description: | + Text to print before the help message + - post_help_text: + type: string + description: | + Text to print after the help message + - validate_params: + type: boolean + description: | + Validate the parameters and error if invalid. + - schema_filename: + type: string + description: | + The filename of the schema to validate against. +output: + - dummy_emit: + type: boolean + description: | + Dummy emit to make nf-core subworkflows lint happy +authors: + - "@adamrtalbot" +maintainers: + - "@adamrtalbot" + - "@maxulysse" diff --git a/subworkflows/nf-core/utils_nfvalidation_plugin/tests/main.nf.test b/subworkflows/nf-core/utils_nfvalidation_plugin/tests/main.nf.test new file mode 100644 index 0000000000..5784a33f2f --- /dev/null +++ b/subworkflows/nf-core/utils_nfvalidation_plugin/tests/main.nf.test @@ -0,0 +1,200 @@ +nextflow_workflow { + + name "Test Workflow UTILS_NFVALIDATION_PLUGIN" + script "../main.nf" + workflow "UTILS_NFVALIDATION_PLUGIN" + tag "subworkflows" + tag "subworkflows_nfcore" + tag "plugin/nf-validation" + tag "'plugin/nf-validation'" + tag "utils_nfvalidation_plugin" + tag "subworkflows/utils_nfvalidation_plugin" + + test("Should run nothing") { + + when { + + params { + monochrome_logs = true + test_data = '' + } + + workflow { + """ + help = false + workflow_command = null + pre_help_text = null + post_help_text = null + validate_params = false + schema_filename = "$moduleTestDir/nextflow_schema.json" + + input[0] = help + input[1] = workflow_command + input[2] = pre_help_text + input[3] = post_help_text + input[4] = validate_params + input[5] = schema_filename + """ + } + } + + then { + assertAll( + { assert workflow.success } + ) + } + } + + test("Should run help") { + + + when { + + params { + monochrome_logs = true + test_data = '' + } + workflow { + """ + help = true + workflow_command = null + pre_help_text = null + post_help_text = null + validate_params = false + schema_filename = "$moduleTestDir/nextflow_schema.json" + + input[0] = help + input[1] = workflow_command + input[2] = pre_help_text + input[3] = post_help_text + input[4] = validate_params + input[5] = schema_filename + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.exitStatus == 0 }, + { assert workflow.stdout.any { it.contains('Input/output options') } }, + { assert workflow.stdout.any { it.contains('--outdir') } } + ) + } + } + + test("Should run help with command") { + + when { + + params { + monochrome_logs = true + test_data = '' + } + workflow { + """ + help = true + workflow_command = "nextflow run noorg/doesntexist" + pre_help_text = null + post_help_text = null + validate_params = false + schema_filename = "$moduleTestDir/nextflow_schema.json" + + input[0] = help + input[1] = workflow_command + input[2] = pre_help_text + input[3] = post_help_text + input[4] = validate_params + input[5] = schema_filename + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.exitStatus == 0 }, + { assert workflow.stdout.any { it.contains('nextflow run noorg/doesntexist') } }, + { assert workflow.stdout.any { it.contains('Input/output options') } }, + { assert workflow.stdout.any { it.contains('--outdir') } } + ) + } + } + + test("Should run help with extra text") { + + + when { + + params { + monochrome_logs = true + test_data = '' + } + workflow { + """ + help = true + workflow_command = "nextflow run noorg/doesntexist" + pre_help_text = "pre-help-text" + post_help_text = "post-help-text" + validate_params = false + schema_filename = "$moduleTestDir/nextflow_schema.json" + + input[0] = help + input[1] = workflow_command + input[2] = pre_help_text + input[3] = post_help_text + input[4] = validate_params + input[5] = schema_filename + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.exitStatus == 0 }, + { assert workflow.stdout.any { it.contains('pre-help-text') } }, + { assert workflow.stdout.any { it.contains('nextflow run noorg/doesntexist') } }, + { assert workflow.stdout.any { it.contains('Input/output options') } }, + { assert workflow.stdout.any { it.contains('--outdir') } }, + { assert workflow.stdout.any { it.contains('post-help-text') } } + ) + } + } + + test("Should validate params") { + + when { + + params { + monochrome_logs = true + test_data = '' + outdir = 1 + } + workflow { + """ + help = false + workflow_command = null + pre_help_text = null + post_help_text = null + validate_params = true + schema_filename = "$moduleTestDir/nextflow_schema.json" + + input[0] = help + input[1] = workflow_command + input[2] = pre_help_text + input[3] = post_help_text + input[4] = validate_params + input[5] = schema_filename + """ + } + } + + then { + assertAll( + { assert workflow.failed }, + { assert workflow.stdout.any { it.contains('ERROR ~ ERROR: Validation of pipeline parameters failed!') } } + ) + } + } +} diff --git a/subworkflows/nf-core/utils_nfvalidation_plugin/tests/nextflow_schema.json b/subworkflows/nf-core/utils_nfvalidation_plugin/tests/nextflow_schema.json new file mode 100644 index 0000000000..7626c1c93e --- /dev/null +++ b/subworkflows/nf-core/utils_nfvalidation_plugin/tests/nextflow_schema.json @@ -0,0 +1,96 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://raw.githubusercontent.com/./master/nextflow_schema.json", + "title": ". pipeline parameters", + "description": "", + "type": "object", + "definitions": { + "input_output_options": { + "title": "Input/output options", + "type": "object", + "fa_icon": "fas fa-terminal", + "description": "Define where the pipeline should find input data and save output data.", + "required": ["outdir"], + "properties": { + "validate_params": { + "type": "boolean", + "description": "Validate parameters?", + "default": true, + "hidden": true + }, + "outdir": { + "type": "string", + "format": "directory-path", + "description": "The output directory where the results will be saved. You have to use absolute paths to storage on Cloud infrastructure.", + "fa_icon": "fas fa-folder-open" + }, + "test_data_base": { + "type": "string", + "default": "https://raw.githubusercontent.com/nf-core/test-datasets/modules", + "description": "Base for test data directory", + "hidden": true + }, + "test_data": { + "type": "string", + "description": "Fake test data param", + "hidden": true + } + } + }, + "generic_options": { + "title": "Generic options", + "type": "object", + "fa_icon": "fas fa-file-import", + "description": "Less common options for the pipeline, typically set in a config file.", + "help_text": "These options are common to all nf-core pipelines and allow you to customise some of the core preferences for how the pipeline runs.\n\nTypically these options would be set in a Nextflow config file loaded for all pipeline runs, such as `~/.nextflow/config`.", + "properties": { + "help": { + "type": "boolean", + "description": "Display help text.", + "fa_icon": "fas fa-question-circle", + "hidden": true + }, + "version": { + "type": "boolean", + "description": "Display version and exit.", + "fa_icon": "fas fa-question-circle", + "hidden": true + }, + "logo": { + "type": "boolean", + "default": true, + "description": "Display nf-core logo in console output.", + "fa_icon": "fas fa-image", + "hidden": true + }, + "singularity_pull_docker_container": { + "type": "boolean", + "description": "Pull Singularity container from Docker?", + "hidden": true + }, + "publish_dir_mode": { + "type": "string", + "default": "copy", + "description": "Method used to save pipeline results to output directory.", + "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.", + "fa_icon": "fas fa-copy", + "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], + "hidden": true + }, + "monochrome_logs": { + "type": "boolean", + "description": "Use monochrome_logs", + "hidden": true + } + } + } + }, + "allOf": [ + { + "$ref": "#/definitions/input_output_options" + }, + { + "$ref": "#/definitions/generic_options" + } + ] +} diff --git a/subworkflows/nf-core/utils_nfvalidation_plugin/tests/tags.yml b/subworkflows/nf-core/utils_nfvalidation_plugin/tests/tags.yml new file mode 100644 index 0000000000..60b1cfff49 --- /dev/null +++ b/subworkflows/nf-core/utils_nfvalidation_plugin/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/utils_nfvalidation_plugin: + - subworkflows/nf-core/utils_nfvalidation_plugin/** diff --git a/tests/config/pytesttags.yml b/tests/config/pytesttags.yml index f33e55023c..0c3c05c554 100644 --- a/tests/config/pytesttags.yml +++ b/tests/config/pytesttags.yml @@ -248,7 +248,7 @@ controlfreec: - modules/nf-core/controlfreec/freec/** - modules/nf-core/controlfreec/freec2bed/** - modules/nf-core/controlfreec/freec2circos/** - - modules/nf-core/controlfreec/makegraph/** + - modules/nf-core/controlfreec/makegraph2/** - modules/nf-core/samtools/mpileup/** - subworkflows/local/bam_variant_calling_mpileup/** - subworkflows/local/bam_variant_calling_somatic_all/** @@ -327,7 +327,7 @@ sentieon/dnascope: - tests/csv/3.0/mapped_single_bam.csv - tests/test_sentieon_dnascope.yml -sentieon_dnascope_skip_filter: +sentieon/dnascope_skip_filter: - conf/modules/sentieon_dnascope.config - modules/nf-core/sentieon/dnascope/** - modules/nf-core/gatk4/mergevcfs/** @@ -355,7 +355,7 @@ sentieon/haplotyper: - tests/csv/3.0/mapped_single_bam.csv - tests/test_sentieon_haplotyper.yml -sentieon_haplotyper_skip_filter: +sentieon/haplotyper_skip_filter: - conf/modules/sentieon_haplotyper.config - modules/nf-core/sentieon/haplotyper/** - modules/nf-core/gatk4/mergevcfs/** @@ -390,7 +390,7 @@ joint_germline: - tests/test_joint_germline.yml ## sentieon_dnascope_joint_germline -sentieon_dnascope_joint_germline: +sentieon/dnascope_joint_germline: - conf/modules/prepare_genome.config - conf/modules/sentieon_dnascope.config - conf/modules/sentieon_dnascope_joint_germline.config @@ -401,7 +401,7 @@ sentieon_dnascope_joint_germline: - tests/test_sentieon_dnascop_joint_germline.yml ## sentieon_haplotyper_joint_germline -sentieon_haplotyper_joint_germline: +sentieon/haplotyper_joint_germline: - conf/modules/prepare_genome.config - conf/modules/sentieon_haplotyper.config - conf/modules/sentieon_haplotyper_joint_germline.config diff --git a/tests/test_annotation_merge.yml b/tests/test_annotation_merge.yml index 9915e502cd..21351f1cfc 100644 --- a/tests/test_annotation_merge.yml +++ b/tests/test_annotation_merge.yml @@ -7,7 +7,7 @@ - path: results/annotation/test/test_snpEff_VEP.ann.vcf.gz # binary changes md5sums on reruns - path: results/annotation/test/test_snpEff_VEP.ann.vcf.gz.tbi - md5sum: 4cb176febbc8c26d717a6c6e67b9c905 + # binary changes md5sums on reruns - path: results/reports/EnsemblVEP/test/test_snpEff_VEP.ann.summary.html contains: ["test_snpEff.ann.vcf.gzOutput filetest_snpEff_VEP.ann.vcf.gz"] - path: results/multiqc @@ -36,15 +36,15 @@ - path: results/annotation/test/test_VEP.ann.vcf.gz # binary changes md5sums on reruns - path: results/annotation/test/test_VEP.ann.vcf.gz.tbi - md5sum: 4cb176febbc8c26d717a6c6e67b9c905 + # binary changes md5sums on reruns - path: results/annotation/test/test_snpEff.ann.vcf.gz - md5sum: 01f24fdd76f73eefd695beea7b3d3d8e + # binary changes md5sums on reruns - path: results/annotation/test/test_snpEff.ann.vcf.gz.tbi - md5sum: 51e418d9be9bb33f1d4123493b15b6c9 + # binary changes md5sums on reruns - path: results/annotation/test/test_snpEff_VEP.ann.vcf.gz # binary changes md5sums on reruns - path: results/annotation/test/test_snpEff_VEP.ann.vcf.gz.tbi - md5sum: 4cb176febbc8c26d717a6c6e67b9c905 + # binary changes md5sums on reruns - path: results/multiqc - path: results/reports/EnsemblVEP/test/test_VEP.ann.summary.html # text-based file changes md5sums on reruns diff --git a/tests/test_annotation_snpeff.yml b/tests/test_annotation_snpeff.yml index a98b7bd34d..d6ce2ee48d 100644 --- a/tests/test_annotation_snpeff.yml +++ b/tests/test_annotation_snpeff.yml @@ -5,9 +5,9 @@ - snpeff files: - path: results/annotation/test/test_snpEff.ann.vcf.gz - md5sum: 01f24fdd76f73eefd695beea7b3d3d8e + # binary changes md5sums on reruns - path: results/annotation/test/test_snpEff.ann.vcf.gz.tbi - md5sum: 51e418d9be9bb33f1d4123493b15b6c9 + # binary changes md5sums on reruns - path: results/multiqc - path: results/reports/snpeff/test/snpEff_summary.html contains: [" Genome total length ", " 100,286,402 ", " MT192765.1 "] diff --git a/tests/test_annotation_vep.yml b/tests/test_annotation_vep.yml index 34baab8b99..176c85020c 100644 --- a/tests/test_annotation_vep.yml +++ b/tests/test_annotation_vep.yml @@ -7,7 +7,7 @@ - path: results/annotation/test/test_VEP.ann.vcf.gz # binary changes md5sums on reruns - path: results/annotation/test/test_VEP.ann.vcf.gz.tbi - md5sum: 4cb176febbc8c26d717a6c6e67b9c905 + # binary changes md5sums on reruns - path: results/multiqc - path: results/reports/EnsemblVEP/test/test_VEP.ann.summary.html contains: ["test.vcf.gzOutput filetest_VEP.ann.vcf.gz"] @@ -20,7 +20,7 @@ - path: results/annotation/test/test_VEP.ann.vcf.gz # binary changes md5sums on reruns - path: results/annotation/test/test_VEP.ann.vcf.gz.tbi - md5sum: 4cb176febbc8c26d717a6c6e67b9c905 + # binary changes md5sums on reruns - path: results/multiqc - path: results/reports/EnsemblVEP/test/test_VEP.ann.summary.html # text-based file changes md5sums on reruns diff --git a/tests/test_cnvkit.yml b/tests/test_cnvkit.yml index 3a1b8181cb..8e9017c70b 100644 --- a/tests/test_cnvkit.yml +++ b/tests/test_cnvkit.yml @@ -57,6 +57,30 @@ md5sum: b4a49faf170e436ec32dcc21ccc3ce8f - path: results/cnvkit should_exist: false + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Run variant calling on tumor_only sample with cnvkit command: nextflow run main.nf -profile test_cache,tools_tumoronly --tools cnvkit --outdir results tags: @@ -88,6 +112,17 @@ md5sum: e6d0190c1c37ce6e41f76ca5b24ccca3 - path: results/cnvkit should_exist: false + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats - name: Run variant calling on germline sample with cnvkit command: nextflow run main.nf -profile test_cache,tools_germline --tools cnvkit --outdir results tags: @@ -121,6 +156,17 @@ md5sum: 79aae7e9c135fb8c65f8fbda12610faf - path: results/cnvkit should_exist: false + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample1/sample1.recal.cram.stats - name: Run variant calling on somatic samples with cnvkit and skip variant calling on matched normal command: nextflow run main.nf -profile test_cache,tools_somatic --tools cnvkit --only_paired_variant_calling --outdir results tags: @@ -156,3 +202,27 @@ md5sum: d15bf5061d90c8edbcba04d2bd2a270c - path: results/variant_calling/cnvkit/sample4_vs_sample3/test2.paired_end.recalibrated.sorted.targetcoverage.cnn md5sum: b4a49faf170e436ec32dcc21ccc3ce8f + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test diff --git a/tests/test_controlfreec.yml b/tests/test_controlfreec.yml index 32393aa501..4d938351f4 100644 --- a/tests/test_controlfreec.yml +++ b/tests/test_controlfreec.yml @@ -7,8 +7,6 @@ - copy_number_calling files: - path: results/multiqc - - path: results/untar/chr_dir/chr21.fasta - md5sum: 69bd44ef67566a76d6cbb8aa4a25ae35 - path: results/variant_calling/controlfreec/sample4_vs_sample3/config.txt contains: [ @@ -52,6 +50,30 @@ should_exist: false - path: results/cnvkit should_exist: false + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Run variant calling on somatic samples with controlfreec without intervals command: nextflow run main.nf -profile test_cache,tools_somatic --tools controlfreec --no_intervals -stub-run --outdir results tags: @@ -68,7 +90,6 @@ md5sum: f3dac01ea66b95fe477446fde2d31489 - path: results/no_intervals.bed.gz.tbi md5sum: f3dac01ea66b95fe477446fde2d31489 - - path: results/untar/chr_dir - path: results/variant_calling/controlfreec/sample4_vs_sample3/GC_profile.sample4_vs_sample3.cpn md5sum: d41d8cd98f00b204e9800998ecf8427e # This is the md5sum of an empty file. Are all these files suppose to be empty? - path: results/variant_calling/controlfreec/sample4_vs_sample3/config.txt @@ -105,6 +126,26 @@ should_exist: false - path: results/mpileup should_exist: false + - path: results/reports/mosdepth/sample3/sample3.recal.global.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/sample3/sample3.recal.summary.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz + md5sum: 1a60c330fb42841e8dcf3cd507a70bfc + - path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz.csi + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.global.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/sample4/sample4.recal.summary.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz + md5sum: 1a60c330fb42841e8dcf3cd507a70bfc + - path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz.csi + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Run variant calling on tumor_only sample with controlfreec command: nextflow run main.nf -profile test_cache,tools_tumoronly --tools controlfreec -stub-run --outdir results tags: @@ -148,3 +189,14 @@ should_exist: false - path: results/mpileup should_exist: false + - path: results/reports/mosdepth/sample2/sample2.recal.global.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/sample2/sample2.recal.region.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/sample2/sample2.recal.summary.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz + md5sum: 1a60c330fb42841e8dcf3cd507a70bfc + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz.csi + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/samtools/sample2/sample2.recal.cram.stats diff --git a/tests/test_deepvariant.yml b/tests/test_deepvariant.yml index ce378e1e76..cead54aa47 100644 --- a/tests/test_deepvariant.yml +++ b/tests/test_deepvariant.yml @@ -7,7 +7,7 @@ files: - path: results/multiqc - path: results/reports/bcftools/deepvariant/sample1/sample1.deepvariant.bcftools_stats.txt - md5sum: 1e8eefa704c0d2b77ee6e8a2cf2ef428 + md5sum: a6634ceb1c712de14009b05d273713a7 - path: results/reports/vcftools/deepvariant/sample1/sample1.deepvariant.FILTER.summary md5sum: acce7a163f4070226429f9d6bc3fbd2c - path: results/reports/vcftools/deepvariant/sample1/sample1.deepvariant.TsTv.count @@ -24,6 +24,17 @@ # binary changes md5sums on reruns - path: results/deepvariant should_exist: false + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample1/sample1.recal.cram.stats - name: Run variant calling on germline sample with deepvariant without intervals command: nextflow run main.nf -profile test_cache,tools_germline --tools deepvariant --no_intervals --outdir results tags: @@ -40,7 +51,7 @@ - path: results/no_intervals.bed.gz.tbi md5sum: f3dac01ea66b95fe477446fde2d31489 - path: results/reports/bcftools/deepvariant/sample1/sample1.deepvariant.bcftools_stats.txt - md5sum: 33551d79cef60dd9a7f56c20db6f30a4 + md5sum: 0c48d8e315ca23c5dc2e7bf71ea0b6a6 - path: results/reports/vcftools/deepvariant/sample1/sample1.deepvariant.FILTER.summary md5sum: 7b17bd18c2d4bf129561c7c6a419a889 - path: results/reports/vcftools/deepvariant/sample1/sample1.deepvariant.TsTv.count @@ -57,3 +68,12 @@ # binary changes md5sums on reruns - path: results/deepvariant should_exist: false + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: d2775eb102acc5950f7f53883dcb503d + - path: results/reports/mosdepth/sample1/sample1.recal.per-base.bed.gz + md5sum: 54431f155c9538809e8caf99d1a75ec7 + - path: results/reports/mosdepth/sample1/sample1.recal.per-base.bed.gz.csi + md5sum: c67dcd711b096eb42f43784d5eadbc0d + - path: results/reports/samtools/sample1/sample1.recal.cram.stats diff --git a/tests/test_gatk4spark.yml b/tests/test_gatk4spark.yml index 7b6b42a3a5..6462bd130a 100644 --- a/tests/test_gatk4spark.yml +++ b/tests/test_gatk4spark.yml @@ -1,5 +1,5 @@ - name: Run default pipeline with gatk4spark - command: nextflow run main.nf -profile test_cache,use_gatk_spark --outdir results + command: nextflow run main.nf -profile test_cache,use_gatk_spark,spark --outdir results tags: - gatk4spark - preprocessing @@ -49,7 +49,7 @@ - path: results/preprocessing/mapped/ should_exist: false - name: Run default pipeline with gatk4spark and skipping all QC steps - command: nextflow run main.nf -profile test_cache,use_gatk_spark --skip_tools fastqc,markduplicates_report,mosdepth,multiqc,samtools --outdir results + command: nextflow run main.nf -profile test_cache,use_gatk_spark,spark --skip_tools fastqc,markduplicates_report,mosdepth,multiqc,samtools --outdir results tags: - gatk4spark - preprocessing @@ -82,7 +82,7 @@ - path: results/reports/samtools should_exist: false - name: Run save_output_as_bam with gatk4 spark - command: nextflow run main.nf -profile test_cache,use_gatk_spark --save_output_as_bam --outdir results + command: nextflow run main.nf -profile test_cache,use_gatk_spark,spark --save_output_as_bam --outdir results tags: - gatk4spark - preprocessing diff --git a/tests/test_haplotypecaller.yml b/tests/test_haplotypecaller.yml index 4ec225367b..2f76698774 100644 --- a/tests/test_haplotypecaller.yml +++ b/tests/test_haplotypecaller.yml @@ -17,7 +17,7 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/haplotypecaller/test/test.haplotypecaller.filtered.bcftools_stats.txt - md5sum: 8ef41291923302f7a8100e4fc34bde0e + md5sum: 01941d63ff87fba208320b8041738179 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.filtered.FILTER.summary md5sum: 4e2ceea7f3ff998004691fd71192d9ee - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.filtered.TsTv.count @@ -34,6 +34,18 @@ # binary changes md5sums on reruns - path: results/haplotypecaller should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + md5sum: 615c5c5019d88045a9ff5bbe6e63d270 + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/test/test.recal.cram.stats + - name: Run variant calling on germline sample with haplotypecaller without intervals command: nextflow run main.nf -profile test_cache,targeted --input ./tests/csv/3.0/mapped_single_bam.csv --tools haplotypecaller --step variant_calling --no_intervals --outdir results tags: @@ -60,7 +72,7 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/haplotypecaller/test/test.haplotypecaller.filtered.bcftools_stats.txt - md5sum: 8ef41291923302f7a8100e4fc34bde0e + md5sum: 01941d63ff87fba208320b8041738179 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.filtered.FILTER.summary md5sum: 4e2ceea7f3ff998004691fd71192d9ee - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.filtered.TsTv.count @@ -77,3 +89,12 @@ # binary changes md5sums on reruns - path: results/haplotypecaller should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + md5sum: 4f0d231060cbde4efdd673863bd2fb59 + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: results/reports/samtools/test/test.recal.cram.stats diff --git a/tests/test_haplotypecaller_skip_filter.yml b/tests/test_haplotypecaller_skip_filter.yml index def69fbbf3..9b68f220e6 100644 --- a/tests/test_haplotypecaller_skip_filter.yml +++ b/tests/test_haplotypecaller_skip_filter.yml @@ -21,7 +21,7 @@ - path: results/variant_calling/haplotypecaller/test/test.haplotypecaller.filtered.vcf.gz.tbi should_exist: false - path: results/reports/bcftools/haplotypecaller/test/test.haplotypecaller.bcftools_stats.txt - md5sum: 98c4a1fdd2700f2e5aee3a5060de57e0 + md5sum: 7fd9e6c0f677b83c7dda1f85360042d2 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.FILTER.summary md5sum: 87a84b5f8ac3d3cbeeef7d60afcdbfe7 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.TsTv.count @@ -38,6 +38,17 @@ should_exist: false - path: results/haplotypecaller should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + md5sum: 615c5c5019d88045a9ff5bbe6e63d270 + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/test/test.recal.cram.stats - name: Run variant calling on germline sample with haplotypecaller without intervals and skip filter command: nextflow run main.nf -profile test_cache,targeted --input ./tests/csv/3.0/mapped_single_bam.csv --tools haplotypecaller --step variant_calling --skip_tools haplotypecaller_filter --no_intervals --outdir results tags: @@ -64,7 +75,7 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/haplotypecaller/test/test.haplotypecaller.bcftools_stats.txt - md5sum: 98c4a1fdd2700f2e5aee3a5060de57e0 + md5sum: 7fd9e6c0f677b83c7dda1f85360042d2 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.FILTER.summary md5sum: 87a84b5f8ac3d3cbeeef7d60afcdbfe7 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.TsTv.count @@ -81,3 +92,12 @@ should_exist: false - path: results/haplotypecaller should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + md5sum: 4f0d231060cbde4efdd673863bd2fb59 + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: results/reports/samtools/test/test.recal.cram.stats diff --git a/tests/test_intervals.yml b/tests/test_intervals.yml index f0cc2495c3..0196376807 100644 --- a/tests/test_intervals.yml +++ b/tests/test_intervals.yml @@ -138,8 +138,6 @@ # binary changes md5sums on reruns - path: results/preprocessing/recalibrated/test/test.recal.cram.crai # binary changes md5sums on reruns - - path: results/reference/intervals - should_exist: false - path: results/reports/fastqc/test-test_L1 - path: results/reports/markduplicates/test/test.md.cram.metrics contains: ["test 17094 1534 168 1046782 12429 197 0 0.635998", "1.0 0.999991 1171"] diff --git a/tests/test_joint_germline.yml b/tests/test_joint_germline.yml index 6bd7b4532f..e01a7ea1a3 100644 --- a/tests/test_joint_germline.yml +++ b/tests/test_joint_germline.yml @@ -30,7 +30,28 @@ - path: results/variant_calling/haplotypecaller/testT/testT.haplotypecaller.g.vcf.gz.tbi - path: results/haplotypecaller should_exist: false - + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.summary.txt + md5sum: 615c5c5019d88045a9ff5bbe6e63d270 + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/testN/testN.recal.cram.stats + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.global.dist.txt + md5sum: ba97ed85645f77da6f3adad138b3cdb4 + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.region.dist.txt + md5sum: a7eb835371dd0aaf347ccca7ebe1eb3b + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.summary.txt + md5sum: a937108cbf24c1430b79c861234ce22b + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz + md5sum: d2b579a74bf8d858f82869f073056252 + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/testT/testT.recal.cram.stats - name: Run joint germline variant calling with haplotypecaller all intervals at once command: nextflow run main.nf -profile test_cache,targeted --input ./tests/csv/3.0/mapped_joint_bam.csv --tools haplotypecaller --step variant_calling --joint_germline --outdir results --nucleotides_per_second 100 tags: @@ -63,7 +84,28 @@ - path: results/variant_calling/haplotypecaller/testT/testT.haplotypecaller.g.vcf.gz.tbi - path: results/haplotypecaller should_exist: false - + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.summary.txt + md5sum: 615c5c5019d88045a9ff5bbe6e63d270 + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/testN/testN.recal.cram.stats + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.global.dist.txt + md5sum: ba97ed85645f77da6f3adad138b3cdb4 + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.region.dist.txt + md5sum: a7eb835371dd0aaf347ccca7ebe1eb3b + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.summary.txt + md5sum: a937108cbf24c1430b79c861234ce22b + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz + md5sum: d2b579a74bf8d858f82869f073056252 + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/testT/testT.recal.cram.stats - name: Run joint germline variant calling with haplotypecaller with Stub for VQSR command: nextflow run main.nf -profile test_cache,tools_germline --input ./tests/csv/3.0/mapped_joint_bam.csv --tools haplotypecaller --step variant_calling --joint_germline --outdir results -stub-run tags: @@ -81,12 +123,12 @@ should_exist: false - path: results/reports/bcftools/haplotypecaller/joint_variant_calling/joint_germline_recalibrated.bcftools_stats.txt # Not stable enough - - path: results/reports/vcftools/haplotypecaller/joint_variant_calling/joint_germline_recalibrated.FILTER.summary - # Not stable enough - - path: results/reports/vcftools/haplotypecaller/joint_variant_calling/joint_germline_recalibrated.TsTv.count - # Not stable enough - - path: results/reports/vcftools/haplotypecaller/joint_variant_calling/joint_germline_recalibrated.TsTv.qual - # Not stable enough + # - path: results/reports/vcftools/haplotypecaller/joint_variant_calling/joint_germline_recalibrated.FILTER.summary + # No longer created with stub (not in the vcf tools module) + # - path: results/reports/vcftools/haplotypecaller/joint_variant_calling/joint_germline_recalibrated.TsTv.count + # No longer created with stub (not in the vcf tools module) + # - path: results/reports/vcftools/haplotypecaller/joint_variant_calling/joint_germline_recalibrated.TsTv.qual + # No longer created with stub (not in the vcf tools module) - path: results/variant_calling/haplotypecaller/joint_variant_calling/joint_germline.vcf.gz # binary changes md5sums on reruns - path: results/variant_calling/haplotypecaller/joint_variant_calling/joint_germline.vcf.gz.tbi @@ -101,3 +143,25 @@ - path: results/variant_calling/haplotypecaller/testT/testT.haplotypecaller.g.vcf.gz.tbi - path: results/haplotypecaller should_exist: false + - path: results/reports/mosdepth/testN/testN.recal.global.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testN/testN.recal.region.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testN/testN.recal.summary.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz + md5sum: 1a60c330fb42841e8dcf3cd507a70bfc + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz.csi + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/samtools/testN/testN.recal.cram.stats + - path: results/reports/mosdepth/testT/testT.recal.global.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testT/testT.recal.region.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testT/testT.recal.summary.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz + md5sum: 1a60c330fb42841e8dcf3cd507a70bfc + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz.csi + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/samtools/testT/testT.recal.cram.stats diff --git a/tests/test_manta.yml b/tests/test_manta.yml index 1e53587f6e..b119ca80b7 100644 --- a/tests/test_manta.yml +++ b/tests/test_manta.yml @@ -22,6 +22,17 @@ # binary changes md5sums on reruns - path: results/manta should_exist: false + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample1/sample1.recal.cram.stats - name: Run variant calling on germline sample with manta without intervals command: nextflow run main.nf -profile test_cache,tools_germline --tools manta --no_intervals --outdir results tags: @@ -53,6 +64,15 @@ md5sum: 4cb176febbc8c26d717a6c6e67b9c905 - path: results/manta should_exist: false + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: d2775eb102acc5950f7f53883dcb503d + - path: results/reports/mosdepth/sample1/sample1.recal.per-base.bed.gz + md5sum: 54431f155c9538809e8caf99d1a75ec7 + - path: results/reports/mosdepth/sample1/sample1.recal.per-base.bed.gz.csi + md5sum: c67dcd711b096eb42f43784d5eadbc0d + - path: results/reports/samtools/sample1/sample1.recal.cram.stats - name: Run variant calling on tumor_only sample with manta command: nextflow run main.nf -profile test_cache,tools_tumoronly --tools manta --outdir results tags: @@ -77,6 +97,17 @@ md5sum: 4cb176febbc8c26d717a6c6e67b9c905 - path: results/manta should_exist: false + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats - name: Run variant calling on tumor_only sample with manta without intervals command: nextflow run main.nf -profile test_cache,tools_tumoronly --tools manta --no_intervals --outdir results tags: @@ -108,6 +139,15 @@ md5sum: 4cb176febbc8c26d717a6c6e67b9c905 - path: results/manta should_exist: false + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 0a7300e56eda6fba7c7564f00aa000f0 + - path: results/reports/mosdepth/sample2/sample2.recal.per-base.bed.gz + md5sum: 3de4a9f4da2f2b4909ef192452a8d211 + - path: results/reports/mosdepth/sample2/sample2.recal.per-base.bed.gz.csi + md5sum: cfb07b0ba46e8468b4342edb243536f3 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats - name: Run variant calling on somatic sample with manta command: nextflow run main.nf -profile test_cache,tools_somatic --tools manta --outdir results tags: @@ -156,6 +196,30 @@ md5sum: 4cb176febbc8c26d717a6c6e67b9c905 - path: results/manta should_exist: false + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Run variant calling on somatic sample with manta without intervals command: nextflow run main.nf -profile test_cache,tools_somatic --tools manta --no_intervals --outdir results tags: @@ -211,3 +275,23 @@ md5sum: 4cb176febbc8c26d717a6c6e67b9c905 - path: results/manta should_exist: false + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: d2775eb102acc5950f7f53883dcb503d + - path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz + md5sum: 54431f155c9538809e8caf99d1a75ec7 + - path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz.csi + md5sum: c67dcd711b096eb42f43784d5eadbc0d + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 0a7300e56eda6fba7c7564f00aa000f0 + - path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz + md5sum: 3de4a9f4da2f2b4909ef192452a8d211 + - path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz.csi + md5sum: cfb07b0ba46e8468b4342edb243536f3 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test diff --git a/tests/test_mpileup.yml b/tests/test_mpileup.yml index 7cff9dad23..f7c5d87749 100644 --- a/tests/test_mpileup.yml +++ b/tests/test_mpileup.yml @@ -13,6 +13,17 @@ should_exist: false - path: results/mpileup should_exist: false + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats - name: Run variant calling on tumor_only sample to test mpileup without intervals command: nextflow run main.nf -profile test_cache,tools_tumoronly --tools mpileup --no_intervals --outdir results tags: @@ -35,6 +46,15 @@ should_exist: false - path: results/mpileup should_exist: false + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 0a7300e56eda6fba7c7564f00aa000f0 + - path: results/reports/mosdepth/sample2/sample2.recal.per-base.bed.gz + md5sum: 3de4a9f4da2f2b4909ef192452a8d211 + - path: results/reports/mosdepth/sample2/sample2.recal.per-base.bed.gz.csi + md5sum: cfb07b0ba46e8468b4342edb243536f3 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats - name: Run variant calling on germline sample to test mpileup command: nextflow run main.nf -profile test_cache,tools_germline --tools mpileup --outdir results tags: @@ -50,6 +70,17 @@ should_exist: false - path: results/mpileup should_exist: false + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample1/sample1.recal.cram.stats - name: Run variant calling on germline sample to test mpileup without intervals command: nextflow run main.nf -profile test_cache,tools_germline --tools mpileup --no_intervals --outdir results tags: @@ -72,3 +103,12 @@ should_exist: false - path: results/mpileup should_exist: false + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: d2775eb102acc5950f7f53883dcb503d + - path: results/reports/mosdepth/sample1/sample1.recal.per-base.bed.gz + md5sum: 54431f155c9538809e8caf99d1a75ec7 + - path: results/reports/mosdepth/sample1/sample1.recal.per-base.bed.gz.csi + md5sum: c67dcd711b096eb42f43784d5eadbc0d + - path: results/reports/samtools/sample1/sample1.recal.cram.stats diff --git a/tests/test_msisensorpro.yml b/tests/test_msisensorpro.yml index 700187e0a4..173dbcf5ca 100644 --- a/tests/test_msisensorpro.yml +++ b/tests/test_msisensorpro.yml @@ -12,6 +12,30 @@ - path: results/variant_calling/msisensorpro/sample4_vs_sample3/sample4_vs_sample3_somatic - path: results/msisensorpro should_exist: false + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Build only index with msisensorpro command: nextflow run main.nf -profile test_cache --build_only_index --tools msisensorpro --input false --outdir results tags: diff --git a/tests/test_mutect2.yml b/tests/test_mutect2.yml index 0329e827d3..52b422b1bf 100644 --- a/tests/test_mutect2.yml +++ b/tests/test_mutect2.yml @@ -23,7 +23,7 @@ - path: results/variant_calling/mutect2/sample2/sample2.mutect2.filtered.vcf.gz # binary changes md5sums on reruns - path: results/variant_calling/mutect2/sample2/sample2.mutect2.filtered.vcf.gz.filteringStats.tsv - md5sum: 9a8439d0bb5875f1e673cf592af85ffb + md5sum: e898b7cea663e7558980d28f403d552b - path: results/variant_calling/mutect2/sample2/sample2.mutect2.filtered.vcf.gz.tbi # binary changes md5sums on reruns - path: results/variant_calling/mutect2/sample2/sample2.mutect2.pileups.table @@ -38,6 +38,17 @@ # binary changes md5sums on reruns - path: results/mutect2 should_exist: false + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats - name: Run variant calling on tumor only sample with mutect2 without intervals command: nextflow run main.nf -profile test_cache,tools_tumoronly --tools mutect2 --no_intervals --outdir results tags: @@ -85,3 +96,12 @@ # binary changes md5sums on reruns - path: results/mutect2 should_exist: false + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 0a7300e56eda6fba7c7564f00aa000f0 + - path: results/reports/mosdepth/sample2/sample2.recal.per-base.bed.gz + md5sum: 3de4a9f4da2f2b4909ef192452a8d211 + - path: results/reports/mosdepth/sample2/sample2.recal.per-base.bed.gz.csi + md5sum: cfb07b0ba46e8468b4342edb243536f3 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats diff --git a/tests/test_sentieon_dnascope.yml b/tests/test_sentieon_dnascope.yml index f51e0bca72..49b88ca43c 100644 --- a/tests/test_sentieon_dnascope.yml +++ b/tests/test_sentieon_dnascope.yml @@ -17,7 +17,6 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/sentieon_dnascope/test/test.dnascope.filtered.bcftools_stats.txt - md5sum: 912c7d5b31784c50e0a75b4fcfa4997b - path: results/reports/vcftools/sentieon_dnascope/test/test.dnascope.filtered.FILTER.summary md5sum: e67b24d296810a075378e5864bcea0fa - path: results/reports/vcftools/sentieon_dnascope/test/test.dnascope.filtered.TsTv.count @@ -34,6 +33,17 @@ # binary changes md5sums on reruns - path: results/dnascope should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + md5sum: 615c5c5019d88045a9ff5bbe6e63d270 + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/test/test.recal.cram.stats - name: Run variant calling on germline sample with sentieons dnascope without intervals command: nextflow run main.nf -profile test_cache,targeted,software_license --sentieon_extension --input ./tests/csv/3.0/mapped_single_bam.csv --tools sentieon_dnascope --step variant_calling --no_intervals --outdir results tags: @@ -60,7 +70,6 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/sentieon_dnascope/test/test.dnascope.filtered.bcftools_stats.txt - md5sum: 912c7d5b31784c50e0a75b4fcfa4997b - path: results/reports/vcftools/sentieon_dnascope/test/test.dnascope.filtered.FILTER.summary md5sum: e67b24d296810a075378e5864bcea0fa - path: results/reports/vcftools/sentieon_dnascope/test/test.dnascope.filtered.TsTv.count @@ -77,6 +86,16 @@ # binary changes md5sums on reruns - path: results/sentieon_dnascope should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + md5sum: 4f0d231060cbde4efdd673863bd2fb59 + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: results/reports/samtools/test/test.recal.cram.stats + - name: Run variant calling on germline sample with sentieons dnascope output gvcf command: nextflow run main.nf -profile test_cache,targeted,software_license --sentieon_extension --input ./tests/csv/3.0/mapped_single_bam.csv --tools sentieon_dnascope --step variant_calling --outdir results --sentieon_dnascope_emit_mode gvcf tags: @@ -115,6 +134,17 @@ should_exist: false - path: results/dnascope should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + md5sum: 615c5c5019d88045a9ff5bbe6e63d270 + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/test/test.recal.cram.stats - name: Run variant calling on germline sample with sentieons dnascope output both gvcf and vcf command: nextflow run main.nf -profile test_cache,targeted,software_license --sentieon_extension --input ./tests/csv/3.0/mapped_single_bam.csv --tools sentieon_dnascope --step variant_calling --outdir results --sentieon_dnascope_emit_mode variant,gvcf tags: @@ -145,3 +175,14 @@ - path: results/variant_calling/sentieon_dnascope/test/test.dnascope.unfiltered.vcf.gz.tbi - path: results/dnascope should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + md5sum: 615c5c5019d88045a9ff5bbe6e63d270 + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/test/test.recal.cram.stats diff --git a/tests/test_sentieon_dnascope_joint_germline.yml b/tests/test_sentieon_dnascope_joint_germline.yml index 234e657270..d5775cc048 100644 --- a/tests/test_sentieon_dnascope_joint_germline.yml +++ b/tests/test_sentieon_dnascope_joint_germline.yml @@ -2,7 +2,7 @@ command: nextflow run main.nf -profile test_cache,targeted,software_license --sentieon_extension --input ./tests/csv/3.0/mapped_joint_bam.csv --tools sentieon_dnascope --step variant_calling --joint_germline --outdir results --sentieon_dnascope_emit_mode gvcf tags: - germline - - sentieon_dnascope_joint_germline + - sentieon/dnascope_joint_germline - variant_calling files: - path: results/csv/variantcalled.csv @@ -38,11 +38,23 @@ should_exist: false - path: results/variant_calling/sentieon_dnascope/joint_variant_calling/joint_germline_recalibrated.vcf.gz.tbi should_exist: false + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.global.dist.txt + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.region.dist.txt + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.summary.txt + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz.csi + - path: results/reports/samtools/testN/testN.recal.cram.stats + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.global.dist.txt + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.region.dist.txt + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.summary.txt + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz.csi + - path: results/reports/samtools/testT/testT.recal.cram.stats - name: Run joint germline variant calling with sentieon dnascope all intervals at once command: nextflow run main.nf -profile test_cache,targeted,software_license --sentieon_extension --input ./tests/csv/3.0/mapped_joint_bam.csv --tools sentieon_dnascope --step variant_calling --joint_germline --outdir results --sentieon_dnascope_emit_mode gvcf --nucleotides_per_second 100 tags: - germline - - sentieon_dnascope_joint_germline + - sentieon/dnascope_joint_germline - variant_calling files: - path: results/csv/variantcalled.csv @@ -64,3 +76,15 @@ - path: results/variant_calling/sentieon_dnascope/testT/testT.dnascope.g.vcf.gz.tbi - path: results/dnascope should_exist: false + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.global.dist.txt + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.region.dist.txt + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.summary.txt + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz.csi + - path: results/reports/samtools/testN/testN.recal.cram.stats + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.global.dist.txt + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.region.dist.txt + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.summary.txt + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz.csi + - path: results/reports/samtools/testT/testT.recal.cram.stats diff --git a/tests/test_sentieon_dnascope_skip_filter.yml b/tests/test_sentieon_dnascope_skip_filter.yml index 6906b7d04e..3950f7a438 100644 --- a/tests/test_sentieon_dnascope_skip_filter.yml +++ b/tests/test_sentieon_dnascope_skip_filter.yml @@ -2,7 +2,7 @@ command: nextflow run main.nf -profile test_cache,targeted,software_license --sentieon_extension --input ./tests/csv/3.0/mapped_single_bam.csv --tools sentieon_dnascope --step variant_calling --skip_tools dnascope_filter --outdir results tags: - germline - - sentieon_dnascope_skip_filter + - sentieon/dnascope_skip_filter - variant_calling files: - path: results/csv/variantcalled.csv @@ -31,11 +31,22 @@ # binary changes md5sums on reruns - path: results/sentieon_dnascope should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + md5sum: 615c5c5019d88045a9ff5bbe6e63d270 + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/test/test.recal.cram.stats - name: Run variant calling on germline sample with sentieon dnascope without intervals and skip filter command: nextflow run main.nf -profile test_cache,targeted,software_license --sentieon_extension --input ./tests/csv/3.0/mapped_single_bam.csv --tools sentieon_dnascope --step variant_calling --skip_tools dnascope_filter --no_intervals --outdir results tags: - germline - - sentieon_dnascope_skip_filter + - sentieon/dnascope_skip_filter - no_intervals - variant_calling files: @@ -71,3 +82,12 @@ # binary changes md5sums on reruns - path: results/sentieon_dnascope should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + md5sum: 4f0d231060cbde4efdd673863bd2fb59 + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: results/reports/samtools/test/test.recal.cram.stats diff --git a/tests/test_sentieon_haplotyper.yml b/tests/test_sentieon_haplotyper.yml index 7cac6f34c7..b5f403710b 100644 --- a/tests/test_sentieon_haplotyper.yml +++ b/tests/test_sentieon_haplotyper.yml @@ -17,7 +17,6 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/sentieon_haplotyper/test/test.haplotyper.filtered.bcftools_stats.txt - md5sum: 66be03d4e6535175514f54a1a031d49f - path: results/reports/vcftools/sentieon_haplotyper/test/test.haplotyper.filtered.FILTER.summary md5sum: d501a93356f3c91c743f51104e24514a - path: results/reports/vcftools/sentieon_haplotyper/test/test.haplotyper.filtered.TsTv.count @@ -34,6 +33,16 @@ # binary changes md5sums on reruns - path: results/haplotyper should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/test/test.recal.cram.stats - name: Run variant calling on germline sample with sentieons haplotyper without intervals command: nextflow run main.nf -profile test_cache,software_license,targeted --sentieon_extension --input ./tests/csv/3.0/mapped_single_bam.csv --tools sentieon_haplotyper --step variant_calling --no_intervals --outdir results tags: @@ -60,7 +69,6 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/sentieon_haplotyper/test/test.haplotyper.filtered.bcftools_stats.txt - md5sum: 66be03d4e6535175514f54a1a031d49f - path: results/reports/vcftools/sentieon_haplotyper/test/test.haplotyper.filtered.FILTER.summary md5sum: d501a93356f3c91c743f51104e24514a - path: results/reports/vcftools/sentieon_haplotyper/test/test.haplotyper.filtered.TsTv.count @@ -77,6 +85,14 @@ # binary changes md5sums on reruns - path: results/sentieon_haplotyper should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: results/reports/samtools/test/test.recal.cram.stats - name: Run variant calling on germline sample with sentieons haplotyper output gvcf command: nextflow run main.nf -profile test_cache,software_license,targeted --sentieon_extension --input ./tests/csv/3.0/mapped_single_bam.csv --tools sentieon_haplotyper --step variant_calling --outdir results --sentieon_haplotyper_emit_mode gvcf tags: @@ -115,6 +131,16 @@ should_exist: false - path: results/haplotyper should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/test/test.recal.cram.stats - name: Run variant calling on germline sample with sentieons haplotyper output both gvcf and vcf command: nextflow run main.nf -profile test_cache,software_license,targeted --sentieon_extension --input ./tests/csv/3.0/mapped_single_bam.csv --tools sentieon_haplotyper --step variant_calling --outdir results --sentieon_haplotyper_emit_mode variant,gvcf tags: @@ -145,6 +171,16 @@ - path: results/variant_calling/sentieon_haplotyper/test/test.haplotyper.unfiltered.vcf.gz.tbi - path: results/haplotyper should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/test/test.recal.cram.stats - name: Run variant calling on germline sample with sentieons haplotyper and gatk haplotypecaller command: nextflow run main.nf -profile test_cache,software_license,targeted --sentieon_extension --input ./tests/csv/3.0/mapped_single_bam.csv --tools haplotypecaller,sentieon_haplotyper --step variant_calling --outdir results tags: @@ -164,7 +200,6 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/sentieon_haplotyper/test/test.haplotyper.filtered.bcftools_stats.txt - md5sum: 66be03d4e6535175514f54a1a031d49f - path: results/reports/vcftools/sentieon_haplotyper/test/test.haplotyper.filtered.FILTER.summary md5sum: d501a93356f3c91c743f51104e24514a - path: results/reports/vcftools/sentieon_haplotyper/test/test.haplotyper.filtered.TsTv.count @@ -189,3 +224,13 @@ # binary changes md5sums on reruns - path: results/haplotyper should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/test/test.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/test/test.recal.cram.stats diff --git a/tests/test_sentieon_haplotyper_joint_germline.yml b/tests/test_sentieon_haplotyper_joint_germline.yml index 1c12f101db..9469559f88 100644 --- a/tests/test_sentieon_haplotyper_joint_germline.yml +++ b/tests/test_sentieon_haplotyper_joint_germline.yml @@ -2,9 +2,8 @@ command: nextflow run main.nf -profile test_cache,software_license,targeted --sentieon_extension --input ./tests/csv/3.0/mapped_joint_bam.csv --tools sentieon_haplotyper --step variant_calling --joint_germline --outdir results --sentieon_haplotyper_emit_mode gvcf tags: - germline - - sentieon_haplotyper_joint_germline + - sentieon/haplotyper_joint_germline - variant_calling - - sentieon/haplotyper files: - path: results/csv/variantcalled.csv md5sum: 6ec10f6455c2b5290c7f6fc687c529ca @@ -27,13 +26,34 @@ - path: results/variant_calling/sentieon_haplotyper/testT/testT.haplotyper.g.vcf.gz.tbi - path: results/haplotyper should_exist: false + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.summary.txt + md5sum: 615c5c5019d88045a9ff5bbe6e63d270 + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/testN/testN.recal.cram.stats + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.global.dist.txt + md5sum: ba97ed85645f77da6f3adad138b3cdb4 + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.region.dist.txt + md5sum: a7eb835371dd0aaf347ccca7ebe1eb3b + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.summary.txt + md5sum: a937108cbf24c1430b79c861234ce22b + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz + md5sum: d2b579a74bf8d858f82869f073056252 + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/testT/testT.recal.cram.stats - name: Run joint germline variant calling with sentieon haplotyper all intervals at once command: nextflow run main.nf -profile test_cache,software_license,targeted --sentieon_extension --input ./tests/csv/3.0/mapped_joint_bam.csv --tools sentieon_haplotyper --step variant_calling --joint_germline --outdir results --sentieon_haplotyper_emit_mode gvcf --nucleotides_per_second 100 tags: - germline - - sentieon_haplotyper_joint_germline + - sentieon/haplotyper_joint_germline - variant_calling - - sentieon/haplotyper files: - path: results/csv/variantcalled.csv md5sum: 6ec10f6455c2b5290c7f6fc687c529ca @@ -54,11 +74,33 @@ - path: results/variant_calling/sentieon_haplotyper/testT/testT.haplotyper.g.vcf.gz.tbi - path: results/haplotyper should_exist: false + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.region.dist.txt + md5sum: 3a2030e5e8af7bc12720c3a5592bf921 + - path: results/reports/mosdepth/testN/testN.recal.mosdepth.summary.txt + md5sum: 615c5c5019d88045a9ff5bbe6e63d270 + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz + md5sum: 9f1ea20e7461db948ba21f70c4d1b3ba + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/testN/testN.recal.cram.stats + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.global.dist.txt + md5sum: ba97ed85645f77da6f3adad138b3cdb4 + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.region.dist.txt + md5sum: a7eb835371dd0aaf347ccca7ebe1eb3b + - path: results/reports/mosdepth/testT/testT.recal.mosdepth.summary.txt + md5sum: a937108cbf24c1430b79c861234ce22b + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz + md5sum: d2b579a74bf8d858f82869f073056252 + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz.csi + md5sum: 5c00a1d457c387d6e71848a6d897e309 + - path: results/reports/samtools/testT/testT.recal.cram.stats - name: Run joint germline variant calling with sentieon haplotyper with stub for VQSR command: nextflow run main.nf -profile test_cache,software_license,tools_germline --sentieon_extension --input ./tests/csv/3.0/mapped_joint_bam.csv --tools sentieon_haplotyper --step variant_calling --joint_germline --outdir results --sentieon_haplotyper_emit_mode gvcf -stub-run tags: - germline - - sentieon_haplotyper_joint_germline + - sentieon/haplotyper_joint_germline - variant_calling - vqsr files: @@ -70,9 +112,6 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/sentieon_haplotyper/joint_variant_calling/joint_germline_recalibrated.bcftools_stats.txt - - path: results/reports/vcftools/sentieon_haplotyper/joint_variant_calling/joint_germline_recalibrated.FILTER.summary - - path: results/reports/vcftools/sentieon_haplotyper/joint_variant_calling/joint_germline_recalibrated.TsTv.count - - path: results/reports/vcftools/sentieon_haplotyper/joint_variant_calling/joint_germline_recalibrated.TsTv.qual - path: results/variant_calling/sentieon_haplotyper/joint_variant_calling/joint_germline.vcf.gz - path: results/variant_calling/sentieon_haplotyper/joint_variant_calling/joint_germline.vcf.gz.tbi - path: results/variant_calling/sentieon_haplotyper/joint_variant_calling/joint_germline_recalibrated.vcf.gz @@ -83,3 +122,25 @@ - path: results/variant_calling/sentieon_haplotyper/testT/testT.haplotyper.g.vcf.gz.tbi - path: results/haplotyper should_exist: false + - path: results/reports/mosdepth/testN/testN.recal.global.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testN/testN.recal.region.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testN/testN.recal.summary.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz + md5sum: 1a60c330fb42841e8dcf3cd507a70bfc + - path: results/reports/mosdepth/testN/testN.recal.regions.bed.gz.csi + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/samtools/testN/testN.recal.cram.stats + - path: results/reports/mosdepth/testT/testT.recal.global.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testT/testT.recal.region.dist.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testT/testT.recal.summary.txt + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz + md5sum: 1a60c330fb42841e8dcf3cd507a70bfc + - path: results/reports/mosdepth/testT/testT.recal.regions.bed.gz.csi + md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: results/reports/samtools/testT/testT.recal.cram.stats diff --git a/tests/test_sentieon_haplotyper_skip_filter.yml b/tests/test_sentieon_haplotyper_skip_filter.yml index b4229da7b4..f599260b5f 100644 --- a/tests/test_sentieon_haplotyper_skip_filter.yml +++ b/tests/test_sentieon_haplotyper_skip_filter.yml @@ -2,9 +2,8 @@ command: nextflow run main.nf -profile test_cache,software_license,targeted --sentieon_extension --input ./tests/csv/3.0/mapped_single_bam.csv --tools sentieon_haplotyper --step variant_calling --skip_tools haplotyper_filter --outdir results tags: - germline - - sentieon_haplotyper_skip_filter + - sentieon/haplotyper_skip_filter - variant_calling - - sentieon/haplotyper files: - path: results/csv/variantcalled.csv md5sum: e08d6aa77d914bc2c933e70696b74cdd @@ -18,7 +17,6 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/sentieon_haplotyper/test/test.haplotyper.unfiltered.bcftools_stats.txt - md5sum: d2660f9f6074b4bf18756c42ee656b8f - path: results/reports/vcftools/sentieon_haplotyper/test/test.haplotyper.unfiltered.FILTER.summary md5sum: 01b3d10464a3ac86f90ee82cdda23f68 - path: results/reports/vcftools/sentieon_haplotyper/test/test.haplotyper.unfiltered.TsTv.count @@ -35,14 +33,21 @@ # binary changes md5sums on reruns - path: results/sentieon_haplotyper should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: results/reports/samtools/test/test.recal.cram.stats - name: Run variant calling on germline sample with sentieon haplotyper without intervals and skip filter command: nextflow run main.nf -profile test_cache,software_license,targeted --sentieon_extension --input ./tests/csv/3.0/mapped_single_bam.csv --tools sentieon_haplotyper --step variant_calling --skip_tools haplotyper_filter --no_intervals --outdir results tags: - germline - - sentieon_haplotyper_skip_filter + - sentieon/haplotyper_skip_filter - no_intervals - variant_calling - - sentieon/haplotyper files: - path: results/csv/variantcalled.csv md5sum: e08d6aa77d914bc2c933e70696b74cdd @@ -62,7 +67,6 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/sentieon_haplotyper/test/test.haplotyper.unfiltered.bcftools_stats.txt - md5sum: d2660f9f6074b4bf18756c42ee656b8f - path: results/reports/vcftools/sentieon_haplotyper/test/test.haplotyper.unfiltered.FILTER.summary md5sum: 01b3d10464a3ac86f90ee82cdda23f68 - path: results/reports/vcftools/sentieon_haplotyper/test/test.haplotyper.unfiltered.TsTv.count @@ -79,3 +83,11 @@ # binary changes md5sums on reruns - path: results/sentieon_haplotyper should_exist: false + - path: results/reports/mosdepth/test/test.recal.mosdepth.global.dist.txt + md5sum: e82e90c7d508a135b5a8a7cd6933452e + - path: results/reports/mosdepth/test/test.recal.mosdepth.summary.txt + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz + md5sum: bc1df47d46f818fee5275975925d769a + - path: results/reports/mosdepth/test/test.recal.per-base.bed.gz.csi + md5sum: 9e649ac749ff6c6073bef5ab63e8aaa4 + - path: results/reports/samtools/test/test.recal.cram.stats diff --git a/tests/test_strelka.yml b/tests/test_strelka.yml index 2a3a24c936..766d9e18c7 100644 --- a/tests/test_strelka.yml +++ b/tests/test_strelka.yml @@ -76,6 +76,52 @@ should_exist: false - path: results/variant_calling/strelka/sample3/sample3.strelka.genome.vcf.gz.tbi should_exist: false + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample1/sample1.recal.cram.stats + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Run variant calling on germline sample with strelka command: nextflow run main.nf -profile test_cache,tools_germline --tools strelka --outdir results tags: @@ -104,6 +150,17 @@ # binary changes md5sums on reruns - path: results/strelka should_exist: false + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample1/sample1.recal.cram.stats - name: Run variant calling on germline sample with strelka without intervals command: nextflow run main.nf -profile test_cache,tools_germline --tools strelka --no_intervals --outdir results tags: @@ -139,6 +196,15 @@ # binary changes md5sums on reruns - path: results/strelka should_exist: false + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: d2775eb102acc5950f7f53883dcb503d + - path: results/reports/mosdepth/sample1/sample1.recal.per-base.bed.gz + md5sum: 54431f155c9538809e8caf99d1a75ec7 + - path: results/reports/mosdepth/sample1/sample1.recal.per-base.bed.gz.csi + md5sum: c67dcd711b096eb42f43784d5eadbc0d + - path: results/reports/samtools/sample1/sample1.recal.cram.stats - name: Run variant calling on tumor only sample with strelka command: nextflow run main.nf -profile test_cache,tools_tumoronly --tools strelka --outdir results tags: @@ -167,6 +233,17 @@ # binary changes md5sums on reruns - path: results/strelka should_exist: false + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats - name: Run variant calling on tumor only sample with strelka without intervals command: nextflow run main.nf -profile test_cache,tools_tumoronly --tools strelka --no_intervals --outdir results tags: @@ -202,6 +279,15 @@ # binary changes md5sums on reruns - path: results/strelka should_exist: false + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 0a7300e56eda6fba7c7564f00aa000f0 + - path: results/reports/mosdepth/sample2/sample2.recal.per-base.bed.gz + md5sum: 3de4a9f4da2f2b4909ef192452a8d211 + - path: results/reports/mosdepth/sample2/sample2.recal.per-base.bed.gz.csi + md5sum: cfb07b0ba46e8468b4342edb243536f3 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats - name: Run variant calling on somatic sample with strelka command: nextflow run main.nf -profile test_cache,tools_somatic --tools strelka --outdir results tags: @@ -254,6 +340,30 @@ # binary changes md5sums on reruns - path: results/strelka should_exist: false + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Run variant calling on somatic sample with strelka without intervals command: nextflow run main.nf -profile test_cache,tools_somatic --tools strelka --no_intervals --outdir results tags: @@ -313,3 +423,23 @@ # binary changes md5sums on reruns - path: results/strelka should_exist: false + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: d2775eb102acc5950f7f53883dcb503d + - path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz + md5sum: 54431f155c9538809e8caf99d1a75ec7 + - path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz.csi + md5sum: c67dcd711b096eb42f43784d5eadbc0d + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 0a7300e56eda6fba7c7564f00aa000f0 + - path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz + md5sum: 3de4a9f4da2f2b4909ef192452a8d211 + - path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz.csi + md5sum: cfb07b0ba46e8468b4342edb243536f3 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test diff --git a/tests/test_strelka_bp.yml b/tests/test_strelka_bp.yml index b89d09550d..b813f648d8 100644 --- a/tests/test_strelka_bp.yml +++ b/tests/test_strelka_bp.yml @@ -88,6 +88,30 @@ should_exist: false - path: results/strelka should_exist: false + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Run variant calling on somatic sample with Strelka BP without intervals command: nextflow run main.nf -profile test_cache,tools_somatic --tools strelka,manta --no_intervals --outdir results tags: @@ -185,3 +209,23 @@ should_exist: false - path: results/strelka should_exist: false + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: d2775eb102acc5950f7f53883dcb503d + - path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz + md5sum: 54431f155c9538809e8caf99d1a75ec7 + - path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz.csi + md5sum: c67dcd711b096eb42f43784d5eadbc0d + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 0a7300e56eda6fba7c7564f00aa000f0 + - path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz + md5sum: 3de4a9f4da2f2b4909ef192452a8d211 + - path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz.csi + md5sum: cfb07b0ba46e8468b4342edb243536f3 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test diff --git a/tests/test_tiddit.yml b/tests/test_tiddit.yml index ad82fb4605..abac99f94b 100644 --- a/tests/test_tiddit.yml +++ b/tests/test_tiddit.yml @@ -44,6 +44,30 @@ # conda changes md5sums for test - path: results/tiddit should_exist: false + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Run variant calling on germline sample with tiddit command: nextflow run main.nf -profile test_cache,tools_germline --tools tiddit --outdir results tags: @@ -70,6 +94,17 @@ # conda changes md5sums for test - path: results/tiddit should_exist: false + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample1/sample1.recal.cram.stats - name: Run variant calling on tumor_only sample with tiddit command: nextflow run main.nf -profile test_cache,tools_tumoronly --tools tiddit --outdir results tags: @@ -96,3 +131,14 @@ # conda changes md5sums for test - path: results/tiddit should_exist: false + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats diff --git a/tests/test_tools_manually.yml b/tests/test_tools_manually.yml index ae4c8f70be..8725ec6a64 100644 --- a/tests/test_tools_manually.yml +++ b/tests/test_tools_manually.yml @@ -34,6 +34,30 @@ md5sum: 68b329da9893e34099c7d8ad5cb9c940 - path: results/variant_calling/ascat/sample4_vs_sample3/sample4_vs_sample3.tumour_normalLogR.txt md5sum: 05418a7d814db11808172a4f57d040a1 + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Run variant calling on somatic sample with mutect2 without intervals command: nextflow run main.nf -profile test_cache,tools_somatic --tools mutect2 --no_intervals --outdir results tags: @@ -82,6 +106,26 @@ md5sum: 17d2091015d04cbd4a26b7a67dc659e6 - path: results/variant_calling/mutect2/sample4_vs_sample3/sample4_vs_sample3.mutect2.vcf.gz.tbi # binary changes md5sums on reruns + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: d2775eb102acc5950f7f53883dcb503d + - path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz + md5sum: 54431f155c9538809e8caf99d1a75ec7 + - path: results/reports/mosdepth/sample3/sample3.recal.per-base.bed.gz.csi + md5sum: c67dcd711b096eb42f43784d5eadbc0d + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 0a7300e56eda6fba7c7564f00aa000f0 + - path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz + md5sum: 3de4a9f4da2f2b4909ef192452a8d211 + - path: results/reports/mosdepth/sample4/sample4.recal.per-base.bed.gz.csi + md5sum: cfb07b0ba46e8468b4342edb243536f3 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Run variant calling on somatic sample with mutect2 command: nextflow run main.nf -profile test_cache,tools_somatic --tools mutect2 --outdir results tags: @@ -123,6 +167,30 @@ md5sum: c09dff3f145d77d4848992e244811c08 - path: results/variant_calling/mutect2/sample4_vs_sample3/sample4_vs_sample3.mutect2.vcf.gz.tbi # binary changes md5sums on reruns + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample4/sample4.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample4/sample4.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample4/sample4.recal.cram.stats + # conda changes md5sums for test - name: Run joint calling on tumor only samples with mutect2 command: nextflow run main.nf -profile test_cache,tools_tumoronly --input tests/csv/3.0/recalibrated_tumoronly_joint.csv --tools mutect2 --joint_mutect2 --outdir results tags: @@ -170,6 +238,18 @@ md5sum: 22e58aef3b14b335fa487d40b590ffeb - path: results/variant_calling/mutect2/test/test.mutect2.vcf.gz.tbi # binary changes md5sums on reruns + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test - name: Run joint calling on somatic samples with mutect2 command: nextflow run main.nf -profile test_cache,tools_somatic --input tests/csv/3.0/recalibrated_somatic_joint.csv --tools mutect2 --joint_mutect2 --outdir results tags: @@ -218,6 +298,42 @@ md5sum: 094cb75b0bda28e92b6718ff33d136e2 - path: results/variant_calling/mutect2/test/test.mutect2.vcf.gz.tbi # binary changes md5sums on reruns + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.global.dist.txt + md5sum: 69e29702ef01fd8f6c7a5468fc35a16a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.region.dist.txt + md5sum: 6ec49cd7d510c2eb3d9d90fdb79b783a + - path: results/reports/mosdepth/sample1/sample1.recal.mosdepth.summary.txt + md5sum: 103098d0bf76ed82d2b87d5f242b099a + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz + md5sum: b5888cf7395c57d39879a5faa6159eb3 + - path: results/reports/mosdepth/sample1/sample1.recal.regions.bed.gz.csi + md5sum: 9cb0ad7039a3b703d16ca7d5b835c0ee + - path: results/reports/samtools/sample1/sample1.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample2/sample2.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample2/sample2.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample2/sample2.recal.cram.stats + # conda changes md5sums for test + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.global.dist.txt + md5sum: f2dcd00a64947c49e8e4b93c2f4fbf27 + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.region.dist.txt + md5sum: 39005ffaac22871ffaaf19656fe69c5b + - path: results/reports/mosdepth/sample3/sample3.recal.mosdepth.summary.txt + md5sum: 68d4b98f17361fddf73052ead34fa370 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz + md5sum: 2819e995eafded35f53328c4ec19ba58 + - path: results/reports/mosdepth/sample3/sample3.recal.regions.bed.gz.csi + md5sum: 393c2749068304d8545b501b9d4658e4 + - path: results/reports/samtools/sample3/sample3.recal.cram.stats + # conda changes md5sums for test - name: Run full pipeline on tumoronly with most tools command: nextflow run . -profile test --input tests/csv/3.0/fastq_tumor_only.csv --tools cnvkit,freebayes,merge,mpileup,mutect2,snpeff,strelka,tiddit,vep --outdir results tags: diff --git a/workflows/sarek.nf b/workflows/sarek/main.nf similarity index 57% rename from workflows/sarek.nf rename to workflows/sarek/main.nf index 99ecd733fc..5062470373 100644 --- a/workflows/sarek.nf +++ b/workflows/sarek/main.nf @@ -1,231 +1,85 @@ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - PRINT PARAMS SUMMARY + IMPORT MODULES / SUBWORKFLOWS / FUNCTIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -include { paramsSummaryLog; paramsSummaryMap; fromSamplesheet } from 'plugin/nf-validation' - -def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs) -def citation = '\n' + WorkflowMain.citation(workflow) + '\n' -def summary_params = paramsSummaryMap(workflow) - -// Print parameter summary log to screen -log.info logo + paramsSummaryLog(workflow) + citation - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - VALIDATE INPUTS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -// Check input path parameters to see if they exist -def checkPathParamList = [ - params.ascat_alleles, - params.ascat_loci, - params.ascat_loci_gc, - params.ascat_loci_rt, - params.bwa, - params.bwamem2, - params.bcftools_annotations, - params.bcftools_annotations_index, - params.bcftools_header_lines, - params.cf_chrom_len, - params.chr_dir, - params.cnvkit_reference, - params.dbnsfp, - params.dbnsfp_tbi, - params.dbsnp, - params.dbsnp_tbi, - params.dict, - params.dragmap, - params.fasta, - params.fasta_fai, - params.germline_resource, - params.germline_resource_tbi, - params.input, - params.intervals, - params.known_indels, - params.known_indels_tbi, - params.known_snps, - params.known_snps_tbi, - params.mappability, - params.multiqc_config, - params.ngscheckmate_bed, - params.pon, - params.pon_tbi, - params.sentieon_dnascope_model, - params.spliceai_indel, - params.spliceai_indel_tbi, - params.spliceai_snv, - params.spliceai_snv_tbi -] - -// only check if we are using the tools -if (params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('merge'))) checkPathParamList.add(params.snpeff_cache) -if (params.tools && (params.tools.split(',').contains('vep') || params.tools.split(',').contains('merge'))) checkPathParamList.add(params.vep_cache) - -// Validate input parameters -WorkflowSarek.initialise(params, log) - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Check mandatory parameters -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -for (param in checkPathParamList) if (param) file(param, checkIfExists: true) - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - IMPORT LOCAL MODULES/SUBWORKFLOWS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -// Initialize file channels based on params, defined in the params.genomes[params.genome] scope -ascat_alleles = params.ascat_alleles ? Channel.fromPath(params.ascat_alleles).collect() : Channel.empty() -ascat_loci = params.ascat_loci ? Channel.fromPath(params.ascat_loci).collect() : Channel.empty() -ascat_loci_gc = params.ascat_loci_gc ? Channel.fromPath(params.ascat_loci_gc).collect() : Channel.value([]) -ascat_loci_rt = params.ascat_loci_rt ? Channel.fromPath(params.ascat_loci_rt).collect() : Channel.value([]) -cf_chrom_len = params.cf_chrom_len ? Channel.fromPath(params.cf_chrom_len).collect() : [] -chr_dir = params.chr_dir ? Channel.fromPath(params.chr_dir).collect() : Channel.value([]) -dbsnp = params.dbsnp ? Channel.fromPath(params.dbsnp).collect() : Channel.value([]) -fasta = params.fasta ? Channel.fromPath(params.fasta).first() : Channel.empty() -fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).collect() : Channel.empty() -germline_resource = params.germline_resource ? Channel.fromPath(params.germline_resource).collect() : Channel.value([]) // Mutect2 does not require a germline resource, so set to optional input -known_indels = params.known_indels ? Channel.fromPath(params.known_indels).collect() : Channel.value([]) -known_snps = params.known_snps ? Channel.fromPath(params.known_snps).collect() : Channel.value([]) -mappability = params.mappability ? Channel.fromPath(params.mappability).collect() : Channel.value([]) -pon = params.pon ? Channel.fromPath(params.pon).collect() : Channel.value([]) // PON is optional for Mutect2 (but highly recommended) -sentieon_dnascope_model = params.sentieon_dnascope_model ? Channel.fromPath(params.sentieon_dnascope_model).collect() : Channel.value([]) - -// Initialize value channels based on params, defined in the params.genomes[params.genome] scope -ascat_genome = params.ascat_genome ?: Channel.empty() -dbsnp_vqsr = params.dbsnp_vqsr ? Channel.value(params.dbsnp_vqsr) : Channel.empty() -known_indels_vqsr = params.known_indels_vqsr ? Channel.value(params.known_indels_vqsr) : Channel.empty() -known_snps_vqsr = params.known_snps_vqsr ? Channel.value(params.known_snps_vqsr) : Channel.empty() -ngscheckmate_bed = params.ngscheckmate_bed ? Channel.value(params.ngscheckmate_bed) : Channel.empty() -snpeff_db = params.snpeff_db ?: Channel.empty() -vep_cache_version = params.vep_cache_version ?: Channel.empty() -vep_genome = params.vep_genome ?: Channel.empty() -vep_species = params.vep_species ?: Channel.empty() -bcftools_annotations = params.bcftools_annotations ?: Channel.empty() -bcftools_annotations_index = params.bcftools_annotations_index ?: Channel.empty() -bcftools_header_lines = params.bcftools_header_lines ?: Channel.empty() - -vep_extra_files = [] - -if (params.dbnsfp && params.dbnsfp_tbi) { - vep_extra_files.add(file(params.dbnsfp, checkIfExists: true)) - vep_extra_files.add(file(params.dbnsfp_tbi, checkIfExists: true)) -} - -if (params.spliceai_snv && params.spliceai_snv_tbi && params.spliceai_indel && params.spliceai_indel_tbi) { - vep_extra_files.add(file(params.spliceai_indel, checkIfExists: true)) - vep_extra_files.add(file(params.spliceai_indel_tbi, checkIfExists: true)) - vep_extra_files.add(file(params.spliceai_snv, checkIfExists: true)) - vep_extra_files.add(file(params.spliceai_snv_tbi, checkIfExists: true)) -} - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - IMPORT LOCAL/NF-CORE MODULES/SUBWORKFLOWS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ +include { paramsSummaryMap } from 'plugin/nf-validation' +include { paramsSummaryMultiqc } from '../../subworkflows/nf-core/utils_nfcore_pipeline' +include { softwareVersionsToYAML } from '../../subworkflows/nf-core/utils_nfcore_pipeline' +include { methodsDescriptionText } from '../../subworkflows/local/utils_nfcore_sarek_pipeline' // Create samplesheets to restart from different steps -include { SAMPLESHEET_TO_CHANNEL } from '../subworkflows/local/samplesheet_to_channel/main' -include { CHANNEL_ALIGN_CREATE_CSV } from '../subworkflows/local/channel_align_create_csv/main' -include { CHANNEL_MARKDUPLICATES_CREATE_CSV } from '../subworkflows/local/channel_markduplicates_create_csv/main' -include { CHANNEL_BASERECALIBRATOR_CREATE_CSV } from '../subworkflows/local/channel_baserecalibrator_create_csv/main' -include { CHANNEL_APPLYBQSR_CREATE_CSV } from '../subworkflows/local/channel_applybqsr_create_csv/main' -include { CHANNEL_VARIANT_CALLING_CREATE_CSV } from '../subworkflows/local/channel_variant_calling_create_csv/main' - -// Download cache for SnpEff/VEP if needed -include { DOWNLOAD_CACHE_SNPEFF_VEP } from '../subworkflows/local/download_cache_snpeff_vep/main' - -// Initialize annotation cache -include { INITIALIZE_ANNOTATION_CACHE } from '../subworkflows/local/initialize_annotation_cache/main' - -// Build indices if needed -include { PREPARE_GENOME } from '../subworkflows/local/prepare_genome/main' - -// Build intervals if needed -include { PREPARE_INTERVALS } from '../subworkflows/local/prepare_intervals/main' - -// Build CNVkit reference if needed -include { PREPARE_REFERENCE_CNVKIT } from '../subworkflows/local/prepare_reference_cnvkit/main' +include { CHANNEL_ALIGN_CREATE_CSV } from '../../subworkflows/local/channel_align_create_csv/main' +include { CHANNEL_MARKDUPLICATES_CREATE_CSV } from '../../subworkflows/local/channel_markduplicates_create_csv/main' +include { CHANNEL_BASERECALIBRATOR_CREATE_CSV } from '../../subworkflows/local/channel_baserecalibrator_create_csv/main' +include { CHANNEL_APPLYBQSR_CREATE_CSV } from '../../subworkflows/local/channel_applybqsr_create_csv/main' +include { CHANNEL_VARIANT_CALLING_CREATE_CSV } from '../../subworkflows/local/channel_variant_calling_create_csv/main' // Convert BAM files to FASTQ files -include { BAM_CONVERT_SAMTOOLS as CONVERT_FASTQ_INPUT } from '../subworkflows/local/bam_convert_samtools/main' -include { BAM_CONVERT_SAMTOOLS as CONVERT_FASTQ_UMI } from '../subworkflows/local/bam_convert_samtools/main' +include { BAM_CONVERT_SAMTOOLS as CONVERT_FASTQ_INPUT } from '../../subworkflows/local/bam_convert_samtools/main' +include { BAM_CONVERT_SAMTOOLS as CONVERT_FASTQ_UMI } from '../../subworkflows/local/bam_convert_samtools/main' // Run FASTQC -include { FASTQC } from '../modules/nf-core/fastqc/main' +include { FASTQC } from '../../modules/nf-core/fastqc/main' // TRIM/SPLIT FASTQ Files -include { FASTP } from '../modules/nf-core/fastp/main' +include { FASTP } from '../../modules/nf-core/fastp/main' // Create umi consensus bams from fastq -include { FASTQ_CREATE_UMI_CONSENSUS_FGBIO } from '../subworkflows/local/fastq_create_umi_consensus_fgbio/main' +include { FASTQ_CREATE_UMI_CONSENSUS_FGBIO } from '../../subworkflows/local/fastq_create_umi_consensus_fgbio/main' // Map input reads to reference genome -include { FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON } from '../subworkflows/local/fastq_align_bwamem_mem2_dragmap_sentieon/main' +include { FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON } from '../../subworkflows/local/fastq_align_bwamem_mem2_dragmap_sentieon/main' // Merge and index BAM files (optional) -include { BAM_MERGE_INDEX_SAMTOOLS } from '../subworkflows/local/bam_merge_index_samtools/main' +include { BAM_MERGE_INDEX_SAMTOOLS } from '../../subworkflows/local/bam_merge_index_samtools/main' // Convert BAM files -include { SAMTOOLS_CONVERT as BAM_TO_CRAM } from '../modules/nf-core/samtools/convert/main' -include { SAMTOOLS_CONVERT as BAM_TO_CRAM_MAPPING } from '../modules/nf-core/samtools/convert/main' +include { SAMTOOLS_CONVERT as BAM_TO_CRAM } from '../../modules/nf-core/samtools/convert/main' +include { SAMTOOLS_CONVERT as BAM_TO_CRAM_MAPPING } from '../../modules/nf-core/samtools/convert/main' // Convert CRAM files (optional) -include { SAMTOOLS_CONVERT as CRAM_TO_BAM } from '../modules/nf-core/samtools/convert/main' -include { SAMTOOLS_CONVERT as CRAM_TO_BAM_RECAL } from '../modules/nf-core/samtools/convert/main' +include { SAMTOOLS_CONVERT as CRAM_TO_BAM } from '../../modules/nf-core/samtools/convert/main' +include { SAMTOOLS_CONVERT as CRAM_TO_BAM_RECAL } from '../../modules/nf-core/samtools/convert/main' // Mark Duplicates (+QC) -include { BAM_MARKDUPLICATES } from '../subworkflows/local/bam_markduplicates/main' -include { BAM_MARKDUPLICATES_SPARK } from '../subworkflows/local/bam_markduplicates_spark/main' -include { BAM_SENTIEON_DEDUP } from '../subworkflows/local/bam_sentieon_dedup/main' +include { BAM_MARKDUPLICATES } from '../../subworkflows/local/bam_markduplicates/main' +include { BAM_MARKDUPLICATES_SPARK } from '../../subworkflows/local/bam_markduplicates_spark/main' +include { BAM_SENTIEON_DEDUP } from '../../subworkflows/local/bam_sentieon_dedup/main' // QC on CRAM -include { CRAM_QC_MOSDEPTH_SAMTOOLS as CRAM_QC_NO_MD } from '../subworkflows/local/cram_qc_mosdepth_samtools/main' -include { CRAM_QC_MOSDEPTH_SAMTOOLS as CRAM_QC_RECAL } from '../subworkflows/local/cram_qc_mosdepth_samtools/main' +include { CRAM_QC_MOSDEPTH_SAMTOOLS as CRAM_QC_NO_MD } from '../../subworkflows/local/cram_qc_mosdepth_samtools/main' +include { CRAM_SAMPLEQC } from '../../subworkflows/local/cram_sampleqc/main' // Create recalibration tables -include { BAM_BASERECALIBRATOR } from '../subworkflows/local/bam_baserecalibrator/main' -include { BAM_BASERECALIBRATOR_SPARK } from '../subworkflows/local/bam_baserecalibrator_spark/main' +include { BAM_BASERECALIBRATOR } from '../../subworkflows/local/bam_baserecalibrator/main' +include { BAM_BASERECALIBRATOR_SPARK } from '../../subworkflows/local/bam_baserecalibrator_spark/main' // Create recalibrated cram files to use for variant calling (+QC) -include { BAM_APPLYBQSR } from '../subworkflows/local/bam_applybqsr/main' -include { BAM_APPLYBQSR_SPARK } from '../subworkflows/local/bam_applybqsr_spark/main' +include { BAM_APPLYBQSR } from '../../subworkflows/local/bam_applybqsr/main' +include { BAM_APPLYBQSR_SPARK } from '../../subworkflows/local/bam_applybqsr_spark/main' // Variant calling on a single normal sample -include { BAM_VARIANT_CALLING_GERMLINE_ALL } from '../subworkflows/local/bam_variant_calling_germline_all/main' +include { BAM_VARIANT_CALLING_GERMLINE_ALL } from '../../subworkflows/local/bam_variant_calling_germline_all/main' // Variant calling on a single tumor sample -include { BAM_VARIANT_CALLING_TUMOR_ONLY_ALL } from '../subworkflows/local/bam_variant_calling_tumor_only_all/main' +include { BAM_VARIANT_CALLING_TUMOR_ONLY_ALL } from '../../subworkflows/local/bam_variant_calling_tumor_only_all/main' // Variant calling on tumor/normal pair -include { BAM_VARIANT_CALLING_SOMATIC_ALL } from '../subworkflows/local/bam_variant_calling_somatic_all/main' +include { BAM_VARIANT_CALLING_SOMATIC_ALL } from '../../subworkflows/local/bam_variant_calling_somatic_all/main' // POST VARIANTCALLING: e.g. merging -include { POST_VARIANTCALLING } from '../subworkflows/local/post_variantcalling/main' +include { POST_VARIANTCALLING } from '../../subworkflows/local/post_variantcalling/main' // QC on VCF files -include { VCF_QC_BCFTOOLS_VCFTOOLS } from '../subworkflows/local/vcf_qc_bcftools_vcftools/main' - -// Sample QC on CRAM files -include { CRAM_SAMPLEQC } from '../subworkflows/local/cram_sampleqc/main' +include { VCF_QC_BCFTOOLS_VCFTOOLS } from '../../subworkflows/local/vcf_qc_bcftools_vcftools/main' // Annotation -include { VCF_ANNOTATE_ALL } from '../subworkflows/local/vcf_annotate_all/main' - -// REPORTING VERSIONS OF SOFTWARE USED -include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main' +include { VCF_ANNOTATE_ALL } from '../../subworkflows/local/vcf_annotate_all/main' // MULTIQC -include { MULTIQC } from '../modules/nf-core/multiqc/main' +include { MULTIQC } from '../../modules/nf-core/multiqc/main' /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -234,153 +88,60 @@ include { MULTIQC } from '../modules/nf-core */ workflow SAREK { - - // Parse samplesheet - // Set input, can either be from --input or from automatic retrieval in WorkflowSarek.groovy - ch_from_samplesheet = params.build_only_index ? Channel.empty() : params.input ? Channel.fromSamplesheet("input") : Channel.fromSamplesheet("input_restart") - SAMPLESHEET_TO_CHANNEL(ch_from_samplesheet) - - input_sample = SAMPLESHEET_TO_CHANNEL.out.input_sample - - // MULTIQC - ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true) - ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath( params.multiqc_config, checkIfExists: true ) : Channel.empty() - ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath( params.multiqc_logo, checkIfExists: true ) : Channel.empty() - ch_multiqc_custom_methods_description = params.multiqc_methods_description ? file(params.multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) + take: + input_sample + allele_files + bcftools_annotations + bcftools_annotations_tbi + bcftools_header_lines + cf_chrom_len + chr_files + cnvkit_reference + dbsnp + dbsnp_tbi + dbsnp_vqsr + dict + fasta + fasta_fai + gc_file + germline_resource + germline_resource_tbi + index_alignement + intervals_and_num_intervals + intervals_bed_combined + intervals_bed_combined_for_variant_calling + intervals_bed_gz_tbi_and_num_intervals + intervals_bed_gz_tbi_combined + intervals_for_preprocessing + known_indels_vqsr + known_sites_indels + known_sites_indels_tbi + known_sites_snps + known_sites_snps_tbi + known_snps_vqsr + loci_files + mappability + msisensorpro_scan + ngscheckmate_bed + pon + pon_tbi + rt_file + sentieon_dnascope_model + snpeff_cache + vep_cache + vep_cache_version + vep_extra_files + vep_fasta + vep_genome + vep_species + + main: // To gather all QC reports for MultiQC - reports = Channel.empty() - // To gather used softwares versions for MultiQC - versions = Channel.empty() - - // Download cache - if (params.download_cache) { - // Assuming that even if the cache is provided, if the user specify download_cache, sarek will download the cache - ensemblvep_info = Channel.of([ [ id:"${params.vep_cache_version}_${params.vep_genome}" ], params.vep_genome, params.vep_species, params.vep_cache_version ]) - snpeff_info = Channel.of([ [ id:"${params.snpeff_genome}.${params.snpeff_db}" ], params.snpeff_genome, params.snpeff_db ]) - DOWNLOAD_CACHE_SNPEFF_VEP(ensemblvep_info, snpeff_info) - snpeff_cache = DOWNLOAD_CACHE_SNPEFF_VEP.out.snpeff_cache - vep_cache = DOWNLOAD_CACHE_SNPEFF_VEP.out.ensemblvep_cache.map{ meta, cache -> [ cache ] } - - versions = versions.mix(DOWNLOAD_CACHE_SNPEFF_VEP.out.versions) - } else { - // Looks for cache information either locally or on the cloud - INITIALIZE_ANNOTATION_CACHE( - (params.snpeff_cache && params.tools && (params.tools.split(',').contains("snpeff") || params.tools.split(',').contains('merge'))), - params.snpeff_cache, - params.snpeff_genome, - params.snpeff_db, - (params.vep_cache && params.tools && (params.tools.split(',').contains("vep") || params.tools.split(',').contains('merge'))), - params.vep_cache, - params.vep_species, - params.vep_cache_version, - params.vep_genome, - "Please refer to https://nf-co.re/sarek/docs/usage/#how-to-customise-snpeff-and-vep-annotation for more information.") - - snpeff_cache = INITIALIZE_ANNOTATION_CACHE.out.snpeff_cache - vep_cache = INITIALIZE_ANNOTATION_CACHE.out.ensemblvep_cache - } - - // Build indices if needed - PREPARE_GENOME( - ascat_alleles, - ascat_loci, - ascat_loci_gc, - ascat_loci_rt, - chr_dir, - dbsnp, - fasta, - fasta_fai, - germline_resource, - known_indels, - known_snps, - pon) - - // Gather built indices or get them from the params - // Built from the fasta file: - dict = params.dict ? Channel.fromPath(params.dict).map{ it -> [ [id:'dict'], it ] }.collect() - : PREPARE_GENOME.out.dict - fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).collect() - : PREPARE_GENOME.out.fasta_fai - bwa = params.bwa ? Channel.fromPath(params.bwa).collect() - : PREPARE_GENOME.out.bwa - bwamem2 = params.bwamem2 ? Channel.fromPath(params.bwamem2).collect() - : PREPARE_GENOME.out.bwamem2 - dragmap = params.dragmap ? Channel.fromPath(params.dragmap).collect() - : PREPARE_GENOME.out.hashtable - - // Gather index for mapping given the chosen aligner - index_alignement = (params.aligner == "bwa-mem" || params.aligner == "sentieon-bwamem") ? bwa : - params.aligner == "bwa-mem2" ? bwamem2 : - dragmap - - // TODO: add a params for msisensorpro_scan - msisensorpro_scan = PREPARE_GENOME.out.msisensorpro_scan - - // For ASCAT, extracted from zip or tar.gz files: - allele_files = PREPARE_GENOME.out.allele_files - chr_files = PREPARE_GENOME.out.chr_files - gc_file = PREPARE_GENOME.out.gc_file - loci_files = PREPARE_GENOME.out.loci_files - rt_file = PREPARE_GENOME.out.rt_file - - // Tabix indexed vcf files: - dbsnp_tbi = params.dbsnp ? params.dbsnp_tbi ? Channel.fromPath(params.dbsnp_tbi).collect() : PREPARE_GENOME.out.dbsnp_tbi : Channel.value([]) - germline_resource_tbi = params.germline_resource ? params.germline_resource_tbi ? Channel.fromPath(params.germline_resource_tbi).collect() : PREPARE_GENOME.out.germline_resource_tbi : [] //do not change to Channel.value([]), the check for its existence then fails for Getpileupsumamries - known_indels_tbi = params.known_indels ? params.known_indels_tbi ? Channel.fromPath(params.known_indels_tbi).collect() : PREPARE_GENOME.out.known_indels_tbi : Channel.value([]) - known_snps_tbi = params.known_snps ? params.known_snps_tbi ? Channel.fromPath(params.known_snps_tbi).collect() : PREPARE_GENOME.out.known_snps_tbi : Channel.value([]) - pon_tbi = params.pon ? params.pon_tbi ? Channel.fromPath(params.pon_tbi).collect() : PREPARE_GENOME.out.pon_tbi : Channel.value([]) - - // known_sites is made by grouping both the dbsnp and the known snps/indels resources - // Which can either or both be optional - known_sites_indels = dbsnp.concat(known_indels).collect() - known_sites_indels_tbi = dbsnp_tbi.concat(known_indels_tbi).collect() - - known_sites_snps = dbsnp.concat(known_snps).collect() - known_sites_snps_tbi = dbsnp_tbi.concat(known_snps_tbi).collect() - - // Build intervals if needed - PREPARE_INTERVALS(fasta_fai, params.intervals, params.no_intervals) - - // Intervals for speed up preprocessing/variant calling by spread/gather - // [interval.bed] all intervals in one file - intervals_bed_combined = params.no_intervals ? Channel.value([]) : PREPARE_INTERVALS.out.intervals_bed_combined - intervals_bed_gz_tbi_combined = params.no_intervals ? Channel.value([]) : PREPARE_INTERVALS.out.intervals_bed_gz_tbi_combined - - // For QC during preprocessing, we don't need any intervals (MOSDEPTH doesn't take them for WGS) - intervals_for_preprocessing = params.wes ? - intervals_bed_combined.map{it -> [ [ id:it.baseName ], it ]}.collect() : - Channel.value([ [ id:'null' ], [] ]) - - intervals = PREPARE_INTERVALS.out.intervals_bed // [ interval, num_intervals ] multiple interval.bed files, divided by useful intervals for scatter/gather - intervals_bed_gz_tbi = PREPARE_INTERVALS.out.intervals_bed_gz_tbi // [ interval_bed, tbi, num_intervals ] multiple interval.bed.gz/.tbi files, divided by useful intervals for scatter/gather - - intervals_and_num_intervals = intervals.map{ interval, num_intervals -> - if ( num_intervals < 1 ) [ [], num_intervals ] - else [ interval, num_intervals ] - } - - intervals_bed_gz_tbi_and_num_intervals = intervals_bed_gz_tbi.map{ intervals, num_intervals -> - if ( num_intervals < 1 ) [ [], [], num_intervals ] - else [ intervals[0], intervals[1], num_intervals ] - } - - if (params.tools && params.tools.split(',').contains('cnvkit')) { - if (params.cnvkit_reference) { - cnvkit_reference = Channel.fromPath(params.cnvkit_reference).collect() - } else { - PREPARE_REFERENCE_CNVKIT(fasta, intervals_bed_combined) - cnvkit_reference = PREPARE_REFERENCE_CNVKIT.out.cnvkit_reference - - versions = versions.mix(PREPARE_REFERENCE_CNVKIT.out.versions) - } - } else { - cnvkit_reference = Channel.value([]) - } - - // Gather used softwares versions - versions = versions.mix(PREPARE_GENOME.out.versions) - versions = versions.mix(PREPARE_INTERVALS.out.versions) + ch_multiqc_files = Channel.empty() + multiqc_report = Channel.empty() + reports = Channel.empty() + versions = Channel.empty() // PREPROCESSING @@ -469,7 +230,7 @@ workflow SAREK { if (params.split_fastq) { reads_for_alignment = FASTP.out.reads.map{ meta, reads -> read_files = reads.sort(false) { a,b -> a.getName().tokenize('.')[0] <=> b.getName().tokenize('.')[0] }.collate(2) - [ meta + [ size:read_files.size() ], read_files ] + [ meta + [ n_fastq: read_files.size() ], read_files ] }.transpose() } else reads_for_alignment = FASTP.out.reads @@ -480,34 +241,61 @@ workflow SAREK { } // STEP 1: MAPPING READS TO REFERENCE GENOME - // reads will be sorted - reads_for_alignment = reads_for_alignment.map{ meta, reads -> - // Update meta.id to meta.sample no multiple lanes or splitted fastqs - if (meta.size * meta.num_lanes == 1) [ meta + [ id:meta.sample ], reads ] - else [ meta, reads ] - } + // First, we must calculate number of lanes for each sample (meta.n_fastq) + // This is needed to group reads from the same sample together using groupKey to avoid stalling the workflow + // when reads from different samples are mixed together + reads_for_alignment.map { meta, reads -> + [ meta.subMap('patient', 'sample', 'sex', 'status'), reads ] + } + .groupTuple() + .map { meta, reads -> + meta + [ n_fastq: reads.size() ] // We can drop the FASTQ files now that we know how many there are + } + .set { reads_grouping_key } + // reads will be sorted sort_bam = true FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON(reads_for_alignment, index_alignement, sort_bam, fasta, fasta_fai) // Grouping the bams from the same samples not to stall the workflow - bam_mapped = FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON.out.bam.map{ meta, bam -> - - // Update meta.id to be meta.sample, ditching sample-lane that is not needed anymore - // Update meta.data_type - // Remove no longer necessary fields: - // read_group: Now in the BAM header - // num_lanes: only needed for mapping - // size: only needed for mapping - - // Use groupKey to make sure that the correct group can advance as soon as it is complete - // and not stall the workflow until all reads from all channels are mapped - [ groupKey( meta - meta.subMap('num_lanes', 'read_group', 'size') + [ data_type:'bam', id:meta.sample ], (meta.num_lanes ?: 1) * (meta.size ?: 1)), bam ] - }.groupTuple() + // Use groupKey to make sure that the correct group can advance as soon as it is complete + // and not stall the workflow until all reads from all channels are mapped + bam_mapped = FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON.out.bam + .combine(reads_grouping_key) // Creates a tuple of [ meta, bam, reads_grouping_key ] + .filter { meta1, bam, meta2 -> meta1.sample == meta2.sample } + // Add n_fastq and other variables to meta + .map { meta1, bam, meta2 -> + [ meta1 + meta2, bam ] + } + // Manipulate meta map to remove old fields and add new ones + .map { meta, bam -> + [ meta - meta.subMap('id', 'read_group', 'data_type', 'num_lanes', 'read_group', 'size') + [ data_type: 'bam', id: meta.sample ], bam ] + } + // Create groupKey from meta map + .map { meta, bam -> + [ groupKey( meta, meta.n_fastq), bam ] + } + // Group + .groupTuple() + + bai_mapped = FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON.out.bai + .combine(reads_grouping_key) // Creates a tuple of [ meta, bai, reads_grouping_key ] + .filter { meta1, bai, meta2 -> meta1.sample == meta2.sample } + // Add n_fastq and other variables to meta + .map { meta1, bai, meta2 -> + [ meta1 + meta2, bai ] + } + // Manipulate meta map to remove old fields and add new ones + .map { meta, bai -> + [ meta - meta.subMap('id', 'read_group', 'data_type', 'num_lanes', 'read_group', 'size') + [ data_type: 'bai', id: meta.sample ], bai ] + } + // Create groupKey from meta map + .map { meta, bai -> + [ groupKey( meta, meta.n_fastq), bai ] + } + // Group + .groupTuple() - bai_mapped = FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON.out.bai.map{ meta, bai -> - [ groupKey( meta - meta.subMap('num_lanes', 'read_group', 'size') + [ data_type:'bai', id:meta.sample ], (meta.num_lanes ?: 1) * (meta.size ?: 1)), bai ] - }.groupTuple() // gatk4 markduplicates can handle multiple bams as input, so no need to merge/index here // Except if and only if save_mapped or (skipping markduplicates and sentieon-dedup) @@ -523,7 +311,8 @@ workflow SAREK { BAM_TO_CRAM_MAPPING(BAM_MERGE_INDEX_SAMTOOLS.out.bam_bai, fasta, fasta_fai) // Create CSV to restart from this step - params.save_output_as_bam ? CHANNEL_ALIGN_CREATE_CSV(BAM_MERGE_INDEX_SAMTOOLS.out.bam_bai) : CHANNEL_ALIGN_CREATE_CSV(BAM_TO_CRAM_MAPPING.out.alignment_index) + if (params.save_output_as_bam) CHANNEL_ALIGN_CREATE_CSV(BAM_MERGE_INDEX_SAMTOOLS.out.bam_bai, params.outdir, params.save_output_as_bam) + else CHANNEL_ALIGN_CREATE_CSV(BAM_TO_CRAM_MAPPING.out.cram.join(BAM_TO_CRAM_MAPPING.out.crai, failOnDuplicate: true, failOnMismatch: true), params.outdir, params.save_output_as_bam) // Gather used softwares versions versions = versions.mix(BAM_MERGE_INDEX_SAMTOOLS.out.versions) @@ -560,7 +349,7 @@ workflow SAREK { !(params.tools && params.tools.split(',').contains('sentieon_dedup')) ) { if (params.step == 'mapping') { - cram_skip_markduplicates = BAM_TO_CRAM_MAPPING.out.alignment_index + cram_skip_markduplicates = BAM_TO_CRAM_MAPPING.out.cram.join(BAM_TO_CRAM_MAPPING.out.crai, failOnDuplicate: true, failOnMismatch: true) } else { input_markduplicates_convert = input_sample.branch{ bam: it[0].data_type == "bam" @@ -571,27 +360,27 @@ workflow SAREK { BAM_TO_CRAM(input_markduplicates_convert.bam, fasta, fasta_fai) versions = versions.mix(BAM_TO_CRAM.out.versions) - cram_skip_markduplicates = Channel.empty().mix(input_markduplicates_convert.cram, BAM_TO_CRAM.out.alignment_index) + cram_skip_markduplicates = Channel.empty().mix(input_markduplicates_convert.cram, BAM_TO_CRAM.out.cram.join(BAM_TO_CRAM.out.crai, failOnDuplicate: true, failOnMismatch: true)) } CRAM_QC_NO_MD(cram_skip_markduplicates, fasta, intervals_for_preprocessing) // Gather QC reports - reports = reports.mix(CRAM_QC_NO_MD.out.reports.collect{ meta, report -> report }) + reports = reports.mix(CRAM_QC_NO_MD.out.reports.collect{ meta, report -> [ report ] }) // Gather used softwares versions versions = versions.mix(CRAM_QC_NO_MD.out.versions) } else if (params.use_gatk_spark && params.use_gatk_spark.contains('markduplicates')) { BAM_MARKDUPLICATES_SPARK( cram_for_markduplicates, - dict.map{ meta, dict -> [ dict ] }, + dict, fasta, fasta_fai, intervals_for_preprocessing) cram_markduplicates_spark = BAM_MARKDUPLICATES_SPARK.out.cram // Gather QC reports - reports = reports.mix(BAM_MARKDUPLICATES_SPARK.out.reports.collect{ meta, report -> report }) + reports = reports.mix(BAM_MARKDUPLICATES_SPARK.out.reports.collect{ meta, report -> [ report ] }) // Gather used softwares versions versions = versions.mix(BAM_MARKDUPLICATES_SPARK.out.versions) @@ -607,7 +396,7 @@ workflow SAREK { cram_sentieon_dedup = BAM_SENTIEON_DEDUP.out.cram // Gather QC reports - reports = reports.mix(BAM_SENTIEON_DEDUP.out.reports.collect{ meta, report -> report }) + reports = reports.mix(BAM_SENTIEON_DEDUP.out.reports.collect{ meta, report -> [ report ] }) // Gather used softwares versions versions = versions.mix(BAM_SENTIEON_DEDUP.out.versions) @@ -621,7 +410,7 @@ workflow SAREK { cram_markduplicates_no_spark = BAM_MARKDUPLICATES.out.cram // Gather QC reports - reports = reports.mix(BAM_MARKDUPLICATES.out.reports.collect{ meta, report -> report }) + reports = reports.mix(BAM_MARKDUPLICATES.out.reports.collect{ meta, report -> [ report ] }) // Gather used softwares versions versions = versions.mix(BAM_MARKDUPLICATES.out.versions) @@ -644,7 +433,8 @@ workflow SAREK { // Create CSV to restart from this step csv_subfolder = (params.tools && params.tools.split(',').contains('sentieon_dedup')) ? 'sentieon_dedup' : 'markduplicates' - params.save_output_as_bam ? CHANNEL_MARKDUPLICATES_CREATE_CSV(CRAM_TO_BAM.out.alignment_index, csv_subfolder, params.outdir, params.save_output_as_bam) : CHANNEL_MARKDUPLICATES_CREATE_CSV(ch_md_cram_for_restart, csv_subfolder, params.outdir, params.save_output_as_bam) + if (params.save_output_as_bam) CHANNEL_MARKDUPLICATES_CREATE_CSV(CRAM_TO_BAM.out.bam.join(CRAM_TO_BAM.out.bai, failOnDuplicate: true, failOnMismatch: true), csv_subfolder, params.outdir, params.save_output_as_bam) + else CHANNEL_MARKDUPLICATES_CREATE_CSV(ch_md_cram_for_restart, csv_subfolder, params.outdir, params.save_output_as_bam) } if (params.step in ['mapping', 'markduplicates', 'prepare_recalibration']) { @@ -662,7 +452,7 @@ workflow SAREK { BAM_TO_CRAM(input_prepare_recal_convert.bam, fasta, fasta_fai) versions = versions.mix(BAM_TO_CRAM.out.versions) - ch_cram_from_bam = BAM_TO_CRAM.out.alignment_index + ch_cram_from_bam = BAM_TO_CRAM.out.cram.join(BAM_TO_CRAM.out.crai, failOnDuplicate: true, failOnMismatch: true) // Make sure correct data types are carried through .map{ meta, cram, crai -> [ meta + [data_type: "cram"], cram, crai ] } @@ -726,12 +516,12 @@ workflow SAREK { ch_table_bqsr_no_spark, ch_table_bqsr_spark) - reports = reports.mix(ch_table_bqsr.collect{ meta, table -> table }) + reports = reports.mix(ch_table_bqsr.collect{ meta, table -> [ table ] }) cram_applybqsr = ch_cram_for_bam_baserecalibrator.join(ch_table_bqsr, failOnDuplicate: true, failOnMismatch: true) // Create CSV to restart from this step - CHANNEL_BASERECALIBRATOR_CREATE_CSV(ch_md_cram_for_restart.join(ch_table_bqsr, failOnDuplicate: true), params.tools, params.skip_tools, params.save_output_as_bam, params.outdir) + CHANNEL_BASERECALIBRATOR_CREATE_CSV(ch_md_cram_for_restart.join(ch_table_bqsr, failOnDuplicate: true), params.tools, params.skip_tools, params.outdir, params.save_output_as_bam) } } @@ -756,7 +546,9 @@ workflow SAREK { versions = versions.mix(BAM_TO_CRAM.out.versions) cram_applybqsr = Channel.empty().mix( - BAM_TO_CRAM.out.alignment_index.join(input_only_table, failOnDuplicate: true, failOnMismatch: true), + BAM_TO_CRAM.out.cram.join(BAM_TO_CRAM.out.crai, failOnDuplicate: true, failOnMismatch: true) + .join(input_only_table, failOnDuplicate: true, failOnMismatch: true), + input_recal_convert.cram) // Join together converted cram with input tables .map{ meta, cram, crai, table -> [ meta + [data_type: "cram"], cram, crai, table ]} @@ -799,34 +591,23 @@ workflow SAREK { cram_variant_calling_no_spark, cram_variant_calling_spark) - CRAM_QC_RECAL( - cram_variant_calling, - fasta, - intervals_for_preprocessing) - - // Gather QC reports - reports = reports.mix(CRAM_QC_RECAL.out.reports.collect{ meta, report -> report }) - - // Gather used softwares versions - versions = versions.mix(CRAM_QC_RECAL.out.versions) - // If params.save_output_as_bam, then convert CRAM files to BAM CRAM_TO_BAM_RECAL(cram_variant_calling, fasta, fasta_fai) versions = versions.mix(CRAM_TO_BAM_RECAL.out.versions) // CSV should be written for the file actually out out, either CRAM or BAM csv_recalibration = Channel.empty() - csv_recalibration = params.save_output_as_bam ? CRAM_TO_BAM_RECAL.out.alignment_index : cram_variant_calling + csv_recalibration = params.save_output_as_bam ? CRAM_TO_BAM_RECAL.out.bam.join(CRAM_TO_BAM_RECAL.out.bai, failOnDuplicate: true, failOnMismatch: true) : cram_variant_calling // Create CSV to restart from this step - CHANNEL_APPLYBQSR_CREATE_CSV(csv_recalibration) + CHANNEL_APPLYBQSR_CREATE_CSV(csv_recalibration, params.outdir, params.save_output_as_bam) } else if (params.step == 'recalibrate') { // cram_variant_calling contains either: // - input bams converted to crams, if started from step recal + skip BQSR // - input crams if started from step recal + skip BQSR cram_variant_calling = Channel.empty().mix( - BAM_TO_CRAM.out.alignment_index, + BAM_TO_CRAM.out.cram.join(BAM_TO_CRAM.out.crai, failOnDuplicate: true, failOnMismatch: true), input_recal_convert.cram.map{ meta, cram, crai, table -> [ meta, cram, crai ] }) } else { // cram_variant_calling contains either: @@ -846,15 +627,23 @@ workflow SAREK { BAM_TO_CRAM(input_variant_calling_convert.bam, fasta, fasta_fai) versions = versions.mix(BAM_TO_CRAM.out.versions) - cram_variant_calling = Channel.empty().mix(BAM_TO_CRAM.out.alignment_index, input_variant_calling_convert.cram) + cram_variant_calling = Channel.empty().mix( + BAM_TO_CRAM.out.cram.join(BAM_TO_CRAM.out.crai, failOnDuplicate: true, failOnMismatch: true), + input_variant_calling_convert.cram + ) } - if (params.tools) { + if (params.step == 'annotate') cram_variant_calling = Channel.empty() - if (params.step == 'annotate') cram_variant_calling = Channel.empty() + // RUN CRAM QC on the recalibrated CRAM files or when starting from step variant calling. NGSCheckmate should be run also on non-recalibrated CRAM files + CRAM_SAMPLEQC(cram_variant_calling, + ngscheckmate_bed, + fasta, + params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator'), + intervals_for_preprocessing) - CRAM_SAMPLEQC(cram_variant_calling, ngscheckmate_bed, fasta) + if (params.tools) { // // Logic to separate germline samples, tumor samples with no matched normal, and combine tumor-normal pairs @@ -932,7 +721,7 @@ workflow SAREK { intervals_and_num_intervals, intervals_bed_combined, // [] if no_intervals, else interval_bed_combined.bed, intervals_bed_gz_tbi_combined, // [] if no_intervals, else interval_bed_combined_gz, interval_bed_combined_gz_tbi - PREPARE_INTERVALS.out.intervals_bed_combined, // no_intervals.bed if no intervals, else interval_bed_combined.bed; Channel operations possible + intervals_bed_combined_for_variant_calling, // no_intervals.bed if no intervals, else interval_bed_combined.bed; Channel operations possible intervals_bed_gz_tbi_and_num_intervals, known_indels_vqsr, known_sites_indels, @@ -1024,12 +813,12 @@ workflow SAREK { // QC VCF_QC_BCFTOOLS_VCFTOOLS(vcf_to_annotate, intervals_bed_combined) - reports = reports.mix(VCF_QC_BCFTOOLS_VCFTOOLS.out.bcftools_stats.collect{ meta, stats -> stats }) - reports = reports.mix(VCF_QC_BCFTOOLS_VCFTOOLS.out.vcftools_tstv_counts.collect{ meta, counts -> counts }) - reports = reports.mix(VCF_QC_BCFTOOLS_VCFTOOLS.out.vcftools_tstv_qual.collect{ meta, qual -> qual }) - reports = reports.mix(VCF_QC_BCFTOOLS_VCFTOOLS.out.vcftools_filter_summary.collect{ meta, summary -> summary }) + reports = reports.mix(VCF_QC_BCFTOOLS_VCFTOOLS.out.bcftools_stats.collect{ meta, stats -> [ stats ] }) + reports = reports.mix(VCF_QC_BCFTOOLS_VCFTOOLS.out.vcftools_tstv_counts.collect{ meta, counts -> [ counts ] }) + reports = reports.mix(VCF_QC_BCFTOOLS_VCFTOOLS.out.vcftools_tstv_qual.collect{ meta, qual -> [ qual ] }) + reports = reports.mix(VCF_QC_BCFTOOLS_VCFTOOLS.out.vcftools_filter_summary.collect{ meta, summary -> [ summary ] }) - CHANNEL_VARIANT_CALLING_CREATE_CSV(vcf_to_annotate) + CHANNEL_VARIANT_CALLING_CREATE_CSV(vcf_to_annotate, params.outdir) // Gather used variant calling softwares versions versions = versions.mix(BAM_VARIANT_CALLING_GERMLINE_ALL.out.versions) @@ -1043,7 +832,7 @@ workflow SAREK { if (params.tools.split(',').contains('merge') || params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('vep')|| params.tools.split(',').contains('bcfann')) { - vep_fasta = (params.vep_include_fasta) ? fasta.map{ fasta -> [ [ id:fasta.baseName ], fasta ] } : [[id: 'null'], []] + vep_fasta = (params.vep_include_fasta) ? fasta : [[id: 'null'], []] VCF_ANNOTATE_ALL( vcf_to_annotate.map{meta, vcf -> [ meta + [ file_name: vcf.baseName ], vcf ] }, @@ -1057,7 +846,7 @@ workflow SAREK { vep_cache, vep_extra_files, bcftools_annotations, - bcftools_annotations_index, + bcftools_annotations_tbi, bcftools_header_lines) // Gather used softwares versions @@ -1066,47 +855,46 @@ workflow SAREK { } } + // + // Collate and save software versions + // version_yaml = Channel.empty() if (!(params.skip_tools && params.skip_tools.split(',').contains('versions'))) { - CUSTOM_DUMPSOFTWAREVERSIONS(versions.unique().collectFile(name: 'collated_versions.yml')) - version_yaml = CUSTOM_DUMPSOFTWAREVERSIONS.out.mqc_yml.collect() + version_yaml = softwareVersionsToYAML(versions) + .collectFile(storeDir: "${params.outdir}/pipeline_info", name: 'nf_core_sarek_software_mqc_versions.yml', sort: true, newLine: true) } + // + // MODULE: MultiQC + // if (!(params.skip_tools && params.skip_tools.split(',').contains('multiqc'))) { - workflow_summary = WorkflowSarek.paramsSummaryMultiqc(workflow, summary_params) - ch_workflow_summary = Channel.value(workflow_summary) - - methods_description = WorkflowSarek.methodsDescriptionText(workflow, ch_multiqc_custom_methods_description, params) - ch_methods_description = Channel.value(methods_description) - - multiqc_files = Channel.empty() - multiqc_files = multiqc_files.mix(version_yaml) - multiqc_files = multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) - multiqc_files = multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml')) - multiqc_files = multiqc_files.mix(reports.collect().ifEmpty([])) - - MULTIQC(multiqc_files.collect(), ch_multiqc_config.collect().ifEmpty([]), ch_multiqc_custom_config.collect().ifEmpty([]), ch_multiqc_logo.collect().ifEmpty([])) + ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true) + ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config, checkIfExists: true) : Channel.empty() + ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath(params.multiqc_logo, checkIfExists: true) : Channel.empty() + summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") + ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params)) + ch_multiqc_custom_methods_description = params.multiqc_methods_description ? file(params.multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) + ch_methods_description = Channel.value(methodsDescriptionText(ch_multiqc_custom_methods_description)) + ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) + ch_multiqc_files = ch_multiqc_files.mix(version_yaml) + ch_multiqc_files = ch_multiqc_files.mix(reports) + ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml', sort: false)) + + MULTIQC ( + ch_multiqc_files.collect(), + ch_multiqc_config.toList(), + ch_multiqc_custom_config.toList(), + ch_multiqc_logo.toList() + ) multiqc_report = MULTIQC.out.report.toList() - versions = versions.mix(MULTIQC.out.versions) - } -} -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - COMPLETION EMAIL AND SUMMARY -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -workflow.onComplete { - if (params.email || params.email_on_fail) { - NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report) } - NfcoreTemplate.dump_parameters(workflow, params) - NfcoreTemplate.summary(workflow, params, log) - if (params.hook_url) NfcoreTemplate.IM_notification(workflow, params, summary_params, projectDir, log) -} + emit: + multiqc_report // channel: /path/to/multiqc_report.html + versions // channel: [ path(versions.yml) ] +} /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~