├── .devcontainer └── devcontainer.json ├── .editorconfig ├── .gitattributes ├── .github ├── .dockstore.yml ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── awsfulltest.yml │ ├── awstest.yml │ ├── branch.yml │ ├── ci.yml │ ├── fix-linting.yml │ ├── linting.yml │ └── linting_comment.yml ├── .gitignore ├── .gitpod.yml ├── .nf-core.yml ├── .prettierignore ├── .prettierrc.yml ├── CHANGELOG.md ├── CITATIONS.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── assets ├── adaptivecard.json ├── email_template.html ├── email_template.txt ├── methods_description_template.yml ├── multiqc_config.yml ├── nf-core-nanoseq_logo_light.png ├── samplesheet.csv ├── schema_input.json ├── sendmail_template.txt └── slackreport.json ├── bin ├── JAFFAL.groovy ├── check_samplesheet.py ├── create_yml.py ├── gtf2bed ├── run_bambu.r ├── run_deseq2.r └── run_dexseq.r ├── conf ├── base.config ├── igenomes.config ├── modules.config ├── test.config ├── test_full.config ├── test_nodx_noaln.config ├── test_nodx_rnamod.config ├── test_nodx_stringtie.config └── test_nodx_vc.config ├── docs ├── README.md ├── images │ ├── mqc_fastqc_adapter.png │ ├── mqc_fastqc_counts.png │ ├── mqc_fastqc_quality.png │ ├── mqc_samtools_stats_plot.png │ ├── nanoplot_readlengthquality.png │ ├── nanoseq_subwaymap_v3.1.png │ ├── nanoseq_subwaymap_v3.1.svg │ ├── nf-core-nanoseq_logo_dark.png │ └── nf-core-nanoseq_logo_light.png ├── output.md └── usage.md ├── lib ├── NfcoreSchema.groovy ├── NfcoreTemplate.groovy ├── Utils.groovy ├── WorkflowMain.groovy ├── WorkflowNanoseq.groovy └── nfcore_external_java_deps.jar ├── main.nf ├── modules.json ├── modules ├── local │ ├── bam_rename.nf │ ├── bambu.nf │ ├── bedtools_bamtobed.nf │ ├── bedtools_genomecov.nf │ ├── cutesv.nf │ ├── deepvariant.nf │ ├── deseq2.nf │ ├── dexseq.nf │ ├── get_chrom_sizes.nf │ ├── get_jaffal_ref.nf │ ├── get_nanolyse_fasta.nf │ ├── get_test_data.nf │ ├── graphmap2_align.nf │ ├── graphmap2_index.nf │ ├── gtf2bed.nf │ ├── jaffal.nf │ ├── m6anet_dataprep.nf │ ├── m6anet_inference.nf │ ├── medaka_variant.nf │ ├── minimap2_align.nf │ ├── minimap2_index.nf │ ├── multiqc.nf │ ├── nanopolish_index_eventalign.nf │ ├── pepper_margin_deepvariant.nf │ ├── qcat.nf │ ├── samplesheet_check.nf │ ├── samtools_sort_index.nf │ ├── samtools_view_bam.nf │ ├── sniffles.nf │ ├── stringtie2.nf │ ├── subread_featurecounts.nf │ ├── ucsc_bed12tobigbed.nf │ ├── ucsc_bedgraphtobigwig.nf │ ├── xpore_dataprep.nf │ └── xpore_diffmod.nf └── nf-core │ ├── bcftools │ └── sort │ │ ├── main.nf │ │ └── meta.yml │ ├── custom │ └── dumpsoftwareversions │ │ ├── main.nf │ │ ├── meta.yml │ │ └── templates │ │ └── dumpsoftwareversions.py │ ├── fastqc │ ├── main.nf │ └── meta.yml │ ├── multiqc │ ├── main.nf │ └── meta.yml │ ├── nanolyse │ ├── main.nf │ └── meta.yml │ ├── nanoplot │ ├── main.nf │ └── meta.yml │ ├── samtools │ ├── faidx │ │ ├── main.nf │ │ └── meta.yml │ ├── flagstat │ │ ├── main.nf │ │ └── meta.yml │ ├── idxstats │ │ ├── main.nf │ │ └── meta.yml │ ├── index │ │ ├── main.nf │ │ └── meta.yml │ ├── sort │ │ ├── main.nf │ │ └── meta.yml │ └── stats │ │ ├── main.nf │ │ └── meta.yml │ ├── stringtie │ └── merge │ │ ├── main.nf │ │ └── meta.yml │ ├── tabix │ ├── bgzip │ │ ├── main.nf │ │ └── meta.yml │ ├── bgziptabix │ │ ├── main.nf │ │ └── meta.yml │ └── tabix │ │ ├── main.nf │ │ └── meta.yml │ └── untar │ ├── main.nf │ └── meta.yml ├── nextflow.config ├── nextflow_schema.json ├── pyproject.toml ├── subworkflows ├── local │ ├── align_graphmap2.nf │ ├── align_minimap2.nf │ ├── bam_sort_index_samtools.nf │ ├── bedtools_ucsc_bigbed.nf │ ├── bedtools_ucsc_bigwig.nf │ ├── differential_deseq2_dexseq.nf │ ├── input_check.nf │ ├── prepare_genome.nf │ ├── qcfastq_nanoplot_fastqc.nf │ ├── quantify_stringtie_featurecounts.nf │ ├── rna_fusions_jaffal.nf │ ├── rna_modifications_xpore_m6anet.nf │ ├── short_variant_calling.nf │ └── structural_variant_calling.nf └── nf-core │ └── bam_stats_samtools.nf └── workflows └── nanoseq.nf /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nfcore", 3 | "image": "nfcore/gitpod:latest", 4 | "remoteUser": "gitpod", 5 | 6 | // Configure tool-specific properties. 7 | "customizations": { 8 | // Configure properties specific to VS Code. 9 | "vscode": { 10 | // Set *default* container specific settings.json values on container create. 11 | "settings": { 12 | "python.defaultInterpreterPath": "/opt/conda/bin/python", 13 | "python.linting.enabled": true, 14 | "python.linting.pylintEnabled": true, 15 | "python.formatting.autopep8Path": "/opt/conda/bin/autopep8", 16 | "python.formatting.yapfPath": "/opt/conda/bin/yapf", 17 | "python.linting.flake8Path": "/opt/conda/bin/flake8", 18 | "python.linting.pycodestylePath": "/opt/conda/bin/pycodestyle", 19 | "python.linting.pydocstylePath": "/opt/conda/bin/pydocstyle", 20 | "python.linting.pylintPath": "/opt/conda/bin/pylint" 21 | }, 22 | 23 | // Add the IDs of extensions you want installed when the container is created. 24 | "extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"] 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | indent_size = 4 9 | indent_style = space 10 | 11 | [*.{md,yml,yaml,html,css,scss,js,cff}] 12 | indent_size = 2 13 | 14 | # These files are edited and tested upstream in nf-core/modules 15 | [/modules/nf-core/**] 16 | charset = unset 17 | end_of_line = unset 18 | insert_final_newline = unset 19 | trim_trailing_whitespace = unset 20 | indent_style = unset 21 | indent_size = unset 22 | 23 | [/assets/email*] 24 | indent_size = unset 25 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.config linguist-language=nextflow 2 | *.nf.test linguist-language=nextflow 3 | modules/nf-core/** linguist-generated 4 | subworkflows/nf-core/** linguist-generated 5 | -------------------------------------------------------------------------------- /.github/.dockstore.yml: -------------------------------------------------------------------------------- 1 | # Dockstore config version, not pipeline version 2 | version: 1.2 3 | workflows: 4 | - subclass: nfl 5 | primaryDescriptorPath: /nextflow.config 6 | publish: True 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | description: Report something that is broken or incorrect 3 | labels: bug 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Before you post this issue, please check the documentation: 9 | 10 | - [nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting) 11 | - [nf-core/nanoseq pipeline documentation](https://nf-co.re/nanoseq/usage) 12 | 13 | - type: textarea 14 | id: description 15 | attributes: 16 | label: Description of the bug 17 | description: A clear and concise description of what the bug is. 18 | validations: 19 | required: true 20 | 21 | - type: textarea 22 | id: command_used 23 | attributes: 24 | label: Command used and terminal output 25 | description: Steps to reproduce the behaviour. Please paste the command you used to launch the pipeline and the output from your terminal. 26 | render: console 27 | placeholder: | 28 | $ nextflow run ... 29 | 30 | Some output where something broke 31 | 32 | - type: textarea 33 | id: files 34 | attributes: 35 | label: Relevant files 36 | description: | 37 | Please drag and drop the relevant files here. Create a `.zip` archive if the extension is not allowed. 38 | Your verbose log file `.nextflow.log` is often useful _(this is a hidden file in the directory where you launched the pipeline)_ as well as custom Nextflow configuration files. 39 | 40 | - type: textarea 41 | id: system 42 | attributes: 43 | label: System information 44 | description: | 45 | * Nextflow version _(eg. 22.10.1)_ 46 | * Hardware _(eg. HPC, Desktop, Cloud)_ 47 | * Executor _(eg. slurm, local, awsbatch)_ 48 | * Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter or Charliecloud)_ 49 | * OS _(eg. CentOS Linux, macOS, Linux Mint)_ 50 | * Version of nf-core/nanoseq _(eg. 1.1, 1.5, 1.8.2)_ 51 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Join nf-core 3 | url: https://nf-co.re/join 4 | about: Please join the nf-core community here 5 | - name: "Slack #nanoseq channel" 6 | url: https://nfcore.slack.com/channels/nanoseq 7 | about: Discussion about the nf-core/nanoseq pipeline 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for the nf-core/nanoseq pipeline 3 | labels: enhancement 4 | body: 5 | - type: textarea 6 | id: description 7 | attributes: 8 | label: Description of feature 9 | description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered. 10 | validations: 11 | required: true 12 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 13 | 14 | ## PR checklist 15 | 16 | - [ ] This comment contains a description of changes (with reason). 17 | - [ ] If you've fixed a bug or added code that should be tested, add tests! 18 | - [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/nanoseq/tree/master/.github/CONTRIBUTING.md)- [ ] If necessary, also make a PR on the nf-core/nanoseq _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. 19 | - [ ] Make sure your code lints (`nf-core lint`). 20 | - [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir `). 21 | - [ ] Usage Documentation in `docs/usage.md` is updated. 22 | - [ ] Output Documentation in `docs/output.md` is updated. 23 | - [ ] `CHANGELOG.md` is updated. 24 | - [ ] `README.md` is updated (including new tool citations and authors/contributors). 25 | -------------------------------------------------------------------------------- /.github/workflows/awsfulltest.yml: -------------------------------------------------------------------------------- 1 | name: nf-core AWS full size tests 2 | # This workflow is triggered on published releases. 3 | # It can be additionally triggered manually with GitHub actions workflow dispatch button. 4 | # It runs the -profile 'test_full' on AWS batch 5 | 6 | on: 7 | release: 8 | types: [published] 9 | workflow_dispatch: 10 | jobs: 11 | run-tower: 12 | name: Run AWS full tests 13 | if: github.repository == 'nf-core/nanoseq' 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Launch workflow via tower 17 | uses: nf-core/tower-action@v3 18 | # TODO nf-core: You can customise AWS full pipeline tests as required 19 | # Add full size test data (but still relatively small datasets for few samples) 20 | # on the `test_full.config` test runs with only one set of parameters 21 | with: 22 | workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} 23 | access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} 24 | compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} 25 | workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/nanoseq/work-${{ github.sha }} 26 | parameters: | 27 | { 28 | "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/nanoseq/results-${{ github.sha }}" 29 | } 30 | profiles: test_full,aws_tower 31 | - uses: actions/upload-artifact@v3 32 | with: 33 | name: Tower debug log file 34 | path: tower_action_*.log 35 | -------------------------------------------------------------------------------- /.github/workflows/awstest.yml: -------------------------------------------------------------------------------- 1 | name: nf-core AWS test 2 | # This workflow can be triggered manually with the GitHub actions workflow dispatch button. 3 | # It runs the -profile 'test' on AWS batch 4 | 5 | on: 6 | workflow_dispatch: 7 | jobs: 8 | run-tower: 9 | name: Run AWS tests 10 | if: github.repository == 'nf-core/nanoseq' 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Launch workflow using Tower CLI tool action 14 | - name: Launch workflow via tower 15 | uses: nf-core/tower-action@v3 16 | with: 17 | workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} 18 | access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} 19 | compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} 20 | workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/nanoseq/work-${{ github.sha }} 21 | parameters: | 22 | { 23 | "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/nanoseq/results-test-${{ github.sha }}" 24 | } 25 | profiles: test,aws_tower 26 | - uses: actions/upload-artifact@v3 27 | with: 28 | name: Tower debug log file 29 | path: tower_action_*.log 30 | -------------------------------------------------------------------------------- /.github/workflows/branch.yml: -------------------------------------------------------------------------------- 1 | name: nf-core branch protection 2 | # This workflow is triggered on PRs to master branch on the repository 3 | # It fails when someone tries to make a PR against the nf-core `master` branch instead of `dev` 4 | on: 5 | pull_request_target: 6 | branches: [master] 7 | 8 | jobs: 9 | test: 10 | runs-on: ubuntu-latest 11 | steps: 12 | # PRs to the nf-core repo master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches 13 | - name: Check PRs 14 | if: github.repository == 'nf-core/nanoseq' 15 | run: | 16 | { [[ ${{github.event.pull_request.head.repo.full_name }} == nf-core/nanoseq ]] && [[ $GITHUB_HEAD_REF = "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] 17 | 18 | # If the above check failed, post a comment on the PR explaining the failure 19 | # NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets 20 | - name: Post PR comment 21 | if: failure() 22 | uses: mshick/add-pr-comment@v1 23 | with: 24 | message: | 25 | ## This PR is against the `master` branch :x: 26 | 27 | * Do not close this PR 28 | * Click _Edit_ and change the `base` to `dev` 29 | * This CI test will remain failed until you push a new commit 30 | 31 | --- 32 | 33 | Hi @${{ github.event.pull_request.user.login }}, 34 | 35 | It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `master` branch. 36 | The `master` branch on nf-core repositories should always contain code from the latest release. 37 | Because of this, PRs to `master` are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. 38 | 39 | You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page. 40 | Note that even after this, the test will continue to show as failing until you push a new commit. 41 | 42 | Thanks again for your contribution! 43 | repo-token: ${{ secrets.GITHUB_TOKEN }} 44 | allow-repeats: false 45 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: nf-core CI 2 | # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors 3 | on: 4 | push: 5 | branches: 6 | - dev 7 | pull_request: 8 | release: 9 | types: [published] 10 | 11 | env: 12 | NXF_ANSI_LOG: false 13 | 14 | concurrency: 15 | group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" 16 | cancel-in-progress: true 17 | 18 | jobs: 19 | test: 20 | name: Run pipeline with test data 21 | # Only run on push if this is the nf-core dev branch (merged PRs) 22 | if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/nanoseq') }}" 23 | runs-on: ubuntu-latest 24 | strategy: 25 | matrix: 26 | NXF_VER: 27 | - "22.10.1" 28 | - "latest-everything" 29 | steps: 30 | - name: Check out pipeline code 31 | uses: actions/checkout@v3 32 | 33 | - name: Install Nextflow 34 | uses: nf-core/setup-nextflow@v1 35 | with: 36 | version: "${{ matrix.NXF_VER }}" 37 | 38 | - name: Run pipeline with test data 39 | run: | 40 | nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results 41 | 42 | profile: 43 | name: Run profile tests 44 | if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/nanoseq') }}" 45 | runs-on: ubuntu-latest 46 | env: 47 | NXF_VER: "22.10.3" 48 | NXF_ANSI_LOG: false 49 | strategy: 50 | matrix: 51 | profiles: 52 | - "test_nodx_vc" 53 | - "test_nodx_stringtie" 54 | - "test_nodx_noaln" 55 | - "test_nodx_rnamod" 56 | steps: 57 | - name: Check out pipeline code 58 | uses: actions/checkout@v3 59 | 60 | - name: Install Nextflow 61 | uses: nf-core/setup-nextflow@v1 62 | with: 63 | version: "${{ matrix.NXF_VER }}" 64 | 65 | - name: Run pipeline with different profiles 66 | run: | 67 | nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.profiles }},docker --outdir ./results 68 | 69 | parameters: 70 | name: Run parameter tests 71 | if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/nanoseq') }}" 72 | runs-on: ubuntu-latest 73 | env: 74 | NXF_VER: "22.10.3" 75 | NXF_ANSI_LOG: false 76 | strategy: 77 | matrix: 78 | parameters: 79 | - "--aligner graphmap2" 80 | - "--skip_alignment" 81 | - "--skip_qc" 82 | - "--skip_quantification" 83 | steps: 84 | - name: Check out pipeline code 85 | uses: actions/checkout@v2 86 | 87 | - name: Install Nextflow 88 | env: 89 | CAPSULE_LOG: none 90 | run: | 91 | wget -qO- get.nextflow.io | bash 92 | sudo mv nextflow /usr/local/bin/ 93 | 94 | - name: Run pipeline with different parameters 95 | run: | 96 | nextflow run ${GITHUB_WORKSPACE} -profile test,docker ${{ matrix.parameters }} 97 | 98 | # 99 | -------------------------------------------------------------------------------- /.github/workflows/fix-linting.yml: -------------------------------------------------------------------------------- 1 | name: Fix linting from a comment 2 | on: 3 | issue_comment: 4 | types: [created] 5 | 6 | jobs: 7 | deploy: 8 | # Only run if comment is on a PR with the main repo, and if it contains the magic keywords 9 | if: > 10 | contains(github.event.comment.html_url, '/pull/') && 11 | contains(github.event.comment.body, '@nf-core-bot fix linting') && 12 | github.repository == 'nf-core/nanoseq' 13 | runs-on: ubuntu-latest 14 | steps: 15 | # Use the @nf-core-bot token to check out so we can push later 16 | - uses: actions/checkout@v3 17 | with: 18 | token: ${{ secrets.nf_core_bot_auth_token }} 19 | 20 | # Action runs on the issue comment, so we don't get the PR by default 21 | # Use the gh cli to check out the PR 22 | - name: Checkout Pull Request 23 | run: gh pr checkout ${{ github.event.issue.number }} 24 | env: 25 | GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }} 26 | 27 | - uses: actions/setup-node@v3 28 | 29 | - name: Install Prettier 30 | run: npm install -g prettier @prettier/plugin-php 31 | 32 | # Check that we actually need to fix something 33 | - name: Run 'prettier --check' 34 | id: prettier_status 35 | run: | 36 | if prettier --check ${GITHUB_WORKSPACE}; then 37 | echo "result=pass" >> $GITHUB_OUTPUT 38 | else 39 | echo "result=fail" >> $GITHUB_OUTPUT 40 | fi 41 | 42 | - name: Run 'prettier --write' 43 | if: steps.prettier_status.outputs.result == 'fail' 44 | run: prettier --write ${GITHUB_WORKSPACE} 45 | 46 | - name: Commit & push changes 47 | if: steps.prettier_status.outputs.result == 'fail' 48 | run: | 49 | git config user.email "core@nf-co.re" 50 | git config user.name "nf-core-bot" 51 | git config push.default upstream 52 | git add . 53 | git status 54 | git commit -m "[automated] Fix linting with Prettier" 55 | git push 56 | -------------------------------------------------------------------------------- /.github/workflows/linting.yml: -------------------------------------------------------------------------------- 1 | name: nf-core linting 2 | # This workflow is triggered on pushes and PRs to the repository. 3 | # It runs the `nf-core lint` and markdown lint tests to ensure 4 | # that the code meets the nf-core guidelines. 5 | on: 6 | push: 7 | branches: 8 | - dev 9 | pull_request: 10 | release: 11 | types: [published] 12 | 13 | jobs: 14 | EditorConfig: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v3 18 | 19 | - uses: actions/setup-node@v3 20 | 21 | - name: Install editorconfig-checker 22 | run: npm install -g editorconfig-checker 23 | 24 | - name: Run ECLint check 25 | run: editorconfig-checker -exclude README.md $(find .* -type f | grep -v '.git\|.py\|.md\|json\|yml\|yaml\|html\|css\|work\|.nextflow\|build\|nf_core.egg-info\|log.txt\|Makefile') 26 | 27 | Prettier: 28 | runs-on: ubuntu-latest 29 | steps: 30 | - uses: actions/checkout@v3 31 | 32 | - uses: actions/setup-node@v3 33 | 34 | - name: Install Prettier 35 | run: npm install -g prettier 36 | 37 | - name: Run Prettier --check 38 | run: prettier --check ${GITHUB_WORKSPACE} 39 | 40 | PythonBlack: 41 | runs-on: ubuntu-latest 42 | steps: 43 | - uses: actions/checkout@v3 44 | 45 | - name: Check code lints with Black 46 | uses: psf/black@stable 47 | 48 | # If the above check failed, post a comment on the PR explaining the failure 49 | - name: Post PR comment 50 | if: failure() 51 | uses: mshick/add-pr-comment@v1 52 | with: 53 | message: | 54 | ## Python linting (`black`) is failing 55 | 56 | To keep the code consistent with lots of contributors, we run automated code consistency checks. 57 | To fix this CI test, please run: 58 | 59 | * Install [`black`](https://black.readthedocs.io/en/stable/): `pip install black` 60 | * Fix formatting errors in your pipeline: `black .` 61 | 62 | Once you push these changes the test should pass, and you can hide this comment :+1: 63 | 64 | We highly recommend setting up Black in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help! 65 | 66 | Thanks again for your contribution! 67 | repo-token: ${{ secrets.GITHUB_TOKEN }} 68 | allow-repeats: false 69 | 70 | nf-core: 71 | runs-on: ubuntu-latest 72 | steps: 73 | - name: Check out pipeline code 74 | uses: actions/checkout@v3 75 | 76 | - name: Install Nextflow 77 | uses: nf-core/setup-nextflow@v1 78 | 79 | - uses: actions/setup-python@v4 80 | with: 81 | python-version: "3.7" 82 | architecture: "x64" 83 | 84 | - name: Install dependencies 85 | run: | 86 | python -m pip install --upgrade pip 87 | pip install nf-core 88 | 89 | - name: Run nf-core lint 90 | env: 91 | GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} 92 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 93 | GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }} 94 | run: nf-core -l lint_log.txt lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md 95 | 96 | - name: Save PR number 97 | if: ${{ always() }} 98 | run: echo ${{ github.event.pull_request.number }} > PR_number.txt 99 | 100 | - name: Upload linting log file artifact 101 | if: ${{ always() }} 102 | uses: actions/upload-artifact@v3 103 | with: 104 | name: linting-logs 105 | path: | 106 | lint_log.txt 107 | lint_results.md 108 | PR_number.txt 109 | -------------------------------------------------------------------------------- /.github/workflows/linting_comment.yml: -------------------------------------------------------------------------------- 1 | name: nf-core linting comment 2 | # This workflow is triggered after the linting action is complete 3 | # It posts an automated comment to the PR, even if the PR is coming from a fork 4 | 5 | on: 6 | workflow_run: 7 | workflows: ["nf-core linting"] 8 | 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Download lint results 14 | uses: dawidd6/action-download-artifact@v2 15 | with: 16 | workflow: linting.yml 17 | workflow_conclusion: completed 18 | 19 | - name: Get PR number 20 | id: pr_number 21 | run: echo "pr_number=$(cat linting-logs/PR_number.txt)" >> $GITHUB_OUTPUT 22 | 23 | - name: Post PR comment 24 | uses: marocchino/sticky-pull-request-comment@v2 25 | with: 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 | number: ${{ steps.pr_number.outputs.pr_number }} 28 | path: linting-logs/lint_results.md 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .nextflow* 2 | work/ 3 | data/ 4 | results/ 5 | .DS_Store 6 | testing/ 7 | testing* 8 | *.pyc 9 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | image: nfcore/gitpod:latest 2 | 3 | vscode: 4 | extensions: # based on nf-core.nf-core-extensionpack 5 | - codezombiech.gitignore # Language support for .gitignore files 6 | # - cssho.vscode-svgviewer # SVG viewer 7 | - esbenp.prettier-vscode # Markdown/CommonMark linting and style checking for Visual Studio Code 8 | - eamodio.gitlens # Quickly glimpse into whom, why, and when a line or code block was changed 9 | - EditorConfig.EditorConfig # override user/workspace settings with settings found in .editorconfig files 10 | - Gruntfuggly.todo-tree # Display TODO and FIXME in a tree view in the activity bar 11 | - mechatroner.rainbow-csv # Highlight columns in csv files in different colors 12 | # - nextflow.nextflow # Nextflow syntax highlighting 13 | - oderwat.indent-rainbow # Highlight indentation level 14 | - streetsidesoftware.code-spell-checker # Spelling checker for source code 15 | -------------------------------------------------------------------------------- /.nf-core.yml: -------------------------------------------------------------------------------- 1 | repository_type: pipeline 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | email_template.html 2 | adaptivecard.json 3 | slackreport.json 4 | .nextflow* 5 | work/ 6 | data/ 7 | results/ 8 | .DS_Store 9 | testing/ 10 | testing* 11 | *.pyc 12 | bin/ 13 | -------------------------------------------------------------------------------- /.prettierrc.yml: -------------------------------------------------------------------------------- 1 | printWidth: 120 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Chelsea Sawyer, Yuk Kei Wan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/adaptivecard.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "message", 3 | "attachments": [ 4 | { 5 | "contentType": "application/vnd.microsoft.card.adaptive", 6 | "contentUrl": null, 7 | "content": { 8 | "\$schema": "http://adaptivecards.io/schemas/adaptive-card.json", 9 | "msteams": { 10 | "width": "Full" 11 | }, 12 | "type": "AdaptiveCard", 13 | "version": "1.2", 14 | "body": [ 15 | { 16 | "type": "TextBlock", 17 | "size": "Large", 18 | "weight": "Bolder", 19 | "color": "<% if (success) { %>Good<% } else { %>Attention<%} %>", 20 | "text": "nf-core/nanoseq v${version} - ${runName}", 21 | "wrap": true 22 | }, 23 | { 24 | "type": "TextBlock", 25 | "spacing": "None", 26 | "text": "Completed at ${dateComplete} (duration: ${duration})", 27 | "isSubtle": true, 28 | "wrap": true 29 | }, 30 | { 31 | "type": "TextBlock", 32 | "text": "<% if (success) { %>Pipeline completed successfully!<% } else { %>Pipeline completed with errors. The full error message was: ${errorReport}.<% } %>", 33 | "wrap": true 34 | }, 35 | { 36 | "type": "TextBlock", 37 | "text": "The command used to launch the workflow was as follows:", 38 | "wrap": true 39 | }, 40 | { 41 | "type": "TextBlock", 42 | "text": "${commandLine}", 43 | "isSubtle": true, 44 | "wrap": true 45 | } 46 | ], 47 | "actions": [ 48 | { 49 | "type": "Action.ShowCard", 50 | "title": "Pipeline Configuration", 51 | "card": { 52 | "type": "AdaptiveCard", 53 | "\$schema": "http://adaptivecards.io/schemas/adaptive-card.json", 54 | "body": [ 55 | { 56 | "type": "FactSet", 57 | "facts": [<% out << summary.collect{ k,v -> "{\"title\": \"$k\", \"value\" : \"$v\"}"}.join(",\n") %> 58 | ] 59 | } 60 | ] 61 | } 62 | } 63 | ] 64 | } 65 | } 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /assets/email_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | nf-core/nanoseq Pipeline Report 9 | 10 | 11 |
12 | 13 | 14 | 15 |

nf-core/nanoseq v${version}

16 |

Run Name: $runName

17 | 18 | <% if (!success){ 19 | out << """ 20 |
21 |

nf-core/nanoseq execution completed unsuccessfully!

22 |

The exit status of the task that caused the workflow execution to fail was: $exitStatus.

23 |

The full error message was:

24 |
${errorReport}
25 |
26 | """ 27 | } else { 28 | out << """ 29 |
30 | nf-core/nanoseq execution completed successfully! 31 |
32 | """ 33 | } 34 | %> 35 | 36 |

The workflow was completed at $dateComplete (duration: $duration)

37 |

The command used to launch the workflow was as follows:

38 |
$commandLine
39 | 40 |

Pipeline Configuration:

41 | 42 | 43 | <% out << summary.collect{ k,v -> "" }.join("\n") %> 44 | 45 |
$k
$v
46 | 47 |

nf-core/nanoseq

48 |

https://github.com/nf-core/nanoseq

49 | 50 |
51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /assets/email_template.txt: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------- 2 | ,--./,-. 3 | ___ __ __ __ ___ /,-._.--~\\ 4 | |\\ | |__ __ / ` / \\ |__) |__ } { 5 | | \\| | \\__, \\__/ | \\ |___ \\`-._,-`-, 6 | `._,._,' 7 | nf-core/nanoseq v${version} 8 | ---------------------------------------------------- 9 | Run Name: $runName 10 | 11 | <% if (success){ 12 | out << "## nf-core/nanoseq execution completed successfully! ##" 13 | } else { 14 | out << """#################################################### 15 | ## nf-core/nanoseq execution completed unsuccessfully! ## 16 | #################################################### 17 | The exit status of the task that caused the workflow execution to fail was: $exitStatus. 18 | The full error message was: 19 | 20 | ${errorReport} 21 | """ 22 | } %> 23 | 24 | 25 | The workflow was completed at $dateComplete (duration: $duration) 26 | 27 | The command used to launch the workflow was as follows: 28 | 29 | $commandLine 30 | 31 | 32 | 33 | Pipeline Configuration: 34 | ----------------------- 35 | <% out << summary.collect{ k,v -> " - $k: $v" }.join("\n") %> 36 | 37 | -- 38 | nf-core/nanoseq 39 | https://github.com/nf-core/nanoseq 40 | -------------------------------------------------------------------------------- /assets/methods_description_template.yml: -------------------------------------------------------------------------------- 1 | id: "nf-core-nanoseq-methods-description" 2 | description: "Suggested text and references to use when describing pipeline usage within the methods section of a publication." 3 | section_name: "nf-core/nanoseq Methods Description" 4 | section_href: "https://github.com/nf-core/nanoseq" 5 | plot_type: "html" 6 | ## TODO nf-core: Update the HTML below to your prefered methods description, e.g. add publication citation for this pipeline 7 | ## You inject any metadata in the Nextflow '${workflow}' object 8 | data: | 9 |

Methods

10 |

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

11 |

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

12 |
${workflow.commandLine}
13 |

References

14 | 18 |
19 |
Notes:
20 | 25 |
26 | -------------------------------------------------------------------------------- /assets/multiqc_config.yml: -------------------------------------------------------------------------------- 1 | report_comment: > 2 | This report has been generated by the nf-core/nanoseq 3 | analysis pipeline. For information about how to interpret these results, please see the 4 | documentation. 5 | report_section_order: 6 | "nf-core-nanoseq-methods-description": 7 | order: -1000 8 | software_versions: 9 | order: -1001 10 | "nf-core-nanoseq-summary": 11 | order: -1002 12 | 13 | export_plots: true 14 | -------------------------------------------------------------------------------- /assets/nf-core-nanoseq_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/nanoseq/6e563e54362cddb8e48d15c156251708c22d0e8d/assets/nf-core-nanoseq_logo_light.png -------------------------------------------------------------------------------- /assets/samplesheet.csv: -------------------------------------------------------------------------------- 1 | group,replicate,barcode,input_file,genome,transcriptome 2 | MCF7,1,,MCF7_directcDNA_replicate1.fastq.gz,genome.fa,genes.gtf 3 | MCF7,2,,MCF7_directcDNA_replicate2.fastq.gz,genome.fa,genes.gtf 4 | MCF7,3,,MCF7_directRNA_replicate3.fastq.gz,genome.fa,genes.gtf 5 | K562,1,,K562_directcDNA_replicate1.fastq.gz,genome.fa,genes.gtf 6 | K562,2,,K562_directcDNA_replicate2.fastq.gz,genome.fa,genes.gtf 7 | K562,3,,K562_directRNA_replicate3.fastq.gz,genome.fa,genes.gtf 8 | -------------------------------------------------------------------------------- /assets/schema_input.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema", 3 | "$id": "https://raw.githubusercontent.com/nf-core/nanoseq/master/assets/schema_input.json", 4 | "title": "nf-core/nanoseq pipeline - params.input schema", 5 | "description": "Schema for the file provided with params.input", 6 | "type": "array", 7 | "items": { 8 | "type": "object", 9 | "properties": { 10 | "sample": { 11 | "type": "string", 12 | "pattern": "^\\S+$", 13 | "errorMessage": "Sample name must be provided and cannot contain spaces" 14 | }, 15 | "fastq_1": { 16 | "type": "string", 17 | "pattern": "^\\S+\\.f(ast)?q\\.gz$", 18 | "errorMessage": "FastQ file for reads 1 must be provided, cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'" 19 | }, 20 | "fastq_2": { 21 | "errorMessage": "FastQ file for reads 2 cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'", 22 | "anyOf": [ 23 | { 24 | "type": "string", 25 | "pattern": "^\\S+\\.f(ast)?q\\.gz$" 26 | }, 27 | { 28 | "type": "string", 29 | "maxLength": 0 30 | } 31 | ] 32 | } 33 | }, 34 | "required": ["sample", "fastq_1"] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /assets/sendmail_template.txt: -------------------------------------------------------------------------------- 1 | To: $email 2 | Subject: $subject 3 | Mime-Version: 1.0 4 | Content-Type: multipart/related;boundary="nfcoremimeboundary" 5 | 6 | --nfcoremimeboundary 7 | Content-Type: text/html; charset=utf-8 8 | 9 | $email_html 10 | 11 | --nfcoremimeboundary 12 | Content-Type: image/png;name="nf-core-nanoseq_logo.png" 13 | Content-Transfer-Encoding: base64 14 | Content-ID: 15 | Content-Disposition: inline; filename="nf-core-nanoseq_logo_light.png" 16 | 17 | <% out << new File("$projectDir/assets/nf-core-nanoseq_logo_light.png"). 18 | bytes. 19 | encodeBase64(). 20 | toString(). 21 | tokenize( '\n' )*. 22 | toList()*. 23 | collate( 76 )*. 24 | collect { it.join() }. 25 | flatten(). 26 | join( '\n' ) %> 27 | 28 | <% 29 | if (mqcFile){ 30 | def mqcFileObj = new File("$mqcFile") 31 | if (mqcFileObj.length() < mqcMaxSize){ 32 | out << """ 33 | --nfcoremimeboundary 34 | Content-Type: text/html; name=\"multiqc_report\" 35 | Content-Transfer-Encoding: base64 36 | Content-ID: 37 | Content-Disposition: attachment; filename=\"${mqcFileObj.getName()}\" 38 | 39 | ${mqcFileObj. 40 | bytes. 41 | encodeBase64(). 42 | toString(). 43 | tokenize( '\n' )*. 44 | toList()*. 45 | collate( 76 )*. 46 | collect { it.join() }. 47 | flatten(). 48 | join( '\n' )} 49 | """ 50 | }} 51 | %> 52 | 53 | --nfcoremimeboundary-- 54 | -------------------------------------------------------------------------------- /assets/slackreport.json: -------------------------------------------------------------------------------- 1 | { 2 | "attachments": [ 3 | { 4 | "fallback": "Plain-text summary of the attachment.", 5 | "color": "<% if (success) { %>good<% } else { %>danger<%} %>", 6 | "author_name": "sanger-tol/readmapping v${version} - ${runName}", 7 | "author_icon": "https://www.nextflow.io/docs/latest/_static/favicon.ico", 8 | "text": "<% if (success) { %>Pipeline completed successfully!<% } else { %>Pipeline completed with errors<% } %>", 9 | "fields": [ 10 | { 11 | "title": "Command used to launch the workflow", 12 | "value": "```${commandLine}```", 13 | "short": false 14 | } 15 | <% 16 | if (!success) { %> 17 | , 18 | { 19 | "title": "Full error message", 20 | "value": "```${errorReport}```", 21 | "short": false 22 | }, 23 | { 24 | "title": "Pipeline configuration", 25 | "value": "<% out << summary.collect{ k,v -> k == "hook_url" ? "_${k}_: (_hidden_)" : ( ( v.class.toString().contains('Path') || ( v.class.toString().contains('String') && v.contains('/') ) ) ? "_${k}_: `${v}`" : (v.class.toString().contains('DateTime') ? ("_${k}_: " + v.format(java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle.MEDIUM))) : "_${k}_: ${v}") ) }.join(",\n") %>", 26 | "short": false 27 | } 28 | <% } 29 | %> 30 | ], 31 | "footer": "Completed at <% out << dateComplete.format(java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle.MEDIUM)) %> (duration: ${duration})" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /bin/JAFFAL.groovy: -------------------------------------------------------------------------------- 1 | /*********************************************************** 2 | ** This is the JAFFA pipeline file for fusion detection 3 | ** with noisy long read data. For polished long read data, 4 | ** use JAFFA_direct.groovy. Run like so: 5 | ** bpipe run 6 | ** See our website for details on running options: 7 | ** https://github.com/Oshlack/JAFFA/wiki. 8 | ** 9 | ** Author: Nadia Davidson 10 | ** Last Update: 2021 11 | *********************************************************/ 12 | 13 | codeBase = file(bpipe.Config.config.script).parentFile.absolutePath 14 | load codeBase+"/JAFFA_stages.groovy" 15 | 16 | get_fasta = { 17 | doc "Converting fastqs to fasta" 18 | output.dir=jaffa_output+branch 19 | produce(branch+".fasta"){ 20 | exec "$reformat threads=16 ignorebadquality=t in=$input out=$output ;" 21 | } 22 | } 23 | 24 | minimap2_transcriptome = { 25 | doc "Aligning candidates to transcriptome using minimap2" 26 | output.dir=jaffa_output+branch 27 | produce(branch+".paf"){ 28 | exec """ 29 | $minimap2 -t 16 -x map-ont -c $transFasta $input > $output1 ; 30 | """ 31 | } 32 | } 33 | 34 | /** CODE NOT USED infer_genome_alignment = { 35 | doc "Bypassing genomic alignment and infering genome position from transcriptome alignments" 36 | output.dir=jaffa_output+branch 37 | produce(branch+"_genome.psl"){ 38 | exec """ 39 | $bypass_genomic_alignment $transTable $input.txt > $output 40 | """ 41 | } 42 | }**/ 43 | 44 | minimap2_genome = { 45 | doc "Aligning candidates to genome using minimap2" 46 | output.dir=jaffa_output+branch 47 | produce(branch+"_genome.paf",branch+"_genome.psl"){ 48 | exec """ 49 | $minimap2 -t 16 -x splice -c $genomeFasta $input > $output1 ; 50 | grep \$'\\t+\\t' $output1 | awk -F'\\t' -v OFS="\\t" '{ print \$4-\$3,0,0,0,0,0,0,0,\$5,\$1,\$2,\$3,\$4,\$6,\$7,\$8,\$9,2, 100","\$4-\$3-100",",\$3","\$3+100",", \$8","\$9-\$4+\$3+100"," }' > $output2 ; 51 | grep \$'\\t-\\t' $output1 | awk -F'\\t' -v OFS="\\t" '{ print \$4-\$3,0,0,0,0,0,0,0,\$5,\$1,\$2,\$3,\$4,\$6,\$7,\$8,\$9,2, 100","\$4-\$3-100",", \$2-\$4","\$2-\$4+100",", \$8","\$9-\$4+\$3+100"," }' >> $output2 52 | """ 53 | } 54 | } 55 | 56 | reassign_dist=50 57 | 58 | readLayout="single" 59 | fastqInputFormat="%.gz" 60 | 61 | common_steps = segment { 62 | minimap2_transcriptome + 63 | filter_transcripts + 64 | extract_fusion_sequences + 65 | // infer_genome_alignment + 66 | minimap2_genome + 67 | make_fasta_reads_table + 68 | get_final_list } 69 | 70 | 71 | // below is the pipeline for a fasta file 72 | if(args[0].endsWith(fastaSuffix)) { 73 | run { run_check + fastaInputFormat * [ 74 | common_steps ] + compile_all_results 75 | } 76 | } else { //or fastq.gz will be converted to fasta. 77 | run { run_check + fastqInputFormat * [ 78 | get_fasta + common_steps ] + compile_all_results 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /bin/create_yml.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | 5 | outfile_name = sys.argv[1] 6 | samples = sys.argv[2:] 7 | outfile = open(outfile_name, "w") 8 | outfile.write( 9 | "notes: Pairwise comparison without replicates with default parameter setting." + "\n" + "\n" + "data:" + "\n" 10 | ) 11 | 12 | dict = {} 13 | for sample in samples: 14 | sample = sample.strip("[").strip("]").split(",") 15 | path_to_sample, condition = sample[0], sample[1] 16 | if condition not in dict: 17 | dict[condition] = [path_to_sample] 18 | else: 19 | dict[condition].append(path_to_sample) 20 | 21 | for condition in dict: 22 | outfile.write(" " + condition + ":" + "\n") 23 | r = 0 24 | for sample in dict[condition]: 25 | r += 1 26 | outfile.write(" rep" + str(r) + ": " + sample + "\n") 27 | 28 | outfile.write("\n" + "out: ./diffmod_outputs" + "\n" + "\n") 29 | 30 | outfile.write( 31 | "method:" 32 | + "\n" 33 | + " prefiltering:" 34 | + "\n" 35 | + " method: t-test" 36 | + "\n" 37 | + " threshold: 0.1" 38 | + "\n" 39 | + "\n" 40 | ) 41 | 42 | outfile.close() 43 | -------------------------------------------------------------------------------- /bin/gtf2bed: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | # Copyright (c) 2011 Erik Aronesty (erik@q32.com) 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | # 23 | # ALSO, IT WOULD BE NICE IF YOU LET ME KNOW YOU USED IT. 24 | 25 | use Getopt::Long; 26 | 27 | my $extended; 28 | GetOptions("x"=>\$extended); 29 | 30 | $in = shift @ARGV; 31 | 32 | my $in_cmd =($in =~ /\.gz$/ ? "gunzip -c $in|" : $in =~ /\.zip$/ ? "unzip -p $in|" : "$in") || die "Can't open $in: $!\n"; 33 | open IN, $in_cmd; 34 | 35 | while () { 36 | $gff = 2 if /^##gff-version 2/; 37 | $gff = 3 if /^##gff-version 3/; 38 | next if /^#/ && $gff; 39 | 40 | s/\s+$//; 41 | # 0-chr 1-src 2-feat 3-beg 4-end 5-scor 6-dir 7-fram 8-attr 42 | my @f = split /\t/; 43 | if ($gff) { 44 | # most ver 2's stick gene names in the id field 45 | ($id) = $f[8]=~ /\bID="([^"]+)"/; 46 | # most ver 3's stick unquoted names in the name field 47 | ($id) = $f[8]=~ /\bName=([^";]+)/ if !$id && $gff == 3; 48 | } else { 49 | ($id) = $f[8]=~ /transcript_id "([^"]+)"/; 50 | } 51 | 52 | next unless $id && $f[0]; 53 | 54 | if ($f[2] eq 'exon') { 55 | die "no position at exon on line $." if ! $f[3]; 56 | # gff3 puts :\d in exons sometimes 57 | $id =~ s/:\d+$// if $gff == 3; 58 | push @{$exons{$id}}, \@f; 59 | # save lowest start 60 | $trans{$id} = \@f if !$trans{$id}; 61 | } elsif ($f[2] eq 'start_codon') { 62 | #optional, output codon start/stop as "thick" region in bed 63 | $sc{$id}->[0] = $f[3]; 64 | } elsif ($f[2] eq 'stop_codon') { 65 | $sc{$id}->[1] = $f[4]; 66 | } elsif ($f[2] eq 'miRNA' ) { 67 | $trans{$id} = \@f if !$trans{$id}; 68 | push @{$exons{$id}}, \@f; 69 | } 70 | } 71 | 72 | for $id ( 73 | # sort by chr then pos 74 | sort { 75 | $trans{$a}->[0] eq $trans{$b}->[0] ? 76 | $trans{$a}->[3] <=> $trans{$b}->[3] : 77 | $trans{$a}->[0] cmp $trans{$b}->[0] 78 | } (keys(%trans)) ) { 79 | my ($chr, undef, undef, undef, undef, undef, $dir, undef, $attr, undef, $cds, $cde) = @{$trans{$id}}; 80 | my ($cds, $cde); 81 | ($cds, $cde) = @{$sc{$id}} if $sc{$id}; 82 | 83 | # sort by pos 84 | my @ex = sort { 85 | $a->[3] <=> $b->[3] 86 | } @{$exons{$id}}; 87 | 88 | my $beg = $ex[0][3]; 89 | my $end = $ex[-1][4]; 90 | 91 | if ($dir eq '-') { 92 | # swap 93 | $tmp=$cds; 94 | $cds=$cde; 95 | $cde=$tmp; 96 | $cds -= 2 if $cds; 97 | $cde += 2 if $cde; 98 | } 99 | 100 | # not specified, just use exons 101 | $cds = $beg if !$cds; 102 | $cde = $end if !$cde; 103 | 104 | # adjust start for bed 105 | --$beg; --$cds; 106 | 107 | my $exn = @ex; # exon count 108 | my $exst = join ",", map {$_->[3]-$beg-1} @ex; # exon start 109 | my $exsz = join ",", map {$_->[4]-$_->[3]+1} @ex; # exon size 110 | 111 | my $gene_id; 112 | my $extend = ""; 113 | if ($extended) { 114 | ($gene_id) = $attr =~ /gene_name "([^"]+)"/; 115 | ($gene_id) = $attr =~ /gene_id "([^"]+)"/ unless $gene_id; 116 | $extend="\t$gene_id"; 117 | } 118 | # added an extra comma to make it look exactly like ucsc's beds 119 | print "$chr\t$beg\t$end\t$id\t0\t$dir\t$cds\t$cde\t0\t$exn\t$exsz,\t$exst,$extend\n"; 120 | } 121 | 122 | 123 | close IN; 124 | -------------------------------------------------------------------------------- /bin/run_bambu.r: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | 3 | ################################################ 4 | ################################################ 5 | ## REQUIREMENTS ## 6 | ################################################ 7 | ################################################ 8 | 9 | ## TRANSCRIPT ISOFORM DISCOVERY AND QUANTIFICATION 10 | ## - ALIGNED READS IN BAM FILE FORMAT 11 | ## - GENOME SEQUENCE 12 | ## - ANNOTATION GTF FILE 13 | ## - THE PACKAGE BELOW NEEDS TO BE AVAILABLE TO LOAD WHEN RUNNING R 14 | 15 | ################################################ 16 | ################################################ 17 | ## LOAD LIBRARY ## 18 | ################################################ 19 | ################################################ 20 | library(bambu) 21 | 22 | ################################################ 23 | ################################################ 24 | ## PARSE COMMAND-LINE PARAMETERS ## 25 | ################################################ 26 | ################################################ 27 | args = commandArgs(trailingOnly=TRUE) 28 | 29 | output_tag <- strsplit(grep('--tag*', args, value = TRUE), split = '=')[[1]][[2]] 30 | ncore <- strsplit(grep('--ncore*', args, value = TRUE), split = '=')[[1]][[2]] 31 | genomeseq <- strsplit(grep('--fasta*', args, value = TRUE), split = '=')[[1]][[2]] 32 | genomeSequence <- Rsamtools::FaFile(genomeseq) 33 | Rsamtools::indexFa(genomeseq) 34 | annot_gtf <- strsplit(grep('--annotation*', args, value = TRUE), split = '=')[[1]][[2]] 35 | readlist <- args[5:length(args)] 36 | 37 | ################################################ 38 | ################################################ 39 | ## RUN BAMBU ## 40 | ################################################ 41 | ################################################ 42 | grlist <- prepareAnnotations(annot_gtf) 43 | se <- bambu(reads = readlist, annotations = grlist, genome = genomeSequence, ncore = ncore, verbose = TRUE) 44 | writeBambuOutput(se, output_tag) 45 | -------------------------------------------------------------------------------- /bin/run_deseq2.r: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | 3 | ################################################ 4 | ################################################ 5 | ## REQUIREMENTS ## 6 | ################################################ 7 | ################################################ 8 | 9 | ## DIFFERENTIAL GENE EXPRESSION ANALYSIS 10 | ## - GENE COUNT QUANTIFICATION INPUTS FROM EITHER STRINGTIE2+FEATURECOUNTS OR BAMBU 11 | ## - SAMPLE INFORMATION INCLUDING CONDITIONS 12 | ## - THE PACKAGE BELOW NEEDS TO BE AVAILABLE TO LOAD WHEN RUNNING R 13 | 14 | ################################################ 15 | ################################################ 16 | ## LOAD LIBRARY ## 17 | ################################################ 18 | ################################################ 19 | 20 | library(DESeq2) 21 | 22 | ################################################ 23 | ################################################ 24 | ## PARSE COMMAND-LINE PARAMETERS ## 25 | ################################################ 26 | ################################################ 27 | args = commandArgs(trailingOnly=TRUE) 28 | if (length(args) < 2) { 29 | stop("Please input the directory with the featureCounts results and the sample information file", call.=FALSE) 30 | } 31 | # default output file 32 | outfile <- "deseq2.results.txt" 33 | 34 | transcriptquant <- args[1] 35 | path <-args[2] 36 | 37 | ################################################ 38 | ################################################ 39 | ## FORMAT GENE COUNT QUANTIFICATION OUTPUT ## 40 | ################################################ 41 | ################################################ 42 | 43 | #create a dataframe for all samples 44 | if (transcriptquant == "stringtie2"){ 45 | count.matrix <- data.frame(read.table(path, sep="\t", header=TRUE, skip = 1)) 46 | count.matrix$Chr <- count.matrix$Start <- count.matrix$End <- count.matrix$Length <- count.matrix$Strand <- NULL 47 | colnames(count.matrix)[2:length(colnames(count.matrix))] <- unlist(lapply(strsplit(colnames(count.matrix)[2:length(colnames(count.matrix))], "\\."), "[[", 1)) 48 | count.matrix <- aggregate(count.matrix[, -1],count.matrix["Geneid"],sum) 49 | countTab <- count.matrix[, -1] 50 | rownames(countTab) <-count.matrix[, 1] 51 | } 52 | if (transcriptquant == "bambu"){ 53 | countTab <- data.frame(read.table(path, sep="\t", header=TRUE, row.names = 1)) 54 | colnames(countTab) <- unlist(lapply(strsplit(colnames(countTab), "\\."), "[[", 1)) 55 | countTab[, 1:length(colnames(countTab))] <- sapply(countTab, as.integer) 56 | } 57 | 58 | 59 | ################################################ 60 | ################################################ 61 | ## READ IN SAMPLE INFORMATION (CONDITIONS) ## 62 | ################################################ 63 | ################################################ 64 | 65 | sample <- colnames(countTab) 66 | group <- sub("(^[^-]+)_.*", "\\1", sample) 67 | sampInfo <- data.frame(group, row.names = sample) 68 | if (!all(rownames(sampInfo) == colnames(countTab))){ 69 | sampInfo <- sampInfo[match(colnames(countTab), rownames(sampInfo)), ] 70 | } 71 | 72 | ################################################ 73 | ################################################ 74 | ## RUN DESEQ2 ## 75 | ################################################ 76 | ################################################ 77 | 78 | dds <- DESeqDataSetFromMatrix(countData = countTab, colData = sampInfo, design = ~ group) 79 | dds <- DESeq(dds) 80 | res <- results(dds) 81 | resOrdered <- res[order(res$pvalue),] 82 | write.csv(as.data.frame(resOrdered), file=outfile) 83 | -------------------------------------------------------------------------------- /bin/run_dexseq.r: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | 3 | ################################################ 4 | ################################################ 5 | ## REQUIREMENTS ## 6 | ################################################ 7 | ################################################ 8 | 9 | ## DIFFERENTIAL TRANSCRIPT EXPRESSION ANALYSIS 10 | ## - TRANSCRIPT COUNT QUANTIFICATION INPUTS FROM EITHER STRINGTIE2+FEATURECOUNTS OR BAMBU 11 | ## - SAMPLE INFORMATION INCLUDING CONDITIONS 12 | 13 | ################################################ 14 | ################################################ 15 | ## LOAD LIBRARIES ## 16 | ################################################ 17 | ################################################ 18 | 19 | library(DRIMSeq) 20 | library(DEXSeq) 21 | library(stageR) 22 | 23 | ################################################ 24 | ################################################ 25 | ## PARSE COMMAND-LINE PARAMETERS ## 26 | ################################################ 27 | ################################################ 28 | 29 | args = commandArgs(trailingOnly=TRUE) 30 | if (length(args) < 2) { 31 | stop("Please input the directory with the transcript level featureCounts results and the sample information file", call.=FALSE) 32 | } 33 | transcriptquant <- args[1] 34 | path <- args[2] 35 | 36 | ################################################### 37 | ################################################### 38 | ## FORMAT TRANSCRIPT COUNT QUANTIFICATION OUTPUT ## 39 | ################################################### 40 | ################################################### 41 | 42 | if (transcriptquant == "stringtie2"){ 43 | count.matrix <- data.frame(read.table(path,sep="\t",header=TRUE, skip = 1)) 44 | count.matrix$Chr <- count.matrix$Start <- count.matrix$End <- count.matrix$Length <- count.matrix$Strand <- NULL 45 | colnames(count.matrix)[2:length(colnames(count.matrix))] <- unlist(lapply(strsplit(colnames(count.matrix)[2:length(colnames(count.matrix))],"\\."),"[[",1)) 46 | } 47 | 48 | if (transcriptquant == "bambu"){ 49 | count.matrix <- data.frame(read.table(path,sep="\t",header=T)) 50 | colnames(count.matrix) <- unlist(lapply(strsplit(colnames(count.matrix),"\\."),"[[",1)) 51 | } 52 | colnames(count.matrix)[1] <- "feature_id" 53 | colnames(count.matrix)[2] <- "gene_id" 54 | 55 | ################################################ 56 | ################################################ 57 | ## READ IN SAMPLE INFORMATION (CONDITIONS) ## 58 | ################################################ 59 | ################################################ 60 | sample_id <- colnames(count.matrix[,3:length(count.matrix)]) 61 | condition <- sub("(^[^-]+)_.*", "\\1", sample_id) 62 | sampleinfo<-data.frame(sample_id, condition) 63 | condition_names <- sampleinfo[!duplicated(sampleinfo$condition),]$condition 64 | lgcolName <- "log2fold" 65 | for (i in length(condition_names):1){ 66 | lgcolName <- paste(lgcolName,condition_names[i],sep='_') 67 | } 68 | 69 | ################################################ 70 | ################################################ 71 | ## FILTERING ## 72 | ################################################ 73 | ################################################ 74 | 75 | cat(paste(sampleinfo$sample_id, collapse = " ")) 76 | cat(paste(colnames(count.matrix), collapse = " ")) 77 | d <- dmDSdata(counts=count.matrix, samples=sampleinfo) 78 | # include genes expressed in minimal min_samps_gene_expr samples with min_gene_expr 79 | # include transcripts expressed in min_samps_feature_expr samples with min_feature_expr; 80 | # include transcripts expressed in min_samps_feature_prop samples with min_feature_prop; 81 | n_samp_gene <- length(sampleinfo$sample_id)/2 82 | n_samp_feature <- length(sampleinfo$sample_id)/2 83 | min_count_gene <- 5 84 | min_count_feature <- 5 85 | dFilter <- dmFilter(d, 86 | min_samps_feature_expr = n_samp_feature, 87 | min_samps_feature_prop = n_samp_feature, 88 | min_samps_gene_expr = n_samp_gene, 89 | min_feature_expr = min_count_feature, 90 | min_gene_expr = min_count_gene, 91 | min_feature_prop=0.1) 92 | 93 | ################################################ 94 | ################################################ 95 | ## RUN DEXSEQ ## 96 | ################################################ 97 | ################################################ 98 | 99 | formulaFullModel <- as.formula("~sample + exon + condition:exon") 100 | dxd <- DEXSeqDataSet(countData=round(as.matrix(counts(dFilter)[,-c(1:2)])), 101 | sampleData=DRIMSeq::samples(dFilter), 102 | design=formulaFullModel, 103 | featureID = counts(dFilter)$feature_id, 104 | groupID=counts(dFilter)$gene_id) 105 | 106 | dxd <- estimateSizeFactors(dxd) 107 | print('Size factor estimated') 108 | dxd <- estimateDispersions(dxd, formula = formulaFullModel) 109 | print('Dispersion estimated') 110 | dxd <- testForDEU(dxd, fullModel = formulaFullModel) 111 | print('DEU tested') 112 | dxd <- estimateExonFoldChanges(dxd) 113 | print('Exon fold changes estimated') 114 | 115 | # Extract DEXSeq results 116 | dxr <- DEXSeqResults(dxd, independentFiltering=FALSE) 117 | 118 | ### Pinpoint genes with transcripts differentially used ### 119 | ##### and transcripts that are differentially used ######## 120 | strp <- function(x) substr(x,1,15) 121 | qval <- perGeneQValue(dxr) 122 | dxr.g <- data.frame(gene=names(qval),qval) 123 | 124 | columns <- c("featureID","groupID","pvalue",lgcolName) 125 | dxr_pval <- as.data.frame(dxr[,columns]) 126 | #head(dxr_pval) 127 | pConfirmation <- matrix(dxr_pval$pvalue,ncol=1) 128 | dimnames(pConfirmation) <- list(strp(dxr_pval$featureID),"transcript") 129 | pScreen <- qval 130 | names(pScreen) <- strp(names(pScreen)) 131 | tx2gene <- as.data.frame(dxr_pval[,c("featureID", "groupID")]) 132 | for (i in 1:2) tx2gene[,i] <- strp(tx2gene[,i]) 133 | 134 | stageRObj <- stageRTx(pScreen=pScreen, pConfirmation=pConfirmation, 135 | pScreenAdjusted=TRUE, tx2gene=tx2gene) 136 | stageRObj <- stageWiseAdjustment(stageRObj, method="dtu", alpha=0.05) 137 | suppressWarnings({ 138 | dex.padj <- getAdjustedPValues(stageRObj, order=FALSE, 139 | onlySignificantGenes=FALSE) 140 | }) 141 | write.csv(cbind(dxr_pval,dex.padj$gene,dex.padj$transcript), file="dexseq.results.txt") 142 | -------------------------------------------------------------------------------- /conf/base.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | nf-core/nanoseq Nextflow base config file 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | A 'blank slate' config file, appropriate for general use on most high performance 6 | compute environments. Assumes that all software is installed and available on 7 | the PATH. Runs in `local` mode - all jobs will be run on the logged in environment. 8 | ---------------------------------------------------------------------------------------- 9 | */ 10 | 11 | if (params.deepvariant_gpu) { 12 | docker.runOptions = '--gpus all' 13 | singularity.runOptions = '--nv' 14 | } 15 | 16 | process { 17 | 18 | cpus = { check_max( 1 * task.attempt, 'cpus' ) } 19 | memory = { check_max( 7.GB * task.attempt, 'memory' ) } 20 | time = { check_max( 4.h * task.attempt, 'time' ) } 21 | 22 | errorStrategy = { task.exitStatus in [143,137,104,134,139] ? 'retry' : 'finish' } 23 | maxRetries = 1 24 | maxErrors = '-1' 25 | 26 | // Process-specific resource requirements 27 | // NOTE - Please try and re-use the labels below as much as possible. 28 | // These labels are used and recognised by default in DSL2 files hosted on nf-core/modules. 29 | // If possible, it would be nice to keep the same label naming convention when 30 | // adding in your local modules too. 31 | // TODO nf-core: Customise requirements for specific processes. 32 | // See https://www.nextflow.io/docs/latest/config.html#config-process-selectors 33 | withLabel:process_single { 34 | cpus = { check_max( 1 , 'cpus' ) } 35 | memory = { check_max( 6.GB * task.attempt, 'memory' ) } 36 | time = { check_max( 4.h * task.attempt, 'time' ) } 37 | } 38 | withLabel:process_low { 39 | cpus = { check_max( 2 * task.attempt, 'cpus' ) } 40 | memory = { check_max( 12.GB * task.attempt, 'memory' ) } 41 | time = { check_max( 4.h * task.attempt, 'time' ) } 42 | } 43 | withLabel:process_medium { 44 | cpus = { check_max( 6 * task.attempt, 'cpus' ) } 45 | memory = { check_max( 42.GB * task.attempt, 'memory' ) } 46 | time = { check_max( 8.h * task.attempt, 'time' ) } 47 | } 48 | withLabel:process_high { 49 | cpus = { check_max( 12 * task.attempt, 'cpus' ) } 50 | memory = { check_max( 84.GB * task.attempt, 'memory' ) } 51 | time = { check_max( 16.h * task.attempt, 'time' ) } 52 | } 53 | withLabel:process_long { 54 | time = { check_max( 20.h * task.attempt, 'time' ) } 55 | } 56 | withLabel:process_high_memory { 57 | memory = { check_max( 200.GB * task.attempt, 'memory' ) } 58 | } 59 | withLabel:error_ignore { 60 | errorStrategy = 'ignore' 61 | } 62 | withLabel:error_retry { 63 | errorStrategy = 'retry' 64 | maxRetries = 2 65 | } 66 | withName:CUSTOM_DUMPSOFTWAREVERSIONS { 67 | cache = false 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /conf/test.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/nanoseq -profile test_nobc_dx, 8 | */ 9 | 10 | params { 11 | config_profile_name = 'Test profile' 12 | config_profile_description = 'Minimal test dataset to check pipeline function' 13 | 14 | // Limit resources 15 | max_cpus = 2 16 | max_memory = 6.GB 17 | max_time = 12.h 18 | 19 | // Input data to perform demultipexing 20 | input = 'https://raw.githubusercontent.com/nf-core/test-datasets/nanoseq/3.0/samplesheet/samplesheet_nobc_dx.csv' 21 | protocol = 'DNA' 22 | barcode_kit = 'NBD103/NBD104' 23 | input_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/nanoseq/fastq/nondemultiplexed/sample_nobc_dx.fastq.gz' 24 | skip_quantification = true 25 | skip_bigwig = true 26 | skip_bigbed = true 27 | skip_fusion_analysis= true 28 | skip_modification_analysis=true 29 | 30 | } 31 | -------------------------------------------------------------------------------- /conf/test_full.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | Nextflow config file for running full-size tests 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | Defines input files and everything required to run a full size pipeline test. 6 | 7 | Use as follows: 8 | nextflow run nf-core/nanoseq -profile test_full, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'Full test profile' 15 | config_profile_description = 'Full test dataset to check pipeline function' 16 | 17 | // Input data for full size test 18 | input = 'https://raw.githubusercontent.com/nf-core/test-datasets/nanoseq/3.0/samplesheet/samplesheet_full.csv' 19 | protocol = 'cDNA' 20 | skip_demultiplexing = true 21 | skip_fusion_analysis= true 22 | skip_modification_analysis=true 23 | } 24 | -------------------------------------------------------------------------------- /conf/test_nodx_noaln.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/nanoseq -profile test_nobc_nodx_noaln, 8 | */ 9 | 10 | params { 11 | config_profile_name = 'Test profile' 12 | config_profile_description = 'Minimal test dataset to check pipeline function' 13 | 14 | // Limit resources so that this can run on Travis 15 | max_cpus = 2 16 | max_memory = 6.5.GB 17 | max_time = 12.h 18 | 19 | // Input data to skip demultiplexing and alignment 20 | input = 'https://raw.githubusercontent.com/nf-core/test-datasets/nanoseq/3.0/samplesheet/samplesheet_nobc_nodx_noaln.csv' 21 | protocol = 'directRNA' 22 | skip_demultiplexing = true 23 | skip_alignment = true 24 | skip_fusion_analysis = true 25 | skip_modification_analysis=true 26 | } 27 | -------------------------------------------------------------------------------- /conf/test_nodx_rnamod.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/nanoseq -profile test_nobc_nodx, 8 | */ 9 | 10 | params { 11 | config_profile_name = 'Test profile' 12 | config_profile_description = 'Minimal test dataset to check pipeline function' 13 | 14 | // Limit resources so that this can run on Travis 15 | max_cpus = 2 16 | max_memory = 6.GB 17 | max_time = 12.h 18 | 19 | // Input data to skip demultiplexing and rna modification analysis 20 | input = 'https://raw.githubusercontent.com/nf-core/test-datasets/nanoseq/3.0/samplesheet/samplesheet_nobc_nodx_rnamod.csv' 21 | protocol = 'directRNA' 22 | skip_demultiplexing = true 23 | skip_quantification = true 24 | skip_fusion_analysis= true 25 | } 26 | 27 | -------------------------------------------------------------------------------- /conf/test_nodx_stringtie.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/nanoseq -profile test_nobc_nodx, 8 | */ 9 | 10 | params { 11 | config_profile_name = 'Test profile' 12 | config_profile_description = 'Minimal test dataset to check pipeline function' 13 | 14 | // Limit resources so that this can run on Travis 15 | max_cpus = 2 16 | max_memory = 6.GB 17 | max_time = 12.h 18 | 19 | // Input data to skip demultiplexing and stringtie 20 | input = 'https://raw.githubusercontent.com/nf-core/test-datasets/nanoseq/3.0/samplesheet/samplesheet_nobc_nodx_stringtie.csv' 21 | protocol = 'directRNA' 22 | skip_demultiplexing = true 23 | skip_fusion_analysis= true 24 | skip_modification_analysis=true 25 | quantification_method = 'stringtie2' 26 | } 27 | -------------------------------------------------------------------------------- /conf/test_nodx_vc.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/nanoseq -profile test_nobc_nodx_vc, 8 | */ 9 | 10 | params { 11 | config_profile_name = 'Test profile' 12 | config_profile_description = 'Minimal test dataset to check variant calling functions' 13 | 14 | // Limit resources so that this can run on Travis 15 | max_cpus = 2 16 | max_memory = 6.GB 17 | max_time = 12.h 18 | 19 | // Input data to skip demultiplexing and variant call 20 | input = 'https://raw.githubusercontent.com/nf-core/test-datasets/nanoseq/3.0/samplesheet/samplesheet_nobc_nodx_vc.csv' 21 | protocol = 'DNA' 22 | skip_quantification = true 23 | skip_demultiplexing = true 24 | call_variants = true 25 | 26 | variant_caller = 'medaka' 27 | structural_variant_caller = 'sniffles' 28 | } 29 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # nf-core/nanoseq: Documentation 2 | 3 | The nf-core/nanoseq documentation is split into the following pages: 4 | 5 | - [Usage](usage.md) 6 | - An overview of how the pipeline works, how to run it and a description of all of the different command-line flags. 7 | - [Output](output.md) 8 | - An overview of the different results produced by the pipeline and how to interpret them. 9 | 10 | You can find a lot more documentation about installing, configuring and running nf-core pipelines on the website: [https://nf-co.re](https://nf-co.re) 11 | -------------------------------------------------------------------------------- /docs/images/mqc_fastqc_adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/nanoseq/6e563e54362cddb8e48d15c156251708c22d0e8d/docs/images/mqc_fastqc_adapter.png -------------------------------------------------------------------------------- /docs/images/mqc_fastqc_counts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/nanoseq/6e563e54362cddb8e48d15c156251708c22d0e8d/docs/images/mqc_fastqc_counts.png -------------------------------------------------------------------------------- /docs/images/mqc_fastqc_quality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/nanoseq/6e563e54362cddb8e48d15c156251708c22d0e8d/docs/images/mqc_fastqc_quality.png -------------------------------------------------------------------------------- /docs/images/mqc_samtools_stats_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/nanoseq/6e563e54362cddb8e48d15c156251708c22d0e8d/docs/images/mqc_samtools_stats_plot.png -------------------------------------------------------------------------------- /docs/images/nanoplot_readlengthquality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/nanoseq/6e563e54362cddb8e48d15c156251708c22d0e8d/docs/images/nanoplot_readlengthquality.png -------------------------------------------------------------------------------- /docs/images/nanoseq_subwaymap_v3.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/nanoseq/6e563e54362cddb8e48d15c156251708c22d0e8d/docs/images/nanoseq_subwaymap_v3.1.png -------------------------------------------------------------------------------- /docs/images/nf-core-nanoseq_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/nanoseq/6e563e54362cddb8e48d15c156251708c22d0e8d/docs/images/nf-core-nanoseq_logo_dark.png -------------------------------------------------------------------------------- /docs/images/nf-core-nanoseq_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/nanoseq/6e563e54362cddb8e48d15c156251708c22d0e8d/docs/images/nf-core-nanoseq_logo_light.png -------------------------------------------------------------------------------- /lib/Utils.groovy: -------------------------------------------------------------------------------- 1 | // 2 | // This file holds several Groovy functions that could be useful for any Nextflow pipeline 3 | // 4 | 5 | import org.yaml.snakeyaml.Yaml 6 | 7 | class Utils { 8 | 9 | // 10 | // When running with -profile conda, warn if channels have not been set-up appropriately 11 | // 12 | public static void checkCondaChannels(log) { 13 | Yaml parser = new Yaml() 14 | def channels = [] 15 | try { 16 | def config = parser.load("conda config --show channels".execute().text) 17 | channels = config.channels 18 | } catch(NullPointerException | IOException e) { 19 | log.warn "Could not verify conda channel configuration." 20 | return 21 | } 22 | 23 | // Check that all channels are present 24 | // This channel list is ordered by required channel priority. 25 | def required_channels_in_order = ['conda-forge', 'bioconda', 'defaults'] 26 | def channels_missing = ((required_channels_in_order as Set) - (channels as Set)) as Boolean 27 | 28 | // Check that they are in the right order 29 | def channel_priority_violation = false 30 | def n = required_channels_in_order.size() 31 | for (int i = 0; i < n - 1; i++) { 32 | channel_priority_violation |= !(channels.indexOf(required_channels_in_order[i]) < channels.indexOf(required_channels_in_order[i+1])) 33 | } 34 | 35 | if (channels_missing | channel_priority_violation) { 36 | log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + 37 | " There is a problem with your Conda configuration!\n\n" + 38 | " You will need to set-up the conda-forge and bioconda channels correctly.\n" + 39 | " Please refer to https://bioconda.github.io/\n" + 40 | " The observed channel order is \n" + 41 | " ${channels}\n" + 42 | " but the following channel order is required:\n" + 43 | " ${required_channels_in_order}\n" + 44 | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 45 | } 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /lib/WorkflowMain.groovy: -------------------------------------------------------------------------------- 1 | // 2 | // This file holds several functions specific to the main.nf workflow in the nf-core/nanoseq pipeline 3 | // 4 | 5 | class WorkflowMain { 6 | 7 | // 8 | // Citation string for pipeline 9 | // 10 | public static String citation(workflow) { 11 | return "If you use ${workflow.manifest.name} for your analysis please cite:\n\n" + 12 | "* The pipeline\n" + 13 | " https://doi.org/10.5281/zenodo.5740870\n\n" + 14 | "* The nf-core framework\n" + 15 | " https://doi.org/10.1038/s41587-020-0439-x\n\n" + 16 | "* Software dependencies\n" + 17 | " https://github.com/${workflow.manifest.name}/blob/master/CITATIONS.md" 18 | } 19 | 20 | // 21 | // Generate help string 22 | // 23 | public static String help(workflow, params, log) { 24 | def command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --genome GRCh37 -profile docker" 25 | def help_string = '' 26 | help_string += NfcoreTemplate.logo(workflow, params.monochrome_logs) 27 | help_string += NfcoreSchema.paramsHelp(workflow, params, command) 28 | help_string += '\n' + citation(workflow) + '\n' 29 | help_string += NfcoreTemplate.dashedLine(params.monochrome_logs) 30 | return help_string 31 | } 32 | 33 | // 34 | // Generate parameter summary log string 35 | // 36 | public static String paramsSummaryLog(workflow, params, log) { 37 | def summary_log = '' 38 | summary_log += NfcoreTemplate.logo(workflow, params.monochrome_logs) 39 | summary_log += NfcoreSchema.paramsSummaryLog(workflow, params) 40 | summary_log += '\n' + citation(workflow) + '\n' 41 | summary_log += NfcoreTemplate.dashedLine(params.monochrome_logs) 42 | return summary_log 43 | } 44 | 45 | // 46 | // Validate parameters and print summary to screen 47 | // 48 | public static void initialise(workflow, params, log) { 49 | // Print help to screen if required 50 | if (params.help) { 51 | log.info help(workflow, params, log) 52 | System.exit(0) 53 | } 54 | 55 | // Print workflow version and exit on --version 56 | if (params.version) { 57 | String workflow_version = NfcoreTemplate.version(workflow) 58 | log.info "${workflow.manifest.name} ${workflow_version}" 59 | System.exit(0) 60 | } 61 | 62 | // Print parameter summary log to screen 63 | log.info paramsSummaryLog(workflow, params, log) 64 | 65 | // Validate workflow parameters via the JSON schema 66 | if (params.validate_params) { 67 | NfcoreSchema.validateParameters(workflow, params, log) 68 | } 69 | 70 | // Check that a -profile or Nextflow config has been provided to run the pipeline 71 | NfcoreTemplate.checkConfigProvided(workflow, log) 72 | 73 | // Check that conda channels are set-up correctly 74 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 75 | Utils.checkCondaChannels(log) 76 | } 77 | 78 | // Check AWS batch settings 79 | NfcoreTemplate.awsBatch(workflow, params) 80 | 81 | // Check input has been provided 82 | if (!params.input) { 83 | log.error "Please provide an input samplesheet to the pipeline e.g. '--input samplesheet.csv'" 84 | System.exit(1) 85 | } 86 | } 87 | // 88 | // Get attribute from genome config file e.g. fasta 89 | // 90 | public static Object getGenomeAttribute(params, attribute) { 91 | if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) { 92 | if (params.genomes[ params.genome ].containsKey(attribute)) { 93 | return params.genomes[ params.genome ][ attribute ] 94 | } 95 | } 96 | return null 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /lib/WorkflowNanoseq.groovy: -------------------------------------------------------------------------------- 1 | // 2 | // This file holds several functions specific to the workflow/nanoseq.nf in the nf-core/nanoseq pipeline 3 | // 4 | 5 | import groovy.text.SimpleTemplateEngine 6 | 7 | class WorkflowNanoseq { 8 | 9 | // 10 | // Check and validate parameters 11 | // 12 | public static void initialise(params, log) { 13 | genomeExistsError(params, log) 14 | 15 | 16 | if (!params.fasta) { 17 | log.error "Genome fasta file not specified with e.g. '--fasta genome.fa' or via a detectable config file." 18 | System.exit(1) 19 | } 20 | } 21 | 22 | // 23 | // Get workflow summary for MultiQC 24 | // 25 | public static String paramsSummaryMultiqc(workflow, summary) { 26 | String summary_section = '' 27 | for (group in summary.keySet()) { 28 | def group_params = summary.get(group) // This gets the parameters of that particular group 29 | if (group_params) { 30 | summary_section += "

$group

\n" 31 | summary_section += "
\n" 32 | for (param in group_params.keySet()) { 33 | summary_section += "
$param
${group_params.get(param) ?: 'N/A'}
\n" 34 | } 35 | summary_section += "
\n" 36 | } 37 | } 38 | 39 | String yaml_file_text = "id: '${workflow.manifest.name.replace('/','-')}-summary'\n" 40 | yaml_file_text += "description: ' - this information is collected when the pipeline is started.'\n" 41 | yaml_file_text += "section_name: '${workflow.manifest.name} Workflow Summary'\n" 42 | yaml_file_text += "section_href: 'https://github.com/${workflow.manifest.name}'\n" 43 | yaml_file_text += "plot_type: 'html'\n" 44 | yaml_file_text += "data: |\n" 45 | yaml_file_text += "${summary_section}" 46 | return yaml_file_text 47 | } 48 | 49 | public static String methodsDescriptionText(run_workflow, mqc_methods_yaml) { 50 | // Convert to a named map so can be used as with familar NXF ${workflow} variable syntax in the MultiQC YML file 51 | def meta = [:] 52 | meta.workflow = run_workflow.toMap() 53 | meta["manifest_map"] = run_workflow.manifest.toMap() 54 | 55 | meta["doi_text"] = meta.manifest_map.doi ? "(doi: ${meta.manifest_map.doi})" : "" 56 | 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.
  • " 57 | 58 | def methods_text = mqc_methods_yaml.text 59 | 60 | def engine = new SimpleTemplateEngine() 61 | def description_html = engine.createTemplate(methods_text).make(meta) 62 | 63 | return description_html 64 | }// 65 | // Exit pipeline if incorrect --genome key provided 66 | // 67 | private static void genomeExistsError(params, log) { 68 | if (params.genomes && params.genome && !params.genomes.containsKey(params.genome)) { 69 | log.error "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + 70 | " Genome '${params.genome}' not found in any config files provided to the pipeline.\n" + 71 | " Currently, the available genome keys are:\n" + 72 | " ${params.genomes.keySet().join(", ")}\n" + 73 | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 74 | System.exit(1) 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/nfcore_external_java_deps.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/nanoseq/6e563e54362cddb8e48d15c156251708c22d0e8d/lib/nfcore_external_java_deps.jar -------------------------------------------------------------------------------- /main.nf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env nextflow 2 | /* 3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | nf-core/nanoseq 5 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 | Github : https://github.com/nf-core/nanoseq 7 | 8 | Website: https://nf-co.re/nanoseq 9 | Slack : https://nfcore.slack.com/channels/nanoseq 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | nextflow.enable.dsl = 2 14 | 15 | /* 16 | ======================================================================================== 17 | VALIDATE & PRINT PARAMETER SUMMARY 18 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 19 | */ 20 | 21 | WorkflowMain.initialise(workflow, params, log) 22 | 23 | /* 24 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 | NAMED WORKFLOW FOR PIPELINE 26 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 | */ 28 | 29 | include { NANOSEQ } from './workflows/nanoseq' 30 | 31 | // 32 | // WORKFLOW: Run main nf-core/nanoseq analysis pipeline 33 | // 34 | workflow NFCORE_NANOSEQ { 35 | NANOSEQ () 36 | } 37 | 38 | /* 39 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | RUN ALL WORKFLOWS 41 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 42 | */ 43 | 44 | // 45 | // WORKFLOW: Execute a single named workflow for the pipeline 46 | // See: https://github.com/nf-core/rnaseq/issues/619 47 | // 48 | workflow { 49 | NFCORE_NANOSEQ () 50 | } 51 | 52 | /* 53 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | THE END 55 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | */ 57 | -------------------------------------------------------------------------------- /modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nf-core/nanoseq", 3 | "homePage": "https://github.com/nf-core/nanoseq", 4 | "repos": { 5 | "https://github.com/nf-core/modules.git": { 6 | "modules": { 7 | "nf-core": { 8 | "bcftools/sort": { 9 | "branch": "master", 10 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 11 | "installed_by": ["modules"] 12 | }, 13 | "custom/dumpsoftwareversions": { 14 | "branch": "master", 15 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 16 | "installed_by": ["modules"] 17 | }, 18 | "fastqc": { 19 | "branch": "master", 20 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 21 | "installed_by": ["modules"] 22 | }, 23 | "multiqc": { 24 | "branch": "master", 25 | "git_sha": "ee80d14721e76e2e079103b8dcd5d57129e584ba", 26 | "installed_by": ["modules"] 27 | }, 28 | "nanolyse": { 29 | "branch": "master", 30 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 31 | "installed_by": ["modules"] 32 | }, 33 | "nanoplot": { 34 | "branch": "master", 35 | "git_sha": "3822e04e49b6d89b7092feb3480d744cb5d9986b", 36 | "installed_by": ["modules"] 37 | }, 38 | "samtools/faidx": { 39 | "branch": "master", 40 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 41 | "installed_by": ["modules"] 42 | }, 43 | "samtools/flagstat": { 44 | "branch": "master", 45 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 46 | "installed_by": ["modules"] 47 | }, 48 | "samtools/idxstats": { 49 | "branch": "master", 50 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 51 | "installed_by": ["modules"] 52 | }, 53 | "samtools/index": { 54 | "branch": "master", 55 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 56 | "installed_by": ["modules"] 57 | }, 58 | "samtools/sort": { 59 | "branch": "master", 60 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 61 | "installed_by": ["modules"] 62 | }, 63 | "samtools/stats": { 64 | "branch": "master", 65 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 66 | "installed_by": ["modules"] 67 | }, 68 | "stringtie/merge": { 69 | "branch": "master", 70 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 71 | "installed_by": ["modules"] 72 | }, 73 | "tabix/bgzip": { 74 | "branch": "master", 75 | "git_sha": "90294980a903ecebd99ac31d8b6c66af48fa8259", 76 | "installed_by": ["modules"] 77 | }, 78 | "tabix/bgziptabix": { 79 | "branch": "master", 80 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 81 | "installed_by": ["modules"] 82 | }, 83 | "tabix/tabix": { 84 | "branch": "master", 85 | "git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c", 86 | "installed_by": ["modules"] 87 | }, 88 | "untar": { 89 | "branch": "master", 90 | "git_sha": "cc1f997fab6d8fde5dc0e6e2a310814df5b53ce7", 91 | "installed_by": ["modules"] 92 | } 93 | } 94 | }, 95 | "subworkflows": { 96 | "nf-core": {} 97 | } 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /modules/local/bam_rename.nf: -------------------------------------------------------------------------------- 1 | process BAM_RENAME { 2 | label 'process_medium' 3 | tag "$meta.id" 4 | 5 | conda "conda-forge::sed=4.7" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/sed:4.7.0' : 8 | 'quay.io/biocontainers/sed:4.7.0' }" 9 | 10 | input: 11 | tuple val(meta), path(bam) 12 | 13 | output: 14 | tuple val(meta), path("*.bam"), emit: bam 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | """ 22 | [ ! -f ${meta.id}.bam ] && ln -s $bam ${meta.id}.bam 23 | 24 | cat <<-END_VERSIONS > versions.yml 25 | "${task.process}": 26 | sed: \$(sed --version 2>&1 | grep "sed (GNU sed)" | sed 's/^.*) //') 27 | END_VERSIONS 28 | """ 29 | } 30 | -------------------------------------------------------------------------------- /modules/local/bambu.nf: -------------------------------------------------------------------------------- 1 | process BAMBU { 2 | label 'process_medium' 3 | 4 | conda "conda-forge::r-base=4.0.3 bioconda::bioconductor-bambu=3.0.8 bioconda::bioconductor-bsgenome=1.66.0" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/bioconductor-bambu:3.0.8--r42hc247a5b_0' : 7 | 'quay.io/biocontainers/bioconductor-bambu:3.0.8--r42hc247a5b_0' }" 8 | 9 | input: 10 | tuple path(fasta), path(gtf) 11 | path bams 12 | 13 | output: 14 | path "counts_gene.txt" , emit: ch_gene_counts 15 | path "counts_transcript.txt" , emit: ch_transcript_counts 16 | path "extended_annotations.gtf", emit: extended_gtf 17 | path "versions.yml" , emit: versions 18 | 19 | when: 20 | task.ext.when == null || task.ext.when 21 | 22 | script: 23 | """ 24 | run_bambu.r \\ 25 | --tag=. \\ 26 | --ncore=$task.cpus \\ 27 | --annotation=$gtf \\ 28 | --fasta=$fasta $bams 29 | 30 | cat <<-END_VERSIONS > versions.yml 31 | "${task.process}": 32 | r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') 33 | bioconductor-bambu: \$(Rscript -e "library(bambu); cat(as.character(packageVersion('bambu')))") 34 | bioconductor-bsgenome: \$(Rscript -e "library(BSgenome); cat(as.character(packageVersion('BSgenome')))") 35 | END_VERSIONS 36 | """ 37 | } 38 | -------------------------------------------------------------------------------- /modules/local/bedtools_bamtobed.nf: -------------------------------------------------------------------------------- 1 | process BEDTOOLS_BAMBED { 2 | label 'process_medium' 3 | 4 | conda "bioconda::bedtools=2.29.2" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/bedtools:2.29.2--hc088bd4_0' : 7 | 'quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0' }" 8 | 9 | input: 10 | tuple val(meta), path(sizes), val(is_transcripts), path(bam), path(bai) 11 | 12 | output: 13 | tuple val(meta), path(sizes), path("*.bed12"), emit: bed12 14 | path "versions.yml" , emit: versions 15 | 16 | when: 17 | !params.skip_alignment && !params.skip_bigbed && (params.protocol == 'directRNA' || params.protocol == 'cDNA') 18 | 19 | script: 20 | """ 21 | bedtools \\ 22 | bamtobed \\ 23 | -bed12 \\ 24 | -cigar \\ 25 | -i ${bam[0]} \\ 26 | | bedtools sort > ${meta.id}.bed12 27 | cat <<-END_VERSIONS > versions.yml 28 | "${task.process}": 29 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 30 | END_VERSIONS 31 | """ 32 | } 33 | -------------------------------------------------------------------------------- /modules/local/bedtools_genomecov.nf: -------------------------------------------------------------------------------- 1 | process BEDTOOLS_GENOMECOV { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::bedtools=2.29.2" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bedtools:2.29.2--hc088bd4_0' : 8 | 'quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0' }" 9 | 10 | input: 11 | tuple val(meta), path(sizes), val(is_transcripts), path(bam), path(bai) 12 | 13 | output: 14 | tuple val(meta), path(sizes), path("*.bedGraph"), emit: bedgraph 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | split = (params.protocol == 'DNA' || is_transcripts) ? "" : "-split" 22 | """ 23 | bedtools \\ 24 | genomecov \\ 25 | -split \\ 26 | -ibam ${bam[0]} \\ 27 | -bg \\ 28 | | bedtools sort > ${meta.id}.bedGraph 29 | cat <<-END_VERSIONS > versions.yml 30 | "${task.process}": 31 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 32 | END_VERSIONS 33 | """ 34 | } 35 | -------------------------------------------------------------------------------- /modules/local/cutesv.nf: -------------------------------------------------------------------------------- 1 | process CUTESV { 2 | tag "$meta.id" 3 | label 'process_high' 4 | 5 | conda "bioconda::cutesv=1.0.12" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/cutesv:1.0.12--pyhdfd78af_0' : 8 | 'quay.io/biocontainers/cutesv:1.0.12--pyhdfd78af_0' }" 9 | 10 | input: 11 | tuple val(meta), path(sizes), val(is_transcripts), path(input), path(index) 12 | path(fasta) 13 | 14 | output: 15 | tuple val(meta), path("*_cuteSV.vcf"), emit: sv_calls // vcf files 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | """ 23 | cuteSV \ 24 | ${input} \ 25 | ${fasta} \ 26 | ${meta.id}_cuteSV.vcf \ 27 | . \ 28 | --threads $task.cpus \ 29 | --sample ${meta.id} \ 30 | --genotype 31 | 32 | cat <<-END_VERSIONS > versions.yml 33 | "${task.process}": 34 | cuteSV: \$( cuteSV --version 2>&1 | sed 's/cuteSV //g' ) 35 | END_VERSIONS 36 | """ 37 | } 38 | 39 | -------------------------------------------------------------------------------- /modules/local/deepvariant.nf: -------------------------------------------------------------------------------- 1 | process DEEPVARIANT { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | container "google/deepvariant:1.4.0" 6 | 7 | // Exit if running this module with -profile conda / -profile mamba 8 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 9 | exit 1, "DEEPVARIANT module does not support Conda. Please use Docker / Singularity / Podman instead." 10 | } 11 | 12 | input: 13 | tuple val(meta), path(sizes), val(is_transcripts), path(input), path(index) 14 | path(fasta) 15 | path(fai) 16 | 17 | output: 18 | tuple val(meta), path("${prefix}.vcf.gz") , emit: vcf 19 | tuple val(meta), path("${prefix}.g.vcf.gz"), emit: gvcf 20 | path "versions.yml" , emit: versions 21 | 22 | when: 23 | task.ext.when == null || task.ext.when 24 | 25 | script: 26 | def args = task.ext.args ?: '' 27 | prefix = task.ext.prefix ?: "${meta.id}" 28 | //def regions = intervals ? "--regions ${intervals}" : "" 29 | 30 | """ 31 | /opt/deepvariant/bin/run_deepvariant \\ 32 | --ref=${fasta} \\ 33 | --reads=${input} \\ 34 | --output_vcf=${prefix}.vcf.gz \\ 35 | --output_gvcf=${prefix}.g.vcf.gz \\ 36 | ${args} \\ 37 | --num_shards=${task.cpus} 38 | 39 | cat <<-END_VERSIONS > versions.yml 40 | "${task.process}": 41 | deepvariant: \$(echo \$(/opt/deepvariant/bin/run_deepvariant --version) | sed 's/^.*version //; s/ .*\$//' ) 42 | END_VERSIONS 43 | """ 44 | } 45 | -------------------------------------------------------------------------------- /modules/local/deseq2.nf: -------------------------------------------------------------------------------- 1 | process DESEQ2 { 2 | label "process_medium" 3 | 4 | conda "conda-forge::r-base=4.0.3 bioconda::bioconductor-deseq2=1.28.0" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/mulled-v2-8849acf39a43cdd6c839a369a74c0adc823e2f91:ab110436faf952a33575c64dd74615a84011450b-0' : 7 | 'quay.io/biocontainers/mulled-v2-8849acf39a43cdd6c839a369a74c0adc823e2f91:ab110436faf952a33575c64dd74615a84011450b-0' }" 8 | 9 | input: 10 | path counts 11 | 12 | output: 13 | path "*.txt" , emit: deseq2_txt 14 | path "versions.yml", emit: versions 15 | 16 | when: 17 | task.ext.when == null || task.ext.when 18 | 19 | script: 20 | """ 21 | run_deseq2.r $params.quantification_method $counts 22 | 23 | cat <<-END_VERSIONS > versions.yml 24 | "${task.process}": 25 | r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') 26 | bioconductor-deseq2: \$(Rscript -e "library(DESeq2); cat(as.character(packageVersion('DESeq2')))") 27 | END_VERSIONS 28 | """ 29 | } 30 | -------------------------------------------------------------------------------- /modules/local/dexseq.nf: -------------------------------------------------------------------------------- 1 | process DEXSEQ { 2 | label "process_medium" 3 | 4 | conda "conda-forge::r-base=4.0.2 bioconda::bioconductor-dexseq=1.36.0 bioconda::bioconductor-drimseq=1.18.0 bioconda::bioconductor-stager=1.12.0" 5 | container "docker.io/yuukiiwa/nanoseq:dexseq" 6 | // need a multitool container for r-base, dexseq, stager, drimseq and on quay hub 7 | 8 | input: 9 | path counts 10 | 11 | output: 12 | path "*.txt" , emit: dexseq_txt 13 | path "versions.yml" , emit: versions 14 | 15 | when: 16 | task.ext.when == null || task.ext.when 17 | 18 | script: 19 | """ 20 | run_dexseq.r $params.quantification_method $counts 21 | 22 | cat <<-END_VERSIONS > versions.yml 23 | "${task.process}": 24 | r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') 25 | bioconductor-dexseq: \$(Rscript -e "library(DEXSeq); cat(as.character(packageVersion('DEXSeq')))") 26 | bioconductor-drimseq: \$(Rscript -e "library(DRIMSeq); cat(as.character(packageVersion('DRIMSeq')))") 27 | bioconductor-stager: \$(Rscript -e "library(stageR); cat(as.character(packageVersion('stageR')))") 28 | END_VERSIONS 29 | """ 30 | } 31 | -------------------------------------------------------------------------------- /modules/local/get_chrom_sizes.nf: -------------------------------------------------------------------------------- 1 | process GET_CHROM_SIZES { 2 | tag "$fasta" 3 | label 'process_medium' 4 | 5 | conda "bioconda::samtools=1.10" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.13--h8c37831_0' : 8 | 'quay.io/biocontainers/samtools:1.13--h8c37831_0' }" 9 | 10 | input: 11 | tuple path(fasta), val(name) 12 | 13 | output: 14 | tuple path('*.sizes'), val(name), emit: sizes 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | """ 22 | samtools faidx $fasta 23 | cut -f 1,2 ${fasta}.fai > ${fasta}.sizes 24 | 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 28 | END_VERSIONS 29 | """ 30 | } 31 | -------------------------------------------------------------------------------- /modules/local/get_jaffal_ref.nf: -------------------------------------------------------------------------------- 1 | process GET_JAFFAL_REF { 2 | label "process_single" 3 | 4 | conda "conda-forge::sed=4.7" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : 7 | 'ubuntu:20.04' }" 8 | 9 | output: 10 | tuple val(null), path("for_jaffal.tar.gz"), emit: ch_jaffal_ref 11 | path "versions.yml" , emit: versions 12 | 13 | 14 | when: 15 | task.ext.when == null || task.ext.when 16 | 17 | script: 18 | """ 19 | curl \\ 20 | -L https://ndownloader.figshare.com/files/28168755 \\ 21 | -o for_jaffal.tar.gz 22 | 23 | cat <<-END_VERSIONS > versions.yml 24 | "${task.process}": 25 | curl: \$(curl --version | grep "curl" | sed "s/curl //; s/ .*\$//") 26 | END_VERSIONS 27 | """ 28 | } 29 | -------------------------------------------------------------------------------- /modules/local/get_nanolyse_fasta.nf: -------------------------------------------------------------------------------- 1 | process GET_NANOLYSE_FASTA { 2 | label "process_single" 3 | 4 | conda "conda-forge::sed=4.7" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : 7 | 'biocontainers/biocontainers:v1.2.0_cv1' }" 8 | 9 | output: 10 | path "*fasta.gz" , emit: ch_nanolyse_fasta 11 | path "versions.yml", emit: versions 12 | 13 | when: 14 | task.ext.when == null || task.ext.when 15 | 16 | script: 17 | """ 18 | curl \\ 19 | -L https://github.com/wdecoster/nanolyse/raw/master/reference/lambda.fasta.gz \\ 20 | -o lambda.fasta.gz 21 | 22 | cat <<-END_VERSIONS > versions.yml 23 | "${task.process}": 24 | curl: \$(echo \$(curl --version 2>&1) | grep "curl" | sed "s/curl //; s/ .*\$//") 25 | END_VERSIONS 26 | """ 27 | } 28 | -------------------------------------------------------------------------------- /modules/local/get_test_data.nf: -------------------------------------------------------------------------------- 1 | process GET_TEST_DATA { 2 | label "process_single" 3 | 4 | container "docker.io/yuukiiwa/git:latest" 5 | 6 | output: 7 | path "test-datasets/fast5/$barcoded/*" , emit: ch_input_fast5s_path 8 | path "test-datasets/modification_fast5_fastq/", emit: ch_input_dir_path 9 | path "versions.yml" , emit: versions 10 | 11 | when: 12 | task.ext.when == null || task.ext.when 13 | 14 | script: 15 | barcoded = (workflow.profile.contains('test_bc_nodx') || workflow.profile.contains('rnamod')) ? "nonbarcoded" : "barcoded" 16 | """ 17 | git clone https://github.com/nf-core/test-datasets.git --branch nanoseq --single-branch 18 | 19 | cat <<-END_VERSIONS > versions.yml 20 | "${task.process}": 21 | git: \$(echo \$(git --version | sed 's/git version //; s/ .*\$//') 22 | """ 23 | } 24 | -------------------------------------------------------------------------------- /modules/local/graphmap2_align.nf: -------------------------------------------------------------------------------- 1 | process GRAPHMAP2_ALIGN { 2 | tag "$meta.id" 3 | label 'process_high' 4 | 5 | conda "bioconda::graphmap=0.6.3" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/graphmap:0.6.3--he513fc3_0' : 8 | 'quay.io/biocontainers/graphmap:0.6.3--he513fc3_0' }" 9 | 10 | input: 11 | tuple val(meta), path(fastq), path(fasta), path(sizes), val(gtf), val(bed), val(is_transcripts), path(index) 12 | 13 | output: 14 | tuple val(meta), path(sizes), val(is_transcripts), path("*.sam"), emit: align_sam 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def preset = (params.protocol == 'DNA' || is_transcripts) ? "" : "-x rnaseq" 22 | def junctions = (params.protocol != 'DNA' && !is_transcripts && gtf) ? "--gtf $gtf" : "" 23 | """ 24 | graphmap2 \\ 25 | align \\ 26 | $preset \\ 27 | $junctions \\ 28 | -t $task.cpus \\ 29 | -r $fasta \\ 30 | -i $index \\ 31 | -d $fastq \\ 32 | -o ${meta.id}.sam \\ 33 | --extcigar 34 | 35 | cat <<-END_VERSIONS > versions.yml 36 | "${task.process}": 37 | graphmap2: \$(echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//') 38 | END_VERSIONS 39 | """ 40 | } 41 | -------------------------------------------------------------------------------- /modules/local/graphmap2_index.nf: -------------------------------------------------------------------------------- 1 | process GRAPHMAP2_INDEX { 2 | tag "$fasta" 3 | label 'process_high' 4 | 5 | conda "bioconda::graphmap=0.6.3" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/graphmap:0.6.3--he513fc3_0' : 8 | 'quay.io/biocontainers/graphmap:0.6.3--he513fc3_0' }" 9 | 10 | input: 11 | tuple path(fasta), path(sizes), val(gtf), val(bed), val(is_transcripts), val(annotation_str) 12 | 13 | output: 14 | tuple path(fasta), path(sizes), path(gtf), val(bed), val(is_transcripts), path("*.gmidx"), val(annotation_str), emit: index 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def preset = (params.protocol == 'DNA' || is_transcripts) ? "" : "-x rnaseq" 22 | def junctions = (params.protocol != 'DNA' && !is_transcripts && gtf) ? "--gtf $gtf" : "" 23 | """ 24 | graphmap2 \\ 25 | align \\ 26 | $preset \\ 27 | $junctions \\ 28 | -t $task.cpus \\ 29 | -I \\ 30 | -r $fasta 31 | 32 | cat <<-END_VERSIONS > versions.yml 33 | "${task.process}": 34 | graphmap2: \$(echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//') 35 | END_VERSIONS 36 | """ 37 | } 38 | -------------------------------------------------------------------------------- /modules/local/gtf2bed.nf: -------------------------------------------------------------------------------- 1 | process GTF2BED { 2 | label 'process_low' 3 | 4 | conda "conda-forge::perl=5.26.2" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/perl:5.26.2' : 7 | 'quay.io/biocontainers/perl:5.26.2' }" 8 | 9 | input: 10 | tuple path(gtf), val(name) 11 | 12 | output: 13 | tuple path('*.bed'), val(name), emit: gtf_bed 14 | path "versions.yml" , emit: versions 15 | 16 | when: 17 | task.ext.when == null || task.ext.when 18 | 19 | script: 20 | """ 21 | gtf2bed $gtf > ${gtf.baseName}.bed 22 | 23 | cat <<-END_VERSIONS > versions.yml 24 | "${task.process}": 25 | perl: \$(echo \$(perl --version 2>&1) | sed 's/.*v\\(.*\\)) built.*/\\1/') 26 | END_VERSIONS 27 | """ 28 | } 29 | -------------------------------------------------------------------------------- /modules/local/jaffal.nf: -------------------------------------------------------------------------------- 1 | process JAFFAL { 2 | echo true 3 | label 'process_medium' 4 | 5 | conda "bioconda::jaffa=2.3.0" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/jaffa:2.3--hdfd78af_0' : 8 | 'quay.io/biocontainers/jaffa:2.3--hdfd78af_0' }" 9 | 10 | input: 11 | tuple val(meta), path(fastq) 12 | path jaffal_ref_dir 13 | 14 | output: 15 | tuple val(meta), path("*.fasta"), emit: jaffal_fastq 16 | path "*.csv" , emit: jaffal_results 17 | path "versions.yml" , emit: versions 18 | 19 | when: 20 | task.ext.when == null || task.ext.when 21 | 22 | script: 23 | """ 24 | bpipe run -p refBase=$jaffal_ref_dir $jaffal_ref_dir/JAFFAL.groovy $fastq 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | jaffa: \$( echo 'jaffa 2.0' ) 29 | END_VERSIONS 30 | """ 31 | } 32 | -------------------------------------------------------------------------------- /modules/local/m6anet_dataprep.nf: -------------------------------------------------------------------------------- 1 | process M6ANET_DATAPREP { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | // conda (params.enable_conda ? "bioconda::nanopolish==0.13.2" : null) // need to get xpore onto conda 6 | container "docker.io/yuukiiwa/m6anet:1.0" 7 | 8 | input: 9 | tuple val(meta), path(genome), path(gtf), path(eventalign), path(nanopolish_summary) 10 | 11 | output: 12 | tuple val(meta), path("$meta.id"), emit: dataprep_outputs 13 | path "versions.yml" , emit: versions 14 | 15 | when: 16 | task.ext.when == null || task.ext.when 17 | 18 | script: 19 | """ 20 | m6anet-dataprep \\ 21 | --eventalign $eventalign \\ 22 | --out_dir $meta.id \\ 23 | --n_processes $task.cpus 24 | 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | m6anet: \$( echo 'm6anet 1.0' ) 28 | END_VERSIONS 29 | """ 30 | } 31 | -------------------------------------------------------------------------------- /modules/local/m6anet_inference.nf: -------------------------------------------------------------------------------- 1 | process M6ANET_INFERENCE { 2 | tag "$meta.id" 3 | echo true 4 | label 'process_medium' 5 | 6 | // conda (params.enable_conda ? "bioconda::nanopolish==0.13.2" : null) // need to get xpore onto conda 7 | container "docker.io/yuukiiwa/m6anet:1.0" 8 | 9 | input: 10 | tuple val(meta), path(input_dir) 11 | 12 | output: 13 | path "*" , emit: m6anet_outputs 14 | path "versions.yml", emit: versions 15 | 16 | when: 17 | task.ext.when == null || task.ext.when 18 | 19 | script: 20 | def out_dir = meta.id+"_results" 21 | """ 22 | m6anet-run_inference --input_dir $input_dir --out_dir $out_dir --batch_size 512 --n_processes $task.cpus --num_iterations 5 --device cpu 23 | 24 | cat <<-END_VERSIONS > versions.yml 25 | "${task.process}": 26 | m6anet: \$( echo 'm6anet 1.0' ) 27 | END_VERSIONS 28 | """ 29 | } 30 | -------------------------------------------------------------------------------- /modules/local/medaka_variant.nf: -------------------------------------------------------------------------------- 1 | process MEDAKA_VARIANT { 2 | tag "$meta.id" 3 | label 'process_high' 4 | 5 | conda "bioconda::medaka=1.4.4" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/medaka:1.4.4--py38h130def0_0' : 8 | 'quay.io/biocontainers/medaka:1.4.4--py38h130def0_0' }" 9 | 10 | input: 11 | tuple val(meta), path(sizes), val(is_transcripts), path(input), path(index) 12 | path(fasta) 13 | 14 | output: 15 | tuple val(meta), path ("$output_vcf"), emit: vcf // vcf files 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def split_mnps = params.split_mnps ? "-l" : '' 23 | def phase_vcf = params.phase_vcf ? "-p" : '' 24 | 25 | output_dir = "${meta.id}" 26 | output_vcf = output_dir+"/round_1.vcf" 27 | """ 28 | 29 | medaka_variant \\ 30 | -d \\ 31 | -f $fasta \\ 32 | -i $input \\ 33 | -o $output_dir \\ 34 | -t $task.cpus \\ 35 | $split_mnps \\ 36 | $phase_vcf 37 | 38 | cat <<-END_VERSIONS > versions.yml 39 | "${task.process}": 40 | medaka: \$( medaka --version 2>&1 | sed 's/medaka //g' ) 41 | END_VERSIONS 42 | """ 43 | } 44 | -------------------------------------------------------------------------------- /modules/local/minimap2_align.nf: -------------------------------------------------------------------------------- 1 | process MINIMAP2_ALIGN { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::minimap2=2.17" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/minimap2:2.17--hed695b0_3' : 8 | 'quay.io/biocontainers/minimap2:2.17--hed695b0_3' }" 9 | 10 | input: 11 | tuple val(meta), path(fastq), path(fasta), path(sizes), val(gtf), val(bed), val(is_transcripts), path(index) 12 | 13 | output: 14 | tuple val(meta), path(sizes), val(is_transcripts), path("*.sam"), emit: align_sam 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def preset = (params.protocol == 'DNA' || is_transcripts) ? "-ax map-ont" : "-ax splice" 22 | def kmer = (params.protocol == 'directRNA') ? "-k14" : "" 23 | def stranded = (params.stranded || params.protocol == 'directRNA') ? "-uf" : "" 24 | def junctions = (params.protocol != 'DNA' && bed) ? "--junc-bed ${file(bed)}" : "" 25 | def md = (params.call_variants && params.protocol == 'DNA') ? "--MD" : "" 26 | """ 27 | minimap2 \\ 28 | $preset \\ 29 | $kmer \\ 30 | $stranded \\ 31 | $junctions \\ 32 | $md \\ 33 | -t $task.cpus \\ 34 | $index \\ 35 | $fastq > ${meta.id}.sam 36 | 37 | cat <<-END_VERSIONS > versions.yml 38 | "${task.process}": 39 | minimap2: \$(minimap2 --version 2>&1) 40 | END_VERSIONS 41 | """ 42 | } 43 | -------------------------------------------------------------------------------- /modules/local/minimap2_index.nf: -------------------------------------------------------------------------------- 1 | process MINIMAP2_INDEX { 2 | tag "$fasta" 3 | label 'process_high' 4 | 5 | conda "bioconda::minimap2=2.17" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/minimap2:2.17--hed695b0_3' : 8 | 'quay.io/biocontainers/minimap2:2.17--hed695b0_3' }" 9 | 10 | input: 11 | tuple path(fasta), path(sizes), val(gtf), val(bed), val(is_transcripts), val(annotation_str) 12 | 13 | output: 14 | tuple path(fasta), path(sizes), val(gtf), val(bed), val(is_transcripts), path("*.mmi"), val(annotation_str), emit: index 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def preset = (params.protocol == 'DNA' || is_transcripts) ? "-ax map-ont" : "-ax splice" 22 | def kmer = (params.protocol == 'directRNA') ? "-k14" : "" 23 | def stranded = (params.stranded || params.protocol == 'directRNA') ? "-uf" : "" 24 | def junctions = (params.protocol != 'DNA' && bed) ? "--junc-bed ${file(bed)}" : "" 25 | """ 26 | minimap2 \\ 27 | $preset \\ 28 | $kmer \\ 29 | $stranded \\ 30 | $junctions \\ 31 | -t $task.cpus \\ 32 | -d ${fasta}.mmi \\ 33 | $fasta 34 | 35 | cat <<-END_VERSIONS > versions.yml 36 | "${task.process}": 37 | minimap2: \$(minimap2 --version 2>&1) 38 | END_VERSIONS 39 | """ 40 | } 41 | -------------------------------------------------------------------------------- /modules/local/multiqc.nf: -------------------------------------------------------------------------------- 1 | process MULTIQC { 2 | label 'process_medium' 3 | 4 | conda "bioconda::multiqc=1.11" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/multiqc:1.11--pyhdfd78af_0' : 7 | 'quay.io/biocontainers/multiqc:1.11--pyhdfd78af_0' }" 8 | 9 | input: 10 | path ch_multiqc_config 11 | path ch_multiqc_custom_config 12 | path ch_fastqc_multiqc 13 | path ch_sortbam_stats_multiqc 14 | path ch_featurecounts_gene_multiqc 15 | path ch_featurecounts_transcript_multiqc 16 | path software_versions_yaml 17 | path workflow_summary 18 | 19 | output: 20 | path "*multiqc_report.html", emit: report 21 | path "*_data" , emit: data 22 | path "*_plots" , optional:true, emit: plots 23 | path "versions.yml" , emit: versions 24 | 25 | when: 26 | task.ext.when == null || task.ext.when 27 | 28 | script: 29 | def args = task.ext.args ?: '' 30 | def custom_config = params.multiqc_config ? "--config $ch_multiqc_custom_config" : '' 31 | """ 32 | multiqc \\ 33 | -f \\ 34 | $args \\ 35 | $custom_config \\ 36 | . 37 | 38 | cat <<-END_VERSIONS > versions.yml 39 | "${task.process}": 40 | multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) 41 | END_VERSIONS 42 | """ 43 | } 44 | 45 | -------------------------------------------------------------------------------- /modules/local/nanopolish_index_eventalign.nf: -------------------------------------------------------------------------------- 1 | process NANOPOLISH_INDEX_EVENTALIGN { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::nanopolish==0.13.2" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/nanopolish:0.13.2--he3b7ca5_2' : 8 | 'quay.io/biocontainers/nanopolish:0.13.2--he3b7ca5_2' }" 9 | 10 | input: 11 | tuple val(meta), path(genome), path(gtf), path(fast5), path(fastq), path(bam), path(bai) 12 | 13 | output: 14 | tuple val(meta), path(genome), path(gtf), path("*eventalign.txt"), path("*summary.txt"), emit: nanopolish_outputs 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | sample_summary = "$meta.id" +"_summary.txt" 22 | sample_eventalign = "$meta.id" +"_eventalign.txt" 23 | """ 24 | nanopolish index -d $fast5 $fastq 25 | nanopolish eventalign --reads $fastq --bam $bam --genome $genome --scale-events --signal-index --summary $sample_summary --threads $task.cpus > $sample_eventalign 26 | 27 | cat <<-END_VERSIONS > versions.yml 28 | "${task.process}": 29 | nanopolish: \$( nanopolish --version | sed -e 's/nanopolish version //g' ) 30 | END_VERSIONS 31 | """ 32 | } 33 | -------------------------------------------------------------------------------- /modules/local/pepper_margin_deepvariant.nf: -------------------------------------------------------------------------------- 1 | process PEPPER_MARGIN_DEEPVARIANT { 2 | tag "$meta.id" 3 | label 'process_high' 4 | 5 | if (params.deepvariant_gpu) { 6 | container 'docker.io/kishwars/pepper_deepvariant:r0.8-gpu' 7 | } else { 8 | container 'docker.io/kishwars/pepper_deepvariant:r0.8' 9 | } 10 | 11 | input: 12 | tuple val(meta), path(sizes), val(is_transcripts), path(input), path(index) 13 | path(fasta) 14 | path(fai) 15 | 16 | output: 17 | tuple val(meta), path("*vcf.gz") , emit: vcf 18 | tuple val(meta), path("*vcf.gz.tbi"), emit: tbi 19 | path "versions.yml" , emit: versions 20 | 21 | when: 22 | task.ext.when == null || task.ext.when 23 | 24 | script: 25 | def args = task.ext.args ?: "" 26 | def gpu = params.deepvariant_gpu ? "-g" : "" 27 | prefix = task.ext.prefix ?: "${meta.id}" 28 | //def regions = intervals ? "--regions ${intervals}" : "" 29 | //def gvcf = params.make_gvcf ? "--gvcf" : "" 30 | 31 | """ 32 | mkdir -p "${prefix}" 33 | 34 | run_pepper_margin_deepvariant call_variant \\ 35 | -b "${input}" \\ 36 | -f "${fasta}" \\ 37 | -o "." \\ 38 | -p "${prefix}" \\ 39 | -t ${task.cpus} \\ 40 | $gpu \\ 41 | $args 42 | 43 | cat <<-END_VERSIONS > versions.yml 44 | "${task.process}": 45 | pepper_margin_deepvariant: \$(run_pepper_margin_deepvariant --version | sed 's/VERSION: //g') 46 | END_VERSIONS 47 | """ 48 | } 49 | -------------------------------------------------------------------------------- /modules/local/qcat.nf: -------------------------------------------------------------------------------- 1 | process QCAT { 2 | tag "$input_path" 3 | label 'process_medium' 4 | 5 | conda "bioconda::qcat=1.1.0" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/qcat:1.1.0--py_0' : 8 | 'quay.io/biocontainers/qcat:1.1.0--py_0' }" 9 | 10 | input: 11 | path input_path 12 | 13 | output: 14 | path "fastq/*.fastq.gz", emit: fastq 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def detect_middle = params.qcat_detect_middle ? "--detect-middle $params.qcat_detect_middle" : "" 22 | """ 23 | ## Unzip fastq file 24 | ## qcat doesnt support zipped files yet 25 | FILE=$input_path 26 | if [[ \$FILE == *.gz ]] 27 | then 28 | zcat $input_path > unzipped.fastq 29 | FILE=unzipped.fastq 30 | fi 31 | qcat \\ 32 | -f \$FILE \\ 33 | -b ./fastq \\ 34 | --kit $params.barcode_kit \\ 35 | --min-score $params.qcat_min_score \\ 36 | $detect_middle 37 | 38 | ## Zip fastq files (cannot find pigz command) 39 | gzip fastq/* 40 | 41 | cat <<-END_VERSIONS > versions.yml 42 | "${task.process}": 43 | qcat: \$(qcat --version 2>&1 | sed 's/^.*qcat //; s/ .*\$//') 44 | END_VERSIONS 45 | """ 46 | } 47 | -------------------------------------------------------------------------------- /modules/local/samplesheet_check.nf: -------------------------------------------------------------------------------- 1 | process SAMPLESHEET_CHECK { 2 | tag "$samplesheet" 3 | label 'process_single' 4 | 5 | conda "conda-forge::python=3.8.3" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/python:3.8.3' : 8 | 'quay.io/biocontainers/python:3.8.3' }" 9 | 10 | input: 11 | path samplesheet 12 | val input_path 13 | 14 | output: 15 | path '*.csv' , emit: csv 16 | path "versions.yml", emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: // This script is bundled with the pipeline, in nf-core/nanoseq/bin/ 22 | updated_path = workflow.profile.contains('test_nodx_rnamod') ? "$input_path" : "not_changed" 23 | """ 24 | check_samplesheet.py \\ 25 | $samplesheet \\ 26 | $updated_path \\ 27 | samplesheet.valid.csv 28 | 29 | cat <<-END_VERSIONS > versions.yml 30 | "${task.process}": 31 | python: \$(python --version | sed 's/Python //g') 32 | END_VERSIONS 33 | """ 34 | } 35 | -------------------------------------------------------------------------------- /modules/local/samtools_sort_index.nf: -------------------------------------------------------------------------------- 1 | process SAMTOOLS_SORT_INDEX { 2 | tag "$meta.id" 3 | label 'process_low' 4 | 5 | conda "bioconda::samtools=1.14" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : 8 | 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" 9 | 10 | input: 11 | tuple val(meta), path(bam) 12 | 13 | output: 14 | tuple val(meta), path("*sorted.bam"), path("*.bai"), optional:true, emit: bam_bai 15 | tuple val(meta), path("*sorted.bam"), path("*.csi"), optional:true, emit: bam_csi 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | """ 23 | samtools sort -@ $task.cpus -o ${meta.id}.sorted.bam -T $meta.id $bam 24 | 25 | samtools index ${meta.id}.sorted.bam 26 | 27 | cat <<-END_VERSIONS > versions.yml 28 | "${task.process}": 29 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 30 | END_VERSIONS 31 | """ 32 | } 33 | -------------------------------------------------------------------------------- /modules/local/samtools_view_bam.nf: -------------------------------------------------------------------------------- 1 | process SAMTOOLS_VIEW_BAM { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::samtools=1.10" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' : 8 | 'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }" 9 | 10 | input: 11 | tuple val(meta), path(sizes), val(is_transcripts), path(sam) 12 | 13 | output: 14 | tuple val(meta), path("*.bam"), emit: bam 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | """ 22 | samtools view -b -h -O BAM -@ $task.cpus -o ${meta.id}.bam $sam 23 | 24 | cat <<-END_VERSIONS > versions.yml 25 | "${task.process}": 26 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 27 | END_VERSIONS 28 | """ 29 | } 30 | -------------------------------------------------------------------------------- /modules/local/sniffles.nf: -------------------------------------------------------------------------------- 1 | process SNIFFLES { 2 | tag "$meta.id" 3 | label 'process_high' 4 | 5 | conda "bioconda::sniffles=1.0.12" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/sniffles:1.0.12--h8b12597_1' : 8 | 'quay.io/biocontainers/sniffles:1.0.12--h8b12597_1' }" 9 | 10 | input: 11 | tuple val(meta), path(sizes), val(is_transcripts), path(input), path(index) 12 | 13 | 14 | output: 15 | tuple val(meta), path("*_sniffles.vcf"), emit: sv_calls 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | """ 23 | sniffles \ 24 | -m $input \ 25 | -v ${meta.id}_sniffles.vcf \ 26 | -t $task.cpus 27 | 28 | cat <<-END_VERSIONS > versions.yml 29 | "${task.process}": 30 | sniffles: \$(sniffles --help 2>&1 | grep Version |sed 's/^.*Version: //') 31 | END_VERSIONS 32 | """ 33 | } 34 | 35 | -------------------------------------------------------------------------------- /modules/local/stringtie2.nf: -------------------------------------------------------------------------------- 1 | process STRINGTIE2 { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | // Note: 2.7X indices incompatible with AWS iGenomes. 6 | conda "bioconda::stringtie=2.1.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/stringtie:2.1.4--h7e0af3c_0' : 9 | 'quay.io/biocontainers/stringtie:2.1.4--h7e0af3c_0' }" 10 | 11 | input: 12 | tuple val(meta), path(fasta), path(gtf), path(bam) 13 | 14 | output: 15 | path "*.stringtie.gtf", emit: stringtie_gtf 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | """ 23 | stringtie \\ 24 | -L \\ 25 | -G $gtf \\ 26 | -o ${meta.id}.stringtie.gtf $bam 27 | 28 | cat <<-END_VERSIONS > versions.yml 29 | "${task.process}": 30 | stringtie2: \$(stringtie --version 2>&1) 31 | END_VERSIONS 32 | """ 33 | } 34 | -------------------------------------------------------------------------------- /modules/local/subread_featurecounts.nf: -------------------------------------------------------------------------------- 1 | process SUBREAD_FEATURECOUNTS { 2 | label 'process_medium' 3 | 4 | // Note: 2.7X indices incompatible with AWS iGenomes. 5 | conda "bioconda::subread=2.0.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/subread:2.0.1--hed695b0_0' : 8 | 'quay.io/biocontainers/subread:2.0.1--hed695b0_0' }" 9 | 10 | input: 11 | path gtf 12 | path bams 13 | 14 | output: 15 | path "counts_gene.txt" , emit: gene_counts 16 | path "counts_transcript.txt" , emit: transcript_counts 17 | path "counts_gene.txt.summary" , emit: featurecounts_gene_multiqc 18 | path "counts_transcript.txt.summary", emit: featurecounts_transcript_multiqc 19 | path "versions.yml" , emit: versions 20 | 21 | when: 22 | task.ext.when == null || task.ext.when 23 | 24 | script: 25 | """ 26 | featureCounts \\ 27 | -L \\ 28 | -O \\ 29 | -f \\ 30 | -g gene_id \\ 31 | -t exon \\ 32 | -T $task.cpus \\ 33 | -a $gtf \\ 34 | -o counts_gene.txt \\ 35 | $bams 36 | 37 | featureCounts \\ 38 | -L \\ 39 | -O \\ 40 | -f \\ 41 | --primary \\ 42 | --fraction \\ 43 | -F GTF \\ 44 | -g transcript_id \\ 45 | -t transcript \\ 46 | --extraAttributes gene_id \\ 47 | -T $task.cpus \\ 48 | -a $gtf \\ 49 | -o counts_transcript.txt \\ 50 | $bams 51 | 52 | cat <<-END_VERSIONS > versions.yml 53 | "${task.process}": 54 | featureCounts: \$( echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g") 55 | END_VERSIONS 56 | """ 57 | } 58 | -------------------------------------------------------------------------------- /modules/local/ucsc_bed12tobigbed.nf: -------------------------------------------------------------------------------- 1 | process UCSC_BED12TOBIGBED { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::ucsc-bedtobigbed=377" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/ucsc-bedtobigbed:377--h446ed27_1' : 8 | 'quay.io/biocontainers/ucsc-bedtobigbed:377--h446ed27_1' }" 9 | 10 | input: 11 | tuple val(meta), path(sizes), path(bed12) 12 | 13 | output: 14 | tuple val(meta), path(sizes), path("*.bigBed"), emit: bigbed 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | !params.skip_alignment && !params.skip_bigbed && (params.protocol == 'directRNA' || params.protocol == 'cDNA') 19 | 20 | script: 21 | def VERSION = '377' 22 | """ 23 | bedToBigBed \\ 24 | $bed12 \\ 25 | $sizes \\ 26 | ${meta.id}.bigBed 27 | 28 | cat <<-END_VERSIONS > versions.yml 29 | "${task.process}": 30 | ucsc_bed12tobigbed: \$(echo $VERSION) 31 | END_VERSIONS 32 | """ 33 | } 34 | -------------------------------------------------------------------------------- /modules/local/ucsc_bedgraphtobigwig.nf: -------------------------------------------------------------------------------- 1 | process UCSC_BEDGRAPHTOBIGWIG { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::ucsc-bedgraphtobigwig=377" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:377--h446ed27_1' : 8 | 'quay.io/biocontainers/ucsc-bedgraphtobigwig:377--h446ed27_1' }" 9 | 10 | input: 11 | tuple val(meta), path(sizes), path(bedgraph) 12 | 13 | output: 14 | tuple val(meta), path(sizes), path("*.bigWig"), emit: bigwig 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def VERSION = '377' 22 | """ 23 | bedGraphToBigWig $bedgraph $sizes ${meta.id}.bigWig 24 | 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | ucsc_bedgraphtobigwig: \$(echo $VERSION) 28 | END_VERSIONS 29 | """ 30 | } 31 | -------------------------------------------------------------------------------- /modules/local/xpore_dataprep.nf: -------------------------------------------------------------------------------- 1 | process XPORE_DATAPREP { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::xpore=2.1.0" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/xpore:2.1--pyh5e36f6f_0' : 8 | 'quay.io/biocontainers/xpore:2.1--pyh5e36f6f_0' }" 9 | 10 | input: 11 | tuple val(meta), path(genome), path(gtf), path(eventalign), path(nanopolish_summary) 12 | 13 | output: 14 | tuple val(meta), path("$meta.id"), emit: dataprep_outputs 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | """ 22 | xpore dataprep \\ 23 | --eventalign $eventalign \\ 24 | --out_dir $meta.id \\ 25 | --n_processes $task.cpus \\ 26 | --genome --gtf_or_gff $gtf --transcript_fasta $genome 27 | 28 | cat <<-END_VERSIONS > versions.yml 29 | "${task.process}": 30 | xpore: \$( xpore --version | sed -e 's/xpore version //g' ) 31 | END_VERSIONS 32 | """ 33 | } 34 | -------------------------------------------------------------------------------- /modules/local/xpore_diffmod.nf: -------------------------------------------------------------------------------- 1 | process XPORE_DIFFMOD { 2 | label 'process_medium' 3 | 4 | conda "bioconda::xpore=2.1.0" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/xpore:2.1--pyh5e36f6f_0' : 7 | 'quay.io/biocontainers/xpore:2.1--pyh5e36f6f_0' }" 8 | 9 | input: 10 | val dataprep_dirs 11 | 12 | output: 13 | path "diffmod*" , emit: diffmod_outputs 14 | path "versions.yml", emit: versions 15 | 16 | when: 17 | task.ext.when == null || task.ext.when 18 | 19 | script: 20 | diffmod_config = "--config $workflow.workDir/*/*/diffmod_config.yml" 21 | """ 22 | create_yml.py diffmod_config.yml $dataprep_dirs 23 | xpore diffmod $diffmod_config --n_processes $task.cpus 24 | 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | xpore: \$( xpore --version | sed -e 's/xpore version //g' ) 28 | END_VERSIONS 29 | """ 30 | } 31 | -------------------------------------------------------------------------------- /modules/nf-core/bcftools/sort/main.nf: -------------------------------------------------------------------------------- 1 | process BCFTOOLS_SORT { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::bcftools=1.16" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bcftools:1.16--hfe4b78e_1': 8 | 'quay.io/biocontainers/bcftools:1.16--hfe4b78e_1' }" 9 | 10 | input: 11 | tuple val(meta), path(vcf) 12 | 13 | output: 14 | tuple val(meta), path("*.gz"), emit: vcf 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | def prefix = task.ext.prefix ?: "${meta.id}" 23 | """ 24 | bcftools \\ 25 | sort \\ 26 | --output ${prefix}.vcf.gz \\ 27 | $args \\ 28 | $vcf 29 | 30 | cat <<-END_VERSIONS > versions.yml 31 | "${task.process}": 32 | bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') 33 | END_VERSIONS 34 | """ 35 | 36 | stub: 37 | def prefix = task.ext.prefix ?: "${meta.id}" 38 | 39 | """ 40 | touch ${prefix}.vcf.gz 41 | 42 | cat <<-END_VERSIONS > versions.yml 43 | "${task.process}": 44 | bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') 45 | END_VERSIONS 46 | """ 47 | } 48 | -------------------------------------------------------------------------------- /modules/nf-core/bcftools/sort/meta.yml: -------------------------------------------------------------------------------- 1 | name: bcftools_sort 2 | description: Sorts VCF files 3 | keywords: 4 | - sorting 5 | - VCF 6 | - variant calling 7 | tools: 8 | - sort: 9 | description: Sort VCF files by coordinates. 10 | homepage: http://samtools.github.io/bcftools/bcftools.html 11 | documentation: http://www.htslib.org/doc/bcftools.html 12 | tool_dev_url: https://github.com/samtools/bcftools 13 | doi: "10.1093/bioinformatics/btp352" 14 | licence: ["MIT"] 15 | 16 | input: 17 | - meta: 18 | type: map 19 | description: | 20 | Groovy Map containing sample information 21 | e.g. [ id:'test', single_end:false ] 22 | - vcf: 23 | type: file 24 | description: The VCF/BCF file to be sorted 25 | pattern: "*.{vcf.gz,vcf,bcf}" 26 | 27 | output: 28 | - meta: 29 | type: map 30 | description: | 31 | Groovy Map containing sample information 32 | e.g. [ id:'test', single_end:false ] 33 | - versions: 34 | type: file 35 | description: File containing software versions 36 | pattern: "versions.yml" 37 | - vcf: 38 | type: file 39 | description: Sorted VCF file 40 | pattern: "*.{vcf.gz}" 41 | 42 | authors: 43 | - "@Gwennid" 44 | -------------------------------------------------------------------------------- /modules/nf-core/custom/dumpsoftwareversions/main.nf: -------------------------------------------------------------------------------- 1 | process CUSTOM_DUMPSOFTWAREVERSIONS { 2 | label 'process_single' 3 | 4 | // Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container 5 | conda "bioconda::multiqc=1.13" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/multiqc:1.13--pyhdfd78af_0' : 8 | 'quay.io/biocontainers/multiqc:1.13--pyhdfd78af_0' }" 9 | 10 | input: 11 | path versions 12 | 13 | output: 14 | path "software_versions.yml" , emit: yml 15 | path "software_versions_mqc.yml", emit: mqc_yml 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | template 'dumpsoftwareversions.py' 24 | } 25 | -------------------------------------------------------------------------------- /modules/nf-core/custom/dumpsoftwareversions/meta.yml: -------------------------------------------------------------------------------- 1 | name: custom_dumpsoftwareversions 2 | description: Custom module used to dump software versions within the nf-core pipeline template 3 | keywords: 4 | - custom 5 | - version 6 | tools: 7 | - custom: 8 | description: Custom module used to dump software versions within the nf-core pipeline template 9 | homepage: https://github.com/nf-core/tools 10 | documentation: https://github.com/nf-core/tools 11 | licence: ["MIT"] 12 | input: 13 | - versions: 14 | type: file 15 | description: YML file containing software versions 16 | pattern: "*.yml" 17 | 18 | output: 19 | - yml: 20 | type: file 21 | description: Standard YML file containing software versions 22 | pattern: "software_versions.yml" 23 | - mqc_yml: 24 | type: file 25 | description: MultiQC custom content YML file containing software versions 26 | pattern: "software_versions_mqc.yml" 27 | - versions: 28 | type: file 29 | description: File containing software versions 30 | pattern: "versions.yml" 31 | 32 | authors: 33 | - "@drpatelh" 34 | - "@grst" 35 | -------------------------------------------------------------------------------- /modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | 4 | """Provide functions to merge multiple versions.yml files.""" 5 | 6 | 7 | import yaml 8 | import platform 9 | from textwrap import dedent 10 | 11 | 12 | def _make_versions_html(versions): 13 | """Generate a tabular HTML output of all versions for MultiQC.""" 14 | html = [ 15 | dedent( 16 | """\\ 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | """ 31 | ) 32 | ] 33 | for process, tmp_versions in sorted(versions.items()): 34 | html.append("") 35 | for i, (tool, version) in enumerate(sorted(tmp_versions.items())): 36 | html.append( 37 | dedent( 38 | f"""\\ 39 | 40 | 41 | 42 | 43 | 44 | """ 45 | ) 46 | ) 47 | html.append("") 48 | html.append("
    Process Name Software Version
    {process if (i == 0) else ''}{tool}{version}
    ") 49 | return "\\n".join(html) 50 | 51 | 52 | def main(): 53 | """Load all version files and generate merged output.""" 54 | versions_this_module = {} 55 | versions_this_module["${task.process}"] = { 56 | "python": platform.python_version(), 57 | "yaml": yaml.__version__, 58 | } 59 | 60 | with open("$versions") as f: 61 | versions_by_process = yaml.load(f, Loader=yaml.BaseLoader) | versions_this_module 62 | 63 | # aggregate versions by the module name (derived from fully-qualified process name) 64 | versions_by_module = {} 65 | for process, process_versions in versions_by_process.items(): 66 | module = process.split(":")[-1] 67 | try: 68 | if versions_by_module[module] != process_versions: 69 | raise AssertionError( 70 | "We assume that software versions are the same between all modules. " 71 | "If you see this error-message it means you discovered an edge-case " 72 | "and should open an issue in nf-core/tools. " 73 | ) 74 | except KeyError: 75 | versions_by_module[module] = process_versions 76 | 77 | versions_by_module["Workflow"] = { 78 | "Nextflow": "$workflow.nextflow.version", 79 | "$workflow.manifest.name": "$workflow.manifest.version", 80 | } 81 | 82 | versions_mqc = { 83 | "id": "software_versions", 84 | "section_name": "${workflow.manifest.name} Software Versions", 85 | "section_href": "https://github.com/${workflow.manifest.name}", 86 | "plot_type": "html", 87 | "description": "are collected at run time from the software output.", 88 | "data": _make_versions_html(versions_by_module), 89 | } 90 | 91 | with open("software_versions.yml", "w") as f: 92 | yaml.dump(versions_by_module, f, default_flow_style=False) 93 | with open("software_versions_mqc.yml", "w") as f: 94 | yaml.dump(versions_mqc, f, default_flow_style=False) 95 | 96 | with open("versions.yml", "w") as f: 97 | yaml.dump(versions_this_module, f, default_flow_style=False) 98 | 99 | 100 | if __name__ == "__main__": 101 | main() 102 | -------------------------------------------------------------------------------- /modules/nf-core/fastqc/main.nf: -------------------------------------------------------------------------------- 1 | process FASTQC { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::fastqc=0.11.9" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0' : 8 | 'quay.io/biocontainers/fastqc:0.11.9--0' }" 9 | 10 | input: 11 | tuple val(meta), path(reads) 12 | 13 | output: 14 | tuple val(meta), path("*.html"), emit: html 15 | tuple val(meta), path("*.zip") , emit: zip 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | def prefix = task.ext.prefix ?: "${meta.id}" 24 | // Make list of old name and new name pairs to use for renaming in the bash while loop 25 | def old_new_pairs = reads instanceof Path || reads.size() == 1 ? [[ reads, "${prefix}.${reads.extension}" ]] : reads.withIndex().collect { entry, index -> [ entry, "${prefix}_${index + 1}.${entry.extension}" ] } 26 | def rename_to = old_new_pairs*.join(' ').join(' ') 27 | def renamed_files = old_new_pairs.collect{ old_name, new_name -> new_name }.join(' ') 28 | """ 29 | printf "%s %s\\n" $rename_to | while read old_name new_name; do 30 | [ -f "\${new_name}" ] || ln -s \$old_name \$new_name 31 | done 32 | fastqc $args --threads $task.cpus $renamed_files 33 | 34 | cat <<-END_VERSIONS > versions.yml 35 | "${task.process}": 36 | fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) 37 | END_VERSIONS 38 | """ 39 | 40 | stub: 41 | def prefix = task.ext.prefix ?: "${meta.id}" 42 | """ 43 | touch ${prefix}.html 44 | touch ${prefix}.zip 45 | 46 | cat <<-END_VERSIONS > versions.yml 47 | "${task.process}": 48 | fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) 49 | END_VERSIONS 50 | """ 51 | } 52 | -------------------------------------------------------------------------------- /modules/nf-core/fastqc/meta.yml: -------------------------------------------------------------------------------- 1 | name: fastqc 2 | description: Run FastQC on sequenced reads 3 | keywords: 4 | - quality control 5 | - qc 6 | - adapters 7 | - fastq 8 | tools: 9 | - fastqc: 10 | description: | 11 | FastQC gives general quality metrics about your reads. 12 | It provides information about the quality score distribution 13 | across your reads, the per base sequence content (%A/C/G/T). 14 | You get information about adapter contamination and other 15 | overrepresented sequences. 16 | homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/ 17 | documentation: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/ 18 | licence: ["GPL-2.0-only"] 19 | input: 20 | - meta: 21 | type: map 22 | description: | 23 | Groovy Map containing sample information 24 | e.g. [ id:'test', single_end:false ] 25 | - reads: 26 | type: file 27 | description: | 28 | List of input FastQ files of size 1 and 2 for single-end and paired-end data, 29 | respectively. 30 | output: 31 | - meta: 32 | type: map 33 | description: | 34 | Groovy Map containing sample information 35 | e.g. [ id:'test', single_end:false ] 36 | - html: 37 | type: file 38 | description: FastQC report 39 | pattern: "*_{fastqc.html}" 40 | - zip: 41 | type: file 42 | description: FastQC report archive 43 | pattern: "*_{fastqc.zip}" 44 | - versions: 45 | type: file 46 | description: File containing software versions 47 | pattern: "versions.yml" 48 | authors: 49 | - "@drpatelh" 50 | - "@grst" 51 | - "@ewels" 52 | - "@FelixKrueger" 53 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/main.nf: -------------------------------------------------------------------------------- 1 | process MULTIQC { 2 | label 'process_single' 3 | 4 | conda "bioconda::multiqc=1.14" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/multiqc:1.14--pyhdfd78af_0' : 7 | 'quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0' }" 8 | 9 | input: 10 | path multiqc_files, stageAs: "?/*" 11 | path(multiqc_config) 12 | path(extra_multiqc_config) 13 | path(multiqc_logo) 14 | 15 | output: 16 | path "*multiqc_report.html", emit: report 17 | path "*_data" , emit: data 18 | path "*_plots" , optional:true, emit: plots 19 | path "versions.yml" , emit: versions 20 | 21 | when: 22 | task.ext.when == null || task.ext.when 23 | 24 | script: 25 | def args = task.ext.args ?: '' 26 | def config = multiqc_config ? "--config $multiqc_config" : '' 27 | def extra_config = extra_multiqc_config ? "--config $extra_multiqc_config" : '' 28 | """ 29 | multiqc \\ 30 | --force \\ 31 | $args \\ 32 | $config \\ 33 | $extra_config \\ 34 | . 35 | 36 | cat <<-END_VERSIONS > versions.yml 37 | "${task.process}": 38 | multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) 39 | END_VERSIONS 40 | """ 41 | 42 | stub: 43 | """ 44 | touch multiqc_data 45 | touch multiqc_plots 46 | touch multiqc_report.html 47 | 48 | cat <<-END_VERSIONS > versions.yml 49 | "${task.process}": 50 | multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) 51 | END_VERSIONS 52 | """ 53 | } 54 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/meta.yml: -------------------------------------------------------------------------------- 1 | name: MultiQC 2 | description: Aggregate results from bioinformatics analyses across many samples into a single report 3 | keywords: 4 | - QC 5 | - bioinformatics tools 6 | - Beautiful stand-alone HTML report 7 | tools: 8 | - multiqc: 9 | description: | 10 | MultiQC searches a given directory for analysis logs and compiles a HTML report. 11 | It's a general use tool, perfect for summarising the output from numerous bioinformatics tools. 12 | homepage: https://multiqc.info/ 13 | documentation: https://multiqc.info/docs/ 14 | licence: ["GPL-3.0-or-later"] 15 | 16 | input: 17 | - multiqc_files: 18 | type: file 19 | description: | 20 | List of reports / files recognised by MultiQC, for example the html and zip output of FastQC 21 | - multiqc_config: 22 | type: file 23 | description: Optional config yml for MultiQC 24 | pattern: "*.{yml,yaml}" 25 | - extra_multiqc_config: 26 | type: file 27 | description: Second optional config yml for MultiQC. Will override common sections in multiqc_config. 28 | pattern: "*.{yml,yaml}" 29 | - multiqc_logo: 30 | type: file 31 | description: Optional logo file for MultiQC 32 | pattern: "*.{png}" 33 | 34 | output: 35 | - report: 36 | type: file 37 | description: MultiQC report file 38 | pattern: "multiqc_report.html" 39 | - data: 40 | type: dir 41 | description: MultiQC data dir 42 | pattern: "multiqc_data" 43 | - plots: 44 | type: file 45 | description: Plots created by MultiQC 46 | pattern: "*_data" 47 | - versions: 48 | type: file 49 | description: File containing software versions 50 | pattern: "versions.yml" 51 | authors: 52 | - "@abhi18av" 53 | - "@bunop" 54 | - "@drpatelh" 55 | - "@jfy133" 56 | -------------------------------------------------------------------------------- /modules/nf-core/nanolyse/main.nf: -------------------------------------------------------------------------------- 1 | process NANOLYSE { 2 | tag "$meta.id" 3 | label 'process_low' 4 | 5 | conda "bioconda::nanolyse=1.2.0" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/nanolyse:1.2.0--py_0' : 8 | 'quay.io/biocontainers/nanolyse:1.2.0--py_0' }" 9 | 10 | input: 11 | tuple val(meta), path(fastq) 12 | path fasta 13 | 14 | output: 15 | tuple val(meta), path("*.fastq.gz"), emit: fastq 16 | path "*.log" , emit: log 17 | path "versions.yml" , emit: versions 18 | 19 | when: 20 | task.ext.when == null || task.ext.when 21 | 22 | script: 23 | def args = task.ext.args ?: '' 24 | def prefix = task.ext.prefix ?: "${meta.id}" 25 | """ 26 | gunzip -c $fastq | NanoLyse -r $fasta | gzip > ${prefix}.fastq.gz 27 | mv NanoLyse.log ${prefix}.nanolyse.log 28 | 29 | cat <<-END_VERSIONS > versions.yml 30 | "${task.process}": 31 | nanolyse: \$(NanoLyse --version 2>&1 | sed -e "s/NanoLyse //g") 32 | END_VERSIONS 33 | """ 34 | } 35 | -------------------------------------------------------------------------------- /modules/nf-core/nanolyse/meta.yml: -------------------------------------------------------------------------------- 1 | name: nanolyse 2 | description: DNA contaminant removal using NanoLyse 3 | keywords: 4 | - contaminant_removal 5 | tools: 6 | - nanolyse: 7 | description: | 8 | DNA contaminant removal using NanoLyse 9 | homepage: https://github.com/wdecoster/nanolyse 10 | documentation: https://github.com/wdecoster/nanolyse#nanolyse 11 | licence: ["GPL-3.0-or-later"] 12 | input: 13 | - meta: 14 | type: map 15 | description: | 16 | Groovy Map containing sample information 17 | e.g. [ id:'test', single_end:false ] 18 | - fastq: 19 | type: file 20 | description: | 21 | Basecalled reads in FASTQ.GZ format 22 | pattern: "*.fastq.gz" 23 | - fasta: 24 | type: file 25 | description: | 26 | A reference fasta file against which to filter. 27 | pattern: "*.fasta" 28 | output: 29 | - meta: 30 | type: map 31 | description: | 32 | Groovy Map containing sample information 33 | e.g. [ id:'test', single_end:false ] 34 | - fastq: 35 | type: file 36 | description: Reads with contaminants removed in FASTQ format 37 | pattern: "*.fastq.gz" 38 | - log: 39 | type: file 40 | description: Log of the Nanolyse run. 41 | pattern: "*.log" 42 | - versions: 43 | type: file 44 | description: File containing software versions 45 | pattern: "versions.yml" 46 | authors: 47 | - "@yuukiiwa" 48 | -------------------------------------------------------------------------------- /modules/nf-core/nanoplot/main.nf: -------------------------------------------------------------------------------- 1 | process NANOPLOT { 2 | tag "$meta.id" 3 | label 'process_low' 4 | 5 | conda "bioconda::nanoplot=1.41.0" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/nanoplot:1.41.0--pyhdfd78af_0' : 8 | 'quay.io/biocontainers/nanoplot:1.41.0--pyhdfd78af_0' }" 9 | 10 | input: 11 | tuple val(meta), path(ontfile) 12 | 13 | output: 14 | tuple val(meta), path("*.html") , emit: html 15 | tuple val(meta), path("*.png") , optional: true, emit: png 16 | tuple val(meta), path("*.txt") , emit: txt 17 | tuple val(meta), path("*.log") , emit: log 18 | path "versions.yml" , emit: versions 19 | 20 | when: 21 | task.ext.when == null || task.ext.when 22 | 23 | script: 24 | def args = task.ext.args ?: '' 25 | def input_file = ("$ontfile".endsWith(".fastq.gz")) ? "--fastq ${ontfile}" : 26 | ("$ontfile".endsWith(".txt")) ? "--summary ${ontfile}" : '' 27 | """ 28 | NanoPlot \\ 29 | $args \\ 30 | -t $task.cpus \\ 31 | $input_file 32 | cat <<-END_VERSIONS > versions.yml 33 | "${task.process}": 34 | nanoplot: \$(echo \$(NanoPlot --version 2>&1) | sed 's/^.*NanoPlot //; s/ .*\$//') 35 | END_VERSIONS 36 | """ 37 | } 38 | -------------------------------------------------------------------------------- /modules/nf-core/nanoplot/meta.yml: -------------------------------------------------------------------------------- 1 | name: nanoplot 2 | description: Run NanoPlot on nanopore-sequenced reads 3 | keywords: 4 | - quality control 5 | - qc 6 | - fastq 7 | - sequencing summary 8 | - nanopore 9 | tools: 10 | - nanoplot: 11 | description: | 12 | NanoPlot is a tool for ploting long-read sequencing data and 13 | alignment. 14 | homepage: http://nanoplot.bioinf.be 15 | documentation: https://github.com/wdecoster/NanoPlot 16 | licence: ["GPL-3.0-or-later"] 17 | input: 18 | - meta: 19 | type: map 20 | description: | 21 | Groovy Map containing sample information 22 | e.g. [ id:'test', single_end:false ] 23 | - fastq: 24 | type: file 25 | description: | 26 | List of input basecalled-FastQ files. 27 | - summary_txt: 28 | type: file 29 | description: | 30 | List of sequencing_summary.txt files from running basecalling. 31 | output: 32 | - meta: 33 | type: map 34 | description: | 35 | Groovy Map containing sample information 36 | e.g. [ id:'test', single_end:false ] 37 | - html: 38 | type: file 39 | description: NanoPlot report 40 | pattern: "*{.html}" 41 | - png: 42 | type: file 43 | description: Plots generated by NanoPlot 44 | pattern: "*{.png}" 45 | - txt: 46 | type: file 47 | description: Stats from NanoPlot 48 | pattern: "*{.txt}" 49 | - log: 50 | type: file 51 | description: log file of NanoPlot run 52 | pattern: "*{.log}" 53 | - versions: 54 | type: file 55 | description: File containing software versions 56 | pattern: "versions.yml" 57 | authors: 58 | - "@drpatelh" 59 | - "@yuukiiwa" 60 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/faidx/main.nf: -------------------------------------------------------------------------------- 1 | process SAMTOOLS_FAIDX { 2 | tag "$fasta" 3 | label 'process_single' 4 | 5 | conda "bioconda::samtools=1.16.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : 8 | 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" 9 | 10 | input: 11 | tuple val(meta), path(fasta) 12 | 13 | output: 14 | tuple val(meta), path ("*.fai"), emit: fai 15 | tuple val(meta), path ("*.gzi"), emit: gzi, optional: true 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | """ 24 | samtools \\ 25 | faidx \\ 26 | $args \\ 27 | $fasta 28 | 29 | cat <<-END_VERSIONS > versions.yml 30 | "${task.process}": 31 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 32 | END_VERSIONS 33 | """ 34 | 35 | stub: 36 | """ 37 | touch ${fasta}.fai 38 | cat <<-END_VERSIONS > versions.yml 39 | 40 | "${task.process}": 41 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 42 | END_VERSIONS 43 | """ 44 | } 45 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/faidx/meta.yml: -------------------------------------------------------------------------------- 1 | name: samtools_faidx 2 | description: Index FASTA file 3 | keywords: 4 | - index 5 | - fasta 6 | tools: 7 | - samtools: 8 | description: | 9 | SAMtools is a set of utilities for interacting with and post-processing 10 | short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. 11 | These files are generated as output by short read aligners like BWA. 12 | homepage: http://www.htslib.org/ 13 | documentation: http://www.htslib.org/doc/samtools.html 14 | doi: 10.1093/bioinformatics/btp352 15 | licence: ["MIT"] 16 | input: 17 | - meta: 18 | type: map 19 | description: | 20 | Groovy Map containing sample information 21 | e.g. [ id:'test', single_end:false ] 22 | - fasta: 23 | type: file 24 | description: FASTA file 25 | pattern: "*.{fa,fasta}" 26 | output: 27 | - meta: 28 | type: map 29 | description: | 30 | Groovy Map containing sample information 31 | e.g. [ id:'test', single_end:false ] 32 | - fai: 33 | type: file 34 | description: FASTA index file 35 | pattern: "*.{fai}" 36 | - gzi: 37 | type: file 38 | description: Optional gzip index file for compressed inputs 39 | pattern: "*.gzi" 40 | - versions: 41 | type: file 42 | description: File containing software versions 43 | pattern: "versions.yml" 44 | authors: 45 | - "@drpatelh" 46 | - "@ewels" 47 | - "@phue" 48 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/flagstat/main.nf: -------------------------------------------------------------------------------- 1 | process SAMTOOLS_FLAGSTAT { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "bioconda::samtools=1.16.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : 8 | 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" 9 | 10 | input: 11 | tuple val(meta), path(bam), path(bai) 12 | 13 | output: 14 | tuple val(meta), path("*.flagstat"), emit: flagstat 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | def prefix = task.ext.prefix ?: "${meta.id}" 23 | """ 24 | samtools \\ 25 | flagstat \\ 26 | --threads ${task.cpus} \\ 27 | $bam \\ 28 | > ${prefix}.flagstat 29 | 30 | cat <<-END_VERSIONS > versions.yml 31 | "${task.process}": 32 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 33 | END_VERSIONS 34 | """ 35 | } 36 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/flagstat/meta.yml: -------------------------------------------------------------------------------- 1 | name: samtools_flagstat 2 | description: Counts the number of alignments in a BAM/CRAM/SAM file for each FLAG type 3 | keywords: 4 | - stats 5 | - mapping 6 | - counts 7 | - bam 8 | - sam 9 | - cram 10 | tools: 11 | - samtools: 12 | description: | 13 | SAMtools is a set of utilities for interacting with and post-processing 14 | short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. 15 | These files are generated as output by short read aligners like BWA. 16 | homepage: http://www.htslib.org/ 17 | documentation: hhttp://www.htslib.org/doc/samtools.html 18 | doi: 10.1093/bioinformatics/btp352 19 | licence: ["MIT"] 20 | input: 21 | - meta: 22 | type: map 23 | description: | 24 | Groovy Map containing sample information 25 | e.g. [ id:'test', single_end:false ] 26 | - bam: 27 | type: file 28 | description: BAM/CRAM/SAM file 29 | pattern: "*.{bam,cram,sam}" 30 | - bai: 31 | type: file 32 | description: Index for BAM/CRAM/SAM file 33 | pattern: "*.{bai,crai,sai}" 34 | output: 35 | - meta: 36 | type: map 37 | description: | 38 | Groovy Map containing sample information 39 | e.g. [ id:'test', single_end:false ] 40 | - flagstat: 41 | type: file 42 | description: File containing samtools flagstat output 43 | pattern: "*.{flagstat}" 44 | - versions: 45 | type: file 46 | description: File containing software versions 47 | pattern: "versions.yml" 48 | authors: 49 | - "@drpatelh" 50 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/idxstats/main.nf: -------------------------------------------------------------------------------- 1 | process SAMTOOLS_IDXSTATS { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "bioconda::samtools=1.16.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : 8 | 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" 9 | 10 | input: 11 | tuple val(meta), path(bam), path(bai) 12 | 13 | output: 14 | tuple val(meta), path("*.idxstats"), emit: idxstats 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | def prefix = task.ext.prefix ?: "${meta.id}" 23 | 24 | """ 25 | samtools \\ 26 | idxstats \\ 27 | --threads ${task.cpus-1} \\ 28 | $bam \\ 29 | > ${prefix}.idxstats 30 | 31 | cat <<-END_VERSIONS > versions.yml 32 | "${task.process}": 33 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 34 | END_VERSIONS 35 | """ 36 | } 37 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/idxstats/meta.yml: -------------------------------------------------------------------------------- 1 | name: samtools_idxstats 2 | description: Reports alignment summary statistics for a BAM/CRAM/SAM file 3 | keywords: 4 | - stats 5 | - mapping 6 | - counts 7 | - chromosome 8 | - bam 9 | - sam 10 | - cram 11 | tools: 12 | - samtools: 13 | description: | 14 | SAMtools is a set of utilities for interacting with and post-processing 15 | short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. 16 | These files are generated as output by short read aligners like BWA. 17 | homepage: http://www.htslib.org/ 18 | documentation: hhttp://www.htslib.org/doc/samtools.html 19 | doi: 10.1093/bioinformatics/btp352 20 | licence: ["MIT"] 21 | input: 22 | - meta: 23 | type: map 24 | description: | 25 | Groovy Map containing sample information 26 | e.g. [ id:'test', single_end:false ] 27 | - bam: 28 | type: file 29 | description: BAM/CRAM/SAM file 30 | pattern: "*.{bam,cram,sam}" 31 | - bai: 32 | type: file 33 | description: Index for BAM/CRAM/SAM file 34 | pattern: "*.{bai,crai,sai}" 35 | output: 36 | - meta: 37 | type: map 38 | description: | 39 | Groovy Map containing sample information 40 | e.g. [ id:'test', single_end:false ] 41 | - idxstats: 42 | type: file 43 | description: File containing samtools idxstats output 44 | pattern: "*.{idxstats}" 45 | - versions: 46 | type: file 47 | description: File containing software versions 48 | pattern: "versions.yml" 49 | authors: 50 | - "@drpatelh" 51 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/index/main.nf: -------------------------------------------------------------------------------- 1 | process SAMTOOLS_INDEX { 2 | tag "$meta.id" 3 | label 'process_low' 4 | 5 | conda "bioconda::samtools=1.16.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : 8 | 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" 9 | 10 | input: 11 | tuple val(meta), path(input) 12 | 13 | output: 14 | tuple val(meta), path("*.bai") , optional:true, emit: bai 15 | tuple val(meta), path("*.csi") , optional:true, emit: csi 16 | tuple val(meta), path("*.crai"), optional:true, emit: crai 17 | path "versions.yml" , emit: versions 18 | 19 | when: 20 | task.ext.when == null || task.ext.when 21 | 22 | script: 23 | def args = task.ext.args ?: '' 24 | """ 25 | samtools \\ 26 | index \\ 27 | -@ ${task.cpus-1} \\ 28 | $args \\ 29 | $input 30 | 31 | cat <<-END_VERSIONS > versions.yml 32 | "${task.process}": 33 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 34 | END_VERSIONS 35 | """ 36 | 37 | stub: 38 | """ 39 | touch ${input}.bai 40 | touch ${input}.crai 41 | touch ${input}.csi 42 | 43 | cat <<-END_VERSIONS > versions.yml 44 | "${task.process}": 45 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 46 | END_VERSIONS 47 | """ 48 | } 49 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/index/meta.yml: -------------------------------------------------------------------------------- 1 | name: samtools_index 2 | description: Index SAM/BAM/CRAM file 3 | keywords: 4 | - index 5 | - bam 6 | - sam 7 | - cram 8 | tools: 9 | - samtools: 10 | description: | 11 | SAMtools is a set of utilities for interacting with and post-processing 12 | short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. 13 | These files are generated as output by short read aligners like BWA. 14 | homepage: http://www.htslib.org/ 15 | documentation: hhttp://www.htslib.org/doc/samtools.html 16 | doi: 10.1093/bioinformatics/btp352 17 | licence: ["MIT"] 18 | input: 19 | - meta: 20 | type: map 21 | description: | 22 | Groovy Map containing sample information 23 | e.g. [ id:'test', single_end:false ] 24 | - bam: 25 | type: file 26 | description: BAM/CRAM/SAM file 27 | pattern: "*.{bam,cram,sam}" 28 | output: 29 | - meta: 30 | type: map 31 | description: | 32 | Groovy Map containing sample information 33 | e.g. [ id:'test', single_end:false ] 34 | - bai: 35 | type: file 36 | description: BAM/CRAM/SAM index file 37 | pattern: "*.{bai,crai,sai}" 38 | - crai: 39 | type: file 40 | description: BAM/CRAM/SAM index file 41 | pattern: "*.{bai,crai,sai}" 42 | - csi: 43 | type: file 44 | description: CSI index file 45 | pattern: "*.{csi}" 46 | - versions: 47 | type: file 48 | description: File containing software versions 49 | pattern: "versions.yml" 50 | authors: 51 | - "@drpatelh" 52 | - "@ewels" 53 | - "@maxulysse" 54 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/sort/main.nf: -------------------------------------------------------------------------------- 1 | process SAMTOOLS_SORT { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::samtools=1.16.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : 8 | 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" 9 | 10 | input: 11 | tuple val(meta), path(bam) 12 | 13 | output: 14 | tuple val(meta), path("*.bam"), emit: bam 15 | tuple val(meta), path("*.csi"), emit: csi, optional: true 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | def prefix = task.ext.prefix ?: "${meta.id}" 24 | if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" 25 | """ 26 | samtools sort $args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam 27 | cat <<-END_VERSIONS > versions.yml 28 | "${task.process}": 29 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 30 | END_VERSIONS 31 | """ 32 | 33 | stub: 34 | def prefix = task.ext.prefix ?: "${meta.id}" 35 | """ 36 | touch ${prefix}.bam 37 | 38 | cat <<-END_VERSIONS > versions.yml 39 | "${task.process}": 40 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 41 | END_VERSIONS 42 | """ 43 | } 44 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/sort/meta.yml: -------------------------------------------------------------------------------- 1 | name: samtools_sort 2 | description: Sort SAM/BAM/CRAM file 3 | keywords: 4 | - sort 5 | - bam 6 | - sam 7 | - cram 8 | tools: 9 | - samtools: 10 | description: | 11 | SAMtools is a set of utilities for interacting with and post-processing 12 | short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. 13 | These files are generated as output by short read aligners like BWA. 14 | homepage: http://www.htslib.org/ 15 | documentation: hhttp://www.htslib.org/doc/samtools.html 16 | doi: 10.1093/bioinformatics/btp352 17 | licence: ["MIT"] 18 | input: 19 | - meta: 20 | type: map 21 | description: | 22 | Groovy Map containing sample information 23 | e.g. [ id:'test', single_end:false ] 24 | - bam: 25 | type: file 26 | description: BAM/CRAM/SAM file 27 | pattern: "*.{bam,cram,sam}" 28 | output: 29 | - meta: 30 | type: map 31 | description: | 32 | Groovy Map containing sample information 33 | e.g. [ id:'test', single_end:false ] 34 | - bam: 35 | type: file 36 | description: Sorted BAM/CRAM/SAM file 37 | pattern: "*.{bam,cram,sam}" 38 | - versions: 39 | type: file 40 | description: File containing software versions 41 | pattern: "versions.yml" 42 | - csi: 43 | type: file 44 | description: BAM index file (optional) 45 | pattern: "*.csi" 46 | authors: 47 | - "@drpatelh" 48 | - "@ewels" 49 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/stats/main.nf: -------------------------------------------------------------------------------- 1 | process SAMTOOLS_STATS { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "bioconda::samtools=1.16.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.16.1--h6899075_1' : 8 | 'quay.io/biocontainers/samtools:1.16.1--h6899075_1' }" 9 | 10 | input: 11 | tuple val(meta), path(input), path(input_index) 12 | path fasta 13 | 14 | output: 15 | tuple val(meta), path("*.stats"), emit: stats 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | def prefix = task.ext.prefix ?: "${meta.id}" 24 | def reference = fasta ? "--reference ${fasta}" : "" 25 | """ 26 | samtools \\ 27 | stats \\ 28 | --threads ${task.cpus} \\ 29 | ${reference} \\ 30 | ${input} \\ 31 | > ${prefix}.stats 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 36 | END_VERSIONS 37 | """ 38 | 39 | stub: 40 | def prefix = task.ext.prefix ?: "${meta.id}" 41 | """ 42 | touch ${prefix}.stats 43 | 44 | cat <<-END_VERSIONS > versions.yml 45 | "${task.process}": 46 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 47 | END_VERSIONS 48 | """ 49 | } 50 | -------------------------------------------------------------------------------- /modules/nf-core/samtools/stats/meta.yml: -------------------------------------------------------------------------------- 1 | name: samtools_stats 2 | description: Produces comprehensive statistics from SAM/BAM/CRAM file 3 | keywords: 4 | - statistics 5 | - counts 6 | - bam 7 | - sam 8 | - cram 9 | tools: 10 | - samtools: 11 | description: | 12 | SAMtools is a set of utilities for interacting with and post-processing 13 | short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. 14 | These files are generated as output by short read aligners like BWA. 15 | homepage: http://www.htslib.org/ 16 | documentation: hhttp://www.htslib.org/doc/samtools.html 17 | doi: 10.1093/bioinformatics/btp352 18 | licence: ["MIT"] 19 | input: 20 | - meta: 21 | type: map 22 | description: | 23 | Groovy Map containing sample information 24 | e.g. [ id:'test', single_end:false ] 25 | - input: 26 | type: file 27 | description: BAM/CRAM file from alignment 28 | pattern: "*.{bam,cram}" 29 | - input_index: 30 | type: file 31 | description: BAI/CRAI file from alignment 32 | pattern: "*.{bai,crai}" 33 | - fasta: 34 | type: optional file 35 | description: Reference file the CRAM was created with 36 | pattern: "*.{fasta,fa}" 37 | output: 38 | - meta: 39 | type: map 40 | description: | 41 | Groovy Map containing sample information 42 | e.g. [ id:'test', single_end:false ] 43 | - stats: 44 | type: file 45 | description: File containing samtools stats output 46 | pattern: "*.{stats}" 47 | - versions: 48 | type: file 49 | description: File containing software versions 50 | pattern: "versions.yml" 51 | authors: 52 | - "@drpatelh" 53 | - "@FriederikeHanssen" 54 | -------------------------------------------------------------------------------- /modules/nf-core/stringtie/merge/main.nf: -------------------------------------------------------------------------------- 1 | process STRINGTIE_MERGE { 2 | label 'process_medium' 3 | 4 | // Note: 2.7X indices incompatible with AWS iGenomes. 5 | conda "bioconda::stringtie=2.2.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/stringtie:2.2.1--hecb563c_2' : 8 | 'quay.io/biocontainers/stringtie:2.2.1--hecb563c_2' }" 9 | 10 | input: 11 | path stringtie_gtf 12 | path annotation_gtf 13 | 14 | output: 15 | path "stringtie.merged.gtf", emit: gtf 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | def reference = annotation_gtf ? "-G $annotation_gtf" : "" 24 | """ 25 | stringtie \\ 26 | --merge $stringtie_gtf \\ 27 | $reference \\ 28 | -o stringtie.merged.gtf \\ 29 | $args 30 | 31 | cat <<-END_VERSIONS > versions.yml 32 | "${task.process}": 33 | stringtie: \$(stringtie --version 2>&1) 34 | END_VERSIONS 35 | """ 36 | 37 | stub: 38 | """ 39 | touch stringtie.merged.gtf 40 | 41 | cat <<-END_VERSIONS > versions.yml 42 | "${task.process}": 43 | stringtie: \$(stringtie --version 2>&1) 44 | END_VERSIONS 45 | """ 46 | } 47 | -------------------------------------------------------------------------------- /modules/nf-core/stringtie/merge/meta.yml: -------------------------------------------------------------------------------- 1 | name: stringtie_merge 2 | description: Merges the annotation gtf file and the stringtie output gtf files 3 | keywords: 4 | - merge 5 | - gtf 6 | - reference 7 | tools: 8 | - stringtie2: 9 | description: | 10 | Transcript assembly and quantification for RNA-Seq 11 | homepage: https://ccb.jhu.edu/software/stringtie/index.shtml 12 | documentation: https://ccb.jhu.edu/software/stringtie/index.shtml?t=manual 13 | licence: ["MIT"] 14 | input: 15 | - stringtie_gtf: 16 | type: file 17 | description: | 18 | Stringtie transcript gtf output(s). 19 | pattern: "*.gtf" 20 | - annotation_gtf: 21 | type: file 22 | description: | 23 | Annotation gtf file (optional). 24 | pattern: "*.gtf" 25 | output: 26 | - merged_gtf: 27 | type: map 28 | description: | 29 | Merged gtf from annotation and stringtie output gtfs. 30 | pattern: "*.gtf" 31 | - versions: 32 | type: file 33 | description: File containing software versions 34 | pattern: "versions.yml" 35 | 36 | authors: 37 | - "@yuukiiwa" 38 | -------------------------------------------------------------------------------- /modules/nf-core/tabix/bgzip/main.nf: -------------------------------------------------------------------------------- 1 | process TABIX_BGZIP { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "bioconda::tabix=1.11" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' : 8 | 'quay.io/biocontainers/tabix:1.11--hdfd78af_0' }" 9 | 10 | input: 11 | tuple val(meta), path(input) 12 | 13 | output: 14 | tuple val(meta), path("${output}") , emit: output 15 | tuple val(meta), path("${output}.gzi"), emit: gzi, optional: true 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | prefix = task.ext.prefix ?: "${meta.id}" 24 | in_bgzip = ["gz", "bgz", "bgzf"].contains(input.getExtension()) 25 | extension = in_bgzip ? input.getBaseName().tokenize(".")[-1] : input.getExtension() 26 | output = in_bgzip ? "${prefix}.${extension}" : "${prefix}.${extension}.gz" 27 | command = in_bgzip ? '-d' : '' 28 | // Name the index according to $prefix, unless a name has been requested 29 | if ((args.matches("(^| )-i\\b") || args.matches("(^| )--index(\$| )")) && !args.matches("(^| )-I\\b") && !args.matches("(^| )--index-name\\b")) { 30 | args = args + " -I ${output}.gzi" 31 | } 32 | """ 33 | bgzip $command -c $args -@${task.cpus} $input > ${output} 34 | 35 | cat <<-END_VERSIONS > versions.yml 36 | "${task.process}": 37 | tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') 38 | END_VERSIONS 39 | """ 40 | 41 | stub: 42 | prefix = task.ext.prefix ?: "${meta.id}" 43 | in_bgzip = ["gz", "bgz", "bgzf"].contains(input.getExtension()) 44 | output = in_bgzip ? input.getBaseName() : "${prefix}.${input.getExtension()}.gz" 45 | 46 | """ 47 | touch ${output} 48 | 49 | cat <<-END_VERSIONS > versions.yml 50 | "${task.process}": 51 | tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') 52 | END_VERSIONS 53 | """ 54 | } 55 | -------------------------------------------------------------------------------- /modules/nf-core/tabix/bgzip/meta.yml: -------------------------------------------------------------------------------- 1 | name: tabix_bgzip 2 | description: Compresses/decompresses files 3 | keywords: 4 | - compress 5 | - decompress 6 | - bgzip 7 | - tabix 8 | tools: 9 | - bgzip: 10 | description: | 11 | Bgzip compresses or decompresses files in a similar manner to, and compatible with, gzip. 12 | homepage: https://www.htslib.org/doc/tabix.html 13 | documentation: http://www.htslib.org/doc/bgzip.html 14 | doi: 10.1093/bioinformatics/btp352 15 | licence: ["MIT"] 16 | input: 17 | - meta: 18 | type: map 19 | description: | 20 | Groovy Map containing sample information 21 | e.g. [ id:'test', single_end:false ] 22 | - input: 23 | type: file 24 | description: file to compress or to decompress 25 | output: 26 | - meta: 27 | type: map 28 | description: | 29 | Groovy Map containing sample information 30 | e.g. [ id:'test', single_end:false ] 31 | - output: 32 | type: file 33 | description: Output compressed/decompressed file 34 | pattern: "*." 35 | - gzi: 36 | type: file 37 | description: Optional gzip index file for compressed inputs 38 | pattern: "*.gzi" 39 | - versions: 40 | type: file 41 | description: File containing software versions 42 | pattern: "versions.yml" 43 | authors: 44 | - "@joseespinosa" 45 | - "@drpatelh" 46 | - "@maxulysse" 47 | - "@nvnieuwk" 48 | -------------------------------------------------------------------------------- /modules/nf-core/tabix/bgziptabix/main.nf: -------------------------------------------------------------------------------- 1 | process TABIX_BGZIPTABIX { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "bioconda::tabix=1.11" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' : 8 | 'quay.io/biocontainers/tabix:1.11--hdfd78af_0' }" 9 | 10 | input: 11 | tuple val(meta), path(input) 12 | 13 | output: 14 | tuple val(meta), path("*.gz"), path("*.tbi"), emit: gz_tbi 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | def args2 = task.ext.args2 ?: '' 23 | def prefix = task.ext.prefix ?: "${meta.id}" 24 | """ 25 | bgzip --threads ${task.cpus} -c $args $input > ${prefix}.${input.getExtension()}.gz 26 | tabix $args2 ${prefix}.${input.getExtension()}.gz 27 | 28 | cat <<-END_VERSIONS > versions.yml 29 | "${task.process}": 30 | tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') 31 | END_VERSIONS 32 | """ 33 | 34 | stub: 35 | def prefix = task.ext.prefix ?: "${meta.id}" 36 | """ 37 | touch ${prefix}.gz 38 | touch ${prefix}.gz.tbi 39 | 40 | cat <<-END_VERSIONS > versions.yml 41 | "${task.process}": 42 | tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') 43 | END_VERSIONS 44 | """ 45 | } 46 | -------------------------------------------------------------------------------- /modules/nf-core/tabix/bgziptabix/meta.yml: -------------------------------------------------------------------------------- 1 | name: tabix_bgziptabix 2 | description: bgzip a sorted tab-delimited genome file and then create tabix index 3 | keywords: 4 | - bgzip 5 | - compress 6 | - index 7 | - tabix 8 | - vcf 9 | tools: 10 | - tabix: 11 | description: Generic indexer for TAB-delimited genome position files. 12 | homepage: https://www.htslib.org/doc/tabix.html 13 | documentation: https://www.htslib.org/doc/tabix.1.html 14 | doi: 10.1093/bioinformatics/btq671 15 | licence: ["MIT"] 16 | input: 17 | - meta: 18 | type: map 19 | description: | 20 | Groovy Map containing sample information 21 | e.g. [ id:'test', single_end:false ] 22 | - tab: 23 | type: file 24 | description: TAB-delimited genome position file 25 | pattern: "*.{bed,gff,sam,vcf}" 26 | output: 27 | - meta: 28 | type: map 29 | description: | 30 | Groovy Map containing sample information 31 | e.g. [ id:'test', single_end:false ] 32 | - gz: 33 | type: file 34 | description: Output compressed file 35 | pattern: "*.{gz}" 36 | - tbi: 37 | type: file 38 | description: tabix index file 39 | pattern: "*.{gz.tbi}" 40 | - versions: 41 | type: file 42 | description: File containing software versions 43 | pattern: "versions.yml" 44 | authors: 45 | - "@maxulysse" 46 | -------------------------------------------------------------------------------- /modules/nf-core/tabix/tabix/main.nf: -------------------------------------------------------------------------------- 1 | process TABIX_TABIX { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "bioconda::tabix=1.11" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' : 8 | 'quay.io/biocontainers/tabix:1.11--hdfd78af_0' }" 9 | 10 | input: 11 | tuple val(meta), path(tab) 12 | 13 | output: 14 | tuple val(meta), path("*.tbi"), optional:true, emit: tbi 15 | tuple val(meta), path("*.csi"), optional:true, emit: csi 16 | path "versions.yml" , emit: versions 17 | 18 | when: 19 | task.ext.when == null || task.ext.when 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | """ 24 | tabix $args $tab 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') 29 | END_VERSIONS 30 | """ 31 | 32 | stub: 33 | def prefix = task.ext.prefix ?: "${meta.id}" 34 | """ 35 | touch ${tab}.tbi 36 | cat <<-END_VERSIONS > versions.yml 37 | 38 | "${task.process}": 39 | tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') 40 | END_VERSIONS 41 | """ 42 | } 43 | -------------------------------------------------------------------------------- /modules/nf-core/tabix/tabix/meta.yml: -------------------------------------------------------------------------------- 1 | name: tabix_tabix 2 | description: create tabix index from a sorted bgzip tab-delimited genome file 3 | keywords: 4 | - index 5 | - tabix 6 | - vcf 7 | tools: 8 | - tabix: 9 | description: Generic indexer for TAB-delimited genome position files. 10 | homepage: https://www.htslib.org/doc/tabix.html 11 | documentation: https://www.htslib.org/doc/tabix.1.html 12 | doi: 10.1093/bioinformatics/btq671 13 | licence: ["MIT"] 14 | input: 15 | - meta: 16 | type: map 17 | description: | 18 | Groovy Map containing sample information 19 | e.g. [ id:'test', single_end:false ] 20 | - tab: 21 | type: file 22 | description: TAB-delimited genome position file compressed with bgzip 23 | pattern: "*.{bed.gz,gff.gz,sam.gz,vcf.gz}" 24 | output: 25 | - meta: 26 | type: map 27 | description: | 28 | Groovy Map containing sample information 29 | e.g. [ id:'test', single_end:false ] 30 | - tbi: 31 | type: file 32 | description: tabix index file 33 | pattern: "*.{tbi}" 34 | - csi: 35 | type: file 36 | description: coordinate sorted index file 37 | pattern: "*.{csi}" 38 | - versions: 39 | type: file 40 | description: File containing software versions 41 | pattern: "versions.yml" 42 | authors: 43 | - "@joseespinosa" 44 | - "@drpatelh" 45 | - "@maxulysse" 46 | -------------------------------------------------------------------------------- /modules/nf-core/untar/main.nf: -------------------------------------------------------------------------------- 1 | process UNTAR { 2 | tag "$archive" 3 | label 'process_single' 4 | 5 | conda "conda-forge::sed=4.7 bioconda::grep=3.4 conda-forge::tar=1.34" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : 8 | 'ubuntu:20.04' }" 9 | 10 | input: 11 | tuple val(meta), path(archive) 12 | 13 | output: 14 | tuple val(meta), path("$prefix"), emit: untar 15 | path "versions.yml" , emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | def args2 = task.ext.args2 ?: '' 23 | prefix = task.ext.prefix ?: ( meta.id ? "${meta.id}" : archive.baseName.toString().replaceFirst(/\.tar$/, "")) 24 | 25 | """ 26 | mkdir $prefix 27 | 28 | ## Ensures --strip-components only applied when top level of tar contents is a directory 29 | ## If just files or multiple directories, place all in prefix 30 | if [[ \$(tar -taf ${archive} | grep -o -P "^.*?\\/" | uniq | wc -l) -eq 1 ]]; then 31 | tar \\ 32 | -C $prefix --strip-components 1 \\ 33 | -xavf \\ 34 | $args \\ 35 | $archive \\ 36 | $args2 37 | else 38 | tar \\ 39 | -C $prefix \\ 40 | -xavf \\ 41 | $args \\ 42 | $archive \\ 43 | $args2 44 | fi 45 | 46 | cat <<-END_VERSIONS > versions.yml 47 | "${task.process}": 48 | untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//') 49 | END_VERSIONS 50 | """ 51 | 52 | stub: 53 | prefix = task.ext.prefix ?: ( meta.id ? "${meta.id}" : archive.toString().replaceFirst(/\.[^\.]+(.gz)?$/, "")) 54 | """ 55 | mkdir $prefix 56 | touch ${prefix}/file.txt 57 | 58 | cat <<-END_VERSIONS > versions.yml 59 | "${task.process}": 60 | untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//') 61 | END_VERSIONS 62 | """ 63 | } 64 | -------------------------------------------------------------------------------- /modules/nf-core/untar/meta.yml: -------------------------------------------------------------------------------- 1 | name: untar 2 | description: Extract files. 3 | keywords: 4 | - untar 5 | - uncompress 6 | tools: 7 | - untar: 8 | description: | 9 | Extract tar.gz files. 10 | documentation: https://www.gnu.org/software/tar/manual/ 11 | licence: ["GPL-3.0-or-later"] 12 | input: 13 | - meta: 14 | type: map 15 | description: | 16 | Groovy Map containing sample information 17 | e.g. [ id:'test', single_end:false ] 18 | - archive: 19 | type: file 20 | description: File to be untar 21 | pattern: "*.{tar}.{gz}" 22 | output: 23 | - meta: 24 | type: map 25 | description: | 26 | Groovy Map containing sample information 27 | e.g. [ id:'test', single_end:false ] 28 | - untar: 29 | type: directory 30 | description: Directory containing contents of archive 31 | pattern: "*/" 32 | - versions: 33 | type: file 34 | description: File containing software versions 35 | pattern: "versions.yml" 36 | authors: 37 | - "@joseespinosa" 38 | - "@drpatelh" 39 | - "@matthdsm" 40 | - "@jfy133" 41 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | # Config file for Python. Mostly used to configure linting of bin/check_samplesheet.py with Black. 2 | # Should be kept the same as nf-core/tools to avoid fighting with template synchronisation. 3 | [tool.black] 4 | line-length = 120 5 | target_version = ["py37", "py38", "py39", "py310"] 6 | 7 | [tool.isort] 8 | profile = "black" 9 | known_first_party = ["nf_core"] 10 | multi_line_output = 3 11 | -------------------------------------------------------------------------------- /subworkflows/local/align_graphmap2.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Alignment with GRAPHMAP2 3 | */ 4 | 5 | include { GRAPHMAP2_INDEX } from '../../modules/local/graphmap2_index' 6 | include { GRAPHMAP2_ALIGN } from '../../modules/local/graphmap2_align' 7 | 8 | workflow ALIGN_GRAPHMAP2 { 9 | take: 10 | ch_fasta_index // channel: [ val(meta), [ reads ] ] 11 | ch_fastq 12 | 13 | main: 14 | /* 15 | * Create genome/transcriptome index 16 | */ 17 | GRAPHMAP2_INDEX ( ch_fasta_index ) 18 | ch_index = GRAPHMAP2_INDEX.out.index 19 | graphmap2_version = GRAPHMAP2_INDEX.out.versions 20 | 21 | ch_index 22 | .cross(ch_fastq) { it -> it[-1] } 23 | .flatten() 24 | .collate(12) // [fasta, fasta sizes, gtf, bed, fasta_index, annotation_string, meta, fastq, fasta, gtf, is_transcript, fasta_gtf_string] 25 | .map { it -> [ it[6], it[7], it[0], it[1], it[2], it[3], it[10], it[4] ] } // [ sample, fastq, fasta, sizes, gtf, bed, is_transcripts, index ] 26 | .set { ch_index } 27 | 28 | /* 29 | * Map reads with GRAPHMAP2 30 | */ 31 | 32 | GRAPHMAP2_ALIGN ( ch_index ) 33 | ch_align_sam = GRAPHMAP2_ALIGN.out.align_sam 34 | 35 | emit: 36 | ch_index 37 | graphmap2_version 38 | ch_align_sam 39 | } 40 | -------------------------------------------------------------------------------- /subworkflows/local/align_minimap2.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Alignment with MINIMAP2 3 | */ 4 | 5 | include { MINIMAP2_INDEX } from '../../modules/local/minimap2_index' 6 | include { MINIMAP2_ALIGN } from '../../modules/local/minimap2_align' 7 | 8 | workflow ALIGN_MINIMAP2 { 9 | take: 10 | ch_fasta_index // channel: [ val(meta), [ reads ] ] 11 | ch_fastq 12 | 13 | main: 14 | /* 15 | * Create genome/transcriptome index 16 | */ 17 | MINIMAP2_INDEX ( ch_fasta_index ) 18 | ch_index = MINIMAP2_INDEX.out.index 19 | minimap2_version = MINIMAP2_INDEX.out.versions 20 | 21 | ch_index 22 | .cross(ch_fastq) { it -> it[-1] } 23 | .flatten() 24 | .collate(13) 25 | .map { it -> [ it[7], it[8], it[0], it[1], it[2], it[3], it[4], it[5] ] } // [ sample, fastq, fasta, sizes, gtf, bed, is_transcripts, index ] 26 | .set { ch_index } 27 | 28 | /* 29 | * Map reads with MINIMAP2 30 | */ 31 | MINIMAP2_ALIGN ( ch_index ) 32 | ch_align_sam = MINIMAP2_ALIGN.out.align_sam 33 | 34 | emit: 35 | ch_index 36 | minimap2_version 37 | ch_align_sam 38 | } 39 | -------------------------------------------------------------------------------- /subworkflows/local/bam_sort_index_samtools.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Sort, index BAM file and run samtools stats, flagstat and idxstats 3 | */ 4 | 5 | include { SAMTOOLS_VIEW_BAM } from '../../modules/local/samtools_view_bam' 6 | include { SAMTOOLS_SORT } from '../../modules/nf-core/samtools/sort/main' 7 | include { SAMTOOLS_INDEX } from '../../modules/nf-core/samtools/index/main' 8 | include { SAMTOOLS_SORT_INDEX } from '../../modules/local/samtools_sort_index' 9 | include { BAM_STATS_SAMTOOLS } from '../../subworkflows/nf-core/bam_stats_samtools' 10 | 11 | workflow BAM_SORT_INDEX_SAMTOOLS { 12 | take: 13 | ch_sam // channel: [ val(meta), [ bam ] ] 14 | call_variants 15 | ch_fasta 16 | 17 | main: 18 | /* 19 | * Sam to bam conversion 20 | */ 21 | SAMTOOLS_VIEW_BAM ( ch_sam ) 22 | if ( call_variants ) { 23 | SAMTOOLS_SORT_INDEX ( SAMTOOLS_VIEW_BAM.out.bam ) 24 | ch_sam 25 | .join( SAMTOOLS_SORT_INDEX.out.bam_bai ) 26 | .map { it -> [ it[0], it[1], it[2], it[4], it[5] ] } 27 | .set { sortbam } 28 | BAM_STATS_SAMTOOLS ( SAMTOOLS_SORT_INDEX.out.bam_bai, ch_fasta ) 29 | } else { 30 | SAMTOOLS_SORT ( SAMTOOLS_VIEW_BAM.out.bam ) 31 | SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ) 32 | ch_sam 33 | .join( SAMTOOLS_SORT.out.bam ) 34 | .join( SAMTOOLS_INDEX.out.bai ) 35 | .map { it -> [ it[0], it[1], it[2], it[4], it[5] ] } 36 | .set { sortbam } 37 | BAM_STATS_SAMTOOLS ( SAMTOOLS_SORT.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]), ch_fasta ) 38 | } 39 | 40 | /* 41 | * SUBWORKFLOW: Create stats using samtools 42 | */ 43 | BAM_STATS_SAMTOOLS.out.stats 44 | .join ( BAM_STATS_SAMTOOLS.out.idxstats ) 45 | .join ( BAM_STATS_SAMTOOLS.out.flagstat ) 46 | .map { it -> [ it[1], it[2], it[3] ] } 47 | .set { sortbam_stats_multiqc } 48 | samtools_versions = BAM_STATS_SAMTOOLS.out.versions 49 | 50 | emit: 51 | sortbam 52 | sortbam_stats_multiqc 53 | samtools_versions 54 | } 55 | -------------------------------------------------------------------------------- /subworkflows/local/bedtools_ucsc_bigbed.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Convert BAM to BigBed 3 | */ 4 | 5 | include { BEDTOOLS_BAMBED } from '../../modules/local/bedtools_bamtobed' 6 | include { UCSC_BED12TOBIGBED } from '../../modules/local/ucsc_bed12tobigbed' 7 | 8 | workflow BEDTOOLS_UCSC_BIGBED { 9 | take: 10 | ch_sortbam 11 | 12 | main: 13 | /* 14 | * Convert BAM to BED12 15 | */ 16 | BEDTOOLS_BAMBED ( ch_sortbam ) 17 | ch_bed12 = BEDTOOLS_BAMBED.out.bed12 18 | bedtools_version = BEDTOOLS_BAMBED.out.versions 19 | 20 | /* 21 | * Convert BED12 to BigBED 22 | */ 23 | UCSC_BED12TOBIGBED ( ch_bed12 ) 24 | ch_bigbed = UCSC_BED12TOBIGBED.out.bigbed 25 | bed12tobigbed_version = UCSC_BED12TOBIGBED.out.versions 26 | 27 | emit: 28 | bedtools_version 29 | ch_bigbed 30 | bed12tobigbed_version 31 | } 32 | -------------------------------------------------------------------------------- /subworkflows/local/bedtools_ucsc_bigwig.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Convert BAM to BigWig 3 | */ 4 | 5 | include { BEDTOOLS_GENOMECOV } from '../../modules/local/bedtools_genomecov' 6 | include { UCSC_BEDGRAPHTOBIGWIG } from '../../modules/local/ucsc_bedgraphtobigwig' 7 | 8 | workflow BEDTOOLS_UCSC_BIGWIG { 9 | take: 10 | ch_sortbam // channel: [ val(meta), [ reads ] ] 11 | 12 | main: 13 | /* 14 | * Convert BAM to BEDGraph 15 | */ 16 | BEDTOOLS_GENOMECOV ( ch_sortbam ) 17 | ch_bedgraph = BEDTOOLS_GENOMECOV.out.bedgraph 18 | bedtools_version = BEDTOOLS_GENOMECOV.out.versions 19 | 20 | /* 21 | * Convert BEDGraph to BigWig 22 | */ 23 | UCSC_BEDGRAPHTOBIGWIG ( ch_bedgraph ) 24 | ch_bigwig = UCSC_BEDGRAPHTOBIGWIG.out.bigwig 25 | bedgraphtobigwig_version = UCSC_BEDGRAPHTOBIGWIG.out.versions 26 | 27 | emit: 28 | ch_bigwig 29 | bedtools_version 30 | bedgraphtobigwig_version 31 | } 32 | -------------------------------------------------------------------------------- /subworkflows/local/differential_deseq2_dexseq.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Differential Expression Analysis with DESeq2 and DEXSeq 3 | */ 4 | 5 | include { DESEQ2 } from '../../modules/local/deseq2' 6 | include { DEXSEQ } from '../../modules/local/dexseq' 7 | 8 | workflow DIFFERENTIAL_DESEQ2_DEXSEQ { 9 | take: 10 | ch_gene_counts 11 | ch_transcript_counts 12 | 13 | main: 14 | /* 15 | * DESeq2 differential expression of genes 16 | */ 17 | DESEQ2 ( ch_gene_counts ) 18 | ch_deseq2_txt = DESEQ2.out.deseq2_txt 19 | deseq2_version = DESEQ2.out.versions 20 | 21 | /* 22 | * DEXseq differential expression of transcripts 23 | */ 24 | DEXSEQ ( ch_transcript_counts ) 25 | ch_dexseq_txt = DEXSEQ.out.dexseq_txt 26 | dexseq_version = DEXSEQ.out.versions 27 | 28 | emit: 29 | ch_deseq2_txt 30 | ch_dexseq_txt 31 | deseq2_version 32 | dexseq_version 33 | } 34 | -------------------------------------------------------------------------------- /subworkflows/local/input_check.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Check input samplesheet and get read channels 3 | */ 4 | 5 | include { SAMPLESHEET_CHECK } from '../../modules/local/samplesheet_check' 6 | 7 | workflow INPUT_CHECK { 8 | take: 9 | samplesheet // file: /path/to/samplesheet.csv 10 | input_path 11 | 12 | main: 13 | /* 14 | * Check samplesheet is valid 15 | */ 16 | SAMPLESHEET_CHECK ( samplesheet, input_path ) 17 | .csv 18 | .splitCsv ( header:true, sep:',' ) 19 | .map { get_sample_info(it, params.genomes) } 20 | .map { it -> [ it[0], it[2], it[3], it[4], it[5], it[6], it[1] , it[7] ] } 21 | .set { ch_sample } 22 | 23 | emit: 24 | ch_sample // [ sample, barcode, fasta, gtf, is_transcripts, annotation_str ] 25 | } 26 | 27 | // Function to resolve fasta and gtf file if using iGenomes 28 | // Returns [ sample, input_file, barcode, fasta, gtf, is_transcripts, annotation_str, nanopolish_fast5 ] 29 | def get_sample_info(LinkedHashMap sample, LinkedHashMap genomeMap) { 30 | def meta = [:] 31 | meta.id = sample.sample 32 | 33 | // Resolve fasta and gtf file if using iGenomes 34 | def fasta = false 35 | def gtf = false 36 | if (sample.fasta) { 37 | if (genomeMap && genomeMap.containsKey(sample.fasta)) { 38 | fasta = file(genomeMap[sample.fasta].fasta, checkIfExists: true) 39 | gtf = file(genomeMap[sample.fasta].gtf, checkIfExists: true) 40 | } else { 41 | fasta = file(sample.fasta, checkIfExists: true) 42 | } 43 | } 44 | 45 | // Check if input file and gtf file exists 46 | input_file = sample.input_file ? file(sample.input_file, checkIfExists: true) : null 47 | gtf = sample.gtf ? file(sample.gtf, checkIfExists: true) : gtf 48 | 49 | return [ meta, input_file, sample.barcode, fasta, gtf, sample.is_transcripts.toBoolean(), fasta.toString()+';'+gtf.toString(), sample.nanopolish_fast5 ] 50 | } 51 | -------------------------------------------------------------------------------- /subworkflows/local/prepare_genome.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Prepare genome/transcriptome before alignment 3 | */ 4 | 5 | include { GET_CHROM_SIZES } from '../../modules/local/get_chrom_sizes' 6 | include { GTF2BED } from '../../modules/local/gtf2bed' 7 | include { SAMTOOLS_FAIDX } from '../../modules/nf-core/samtools/faidx/main' 8 | 9 | workflow PREPARE_GENOME { 10 | take: 11 | ch_fastq 12 | 13 | main: 14 | // Get unique list of all fasta files 15 | ch_fastq 16 | .filter { it[2] } 17 | .map { it -> [ it[2], it[5].toString() ] } // [ fasta, annotation_str ] 18 | .unique() 19 | .set { ch_fastq_sizes } 20 | 21 | /* 22 | * Make chromosome sizes file 23 | */ 24 | GET_CHROM_SIZES ( ch_fastq_sizes ) 25 | ch_chrom_sizes = GET_CHROM_SIZES.out.sizes 26 | samtools_version = GET_CHROM_SIZES.out.versions 27 | 28 | // Get unique list of all gtf files 29 | ch_fastq 30 | .filter { it[3] } 31 | .map { it -> [ it[3], it[5] ] } // [ gtf, annotation_str ] 32 | .unique() 33 | .set { ch_fastq_gtf } 34 | 35 | /* 36 | * Convert GTF to BED12 37 | */ 38 | GTF2BED ( ch_fastq_gtf ) 39 | ch_gtf_bed = GTF2BED.out.gtf_bed 40 | gtf2bed_version = GTF2BED.out.versions 41 | 42 | ch_chrom_sizes 43 | .join(ch_gtf_bed, by: 1, remainder:true) 44 | .map { it -> [ it[1], it[2], it[0] ] } 45 | .cross(ch_fastq) { it -> it[-1] } 46 | .flatten() 47 | .collate(9) 48 | .map { it -> [ it[5], it[0], it[6], it[1], it[7], it[8] ]} // [ fasta, sizes, gtf, bed, is_transcripts, annotation_str ] 49 | .unique() 50 | .set { ch_fasta_index } 51 | 52 | /* 53 | * Convert GTF to BED12 54 | */ 55 | ch_fastq 56 | .filter { it[2] } 57 | .map { it -> [ it[0], it[2] ] } // [ gtf, annotation_str ] 58 | .unique() 59 | .set { ch_fasta } 60 | 61 | SAMTOOLS_FAIDX ( ch_fasta ) 62 | ch_fai = SAMTOOLS_FAIDX.out.fai 63 | 64 | emit: 65 | ch_fasta 66 | ch_fai 67 | ch_fasta_index 68 | ch_gtf_bed 69 | samtools_version 70 | gtf2bed_version 71 | } 72 | -------------------------------------------------------------------------------- /subworkflows/local/qcfastq_nanoplot_fastqc.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * FastQ QC with NanoPlot and fastqc 3 | */ 4 | 5 | include { NANOPLOT } from '../../modules/nf-core/nanoplot/main' 6 | include { FASTQC } from '../../modules/nf-core/fastqc/main' 7 | 8 | workflow QCFASTQ_NANOPLOT_FASTQC { 9 | take: 10 | ch_fastq 11 | skip_nanoplot 12 | skip_fastqc 13 | 14 | main: 15 | ch_fastq 16 | .map { ch -> [ ch[0], ch[1] ] } 17 | .set { ch_fastq } 18 | 19 | /* 20 | * FastQ QC using NanoPlot 21 | */ 22 | nanoplot_png = Channel.empty() 23 | nanoplot_html = Channel.empty() 24 | nanoplot_txt = Channel.empty() 25 | nanoplot_log = Channel.empty() 26 | nanoplot_version = Channel.empty() 27 | if (!skip_nanoplot){ 28 | NANOPLOT ( ch_fastq ) 29 | //nanoplot_png = NANOPLOT.out.png 30 | nanoplot_html = NANOPLOT.out.html 31 | nanoplot_txt = NANOPLOT.out.txt 32 | nanoplot_log = NANOPLOT.out.log 33 | nanoplot_version = NANOPLOT.out.versions 34 | } 35 | 36 | /* 37 | * FastQ QC using FASTQC 38 | */ 39 | fastqc_zip = Channel.empty() 40 | fastqc_html = Channel.empty() 41 | fastqc_multiqc = Channel.empty() 42 | fastqc_version = Channel.empty() 43 | if (!skip_fastqc){ 44 | FASTQC ( ch_fastq ) 45 | fastqc_zip = FASTQC.out.zip 46 | fastqc_html = FASTQC.out.html 47 | fastqc_zip 48 | .map { it -> [ it[1] ] } 49 | .set { fastqc_zip_only } 50 | fastqc_html 51 | .map { it -> [ it[1] ] } 52 | .set { fastqc_html_only } 53 | fastqc_multiqc = fastqc_multiqc.mix( fastqc_zip_only, fastqc_html_only ) 54 | // fastqc_version = FASTQC.out.versions 55 | } 56 | 57 | emit: 58 | nanoplot_png 59 | nanoplot_html 60 | nanoplot_txt 61 | nanoplot_log 62 | nanoplot_version 63 | 64 | fastqc_zip 65 | fastqc_html 66 | fastqc_version 67 | fastqc_multiqc 68 | } 69 | -------------------------------------------------------------------------------- /subworkflows/local/quantify_stringtie_featurecounts.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Transcript Discovery and Quantification with StringTie2 and FeatureCounts 3 | */ 4 | 5 | include { STRINGTIE2 } from '../../modules/local/stringtie2' 6 | include { STRINGTIE_MERGE } from '../../modules/nf-core/stringtie/merge/main' 7 | include { SUBREAD_FEATURECOUNTS } from '../../modules/local/subread_featurecounts' 8 | 9 | workflow QUANTIFY_STRINGTIE_FEATURECOUNTS { 10 | take: 11 | ch_sample 12 | ch_sortbam 13 | 14 | main: 15 | 16 | ch_sample 17 | .map { it -> [ it[0], it[2], it[3] ] } 18 | .join ( ch_sortbam ) 19 | .set { ch_sample } 20 | 21 | /* 22 | * Novel isoform detection with StringTie 23 | */ 24 | STRINGTIE2 ( ch_sample ) 25 | ch_stringtie_gtf = STRINGTIE2.out.stringtie_gtf 26 | stringtie2_version = STRINGTIE2.out.versions 27 | 28 | ch_sample 29 | .map { it -> [ it[2] ] } 30 | .unique() 31 | .set { ch_sample_gtf } 32 | 33 | /* 34 | * Merge isoforms across samples called by StringTie 35 | */ 36 | STRINGTIE_MERGE ( ch_stringtie_gtf.collect(), ch_sample_gtf ) 37 | ch_stringtie_merged_gtf = STRINGTIE_MERGE.out.gtf 38 | 39 | /* 40 | * Gene and transcript quantification with featureCounts 41 | */ 42 | ch_sample 43 | .collect { it[-1] } 44 | .set { ch_sample } 45 | SUBREAD_FEATURECOUNTS ( ch_stringtie_merged_gtf, ch_sample ) 46 | ch_gene_counts = SUBREAD_FEATURECOUNTS.out.gene_counts 47 | ch_transcript_counts = SUBREAD_FEATURECOUNTS.out.transcript_counts 48 | featurecounts_gene_multiqc = SUBREAD_FEATURECOUNTS.out.featurecounts_gene_multiqc 49 | featurecounts_transcript_multiqc = SUBREAD_FEATURECOUNTS.out.featurecounts_transcript_multiqc 50 | featurecounts_version = SUBREAD_FEATURECOUNTS.out.versions 51 | 52 | emit: 53 | ch_stringtie_gtf 54 | ch_stringtie_merged_gtf 55 | ch_gene_counts 56 | ch_transcript_counts 57 | featurecounts_gene_multiqc 58 | featurecounts_transcript_multiqc 59 | stringtie2_version 60 | featurecounts_version 61 | } 62 | -------------------------------------------------------------------------------- /subworkflows/local/rna_fusions_jaffal.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * RNA FUSION DETECTION WITH JAFFAL 3 | */ 4 | 5 | include { GET_JAFFAL_REF } from '../../modules/local/get_jaffal_ref' 6 | include { UNTAR } from '../../modules/nf-core/untar/main' 7 | include { JAFFAL } from '../../modules/local/jaffal' 8 | 9 | workflow RNA_FUSIONS_JAFFAL { 10 | take: 11 | ch_sample_simple 12 | jaffal_ref_dir 13 | 14 | main: 15 | if (jaffal_ref_dir) { 16 | ch_jaffal_ref_dir = file(params.jaffal_ref_dir, checkIfExists: true) 17 | } else { 18 | 19 | /* 20 | * Get jaffel reference 21 | */ 22 | GET_JAFFAL_REF() 23 | 24 | /* 25 | * Untar jaffel reference 26 | */ 27 | UNTAR( GET_JAFFAL_REF.out.ch_jaffal_ref ) 28 | UNTAR.out.untar 29 | .map { it -> [ it[1] ]} 30 | .set { ch_jaffal_ref_dir } 31 | 32 | ch_jaffal_ref_dir.view() 33 | 34 | } 35 | 36 | ch_sample_simple.view() 37 | 38 | /* 39 | * Align current signals to reference with jaffel 40 | */ 41 | JAFFAL( ch_sample_simple, ch_jaffal_ref_dir ) 42 | } 43 | -------------------------------------------------------------------------------- /subworkflows/local/rna_modifications_xpore_m6anet.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * RNA MODIFICATION DETECTION WITH XPORE AND M6ANET 3 | */ 4 | 5 | include { NANOPOLISH_INDEX_EVENTALIGN } from '../../modules/local/nanopolish_index_eventalign' 6 | include { XPORE_DATAPREP } from '../../modules/local/xpore_dataprep' 7 | include { XPORE_DIFFMOD } from '../../modules/local/xpore_diffmod' 8 | include { M6ANET_DATAPREP } from '../../modules/local/m6anet_dataprep' 9 | include { M6ANET_INFERENCE } from '../../modules/local/m6anet_inference' 10 | 11 | workflow RNA_MODIFICATION_XPORE_M6ANET { 12 | take: 13 | ch_sample 14 | ch_nanopolish_sortbam 15 | 16 | main: 17 | ch_sample 18 | .join(ch_nanopolish_sortbam) 19 | .map { it -> [ it[0], it[2], it[3], it[7], it[6], it[8], it[9] ] } 20 | .set { ch_nanopolish_input } 21 | 22 | /* 23 | * Align current signals to reference with Nanopolish 24 | */ 25 | NANOPOLISH_INDEX_EVENTALIGN { ch_nanopolish_input } 26 | ch_nanopolish_outputs = NANOPOLISH_INDEX_EVENTALIGN.out.nanopolish_outputs 27 | nanopolish_version = NANOPOLISH_INDEX_EVENTALIGN.out.versions 28 | 29 | xpore_version = '' 30 | ch_xpore_dataprep_dirs = '' 31 | if (!params.skip_xpore) { 32 | 33 | /* 34 | * Prepare data with xpore 35 | */ 36 | XPORE_DATAPREP( ch_nanopolish_outputs ) 37 | ch_xpore_dataprep_dirs = XPORE_DATAPREP.out.dataprep_outputs 38 | ch_xpore_dataprep_dirs 39 | .map{ it -> it[1]+','+it[0].id } 40 | .set{ ch_xpore_diffmod_inputs } 41 | 42 | /* 43 | * Differential modification expression with xpore 44 | */ 45 | XPORE_DIFFMOD{ ch_xpore_diffmod_inputs.collect() } 46 | xpore_version = XPORE_DIFFMOD.out.versions 47 | } 48 | 49 | /* 50 | * Detect m6A sites with m6anet 51 | */ 52 | m6anet_version = '' 53 | if (!params.skip_m6anet) { 54 | /* 55 | * Detect m6A sites with m6anet 56 | */ 57 | M6ANET_DATAPREP( ch_nanopolish_outputs ) 58 | ch_m6anet_dataprep_dirs = M6ANET_DATAPREP.out.dataprep_outputs 59 | M6ANET_INFERENCE{ ch_m6anet_dataprep_dirs } 60 | m6anet_version = M6ANET_INFERENCE.out.versions 61 | } 62 | 63 | emit: 64 | ch_nanopolish_outputs 65 | nanopolish_version 66 | ch_xpore_dataprep_dirs 67 | xpore_version 68 | m6anet_version 69 | } 70 | -------------------------------------------------------------------------------- /subworkflows/local/short_variant_calling.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Short variant calling test 3 | */ 4 | 5 | include { MEDAKA_VARIANT } from '../../modules/local/medaka_variant' 6 | include { TABIX_BGZIP as MEDAKA_BGZIP_VCF } from '../../modules/nf-core/tabix/bgzip/main' 7 | include { TABIX_TABIX as MEDAKA_TABIX_VCF } from '../../modules/nf-core/tabix/tabix/main' 8 | include { DEEPVARIANT } from '../../modules/local/deepvariant' 9 | include { TABIX_TABIX as DEEPVARIANT_TABIX_VCF } from '../../modules/nf-core/tabix/tabix/main' 10 | include { TABIX_TABIX as DEEPVARIANT_TABIX_GVCF } from '../../modules/nf-core/tabix/tabix/main' 11 | include { PEPPER_MARGIN_DEEPVARIANT } from '../../modules/local/pepper_margin_deepvariant' 12 | 13 | workflow SHORT_VARIANT_CALLING { 14 | 15 | take: 16 | ch_view_sortbam 17 | ch_fasta 18 | ch_fai 19 | 20 | main: 21 | ch_short_calls_vcf = Channel.empty() 22 | ch_short_calls_vcf_tbi = Channel.empty() 23 | ch_short_calls_gvcf = Channel.empty() 24 | ch_short_calls_gvcf_tbi = Channel.empty() 25 | ch_versions = Channel.empty() 26 | 27 | /* 28 | * Call short variants 29 | */ 30 | if (params.variant_caller == 'medaka') { 31 | 32 | /* 33 | * Call short variants with medaka 34 | */ 35 | MEDAKA_VARIANT( ch_view_sortbam, ch_fasta ) 36 | ch_versions = ch_versions.mix(medaka_version = MEDAKA_VARIANT.out.versions) 37 | 38 | /* 39 | * Zip medaka vcf 40 | */ 41 | MEDAKA_BGZIP_VCF( MEDAKA_VARIANT.out.vcf ) 42 | ch_short_calls_vcf = MEDAKA_BGZIP_VCF.out.output 43 | ch_versions = ch_versions.mix(bgzip_version = MEDAKA_BGZIP_VCF.out.versions) 44 | 45 | /* 46 | * Index medaka vcf.gz 47 | */ 48 | MEDAKA_TABIX_VCF( ch_short_calls_vcf ) 49 | ch_short_calls_vcf_tbi = MEDAKA_TABIX_VCF.out.tbi 50 | ch_versions = ch_versions.mix(tabix_version = MEDAKA_TABIX_VCF.out.versions) 51 | 52 | } else if (params.variant_caller == 'deepvariant') { 53 | 54 | /* 55 | * Call variants with deepvariant 56 | */ 57 | DEEPVARIANT( ch_view_sortbam, ch_fasta, ch_fai ) 58 | ch_short_calls_vcf = DEEPVARIANT.out.vcf 59 | ch_short_calls_gvcf = DEEPVARIANT.out.gvcf 60 | ch_versions = ch_versions.mix(DEEPVARIANT.out.versions) 61 | 62 | /* 63 | * Index deepvariant vcf.gz 64 | */ 65 | DEEPVARIANT_TABIX_VCF( ch_short_calls_vcf ) 66 | ch_short_calls_vcf_tbi = DEEPVARIANT_TABIX_VCF.out.tbi 67 | ch_versions = ch_versions.mix(DEEPVARIANT_TABIX_VCF.out.versions) 68 | 69 | /* 70 | * Index deepvariant g.vcf.gz 71 | */ 72 | DEEPVARIANT_TABIX_GVCF( ch_short_calls_gvcf ) 73 | ch_short_calls_gvcf_tbi = DEEPVARIANT_TABIX_GVCF.out.tbi 74 | ch_versions = ch_versions.mix(DEEPVARIANT_TABIX_VCF.out.versions) 75 | 76 | } else { 77 | 78 | /* 79 | * Call variants with pepper_margin_deepvariant (automatic zip + index, docker + singularity only) 80 | */ 81 | PEPPER_MARGIN_DEEPVARIANT( ch_view_sortbam, ch_fasta, ch_fai ) 82 | ch_short_calls_vcf = PEPPER_MARGIN_DEEPVARIANT.out.vcf 83 | ch_short_calls_vcf_tbi = PEPPER_MARGIN_DEEPVARIANT.out.tbi 84 | ch_versions = ch_versions.mix(PEPPER_MARGIN_DEEPVARIANT.out.versions) 85 | } 86 | 87 | emit: 88 | ch_short_calls_vcf 89 | ch_short_calls_vcf_tbi 90 | ch_short_calls_gvcf 91 | ch_short_calls_gvcf_tbi 92 | ch_versions 93 | } 94 | -------------------------------------------------------------------------------- /subworkflows/local/structural_variant_calling.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Structural variant calling 3 | */ 4 | 5 | include { SNIFFLES } from '../../modules/local/sniffles' 6 | include { BCFTOOLS_SORT as SNIFFLES_SORT_VCF } from '../../modules/nf-core/bcftools/sort/main' 7 | include { TABIX_BGZIP as SNIFFLES_BGZIP_VCF } from '../../modules/nf-core/tabix/bgzip/main' 8 | include { TABIX_TABIX as SNIFFLES_TABIX_VCF } from '../../modules/nf-core/tabix/tabix/main' 9 | include { CUTESV } from '../../modules/local/cutesv' 10 | include { BCFTOOLS_SORT as CUTESV_SORT_VCF } from '../../modules/nf-core/bcftools/sort/main' 11 | include { TABIX_BGZIP as CUTESV_BGZIP_VCF } from '../../modules/nf-core/tabix/bgzip/main' 12 | include { TABIX_TABIX as CUTESV_TABIX_VCF } from '../../modules/nf-core/tabix/tabix/main' 13 | 14 | 15 | workflow STRUCTURAL_VARIANT_CALLING { 16 | 17 | take: 18 | ch_view_sortbam 19 | ch_fasta 20 | ch_fai 21 | 22 | main: 23 | ch_sv_calls_vcf = Channel.empty() 24 | ch_sv_calls_vcf_tbi = Channel.empty() 25 | 26 | ch_versions = Channel.empty() 27 | 28 | /* 29 | * Call structural variants with sniffles 30 | */ 31 | if (params.structural_variant_caller == 'sniffles') { 32 | 33 | /* 34 | * Call structural variants with sniffles 35 | */ 36 | SNIFFLES( ch_view_sortbam ) 37 | ch_versions = ch_versions.mix(SNIFFLES.out.versions) 38 | 39 | /* 40 | * Sort structural variants with bcftools 41 | */ 42 | SNIFFLES_SORT_VCF( SNIFFLES.out.sv_calls ) 43 | ch_sv_calls_vcf = SNIFFLES_SORT_VCF.out.vcf 44 | ch_versions = ch_versions.mix(SNIFFLES_SORT_VCF.out.versions) 45 | 46 | /* 47 | * Index sniffles vcf.gz 48 | */ 49 | SNIFFLES_TABIX_VCF( ch_sv_calls_vcf ) 50 | ch_sv_calls_tbi = SNIFFLES_TABIX_VCF.out.tbi 51 | ch_versions = ch_versions.mix(SNIFFLES_TABIX_VCF.out.versions) 52 | 53 | } else if (params.structural_variant_caller == 'cutesv') { 54 | 55 | /* 56 | * Call structural variants with cutesv 57 | */ 58 | CUTESV( ch_view_sortbam, ch_fasta ) 59 | ch_versions = ch_versions.mix(CUTESV.out.versions) 60 | 61 | /* 62 | * Sort structural variants with bcftools 63 | */ 64 | CUTESV_SORT_VCF( CUTESV.out.sv_calls ) 65 | ch_sv_calls_vcf = CUTESV_SORT_VCF.out.vcf 66 | ch_versions = ch_versions.mix(CUTESV_SORT_VCF.out.versions) 67 | 68 | /* 69 | * Zip cutesv vcf.gz 70 | */ 71 | CUTESV_TABIX_VCF( ch_sv_calls_vcf ) 72 | ch_sv_calls_tbi = CUTESV_TABIX_VCF.out.tbi 73 | ch_versions = ch_versions.mix(CUTESV_TABIX_VCF.out.versions) 74 | } 75 | 76 | emit: 77 | ch_sv_calls_vcf 78 | ch_sv_calls_vcf_tbi 79 | ch_versions 80 | } 81 | -------------------------------------------------------------------------------- /subworkflows/nf-core/bam_stats_samtools.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Run SAMtools stats, flagstat and idxstats 3 | */ 4 | 5 | include { SAMTOOLS_STATS } from '../../modules/nf-core/samtools/stats/main' 6 | include { SAMTOOLS_IDXSTATS } from '../../modules/nf-core/samtools/idxstats/main' 7 | include { SAMTOOLS_FLAGSTAT } from '../../modules/nf-core/samtools/flagstat/main' 8 | 9 | workflow BAM_STATS_SAMTOOLS { 10 | take: 11 | ch_bam_bai // channel: [ val(meta), [ bam ], [bai] ] 12 | ch_id_fasta 13 | 14 | main: 15 | /* 16 | * Stats with samtools 17 | */ 18 | ch_id_fasta 19 | .map{ it -> it[1] } 20 | .set{ ch_fasta } 21 | SAMTOOLS_STATS ( ch_bam_bai, ch_fasta ) 22 | 23 | /* 24 | * Flagstat with samtools 25 | */ 26 | SAMTOOLS_FLAGSTAT ( ch_bam_bai ) 27 | 28 | /* 29 | * Idxstats with samtools 30 | */ 31 | SAMTOOLS_IDXSTATS ( ch_bam_bai ) 32 | 33 | emit: 34 | stats = SAMTOOLS_STATS.out.stats // channel: [ val(meta), [ stats ] ] 35 | flagstat = SAMTOOLS_FLAGSTAT.out.flagstat // channel: [ val(meta), [ flagstat ] ] 36 | idxstats = SAMTOOLS_IDXSTATS.out.idxstats // channel: [ val(meta), [ idxstats ] ] 37 | versions = SAMTOOLS_STATS.out.versions // path: version.yml 38 | } 39 | --------------------------------------------------------------------------------