diff --git a/.editorconfig b/.editorconfig index b78de6e6..b6b31907 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,7 +8,7 @@ trim_trailing_whitespace = true indent_size = 4 indent_style = space -[*.{md,yml,yaml,html,css,scss,js,cff}] +[*.{md,yml,yaml,html,css,scss,js}] indent_size = 2 # These files are edited and tested upstream in nf-core/modules diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d4b48eae..975df6cd 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -116,4 +116,3 @@ To get started: Devcontainer specs: - [DevContainer config](.devcontainer/devcontainer.json) -- [Dockerfile](.devcontainer/Dockerfile) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 8ed5ffe6..7755ffb4 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -42,9 +42,9 @@ body: attributes: label: System information description: | - * Nextflow version _(eg. 22.10.1)_ + * Nextflow version _(eg. 23.04.0)_ * Hardware _(eg. HPC, Desktop, Cloud)_ * Executor _(eg. slurm, local, awsbatch)_ - * Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter or Charliecloud)_ + * Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter, Charliecloud, or Apptainer)_ * OS _(eg. CentOS Linux, macOS, Linux Mint)_ * Version of nf-core/rnafusion _(eg. 1.1, 1.5, 1.8.2)_ diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6f604f38..5cc076f3 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -15,7 +15,8 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/rnaf - [ ] This comment contains a description of changes (with reason). - [ ] If you've fixed a bug or added code that should be tested, add tests! -- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/rnafusion/tree/master/.github/CONTRIBUTING.md)- [ ] If necessary, also make a PR on the nf-core/rnafusion _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. +- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/rnafusion/tree/master/.github/CONTRIBUTING.md) +- [ ] If necessary, also make a PR on the nf-core/rnafusion _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 `). - [ ] Usage Documentation in `docs/usage.md` is updated. diff --git a/.github/workflows/awsfulltest.yml b/.github/workflows/awsfulltest.yml index caad7c58..31c6cd5f 100644 --- a/.github/workflows/awsfulltest.yml +++ b/.github/workflows/awsfulltest.yml @@ -14,14 +14,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Launch build arriba workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 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/rnafusion/work-${{ github.sha }} parameters: | { + "hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}", "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/rnafusion/results-${{ github.sha }}", "genomes_base": "s3://${{ secrets.AWS_S3_BUCKET }}/rnafusion/results-${{ github.sha }}/references", "cosmic_username": "${{ secrets.cosmic_username }}", @@ -30,9 +32,15 @@ jobs: "build_references": true } profiles: test_full,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch arriba workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -47,9 +55,15 @@ jobs: "arriba": true, } profiles: test_full,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch build squid workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -65,9 +79,15 @@ jobs: "build_references": true } profiles: test_full,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch squid workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -82,9 +102,15 @@ jobs: "squid": true, } profiles: test_full,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch build starfusion workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -100,9 +126,15 @@ jobs: "build_references": true } profiles: test_full,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch starfusion workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -117,9 +149,15 @@ jobs: "starfusion": true, } profiles: test_full,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch build fusioncatcher workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -135,9 +173,15 @@ jobs: "build_references": true } profiles: test_full,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch fusioncatcher workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -152,9 +196,15 @@ jobs: "fusioncatcher": true, } profiles: test_full,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch build pizzly workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -170,9 +220,15 @@ jobs: "build_references": true } profiles: test_full,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch pizzly workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -187,9 +243,15 @@ jobs: "pizzly": true, } profiles: test_full,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch stringtie workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -204,3 +266,9 @@ jobs: "stringtie": true, } profiles: test_full,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json diff --git a/.github/workflows/awstest.yml b/.github/workflows/awstest.yml index 036579de..003f6786 100644 --- a/.github/workflows/awstest.yml +++ b/.github/workflows/awstest.yml @@ -12,11 +12,12 @@ jobs: steps: # Launch workflow using Tower CLI tool action - name: Launch build arriba workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 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/rnafusion/work-${{ github.sha }} parameters: | { @@ -29,9 +30,15 @@ jobs: "build_references": true } profiles: test,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch arriba workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -47,9 +54,15 @@ jobs: "stub": true } profiles: test,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch build squid workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -66,9 +79,15 @@ jobs: "build_references": true } profiles: test,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch squid workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -84,9 +103,15 @@ jobs: "stub": true } profiles: test,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch build starfusion workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -103,9 +128,15 @@ jobs: "stub": true } profiles: test,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch starfusion workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -121,9 +152,15 @@ jobs: "stub": true } profiles: test,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch build fusioncatcher workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -140,9 +177,15 @@ jobs: "stub": true } profiles: test,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch fusioncatcher workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -158,9 +201,15 @@ jobs: "stub": true } profiles: test,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch build pizzly workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -177,9 +226,15 @@ jobs: "stub": true } profiles: test,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch pizzly workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -195,9 +250,15 @@ jobs: "stub": true } profiles: test,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json - name: Launch stringtie workflow via tower - uses: nf-core/tower-action@v3 + uses: seqeralabs/action-tower-launch@v2 with: workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} @@ -213,3 +274,9 @@ jobs: "stub": true } profiles: test,aws_tower + - uses: actions/upload-artifact@v3 + with: + name: Tower debug log file + path: | + tower_action_*.log + tower_action_*.json diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index ccb7211b..3867817a 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -13,7 +13,7 @@ jobs: - name: Check PRs if: github.repository == 'nf-core/rnafusion' run: | - { [[ ${{github.event.pull_request.head.repo.full_name }} == nf-core/rnafusion ]] && [[ $GITHUB_HEAD_REF = "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] + { [[ ${{github.event.pull_request.head.repo.full_name }} == nf-core/rnafusion ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] # If the above check failed, post a comment on the PR explaining the failure # NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30db85cf..e62dcf41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: NXF_VER: - - "22.10.1" + - "23.04.0" - "latest-everything" steps: - name: Check out pipeline code diff --git a/.github/workflows/clean-up.yml b/.github/workflows/clean-up.yml new file mode 100644 index 00000000..694e90ec --- /dev/null +++ b/.github/workflows/clean-up.yml @@ -0,0 +1,24 @@ +name: "Close user-tagged issues and PRs" +on: + schedule: + - cron: "0 0 * * 0" # Once a week + +jobs: + clean-up: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v7 + 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." + close-issue-message: "This issue was closed because it has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor and then staled for 20 days with no activity." + days-before-stale: 30 + days-before-close: 20 + days-before-pr-close: -1 + any-of-labels: "awaiting-changes,awaiting-feedback" + exempt-issue-labels: "WIP" + exempt-pr-labels: "WIP" + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 858d622e..888cb4bc 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -78,7 +78,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.7" + python-version: "3.8" architecture: "x64" - name: Install dependencies diff --git a/.gitpod.yml b/.gitpod.yml index 85d95ecc..25488dcc 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,4 +1,9 @@ image: nfcore/gitpod:latest +tasks: + - name: Update Nextflow and setup pre-commit + command: | + pre-commit install --install-hooks + nextflow self-update vscode: extensions: # based on nf-core.nf-core-extensionpack diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..0c31cdb9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v2.7.1" + hooks: + - id: prettier diff --git a/CHANGELOG.md b/CHANGELOG.md index ff835124..4c9ff036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,39 @@ 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). -## v2.3.0 = [2022/04/24] +## v2.4.0 - [2023/09/22] + +### Added + +### Changed + +- Use institutional configs by default [#381](https://github.com/nf-core/rnafusion/pull/381) +- Remove redundant indexing in starfusion and qc workflows [#387](https://github.com/nf-core/rnafusion/pull/387) +- Output bai files in same directory as bam files [#387](https://github.com/nf-core/rnafusion/pull/387) +- Update and review documentation [#396](https://github.com/nf-core/rnafusion/pull/396) +- Update picard container for `PICARD_COLLECTRNASEQMETRICS` to 3.0.0 [#395](https://github.com/nf-core/rnafusion/pull/395) +- Renamed output files [#395](https://github.com/nf-core/rnafusion/pull/395) + - `Arriba` visualisation pdf from meta.id to meta.id_combined_fusions_arriba_visualisation + - cram file from output bam of `STAR_FOR_ARRIBA`: meta.id to meta.id_star_for_arriba + - cram file from output bam of `STAR_FOR_STARFUSION`: meta.id to meta.id.star_for_starfusion.Aligned.sortedByCoord.out + - `fusion-report` index.html file to meta.id_fusionreport_index.html + - meta.id.vcf output from `MEGAFUSION` to meta.id_fusion_data.vcf + +### Fixed + +- Tail trimming for reverse reads [#379](https://github.com/nf-core/rnafusion/pull/379) +- Set html files as optional in fusionreport [#380](https://github.com/nf-core/rnafusion/pull/380) +- Provide gene count file by default when running STAR_FOR_STARFUSION [#385](https://github.com/nf-core/rnafusion/pull/385) +- Fix fusion-report issue with MACOXS directories [#386](https://github.com/nf-core/rnafusion/pull/386) +- The fusion lists is updated to contain two branches, one in case no fusions are detected and one for if fusions are detected, that will be used to feed to fusioninspector, megafusion, arriba visualisation [#388](https://github.com/nf-core/rnafusion/pull/388) +- Update fusionreport to 2.1.5p4 to fix 403 error in downloading databases [#403](https://github.com/nf-core/rnafusion/pull/403) + +### Removed + +- `samtools sort` and `samtools index` for `arriba` workflow were dispensable and were removed [#395](https://github.com/nf-core/rnafusion/pull/395) +- Removed trimmed fastqc report from multiqc [#394](https://github.com/nf-core/rnafusion/pull/394) + +## v2.3.0 - [2023/04/24] ### Added @@ -26,7 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed -## v2.2.0 - [2022/03/13] +## v2.2.0 - [2023/03/13] ### Added @@ -63,7 +95,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - FUSIONINSPECTOR_DEV process as the option fusioninspector_limitSjdbInsertNsj is part of the main starfusion release -## [2.1.0] nfcore/rnafusion - 2022/07/12 +## v2.1.0 - [2022/07/12] ### Added @@ -97,7 +129,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed -## [2.0.0] nfcore/rnafusion - 2022/05/19 +## v2.0.0 - [2022/05/19] Update to DSL2 and newer software/reference versions @@ -239,7 +271,7 @@ to - GRCh37 support. Subdirectory with params.genome are removed - Running with conda -## v1.3.0dev nfcore/rnafusion - 2020/07/15 +## v1.3.0 - [2020/07/15] - Using official STAR-Fusion container [#160](https://github.com/nf-core/rnafusion/issues/160) @@ -270,7 +302,7 @@ to --- -## [1.1.0] nfcore/rnafusion - 2020/02/10 +## v1.1.0 - [2020/02/10] - Fusion gene detection tools: - `Arriba v1.1.0` @@ -318,7 +350,7 @@ to --- -## [1.0.2] nfcore/rnafusion - 2019/05/13 +## v1.0.2 - [2019/05/13] ### Changed @@ -332,7 +364,7 @@ to --- -## [1.0.1] nfcore/rnafusion - 2019/04/06 +## v1.0.1 - [2019/04/06] ### Added @@ -360,7 +392,7 @@ to --- -## [1.0] nfcore/rnafusion - 2018/02/14 +## v1.0 - [2018/02/14] Version 1.0 marks the first production release of this pipeline under the nf-core flag. The pipeline includes additional help scripts to download references for fusion tools and Singularity images. diff --git a/CITATIONS.md b/CITATIONS.md index 1a3482ac..42e5e50c 100644 --- a/CITATIONS.md +++ b/CITATIONS.md @@ -10,32 +10,57 @@ ## Pipeline tools -- [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/) +- [Arriba](https://github.com/suhrig/arriba) -- [MultiQC](https://pubmed.ncbi.nlm.nih.gov/27312411/) + > Uhrig S, Ellermann J, Walther T, Burkhardt P, Fröhlich M, Hutter B, Toprak UH, Neumann O, Stenzinger A, Scholl C, Fröhling S, Brors B. Accurate and efficient detection of gene fusions from RNA sequencing data. Genome Research. 2021 Mar 31;448-460. doi: 10.1101/gr.257246.119. Epub 2021 Jan 13. PubMed PMID: 33441414. - > Ewels P, Magnusson M, Lundin S, Käller M. MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics. 2016 Oct 1;32(19):3047-8. doi: 10.1093/bioinformatics/btw354. Epub 2016 Jun 16. PubMed PMID: 27312411; PubMed Central PMCID: PMC5039924. +- [BEDOPS](https://bedops.readthedocs.io/en/latest/index.html) - convert2bed -- [Arriba](https://github.com/suhrig/arriba) + > Neph S, Scott Kuehn M, Reynolds AP, Haugen E, Thurman RE, Johnson AK, Rynes E, Maurano MT, Vierstra J, Thomas S, Sandstrom R, Humbert R, Stamatoyannopoulos JA. BEDOPS: high-performance genomic feature operations. Bioinformatics. 2012 May, 28 (14): 1919-1920. doi: 10.1093/bioinformatics/bts277, PubMed PMID: PMID: 22576172. + +- [FastP](https://academic.oup.com/bioinformatics/article/34/17/i884/5093234) - > Uhrig S, Ellermann J, Walther T, Burkhardt P, Fröhlich M, Hutter B, Toprak UH, Neumann O, Stenzinger A, Scholl C, Fröhling S, Brors B. Accurate and efficient detection of gene fusions from RNA sequencing data. - > Genome Research. 2021 Mar 31;448-460. doi: 10.1101/gr.257246.119. Epub 2021 Jan 13. PubMed PMID: 33441414; PubMed Central PMCID: PMC7919457. + > Shifu Chen, Yanqing Zhou, Yaru Chen, Jia Gu. fastp: an ultra-fast all-in-one FASTQ preprocessor. Bioinformatics. 2018 Sept 34:17 (i884–i890), doi: 10.1093/bioinformatics/bty560. PubMed PMID: 30423086. PubMed Central PMCID: PMC6129281 + +- [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/) + + > Andrews, S. (2010). FastQC: A Quality Control Tool for High Throughput Sequence Data [Online]. Available online https://www.bioinformatics.babraham.ac.uk/projects/fastqc/. - [FusionCatcher](https://github.com/ndaniel/fusioncatcher) > Nicorici D, Satalan M, Edgren H, Kangaspeska S, Murumagi A, Kallioniemi O, Virtanen S, Kilkku O. FusionCatcher – a tool for finding somatic fusion genes in paired-end RNA-sequencing data. BioRxiv, 2014 Nov. doi: 10.1101/011650. +- [FusionInspector](https://github.com/FusionInspector/FusionInspector) + + > Haas BJ, Dobin A, Ghandi M, Van Arsdale A, Tickle T, Robinson JT, Gillani R, Kasif S, Regev A. Targeted in silico characterization of fusion transcripts in tumor and normal tissues via FusionInspector. Cell Reports Methods. 2023 May 3:5, doi: 10.1016/j.crmeth.2023.100467, PMID: 37323575 + - [Fusion-report](https://github.com/matq007/fusion-report) > Proks M, Genomic Profiling of a Comprehensive Nation-wide Collection of Childhood Solid Tumors, Master Thesis, Supervisors: Grøntved L, Díaz de Ståhl T, Nistér M, Ewels P, Garcia MU, Juhos S, University of Southern Denmark, 2019, unpublished. +- [GATK4](https://gatk.broadinstitute.org/hc/en-us) + + > Van der Auwera GA. Somatic variation discovery with GATK4. Proceedings of the American Association for Cancer Research Annual Meeting 2017. 2017 Apr 1-5. Cancer Res 2017;77(13 Suppl) doi:10.1158/1538-7445.AM2017-3590 + - [Kallisto](https://pachterlab.github.io/kallisto/) > Bray NL, Pimentel H, Melsted P, Pachter L. Near-optimal probabilistic RNA-seq quantification. Nature Biotechnology 2016 Apr. 34, 525–527. doi:10.1038/nbt.3519. PMID: 27043002. +- [MegaFusion](https://github.com/J35P312/MegaFusion) + +- [MultiQC](https://pubmed.ncbi.nlm.nih.gov/27312411/) + + > Ewels P, Magnusson M, Lundin S, Käller M. MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics. 2016 Oct 1;32(19):3047-8. doi: 10.1093/bioinformatics/btw354. Epub 2016 Jun 16. PubMed PMID: 27312411; PubMed Central PMCID: PMC5039924. + +- [picard-tools](http://broadinstitute.github.io/picard) + - [Pizzly](https://github.com/pmelsted/pizzly) Melsted P, Hateley S, Joseph IC, Pimentel H, Bray N, Pachter L. Fusion detection and quantification by pseudoalignment. BioRxiv, 2017 Jul. doi: 10.1101/166322. +- [Qualimap 2](https://pubmed.ncbi.nlm.nih.gov/26428292/) + + > Okonechnikov K, Conesa A, García-Alcalde F. Qualimap 2: advanced multi-sample quality control for high-throughput sequencing data Bioinformatics. 2016 Jan 15;32(2):292-4. doi: 10.1093/bioinformatics/btv566. Epub 2015 Oct 1. PubMed PMID: 26428292; PubMed Central PMCID: PMC4708105. + - [SAMtools](https://pubmed.ncbi.nlm.nih.gov/19505943/) > Li H, Handsaker B, Wysoker A, Fennell T, Ruan J, Homer N, Marth G, Abecasis G, Durbin R; 1000 Genome Project Data Processing Subgroup. The Sequence Alignment/Map format and SAMtools. Bioinformatics. 2009 Aug 15;25(16):2078-9. doi: 10.1093/bioinformatics/btp352. Epub 2009 Jun 8. PubMed PMID: 19505943; PubMed Central PMCID: PMC2723002. @@ -71,5 +96,8 @@ - [Docker](https://dl.acm.org/doi/10.5555/2600239.2600241) + > Merkel, D. (2014). Docker: lightweight linux containers for consistent development and deployment. Linux Journal, 2014(239), 2. doi: 10.5555/2600239.2600241. + - [Singularity](https://pubmed.ncbi.nlm.nih.gov/28494014/) + > Kurtzer GM, Sochat V, Bauer MW. Singularity: Scientific containers for mobility of compute. PLoS One. 2017 May 11;12(5):e0177459. doi: 10.1371/journal.pone.0177459. eCollection 2017. PubMed PMID: 28494014; PubMed Central PMCID: PMC5426675. diff --git a/README.md b/README.md index d5ccda0f..a6f3e750 100644 --- a/README.md +++ b/README.md @@ -2,36 +2,19 @@ [![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/rnafusion/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.2565517-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.2565517) -[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A522.10.1-23aa62.svg)](https://www.nextflow.io/) +[![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/rnafusion) -[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23rnafusion-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/rnafusion)[![Follow on Twitter](http://img.shields.io/badge/twitter-%40nf__core-1DA1F2?labelColor=000000&logo=twitter)](https://twitter.com/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%23rnafusion-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/rnafusion)[![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 -**nf-core/rnafusion** is a bioinformatics best-practice analysis pipeline for RNA sequencing analysis pipeline with curated list of tools for detecting and visualizing fusion genes. +**nf-core/rnafusion** is a bioinformatics best-practice analysis pipeline for RNA sequencing consisting of several tools designed for detecting and visualizing fusion genes. Results from up to 5 fusion callers tools are created, and are also aggregated, most notably in a pdf visualiation document, a vcf data collection file, and html and tsv reports. -The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. Where possible, these processes have been submitted to and installed from [nf-core/modules](https://github.com/nf-core/modules) in order to make them available to all nf-core pipelines, and to everyone within the Nextflow community! - -> **IMPORTANT: conda is not supported currently.** Run with singularity or docker. - -> GRCh38 is the only supported reference - -| Tool | Version | -| --------------------------------------------------------- | :------: | -| [Arriba](https://github.com/suhrig/arriba) | `2.3.0` | -| [FusionCatcher](https://github.com/ndaniel/fusioncatcher) | `1.33` | -| [Pizzly](https://github.com/pmelsted/pizzly) | `0.37.3` | -| [Squid](https://github.com/Kingsford-Group/squid) | `1.5` | -| [STAR-Fusion](https://github.com/STAR-Fusion/STAR-Fusion) | `1.10.1` | -| [StringTie](https://github.com/gpertea/stringtie) | `2.2.1` | - -> Single-end reads are to be use as last-resort. Paired-end reads are recommended. FusionCatcher cannot be used with single-end reads shorter than 130 bp. - -On release, automated continuous integration tests run the pipeline on a full-sized dataset on the AWS cloud infrastructure. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world datasets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources.The results obtained from the full-sized test can be viewed on the [nf-core website](https://nf-co.re/rnafusion/results). +On release, automated continuous integration tests run the pipeline on a full-sized dataset on the AWS cloud infrastructure. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world datasets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources. The results obtained from the full-sized test can be viewed on the [nf-core website](https://nf-co.re/rnafusion/results). In rnafusion the full-sized test includes reference building and fusion detection. The test dataset is taken from [here](https://github.com/nf-core/test-datasets/tree/rnafusion/testdata/human). @@ -39,92 +22,102 @@ In rnafusion the full-sized test includes reference building and fusion detectio ![nf-core/rnafusion metro map](docs/images/nf-core-rnafusion_metro_map.png) -#### Build references +### Build references -`--build_references` triggers a parallel workflow to build all references +`--build_references` triggers a parallel workflow to build references, which is a prerequisite to running the pipeline: 1. Download ensembl fasta and gtf files -2. Create STAR index -3. Download arriba references -4. Download fusioncatcher references -5. Download pizzly references (kallisto index) -6. Download and build STAR-fusion references -7. Download fusion-report DBs +2. Create [STAR](https://github.com/alexdobin/STAR) index +3. Download [Arriba](https://github.com/suhrig/arriba) references +4. Download [FusionCatcher](https://github.com/ndaniel/fusioncatcher) references +5. Download [Pizzly](https://github.com/pmelsted/pizzly) references ([kallisto](https://pachterlab.github.io/kallisto/manual) index) +6. Download and build [STAR-Fusion](https://github.com/STAR-Fusion/STAR-Fusion) references +7. Download [Fusion-report](https://github.com/Clinical-Genomics/fusion-report) DBs #### Main workflow 1. Input samplesheet check -2. Concatenate fastq files per sample -3. Read QC ([`FastQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)) -4. Arriba subworkflow +2. Concatenate fastq files per sample ([cat](http://www.linfo.org/cat.html)) +3. Reads quality control ([FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)) +4. Optional trimming with [fastp](https://github.com/OpenGene/fastp) +5. Arriba subworkflow - [STAR](https://github.com/alexdobin/STAR) alignment - - [Samtool](https://github.com/samtools/samtools) sort - - [Samtool](https://github.com/samtools/samtools) index - [Arriba](https://github.com/suhrig/arriba) fusion detection -5. Pizzly subworkflow +6. Pizzly subworkflow - [Kallisto](https://pachterlab.github.io/kallisto/) quantification - [Pizzly](https://github.com/pmelsted/pizzly) fusion detection -6. Squid subworkflow +7. Squid subworkflow - [STAR](https://github.com/alexdobin/STAR) alignment - [Samtools view](http://www.htslib.org/): convert sam output from STAR to bam - [Samtools sort](http://www.htslib.org/): bam output from STAR - [SQUID](https://github.com/Kingsford-Group/squid) fusion detection - [SQUID](https://github.com/Kingsford-Group/squid) annotate -7. STAR-fusion subworkflow +8. STAR-fusion subworkflow - [STAR](https://github.com/alexdobin/STAR) alignment - [STAR-Fusion](https://github.com/STAR-Fusion/STAR-Fusion) fusion detection -8. Fusioncatcher subworkflow +9. Fusioncatcher subworkflow - [FusionCatcher](https://github.com/ndaniel/fusioncatcher) fusion detection -9. Fusion-report subworkflow - - Merge all fusions detected by the different tools - - [Fusion-report](https://github.com/matq007/fusion-report) -10. FusionInspector subworkflow +10. StringTie subworkflow + - [StringTie](https://ccb.jhu.edu/software/stringtie/) +11. Fusion-report + - Merge all fusions detected by the selected tools with [Fusion-report](https://github.com/Clinical-Genomics/fusion-report) +12. Post-processing and analysis of data - [FusionInspector](https://github.com/FusionInspector/FusionInspector) - [Arriba](https://github.com/suhrig/arriba) visualisation -11. Stringtie subworkflow - - [StringTie](https://ccb.jhu.edu/software/stringtie/index.shtml) -12. Present QC for raw reads ([`MultiQC`](http://multiqc.info/)) -13. QC for mapped reads ([`QualiMap: BAM QC`](https://kokonech.github.io/qualimap/HG00096.chr20_bamqc/qualimapReport.html)) -14. Index mapped reads ([samtools index](http://www.htslib.org/)) -15. Collect metrics ([`picard CollectRnaSeqMetrics`](https://gatk.broadinstitute.org/hc/en-us/articles/360037057492-CollectRnaSeqMetrics-Picard-) and ([`picard MarkDuplicates`](https://gatk.broadinstitute.org/hc/en-us/articles/360037052812-MarkDuplicates-Picard-)) - -## Quick Start - -1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=22.10.1`) - -2. Install any of [`Docker`](https://docs.docker.com/engine/installation/), [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/) (you can follow [this tutorial](https://singularity-tutorial.github.io/01-installation/)), [`Podman`](https://podman.io/), [`Shifter`](https://nersc.gitlab.io/development/shifter/how-to-use/) or [`Charliecloud`](https://hpc.github.io/charliecloud/) for full pipeline reproducibility _(you can use [`Conda`](https://conda.io/miniconda.html) both to install Nextflow itself and also to manage software within pipelines. Please only use it within pipelines as a last resort; see [docs](https://nf-co.re/usage/configuration#basic-configuration-profiles))_. + - QC for mapped reads ([`QualiMap: BAM QC`](https://kokonech.github.io/qualimap/HG00096.chr20_bamqc/qualimapReport.html)) + - Collect metrics ([`picard CollectRnaSeqMetrics`](https://gatk.broadinstitute.org/hc/en-us/articles/360037057492-CollectRnaSeqMetrics-Picard-) and ([`picard MarkDuplicates`](https://gatk.broadinstitute.org/hc/en-us/articles/360037052812-MarkDuplicates-Picard-)) +13. Present QC for raw reads ([`MultiQC`](http://multiqc.info/)) +14. Compress bam files to cram with [samtools view](http://www.htslib.org/) -3. Download the pipeline and test it on a minimal dataset with a single command: +## Usage - ```bash - nextflow run nf-core/rnafusion -profile test,YOURPROFILE --outdir -stub --all --build_references +> **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. - nextflow run nf-core/rnafusion -profile test,YOURPROFILE --outdir -stub --all +As the reference building is computationally heavy (> 24h on HPC), it is recommended to test the pipeline with the `-stub` parameter (creation of empty files): - ``` +First, build the references: - Note that some form of configuration will be needed so that Nextflow knows how to fetch the required software. This is usually done in the form of a config profile (`YOURPROFILE` in the example command above). You can chain multiple config profiles in a comma-separated string. - - > - The pipeline comes with config profiles called `docker`, `singularity`, `podman`, `shifter`, `charliecloud` and `conda` which instruct the pipeline to use the named tool for software management. For example, `-profile test,docker`. - > - Please check [nf-core/configs](https://github.com/nf-core/configs#documentation) to see if a custom config file to run nf-core pipelines already exists for your Institute. If so, you can simply use `-profile ` in your command. This will enable either `docker` or `singularity` and set the appropriate execution settings for your local compute environment. - > - If you are using `singularity`, please use the [`nf-core download`](https://nf-co.re/tools/#downloading-pipelines-for-offline-use) command to download images first, before running the pipeline. Setting the [`NXF_SINGULARITY_CACHEDIR` or `singularity.cacheDir`](https://www.nextflow.io/docs/latest/singularity.html?#singularity-docker-hub) Nextflow options enables you to store and re-use the images from a central location for future pipeline runs. - > - If you are using `conda`, it is highly recommended to use the [`NXF_CONDA_CACHEDIR` or `conda.cacheDir`](https://www.nextflow.io/docs/latest/conda.html) settings to store the environments in a central location for future pipeline runs. - -4. Start running your own analysis! - -```console -nextflow run nf-core/rnafusion --input samplesheet.csv --outdir --genome GRCh38 --all -profile +```bash +nextflow run nf-core/rnafusion \ + -profile \ + -profile test \ + --outdir \ + --build_references \ + -stub ``` +Then perform the analysis: + ```bash -nextflow run nf-core/rnafusion --input samplesheet.csv --outdir --genome GRCh37 -profile +nextflow run nf-core/rnafusion \ + -profile \ + -profile test \ + --outdir \ + -stub ``` -> Note that paths need to be absolute and that runs with conda are not supported. +> **Notes:** +> +> - Conda is not currently supported; run with singularity or docker. +> - Paths need to be absolute. +> - GRCh38 is the only supported reference. +> - Single-end reads are to be used as last-resort. Paired-end reads are recommended. FusionCatcher cannot be used with single-end reads shorter than 130 bp. + +> **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/rnafusion/usage) and the [parameter documentation](https://nf-co.re/rnafusion/parameters). -## Documentation +## Pipeline output -The nf-core/rnafusion pipeline comes with documentation about the pipeline [usage](https://nf-co.re/rnafusion/usage), [parameters](https://nf-co.re/rnafusion/parameters) and [output](https://nf-co.re/rnafusion/output). +To see the results of an example test run with a full size dataset refer to the [results](https://nf-co.re/rnafusion/results) tab on the nf-core website pipeline page. +For more details about the output files and reports, please refer to the +[output documentation](https://nf-co.re/rnafusion/output). ## Credits diff --git a/assets/methods_description_template.yml b/assets/methods_description_template.yml index 8efa2896..80452425 100644 --- a/assets/methods_description_template.yml +++ b/assets/methods_description_template.yml @@ -5,13 +5,17 @@ section_href: "https://github.com/nf-core/rnafusion" plot_type: "html" data: |

Methods

-

Data was processed using nf-core/rnafusion v${workflow.manifest.version} ${doi_text} of the nf-core collection of workflows (Ewels et al., 2020).

+

Data was processed using nf-core/rnafusion v${workflow.manifest.version} ${doi_text} of the nf-core collection of workflows (Ewels et al., 2020), utilising reproducible software environments from the Bioconda (Grüning et al., 2018) and Biocontainers (da Veiga Leprevost et al., 2017) projects.

The pipeline was executed with Nextflow v${workflow.nextflow.version} (Di Tommaso et al., 2017) with the following command:

${workflow.commandLine}
+

${tool_citations}

References

    -
  • Di Tommaso, P., Chatzou, M., Floden, E. W., Barja, P. P., Palumbo, E., & Notredame, C. (2017). Nextflow enables reproducible computational workflows. Nature Biotechnology, 35(4), 316-319. https://doi.org/10.1038/nbt.3820
  • -
  • Ewels, P. A., Peltzer, A., Fillinger, S., Patel, H., Alneberg, J., Wilm, A., Garcia, M. U., Di Tommaso, P., & Nahnsen, S. (2020). The nf-core framework for community-curated bioinformatics pipelines. Nature Biotechnology, 38(3), 276-278. https://doi.org/10.1038/s41587-020-0439-x
  • +
  • Di Tommaso, P., Chatzou, M., Floden, E. W., Barja, P. P., Palumbo, E., & Notredame, C. (2017). Nextflow enables reproducible computational workflows. Nature Biotechnology, 35(4), 316-319. doi: 10.1038/nbt.3820
  • +
  • Ewels, P. A., Peltzer, A., Fillinger, S., Patel, H., Alneberg, J., Wilm, A., Garcia, M. U., Di Tommaso, P., & Nahnsen, S. (2020). The nf-core framework for community-curated bioinformatics pipelines. Nature Biotechnology, 38(3), 276-278. doi: 10.1038/s41587-020-0439-x
  • +
  • Grüning, B., Dale, R., Sjödin, A., Chapman, B. A., Rowe, J., Tomkins-Tinch, C. H., Valieris, R., Köster, J., & Bioconda Team. (2018). Bioconda: sustainable and comprehensive software distribution for the life sciences. Nature Methods, 15(7), 475–476. doi: 10.1038/s41592-018-0046-7
  • +
  • da Veiga Leprevost, F., Grüning, B. A., Alves Aflitos, S., Röst, H. L., Uszkoreit, J., Barsnes, H., Vaudel, M., Moreno, P., Gatto, L., Weber, J., Bai, M., Jimenez, R. C., Sachsenberg, T., Pfeuffer, J., Vera Alvarez, R., Griss, J., Nesvizhskii, A. I., & Perez-Riverol, Y. (2017). BioContainers: an open-source and community-driven framework for software standardization. Bioinformatics (Oxford, England), 33(16), 2580–2582. doi: 10.1093/bioinformatics/btx192
  • + ${tool_bibliography}
Notes:
diff --git a/assets/multiqc_config.yml b/assets/multiqc_config.yml index 5c8a20b2..5e0f10e0 100644 --- a/assets/multiqc_config.yml +++ b/assets/multiqc_config.yml @@ -1,7 +1,7 @@ report_comment: > - This report has been generated by the nf-core/rnafusion + This report has been generated by the nf-core/rnafusion analysis pipeline. For information about how to interpret these results, please see the - documentation. + documentation. report_section_order: "nf-core-rnafusion-methods-description": order: -1000 diff --git a/assets/nf-core-rnafusion_logo_light.png b/assets/nf-core-rnafusion_logo_light.png index 55f38541..5609a199 100644 Binary files a/assets/nf-core-rnafusion_logo_light.png and b/assets/nf-core-rnafusion_logo_light.png differ diff --git a/assets/samplesheet.csv b/assets/samplesheet.csv deleted file mode 100644 index 4f9acc40..00000000 --- a/assets/samplesheet.csv +++ /dev/null @@ -1,2 +0,0 @@ -sample,fastq_1,fastq_2,strandedness -test_rnafusion,https://github.com/nf-core/test-datasets/raw/d6cd12c9a69c148ef986d156d110f741df482b04/testdata/human/reads_1.fq.gz,https://github.com/nf-core/test-datasets/raw/d6cd12c9a69c148ef986d156d110f741df482b04/testdata/human/reads_2.fq.gz,forward diff --git a/assets/samplesheet_valid.csv b/assets/samplesheet_valid.csv deleted file mode 100644 index 4ac8f7b1..00000000 --- a/assets/samplesheet_valid.csv +++ /dev/null @@ -1,2 +0,0 @@ -sample,fastq_1,fastq_2,strandedness -test,https://github.com/nf-core/test-datasets/raw/rnafusion/testdata/human/reads_1.fq.gz,https://github.com/nf-core/test-datasets/raw/rnafusion/testdata/human/reads_2.fq.gz,forward diff --git a/assets/slackreport.json b/assets/slackreport.json index 043d02f2..1b3cba01 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": "sanger-tol/readmapping v${version} - ${runName}", + "author_name": "nf-core/rnafusion v${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/bin/check_samplesheet.py b/bin/check_samplesheet.py index da160e68..57cf8e6b 100755 --- a/bin/check_samplesheet.py +++ b/bin/check_samplesheet.py @@ -166,9 +166,6 @@ def sniff_format(handle): peek = read_head(handle) handle.seek(0) sniffer = csv.Sniffer() - if not sniffer.has_header(peek): - logger.critical("The given sample sheet does not appear to contain a header.") - sys.exit(1) dialect = sniffer.sniff(peek) return dialect diff --git a/bin/get_rrna_transcripts.py b/bin/get_rrna_transcripts.py index 46812caf..670d5f06 100755 --- a/bin/get_rrna_transcripts.py +++ b/bin/get_rrna_transcripts.py @@ -8,7 +8,6 @@ def get_rrna_intervals(file_in, file_out): """ - Get the commented out header Get lines containing ``#`` or ``gene_type rRNA`` or ```` or ``gene_type rRNA_pseudogene`` or ``gene_type MT_rRNA`` Create output file diff --git a/bin/megafusion.py b/bin/megafusion.py index 6f27b296..76872b57 100755 --- a/bin/megafusion.py +++ b/bin/megafusion.py @@ -122,6 +122,8 @@ def column_manipulation(df): df["QUAL"] = "." df["FILTER"] = "PASS" df["REF"] = "N" + df["INFO"] = "" + df["Sample"] = "" for index, row in df.iterrows(): # ALT diff --git a/conf/base.config b/conf/base.config index 09f68194..165a5e88 100644 --- a/conf/base.config +++ b/conf/base.config @@ -15,7 +15,7 @@ process { time = { check_max( 4.h * task.attempt, 'time' ) } shell = ['/bin/bash', '-euo', 'pipefail'] - errorStrategy = { task.exitStatus in [140,143,137,104,134,139] ? 'retry' : 'finish' } + errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' } maxRetries = 1 maxErrors = '-1' diff --git a/conf/modules.config b/conf/modules.config index 7b8f2787..b4dc96d6 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -36,7 +36,8 @@ process { } withName: ARRIBA_VISUALISATION { - ext.when = { !params.fusioninspector_only && (params.starfusion || params.all) } + ext.when = { !params.fusioninspector_only && (params.starfusion || params.all) } + ext.prefix = { "${meta.id}_combined_fusions_arriba_visualisation" } publishDir = [ path: { "${params.outdir}/arriba_visualisation" }, mode: params.publish_dir_mode, @@ -61,7 +62,7 @@ process { } withName: FASTP { - ext.args = params.trim_tail ? "--trim_tail1 ${params.trim_tail}" : '' + ext.args = params.trim_tail ? "--trim_tail1 ${params.trim_tail} --trim_tail2 ${params.trim_tail} " : '' } withName: FASTQC { @@ -142,6 +143,7 @@ process { } withName: MEGAFUSION { ext.when = {!params.fusioninspector_only} + ext.prefix = { "${meta.id}_fusion_data" } } @@ -185,32 +187,15 @@ process { ] } - withName: SAMTOOLS_INDEX_FOR_ARRIBA { - publishDir = [ - path: { "${params.outdir}/samtools_index_for_arriba" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - - withName: SAMTOOLS_INDEX_FOR_QC { - ext.when = { !params.skip_qc && !params.fusioninspector_only && (params.starfusion || params.all)} - publishDir = [ - path: { "${params.outdir}/samtools_index_for_qc" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - withName: SAMTOOLS_INDEX_FOR_STARFUSION { publishDir = [ - path: { "${params.outdir}/samtools_index_for_starfusion" }, + path: { "${params.outdir}/star_for_starfusion" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] } - withName: SAMTOOLS_FAIDX { + withName: SAMTOOLS_FAIDX { publishDir = [ path: { "${params.genomes_base}/ensembl" }, mode: params.publish_dir_mode, @@ -218,15 +203,6 @@ process { ] } - withName: SAMTOOLS_SORT_FOR_ARRIBA { - ext.prefix = { "${meta.id}_sorted" } - publishDir = [ - path: { "${params.outdir}/samtools_sort_for_arriba" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - withName: SAMTOOLS_SORT_FOR_SQUID_CHIMERIC { ext.prefix = { "${meta.id}_chimeric_sorted" } publishDir = [ @@ -238,6 +214,7 @@ process { withName: SAMTOOLS_VIEW_FOR_ARRIBA { ext.args = { "--output-fmt cram" } + ext.prefix = { "${meta.id}_star_for_arriba" } publishDir = [ path: { "${params.outdir}/cram_arriba" }, mode: params.publish_dir_mode, @@ -276,6 +253,7 @@ process { withName: SAMTOOLS_VIEW_FOR_STARFUSION { ext.args = { "--output-fmt cram" } + ext.prefix = { "${meta.id}.star_for_starfusion.Aligned.sortedByCoord.out" } publishDir = [ path: { "${params.outdir}/cram_starfusion" }, mode: params.publish_dir_mode, @@ -352,7 +330,8 @@ process { --alignInsertionFlush Right \ --alignSplicedMateMapLminOverLmate 0 \ --alignSplicedMateMapLmin 30 \ - --chimOutType Junctions' + --chimOutType Junctions \ + --quantMode GeneCounts' } withName: STAR_GENOMEGENERATE { diff --git a/docs/output.md b/docs/output.md index b7afedf1..4144891b 100644 --- a/docs/output.md +++ b/docs/output.md @@ -12,7 +12,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d - [Download and build references](#references) - Build references needed to run the rest of the pipeline - [STAR](#star) - Alignment for arriba, squid and STAR-fusion -- [Cat](#cat) - Concatenated fastq files per sample ID +- [Cat](#cat) - Concatenate fastq files per sample ID - [Arriba](#arriba) - Arriba fusion detection - [Pizzly](#pizzly) - Pizzly fusion detection - [Squid](#squid) - Squid fusion detection @@ -20,21 +20,23 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d - [StringTie](#stringtie) - StringTie assembly - [FusionCatcher](#fusioncatcher) - Fusion catcher fusion detection - [Samtools](#samtools) - SAM/BAM file manipulation -- [Fusion-report](#fusion-report) - Summary of the findings of each tool and comparison to COSMIC, Mitelman and FusionGBD databases -- [FusionInspector](#fusionInspector) - IGV-based visualisation tool for fusions filtered by fusion-report +- [Fusion-report](#fusion-report) - Summary of the findings of each tool and comparison to COSMIC, Mitelman, FusionGBD and FusionGDB2 databases +- [FusionInspector](#fusionInspector) - Supervised analysis of fusion predictions from fusion-report, recover and re-score evidence for such predictions - [Arriba visualisation](#arriba-visualisation) - Arriba visualisation report for FusionInspector fusions -- [Qualimap](#qualimap) - Quality control of alignment -- [Picard](#picard) - Collect metrics +- [Qualimap](#qualimap) - Quality control of alignments +- [Picard](#picard) - Collect QC metrics - [FastQC](#fastqc) - Raw read quality control -- [MultiQC](#multiqc) - Aggregate report describing results and QC from the whole pipeline +- [MultiQC](#multiqc) - Aggregate reports describing QC results from the whole pipeline - [Pipeline information](#pipeline-information) - Report metrics generated during the workflow execution -### Download and build references +## Download and build references
-Output files +Output reference files and folder structure + +### References directory structure -- `genomes_base/` +- `references/` - `arriba` - `blacklist_hg38_GRCh38_v2.1.0.tsv.gz` - `protein_domains_hg38_GRCh38_v2.1.0.gff3` @@ -64,211 +66,253 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d
-### STAR +## Main pipeline workflow + +> If no argument is specified here, the tool was used with default parameters. + +### Directory structure + +```text +{outdir} +├── arriba +├── arriba_visualisation +├── cram_arriba +├── cram_starfusion +├── cram_squid +├── fastp +├── fastqc +├── fusioncatcher +├── fusioninspector +├── fusionreport +├── kallisto_quant +├── megafusion +├── multiqc +├── picard +├── pizzly +├── pipeline_info +├── pizzly +├── qualimap +├── samtools_sort_for_arriba +├── squid +├── star_for_arriba +├── star_for_starfusion +├── star_for_squid +├── starfusion +└── work +.nextflow.log +``` -STAR is used to align to genome reference +If no parameters are specified, the default is applied. -STAR is run 3 times: +### Arriba -For arriba with the parameters: +[Arriba](https://arriba.readthedocs.io/en/latest/) is used for i) detect gene fusions and ii) create a PDF report for the fusions found (visualisation): -```bash ---readFilesCommand zcat \ ---outSAMtype BAM Unsorted \ ---outSAMunmapped Within \ ---outBAMcompression 0 \ ---outFilterMultimapNmax 50 \ ---peOverlapNbasesMin 10 \ ---alignSplicedMateMapLminOverLmate 0.5 \ ---alignSJstitchMismatchNmax 5 -1 5 5 \ ---chimSegmentMin 10 \ ---chimOutType WithinBAM HardClip \ ---chimJunctionOverhangMin 10 \ ---chimScoreDropMax 30 \ ---chimScoreJunctionNonGTAG 0 \ ---chimScoreSeparation 1 \ ---chimSegmentReadGapMax 3 \ ---chimMultimapNmax 50 -``` - -For squid with the parameters: +#### Detection -```bash ---twopassMode Basic \ ---chimOutType SeparateSAMold \ ---chimSegmentMin 20 \ ---chimJunctionOverhangMin 12 \ ---alignSJDBoverhangMin 10 \ ---outReadsUnmapped Fastx \ ---outSAMstrandField intronMotif \ ---outSAMtype BAM SortedByCoordinate \ ---readFilesCommand zcat -``` +
+Output files -For STAR-fusion with the parameters: +- `arriba/` + - `.arriba.fusions.tsv` - contains the identified fusions + - `.arriba.fusions.discarded.tsv` -```bash ---twopassMode Basic \ ---outReadsUnmapped None \ ---readFilesCommand zcat \ ---outSAMstrandField intronMotif \ ---outSAMunmapped Within \ ---chimSegmentMin 12 \ ---chimJunctionOverhangMin 8 \ ---chimOutJunctionFormat 1 \ ---alignSJDBoverhangMin 10 \ ---alignMatesGapMax 100000 \ ---alignIntronMax 100000 \ ---alignSJstitchMismatchNmax 5 -1 5 5 \ ---chimMultimapScoreRange 3 \ ---chimScoreJunctionNonGTAG -4 \ ---chimMultimapNmax 20 \ ---chimNonchimScoreDropMin 10 \ ---peOverlapNbasesMin 12 \ ---peOverlapMMp 0.1 \ ---alignInsertionFlush Right \ ---alignSplicedMateMapLminOverLmate 0 \ ---alignSplicedMateMapLmin 30 \ ---chimOutType Junctions -``` +
-> STAR_FOR_STARFUSION uses `${params.ensembl_ref}/Homo_sapiens.GRCh38.${params.ensembl_version}.chr.gtf` whereas STAR_FOR_ARRIBA and STAR_FOR_SQUID use `${params.ensembl_ref}/Homo_sapiens.GRCh38.${params.ensembl_version}.gtf` +#### Visualisation
Output files -- `star_for_` -_ **Common** -_ `.Log.final.out` -_ `.Log.progress.out` -_ `.SJ.out.tab` -_ **For arriba:** -_ `.Aligned.out.bam` -_ **For squid:** -_ `.Aligned.sortedByCoord.out.bam` -_ `.Chimeric.out.sam` -_ `.unmapped_1.fastq.gz` -_ `.unmapped_2.fastq.gz` -_ **For starfusion:** -_ `.Aligned.sortedByCoord.out.bam` -_ `.Chimeric.out.junction` +- `arriba_visualisation/` + - `_combined_fusions_arriba_visualisation.pdf` +
### Cat -Cat is used to concatenate fastq files belonging to the same sample. -
Output files -- `cat` - - `_1.merged.fastq.gz` - - `_2.merged.fastq.gz` +- `cat/` + - `_1.merged.fastq.gz` + - `_2.merged.fastq.gz`
-### Arriba +If multiple libraries or runs have been provided for the same sample in the input samplesheet (e.g. to increase sequencing depth) then these will be merged at the very beginning of the pipeline in order to have consistent sample naming throughout the pipeline. Please refer to the [usage](https://nf-co.re/rnafusion/usage#samplesheet-input) documentation to see how to specify these samples in the input samplesheet. -Arriba is used for i) detect fusion and ii) output a PDF report for the fusions found (visualisation): +### Fastp -#### Detection +If `--trim_fastp` is selected, [fastp](https://github.com/OpenGene/fastp) will filter low quality reads as well as bases at the 5' and 3' ends, trim adapters (automatically detected, but input with parameter `--adapter_fasta` is possible). 3' trimming is also possible via parameter `--trim_tail`.
Output files -- `arriba` - - `.arriba.fusions.tsv` - contains the identified fusions - - `.arriba.fusions.discarded.tsv` +- `fastp/` + - `_1.fastp.fastq.gz` + - `_2.fastp.fastq.gz` + - `.fastp.html` + - `.fastp.json` + - `.fastp.log`
-#### Visualisation +### FastQC
Output files -- `arriba_visualisation` - - `.pdf` +- `fastqc/` + - `*_fastqc.html`: FastQC report containing quality metrics. + - `*_fastqc.zip`: Zip archive containing the FastQC report, tab-delimited data file and plot images.
-### Pizzly +[FastQC](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/) gives general quality metrics about your sequenced reads. It provides information about the quality score distribution across your reads, per base sequence content (%A/T/G/C), adapter contamination and overrepresented sequences. For further reading and documentation see the [FastQC help pages](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/). + +![MultiQC - FastQC sequence counts plot](images/mqc_fastqc_counts.png) + +![MultiQC - FastQC mean quality scores plot](images/mqc_fastqc_quality.png) -The first step of the pizzly workflow is to run `kallisto quant`: +![MultiQC - FastQC adapter content plot](images/mqc_fastqc_adapter.png) -#### Kallisto +> **NB:** The FastQC plots displayed in the MultiQC report shows _untrimmed_ reads. They may contain adapter sequence and potentially regions with low quality. + +### FusionCatcher
Output files -- `kallisto` - - `.kallisto_quant.fusions.txt` +- `fusioncatcher` + - `.fusioncatcher.fusion-genes.txt` + - `.fusioncatcher.summary.txt` + - `.fusioncatcher.log`
-Pizzly refines kallisto output. +[FusionCatcher](https://github.com/ndaniel/fusioncatcher) searches for novel/known somatic fusion genes translocations, and chimeras in RNA-seq data. Possibility to use parameter `--fusioncatcher_limitSjdbInsertNsj` to modify limitSjdbInsertNsj. -#### Pizzly +### FusionInspector -Pizzly uses the following arguments: +
+Output files -```bash --k 31 \ ---align-score 2 \ ---insert-size 400 \ ---cache index.cache.txt -``` +- `fusioninspector` + - `.fusion_inspector_web.html` - visualisation report described in details [here](https://github.com/FusionInspector/FusionInspector/wiki/FusionInspector-Visualizations) + - `FusionInspector.log` + - `.FusionInspector.fusions.abridged.tsv` + +
+ +[FusionInspector](https://github.com/FusionInspector/FusionInspector/tree/master) performs a validation of fusion transcript predictions. Possibility to use `--fusioninspector_limitSjdbInsertNsj` to set limitSjdbInsertNsj to anything other than the default 1000000. + +### Fusion-report
Output files -- `pizzly` - - `.pizzly.txt` - contains the identified fusions - - `.pizzly.unfiltered.json` +- `fusionreport` + - + - `.fusionreport.tsv` + - `.fusionreport_filtered.tsv` + - `_fusionreport_index.html` - general report for all filtered fusions + - `.fusions.csv` - index in csv format + - `_.html` - specific report for each filtered fusion
-### Squid +[Fusion-report](https://github.com/matq007/fusion-report) is a tool for parsing outputs from fusion detection tools. +The score is explained [on the original fusion-report github page](https://matq007.github.io/fusion-report/#/score). -Squid is run in two steps: i) fusion detection and ii) fusion annotation but the output is in a common `squid` directory. +`--fusionreport_filter` can be used to filter the output of fusion-report to fusions identified by at least 2 different tools. + +### Kallisto
Output files -- `squid` - - `.squid.fusions_sv.txt` - contains the identified fusions - - `.squid.fusions.annotated.txt`- contains the identified fusions annotatedvi +- `kallisto` + - `.kallisto_quant.fusions.txt`
-### STAR-fusion +Quantifying abundances of transcripts from bulk and single-cell RNA-Seq data, or more generally of target sequences using high-throughput sequencing reads. + +### Megafusion
Output files -- `starfusion` - - `.starfusion.fusion_predictions.tsv` - contains the identified fusions - - `.starfusion.abridged.tsv` - - `- contains the identified fusions.starfusion.abridged.coding_effect.tsv` +- `megafusion` + - `_fusion_data.vcf` - contains the fusions in vcf format with collected statistics.
-### StringTie +[Megafusion](https://github.com/J35P312/MegaFusion) converts RNA fusion files to SV VCF and collects statistics and metrics in a VCF file. + +### MultiQC
Output files -- `stringtie//stringtie.merged.gtf` - merged gtf from annotation and stringtie output gtfs +- `multiqc/` + - `multiqc_report.html`: a standalone HTML file that can be viewed in your web browser. + - `multiqc_data/`: directory containing parsed statistics from the different tools used in the pipeline. + - `multiqc_plots/`: directory containing static images from the report in various formats. +
-### FusionCatcher +[MultiQC](http://multiqc.info) is a visualization tool that generates a single HTML report summarising all samples in your project. Most of the pipeline QC results are visualised in the report and further statistics are available in the report data directory. + +Results generated by MultiQC collate pipeline QC from supported tools e.g. FastQC. The pipeline has special steps which also allow the software versions to be reported in the MultiQC output for future traceability. For more information about how to use MultiQC reports, see . + +### Picard
Output files -- `fusioncatcher` -_ `.fusioncatcher.fusion-genes.txt` -_ `.fusioncatcher.summary.txt` \* `.fusioncatcher.log` +Picard CollectRnaMetrics and picard MarkDuplicates share the same output directory. + +- `picard` + - `.MarkDuplicates.metrics.txt` - metrics from MarkDuplicates + - `_rna_metrics.txt` - metrics from CollectRnaMetrics + - `.bam` - BAM file with marked duplicates + +
+ +#### Pizzly + +Pizzly uses the following arguments: + +```bash +-k 31 \ +--align-score 2 \ +--insert-size 400 \ +--cache index.cache.txt +``` + +
+Output files + +- `pizzly` + - `.pizzly.txt` - contains the identified fusions + - `.pizzly.unfiltered.json` + +
+ +### Qualimap + +
+Output files + +- `qualimap` + - `qualimapReport.html` - HTML report + - `rnaseq_qc_results.txt` - TXT results + - `css` - dir for html style + - `images_qualimapReport`- dir for html images + - `raw_data_qualimapReport` - dir for html raw data +
### Samtools @@ -281,7 +325,7 @@ Samtools view is used to convert the chimeric SAM output from STAR_FOR_SQUID to Output files - `samtools_view_for_squid` - - `_chimeric.bam` - sorted BAM file + - `_chimeric.bam` - sorted BAM file @@ -293,7 +337,7 @@ Samtools sort is used to sort BAM files from STAR_FOR_STARFUSION (for arriba vis Output files - `samtools_sort_for_` - - `(_chimeric)_sorted.bam` - sorted BAM file + - `(_chimeric)_sorted.bam` - sorted BAM file @@ -305,102 +349,144 @@ Samtools index is used to index BAM files from STAR_FOR_ARRIBA (for arriba visua Output files - `samtools_for_` - - `.(Aligned.sortedByCoord).out.bam.bai` - + - `.(Aligned.sortedByCoord).out.bam.bai` - -### Fusion-report +### Squid + +Squid is run in two steps: i) fusion detection and ii) fusion annotation, but the output is in a shared `squid` directory
Output files -- `fusionreport` - - - - `.fusionreport.tsv` - - `.fusionreport_filtered.tsv` - - `index.html` - general report for all filtered fusions - - `.html` - specific report for each filtered fusion +- `squid` + - `.squid.fusions_sv.txt` - contains the identified fusions + - `.squid.fusions.annotated.txt`- contains the identified fusions annotated
-The score is explained [on the original fusion-report github page](https://matq007.github.io/fusion-report/#/score). - -### FusionInspector +### STAR -
-Output files +STAR is used to align to genome reference -- `fusioninspector` - - `.fusion_inspector_web.html` - visualisation report described in details [here](https://github.com/FusionInspector/FusionInspector/wiki/FusionInspector-Visualizations) - - `FusionInspector.log` - - `.FusionInspector.fusions.abridged.tsv` +STAR is run for 3 tools: -
+For `arriba` with the parameters: -### Qualimap +```bash +--readFilesCommand zcat \ +--outSAMtype BAM Unsorted \ +--outSAMunmapped Within \ +--outBAMcompression 0 \ +--outFilterMultimapNmax 50 \ +--peOverlapNbasesMin 10 \ +--alignSplicedMateMapLminOverLmate 0.5 \ +--alignSJstitchMismatchNmax 5 -1 5 5 \ +--chimSegmentMin 10 \ +--chimOutType WithinBAM HardClip \ +--chimJunctionOverhangMin 10 \ +--chimScoreDropMax 30 \ +--chimScoreJunctionNonGTAG 0 \ +--chimScoreSeparation 1 \ +--chimSegmentReadGapMax 3 \ +--chimMultimapNmax 50 +``` -
-Output files +For `squid` with the parameters: -- `qualimap` - - `qualimapReport.html` - HTML report - - `rnaseq_qc_results.txt` - TXT results - - `css` - dir for html style - - `images_qualimapReport`- dir for html images - - `raw_data_qualimapReport` - dir for html raw data +```bash +--twopassMode Basic \ +--chimOutType SeparateSAMold \ +--chimSegmentMin 20 \ +--chimJunctionOverhangMin 12 \ +--alignSJDBoverhangMin 10 \ +--outReadsUnmapped Fastx \ +--outSAMstrandField intronMotif \ +--outSAMtype BAM SortedByCoordinate \ +--readFilesCommand zcat +``` -
+For `STAR-fusion` with the parameters: -### Picard +```bash +--twopassMode Basic \ +--outReadsUnmapped None \ +--readFilesCommand zcat \ +--outSAMstrandField intronMotif \ +--outSAMunmapped Within \ +--chimSegmentMin 12 \ +--chimJunctionOverhangMin 8 \ +--chimOutJunctionFormat 1 \ +--alignSJDBoverhangMin 10 \ +--alignMatesGapMax 100000 \ +--alignIntronMax 100000 \ +--alignSJstitchMismatchNmax 5 -1 5 5 \ +--chimMultimapScoreRange 3 \ +--chimScoreJunctionNonGTAG -4 \ +--chimMultimapNmax 20 \ +--chimNonchimScoreDropMin 10 \ +--peOverlapNbasesMin 12 \ +--peOverlapMMp 0.1 \ +--alignInsertionFlush Right \ +--alignSplicedMateMapLminOverLmate 0 \ +--alignSplicedMateMapLmin 30 \ +--chimOutType Junctions \ +--quantMode GeneCounts +``` -Picard CollectRnaMetrics and picard MarkDuplicates share the same outpur directory. +> STAR_FOR_STARFUSION uses `${params.ensembl}/Homo_sapiens.GRCh38.${params.ensembl_version}.chr.gtf` whereas STAR_FOR_ARRIBA and STAR_FOR_SQUID use `${params.ensembl_ref}/Homo_sapiens.GRCh38.${params.ensembl_version}.gtf`
Output files -- `picard` - - `.MarkDuplicates.metrics.txt` - metrics from CollectRnaMetrics - - `_rna_metrics.txt` - metrics from MarkDuplicates - - `.bam` - BAM file with marked duplicates +**Common** -
+- `star_for_` +- `.Log.final.out` +- `.Log.progress.out` +- `.SJ.out.tab` -### FastQC +**For arriba:** -
-Output files +- `.Aligned.out.bam` -- `fastqc/` - - `*_fastqc.html`: FastQC report containing quality metrics. - - `*_fastqc.zip`: Zip archive containing the FastQC report, tab-delimited data file and plot images. - -
+**For squid:** -[FastQC](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/) gives general quality metrics about your sequenced reads. It provides information about the quality score distribution across your reads, per base sequence content (%A/T/G/C), adapter contamination and overrepresented sequences. For further reading and documentation see the [FastQC help pages](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/). +- `.Aligned.sortedByCoord.out.bam` +- `.Chimeric.out.sam` +- `.unmapped_1.fastq.gz` +- `.unmapped_2.fastq.gz` -![MultiQC - FastQC sequence counts plot](images/mqc_fastqc_counts.png) + **For starfusion:** -![MultiQC - FastQC mean quality scores plot](images/mqc_fastqc_quality.png) +- `.Aligned.sortedByCoord.out.bam` +- `.Chimeric.out.junction` +- `.ReadsPerGene.out.tab` -![MultiQC - FastQC adapter content plot](images/mqc_fastqc_adapter.png) + -> **NB:** The FastQC plots displayed in the MultiQC report shows _untrimmed_ reads. They may contain adapter sequence and potentially regions with low quality. +The STAR index is generated with `--sjdbOverhang ${params.read_length - 1}`, params.read_length default is 100. -### MultiQC +### STAR-fusion
Output files -- `multiqc/` - - `multiqc_report.html`: a standalone HTML file that can be viewed in your web browser. - - `multiqc_data/`: directory containing parsed statistics from the different tools used in the pipeline. - - `multiqc_plots/`: directory containing static images from the report in various formats. +- `starfusion` + - `.starfusion.fusion_predictions.tsv` - contains the identified fusions + - `.starfusion.abridged.tsv` - contains the identified fusions abridged + - `starfusion.abridged.coding_effect.tsv`
-[MultiQC](http://multiqc.info) is a visualization tool that generates a single HTML report summarising all samples in your project. Most of the pipeline QC results are visualised in the report and further statistics are available in the report data directory. +### StringTie -Results generated by MultiQC collate pipeline QC from supported tools e.g. FastQC. The pipeline has special steps which also allow the software versions to be reported in the MultiQC output for future traceability. For more information about how to use MultiQC reports, see . +
+Output files + +- `stringtie//stringtie.merged.gtf` - merged gtf from annotation and stringtie output gtfs +
### Pipeline information diff --git a/docs/usage.md b/docs/usage.md index 5eb23ccd..9df6d24e 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -4,31 +4,27 @@ > _Documentation of pipeline parameters is generated automatically from the pipeline schema and can no longer be found in markdown files._ -## Introduction +## Pipeline summary The pipeline is divided into two parts: 1. Download and build references - specified with `--build_references` parameter - required only once before running the pipeline - - **Important**: rerun with each new release + - **Important**: has to be run with each new release 2. Detecting fusions - - Supported tools: `Arriba`, `FusionCatcher`, `pizzly`, `SQUID`, `STAR-Fusion` and `StringTie` - - QC: `Fastqc` and `MultiQC` - - Fusion visualization: `Arriba` (only fusion detected with Arriba), `fusion-report` and `FusionInspector` + - Supported tools: `Arriba`, `FusionCatcher`, `pizzly`, `SQUID`, `STAR-Fusion`, and `StringTie` + - QC: `Fastqc`, `MultiQC`, and `Qualimap rnaseq` + - Fusions visualization: `Arriba`, `fusion-report` and `FusionInspector`, VCF file creation based on `MegaFusion` -### 1. Download and build references +## Download and build references The rnafusion pipeline needs references for the fusion detection tools, so downloading these is a **requirement**. -Whilst it is possible to download and build each reference manually, it is advised to download references with the rnafusion pipeline. -First register for a free account at COSMIC at [https://cancer.sanger.ac.uk/cosmic/register](https://cancer.sanger.ac.uk/cosmic/register) using your university email. The account is **only activated upon** clicking the link in the registration email. - -Download the references as shown below including your COSMIC credentials. - -> Note that this step takes about 24 hours to complete on HPC. - -> Do not provide a samplesheet via the `input` parameter, otherwise the pipeline will run the analysis directly after downloading the references (except if that is what you want). +> **IMPORTANT** +> +> - Note that this step takes about 24 hours to complete on HPC. +> - Do not provide a samplesheet via the `input` parameter, otherwise the pipeline will run the analysis directly after downloading the references (except if that is what you want). ```bash nextflow run nf-core/rnafusion \ @@ -48,7 +44,15 @@ nextflow run nf-core/rnafusion \ --outdir ``` -#### Using QIAGEN download insead of SANGER (non-academic usage) for the COSMIC database +### Downloading the cosmic database with SANGER or QUIAGEN + +#### For academic users + +First register for a free account at COSMIC at [https://cancer.sanger.ac.uk/cosmic/register](https://cancer.sanger.ac.uk/cosmic/register) using a university email. The account is **only activated upon** clicking the link in the registration email. + +#### For non-academic users + +Use credentials from QIAGEN and add `--qiagen` ```bash nextflow run nf-core/rnafusion \ @@ -58,23 +62,13 @@ nextflow run nf-core/rnafusion \ --outdir --qiagen ``` -#### References directory tree +#### STAR-Fusion references downloaded vs built -```text -references/ -|-- arriba -|-- ensembl -|-- fusion_report_db -|-- fusioncatcher -| `-- human_v102 -|-- pizzly -|-- star -`-- starfusion -``` +By default STAR-Fusion references are **built**. You can also download them from [CTAT](https://github.com/NCIP/Trinity_CTAT/wiki) by using the flag `--starfusion_build FALSE` for both reference building and fusion detection. This allows more flexibility for different organisms but **be aware that STAR-Fusion reference download is not recommended as not fully tested!** #### Issues with building references -If process `FUSIONREPORT_DOWNLOAD` times out, it could be due to network restriction (e.g. if trying to run on HPC). As this process is lightweight in compute, storage and time, running on local machines with the following options might solve the issue: +If process `FUSIONREPORT_DOWNLOAD` times out, it could be due to network restriction (for example if trying to run on HPC). As this process is lightweight in cpu, memory and time, running on local machines with the following options might solve the issue: ```bash nextflow run nf-core/rnafusion \ @@ -85,7 +79,7 @@ nextflow run nf-core/rnafusion \ --outdir ``` -Adjustments for compute requirements can be done by feeding a custom configuration with `-c /PATH/TO/CUSTOM/CONFIG`. +Adjustments for cpu and memory requirements can be done by feeding a custom configuration with `-c /PATH/TO/CUSTOM/CONFIG`. Where the custom configuration could look like (adaptation to local machine necessary): ```text @@ -100,17 +94,36 @@ process { The four `fusion-report` files: `cosmic.db`, `fusiongdb.db`, `fusiongdb2.db`, `mitelman.db` should then be copied into the HPC `/references/fusion_report_db`. -#### Non-human references +## Running the pipeline -Non-human references, not supported by default, can be built manually and fed to rnafusion using the parameter `--_ref`. +### Samplesheet input -#### STAR-Fusion references downloaded vs built +You will need to create a samplesheet with information about the samples you would like to analyse before running the pipeline. The pipeline will detect whether a sample is single- or paired-end from the samplesheet - the `fastq_2` column is empty for single-end. The samplesheet has to be a comma-separated file (.csv) but can have as many columns as you desire. There is a strict requirement for the first 4 columns to match those defined in the table below with the header row included. +A final samplesheet file consisting of both single- and paired-end data may look something like the one below. This is for 6 samples, where `TREATMENT_REP3` has been sequenced twice. -By default STAR-Fusion references are **built**. You can also download them from [CTAT](https://github.com/NCIP/Trinity_CTAT/wiki) by using the flag `--starfusion_build FALSE` for both reference building and fusion detection. This allows more flexibility for different organisms but **be aware that STAR-Fusion reference download is not recommended as not fully tested!** +```console +sample,fastq_1,fastq_2,strandedness +CONTROL_REP1,AEG588A1_S1_L002_R1_001.fastq.gz,AEG588A1_S1_L002_R2_001.fastq.gz,forward +CONTROL_REP2,AEG588A2_S2_L002_R1_001.fastq.gz,AEG588A2_S2_L002_R2_001.fastq.gz,forward +CONTROL_REP3,AEG588A3_S3_L002_R1_001.fastq.gz,AEG588A3_S3_L002_R2_001.fastq.gz,forward +TREATMENT_REP1,AEG588A4_S4_L003_R1_001.fastq.gz,,forward +TREATMENT_REP2,AEG588A5_S5_L003_R1_001.fastq.gz,,forward +TREATMENT_REP3,AEG588A6_S6_L003_R1_001.fastq.gz,,forward +TREATMENT_REP3,AEG588A6_S6_L004_R1_001.fastq.gz,,forward +``` -### 2. Detecting fusions +As you can see above for multiple runs of the same sample, the `sample` name has to be the same when you have re-sequenced the same sample more than once e.g. to increase sequencing depth. The pipeline will concatenate the raw reads before performing any downstream analysis. -This step can either be run using all fusion detection tools or specifying individual tools. Visualisation tools will be run on all fusions detected. To run all tools (`arriba`, `fusioncatcher`, `pizzly`, `squid`, `starfusion`, `stringtie`) use the `--all` parameter: +| Column | Description | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sample` | Custom sample name. This entry will be identical for multiple sequencing libraries/runs from the same sample. Spaces in sample names are automatically converted to underscores (`_`). | +| `fastq_1` | Full path to FastQ file for Illumina short reads 1. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". | +| `fastq_2` | Full path to FastQ file for Illumina short reads 2. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". | +| `strandedness` | Strandedness: forward or reverse. | + +### Starting commands + +The pipeline can either be run using all fusion detection tools or specifying individual tools. Visualisation tools will be run on all fusions detected. To run all tools (`arriba`, `fusioncatcher`, `pizzly`, `squid`, `starfusion`, `stringtie`) use the `--all` parameter: ```bash nextflow run nf-core/rnafusion \ @@ -120,11 +133,7 @@ nextflow run nf-core/rnafusion \ --outdir ``` -> **IMPORTANT: Either `--all` or `--`** is necessary to run detection tools - -`--genomes_base` should be the path to the directory containing the folder `references/` that was built in step 1 `build_references`. - -Alternatively, to run only a specific detection tool use: `--tool`: +To run only a specific detection tool use: `--tool`: ```bash nextflow run nf-core/rnafusion \ @@ -134,11 +143,48 @@ nextflow run nf-core/rnafusion \ --outdir ``` +> **IMPORTANT: Either `--all` or `--`** is necessary to run detection tools + +`--genomes_base` should be the path to the directory containing the folder `references/` that was built with `--build_references`. + +Note that the pipeline will create the following files in your working directory: + +```bash +work # Directory containing the nextflow working files + # Finished results in specified location (defined with --outdir) +.nextflow_log # Log file from Nextflow +# Other nextflow hidden files, eg. history of pipeline runs and old logs. +``` + +If you wish to repeatedly use the same parameters for multiple runs, rather than specifying each flag in the command, you can specify these in a params file. + +Pipeline settings can be provided in a `yaml` or `json` file via `-params-file `. + +> ⚠️ Do not use `-c ` to specify parameters as this will result in errors. Custom config files specified with `-c` must only be used for [tuning process resource specifications](https://nf-co.re/docs/usage/configuration#tuning-workflow-resources), other infrastructural tweaks (such as output directories), or module arguments (args). + +The above pipeline run specified with a params file in yaml format: + +```bash +nextflow run nf-core/rnafusion -profile docker -params-file params.yaml +``` + +with `params.yaml` containing: + +```yaml +input: './samplesheet.csv' +outdir: './results/' +<...> +``` + +You can also generate such `YAML`/`JSON` files via [nf-core/launch](https://nf-co.re/launch). + +### Options + #### Trimming There are 2 options to trim -1. fastp +1. Fastp In this case all tools use the trimmed reads. Quality and adapter trimming by default. In addition, tail trimming and adapter_fastq specification are possible. Example usage: ```bash @@ -152,7 +198,7 @@ nextflow run nf-core/rnafusion \ --adapter_fastq (optional) ``` -2. hard trimming +2. Hard trimming In this case, only reads fed to fusioncatcher are trimmed. This is a harsh workaround in case of high read-through. The recommended trimming is thus the fastp_trim one. The trimming is done at 75 bp from the tails. Example usage: ```bash @@ -199,7 +245,7 @@ GENE3--GENE4 #### Running FusionInspector only -FusionInspector can be run standalone with: +FusionInspector can be run as a standalone with: ```bash nextflow run nf-core/rnafusion \ @@ -227,7 +273,7 @@ nextflow run nf-core/rnafusion \ --outdir ``` -This will skip all QC-related processes. +This will skip all QC-related processes (metrics collection, `Qualimap`) #### Skipping visualisation @@ -246,59 +292,6 @@ This will skip all visualisation processes, including `fusion-report`, `FusionIn It is possible to give the output of each tool manually using the argument: `--_fusions PATH/TO/FUSION/FILE`: this feature need more testing, don't hesitate to open an issue if you encounter problems. -## Samplesheet input - -You will need to create a samplesheet with information about the samples you would like to analyse before running the pipeline. Use the `--input` parameter to specify its location. The pipeline will detect whether a sample is single- or paired-end from the samplesheet - the `fastq_2` column is empty for single-end. The samplesheet has to be a comma-separated file (.csv) but can have as many columns as you desire. There is a strict requirement for the first 4 columns to match those defined in the table below with the header row included. -A final samplesheet file consisting of both single- and paired-end data may look something like the one below. This is for 6 samples, where `TREATMENT_REP3` has been sequenced twice. - -```console -sample,fastq_1,fastq_2,strandedness -CONTROL_REP1,AEG588A1_S1_L002_R1_001.fastq.gz,AEG588A1_S1_L002_R2_001.fastq.gz,forward -CONTROL_REP2,AEG588A2_S2_L002_R1_001.fastq.gz,AEG588A2_S2_L002_R2_001.fastq.gz,forward -CONTROL_REP3,AEG588A3_S3_L002_R1_001.fastq.gz,AEG588A3_S3_L002_R2_001.fastq.gz,forward -TREATMENT_REP1,AEG588A4_S4_L003_R1_001.fastq.gz,,forward -TREATMENT_REP2,AEG588A5_S5_L003_R1_001.fastq.gz,,forward -TREATMENT_REP3,AEG588A6_S6_L003_R1_001.fastq.gz,,forward -TREATMENT_REP3,AEG588A6_S6_L004_R1_001.fastq.gz,,forward -``` - -| Column | Description | -| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `sample` | Custom sample name. This entry will be identical for multiple sequencing libraries/runs from the same sample. Spaces in sample names are automatically converted to underscores (`_`). | -| `fastq_1` | Full path to FastQ file for Illumina short reads 1. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". | -| `fastq_2` | Full path to FastQ file for Illumina short reads 2. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". | -| `strandedness` | Strandedness: forward or reverse. | - -An [example samplesheet](../assets/samplesheet.csv) has been provided with the pipeline. - -As you can see above for multiple runs of the same sample, the `sample` name has to be the same when you have re-sequenced the same sample more than once e.g. to increase sequencing depth. The pipeline will concatenate the raw reads before performing any downstream analysis. Below is an example for the same sample sequenced across 3 lanes: - -```bash -sample,fastq_1,fastq_2,strandedness -CONTROL_REP1,AEG588A1_S1_L002_R1_001.fastq.gz,AEG588A1_S1_L002_R2_001.fastq.gz,forward -CONTROL_REP1,AEG588A1_S1_L003_R1_001.fastq.gz,AEG588A1_S1_L003_R2_001.fastq.gz,forward -CONTROL_REP1,AEG588A1_S1_L004_R1_001.fastq.gz,AEG588A1_S1_L004_R2_001.fastq.gz,forward -``` - -## Running the pipeline - -The typical command for running the pipeline is as follows. - -```bash -nextflow run nf-core/rnafusion --input samplesheet.csv --outdir --genome GRCh38 -profile docker -``` - -This will launch the pipeline with the `docker` configuration profile. See below for more information about profiles. - -Note that the pipeline will create the following files in your working directory: - -```bash -work # Directory containing the nextflow working files - # Finished results in specified location (defined with --outdir) -.nextflow_log # Log file from Nextflow -# Other nextflow hidden files, eg. history of pipeline runs and old logs. -``` - #### Set different `--limitSjdbInsertNsj` parameter There are two parameters to increase the `--limitSjdbInsertNsj` parameter if necessary: @@ -306,6 +299,11 @@ There are two parameters to increase the `--limitSjdbInsertNsj` parameter if nec - `--fusioncatcher_limitSjdbInsertNsj`, default: 2000000 - `--fusioninspector_limitSjdbInsertNsj`, default: 1000000 +Use the parameter `--cram` to compress the BAM files to CRAM for specific tools. Options: arriba, squid, starfusion. Leave no space between options: + +- `--cram arriba,squid,starfusion`, default: [] +- `--cram arriba` + ### Updating the pipeline When you run the above command, Nextflow automatically pulls the pipeline code from GitHub and stores it as a cached version. When running the pipeline after this, it will always use the cached version if available - even if the pipeline has been updated since. To make sure that you're running the latest version of the pipeline, make sure that you regularly update the cached version of the pipeline: @@ -314,13 +312,6 @@ When you run the above command, Nextflow automatically pulls the pipeline code f nextflow pull nf-core/rnafusion ``` -#### Compress to CRAM file - -Use the parameter `--cram` to compress the BAM files to CRAM for specific tools. Options: arriba, squid, starfusion. Leave no space between options: - -- `--cram arriba,squid,starfusion`, default: [] -- `--cram arriba` - ### Reproducibility It is a good idea to specify a pipeline version when running the pipeline on your data. This ensures that a specific version of the pipeline code and software are used when you run your pipeline. If you keep using the same tag, you'll be running the same version of the pipeline, even if there have been changes to the code since. @@ -329,6 +320,10 @@ First, go to the [nf-core/rnafusion releases page](https://github.com/nf-core/rn This version number will be logged in reports when you run the pipeline, so that you'll know what you used when you look back in the future. For example, at the bottom of the MultiQC reports. +To further assist in reproducbility, you can use share and re-use [parameter files](#running-the-pipeline) to repeat pipeline runs with the same settings without having to write out a command with every single parameter. + +> 💡 If you wish to share such profile (such as upload as supplementary material for academic publications), make sure to NOT include cluster specific paths to files, nor institutional specific profiles. + ## Core Nextflow arguments > **NB:** These options are part of Nextflow and use a _single_ hyphen (pipeline parameters use a double-hyphen). @@ -337,7 +332,7 @@ This version number will be logged in reports when you run the pipeline, so that Use this parameter to choose a configuration profile. Profiles can give configuration presets for different compute environments. -Several generic profiles are bundled with the pipeline which instruct the pipeline to use software packaged using different methods (Docker, Singularity, Podman, Shifter, Charliecloud, Conda) - see below. +Several generic profiles are bundled with the pipeline which instruct the pipeline to use software packaged using different methods (Docker, Singularity, Podman, Shifter, Charliecloud, Apptainer, Conda) - see below. > We highly recommend the use of Docker or Singularity containers for full pipeline reproducibility, however when this is not possible, Conda is also supported. @@ -361,8 +356,10 @@ If `-profile` is not specified, the pipeline will run locally and expect all sof - A generic configuration profile to be used with [Shifter](https://nersc.gitlab.io/development/shifter/how-to-use/) - `charliecloud` - A generic configuration profile to be used with [Charliecloud](https://hpc.github.io/charliecloud/) +- `apptainer` + - A generic configuration profile to be used with [Apptainer](https://apptainer.org/) - `conda` - - A generic configuration profile to be used with [Conda](https://conda.io/docs/). Please only use Conda as a last resort i.e. when it's not possible to run the pipeline with Docker, Singularity, Podman, Shifter or Charliecloud. + - A generic configuration profile to be used with [Conda](https://conda.io/docs/). Please only use Conda as a last resort i.e. when it's not possible to run the pipeline with Docker, Singularity, Podman, Shifter, Charliecloud, or Apptainer. - `test` - A profile with a complete configuration for automated testing - Includes links to test data so needs no other parameters @@ -385,138 +382,19 @@ Specify the path to a specific config file (this is a core Nextflow command). Se Whilst the default requirements set within the pipeline will hopefully work for most people and with most input data, you may find that you want to customise the compute resources that the pipeline requests. Each step in the pipeline has a default set of requirements for number of CPUs, memory and time. For most of the steps in the pipeline, if the job exits with any of the error codes specified [here](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/conf/base.config#L18) it will automatically be resubmitted with higher requests (2 x original, then 3 x original). If it still fails after the third attempt then the pipeline execution is stopped. -For example, if the nf-core/rnaseq pipeline is failing after multiple re-submissions of the `STAR_ALIGN` process due to an exit code of `137` this would indicate that there is an out of memory issue: - -```console -[62/149eb0] NOTE: Process `NFCORE_RNASEQ:RNASEQ:ALIGN_STAR:STAR_ALIGN (WT_REP1)` terminated with an error exit status (137) -- Execution is retried (1) -Error executing process > 'NFCORE_RNASEQ:RNASEQ:ALIGN_STAR:STAR_ALIGN (WT_REP1)' - -Caused by: - Process `NFCORE_RNASEQ:RNASEQ:ALIGN_STAR:STAR_ALIGN (WT_REP1)` terminated with an error exit status (137) - -Command executed: - STAR \ - --genomeDir star \ - --readFilesIn WT_REP1_trimmed.fq.gz \ - --runThreadN 2 \ - --outFileNamePrefix WT_REP1. \ - - -Command exit status: - 137 - -Command output: - (empty) - -Command error: - .command.sh: line 9: 30 Killed STAR --genomeDir star --readFilesIn WT_REP1_trimmed.fq.gz --runThreadN 2 --outFileNamePrefix WT_REP1. -Work dir: - /home/pipelinetest/work/9d/172ca5881234073e8d76f2a19c88fb - -Tip: you can replicate the issue by changing to the process work dir and entering the command `bash .command.run` -``` - -#### For beginners - -A first step to bypass this error, you could try to increase the amount of CPUs, memory, and time for the whole pipeline. Therefor you can try to increase the resource for the parameters `--max_cpus`, `--max_memory`, and `--max_time`. Based on the error above, you have to increase the amount of memory. Therefore you can go to the [parameter documentation of rnaseq](https://nf-co.re/rnaseq/3.9/parameters) and scroll down to the `show hidden parameter` button to get the default value for `--max_memory`. In this case 128GB, you than can try to run your pipeline again with `--max_memory 200GB -resume` to skip all process, that were already calculated. If you can not increase the resource of the complete pipeline, you can try to adapt the resource for a single process as mentioned below. - -#### Advanced option on process level - -To bypass this error you would need to find exactly which resources are set by the `STAR_ALIGN` process. The quickest way is to search for `process STAR_ALIGN` in the [nf-core/rnaseq Github repo](https://github.com/nf-core/rnaseq/search?q=process+STAR_ALIGN). -We have standardised the structure of Nextflow DSL2 pipelines such that all module files will be present in the `modules/` directory and so, based on the search results, the file we want is `modules/nf-core/star/align/main.nf`. -If you click on the link to that file you will notice that there is a `label` directive at the top of the module that is set to [`label process_high`](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/modules/nf-core/software/star/align/main.nf#L9). -The [Nextflow `label`](https://www.nextflow.io/docs/latest/process.html#label) directive allows us to organise workflow processes in separate groups which can be referenced in a configuration file to select and configure subset of processes having similar computing requirements. -The default values for the `process_high` label are set in the pipeline's [`base.config`](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/conf/base.config#L33-L37) which in this case is defined as 72GB. -Providing you haven't set any other standard nf-core parameters to **cap** the [maximum resources](https://nf-co.re/usage/configuration#max-resources) used by the pipeline then we can try and bypass the `STAR_ALIGN` process failure by creating a custom config file that sets at least 72GB of memory, in this case increased to 100GB. -The custom config below can then be provided to the pipeline via the [`-c`](#-c) parameter as highlighted in previous sections. - -```nextflow -process { - withName: 'NFCORE_RNASEQ:RNASEQ:ALIGN_STAR:STAR_ALIGN' { - memory = 100.GB - } -} -``` - -> **NB:** We specify the full process name i.e. `NFCORE_RNASEQ:RNASEQ:ALIGN_STAR:STAR_ALIGN` in the config file because this takes priority over the short name (`STAR_ALIGN`) and allows existing configuration using the full process name to be correctly overridden. - -If you get a warning suggesting that the process selector isn't recognised check that the process name has been specified correctly. - -### Tool-specific options - -For the ultimate flexibility, we have implemented and are using Nextflow DSL2 modules in a way where it is possible for both developers and users to change tool-specific command-line arguments (e.g. providing an additional command-line argument to the `STAR_ALIGN` process) as well as publishing options (e.g. saving files produced by the `STAR_ALIGN` process that aren't saved by default by the pipeline). In the majority of instances, as a user you won't have to change the default options set by the pipeline developer(s), however, there may be edge cases where creating a simple custom config file can improve the behaviour of the pipeline if for example it is failing due to a weird error that requires setting a tool-specific parameter to deal with smaller / larger genomes. - -The command-line arguments passed to STAR in the `STAR_ALIGN` module are a combination of: - -- Mandatory arguments or those that need to be evaluated within the scope of the module, as supplied in the [`script`](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/modules/nf-core/software/star/align/main.nf#L49-L55) section of the module file. - -- An [`options.args`](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/modules/nf-core/software/star/align/main.nf#L56) string of non-mandatory parameters that is set to be empty by default in the module but can be overwritten when including the module in the sub-workflow / workflow context via the `addParams` Nextflow option. - -The nf-core/rnaseq pipeline has a sub-workflow (see [terminology](https://github.com/nf-core/modules#terminology)) specifically to align reads with STAR and to sort, index and generate some basic stats on the resulting BAM files using SAMtools. At the top of this file we import the `STAR_ALIGN` module via the Nextflow [`include`](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/subworkflows/nf-core/align_star.nf#L10) keyword and by default the options passed to the module via the `addParams` option are set as an empty Groovy map [here](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/subworkflows/nf-core/align_star.nf#L5); this in turn means `options.args` will be set to empty by default in the module file too. This is an intentional design choice and allows us to implement well-written sub-workflows composed of a chain of tools that by default run with the bare minimum parameter set for any given tool in order to make it much easier to share across pipelines and to provide the flexibility for users and developers to customise any non-mandatory arguments. - -When including the sub-workflow above in the main pipeline workflow we use the same `include` statement, however, we now have the ability to overwrite options for each of the tools in the sub-workflow including the [`align_options`](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/workflows/rnaseq.nf#L225) variable that will be used specifically to overwrite the optional arguments passed to the `STAR_ALIGN` module. In this case, the options to be provided to `STAR_ALIGN` have been assigned sensible defaults by the developer(s) in the pipeline's [`modules.config`](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/conf/modules.config#L70-L74) and can be accessed and customised in the [workflow context](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/workflows/rnaseq.nf#L201-L204) too before eventually passing them to the sub-workflow as a Groovy map called `star_align_options`. These options will then be propagated from `workflow -> sub-workflow -> module`. - -As mentioned at the beginning of this section it may also be necessary for users to overwrite the options passed to modules to be able to customise specific aspects of the way in which a particular tool is executed by the pipeline. Given that all of the default module options are stored in the pipeline's `modules.config` as a [`params` variable](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/conf/modules.config#L24-L25) it is also possible to overwrite any of these options via a custom config file. - -Say for example we want to append an additional, non-mandatory parameter (i.e. `--outFilterMismatchNmax 16`) to the arguments passed to the `STAR_ALIGN` module. Firstly, we need to copy across the default `args` specified in the [`modules.config`](https://github.com/nf-core/rnaseq/blob/4c27ef5610c87db00c3c5a3eed10b1d161abf575/conf/modules.config#L71) and create a custom config file that is a composite of the default `args` as well as the additional options you would like to provide. This is very important because Nextflow will overwrite the default value of `args` that you provide via the custom config. - -As you will see in the example below, we have: - -- appended `--outFilterMismatchNmax 16` to the default `args` used by the module. -- changed the default `publishDir` value to where the files will eventually be published in the main results directory. -- appended `'bam':''` to the default value of `publish_files` so that the BAM files generated by the process will also be saved in the top-level results directory for the module. Note: `'out':'log'` means any file/directory ending in `out` will now be saved in a separate directory called `my_star_directory/log/`. - -```nextflow -params { - modules { - 'star_align' { - args = "--quantMode omeSAM --twopassMode Basic --outSAMtype BAM Unsorted --readFilesCommand zcat --runRNGseed 0 --outFilterMultimapNmax 20 --alignSJDBoverhangMin 1 --outSAMattributes NH HI AS NM MD --quantomeBan Singleend --outFilterMismatchNmax 16" - publishDir = "my_star_directory" - publish_files = ['out':'log', 'tab':'log', 'bam':''] - } - } -} -``` - -### Updating containers (advanced users) - -The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. If for some reason you need to use a different version of a particular tool with the pipeline then you just need to identify the `process` name and override the Nextflow `container` definition for that process using the `withName` declaration. For example, in the [nf-core/viralrecon](https://nf-co.re/viralrecon) pipeline a tool called [Pangolin](https://github.com/cov-lineages/pangolin) has been used during the COVID-19 pandemic to assign lineages to SARS-CoV-2 genome sequenced samples. Given that the lineage assignments change quite frequently it doesn't make sense to re-release the nf-core/viralrecon everytime a new version of Pangolin has been released. However, you can override the default container used by the pipeline by creating a custom config file and passing it as a command-line argument via `-c custom.config`. - -1. Check the default version used by the pipeline in the module file for [Pangolin](https://github.com/nf-core/viralrecon/blob/a85d5969f9025409e3618d6c280ef15ce417df65/modules/nf-core/software/pangolin/main.nf#L14-L19) -2. Find the latest version of the Biocontainer available on [Quay.io](https://quay.io/repository/biocontainers/pangolin?tag=latest&tab=tags) -3. Create the custom config accordingly: - - - For Docker: +To change the resource requests, please see the [max resources](https://nf-co.re/docs/usage/configuration#max-resources) and [tuning workflow resources](https://nf-co.re/docs/usage/configuration#tuning-workflow-resources) section of the nf-core website. - ```nextflow - process { - withName: PANGOLIN { - container = 'quay.io/biocontainers/pangolin:3.0.5--pyhdfd78af_0' - } - } - ``` +### Custom Containers - - For Singularity: +In some cases you may wish to change which container or conda environment a step of the pipeline uses for a particular tool. By default nf-core pipelines use containers and software from the [biocontainers](https://biocontainers.pro/) or [bioconda](https://bioconda.github.io/) projects. However in some cases the pipeline specified version maybe out of date. - ```nextflow - process { - withName: PANGOLIN { - container = 'https://depot.galaxyproject.org/singularity/pangolin:3.0.5--pyhdfd78af_0' - } - } - ``` +To use a different container from the default container or conda environment specified in a pipeline, please see the [updating tool versions](https://nf-co.re/docs/usage/configuration#updating-tool-versions) section of the nf-core website. - - For Conda: +### Custom Tool Arguments - ```nextflow - process { - withName: PANGOLIN { - conda = 'bioconda::pangolin=3.0.5' - } - } - ``` +A pipeline might not always support every possible argument or option of a particular tool used in pipeline. Fortunately, nf-core pipelines provide some freedom to users to insert additional parameters that the pipeline does not include by default. -> **NB:** If you wish to periodically update individual tool-specific results (e.g. Pangolin) generated by the pipeline then you must ensure to keep the `work/` directory otherwise the `-resume` ability of the pipeline will be compromised and it will restart from scratch. +To learn how to provide additional arguments to a particular tool of the pipeline, please see the [customising tool arguments](https://nf-co.re/docs/usage/configuration#customising-tool-arguments) section of the nf-core website. ### nf-core/configs diff --git a/lib/NfcoreSchema.groovy b/lib/NfcoreSchema.groovy deleted file mode 100755 index 33cd4f6e..00000000 --- a/lib/NfcoreSchema.groovy +++ /dev/null @@ -1,528 +0,0 @@ -// -// This file holds several functions used to perform JSON parameter validation, help and summary rendering for the nf-core pipeline template. -// - -import org.everit.json.schema.Schema -import org.everit.json.schema.loader.SchemaLoader -import org.everit.json.schema.ValidationException -import org.json.JSONObject -import org.json.JSONTokener -import org.json.JSONArray -import groovy.json.JsonSlurper -import groovy.json.JsonBuilder - -class NfcoreSchema { - - // - // Resolve Schema path relative to main workflow directory - // - public static String getSchemaPath(workflow, schema_filename='nextflow_schema.json') { - return "${workflow.projectDir}/${schema_filename}" - } - - // - // Function to loop over all parameters defined in schema and check - // whether the given parameters adhere to the specifications - // - /* groovylint-disable-next-line UnusedPrivateMethodParameter */ - public static void validateParameters(workflow, params, log, schema_filename='nextflow_schema.json') { - def has_error = false - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// - // Check for nextflow core params and unexpected params - def json = new File(getSchemaPath(workflow, schema_filename=schema_filename)).text - def Map schemaParams = (Map) new JsonSlurper().parseText(json).get('definitions') - def nf_params = [ - // Options for base `nextflow` command - 'bg', - 'c', - 'C', - 'config', - 'd', - 'D', - 'dockerize', - 'h', - 'log', - 'q', - 'quiet', - 'syslog', - 'v', - - // Options for `nextflow run` command - 'ansi', - 'ansi-log', - 'bg', - 'bucket-dir', - 'c', - 'cache', - 'config', - 'dsl2', - 'dump-channels', - 'dump-hashes', - 'E', - 'entry', - 'latest', - 'lib', - 'main-script', - 'N', - 'name', - 'offline', - 'params-file', - 'pi', - 'plugins', - 'poll-interval', - 'pool-size', - 'profile', - 'ps', - 'qs', - 'queue-size', - 'r', - 'resume', - 'revision', - 'stdin', - 'stub', - 'stub-run', - 'test', - 'w', - 'with-charliecloud', - 'with-conda', - 'with-dag', - 'with-docker', - 'with-mpi', - 'with-notification', - 'with-podman', - 'with-report', - 'with-singularity', - 'with-timeline', - 'with-tower', - 'with-trace', - 'with-weblog', - 'without-docker', - 'without-podman', - 'work-dir' - ] - def unexpectedParams = [] - - // Collect expected parameters from the schema - def expectedParams = [] - def enums = [:] - for (group in schemaParams) { - for (p in group.value['properties']) { - expectedParams.push(p.key) - if (group.value['properties'][p.key].containsKey('enum')) { - enums[p.key] = group.value['properties'][p.key]['enum'] - } - } - } - - for (specifiedParam in params.keySet()) { - // nextflow params - if (nf_params.contains(specifiedParam)) { - log.error "ERROR: You used a core Nextflow option with two hyphens: '--${specifiedParam}'. Please resubmit with '-${specifiedParam}'" - has_error = true - } - // unexpected params - def params_ignore = params.schema_ignore_params.split(',') + 'schema_ignore_params' - def expectedParamsLowerCase = expectedParams.collect{ it.replace("-", "").toLowerCase() } - def specifiedParamLowerCase = specifiedParam.replace("-", "").toLowerCase() - def isCamelCaseBug = (specifiedParam.contains("-") && !expectedParams.contains(specifiedParam) && expectedParamsLowerCase.contains(specifiedParamLowerCase)) - if (!expectedParams.contains(specifiedParam) && !params_ignore.contains(specifiedParam) && !isCamelCaseBug) { - // Temporarily remove camelCase/camel-case params #1035 - def unexpectedParamsLowerCase = unexpectedParams.collect{ it.replace("-", "").toLowerCase()} - if (!unexpectedParamsLowerCase.contains(specifiedParamLowerCase)){ - unexpectedParams.push(specifiedParam) - } - } - } - - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// - // Validate parameters against the schema - InputStream input_stream = new File(getSchemaPath(workflow, schema_filename=schema_filename)).newInputStream() - JSONObject raw_schema = new JSONObject(new JSONTokener(input_stream)) - - // Remove anything that's in params.schema_ignore_params - raw_schema = removeIgnoredParams(raw_schema, params) - - Schema schema = SchemaLoader.load(raw_schema) - - // Clean the parameters - def cleanedParams = cleanParameters(params) - - // Convert to JSONObject - def jsonParams = new JsonBuilder(cleanedParams) - JSONObject params_json = new JSONObject(jsonParams.toString()) - - // Validate - try { - schema.validate(params_json) - } catch (ValidationException e) { - println '' - log.error 'ERROR: Validation of pipeline parameters failed!' - JSONObject exceptionJSON = e.toJSON() - printExceptions(exceptionJSON, params_json, log, enums) - println '' - has_error = true - } - - // Check for unexpected parameters - if (unexpectedParams.size() > 0) { - Map colors = NfcoreTemplate.logColours(params.monochrome_logs) - println '' - def warn_msg = 'Found unexpected parameters:' - for (unexpectedParam in unexpectedParams) { - warn_msg = warn_msg + "\n* --${unexpectedParam}: ${params[unexpectedParam].toString()}" - } - log.warn warn_msg - log.info "- ${colors.dim}Ignore this warning: params.schema_ignore_params = \"${unexpectedParams.join(',')}\" ${colors.reset}" - println '' - } - - if (has_error) { - System.exit(1) - } - } - - // - // Beautify parameters for --help - // - public static String paramsHelp(workflow, params, command, schema_filename='nextflow_schema.json') { - Map colors = NfcoreTemplate.logColours(params.monochrome_logs) - Integer num_hidden = 0 - String output = '' - output += 'Typical pipeline command:\n\n' - output += " ${colors.cyan}${command}${colors.reset}\n\n" - Map params_map = paramsLoad(getSchemaPath(workflow, schema_filename=schema_filename)) - Integer max_chars = paramsMaxChars(params_map) + 1 - Integer desc_indent = max_chars + 14 - Integer dec_linewidth = 160 - desc_indent - for (group in params_map.keySet()) { - Integer num_params = 0 - String group_output = colors.underlined + colors.bold + group + colors.reset + '\n' - def group_params = params_map.get(group) // This gets the parameters of that particular group - for (param in group_params.keySet()) { - if (group_params.get(param).hidden && !params.show_hidden_params) { - num_hidden += 1 - continue; - } - def type = '[' + group_params.get(param).type + ']' - def description = group_params.get(param).description - def defaultValue = group_params.get(param).default != null ? " [default: " + group_params.get(param).default.toString() + "]" : '' - def description_default = description + colors.dim + defaultValue + colors.reset - // Wrap long description texts - // Loosely based on https://dzone.com/articles/groovy-plain-text-word-wrap - if (description_default.length() > dec_linewidth){ - List olines = [] - String oline = "" // " " * indent - description_default.split(" ").each() { wrd -> - if ((oline.size() + wrd.size()) <= dec_linewidth) { - oline += wrd + " " - } else { - olines += oline - oline = wrd + " " - } - } - olines += oline - description_default = olines.join("\n" + " " * desc_indent) - } - group_output += " --" + param.padRight(max_chars) + colors.dim + type.padRight(10) + colors.reset + description_default + '\n' - num_params += 1 - } - group_output += '\n' - if (num_params > 0){ - output += group_output - } - } - if (num_hidden > 0){ - output += colors.dim + "!! Hiding $num_hidden params, use --show_hidden_params to show them !!\n" + colors.reset - } - output += NfcoreTemplate.dashedLine(params.monochrome_logs) - return output - } - - // - // Groovy Map summarising parameters/workflow options used by the pipeline - // - public static LinkedHashMap paramsSummaryMap(workflow, params, schema_filename='nextflow_schema.json') { - // Get a selection of core Nextflow workflow options - def Map workflow_summary = [:] - if (workflow.revision) { - workflow_summary['revision'] = workflow.revision - } - workflow_summary['runName'] = workflow.runName - if (workflow.containerEngine) { - workflow_summary['containerEngine'] = workflow.containerEngine - } - if (workflow.container) { - workflow_summary['container'] = workflow.container - } - workflow_summary['launchDir'] = workflow.launchDir - workflow_summary['workDir'] = workflow.workDir - workflow_summary['projectDir'] = workflow.projectDir - workflow_summary['userName'] = workflow.userName - workflow_summary['profile'] = workflow.profile - workflow_summary['configFiles'] = workflow.configFiles.join(', ') - - // Get pipeline parameters defined in JSON Schema - def Map params_summary = [:] - def params_map = paramsLoad(getSchemaPath(workflow, schema_filename=schema_filename)) - for (group in params_map.keySet()) { - def sub_params = new LinkedHashMap() - def group_params = params_map.get(group) // This gets the parameters of that particular group - for (param in group_params.keySet()) { - if (params.containsKey(param)) { - def params_value = params.get(param) - def schema_value = group_params.get(param).default - def param_type = group_params.get(param).type - if (schema_value != null) { - if (param_type == 'string') { - if (schema_value.contains('$projectDir') || schema_value.contains('${projectDir}')) { - def sub_string = schema_value.replace('\$projectDir', '') - sub_string = sub_string.replace('\${projectDir}', '') - if (params_value.contains(sub_string)) { - schema_value = params_value - } - } - if (schema_value.contains('$params.outdir') || schema_value.contains('${params.outdir}')) { - def sub_string = schema_value.replace('\$params.outdir', '') - sub_string = sub_string.replace('\${params.outdir}', '') - if ("${params.outdir}${sub_string}" == params_value) { - schema_value = params_value - } - } - } - } - - // We have a default in the schema, and this isn't it - if (schema_value != null && params_value != schema_value) { - sub_params.put(param, params_value) - } - // No default in the schema, and this isn't empty - else if (schema_value == null && params_value != "" && params_value != null && params_value != false) { - sub_params.put(param, params_value) - } - } - } - params_summary.put(group, sub_params) - } - return [ 'Core Nextflow options' : workflow_summary ] << params_summary - } - - // - // Beautify parameters for summary and return as string - // - public static String paramsSummaryLog(workflow, params) { - Map colors = NfcoreTemplate.logColours(params.monochrome_logs) - String output = '' - def params_map = paramsSummaryMap(workflow, params) - def max_chars = paramsMaxChars(params_map) - for (group in params_map.keySet()) { - def group_params = params_map.get(group) // This gets the parameters of that particular group - if (group_params) { - output += colors.bold + group + colors.reset + '\n' - for (param in group_params.keySet()) { - output += " " + colors.blue + param.padRight(max_chars) + ": " + colors.green + group_params.get(param) + colors.reset + '\n' - } - output += '\n' - } - } - output += "!! Only displaying parameters that differ from the pipeline defaults !!\n" - output += NfcoreTemplate.dashedLine(params.monochrome_logs) - return output - } - - // - // Loop over nested exceptions and print the causingException - // - private static void printExceptions(ex_json, params_json, log, enums, limit=5) { - def causingExceptions = ex_json['causingExceptions'] - if (causingExceptions.length() == 0) { - def m = ex_json['message'] =~ /required key \[([^\]]+)\] not found/ - // Missing required param - if (m.matches()) { - log.error "* Missing required parameter: --${m[0][1]}" - } - // Other base-level error - else if (ex_json['pointerToViolation'] == '#') { - log.error "* ${ex_json['message']}" - } - // Error with specific param - else { - def param = ex_json['pointerToViolation'] - ~/^#\// - def param_val = params_json[param].toString() - if (enums.containsKey(param)) { - def error_msg = "* --${param}: '${param_val}' is not a valid choice (Available choices" - if (enums[param].size() > limit) { - log.error "${error_msg} (${limit} of ${enums[param].size()}): ${enums[param][0..limit-1].join(', ')}, ... )" - } else { - log.error "${error_msg}: ${enums[param].join(', ')})" - } - } else { - log.error "* --${param}: ${ex_json['message']} (${param_val})" - } - } - } - for (ex in causingExceptions) { - printExceptions(ex, params_json, log, enums) - } - } - - // - // Remove an element from a JSONArray - // - private static JSONArray removeElement(json_array, element) { - def list = [] - int len = json_array.length() - for (int i=0;i - if(raw_schema.keySet().contains('definitions')){ - raw_schema.definitions.each { definition -> - for (key in definition.keySet()){ - if (definition[key].get("properties").keySet().contains(ignore_param)){ - // Remove the param to ignore - definition[key].get("properties").remove(ignore_param) - // If the param was required, change this - if (definition[key].has("required")) { - def cleaned_required = removeElement(definition[key].required, ignore_param) - definition[key].put("required", cleaned_required) - } - } - } - } - } - if(raw_schema.keySet().contains('properties') && raw_schema.get('properties').keySet().contains(ignore_param)) { - raw_schema.get("properties").remove(ignore_param) - } - if(raw_schema.keySet().contains('required') && raw_schema.required.contains(ignore_param)) { - def cleaned_required = removeElement(raw_schema.required, ignore_param) - raw_schema.put("required", cleaned_required) - } - } - return raw_schema - } - - // - // Clean and check parameters relative to Nextflow native classes - // - private static Map cleanParameters(params) { - def new_params = params.getClass().newInstance(params) - for (p in params) { - // remove anything evaluating to false - if (!p['value']) { - new_params.remove(p.key) - } - // Cast MemoryUnit to String - if (p['value'].getClass() == nextflow.util.MemoryUnit) { - new_params.replace(p.key, p['value'].toString()) - } - // Cast Duration to String - if (p['value'].getClass() == nextflow.util.Duration) { - new_params.replace(p.key, p['value'].toString().replaceFirst(/d(?!\S)/, "day")) - } - // Cast LinkedHashMap to String - if (p['value'].getClass() == LinkedHashMap) { - new_params.replace(p.key, p['value'].toString()) - } - } - return new_params - } - - // - // This function tries to read a JSON params file - // - private static LinkedHashMap paramsLoad(String json_schema) { - def params_map = new LinkedHashMap() - try { - params_map = paramsRead(json_schema) - } catch (Exception e) { - println "Could not read parameters settings from JSON. $e" - params_map = new LinkedHashMap() - } - return params_map - } - - // - // Method to actually read in JSON file using Groovy. - // Group (as Key), values are all parameters - // - Parameter1 as Key, Description as Value - // - Parameter2 as Key, Description as Value - // .... - // Group - // - - private static LinkedHashMap paramsRead(String json_schema) throws Exception { - def json = new File(json_schema).text - def Map schema_definitions = (Map) new JsonSlurper().parseText(json).get('definitions') - def Map schema_properties = (Map) new JsonSlurper().parseText(json).get('properties') - /* Tree looks like this in nf-core schema - * definitions <- this is what the first get('definitions') gets us - group 1 - title - description - properties - parameter 1 - type - description - parameter 2 - type - description - group 2 - title - description - properties - parameter 1 - type - description - * properties <- parameters can also be ungrouped, outside of definitions - parameter 1 - type - description - */ - - // Grouped params - def params_map = new LinkedHashMap() - schema_definitions.each { key, val -> - def Map group = schema_definitions."$key".properties // Gets the property object of the group - def title = schema_definitions."$key".title - def sub_params = new LinkedHashMap() - group.each { innerkey, value -> - sub_params.put(innerkey, value) - } - params_map.put(title, sub_params) - } - - // Ungrouped params - def ungrouped_params = new LinkedHashMap() - schema_properties.each { innerkey, value -> - ungrouped_params.put(innerkey, value) - } - params_map.put("Other parameters", ungrouped_params) - - return params_map - } - - // - // Get maximum number of characters across all parameter names - // - private static Integer paramsMaxChars(params_map) { - Integer max_chars = 0 - for (group in params_map.keySet()) { - def group_params = params_map.get(group) // This gets the parameters of that particular group - for (param in group_params.keySet()) { - if (param.size() > max_chars) { - max_chars = param.size() - } - } - } - return max_chars - } -} diff --git a/lib/NfcoreTemplate.groovy b/lib/NfcoreTemplate.groovy index 25a0a74a..408951ae 100755 --- a/lib/NfcoreTemplate.groovy +++ b/lib/NfcoreTemplate.groovy @@ -128,7 +128,7 @@ class NfcoreTemplate { def email_html = html_template.toString() // Render the sendmail template - def max_multiqc_email_size = params.max_multiqc_email_size as nextflow.util.MemoryUnit + 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) diff --git a/lib/WorkflowMain.groovy b/lib/WorkflowMain.groovy index 8db3c4ec..6478740f 100755 --- a/lib/WorkflowMain.groovy +++ b/lib/WorkflowMain.groovy @@ -2,6 +2,8 @@ // This file holds several functions specific to the main.nf workflow in the nf-core/rnafusion pipeline // +import nextflow.Nextflow + class WorkflowMain { // @@ -17,40 +19,11 @@ class WorkflowMain { " https://github.com/${workflow.manifest.name}/blob/master/CITATIONS.md" } - // - // Generate help string - // - public static String help(workflow, params, log) { - def command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --genome GRCh38 -profile docker" - def help_string = '' - help_string += NfcoreTemplate.logo(workflow, params.monochrome_logs) - help_string += NfcoreSchema.paramsHelp(workflow, params, command) - help_string += '\n' + citation(workflow) + '\n' - help_string += NfcoreTemplate.dashedLine(params.monochrome_logs) - return help_string - } - - // - // Generate parameter summary log string - // - public static String paramsSummaryLog(workflow, params, log) { - def summary_log = '' - summary_log += NfcoreTemplate.logo(workflow, params.monochrome_logs) - summary_log += NfcoreSchema.paramsSummaryLog(workflow, params) - summary_log += '\n' + citation(workflow) + '\n' - summary_log += NfcoreTemplate.dashedLine(params.monochrome_logs) - return summary_log - } // // Validate parameters and print summary to screen // public static void initialise(workflow, params, log) { - // Print help to screen if required - if (params.help) { - log.info help(workflow, params, log) - System.exit(0) - } // Print workflow version and exit on --version if (params.version) { @@ -59,14 +32,6 @@ class WorkflowMain { System.exit(0) } - // Print parameter summary log to screen - log.info paramsSummaryLog(workflow, params, log) - - // Validate workflow parameters via the JSON schema - if (params.validate_params) { - NfcoreSchema.validateParameters(workflow, params, log) - } - // Check that a -profile or Nextflow config has been provided to run the pipeline NfcoreTemplate.checkConfigProvided(workflow, log) @@ -80,8 +45,7 @@ class WorkflowMain { // Check input has been provided if (!params.input) { - log.error "Please provide an input samplesheet to the pipeline e.g. '--input samplesheet.csv'" - System.exit(1) + Nextflow.error("Please provide an input samplesheet to the pipeline e.g. '--input samplesheet.csv'") } } // diff --git a/lib/WorkflowRnafusion.groovy b/lib/WorkflowRnafusion.groovy index f31abbf7..0654f5fc 100755 --- a/lib/WorkflowRnafusion.groovy +++ b/lib/WorkflowRnafusion.groovy @@ -2,6 +2,7 @@ // This file holds several functions specific to the workflow/rnafusion.nf in the nf-core/rnafusion pipeline // +import nextflow.Nextflow import groovy.text.SimpleTemplateEngine class WorkflowRnafusion { @@ -10,12 +11,12 @@ class WorkflowRnafusion { // Check and validate parameters // public static void initialise(params, log) { + genomeExistsError(params, log) if (!params.fasta) { - log.error "Genome fasta file not specified with e.g. '--fasta genome.fa' or via a detectable config file." - System.exit(1) + Nextflow.error "Genome fasta file not specified with e.g. '--fasta genome.fa' or via a detectable config file." } } @@ -46,32 +47,76 @@ class WorkflowRnafusion { return yaml_file_text } - public static String methodsDescriptionText(run_workflow, mqc_methods_yaml) { + // + // Generate methods description for MultiQC + // + + public static String toolCitationText(params) { + + // TODO 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)) { - log.error "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + + 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" + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - System.exit(1) + Nextflow.error(error_string) } } } diff --git a/main.nf b/main.nf index 54dddc53..07b9c174 100644 --- a/main.nf +++ b/main.nf @@ -4,7 +4,6 @@ nf-core/rnafusion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Github : https://github.com/nf-core/rnafusion - Website: https://nf-co.re/rnafusion Slack : https://nfcore.slack.com/channels/rnafusion ---------------------------------------------------------------------------------------- @@ -39,6 +38,22 @@ params.rrna_intervals = WorkflowMain.getGenomeAttribute(params, 'rrna_interval ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +include { validateParameters; paramsHelp } from 'plugin/nf-validation' + +// 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 GRCh37 -profile docker" + log.info logo + paramsHelp(command) + citation + NfcoreTemplate.dashedLine(params.monochrome_logs) + System.exit(0) +} + +// Validate input parameters +if (params.validate_params) { + validateParameters() +} + WorkflowMain.initialise(workflow, params, log) /* diff --git a/modules.json b/modules.json index cfa3ec10..162a71b5 100644 --- a/modules.json +++ b/modules.json @@ -7,107 +7,107 @@ "nf-core": { "arriba": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "ea9e2892a9d12e8769402f12096219942bcf6536", "installed_by": ["modules"] }, "cat/cat": { "branch": "master", - "git_sha": "0f8a77ff00e65eaeebc509b8156eaa983192474b", + "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", "installed_by": ["modules"] }, "cat/fastq": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "5c460c5a4736974abde2843294f35307ee2b0e5e", "installed_by": ["modules"] }, "custom/dumpsoftwareversions": { "branch": "master", - "git_sha": "b6d4d476aee074311c89d82a69c1921bd70c8180", + "git_sha": "05c280924b6c768d484c7c443dad5e605c4ff4b4", "installed_by": ["modules"] }, "fastp": { "branch": "master", - "git_sha": "20a508676f40d0fd3f911ac595af91ec845704c4", + "git_sha": "d497a4868ace3302016ea8ed4b395072d5e833cd", "installed_by": ["modules"] }, "fastqc": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "9a4517e720bc812e95b56d23d15a1653b6db4f53", "installed_by": ["modules"] }, "gatk4/bedtointervallist": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "2df2a11d5b12f2a73bca74f103691bc35d83c5fd", "installed_by": ["modules"] }, "gatk4/createsequencedictionary": { "branch": "master", - "git_sha": "0f8a77ff00e65eaeebc509b8156eaa983192474b", + "git_sha": "541811d779026c5d395925895fa5ed35e7216cc0", "installed_by": ["modules"] }, "kallisto/index": { "branch": "master", - "git_sha": "0f8a77ff00e65eaeebc509b8156eaa983192474b", + "git_sha": "699fa6f3002d922380615f3847198aeb57d8b6a9", "installed_by": ["modules"] }, "multiqc": { "branch": "master", - "git_sha": "ee80d14721e76e2e079103b8dcd5d57129e584ba", + "git_sha": "a6e11ac655e744f7ebc724be669dd568ffdc0e80", "installed_by": ["modules"] }, "picard/collectwgsmetrics": { "branch": "master", - "git_sha": "0f8a77ff00e65eaeebc509b8156eaa983192474b", + "git_sha": "735e1e04e7e01751d2d6e97055bbdb6f70683cc1", "installed_by": ["modules"] }, "picard/markduplicates": { "branch": "master", - "git_sha": "2f88b26e9804b99e98f7cd08e74c3f88288a3358", + "git_sha": "2ee934606f1fdf7fc1cb05d6e8abc13bec8ab448", "installed_by": ["modules"] }, "qualimap/rnaseq": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "4657d98bc9f565e067c4d924126ce107056f5e2f", "installed_by": ["modules"] }, "samtools/faidx": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "fd742419940e01ba1c5ecb172c3e32ec840662fe", "installed_by": ["modules"] }, "samtools/index": { "branch": "master", - "git_sha": "0f8a77ff00e65eaeebc509b8156eaa983192474b", + "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", "installed_by": ["modules"] }, "samtools/sort": { "branch": "master", - "git_sha": "0f8a77ff00e65eaeebc509b8156eaa983192474b", + "git_sha": "a0f7be95788366c1923171e358da7d049eb440f9", "installed_by": ["modules"] }, "samtools/view": { "branch": "master", - "git_sha": "0f8a77ff00e65eaeebc509b8156eaa983192474b", + "git_sha": "3ffae3598260a99e8db3207dead9f73f87f90d1f", "installed_by": ["modules"] }, "star/align": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "cc08a888069f67cab8120259bddab8032d4c0fe3", "installed_by": ["modules"] }, "star/genomegenerate": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "cc08a888069f67cab8120259bddab8032d4c0fe3", "installed_by": ["modules"] }, "stringtie/merge": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", "installed_by": ["modules"] }, "stringtie/stringtie": { "branch": "master", - "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", + "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", "installed_by": ["modules"] } } diff --git a/modules/local/arriba/visualisation/main.nf b/modules/local/arriba/visualisation/main.nf index b55666ca..5805a904 100644 --- a/modules/local/arriba/visualisation/main.nf +++ b/modules/local/arriba/visualisation/main.nf @@ -9,9 +9,9 @@ process ARRIBA_VISUALISATION { input: tuple val(meta), path(bam), path(bai), path(fusions) - path gtf - path protein_domains - path cytobands + tuple val(meta2), path(gtf) + tuple val(meta3), path(protein_domains) + tuple val(meta4), path(cytobands) output: tuple val(meta), path("*.pdf") , emit: pdf diff --git a/modules/local/convert2bed/meta.yml b/modules/local/convert2bed/meta.yml index e578330b..31ff3649 100644 --- a/modules/local/convert2bed/meta.yml +++ b/modules/local/convert2bed/meta.yml @@ -4,7 +4,7 @@ description: convert from GTF to BED format tools: - convert2bed: description: convert from GTF to BED format - homepage: https://pachterlab.github.io/kallisto/ + homepage: https://github.com/bedops/bedops documentation: https://bedops.readthedocs.io/en/latest/index.html tool_dev_url: https://github.com/bedops/bedops doi: "" diff --git a/modules/local/ensembl/main.nf b/modules/local/ensembl/main.nf index d6d71e6d..4a782c0d 100644 --- a/modules/local/ensembl/main.nf +++ b/modules/local/ensembl/main.nf @@ -9,13 +9,16 @@ process ENSEMBL_DOWNLOAD { input: val ensembl_version + val genome + val meta output: - path "versions.yml" , emit: versions - path "Homo_sapiens.${params.genome}.${ensembl_version}.all.fa" , emit: fasta - path "Homo_sapiens.${params.genome}.${ensembl_version}.gtf" , emit: gtf - path "Homo_sapiens.${params.genome}.${ensembl_version}.chr.gtf" , emit: chrgtf - path "Homo_sapiens.${params.genome}.${ensembl_version}.cdna.all.fa.gz", emit: transcript + tuple val(meta), path("Homo_sapiens.${genome}.${ensembl_version}.all.fa") , emit: fasta + tuple val(meta), path("Homo_sapiens.${genome}.${ensembl_version}.gtf") , emit: gtf + tuple val(meta), path("Homo_sapiens.${genome}.${ensembl_version}.chr.gtf") , emit: chrgtf + tuple val(meta), path("Homo_sapiens.${genome}.${ensembl_version}.cdna.all.fa.gz"), emit: transcript + path "versions.yml" , emit: versions + script: """ @@ -40,10 +43,10 @@ process ENSEMBL_DOWNLOAD { stub: """ - touch "Homo_sapiens.${params.genome}.${ensembl_version}.all.fa" - touch "Homo_sapiens.${params.genome}.${ensembl_version}.gtf" - touch "Homo_sapiens.${params.genome}.${ensembl_version}.chr.gtf" - touch "Homo_sapiens.${params.genome}.${ensembl_version}.cdna.all.fa.gz" + touch "Homo_sapiens.${genome}.${ensembl_version}.all.fa" + touch "Homo_sapiens.${genome}.${ensembl_version}.gtf" + touch "Homo_sapiens.${genome}.${ensembl_version}.chr.gtf" + touch "Homo_sapiens.${genome}.${ensembl_version}.cdna.all.fa.gz" cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/local/fusionreport/detect/main.nf b/modules/local/fusionreport/detect/main.nf index 8c35be4a..38809803 100644 --- a/modules/local/fusionreport/detect/main.nf +++ b/modules/local/fusionreport/detect/main.nf @@ -4,19 +4,19 @@ process FUSIONREPORT { // Note: 2.7X indices incompatible with AWS iGenomes. conda "bioconda::star=2.7.9a" - container "docker.io/clinicalgenomics/fusion-report:2.1.5p2.1" + container "docker.io/clinicalgenomics/fusion-report:2.1.5p4" input: tuple val(meta), path(reads), path(arriba_fusions), path(pizzly_fusions), path(squid_fusions), path(starfusion_fusions), path(fusioncatcher_fusions) - path(fusionreport_ref) + tuple val(meta2), path(fusionreport_ref) output: path "versions.yml" , emit: versions tuple val(meta), path("*fusionreport.tsv") , emit: fusion_list tuple val(meta), path("*fusionreport_filtered.tsv") , emit: fusion_list_filtered - tuple val(meta), path("index.html") , emit: report - tuple val(meta), path("*_*.html") , emit: html + tuple val(meta), path("*index.html") , emit: report + tuple val(meta), path("*_*.html") , optional:true, emit: html tuple val(meta), path("*.csv") , optional:true, emit: csv tuple val(meta), path("*.json") , optional:true, emit: json @@ -37,6 +37,7 @@ process FUSIONREPORT { mv fusion_list.tsv ${prefix}.fusionreport.tsv mv fusion_list_filtered.tsv ${prefix}.fusionreport_filtered.tsv + mv index.html ${prefix}_fusionreport_index.html [ ! -f fusions.csv ] || mv fusions.csv ${prefix}.fusions.csv [ ! -f fusions.json ] || mv fusions.json ${prefix}.fusions.json @@ -52,7 +53,7 @@ process FUSIONREPORT { """ touch ${prefix}.fusionreport_filtered.tsv touch ${prefix}.fusionreport.tsv - touch index.html + touch ${prefix}_fusionreport_index.html touch AAA_BBB.html touch ${prefix}.fusions.csv touch ${prefix}.fusions.json diff --git a/modules/local/fusionreport/detect/meta.yml b/modules/local/fusionreport/detect/meta.yml index f3d5cd88..7b9de84c 100644 --- a/modules/local/fusionreport/detect/meta.yml +++ b/modules/local/fusionreport/detect/meta.yml @@ -4,7 +4,7 @@ keywords: - sort tools: - fusionreport: - description: fusionreport + description: Tool for parsing outputs from fusion detection tools homepage: https://github.com/matq007/fusion-report documentation: https://matq007.github.io/fusion-report/#/ doi: "10.1101/011650" diff --git a/modules/local/fusionreport/download/main.nf b/modules/local/fusionreport/download/main.nf index 5dca9b2a..3ab1bc03 100644 --- a/modules/local/fusionreport/download/main.nf +++ b/modules/local/fusionreport/download/main.nf @@ -4,7 +4,7 @@ process FUSIONREPORT_DOWNLOAD { // Note: 2.7X indices incompatible with AWS iGenomes. conda "bioconda::star=2.7.9a" - container "docker.io/clinicalgenomics/fusion-report:2.1.5p2.1" + container "docker.io/clinicalgenomics/fusion-report:2.1.5p4" input: val(username) diff --git a/modules/local/megafusion/meta.yml b/modules/local/megafusion/meta.yml index a25cd74c..31343c7e 100644 --- a/modules/local/megafusion/meta.yml +++ b/modules/local/megafusion/meta.yml @@ -4,7 +4,7 @@ keywords: - sort tools: - fusionreport: - description: megafusion + description: Converts RNA fusion files to SV VCF and collects statistics and metrics in a VCF file. homepage: Adapted from https://github.com/J35P312/MegaFusion documentation: https://github.com/J35P312/MegaFusion doi: "" diff --git a/modules/local/picard/collectrnaseqmetrics/main.nf b/modules/local/picard/collectrnaseqmetrics/main.nf index f1b2fff5..af0b8958 100644 --- a/modules/local/picard/collectrnaseqmetrics/main.nf +++ b/modules/local/picard/collectrnaseqmetrics/main.nf @@ -2,15 +2,15 @@ process PICARD_COLLECTRNASEQMETRICS { tag "$meta.id" label 'process_medium' - conda "bioconda::picard=2.27.4" + conda "bioconda::picard=3.0.0 r::r-base" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:2.27.4--hdfd78af_0' : - 'quay.io/biocontainers/picard:2.27.4--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:3.0.0--hdfd78af_1' : + 'biocontainers/picard:3.0.0--hdfd78af_1' }" input: tuple val(meta), path(bam), path(bai) - path(refflat) - path(rrna_intervals) + tuple val(meta2), path(refflat) + tuple val(meta3), path(rrna_intervals) output: tuple val(meta), path("*rna_metrics.txt") , emit: metrics diff --git a/modules/local/pizzly/detect/main.nf b/modules/local/pizzly/detect/main.nf index 9f10caf8..a610b531 100644 --- a/modules/local/pizzly/detect/main.nf +++ b/modules/local/pizzly/detect/main.nf @@ -9,8 +9,8 @@ process PIZZLY { input: tuple val(meta), path(txt) - path transcript - path gtf + tuple val(meta2), path(transcript) + tuple val(meta3), path(gtf) output: path "versions.yml" , emit: versions diff --git a/modules/local/pizzly/download/main.nf b/modules/local/pizzly/download/main.nf index 571cd4dc..efaae3aa 100644 --- a/modules/local/pizzly/download/main.nf +++ b/modules/local/pizzly/download/main.nf @@ -8,7 +8,7 @@ process PIZZLY_DOWNLOAD { 'quay.io/biocontainers/kallisto:0.46.2--h4f7b962_1' }" input: - path transcript + tuple val(meta), path(transcript) output: path "versions.yml" , emit: versions diff --git a/modules/local/samplesheet_check.nf b/modules/local/samplesheet_check.nf index a17dc6dc..9473ea1b 100644 --- a/modules/local/samplesheet_check.nf +++ b/modules/local/samplesheet_check.nf @@ -5,8 +5,9 @@ process SAMPLESHEET_CHECK { conda "conda-forge::python=3.8.3" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/python:3.9--1' : - 'quay.io/biocontainers/python:3.9--1' }" + 'https://depot.galaxyproject.org/singularity/python:3.8.3' : + 'biocontainers/python:3.8.3' }" + input: path samplesheet diff --git a/modules/local/squid/annotate/main.nf b/modules/local/squid/annotate/main.nf index 19975b00..9b6eebe7 100644 --- a/modules/local/squid/annotate/main.nf +++ b/modules/local/squid/annotate/main.nf @@ -10,7 +10,7 @@ process SQUID_ANNOTATE { input: tuple val(meta), path(txt) - path gtf + tuple val(meta2), path(gtf) output: tuple val(meta), path("*annotated.txt") , emit: fusions_annotated diff --git a/modules/local/starfusion/build/main.nf b/modules/local/starfusion/build/main.nf index da5b0c3b..e2bd7879 100644 --- a/modules/local/starfusion/build/main.nf +++ b/modules/local/starfusion/build/main.nf @@ -5,8 +5,8 @@ process STARFUSION_BUILD { container "docker.io/trinityctat/starfusion:1.12.0" input: - path fasta - path gtf + tuple val(meta), path(fasta) + tuple val(meta2), path(gtf) output: path "*" , emit: reference diff --git a/modules/local/uscs/custom_gtftogenepred/main.nf b/modules/local/uscs/custom_gtftogenepred/main.nf index 46052b5a..78fcbd29 100644 --- a/modules/local/uscs/custom_gtftogenepred/main.nf +++ b/modules/local/uscs/custom_gtftogenepred/main.nf @@ -7,7 +7,7 @@ process GTF_TO_REFFLAT { 'quay.io/biocontainers/ucsc-gtftogenepred:377--ha8a8165_5' }" input: - path gtf + tuple val(meta), path (gtf) output: path('*.refflat'), emit: refflat diff --git a/modules/nf-core/arriba/main.nf b/modules/nf-core/arriba/main.nf index e4b48be2..2537d05b 100644 --- a/modules/nf-core/arriba/main.nf +++ b/modules/nf-core/arriba/main.nf @@ -2,20 +2,20 @@ process ARRIBA { tag "$meta.id" label 'process_medium' - conda "bioconda::arriba=2.3.0" + conda "bioconda::arriba=2.4.0" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/arriba:2.3.0--haa8aa89_0' : - 'quay.io/biocontainers/arriba:2.3.0--haa8aa89_0' }" + 'https://depot.galaxyproject.org/singularity/arriba:2.4.0--h0033a41_2' : + 'biocontainers/arriba:2.4.0--h0033a41_2' }" input: tuple val(meta), path(bam) - path fasta - path gtf - path blacklist - path known_fusions - path structural_variants - path tags - path protein_domains + tuple val(meta2), path(fasta) + tuple val(meta3), path(gtf) + tuple val(meta4), path(blacklist) + tuple val(meta5), path(known_fusions) + tuple val(meta6), path(structural_variants) + tuple val(meta7), path(tags) + tuple val(meta8), path(protein_domains) output: tuple val(meta), path("*.fusions.tsv") , emit: fusions diff --git a/modules/nf-core/arriba/meta.yml b/modules/nf-core/arriba/meta.yml index 119dd912..85b3a30b 100644 --- a/modules/nf-core/arriba/meta.yml +++ b/modules/nf-core/arriba/meta.yml @@ -3,6 +3,8 @@ description: Arriba is a command-line tool for the detection of gene fusions fro keywords: - fusion - arriba + - detection + - RNA-Seq tools: - arriba: description: Fast and accurate gene fusion detection from RNA-Seq data @@ -22,30 +24,65 @@ input: type: file description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - fasta: type: file description: Assembly FASTA file pattern: "*.{fasta}" + - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - gtf: type: file description: Annotation GTF file pattern: "*.{gtf}" + - meta4: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - blacklist: type: file description: Blacklist file pattern: "*.{tsv}" + - meta5: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - known_fusions: type: file description: Known fusions file pattern: "*.{tsv}" + - meta6: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - structural_variants: type: file description: Structural variants file pattern: "*.{tsv}" + - meta7: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - tags: type: file description: Tags file pattern: "*.{tsv}" + - meta8: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - protein_domains: type: file description: Protein domains file diff --git a/modules/nf-core/cat/cat/main.nf b/modules/nf-core/cat/cat/main.nf index 840af4b9..9f062219 100644 --- a/modules/nf-core/cat/cat/main.nf +++ b/modules/nf-core/cat/cat/main.nf @@ -5,7 +5,7 @@ process CAT_CAT { conda "conda-forge::pigz=2.3.4" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/pigz:2.3.4' : - 'quay.io/biocontainers/pigz:2.3.4' }" + 'biocontainers/pigz:2.3.4' }" input: tuple val(meta), path(files_in) diff --git a/modules/nf-core/cat/fastq/main.nf b/modules/nf-core/cat/fastq/main.nf index 8a0b5600..5021e6fc 100644 --- a/modules/nf-core/cat/fastq/main.nf +++ b/modules/nf-core/cat/fastq/main.nf @@ -5,7 +5,7 @@ process CAT_FASTQ { conda "conda-forge::sed=4.7" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : - 'ubuntu:20.04' }" + 'nf-core/ubuntu:20.04' }" input: tuple val(meta), path(reads, stageAs: "input*/*") diff --git a/modules/nf-core/cat/fastq/meta.yml b/modules/nf-core/cat/fastq/meta.yml index c836598e..8a39e309 100644 --- a/modules/nf-core/cat/fastq/meta.yml +++ b/modules/nf-core/cat/fastq/meta.yml @@ -1,6 +1,7 @@ name: cat_fastq description: Concatenates fastq files keywords: + - cat - fastq - concatenate tools: @@ -16,7 +17,7 @@ input: Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - reads: - type: list + type: file description: | List of input FastQ files to be concatenated. output: diff --git a/modules/nf-core/custom/dumpsoftwareversions/main.nf b/modules/nf-core/custom/dumpsoftwareversions/main.nf index 800a6099..c9d014b1 100644 --- a/modules/nf-core/custom/dumpsoftwareversions/main.nf +++ b/modules/nf-core/custom/dumpsoftwareversions/main.nf @@ -2,10 +2,10 @@ process CUSTOM_DUMPSOFTWAREVERSIONS { label 'process_single' // Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container - conda "bioconda::multiqc=1.14" + conda "bioconda::multiqc=1.15" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.14--pyhdfd78af_0' : - 'quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/multiqc:1.15--pyhdfd78af_0' : + 'biocontainers/multiqc:1.15--pyhdfd78af_0' }" input: path versions diff --git a/modules/nf-core/custom/dumpsoftwareversions/meta.yml b/modules/nf-core/custom/dumpsoftwareversions/meta.yml index 60b546a0..c32657de 100644 --- a/modules/nf-core/custom/dumpsoftwareversions/meta.yml +++ b/modules/nf-core/custom/dumpsoftwareversions/meta.yml @@ -1,7 +1,9 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-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: diff --git a/modules/nf-core/fastp/main.nf b/modules/nf-core/fastp/main.nf index 5eeb9b09..831b7f12 100644 --- a/modules/nf-core/fastp/main.nf +++ b/modules/nf-core/fastp/main.nf @@ -2,10 +2,10 @@ process FASTP { tag "$meta.id" label 'process_medium' - conda "bioconda::fastp=0.23.2" + conda "bioconda::fastp=0.23.4" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/fastp:0.23.2--h79da9fb_0' : - 'quay.io/biocontainers/fastp:0.23.2--h79da9fb_0' }" + 'https://depot.galaxyproject.org/singularity/fastp:0.23.4--h5f740d0_0' : + 'biocontainers/fastp:0.23.4--h5f740d0_0' }" input: tuple val(meta), path(reads) diff --git a/modules/nf-core/fastqc/main.nf b/modules/nf-core/fastqc/main.nf index 9ae58381..249f9064 100644 --- a/modules/nf-core/fastqc/main.nf +++ b/modules/nf-core/fastqc/main.nf @@ -5,7 +5,7 @@ process FASTQC { conda "bioconda::fastqc=0.11.9" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0' : - 'quay.io/biocontainers/fastqc:0.11.9--0' }" + 'biocontainers/fastqc:0.11.9--0' }" input: tuple val(meta), path(reads) @@ -29,7 +29,11 @@ process FASTQC { printf "%s %s\\n" $rename_to | while read old_name new_name; do [ -f "\${new_name}" ] || ln -s \$old_name \$new_name done - fastqc $args --threads $task.cpus $renamed_files + + fastqc \\ + $args \\ + --threads $task.cpus \\ + $renamed_files cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/fastqc/tests/main.nf.test b/modules/nf-core/fastqc/tests/main.nf.test new file mode 100644 index 00000000..3961de60 --- /dev/null +++ b/modules/nf-core/fastqc/tests/main.nf.test @@ -0,0 +1,32 @@ +nextflow_process { + + name "Test Process FASTQC" + script "modules/nf-core/fastqc/main.nf" + process "FASTQC" + tag "fastqc" + + test("Single-Read") { + + when { + process { + """ + input[0] = [ + [ id: 'test', single_end:true ], + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assert process.success + 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 process.out.zip.get(0).get(1) ==~ ".*/test_fastqc.zip" + } + + } + +} diff --git a/modules/nf-core/gatk4/bedtointervallist/main.nf b/modules/nf-core/gatk4/bedtointervallist/main.nf index 41fab003..a23abd06 100644 --- a/modules/nf-core/gatk4/bedtointervallist/main.nf +++ b/modules/nf-core/gatk4/bedtointervallist/main.nf @@ -2,14 +2,14 @@ process GATK4_BEDTOINTERVALLIST { tag "$meta.id" label 'process_medium' - conda "bioconda::gatk4=4.3.0.0" + conda "bioconda::gatk4=4.4.0.0" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.3.0.0--py36hdfd78af_0': - 'quay.io/biocontainers/gatk4:4.3.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" input: tuple val(meta), path(bed) - path dict + tuple val(meta2), path(dict) output: tuple val(meta), path('*.interval_list'), emit: interval_list @@ -22,14 +22,14 @@ process GATK4_BEDTOINTERVALLIST { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def avail_mem = 3 + def avail_mem = 3072 if (!task.memory) { log.info '[GATK BedToIntervalList] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' } else { - avail_mem = task.memory.giga + avail_mem = (task.memory.mega*0.8).intValue() } """ - gatk --java-options "-Xmx${avail_mem}g" BedToIntervalList \\ + gatk --java-options "-Xmx${avail_mem}M" BedToIntervalList \\ --INPUT $bed \\ --OUTPUT ${prefix}.interval_list \\ --SEQUENCE_DICTIONARY $dict \\ diff --git a/modules/nf-core/gatk4/bedtointervallist/meta.yml b/modules/nf-core/gatk4/bedtointervallist/meta.yml index 986f1592..40daf752 100644 --- a/modules/nf-core/gatk4/bedtointervallist/meta.yml +++ b/modules/nf-core/gatk4/bedtointervallist/meta.yml @@ -3,6 +3,7 @@ description: Creates an interval list from a bed file and a reference dict keywords: - bed - interval list + - bedtointervallist tools: - gatk4: description: | @@ -23,6 +24,11 @@ input: type: file description: Input bed file pattern: "*.bed" + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] - dict: type: file description: Sequence dictionary @@ -38,3 +44,4 @@ output: pattern: "versions.yml" authors: - "@kevinmenden" + - "@ramprasadn" diff --git a/modules/nf-core/gatk4/createsequencedictionary/main.nf b/modules/nf-core/gatk4/createsequencedictionary/main.nf index bc324ada..15a86bea 100644 --- a/modules/nf-core/gatk4/createsequencedictionary/main.nf +++ b/modules/nf-core/gatk4/createsequencedictionary/main.nf @@ -2,17 +2,17 @@ process GATK4_CREATESEQUENCEDICTIONARY { tag "$fasta" label 'process_medium' - conda "bioconda::gatk4=4.3.0.0" + conda "bioconda::gatk4=4.4.0.0" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.3.0.0--py36hdfd78af_0': - 'quay.io/biocontainers/gatk4:4.3.0.0--py36hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0': + 'biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }" input: - path fasta + tuple val(meta), path(fasta) output: - path "*.dict" , emit: dict - path "versions.yml" , emit: versions + tuple val(meta), path('*.dict') , emit: dict + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -20,14 +20,14 @@ process GATK4_CREATESEQUENCEDICTIONARY { script: def args = task.ext.args ?: '' - def avail_mem = 6 + def avail_mem = 6144 if (!task.memory) { log.info '[GATK CreateSequenceDictionary] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.' } else { - avail_mem = task.memory.giga + avail_mem = (task.memory.mega*0.8).intValue() } """ - gatk --java-options "-Xmx${avail_mem}g" CreateSequenceDictionary \\ + gatk --java-options "-Xmx${avail_mem}M" CreateSequenceDictionary \\ --REFERENCE $fasta \\ --URI $fasta \\ --TMP_DIR . \\ diff --git a/modules/nf-core/gatk4/createsequencedictionary/meta.yml b/modules/nf-core/gatk4/createsequencedictionary/meta.yml index 69c23581..a421e681 100644 --- a/modules/nf-core/gatk4/createsequencedictionary/meta.yml +++ b/modules/nf-core/gatk4/createsequencedictionary/meta.yml @@ -3,6 +3,7 @@ description: Creates a sequence dictionary for a reference sequence keywords: - dictionary - fasta + - createsequencedictionary tools: - gatk: description: | @@ -15,6 +16,11 @@ tools: licence: ["Apache-2.0"] input: + - meta: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] - fasta: type: file description: Input fasta file @@ -30,3 +36,4 @@ output: pattern: "versions.yml" authors: - "@maxulysse" + - "@ramprasadn" diff --git a/modules/nf-core/kallisto/index/main.nf b/modules/nf-core/kallisto/index/main.nf index a24024b4..fb9e44d9 100644 --- a/modules/nf-core/kallisto/index/main.nf +++ b/modules/nf-core/kallisto/index/main.nf @@ -5,14 +5,14 @@ process KALLISTO_INDEX { conda "bioconda::kallisto=0.46.2" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/kallisto:0.46.2--h4f7b962_1' : - 'quay.io/biocontainers/kallisto:0.46.2--h4f7b962_1' }" + 'biocontainers/kallisto:0.46.2--h4f7b962_1' }" input: - path fasta + tuple val(meta), path(fasta) output: - path "kallisto" , emit: idx - path "versions.yml" , emit: versions + tuple val(meta), path("kallisto") , emit: index + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/kallisto/index/meta.yml b/modules/nf-core/kallisto/index/meta.yml index 47f40c9a..05dfa53d 100644 --- a/modules/nf-core/kallisto/index/meta.yml +++ b/modules/nf-core/kallisto/index/meta.yml @@ -1,6 +1,8 @@ name: kallisto_index description: Create kallisto index keywords: + - kallisto + - kallisto/index - index tools: - kallisto: @@ -12,20 +14,30 @@ tools: licence: ["BSD-2-Clause"] input: + - meta: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - fasta: type: file description: genome fasta file pattern: "*.{fasta}" output: + - meta: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] + - index: + type: directory + description: Kallisto genome index + pattern: "*.idx" - versions: type: file description: File containing software versions pattern: "versions.yml" - - idx: - type: index - description: Kallisto genome index - pattern: "*.idx" authors: - "@ggabernet" diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 4b604749..65d7dd0d 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -1,10 +1,10 @@ process MULTIQC { label 'process_single' - conda "bioconda::multiqc=1.14" + conda "bioconda::multiqc=1.15" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.14--pyhdfd78af_0' : - 'quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/multiqc:1.15--pyhdfd78af_0' : + 'biocontainers/multiqc:1.15--pyhdfd78af_0' }" input: path multiqc_files, stageAs: "?/*" diff --git a/modules/nf-core/multiqc/meta.yml b/modules/nf-core/multiqc/meta.yml index ebc29b27..f93b5ee5 100644 --- a/modules/nf-core/multiqc/meta.yml +++ b/modules/nf-core/multiqc/meta.yml @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json name: MultiQC description: Aggregate results from bioinformatics analyses across many samples into a single report keywords: @@ -37,7 +38,7 @@ output: description: MultiQC report file pattern: "multiqc_report.html" - data: - type: dir + type: directory description: MultiQC data dir pattern: "multiqc_data" - plots: diff --git a/modules/nf-core/picard/collectwgsmetrics/main.nf b/modules/nf-core/picard/collectwgsmetrics/main.nf index 827dfb23..1d59334c 100644 --- a/modules/nf-core/picard/collectwgsmetrics/main.nf +++ b/modules/nf-core/picard/collectwgsmetrics/main.nf @@ -5,12 +5,12 @@ process PICARD_COLLECTWGSMETRICS { conda "bioconda::picard=3.0.0 r::r-base" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/picard:3.0.0--hdfd78af_1' : - 'quay.io/biocontainers/picard:3.0.0--hdfd78af_1' }" + 'biocontainers/picard:3.0.0--hdfd78af_1' }" input: tuple val(meta), path(bam), path(bai) tuple val(meta2), path(fasta) - tuple val(meta2), path(fai) + tuple val(meta3), path(fai) path intervallist output: @@ -23,16 +23,16 @@ process PICARD_COLLECTWGSMETRICS { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def avail_mem = 3 + def avail_mem = 3072 def interval = intervallist ? "--INTERVALS ${intervallist}" : '' if (!task.memory) { log.info '[Picard CollectWgsMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' } else { - avail_mem = task.memory.giga + avail_mem = (task.memory.mega*0.8).intValue() } """ picard \\ - -Xmx${avail_mem}g \\ + -Xmx${avail_mem}M \\ CollectWgsMetrics \\ $args \\ --INPUT $bam \\ diff --git a/modules/nf-core/picard/collectwgsmetrics/meta.yml b/modules/nf-core/picard/collectwgsmetrics/meta.yml index 2f8dbd3c..19906f08 100644 --- a/modules/nf-core/picard/collectwgsmetrics/meta.yml +++ b/modules/nf-core/picard/collectwgsmetrics/meta.yml @@ -37,7 +37,7 @@ input: type: file description: Genome fasta file pattern: "*.{fa,fasta,fna}" - - meta2: + - meta3: type: map description: | Groovy Map containing reference information @@ -67,3 +67,4 @@ authors: - "@drpatelh" - "@flowuenne" - "@lassefolkersen" + - "@ramprasadn" diff --git a/modules/nf-core/picard/markduplicates/main.nf b/modules/nf-core/picard/markduplicates/main.nf index be243a95..ebfa0864 100644 --- a/modules/nf-core/picard/markduplicates/main.nf +++ b/modules/nf-core/picard/markduplicates/main.nf @@ -5,12 +5,12 @@ process PICARD_MARKDUPLICATES { conda "bioconda::picard=3.0.0" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/picard:3.0.0--hdfd78af_1' : - 'quay.io/biocontainers/picard:3.0.0--hdfd78af_1' }" + 'biocontainers/picard:3.0.0--hdfd78af_1' }" input: tuple val(meta), path(bam) - path fasta - path fai + tuple val(meta2), path(fasta) + tuple val(meta3), path(fai) output: tuple val(meta), path("*.bam") , emit: bam @@ -24,15 +24,18 @@ process PICARD_MARKDUPLICATES { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def avail_mem = 3 + def avail_mem = 3072 if (!task.memory) { log.info '[Picard MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' } else { - avail_mem = task.memory.giga + avail_mem = (task.memory.mega*0.8).intValue() } + + if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + """ picard \\ - -Xmx${avail_mem}g \\ + -Xmx${avail_mem}M \\ MarkDuplicates \\ $args \\ --INPUT $bam \\ @@ -48,6 +51,7 @@ process PICARD_MARKDUPLICATES { 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 touch ${prefix}.bam.bai diff --git a/modules/nf-core/picard/markduplicates/meta.yml b/modules/nf-core/picard/markduplicates/meta.yml index 3f2357bb..f7693d2f 100644 --- a/modules/nf-core/picard/markduplicates/meta.yml +++ b/modules/nf-core/picard/markduplicates/meta.yml @@ -25,10 +25,20 @@ input: type: file description: BAM file pattern: "*.{bam,cram,sam}" + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] - fasta: type: file description: Reference genome fasta file pattern: "*.{fasta,fa}" + - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] - fai: type: file description: Reference genome fasta index @@ -58,3 +68,4 @@ output: authors: - "@drpatelh" - "@projectoriented" + - "@ramprasadn" diff --git a/modules/nf-core/qualimap/rnaseq/main.nf b/modules/nf-core/qualimap/rnaseq/main.nf index ad15ebc2..044c983f 100644 --- a/modules/nf-core/qualimap/rnaseq/main.nf +++ b/modules/nf-core/qualimap/rnaseq/main.nf @@ -5,11 +5,11 @@ process QUALIMAP_RNASEQ { conda "bioconda::qualimap=2.2.2d" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1' : - 'quay.io/biocontainers/qualimap:2.2.2d--1' }" + 'biocontainers/qualimap:2.2.2d--1' }" input: tuple val(meta), path(bam) - path gtf + tuple val(meta2), path(gtf) output: tuple val(meta), path("${prefix}"), emit: results @@ -22,7 +22,7 @@ process QUALIMAP_RNASEQ { def args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" def paired_end = meta.single_end ? '' : '-pe' - def memory = task.memory.toGiga() + "G" + def memory = (task.memory.mega*0.8).intValue() + 'M' def strandedness = 'non-strand-specific' if (meta.strandedness == 'forward') { @@ -32,7 +32,7 @@ process QUALIMAP_RNASEQ { } """ unset DISPLAY - mkdir tmp + mkdir -p tmp export _JAVA_OPTIONS=-Djava.io.tmpdir=./tmp qualimap \\ --java-mem-size=$memory \\ diff --git a/modules/nf-core/qualimap/rnaseq/meta.yml b/modules/nf-core/qualimap/rnaseq/meta.yml new file mode 100644 index 00000000..7738f08d --- /dev/null +++ b/modules/nf-core/qualimap/rnaseq/meta.yml @@ -0,0 +1,52 @@ +name: qualimap_rnaseq +description: Evaluate alignment data +keywords: + - quality control + - qc + - rnaseq +tools: + - qualimap: + description: | + Qualimap 2 is a platform-independent application written in + Java and R that provides both a Graphical User Interface and + a command-line interface to facilitate the quality control of + alignment sequencing data and its derivatives like feature counts. + homepage: http://qualimap.bioinfo.cipf.es/ + documentation: http://qualimap.conesalab.org/doc_html/index.html + doi: 10.1093/bioinformatics/bts503 + licence: ["GPL-2.0-only"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM file + pattern: "*.{bam}" + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] + - gtf: + type: file + description: GTF file of the reference genome + pattern: "*.{gtf}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - results: + type: directory + description: Qualimap results dir + pattern: "*/*" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@FriederikeHanssen" diff --git a/modules/nf-core/samtools/faidx/main.nf b/modules/nf-core/samtools/faidx/main.nf index ce6580d2..59ed3088 100644 --- a/modules/nf-core/samtools/faidx/main.nf +++ b/modules/nf-core/samtools/faidx/main.nf @@ -2,18 +2,20 @@ process SAMTOOLS_FAIDX { tag "$fasta" label 'process_single' - conda "bioconda::samtools=1.16.1" + conda "bioconda::samtools=1.17" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : - 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : + 'biocontainers/samtools:1.17--h00cdaf9_0' }" input: tuple val(meta), path(fasta) + tuple val(meta2), path(fai) output: - tuple val(meta), path ("*.fai"), emit: fai - tuple val(meta), path ("*.gzi"), emit: gzi, optional: true - path "versions.yml" , emit: versions + tuple val(meta), path ("*.{fa,fasta}") , emit: fa , optional: true + tuple val(meta), path ("*.fai") , emit: fai, optional: true + tuple val(meta), path ("*.gzi") , emit: gzi, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -23,8 +25,8 @@ process SAMTOOLS_FAIDX { """ samtools \\ faidx \\ - $args \\ - $fasta + $fasta \\ + $args cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -33,8 +35,12 @@ process SAMTOOLS_FAIDX { """ stub: + def match = (task.ext.args =~ /-o(?:utput)?\s(.*)\s?/).findAll() + def fastacmd = match[0] ? "touch ${match[0][1]}" : '' """ + ${fastacmd} touch ${fasta}.fai + cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/samtools/faidx/meta.yml b/modules/nf-core/samtools/faidx/meta.yml index fe2fe9a1..957b25e5 100644 --- a/modules/nf-core/samtools/faidx/meta.yml +++ b/modules/nf-core/samtools/faidx/meta.yml @@ -3,6 +3,7 @@ description: Index FASTA file keywords: - index - fasta + - faidx tools: - samtools: description: | @@ -17,12 +18,21 @@ input: - meta: type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + Groovy Map containing reference information + e.g. [ id:'test' ] - fasta: type: file description: FASTA file pattern: "*.{fa,fasta}" + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] + - fai: + type: file + description: FASTA index file + pattern: "*.{fai}" output: - meta: type: map diff --git a/modules/nf-core/samtools/index/main.nf b/modules/nf-core/samtools/index/main.nf index 8b95687a..0b20aa4b 100644 --- a/modules/nf-core/samtools/index/main.nf +++ b/modules/nf-core/samtools/index/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_INDEX { tag "$meta.id" label 'process_low' - conda "bioconda::samtools=1.16.1" + conda "bioconda::samtools=1.17" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : - 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : + 'biocontainers/samtools:1.17--h00cdaf9_0' }" input: tuple val(meta), path(input) diff --git a/modules/nf-core/samtools/sort/main.nf b/modules/nf-core/samtools/sort/main.nf index 84c167cd..2b7753fd 100644 --- a/modules/nf-core/samtools/sort/main.nf +++ b/modules/nf-core/samtools/sort/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_SORT { tag "$meta.id" label 'process_medium' - conda "bioconda::samtools=1.16.1" + conda "bioconda::samtools=1.17" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : - 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : + 'biocontainers/samtools:1.17--h00cdaf9_0' }" input: tuple val(meta), path(bam) @@ -23,7 +23,13 @@ process SAMTOOLS_SORT { 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!" """ - samtools sort $args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam + samtools sort \\ + $args \\ + -@ $task.cpus \\ + -o ${prefix}.bam \\ + -T $prefix \\ + $bam + cat <<-END_VERSIONS > versions.yml "${task.process}": samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') diff --git a/modules/nf-core/samtools/view/main.nf b/modules/nf-core/samtools/view/main.nf index 729c85e5..cb91facf 100644 --- a/modules/nf-core/samtools/view/main.nf +++ b/modules/nf-core/samtools/view/main.nf @@ -2,14 +2,14 @@ process SAMTOOLS_VIEW { tag "$meta.id" label 'process_low' - conda "bioconda::samtools=1.16.1" + conda "bioconda::samtools=1.17" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : - 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : + 'biocontainers/samtools:1.17--h00cdaf9_0' }" input: tuple val(meta), path(input), path(index) - path fasta + tuple val(meta2), path(fasta) path qname output: diff --git a/modules/nf-core/samtools/view/meta.yml b/modules/nf-core/samtools/view/meta.yml index 2e597d34..3b05450b 100644 --- a/modules/nf-core/samtools/view/meta.yml +++ b/modules/nf-core/samtools/view/meta.yml @@ -26,12 +26,17 @@ input: description: BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" - index: - type: optional file - description: BAM.BAI/CRAM.CRAI file - pattern: "*.{.bai,.crai}" + type: file + description: BAM.BAI/BAM.CSI/CRAM.CRAI file (optional) + pattern: "*.{.bai,.csi,.crai}" + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - fasta: - type: optional file - description: Reference file the CRAM was created with + type: file + description: Reference file the CRAM was created with (optional) pattern: "*.{fasta,fa}" - qname: type: file diff --git a/modules/nf-core/star/align/main.nf b/modules/nf-core/star/align/main.nf index 0e3bd713..d0e20384 100644 --- a/modules/nf-core/star/align/main.nf +++ b/modules/nf-core/star/align/main.nf @@ -5,30 +5,34 @@ process STAR_ALIGN { conda "bioconda::star=2.7.10a bioconda::samtools=1.16.1 conda-forge::gawk=5.1.0" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1df389393721fc66f3fd8778ad938ac711951107-0' : - 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1df389393721fc66f3fd8778ad938ac711951107-0' }" + 'biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1df389393721fc66f3fd8778ad938ac711951107-0' }" input: - tuple val(meta), path(reads) - path index - path gtf + tuple val(meta), path(reads, stageAs: "input*/*") + tuple val(meta2), path(index) + tuple val(meta3), path(gtf) val star_ignore_sjdbgtf val seq_platform val seq_center output: - tuple val(meta), path('*d.out.bam') , emit: bam tuple val(meta), path('*Log.final.out') , emit: log_final tuple val(meta), path('*Log.out') , emit: log_out tuple val(meta), path('*Log.progress.out'), emit: log_progress path "versions.yml" , emit: versions + tuple val(meta), path('*d.out.bam') , optional:true, emit: bam tuple val(meta), path('*sortedByCoord.out.bam') , optional:true, emit: bam_sorted tuple val(meta), path('*toTranscriptome.out.bam'), optional:true, emit: bam_transcript tuple val(meta), path('*Aligned.unsort.out.bam') , optional:true, emit: bam_unsorted tuple val(meta), path('*fastq.gz') , optional:true, emit: fastq tuple val(meta), path('*.tab') , optional:true, emit: tab + tuple val(meta), path('*.SJ.out.tab') , optional:true, emit: spl_junc_tab + tuple val(meta), path('*.ReadsPerGene.out.tab') , optional:true, emit: read_per_gene_tab tuple val(meta), path('*.out.junction') , optional:true, emit: junction tuple val(meta), path('*.out.sam') , optional:true, emit: sam + tuple val(meta), path('*.wig') , optional:true, emit: wig + tuple val(meta), path('*.bg') , optional:true, emit: bedgraph when: task.ext.when == null || task.ext.when @@ -36,20 +40,23 @@ process STAR_ALIGN { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def reads1 = [], reads2 = [] + meta.single_end ? [reads].flatten().each{reads1 << it} : reads.eachWithIndex{ v, ix -> ( ix & 1 ? reads2 : reads1) << v } def ignore_gtf = star_ignore_sjdbgtf ? '' : "--sjdbGTFfile $gtf" def seq_platform = seq_platform ? "'PL:$seq_platform'" : "" - def seq_center = seq_center ? "--outSAMattrRGline ID:$prefix 'CN:$seq_center' 'SM:$prefix' $seq_platform " : "--outSAMattrRGline ID:$prefix 'SM:$prefix' $seq_platform " + def seq_center = seq_center ? "'CN:$seq_center'" : "" + def attrRG = args.contains("--outSAMattrRGline") ? "" : "--outSAMattrRGline 'ID:$prefix' $seq_center 'SM:$prefix' $seq_platform" def out_sam_type = (args.contains('--outSAMtype')) ? '' : '--outSAMtype BAM Unsorted' def mv_unsorted_bam = (args.contains('--outSAMtype BAM Unsorted SortedByCoordinate')) ? "mv ${prefix}.Aligned.out.bam ${prefix}.Aligned.unsort.out.bam" : '' """ STAR \\ --genomeDir $index \\ - --readFilesIn $reads \\ + --readFilesIn ${reads1.join(",")} ${reads2.join(",")} \\ --runThreadN $task.cpus \\ --outFileNamePrefix $prefix. \\ $out_sam_type \\ $ignore_gtf \\ - $seq_center \\ + $attrRG \\ $args $mv_unsorted_bam @@ -81,11 +88,16 @@ process STAR_ALIGN { touch ${prefix}.sortedByCoord.out.bam touch ${prefix}.toTranscriptome.out.bam touch ${prefix}.Aligned.unsort.out.bam + touch ${prefix}.Aligned.sortedByCoord.out.bam touch ${prefix}.unmapped_1.fastq.gz touch ${prefix}.unmapped_2.fastq.gz touch ${prefix}.tab + touch ${prefix}.SJ.out.tab + touch ${prefix}.ReadsPerGene.out.tab touch ${prefix}.Chimeric.out.junction touch ${prefix}.out.sam + touch ${prefix}.Signal.UniqueMultiple.str1.out.wig + touch ${prefix}.Signal.UniqueMultiple.str1.out.bg cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/star/align/meta.yml b/modules/nf-core/star/align/meta.yml index 7ee10f1c..3d8fed0c 100644 --- a/modules/nf-core/star/align/meta.yml +++ b/modules/nf-core/star/align/meta.yml @@ -25,10 +25,34 @@ input: description: | List of input FastQ files of size 1 and 2 for single-end and paired-end data, respectively. + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - index: type: directory description: STAR genome index pattern: "star" + - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] + - gtf: + type: file + description: Annotation GTF file + pattern: "*.{gtf}" + - star_ignore_sjdbgtf: + type: boolean + description: Ignore annotation GTF file + - seq_platform: + type: string + description: Sequencing platform + - seq_center: + type: string + description: Sequencing center + output: - bam: type: file @@ -74,6 +98,14 @@ output: type: file description: STAR chimeric junction output file (optional) pattern: "*.out.junction" + - wig: + type: file + description: STAR output wiggle format file(s) (optional) + pattern: "*.wig" + - bedgraph: + type: file + description: STAR output bedGraph format file(s) (optional) + pattern: "*.bg" authors: - "@kevinmenden" diff --git a/modules/nf-core/star/genomegenerate/main.nf b/modules/nf-core/star/genomegenerate/main.nf index 91462489..43424042 100644 --- a/modules/nf-core/star/genomegenerate/main.nf +++ b/modules/nf-core/star/genomegenerate/main.nf @@ -5,15 +5,15 @@ process STAR_GENOMEGENERATE { conda "bioconda::star=2.7.10a bioconda::samtools=1.16.1 conda-forge::gawk=5.1.0" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1df389393721fc66f3fd8778ad938ac711951107-0' : - 'quay.io/biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1df389393721fc66f3fd8778ad938ac711951107-0' }" + 'biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:1df389393721fc66f3fd8778ad938ac711951107-0' }" input: - path fasta - path gtf + tuple val(meta), path(fasta) + tuple val(meta2), path(gtf) output: - path "star" , emit: index - path "versions.yml", emit: versions + tuple val(meta), path("star") , emit: index + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/star/genomegenerate/meta.yml b/modules/nf-core/star/genomegenerate/meta.yml index 8181157a..eba2d9cf 100644 --- a/modules/nf-core/star/genomegenerate/meta.yml +++ b/modules/nf-core/star/genomegenerate/meta.yml @@ -15,14 +15,29 @@ tools: doi: 10.1093/bioinformatics/bts635 licence: ["MIT"] input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - fasta: type: file description: Fasta file of the reference genome + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - gtf: type: file description: GTF file of the reference genome output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - index: type: directory description: Folder containing the star index files diff --git a/modules/nf-core/stringtie/merge/main.nf b/modules/nf-core/stringtie/merge/main.nf index f1635afc..12224f78 100644 --- a/modules/nf-core/stringtie/merge/main.nf +++ b/modules/nf-core/stringtie/merge/main.nf @@ -5,7 +5,7 @@ process STRINGTIE_MERGE { conda "bioconda::stringtie=2.2.1" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/stringtie:2.2.1--hecb563c_2' : - 'quay.io/biocontainers/stringtie:2.2.1--hecb563c_2' }" + 'biocontainers/stringtie:2.2.1--hecb563c_2' }" input: path stringtie_gtf diff --git a/modules/nf-core/stringtie/stringtie/main.nf b/modules/nf-core/stringtie/stringtie/main.nf index 2d5b035f..d0f8b563 100644 --- a/modules/nf-core/stringtie/stringtie/main.nf +++ b/modules/nf-core/stringtie/stringtie/main.nf @@ -5,7 +5,7 @@ process STRINGTIE_STRINGTIE { conda "bioconda::stringtie=2.2.1" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/stringtie:2.2.1--hecb563c_2' : - 'quay.io/biocontainers/stringtie:2.2.1--hecb563c_2' }" + 'biocontainers/stringtie:2.2.1--hecb563c_2' }" input: tuple val(meta), path(bam) diff --git a/nextflow.config b/nextflow.config index 0f0bbc88..994e96e3 100644 --- a/nextflow.config +++ b/nextflow.config @@ -73,7 +73,7 @@ params { arriba_ref_blacklist = "${params.genomes_base}/arriba/blacklist_hg38_GRCh38_v2.3.0.tsv.gz" arriba_ref_cytobands = "${params.genomes_base}/arriba/cytobands_hg38_GRCh38_v2.3.0.tsv" arriba_ref_known_fusions = "${params.genomes_base}/arriba/known_fusions_hg38_GRCh38_v2.3.0.tsv.gz" - arriba_ref_protein_domain = "${params.genomes_base}/arriba/protein_domains_hg38_GRCh38_v2.3.0.gff3" + arriba_ref_protein_domains = "${params.genomes_base}/arriba/protein_domains_hg38_GRCh38_v2.3.0.gff3" fusioncatcher_ref = "${params.genomes_base}/fusioncatcher/human_v102" pizzly_ref = "${params.genomes_base}/pizzly/kallisto" squid_ref = "${params.genomes_base}/squid" @@ -93,7 +93,6 @@ params { // Boilerplate options outdir = null - tracedir = "${params.outdir}/pipeline_info" publish_dir_mode = 'copy' email = null email_on_fail = null @@ -102,18 +101,14 @@ params { hook_url = null help = false version = false - validate_params = true - show_hidden_params = false - schema_ignore_params = 'genomes' - // Config options + config_profile_name = null + config_profile_description = null custom_config_version = 'master' custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" - config_profile_description = null config_profile_contact = null config_profile_url = null - config_profile_name = null // Max resource options @@ -121,6 +116,14 @@ params { max_memory = '128.GB' max_cpus = 16 max_time = '240.h' + + + // Schema validation default options + validationFailUnrecognisedParams = false + validationLenientMode = false + validationSchemaIgnoreParams = 'genomes' + validationShowHiddenParams = false + validate_params = true } // Load base.config by default for all pipelines @@ -137,15 +140,17 @@ try { // Load nf-core/rnafusion custom profiles from different institutions. // Warning: Uncomment only if a pipeline-specific instititutional config already exists on nf-core/configs! -// try { -// includeConfig "${params.custom_config_base}/pipeline/rnafusion.config" -// } catch (Exception e) { -// System.err.println("WARNING: Could not load nf-core/config/rnafusion profiles: ${params.custom_config_base}/pipeline/rnafusion.config") -// } - - +try { + includeConfig "${params.custom_config_base}/pipeline/rnafusion.config" +} catch (Exception e) { + System.err.println("WARNING: Could not load nf-core/config/rnafusion profiles: ${params.custom_config_base}/pipeline/rnafusion.config") +} profiles { - debug { process.beforeScript = 'echo $HOSTNAME' } + debug { + dumpHashes = true + process.beforeScript = 'echo $HOSTNAME' + cleanup = false + } conda { conda.enabled = true docker.enabled = false @@ -153,6 +158,7 @@ profiles { podman.enabled = false shifter.enabled = false charliecloud.enabled = false + apptainer.enabled = false } mamba { conda.enabled = true @@ -162,14 +168,17 @@ profiles { podman.enabled = false shifter.enabled = false charliecloud.enabled = false + apptainer.enabled = false } docker { docker.enabled = true docker.userEmulation = true + conda.enabled = false singularity.enabled = false podman.enabled = false shifter.enabled = false charliecloud.enabled = false + apptainer.enabled = false } arm { docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' @@ -177,31 +186,48 @@ profiles { singularity { singularity.enabled = true singularity.autoMounts = true + conda.enabled = false docker.enabled = false podman.enabled = false shifter.enabled = false charliecloud.enabled = false + apptainer.enabled = false } podman { podman.enabled = true + conda.enabled = false docker.enabled = false singularity.enabled = false shifter.enabled = false charliecloud.enabled = false + apptainer.enabled = false } shifter { shifter.enabled = true + conda.enabled = false docker.enabled = false singularity.enabled = false podman.enabled = false charliecloud.enabled = false + apptainer.enabled = false } charliecloud { charliecloud.enabled = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + apptainer.enabled = false + } + apptainer { + apptainer.enabled = true + conda.enabled = false docker.enabled = false singularity.enabled = false podman.enabled = false shifter.enabled = false + charliecloud.enabled = false } test { includeConfig 'conf/test.config' @@ -217,6 +243,19 @@ profiles { } } +// Set default registry for Apptainer, Docker, Podman and Singularity independent of -profile +// Will not be used unless Apptainer / Docker / Podman / Singularity are enabled +// Set to your registry if you have a mirror of containers +apptainer.registry = 'quay.io' +docker.registry = 'quay.io' +podman.registry = 'quay.io' +singularity.registry = 'quay.io' + +// Nextflow plugins +plugins { + id 'nf-validation' // Validation of pipeline parameters and creation of an input channel from a sample sheet +} + // Export these variables to prevent local Python/R libraries from conflicting with those in the container // The JULIA depot path has been adjusted to a fixed path `/usr/local/share/julia` that needs to be used for packages in the container. // See https://apeltzer.github.io/post/03-julia-lang-nextflow/ for details on that. Once we have a common agreement on where to keep Julia packages, this is adjustable. @@ -234,19 +273,19 @@ process.shell = ['/bin/bash', '-euo', 'pipefail'] def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss') timeline { enabled = true - file = "${params.tracedir}/execution_timeline_${trace_timestamp}.html" + file = "${params.outdir}/pipeline_info/execution_timeline_${trace_timestamp}.html" } report { enabled = true - file = "${params.tracedir}/execution_report_${trace_timestamp}.html" + file = "${params.outdir}/pipeline_info/execution_report_${trace_timestamp}.html" } trace { enabled = true - file = "${params.tracedir}/execution_trace_${trace_timestamp}.txt" + file = "${params.outdir}/pipeline_info/execution_trace_${trace_timestamp}.txt" } dag { enabled = true - file = "${params.tracedir}/pipeline_dag_${trace_timestamp}.html" + file = "${params.outdir}/pipeline_info/pipeline_dag_${trace_timestamp}.html" } manifest { @@ -255,8 +294,8 @@ manifest { homePage = 'https://github.com/nf-core/rnafusion' description = """Nextflow rnafusion analysis pipeline, part of the nf-core community.""" mainScript = 'main.nf' - nextflowVersion = '!>=22.10.1' - version = '2.3.4' + nextflowVersion = '!>=23.04.0' + version = '2.4.0' doi = '' } diff --git a/nextflow_schema.json b/nextflow_schema.json index 7f517b3e..02cd1e27 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -32,9 +32,9 @@ "input": { "type": "string", "format": "file-path", + "exists": true, "mimetype": "text/csv", "pattern": "^\\S+\\.csv$", - "schema": "assets/schema_input.json", "description": "Path to comma-separated file containing information about the samples in the experiment.", "help_text": "You will need to create a design file with information about the samples in your experiment before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row. See [usage docs](https://nf-co.re/rnafusion/usage#samplesheet-input).", "fa_icon": "fas fa-file-csv" @@ -114,7 +114,7 @@ "fa_icon": "far fa-file-code", "description": "Path to arriba reference known fusions" }, - "arriba_ref_protein_domain": { + "arriba_ref_protein_domains": { "type": "string", "fa_icon": "far fa-file-code", "description": "Path to arriba reference protein domain" @@ -454,7 +454,7 @@ "description": "Maximum amount of time that can be requested for any single job.", "default": "240.h", "fa_icon": "far fa-clock", - "pattern": "^(\\d+\\.?\\s*(s|m|h|day)\\s*)+$", + "pattern": "^(\\d+\\.?\\s*(s|m|h|d|day)\\s*)+$", "hidden": true, "help_text": "Use to set an upper-limit for the time requirement for each process. Should be a string in the format integer-unit e.g. `--max_time '2.h'`" } @@ -471,12 +471,14 @@ "type": "boolean", "description": "Display help text.", "fa_icon": "fas fa-question-circle", + "default": false, "hidden": true }, "version": { "type": "boolean", "description": "Display version and exit.", "fa_icon": "fas fa-question-circle", + "default": false, "hidden": true }, "publish_dir_mode": { @@ -500,6 +502,7 @@ "type": "boolean", "description": "Send plain-text email instead of HTML.", "fa_icon": "fas fa-remove-format", + "default": false, "hidden": true }, "max_multiqc_email_size": { @@ -514,6 +517,7 @@ "type": "boolean", "description": "Do not use coloured log outputs.", "fa_icon": "fas fa-palette", + "default": false, "hidden": true }, "hook_url": { @@ -525,6 +529,7 @@ }, "multiqc_config": { "type": "string", + "format": "file-path", "description": "Custom config file to supply to MultiQC.", "fa_icon": "fas fa-cog", "hidden": true @@ -540,13 +545,6 @@ "description": "Custom MultiQC yaml file containing HTML including a methods description.", "fa_icon": "fas fa-cog" }, - "tracedir": { - "type": "string", - "description": "Directory to keep pipeline Nextflow logs and reports.", - "default": "${params.outdir}/pipeline_info", - "fa_icon": "fas fa-cogs", - "hidden": true - }, "validate_params": { "type": "boolean", "description": "Boolean whether to validate parameters against the schema at runtime", @@ -554,13 +552,30 @@ "fa_icon": "fas fa-check-square", "hidden": true }, - "show_hidden_params": { + "validationShowHiddenParams": { "type": "boolean", "fa_icon": "far fa-eye-slash", "description": "Show all params when using `--help`", + "default": false, "hidden": true, "help_text": "By default, parameters set as _hidden_ in the schema are not shown on the command line when a user runs with `--help`. Specifying this option will tell the pipeline to show all parameters." }, + "validationFailUnrecognisedParams": { + "type": "boolean", + "fa_icon": "far fa-check-circle", + "description": "Validation of parameters fails when an unrecognised parameter is found.", + "default": false, + "hidden": true, + "help_text": "By default, when an unrecognised parameter is found, it returns a warinig." + }, + "validationLenientMode": { + "type": "boolean", + "fa_icon": "far fa-check-circle", + "description": "Validation of parameters in lenient more.", + "default": false, + "hidden": true, + "help_text": "Allows string values that are parseable as numbers or booleans. For further information see [JSONSchema docs](https://github.com/everit-org/json-schema#lenient-mode)." + }, "seq_center": { "type": "string", "description": "Sequencing center", diff --git a/subworkflows/local/arriba_workflow.nf b/subworkflows/local/arriba_workflow.nf index 0712f787..36c3924f 100644 --- a/subworkflows/local/arriba_workflow.nf +++ b/subworkflows/local/arriba_workflow.nf @@ -1,6 +1,4 @@ include { ARRIBA } from '../../modules/nf-core/arriba/main' -include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_FOR_ARRIBA} from '../../modules/nf-core/samtools/index/main' -include { SAMTOOLS_SORT as SAMTOOLS_SORT_FOR_ARRIBA } from '../../modules/nf-core/samtools/sort/main' include { SAMTOOLS_VIEW as SAMTOOLS_VIEW_FOR_ARRIBA} from '../../modules/nf-core/samtools/view/main' include { STAR_ALIGN as STAR_FOR_ARRIBA } from '../../modules/nf-core/star/align/main' @@ -10,6 +8,9 @@ workflow ARRIBA_WORKFLOW { ch_gtf ch_fasta ch_starindex_ref + ch_arriba_ref_blacklist + ch_arriba_ref_known_fusions + ch_arriba_ref_protein_domains main: ch_versions = Channel.empty() @@ -20,21 +21,12 @@ workflow ARRIBA_WORKFLOW { STAR_FOR_ARRIBA( reads, ch_starindex_ref, ch_gtf, params.star_ignore_sjdbgtf, '', params.seq_center ?: '') ch_versions = ch_versions.mix(STAR_FOR_ARRIBA.out.versions) - SAMTOOLS_SORT_FOR_ARRIBA(STAR_FOR_ARRIBA.out.bam) - ch_versions = ch_versions.mix(SAMTOOLS_SORT_FOR_ARRIBA.out.versions) - - SAMTOOLS_INDEX_FOR_ARRIBA(SAMTOOLS_SORT_FOR_ARRIBA.out.bam) - ch_versions = ch_versions.mix(SAMTOOLS_INDEX_FOR_ARRIBA.out.versions) - - bam_indexed = SAMTOOLS_SORT_FOR_ARRIBA.out.bam.join(SAMTOOLS_INDEX_FOR_ARRIBA.out.bai) - if (params.arriba_fusions) { - // [meta, reads], fusions -> [meta, fusions] ch_arriba_fusions = reads.combine( Channel.value( file( params.arriba_fusions, checkIfExists: true ) ) ) .map { meta, reads, fusions -> [ meta, fusions ] } ch_arriba_fusion_fail = ch_dummy_file } else { - ARRIBA ( STAR_FOR_ARRIBA.out.bam, ch_fasta, ch_gtf, params.arriba_ref_blacklist, params.arriba_ref_known_fusions, [], [], params.arriba_ref_protein_domain ) + ARRIBA ( STAR_FOR_ARRIBA.out.bam, ch_fasta, ch_gtf, ch_arriba_ref_blacklist, ch_arriba_ref_known_fusions, [[],[]], [[],[]], ch_arriba_ref_protein_domains ) ch_versions = ch_versions.mix(ARRIBA.out.versions) ch_arriba_fusions = ARRIBA.out.fusions @@ -42,9 +34,9 @@ workflow ARRIBA_WORKFLOW { } if (params.cram.contains('arriba') ){ - SAMTOOLS_VIEW_FOR_ARRIBA(bam_indexed, ch_fasta, []) - ch_versions = ch_versions.mix(SAMTOOLS_VIEW_FOR_ARRIBA.out.versions ) + SAMTOOLS_VIEW_FOR_ARRIBA(STAR_FOR_ARRIBA.out.bam.map { meta, bam -> [ meta, bam, [] ] }, ch_fasta, []) + ch_versions = ch_versions.mix(SAMTOOLS_VIEW_FOR_ARRIBA.out.versions ) } diff --git a/subworkflows/local/fusioninspector_workflow.nf b/subworkflows/local/fusioninspector_workflow.nf index 388f42a6..5fa21cf1 100644 --- a/subworkflows/local/fusioninspector_workflow.nf +++ b/subworkflows/local/fusioninspector_workflow.nf @@ -11,23 +11,29 @@ workflow FUSIONINSPECTOR_WORKFLOW { report bam_sorted_indexed ch_gtf + ch_arriba_ref_protein_domains + ch_arriba_ref_cytobands main: ch_versions = Channel.empty() index ="${params.starfusion_ref}" - ch_fusion_list = params.fusioninspector_filter ? fusion_list_filtered : fusion_list + ch_fusion_list = ( params.fusioninspector_filter ? fusion_list_filtered : fusion_list ) + .branch{ + no_fusions: it[1].size() == 0 + fusions: it[1].size() > 0 + } if (params.whitelist) { - ch_whitelist = ch_fusion_list.combine(Channel.value(file(params.whitelist, checkIfExists:true))) + ch_whitelist = ch_fusion_list.fusions.combine(Channel.value(file(params.whitelist, checkIfExists:true))) .map { meta, fusions, whitelist -> [ meta, [fusions, whitelist] ] } CAT_CAT(ch_whitelist) // fusioninspector takes care of possible duplicates ch_versions = ch_versions.mix(CAT_CAT.out.versions) - ch_fusion_list = CAT_CAT.out.file_out + ch_fusion_list.fusions = CAT_CAT.out.file_out } - reads_fusion = reads.join(ch_fusion_list ) + reads_fusion = reads.join(ch_fusion_list.fusions ) FUSIONINSPECTOR( reads_fusion, index) ch_versions = ch_versions.mix(FUSIONINSPECTOR.out.versions) @@ -38,7 +44,7 @@ workflow FUSIONINSPECTOR_WORKFLOW { if ((params.starfusion || params.all || params.stringtie) && !params.fusioninspector_only && !params.skip_vis) { bam_sorted_indexed_fusions = bam_sorted_indexed.join(FUSIONINSPECTOR.out.tsv) - ARRIBA_VISUALISATION(bam_sorted_indexed_fusions, ch_gtf, params.arriba_ref_protein_domain, params.arriba_ref_cytobands) + ARRIBA_VISUALISATION(bam_sorted_indexed_fusions, ch_gtf, ch_arriba_ref_protein_domains, ch_arriba_ref_cytobands) ch_versions = ch_versions.mix(ARRIBA_VISUALISATION.out.versions) } diff --git a/subworkflows/local/qc_workflow.nf b/subworkflows/local/qc_workflow.nf index a2a1dec9..bdf887d1 100644 --- a/subworkflows/local/qc_workflow.nf +++ b/subworkflows/local/qc_workflow.nf @@ -3,13 +3,13 @@ // include { QUALIMAP_RNASEQ } from '../../modules/nf-core/qualimap/rnaseq/main' -include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_FOR_QC } from '../../modules/nf-core/samtools/index/main' include { PICARD_COLLECTRNASEQMETRICS } from '../../modules/local/picard/collectrnaseqmetrics/main' include { PICARD_MARKDUPLICATES } from '../../modules/nf-core/picard/markduplicates/main' workflow QC_WORKFLOW { take: - bam_sorted + ch_bam_sorted + ch_bam_sorted_indexed ch_chrgtf ch_refflat ch_fasta @@ -19,20 +19,15 @@ workflow QC_WORKFLOW { main: ch_versions = Channel.empty() - QUALIMAP_RNASEQ(bam_sorted, ch_chrgtf) + QUALIMAP_RNASEQ(ch_bam_sorted, ch_chrgtf) ch_versions = ch_versions.mix(QUALIMAP_RNASEQ.out.versions) ch_qualimap_qc = Channel.empty().mix(QUALIMAP_RNASEQ.out.results) - SAMTOOLS_INDEX_FOR_QC(bam_sorted) - ch_versions = ch_versions.mix(SAMTOOLS_INDEX_FOR_QC.out.versions) - - bam_indexed = bam_sorted.join(SAMTOOLS_INDEX_FOR_QC.out.bai) - - PICARD_COLLECTRNASEQMETRICS(bam_indexed, ch_refflat, ch_rrna_interval) + PICARD_COLLECTRNASEQMETRICS(ch_bam_sorted_indexed, ch_refflat, ch_rrna_interval) ch_versions = ch_versions.mix(PICARD_COLLECTRNASEQMETRICS.out.versions) ch_rnaseq_metrics = Channel.empty().mix(PICARD_COLLECTRNASEQMETRICS.out.metrics) - PICARD_MARKDUPLICATES(bam_sorted, ch_fasta, ch_fai) + PICARD_MARKDUPLICATES(ch_bam_sorted, ch_fasta, ch_fai) ch_versions = ch_versions.mix(PICARD_MARKDUPLICATES.out.versions) ch_duplicate_metrics = Channel.empty().mix(PICARD_MARKDUPLICATES.out.metrics) diff --git a/subworkflows/local/starfusion_workflow.nf b/subworkflows/local/starfusion_workflow.nf index 1656ec7a..c9ba4bf3 100644 --- a/subworkflows/local/starfusion_workflow.nf +++ b/subworkflows/local/starfusion_workflow.nf @@ -51,8 +51,9 @@ workflow STARFUSION_WORKFLOW { emit: fusions = ch_starfusion_fusions star_stats = ch_star_stats - bam_sorted = ch_align + ch_bam_sorted = ch_align.ifEmpty([[],[]]) + ch_bam_sorted_indexed = bam_sorted_indexed.ifEmpty([[],[],[]]) versions = ch_versions.ifEmpty(null) - ch_bam_sorted_indexed = bam_sorted_indexed.ifEmpty(null) + } diff --git a/subworkflows/local/trim_workflow.nf b/subworkflows/local/trim_workflow.nf index 01baeec7..bf3781f8 100644 --- a/subworkflows/local/trim_workflow.nf +++ b/subworkflows/local/trim_workflow.nf @@ -10,7 +10,6 @@ workflow TRIM_WORKFLOW { main: ch_versions = Channel.empty() - ch_reports = Channel.empty() if (params.trim) { @@ -21,7 +20,6 @@ workflow TRIM_WORKFLOW { ch_reads_all = reads ch_reads_fusioncatcher = REFORMAT.out.reads_out - ch_reports = FASTQC_FOR_TRIM.out.zip.collect{it[1]}.ifEmpty([]) } else if (params.fastp_trim) { FASTP(reads, params.adapter_fasta, false, false) @@ -32,11 +30,7 @@ workflow TRIM_WORKFLOW { ch_reads_all = FASTP.out.reads ch_reads_fusioncatcher = ch_reads_all - ch_reports = ch_reports.mix( - FASTQC_FOR_FASTP.out.zip.collect{it[1]}.ifEmpty([]), - FASTP.out.json.collect{meta, json -> json}, - FASTP.out.html.collect{meta, html -> html} - ) + } else { ch_reads_all = reads @@ -46,7 +40,6 @@ workflow TRIM_WORKFLOW { emit: ch_reads_all ch_reads_fusioncatcher - ch_reports versions = ch_versions.ifEmpty(null) } diff --git a/tower.yml b/tower.yml new file mode 100644 index 00000000..5813f5d3 --- /dev/null +++ b/tower.yml @@ -0,0 +1,35 @@ +reports: + multiqc_report.html: + display: "MultiQC HTML report" + "**/arriba/*.arriba.fusions.tsv": + display: "Arriba identified fusion TSV report" + "**/arriba_visualisation/*_combined_fusions_arriba_visualisation.pdf": + display: "PDF visualisation of the transcripts involved in predicted fusions" + "**/fastp/*fastp.html": + display: "Post fastp trimming HTML report" + "**/fusioncatcher/*.fusioncatcher.fusion-genes.txt": + display: "FusionCatcher identified fusion TXT report" + "**/fusioninspector/*.FusionInspector.fusions.abridged.tsv": + display: "FusionInspector TSV report" + "**/fusionreport/*/*_fusionreport_index.html": + display: "Fusion-report HTML report" + "**/megafusion/*_fusion_data.vcf": + display: "Collected statistics on each fusion fed to FusionInspector in VCF format" + "**/picard/*.MarkDuplicates.metrics.txt": + display: "Picard: Metrics from CollectRnaMetrics" + "**/picard/*_rna_metrics.txt": + display: "Picard: Metrics from MarkDuplicates" + "**/pizzly/*.pizzly.txt": + display: "Pizzly identified fusion TXT report" + "**/qualimap/qualimapReport.html": + display: "Qualimap HTML report from STAR_FOR_STARFUSION alignment" + "**/qualimap/rnaseq_qc_results.txt": + display: "Qualimap QC results from STAR_FOR_STARFUSION alignment in TXT format" + "**/squid/*.squid.fusions.annotated.txt": + display: "Squid identified fusion TXT report" + "**/star_for_starfusion/*ReadsPerGene.out.tab": + display: "Number of reads per gene" + "**/starfusion/*.starfusion.fusion_predictions.tsv": + display: "STAR-Fusion identified fusion TSV report" + "**/stringtie/*/*stringtie.merged.gtf": + display: "Merged GTFs from StringTie with annotations" diff --git a/workflows/build_references.nf b/workflows/build_references.nf index c43ecc84..6a03edb6 100644 --- a/workflows/build_references.nf +++ b/workflows/build_references.nf @@ -33,18 +33,15 @@ include { GATK4_BEDTOINTERVALLIST } from '../modules/nf-core/gatk4/bedto workflow BUILD_REFERENCES { - ENSEMBL_DOWNLOAD( params.ensembl_version ) - ENSEMBL_DOWNLOAD.out.fasta - .map { it -> tuple(id:it.baseName, it) } - .set { ch_fasta_w_meta } + def fake_meta = [:] + fake_meta.id = "Homo_sapiens.${params.genome}.${params.ensembl_version}" + ENSEMBL_DOWNLOAD( params.ensembl_version, params.genome, fake_meta ) - SAMTOOLS_FAIDX(ch_fasta_w_meta) + + SAMTOOLS_FAIDX(ENSEMBL_DOWNLOAD.out.fasta, [[],[]]) GATK4_CREATESEQUENCEDICTIONARY(ENSEMBL_DOWNLOAD.out.fasta) - ENSEMBL_DOWNLOAD.out.gtf - .map { it -> tuple(id:it.baseName, it) } - .set { ch_gtf_w_meta } - RRNA_TRANSCRIPTS(ch_gtf_w_meta) + RRNA_TRANSCRIPTS(ENSEMBL_DOWNLOAD.out.gtf) CONVERT2BED(RRNA_TRANSCRIPTS.out.rrna_gtf) GATK4_BEDTOINTERVALLIST(CONVERT2BED.out.bed, GATK4_CREATESEQUENCEDICTIONARY.out.dict) diff --git a/workflows/rnafusion.nf b/workflows/rnafusion.nf index 45a9e623..6f498e11 100644 --- a/workflows/rnafusion.nf +++ b/workflows/rnafusion.nf @@ -1,12 +1,18 @@ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - VALIDATE INPUTS + PRINT PARAMS SUMMARY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -def summary_params = NfcoreSchema.paramsSummaryMap(workflow, params) +include { paramsSummaryLog; paramsSummaryMap } 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 input parameters WorkflowRnafusion.initialise(params, log) // Check mandatory parameters @@ -14,38 +20,42 @@ WorkflowRnafusion.initialise(params, log) if (file(params.input).exists() || params.build_references) { ch_input = file(params.input) } else { exit 1, 'Input samplesheet does not exist or was not specified!' } if (params.fusioninspector_only && !params.fusioninspector_fusions) { exit 1, 'Parameter --fusioninspector_fusions PATH_TO_FUSION_LIST expected with parameter --fusioninspector_only'} -ch_chrgtf = params.starfusion_build ? file(params.chrgtf) : file("${params.starfusion_ref}/ref_annot.gtf") -ch_starindex_ref = params.starfusion_build ? params.starindex_ref : "${params.starfusion_ref}/ref_genome.fa.star.idx" -ch_starindex_ensembl_ref = params.starindex_ref -ch_refflat = params.starfusion_build ? file(params.refflat) : "${params.ensembl_ref}/ref_annot.gtf.refflat" -ch_rrna_interval = params.starfusion_build ? file(params.rrna_intervals) : "${params.ensembl_ref}/ref_annot.interval_list" +ch_chrgtf = params.starfusion_build ? Channel.fromPath(params.chrgtf).map { it -> [[id:it.Name], it] }.collect() : Channel.fromPath("${params.starfusion_ref}/ref_annot.gtf").map { it -> [[id:it.Name], it] }.collect() +ch_starindex_ref = params.starfusion_build ? Channel.fromPath(params.starindex_ref).map { it -> [[id:it.Name], it] }.collect() : Channel.fromPath("${params.starfusion_ref}/ref_genome.fa.star.idx").map { it -> [[id:it.Name], it] }.collect() +ch_starindex_ensembl_ref = Channel.fromPath(params.starindex_ref).map { it -> [[id:it.Name], it] }.collect() +ch_refflat = params.starfusion_build ? Channel.fromPath(params.refflat).map { it -> [[id:it.Name], it] }.collect() : Channel.fromPath("${params.ensembl_ref}/ref_annot.gtf.refflat").map { it -> [[id:it.Name], it] }.collect() +ch_rrna_interval = params.starfusion_build ? Channel.fromPath(params.rrna_intervals).map { it -> [[id:it.Name], it] }.collect() : Channel.fromPath("${params.ensembl_ref}/ref_annot.interval_list").map { it -> [[id:it.Name], it] }.collect() +ch_fusionreport_ref = Channel.fromPath(params.fusionreport_ref).map { it -> [[id:it.Name], it] }.collect() +ch_arriba_ref_blacklist = Channel.fromPath(params.arriba_ref_blacklist).map { it -> [[id:it.Name], it] }.collect() +ch_arriba_ref_known_fusions = Channel.fromPath(params.arriba_ref_known_fusions).map { it -> [[id:it.Name], it] }.collect() +ch_arriba_ref_protein_domains = Channel.fromPath(params.arriba_ref_protein_domains).map { it -> [[id:it.Name], it] }.collect() +ch_arriba_ref_cytobands = Channel.fromPath(params.arriba_ref_cytobands).map { it -> [[id:it.Name], it] }.collect() + +ch_fasta = Channel.fromPath(params.fasta).map { it -> [[id:it.Name], it] }.collect() +ch_gtf = Channel.fromPath(params.gtf).map { it -> [[id:it.Name], it] }.collect() +ch_transcript = Channel.fromPath(params.transcript).map { it -> [[id:it.Name], it] }.collect() +ch_fai = Channel.fromPath(params.fai).map { it -> [[id:it.Name], it] }.collect() def checkPathParamList = [ params.fasta, params.fai, params.gtf, - ch_chrgtf, params.transcript, - ch_refflat, - ch_rrna_interval ] - for (param in checkPathParamList) if ((param) && !params.build_references) file(param, checkIfExists: true) -if (params.fasta[0,1] == "s3") { - log.info "INFO: s3 path detected, check for absolute path and trailing '/' not performed" +def params_fasta_path_uri = params.fasta =~ /^([a-zA-Z0-9]*):\/\/(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/ +// check if params.fasta is a remote uri such as s3://, gs:// or dx:// +if (params_fasta_path_uri){ + log.info "INFO: a remote uri path detected, check for absolute path and trailing '/' not performed" + // log.info "INFO: remote uri path detected (e.g. s3), check for absolute path and trailing '/' not performed" } else { for (param in checkPathParamList) if ((param.toString())!= file(param).toString() && !params.build_references) { exit 1, "Problem with ${param}: ABSOLUTE PATHS are required! Check for trailing '/' at the end of paths too." } } if ((params.squid || params.all) && params.ensembl_version != 102) { exit 1, 'Ensembl version is not supported by squid' } -ch_fasta = file(params.fasta) -ch_gtf = file(params.gtf) -ch_transcript = file(params.transcript) -ch_fai = file(params.fai) - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CONFIG FILES @@ -108,11 +118,14 @@ workflow RNAFUSION { ch_versions = Channel.empty() + + + // // SUBWORKFLOW: Read in samplesheet, validate and stage input files // INPUT_CHECK ( - ch_input + file(params.input) ) .reads .map { @@ -160,7 +173,10 @@ workflow RNAFUSION { ch_reads_all, ch_gtf, ch_fasta, - ch_starindex_ensembl_ref + ch_starindex_ensembl_ref, + ch_arriba_ref_blacklist, + ch_arriba_ref_known_fusions, + ch_arriba_ref_protein_domains ) ch_versions = ch_versions.mix(ARRIBA_WORKFLOW.out.versions.first().ifEmpty(null)) @@ -204,7 +220,7 @@ workflow RNAFUSION { //Run stringtie STRINGTIE_WORKFLOW ( - STARFUSION_WORKFLOW.out.bam_sorted, + STARFUSION_WORKFLOW.out.ch_bam_sorted, ch_chrgtf ) ch_versions = ch_versions.mix(STRINGTIE_WORKFLOW.out.versions.first().ifEmpty(null)) @@ -213,7 +229,7 @@ workflow RNAFUSION { //Run fusion-report FUSIONREPORT_WORKFLOW ( ch_reads_all, - params.fusionreport_ref, + ch_fusionreport_ref, ARRIBA_WORKFLOW.out.fusions, PIZZLY_WORKFLOW.out.fusions, SQUID_WORKFLOW.out.fusions, @@ -230,14 +246,17 @@ workflow RNAFUSION { FUSIONREPORT_WORKFLOW.out.fusion_list_filtered, FUSIONREPORT_WORKFLOW.out.report, STARFUSION_WORKFLOW.out.ch_bam_sorted_indexed, - ch_chrgtf + ch_chrgtf, + ch_arriba_ref_protein_domains, + ch_arriba_ref_cytobands ) ch_versions = ch_versions.mix(FUSIONINSPECTOR_WORKFLOW.out.versions.first().ifEmpty(null)) //QC QC_WORKFLOW ( - STARFUSION_WORKFLOW.out.bam_sorted, + STARFUSION_WORKFLOW.out.ch_bam_sorted, + STARFUSION_WORKFLOW.out.ch_bam_sorted_indexed, ch_chrgtf, ch_refflat, ch_fasta, @@ -257,7 +276,7 @@ workflow RNAFUSION { workflow_summary = WorkflowRnafusion.paramsSummaryMultiqc(workflow, summary_params) ch_workflow_summary = Channel.value(workflow_summary) - methods_description = WorkflowRnafusion.methodsDescriptionText(workflow, ch_multiqc_custom_methods_description) + methods_description = WorkflowRnafusion.methodsDescriptionText(workflow, ch_multiqc_custom_methods_description, params) ch_methods_description = Channel.value(methods_description) ch_multiqc_files = Channel.empty() @@ -269,7 +288,6 @@ workflow RNAFUSION { ch_multiqc_files = ch_multiqc_files.mix(STARFUSION_WORKFLOW.out.star_stats.collect{it[1]}.ifEmpty([])) ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.rnaseq_metrics.collect{it[1]}.ifEmpty([])) ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.duplicate_metrics.collect{it[1]}.ifEmpty([])) - ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_reports.ifEmpty([]))