├── .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 │ ├── clean-up.yml │ ├── fix-linting.yml │ ├── linting.yml │ └── linting_comment.yml ├── .gitignore ├── .gitpod.yml ├── .nf-core.yml ├── .pre-commit-config.yaml ├── .prettierignore ├── .prettierrc.yml ├── CHANGELOG.md ├── CITATIONS.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── assets ├── adaptivecard.json ├── bamtools_filter_pe.json ├── bamtools_filter_se.json ├── blacklists │ ├── old │ │ ├── GRCm38-blacklist.bed │ │ ├── hg38-blacklist.bed │ │ └── mm10-blacklist.bed │ ├── v1.0 │ │ ├── GRCh37-blacklist.v1.bed │ │ └── hg19-blacklist.v1.bed │ ├── v2.0 │ │ ├── GRCm38-blacklist.v2.bed │ │ ├── ce10-blacklist.v2.bed │ │ ├── ce11-blacklist.v2.bed │ │ ├── dm3-blacklist.v2.bed │ │ ├── dm6-blacklist.v2.bed │ │ ├── hg19-blacklist.v2.bed │ │ ├── hg38-blacklist.v2.bed │ │ └── mm10-blacklist.v2.bed │ └── v3.0 │ │ ├── GRCh38-blacklist.v3.bed │ │ └── hg38-blacklist.v3.bed ├── email_template.html ├── email_template.txt ├── methods_description_template.yml ├── multiqc │ ├── merged_library_deseq2_clustering_header.txt │ ├── merged_library_deseq2_pca_header.txt │ ├── merged_library_frip_score_header.txt │ ├── merged_library_peak_annotation_header.txt │ ├── merged_library_peak_count_header.txt │ ├── merged_replicate_deseq2_clustering_header.txt │ ├── merged_replicate_deseq2_pca_header.txt │ ├── merged_replicate_frip_score_header.txt │ ├── merged_replicate_peak_annotation_header.txt │ └── merged_replicate_peak_count_header.txt ├── multiqc_config.yml ├── nf-core-atacseq_logo_light.png ├── samplesheet.csv ├── schema_input.json ├── sendmail_template.txt └── slackreport.json ├── bin ├── bampe_rm_orphan.py ├── check_samplesheet.py ├── deseq2_qc.r ├── get_autosomes.py ├── gtf2bed ├── igv_files_to_session.py ├── macs2_merged_expand.py ├── plot_homer_annotatepeaks.r ├── plot_macs2_qc.r └── plot_peak_intersect.r ├── conf ├── base.config ├── igenomes.config ├── modules.config ├── test.config ├── test_controls.config └── test_full.config ├── docs ├── README.md ├── images │ ├── igv_screenshot.png │ ├── mqc_annotatePeaks_feature_percentage_plot.png │ ├── mqc_cutadapt_plot.png │ ├── mqc_deeptools_plotFingerprint_plot.png │ ├── mqc_deeptools_plotProfile_plot.png │ ├── mqc_deseq2_pca_plot.png │ ├── mqc_deseq2_sample_similarity_plot.png │ ├── mqc_fastqc_adapter.png │ ├── mqc_fastqc_counts.png │ ├── mqc_fastqc_quality.png │ ├── mqc_featureCounts_assignment_plot.png │ ├── mqc_frip_score_plot.png │ ├── mqc_macs2_peak_count_plot.png │ ├── mqc_picard_deduplication_plot.png │ ├── mqc_picard_insert_size_plot.png │ ├── mqc_preseq_plot.png │ ├── mqc_samtools_idxstats_plot.png │ ├── mqc_samtools_stats_plot.png │ ├── nf-core-atacseq_logo_dark.png │ ├── nf-core-atacseq_logo_light.png │ ├── nf-core-atacseq_metro_map_grey.png │ ├── nf-core-atacseq_metro_map_grey.svg │ └── r_upsetr_intersect_plot.png ├── output.md └── usage.md ├── lib ├── NfcoreTemplate.groovy ├── Utils.groovy ├── WorkflowAtacseq.groovy ├── WorkflowMain.groovy └── nfcore_external_java_deps.jar ├── main.nf ├── modules.json ├── modules ├── local │ ├── bam_remove_orphans.nf │ ├── bamtools_filter.nf │ ├── bedtools_genomecov.nf │ ├── deseq2_qc.nf │ ├── frip_score.nf │ ├── genome_blacklist_regions.nf │ ├── get_autosomes.nf │ ├── gtf2bed.nf │ ├── igv.nf │ ├── macs2_consensus.nf │ ├── multiqc.nf │ ├── multiqc_custom_peaks.nf │ ├── plot_homer_annotatepeaks.nf │ ├── plot_macs2_qc.nf │ ├── samplesheet_check.nf │ ├── star_align.nf │ ├── star_genomegenerate.nf │ └── tss_extract.nf └── nf-core │ ├── ataqv │ ├── ataqv │ │ ├── main.nf │ │ └── meta.yml │ └── mkarv │ │ ├── main.nf │ │ └── meta.yml │ ├── bowtie2 │ ├── align │ │ ├── main.nf │ │ └── meta.yml │ └── build │ │ ├── main.nf │ │ └── meta.yml │ ├── bwa │ ├── index │ │ ├── main.nf │ │ └── meta.yml │ └── mem │ │ ├── main.nf │ │ └── meta.yml │ ├── chromap │ ├── chromap │ │ ├── main.nf │ │ └── meta.yml │ └── index │ │ ├── main.nf │ │ └── meta.yml │ ├── custom │ ├── dumpsoftwareversions │ │ ├── main.nf │ │ ├── meta.yml │ │ └── templates │ │ │ └── dumpsoftwareversions.py │ └── getchromsizes │ │ ├── main.nf │ │ └── meta.yml │ ├── deeptools │ ├── computematrix │ │ ├── main.nf │ │ └── meta.yml │ ├── plotfingerprint │ │ ├── main.nf │ │ └── meta.yml │ ├── plotheatmap │ │ ├── main.nf │ │ └── meta.yml │ └── plotprofile │ │ ├── main.nf │ │ └── meta.yml │ ├── fastqc │ ├── main.nf │ └── meta.yml │ ├── gffread │ ├── main.nf │ └── meta.yml │ ├── gunzip │ ├── main.nf │ └── meta.yml │ ├── homer │ └── annotatepeaks │ │ ├── main.nf │ │ └── meta.yml │ ├── khmer │ └── uniquekmers │ │ ├── main.nf │ │ └── meta.yml │ ├── macs2 │ └── callpeak │ │ ├── main.nf │ │ └── meta.yml │ ├── picard │ ├── collectmultiplemetrics │ │ ├── main.nf │ │ └── meta.yml │ ├── markduplicates │ │ ├── main.nf │ │ └── meta.yml │ └── mergesamfiles │ │ ├── main.nf │ │ └── meta.yml │ ├── preseq │ └── lcextrap │ │ ├── main.nf │ │ └── meta.yml │ ├── samtools │ ├── 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 │ ├── subread │ └── featurecounts │ │ ├── main.nf │ │ └── meta.yml │ ├── trimgalore │ ├── main.nf │ └── meta.yml │ ├── ucsc │ └── bedgraphtobigwig │ │ ├── main.nf │ │ └── meta.yml │ ├── umitools │ └── extract │ │ ├── main.nf │ │ └── meta.yml │ └── untar │ ├── main.nf │ └── meta.yml ├── nextflow.config ├── nextflow_schema.json ├── pyproject.toml ├── subworkflows ├── local │ ├── align_star.nf │ ├── bam_bedgraph_bigwig_bedtools_ucsc.nf │ ├── bam_filter_bamtools.nf │ ├── bam_peaks_call_qc_annotate_macs2_homer.nf │ ├── bed_consensus_quantify_qc_bedtools_featurecounts_deseq2.nf │ ├── bigwig_plot_deeptools.nf │ ├── input_check.nf │ └── prepare_genome.nf └── nf-core │ ├── bam_markduplicates_picard │ ├── main.nf │ └── meta.yml │ ├── bam_sort_stats_samtools │ ├── main.nf │ └── meta.yml │ ├── bam_stats_samtools │ ├── main.nf │ └── meta.yml │ ├── fastq_align_bowtie2 │ ├── main.nf │ └── meta.yml │ ├── fastq_align_bwa │ ├── main.nf │ └── meta.yml │ ├── fastq_align_chromap │ ├── main.nf │ └── meta.yml │ └── fastq_fastqc_umitools_trimgalore │ ├── main.nf │ └── meta.yml ├── tower.yml └── workflows └── atacseq.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}] 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 | 26 | [/assets/blacklists/GRCh37-blacklist.bed] 27 | trim_trailing_whitespace = unset 28 | -------------------------------------------------------------------------------- /.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/atacseq pipeline documentation](https://nf-co.re/atacseq/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. 23.04.0)_ 46 | * Hardware _(eg. HPC, Desktop, Cloud)_ 47 | * Executor _(eg. slurm, local, awsbatch)_ 48 | * Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter, Charliecloud, or Apptainer)_ 49 | * OS _(eg. CentOS Linux, macOS, Linux Mint)_ 50 | * Version of nf-core/atacseq _(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 #atacseq channel" 6 | url: https://nfcore.slack.com/channels/atacseq 7 | about: Discussion about the nf-core/atacseq pipeline 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for the nf-core/atacseq 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/atacseq/tree/master/.github/CONTRIBUTING.md) 19 | - [ ] If necessary, also make a PR on the nf-core/atacseq _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. 20 | - [ ] Make sure your code lints (`nf-core lint`). 21 | - [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir `). 22 | - [ ] Usage Documentation in `docs/usage.md` is updated. 23 | - [ ] Output Documentation in `docs/output.md` is updated. 24 | - [ ] `CHANGELOG.md` is updated. 25 | - [ ] `README.md` is updated (including new tool citations and authors/contributors). 26 | -------------------------------------------------------------------------------- /.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/atacseq' 14 | runs-on: ubuntu-latest 15 | strategy: 16 | matrix: 17 | aligner: ["bwa", "bowtie2", "chromap", "star"] 18 | steps: 19 | - name: Launch workflow via tower 20 | uses: seqeralabs/action-tower-launch@v2 21 | with: 22 | workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} 23 | access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} 24 | compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} 25 | revision: ${{ github.sha }} 26 | workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/atacseq/work-${{ github.sha }} 27 | parameters: | 28 | { 29 | "hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}", 30 | "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/atacseq/results-${{ github.sha }}", 31 | "aligner": "${{ matrix.aligner }}" 32 | } 33 | profiles: test_full 34 | 35 | - uses: actions/upload-artifact@v3 36 | with: 37 | name: Tower debug log file 38 | path: | 39 | tower_action_*.log 40 | tower_action_*.json 41 | -------------------------------------------------------------------------------- /.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/atacseq' 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Launch workflow using Tower CLI tool action 14 | - name: Launch workflow via tower 15 | uses: seqeralabs/action-tower-launch@v2 16 | with: 17 | workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} 18 | access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} 19 | compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} 20 | revision: ${{ github.sha }} 21 | workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/atacseq/work-${{ github.sha }} 22 | parameters: | 23 | { 24 | "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/atacseq/results-test-${{ github.sha }}" 25 | } 26 | profiles: test 27 | 28 | - uses: actions/upload-artifact@v3 29 | with: 30 | name: Tower debug log file 31 | path: | 32 | tower_action_*.log 33 | tower_action_*.json 34 | -------------------------------------------------------------------------------- /.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/atacseq' 15 | run: | 16 | { [[ ${{github.event.pull_request.head.repo.full_name }} == nf-core/atacseq ]] && [[ $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/clean-up.yml: -------------------------------------------------------------------------------- 1 | name: "Close user-tagged issues and PRs" 2 | on: 3 | schedule: 4 | - cron: "0 0 * * 0" # Once a week 5 | 6 | jobs: 7 | clean-up: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | issues: write 11 | pull-requests: write 12 | steps: 13 | - uses: actions/stale@v7 14 | with: 15 | stale-issue-message: "This issue has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment otherwise this issue will be closed in 20 days." 16 | stale-pr-message: "This PR has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment if it is still useful." 17 | close-issue-message: "This issue was closed because it has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor and then staled for 20 days with no activity." 18 | days-before-stale: 30 19 | days-before-close: 20 20 | days-before-pr-close: -1 21 | any-of-labels: "awaiting-changes,awaiting-feedback" 22 | exempt-issue-labels: "WIP" 23 | exempt-pr-labels: "WIP" 24 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 25 | -------------------------------------------------------------------------------- /.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/atacseq' 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_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 | tasks: 3 | - name: Update Nextflow and setup pre-commit 4 | command: | 5 | pre-commit install --install-hooks 6 | nextflow self-update 7 | 8 | vscode: 9 | extensions: # based on nf-core.nf-core-extensionpack 10 | - codezombiech.gitignore # Language support for .gitignore files 11 | # - cssho.vscode-svgviewer # SVG viewer 12 | - esbenp.prettier-vscode # Markdown/CommonMark linting and style checking for Visual Studio Code 13 | - eamodio.gitlens # Quickly glimpse into whom, why, and when a line or code block was changed 14 | - EditorConfig.EditorConfig # override user/workspace settings with settings found in .editorconfig files 15 | - Gruntfuggly.todo-tree # Display TODO and FIXME in a tree view in the activity bar 16 | - mechatroner.rainbow-csv # Highlight columns in csv files in different colors 17 | # - nextflow.nextflow # Nextflow syntax highlighting 18 | - oderwat.indent-rainbow # Highlight indentation level 19 | - streetsidesoftware.code-spell-checker # Spelling checker for source code 20 | -------------------------------------------------------------------------------- /.nf-core.yml: -------------------------------------------------------------------------------- 1 | repository_type: pipeline 2 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/mirrors-prettier 3 | rev: "v2.7.1" 4 | hooks: 5 | - id: prettier 6 | -------------------------------------------------------------------------------- /.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) Patel H, Langer B, Espinosa-Carrasco J, Syme R 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/bamtools_filter_pe.json: -------------------------------------------------------------------------------- 1 | { 2 | "filters": [ 3 | { "id": "insert_min", "insertSize": ">=-2000" }, 4 | 5 | { "id": "insert_max", "insertSize": "<=2000" }, 6 | 7 | { "id": "mismatch", "tag": "NM:<=4" }, 8 | 9 | { "id": "cigar", "cigar": "*S*" } 10 | ], 11 | 12 | "rule": " insert_min & insert_max & mismatch & !cigar " 13 | } 14 | -------------------------------------------------------------------------------- /assets/bamtools_filter_se.json: -------------------------------------------------------------------------------- 1 | { 2 | "filters": [ 3 | { "id": "mismatch", "tag": "NM:<=4" }, 4 | 5 | { "id": "cigar", "cigar": "*S*" } 6 | ], 7 | 8 | "rule": " mismatch & !cigar " 9 | } 10 | -------------------------------------------------------------------------------- /assets/blacklists/old/hg38-blacklist.bed: -------------------------------------------------------------------------------- 1 | chr10 38528030 38529790 2 | chr10 42070420 42070660 3 | chr16 34571420 34571640 4 | chr16 34572700 34572930 5 | chr16 34584530 34584840 6 | chr16 34585000 34585220 7 | chr16 34585700 34586380 8 | chr16 34586660 34587100 9 | chr16 34587060 34587660 10 | chr16 34587900 34588170 11 | chr16 34593000 34593590 12 | chr16 34594490 34594720 13 | chr16 34594900 34595150 14 | chr16 34595320 34595570 15 | chr16 46380910 46381140 16 | chr16 46386270 46386530 17 | chr16 46390180 46390930 18 | chr16 46394370 46395100 19 | chr16 46395670 46395910 20 | chr16 46398780 46399020 21 | chr16 46400700 46400970 22 | chr1 124450730 124450960 23 | chr20 28513520 28513770 24 | chr20 31060210 31060770 25 | chr20 31061050 31061560 26 | chr20 31063990 31064490 27 | chr20 31067930 31069060 28 | chr20 31069000 31069280 29 | chr21 8219780 8220120 30 | chr21 8234330 8234620 31 | chr2 90397520 90397900 32 | chr2 90398120 90398760 33 | chr3 93470260 93470870 34 | chr4 49118760 49119010 35 | chr4 49120790 49121130 36 | chr5 49601430 49602300 37 | chr5 49657080 49657690 38 | chr5 49661330 49661570 39 | -------------------------------------------------------------------------------- /assets/email_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | nf-core/atacseq Pipeline Report 9 | 10 | 11 |
12 | 13 | 14 | 15 |

nf-core/atacseq v${version}

16 |

Run Name: $runName

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

nf-core/atacseq 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/atacseq 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/atacseq

48 |

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

49 | 50 |
51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /assets/email_template.txt: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------- 2 | ,--./,-. 3 | ___ __ __ __ ___ /,-._.--~\\ 4 | |\\ | |__ __ / ` / \\ |__) |__ } { 5 | | \\| | \\__, \\__/ | \\ |___ \\`-._,-`-, 6 | `._,._,' 7 | nf-core/atacseq v${version} 8 | ---------------------------------------------------- 9 | Run Name: $runName 10 | 11 | <% if (success){ 12 | out << "## nf-core/atacseq execution completed successfully! ##" 13 | } else { 14 | out << """#################################################### 15 | ## nf-core/atacseq 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/atacseq 39 | https://github.com/nf-core/atacseq 40 | -------------------------------------------------------------------------------- /assets/multiqc/merged_library_deseq2_clustering_header.txt: -------------------------------------------------------------------------------- 1 | #id: 'mlib_deseq2_clustering' 2 | #section_name: 'MERGED LIB: DESeq2 sample similarity' 3 | #description: "Matrix is generated from clustering with Euclidean distances between 4 | # DESeq2 5 | # rlog values for each sample 6 | # in the deseq2_qc.r script." 7 | #plot_type: 'heatmap' 8 | #anchor: 'mlib_deseq2_clustering' 9 | #pconfig: 10 | # title: 'DESeq2: Heatmap of the sample-to-sample distances' 11 | # xlab: True 12 | # reverseColors: True 13 | -------------------------------------------------------------------------------- /assets/multiqc/merged_library_deseq2_pca_header.txt: -------------------------------------------------------------------------------- 1 | #id: 'mlib_deseq2_pca' 2 | #section_name: 'MERGED LIB: DESeq2 PCA plot' 3 | #description: "PCA plot of the samples in the experiment. 4 | # These values are calculated using DESeq2 5 | # in the deseq2_qc.r script." 6 | #plot_type: 'scatter' 7 | #anchor: 'mlib_deseq2_pca' 8 | #pconfig: 9 | # title: 'DESeq2: Principal component plot' 10 | # xlab: PC1 11 | # ylab: PC2 12 | -------------------------------------------------------------------------------- /assets/multiqc/merged_library_frip_score_header.txt: -------------------------------------------------------------------------------- 1 | #id: 'mlib_frip_score' 2 | #section_name: 'MERGED LIB: MACS2 peak FRiP score' 3 | #description: "is generated by calculating the fraction of all mapped reads that fall 4 | # into the MACS2 called peak regions. A read must overlap a peak by at least 20% to be counted. 5 | # See FRiP score." 6 | #plot_type: 'bargraph' 7 | #anchor: 'mlib_frip_score' 8 | #pconfig: 9 | # title: 'FRiP score' 10 | # ylab: 'FRiP score' 11 | # ymax: 1 12 | # ymin: 0 13 | # tt_decimals: 2 14 | # cpswitch: False 15 | -------------------------------------------------------------------------------- /assets/multiqc/merged_library_peak_annotation_header.txt: -------------------------------------------------------------------------------- 1 | #id: 'mlib_peak_annotation' 2 | #section_name: 'MERGED LIB: HOMER peak annotation' 3 | #description: "is generated by calculating the proportion of peaks assigned to genomic features by 4 | # HOMER annotatePeaks.pl." 5 | #plot_type: 'bargraph' 6 | #anchor: 'mlib_peak_annotation' 7 | #pconfig: 8 | # title: 'Peak to feature proportion' 9 | # ylab: 'Peak count' 10 | -------------------------------------------------------------------------------- /assets/multiqc/merged_library_peak_count_header.txt: -------------------------------------------------------------------------------- 1 | #id: 'mlib_peak_count' 2 | #section_name: 'MERGED LIB: MACS2 peak count' 3 | #description: "is calculated from total number of peaks called by 4 | # MACS2" 5 | #plot_type: 'bargraph' 6 | #anchor: 'mlib_peak_count' 7 | #pconfig: 8 | # title: 'Total peak count' 9 | # ylab: 'Peak count' 10 | # cpswitch: False 11 | -------------------------------------------------------------------------------- /assets/multiqc/merged_replicate_deseq2_clustering_header.txt: -------------------------------------------------------------------------------- 1 | #id: 'mrep_deseq2_clustering' 2 | #section_name: 'MERGED REP: DESeq2 sample similarity' 3 | #description: "Matrix is generated from clustering with Euclidean distances between 4 | # DESeq2 5 | # rlog values for each sample 6 | # in the deseq2_qc.r script." 7 | #plot_type: 'heatmap' 8 | #anchor: 'mrep_deseq2_clustering' 9 | #pconfig: 10 | # title: 'DESeq2: Heatmap of the sample-to-sample distances' 11 | # xlab: True 12 | # reverseColors: True 13 | -------------------------------------------------------------------------------- /assets/multiqc/merged_replicate_deseq2_pca_header.txt: -------------------------------------------------------------------------------- 1 | #id: 'mrep_deseq2_pca' 2 | #section_name: 'MERGED REP: DESeq2 PCA plot' 3 | #description: "PCA plot of the samples in the experiment. 4 | # These values are calculated using DESeq2 5 | # in the deseq2_qc.r script." 6 | #plot_type: 'scatter' 7 | #anchor: 'mrep_deseq2_pca' 8 | #pconfig: 9 | # title: 'DESeq2: Principal component plot' 10 | # xlab: PC1 11 | # ylab: PC2 12 | -------------------------------------------------------------------------------- /assets/multiqc/merged_replicate_frip_score_header.txt: -------------------------------------------------------------------------------- 1 | #id: 'mrep_frip_score' 2 | #section_name: 'MERGED REP: MACS2 peak FRiP score' 3 | #description: "is generated by calculating the fraction of all mapped reads that fall 4 | # into the MACS2 called peak regions. A read must overlap a peak by at least 20% to be counted. 5 | # See FRiP score." 6 | #plot_type: 'bargraph' 7 | #anchor: 'mrep_frip_score' 8 | #pconfig: 9 | # title: 'FRiP score' 10 | # ylab: 'FRiP score' 11 | # ymax: 1 12 | # ymin: 0 13 | # tt_decimals: 2 14 | # cpswitch: False 15 | -------------------------------------------------------------------------------- /assets/multiqc/merged_replicate_peak_annotation_header.txt: -------------------------------------------------------------------------------- 1 | #id: 'mrep_peak_annotation' 2 | #section_name: 'MERGED REP: HOMER peak annotation' 3 | #description: "is generated by calculating the proportion of peaks assigned to genomic features by 4 | # HOMER annotatePeaks.pl." 5 | #plot_type: 'bargraph' 6 | #anchor: 'mrep_peak_annotation' 7 | #pconfig: 8 | # title: 'Peak to feature proportion' 9 | # ylab: 'Peak count' 10 | -------------------------------------------------------------------------------- /assets/multiqc/merged_replicate_peak_count_header.txt: -------------------------------------------------------------------------------- 1 | #id: 'mrep_peak_count' 2 | #section_name: 'MERGED REP: MACS2 Peak count' 3 | #description: "is calculated from total number of peaks called by 4 | # MACS2" 5 | #plot_type: 'bargraph' 6 | #anchor: 'mrep_peak_count' 7 | #pconfig: 8 | # title: 'Total peak count' 9 | # ylab: 'Peak count' 10 | # cpswitch: False 11 | -------------------------------------------------------------------------------- /assets/nf-core-atacseq_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/assets/nf-core-atacseq_logo_light.png -------------------------------------------------------------------------------- /assets/samplesheet.csv: -------------------------------------------------------------------------------- 1 | sample,fastq_1,fastq_2,replicate 2 | CONTROL,AEG588A1_S1_L002_R1_001.fastq.gz,AEG588A1_S1_L002_R2_001.fastq.gz,1 3 | CONTROL,AEG588A2_S2_L002_R1_001.fastq.gz,AEG588A2_S2_L002_R2_001.fastq.gz,2 4 | CONTROL,AEG588A3_S3_L002_R1_001.fastq.gz,AEG588A3_S3_L002_R2_001.fastq.gz,3 5 | TREATMENT,AEG588A4_S4_L003_R1_001.fastq.gz,,1 6 | TREATMENT,AEG588A5_S5_L003_R1_001.fastq.gz,,2 7 | TREATMENT,AEG588A6_S6_L003_R1_001.fastq.gz,,3 8 | TREATMENT,AEG588A6_S6_L004_R1_001.fastq.gz,,3 9 | -------------------------------------------------------------------------------- /assets/schema_input.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema", 3 | "$id": "https://raw.githubusercontent.com/nf-core/atacseq/master/assets/schema_input.json", 4 | "title": "nf-core/atacseq 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 | "replicate": { 34 | "type": "integer", 35 | "pattern": "^[1-9][0-9]*$", 36 | "errorMessage": "Integer representing replicate number. Must start from 1..." 37 | }, 38 | "control": { 39 | "type": "string", 40 | "pattern": "^\\S+$", 41 | "errorMessage": "Control entry cannot contain spaces" 42 | }, 43 | "control_replicate": { 44 | "type": "integer", 45 | "pattern": "^[1-9][0-9]*$", 46 | "errorMessage": "Integer representing control's replicate number." 47 | } 48 | }, 49 | "required": ["sample", "fastq_1", "replicate"] 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /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-atacseq_logo.png" 13 | Content-Transfer-Encoding: base64 14 | Content-ID: 15 | Content-Disposition: inline; filename="nf-core-atacseq_logo_light.png" 16 | 17 | <% out << new File("$projectDir/assets/nf-core-atacseq_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": "nf-core/atacseq 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 | -------------------------------------------------------------------------------- /conf/test.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | Nextflow config file for running minimal tests 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | Defines input files and everything required to run a fast and simple pipeline test. 6 | 7 | Use as follows: 8 | nextflow run nf-core/atacseq -profile test, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'Test profile' 15 | config_profile_description = 'Minimal test dataset to check pipeline function' 16 | 17 | // Limit resources so that this can run on GitHub Actions 18 | max_cpus = 2 19 | max_memory = '6.GB' 20 | max_time = '6.h' 21 | 22 | // Input data 23 | input = 'https://raw.githubusercontent.com/nf-core/test-datasets/atacseq/samplesheet/v2.0/samplesheet_test.csv' 24 | read_length = 50 25 | 26 | // Genome references 27 | mito_name = 'MT' 28 | fasta = 'https://raw.githubusercontent.com/nf-core/test-datasets/atacseq/reference/genome.fa' 29 | gtf = 'https://raw.githubusercontent.com/nf-core/test-datasets/atacseq/reference/genes.gtf' 30 | 31 | // For speed to avoid CI time-out 32 | fingerprint_bins = 100 33 | } 34 | -------------------------------------------------------------------------------- /conf/test_controls.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | Nextflow config file for running minimal tests with control samples 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | Defines input files and everything required to run a fast and simple pipeline test. 6 | 7 | Use as follows: 8 | nextflow run nf-core/atacseq -profile test_controls, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'Test profile with controls' 15 | config_profile_description = 'Minimal test dataset to check pipeline function' 16 | 17 | // Limit resources so that this can run on GitHub Actions 18 | max_cpus = 2 19 | max_memory = '6.GB' 20 | max_time = '6.h' 21 | 22 | // Input data 23 | input = 'https://raw.githubusercontent.com/nf-core/test-datasets/atacseq/samplesheet/v2.1/samplesheet_test_controls.csv' 24 | read_length = 50 25 | 26 | // Genome references 27 | mito_name = 'MT' 28 | fasta = 'https://raw.githubusercontent.com/nf-core/test-datasets/atacseq/reference/genome.fa' 29 | gtf = 'https://raw.githubusercontent.com/nf-core/test-datasets/atacseq/reference/genes.gtf' 30 | 31 | // For speed to avoid CI time-out 32 | fingerprint_bins = 100 33 | } 34 | -------------------------------------------------------------------------------- /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/atacseq -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 18 | input = 'https://raw.githubusercontent.com/nf-core/test-datasets/atacseq/samplesheet/v2.0/samplesheet_full.csv' 19 | 20 | // Used to calculate --macs_gsize 21 | read_length = 50 22 | 23 | // Genome references 24 | genome = 'hg19' 25 | } 26 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # nf-core/atacseq: Documentation 2 | 3 | The nf-core/atacseq 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/igv_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/igv_screenshot.png -------------------------------------------------------------------------------- /docs/images/mqc_annotatePeaks_feature_percentage_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_annotatePeaks_feature_percentage_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_cutadapt_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_cutadapt_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_deeptools_plotFingerprint_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_deeptools_plotFingerprint_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_deeptools_plotProfile_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_deeptools_plotProfile_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_deseq2_pca_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_deseq2_pca_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_deseq2_sample_similarity_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_deseq2_sample_similarity_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_fastqc_adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_fastqc_adapter.png -------------------------------------------------------------------------------- /docs/images/mqc_fastqc_counts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_fastqc_counts.png -------------------------------------------------------------------------------- /docs/images/mqc_fastqc_quality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_fastqc_quality.png -------------------------------------------------------------------------------- /docs/images/mqc_featureCounts_assignment_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_featureCounts_assignment_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_frip_score_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_frip_score_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_macs2_peak_count_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_macs2_peak_count_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_picard_deduplication_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_picard_deduplication_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_picard_insert_size_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_picard_insert_size_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_preseq_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_preseq_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_samtools_idxstats_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_samtools_idxstats_plot.png -------------------------------------------------------------------------------- /docs/images/mqc_samtools_stats_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/mqc_samtools_stats_plot.png -------------------------------------------------------------------------------- /docs/images/nf-core-atacseq_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/nf-core-atacseq_logo_dark.png -------------------------------------------------------------------------------- /docs/images/nf-core-atacseq_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/nf-core-atacseq_logo_light.png -------------------------------------------------------------------------------- /docs/images/nf-core-atacseq_metro_map_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/nf-core-atacseq_metro_map_grey.png -------------------------------------------------------------------------------- /docs/images/r_upsetr_intersect_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/docs/images/r_upsetr_intersect_plot.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 | -------------------------------------------------------------------------------- /lib/WorkflowMain.groovy: -------------------------------------------------------------------------------- 1 | // 2 | // This file holds several functions specific to the main.nf workflow in the nf-core/atacseq pipeline 3 | // 4 | 5 | import nextflow.Nextflow 6 | 7 | class WorkflowMain { 8 | 9 | // 10 | // Citation string for pipeline 11 | // 12 | public static String citation(workflow) { 13 | return "If you use ${workflow.manifest.name} for your analysis please cite:\n\n" + 14 | "* The pipeline\n" + 15 | " https://doi.org/10.5281/zenodo.2634132\n\n" + 16 | "* The nf-core framework\n" + 17 | " https://doi.org/10.1038/s41587-020-0439-x\n\n" + 18 | "* Software dependencies\n" + 19 | " https://github.com/${workflow.manifest.name}/blob/master/CITATIONS.md" 20 | } 21 | 22 | // 23 | // Validate parameters and print summary to screen 24 | // 25 | public static void initialise(workflow, params, log) { 26 | 27 | // Print workflow version and exit on --version 28 | if (params.version) { 29 | String workflow_version = NfcoreTemplate.version(workflow) 30 | log.info "${workflow.manifest.name} ${workflow_version}" 31 | System.exit(0) 32 | } 33 | 34 | // Check that a -profile or Nextflow config has been provided to run the pipeline 35 | NfcoreTemplate.checkConfigProvided(workflow, log) 36 | 37 | // Check that conda channels are set-up correctly 38 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 39 | Utils.checkCondaChannels(log) 40 | } 41 | 42 | // Check AWS batch settings 43 | NfcoreTemplate.awsBatch(workflow, params) 44 | } 45 | 46 | // 47 | // Get attribute from genome config file e.g. fasta 48 | // 49 | public static Object getGenomeAttribute(params, attribute) { 50 | if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) { 51 | if (params.genomes[ params.genome ].containsKey(attribute)) { 52 | return params.genomes[ params.genome ][ attribute ] 53 | } 54 | } 55 | return null 56 | } 57 | 58 | // 59 | // Get macs genome size (macs_gsize) 60 | // 61 | public static Long getMacsGsize(params) { 62 | def val = null 63 | if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) { 64 | if (params.genomes[ params.genome ].containsKey('macs_gsize')) { 65 | if (params.genomes[ params.genome ][ 'macs_gsize' ].containsKey(params.read_length.toString())) { 66 | val = params.genomes[ params.genome ][ 'macs_gsize' ][ params.read_length.toString() ] 67 | } 68 | } 69 | } 70 | return val 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/nfcore_external_java_deps.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/atacseq/1a1dbe52ffbd82256c941a032b0e22abbd925b8a/lib/nfcore_external_java_deps.jar -------------------------------------------------------------------------------- /modules/local/bam_remove_orphans.nf: -------------------------------------------------------------------------------- 1 | process BAM_REMOVE_ORPHANS { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::pysam=0.19.0 bioconda::samtools=1.15.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/mulled-v2-57736af1eb98c01010848572c9fec9fff6ffaafd:402e865b8f6af2f3e58c6fc8d57127ff0144b2c7-0' : 8 | 'biocontainers/mulled-v2-57736af1eb98c01010848572c9fec9fff6ffaafd:402e865b8f6af2f3e58c6fc8d57127ff0144b2c7-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: // This script is bundled with the pipeline, in nf-core/atacseq/bin/ 21 | def args = task.ext.args ?: '' 22 | def prefix = task.ext.prefix ?: "${meta.id}" 23 | if (!meta.single_end) { 24 | """ 25 | bampe_rm_orphan.py \\ 26 | $bam \\ 27 | ${prefix}.bam \\ 28 | $args 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 | } else { 36 | """ 37 | ln -s $bam ${prefix}.bam 38 | 39 | cat <<-END_VERSIONS > versions.yml 40 | "${task.process}": 41 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 42 | END_VERSIONS 43 | """ 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /modules/local/bamtools_filter.nf: -------------------------------------------------------------------------------- 1 | process BAMTOOLS_FILTER { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::bamtools=2.5.2 bioconda::samtools=1.15.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/mulled-v2-0560a8046fc82aa4338588eca29ff18edab2c5aa:5687a7da26983502d0a8a9a6b05ed727c740ddc4-0' : 8 | 'biocontainers/mulled-v2-0560a8046fc82aa4338588eca29ff18edab2c5aa:5687a7da26983502d0a8a9a6b05ed727c740ddc4-0' }" 9 | 10 | input: 11 | tuple val(meta), path(bam), path(bai) 12 | path bed 13 | path bamtools_filter_se_config 14 | path bamtools_filter_pe_config 15 | 16 | output: 17 | tuple val(meta), path("*.bam"), emit: bam 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 prefix = task.ext.prefix ?: "${meta.id}" 26 | def blacklist = bed ? "-L $bed" : '' 27 | def config = meta.single_end ? bamtools_filter_se_config : bamtools_filter_pe_config 28 | """ 29 | samtools view \\ 30 | $args \\ 31 | $blacklist \\ 32 | -b $bam \\ 33 | | bamtools filter \\ 34 | -out ${prefix}.bam \\ 35 | -script $config 36 | 37 | cat <<-END_VERSIONS > versions.yml 38 | "${task.process}": 39 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 40 | bamtools: \$(echo \$(bamtools --version 2>&1) | sed 's/^.*bamtools //; s/Part .*\$//') 41 | END_VERSIONS 42 | """ 43 | } 44 | -------------------------------------------------------------------------------- /modules/local/bedtools_genomecov.nf: -------------------------------------------------------------------------------- 1 | process BEDTOOLS_GENOMECOV { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::bedtools=2.30.0" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0': 8 | 'biocontainers/bedtools:2.30.0--hc088bd4_0' }" 9 | 10 | input: 11 | tuple val(meta), path(bam), path(flagstat) 12 | 13 | output: 14 | tuple val(meta), path("*.bedGraph"), emit: bedgraph 15 | tuple val(meta), path("*.txt") , emit: scale_factor 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 pe = meta.single_end ? '' : '-pc' 25 | """ 26 | SCALE_FACTOR=\$(grep '[0-9] mapped (' $flagstat | awk '{print 1000000/\$1}') 27 | echo \$SCALE_FACTOR > ${prefix}.scale_factor.txt 28 | 29 | bedtools \\ 30 | genomecov \\ 31 | -ibam $bam \\ 32 | -bg \\ 33 | -scale \$SCALE_FACTOR \\ 34 | $pe \\ 35 | $args \\ 36 | > tmp.bg 37 | 38 | bedtools sort -i tmp.bg > ${prefix}.bedGraph 39 | 40 | cat <<-END_VERSIONS > versions.yml 41 | "${task.process}": 42 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 43 | END_VERSIONS 44 | """ 45 | } 46 | -------------------------------------------------------------------------------- /modules/local/frip_score.nf: -------------------------------------------------------------------------------- 1 | process FRIP_SCORE { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::bedtools=2.30.0 bioconda::samtools=1.15.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/mulled-v2-8186960447c5cb2faa697666dc1e6d919ad23f3e:3127fcae6b6bdaf8181e21a26ae61231030a9fcb-0': 8 | 'biocontainers/mulled-v2-8186960447c5cb2faa697666dc1e6d919ad23f3e:3127fcae6b6bdaf8181e21a26ae61231030a9fcb-0' }" 9 | 10 | input: 11 | tuple val(meta), path(bam), path(peak) 12 | 13 | output: 14 | tuple val(meta), path("*.txt"), emit: txt 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 | READS_IN_PEAKS=\$(intersectBed -a $bam -b $peak $args | awk -F '\t' '{sum += \$NF} END {print sum}') 25 | samtools flagstat $bam > ${bam}.flagstat 26 | grep 'mapped (' ${bam}.flagstat | grep -v "primary" | awk -v a="\$READS_IN_PEAKS" -v OFS='\t' '{print "${prefix}", a/\$1}' > ${prefix}.FRiP.txt 27 | 28 | cat <<-END_VERSIONS > versions.yml 29 | "${task.process}": 30 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 31 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 32 | END_VERSIONS 33 | """ 34 | } 35 | -------------------------------------------------------------------------------- /modules/local/genome_blacklist_regions.nf: -------------------------------------------------------------------------------- 1 | process GENOME_BLACKLIST_REGIONS { 2 | tag "$sizes" 3 | 4 | conda "bioconda::bedtools=2.30.0" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0': 7 | 'biocontainers/bedtools:2.30.0--hc088bd4_0' }" 8 | 9 | input: 10 | path sizes 11 | path blacklist 12 | val mito_name 13 | val keep_mito 14 | 15 | output: 16 | path '*.bed' , emit: bed 17 | path "versions.yml", emit: versions 18 | 19 | when: 20 | task.ext.when == null || task.ext.when 21 | 22 | script: 23 | def file_out = "${sizes.simpleName}.include_regions.bed" 24 | def name_filter = mito_name ? "| awk '\$1 !~ /${params.mito_name}/ {print \$0}'": '' 25 | def mito_filter = keep_mito ? '' : name_filter 26 | if (blacklist) { 27 | """ 28 | sortBed -i $blacklist -g $sizes | complementBed -i stdin -g $sizes $mito_filter > $file_out 29 | 30 | cat <<-END_VERSIONS > versions.yml 31 | "${task.process}": 32 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 33 | END_VERSIONS 34 | """ 35 | } else { 36 | """ 37 | awk '{print \$1, '0' , \$2}' OFS='\t' $sizes $mito_filter > $file_out 38 | 39 | cat <<-END_VERSIONS > versions.yml 40 | "${task.process}": 41 | bedtools: \$(bedtools --version | sed -e "s/bedtools v//g") 42 | END_VERSIONS 43 | """ 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /modules/local/get_autosomes.nf: -------------------------------------------------------------------------------- 1 | process GET_AUTOSOMES { 2 | tag "$fai" 3 | 4 | conda "conda-forge::python=3.8.3" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/python:3.8.3' : 7 | 'biocontainers/python:3.8.3' }" 8 | 9 | input: 10 | path fai 11 | 12 | output: 13 | path '*.txt' , emit: txt 14 | path "versions.yml", emit: versions 15 | 16 | when: 17 | task.ext.when == null || task.ext.when 18 | 19 | script: // This script is bundled with the pipeline, in nf-core/atacseq/bin/ 20 | """ 21 | get_autosomes.py \\ 22 | $fai \\ 23 | ${fai.baseName}.autosomes.txt 24 | 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | python: \$(python --version | sed 's/Python //g') 28 | END_VERSIONS 29 | """ 30 | } 31 | -------------------------------------------------------------------------------- /modules/local/gtf2bed.nf: -------------------------------------------------------------------------------- 1 | process GTF2BED { 2 | tag "$gtf" 3 | label 'process_low' 4 | 5 | conda "conda-forge::perl=5.26.2" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/perl:5.26.2': 8 | 'biocontainers/perl:5.26.2' }" 9 | 10 | input: 11 | path gtf 12 | 13 | output: 14 | path '*.bed' , emit: bed 15 | path "versions.yml", emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: // This script is bundled with the pipeline, in nf-core/atacseq/bin/ 21 | """ 22 | gtf2bed \\ 23 | $gtf \\ 24 | > ${gtf.baseName}.bed 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | perl: \$(echo \$(perl --version 2>&1) | sed 's/.*v\\(.*\\)) built.*/\\1/') 29 | END_VERSIONS 30 | """ 31 | } 32 | -------------------------------------------------------------------------------- /modules/local/igv.nf: -------------------------------------------------------------------------------- 1 | process IGV { 2 | 3 | conda "conda-forge::python=3.8.3" 4 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 5 | 'https://depot.galaxyproject.org/singularity/python:3.8.3': 6 | 'biocontainers/python:3.8.3' }" 7 | 8 | input: 9 | path fasta 10 | path fai 11 | path ("${bigwig_library_publish_dir}/*") 12 | path ("${peak_library_publish_dir}/*") 13 | path ("${consensus_library_publish_dir}/*") 14 | path ("${bigwig_replicate_publish_dir}/*") 15 | path ("${peak_replicate_publish_dir}/*") 16 | path ("${consensus_replicate_publish_dir}/*") 17 | val bigwig_library_publish_dir 18 | val peak_library_publish_dir 19 | val consensus_library_publish_dir 20 | val bigwig_replicate_publish_dir 21 | val peak_replicate_publish_dir 22 | val consensus_replicate_publish_dir 23 | 24 | output: 25 | // Publish fasta file while copyTo fails when the source and destination buckets are in different regions 26 | path "*files.txt" , emit: txt 27 | path "*.xml" , emit: xml 28 | path fasta , emit: fasta 29 | path fai , emit: fai 30 | path "versions.yml", emit: versions 31 | 32 | when: 33 | task.ext.when == null || task.ext.when 34 | 35 | script: // scripts are bundled with the pipeline in nf-core/atacseq/bin/ 36 | """ 37 | find * -type l -name "*.bigWig" -exec echo -e ""{}"\\t0,0,178" \\; | { grep "^$bigwig_library_publish_dir" || test \$? = 1; } > mLb_bigwig.igv.txt 38 | find * -type l -name "*Peak" -exec echo -e ""{}"\\t0,0,178" \\; | { grep "^$peak_library_publish_dir" || test \$? = 1; } > mLb_peaks.igv.txt 39 | find * -type l -name "*.bed" -exec echo -e ""{}"\\t0,0,0" \\; | { grep "^$consensus_library_publish_dir" || test \$? = 1; } > mLb_bed.igv.txt 40 | find * -type l -name "*.bigWig" -exec echo -e ""{}"\\t0,0,178" \\; | { grep "^$bigwig_replicate_publish_dir" || test \$? = 1; } > mRp_bigwig.igv.txt 41 | find * -type l -name "*Peak" -exec echo -e ""{}"\\t0,0,178" \\; | { grep "^$peak_replicate_publish_dir" || test \$? = 1; } > mRp_peaks.igv.txt 42 | find * -type l -name "*.bed" -exec echo -e ""{}"\\t0,0,0" \\; | { grep "^$consensus_replicate_publish_dir" || test \$? = 1; } > mRp_bed.igv.txt 43 | 44 | cat *.txt > igv_files.txt 45 | igv_files_to_session.py igv_session.xml igv_files.txt ../../genome/${fasta.getName()} --path_prefix '../../' 46 | 47 | cat <<-END_VERSIONS > versions.yml 48 | "${task.process}": 49 | python: \$(python --version | sed 's/Python //g') 50 | END_VERSIONS 51 | """ 52 | } 53 | -------------------------------------------------------------------------------- /modules/local/macs2_consensus.nf: -------------------------------------------------------------------------------- 1 | process MACS2_CONSENSUS { 2 | tag "$meta.id" 3 | label 'process_long' 4 | 5 | conda "conda-forge::biopython conda-forge::r-optparse=1.7.1 conda-forge::r-upsetr=1.4.0 bioconda::bedtools=2.30.0" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/mulled-v2-2f48cc59b03027e31ead6d383fe1b8057785dd24:5d182f583f4696f4c4d9f3be93052811b383341f-0': 8 | 'biocontainers/mulled-v2-2f48cc59b03027e31ead6d383fe1b8057785dd24:5d182f583f4696f4c4d9f3be93052811b383341f-0' }" 9 | 10 | input: 11 | tuple val(meta), path(peaks) 12 | val is_narrow_peak 13 | 14 | output: 15 | tuple val(meta), path("*.bed") , emit: bed 16 | tuple val(meta), path("*.saf") , emit: saf 17 | tuple val(meta), path("*.pdf") , emit: pdf 18 | tuple val(meta), path("*.boolean.txt") , emit: boolean_txt 19 | tuple val(meta), path("*.intersect.txt"), emit: intersect_txt 20 | path "versions.yml" , emit: versions 21 | 22 | when: 23 | task.ext.when == null || task.ext.when 24 | 25 | script: // This script is bundled with the pipeline, in nf-core/atacseq/bin/ 26 | def args = task.ext.args ?: '' 27 | def prefix = task.ext.prefix ?: "${meta.id}" 28 | def peak_type = is_narrow_peak ? 'narrowPeak' : 'broadPeak' 29 | def mergecols = is_narrow_peak ? (2..10).join(',') : (2..9).join(',') 30 | def collapsecols = is_narrow_peak ? (['collapse']*9).join(',') : (['collapse']*8).join(',') 31 | def expandparam = is_narrow_peak ? '--is_narrow_peak' : '' 32 | """ 33 | sort -T '.' -k1,1 -k2,2n ${peaks.collect{it.toString()}.sort().join(' ')} \\ 34 | | mergeBed -c $mergecols -o $collapsecols > ${prefix}.txt 35 | 36 | macs2_merged_expand.py \\ 37 | ${prefix}.txt \\ 38 | ${peaks.collect{it.toString()}.sort().join(',').replaceAll("_peaks.${peak_type}","")} \\ 39 | ${prefix}.boolean.txt \\ 40 | $args \\ 41 | $expandparam 42 | 43 | awk -v FS='\t' -v OFS='\t' 'FNR > 1 { print \$1, \$2, \$3, \$4, "0", "+" }' ${prefix}.boolean.txt > ${prefix}.bed 44 | 45 | echo -e "GeneID\tChr\tStart\tEnd\tStrand" > ${prefix}.saf 46 | awk -v FS='\t' -v OFS='\t' 'FNR > 1 { print \$4, \$1, \$2, \$3, "+" }' ${prefix}.boolean.txt >> ${prefix}.saf 47 | 48 | plot_peak_intersect.r -i ${prefix}.boolean.intersect.txt -o ${prefix}.boolean.intersect.plot.pdf 49 | 50 | cat <<-END_VERSIONS > versions.yml 51 | "${task.process}": 52 | python: \$(python --version | sed 's/Python //g') 53 | r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') 54 | END_VERSIONS 55 | """ 56 | } 57 | -------------------------------------------------------------------------------- /modules/local/multiqc.nf: -------------------------------------------------------------------------------- 1 | process MULTIQC { 2 | label 'process_medium' 3 | 4 | conda 'bioconda::multiqc=1.13' 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/multiqc:1.13--pyhdfd78af_0' : 7 | 'biocontainers/multiqc:1.13--pyhdfd78af_0' }" 8 | 9 | input: 10 | path multiqc_config 11 | path multiqc_custom_config 12 | path software_versions 13 | path workflow_summary 14 | 15 | path ('fastqc/*') 16 | path ('trimgalore/fastqc/*') 17 | path ('trimgalore/*') 18 | 19 | path ('alignment/library/*') 20 | path ('alignment/library/*') 21 | path ('alignment/library/*') 22 | 23 | path ('alignment/merged_library/unfiltered/*') 24 | path ('alignment/merged_library/unfiltered/*') 25 | path ('alignment/merged_library/unfiltered/*') 26 | path ('alignment/merged_library/unfiltered/picard_metrics/*') 27 | 28 | path ('alignment/merged_library/filtered/*') 29 | path ('alignment/merged_library/filtered/*') 30 | path ('alignment/merged_library/filtered/*') 31 | path ('alignment/merged_library/filtered/picard_metrics/*') 32 | 33 | path ('preseq/*') 34 | 35 | path ('deeptools/*') 36 | path ('deeptools/*') 37 | 38 | path ('macs2/merged_library/peaks/*') 39 | path ('macs2/merged_library/peaks/*') 40 | path ('macs2/merged_library/annotation/*') 41 | path ('macs2/merged_library/featurecounts/*') 42 | 43 | path ('alignment/merged_replicate/*') 44 | path ('alignment/merged_replicate/*') 45 | path ('alignment/merged_replicate/*') 46 | path ('alignment/merged_replicate/picard_metrics/*') 47 | 48 | path ('macs2/merged_replicate/peaks/*') 49 | path ('macs2/merged_replicate/peaks/*') 50 | path ('macs2/merged_replicate/annotation/*') 51 | path ('macs2/merged_replicate/featurecounts/*') 52 | 53 | path ('deseq2_library/*') 54 | path ('deseq2_library/*') 55 | path ('deseq2_replicate/*') 56 | path ('deseq2_replicate/*') 57 | 58 | output: 59 | path "*multiqc_report.html", emit: report 60 | path "*_data" , emit: data 61 | path "*_plots" , optional:true, emit: plots 62 | path "versions.yml" , emit: versions 63 | 64 | when: 65 | task.ext.when == null || task.ext.when 66 | 67 | script: 68 | def args = task.ext.args ?: '' 69 | def custom_config = params.multiqc_config ? "--config $multiqc_custom_config" : '' 70 | """ 71 | multiqc \\ 72 | -f \\ 73 | $args \\ 74 | $custom_config \\ 75 | . 76 | 77 | cat <<-END_VERSIONS > versions.yml 78 | "${task.process}": 79 | multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) 80 | END_VERSIONS 81 | """ 82 | } 83 | -------------------------------------------------------------------------------- /modules/local/multiqc_custom_peaks.nf: -------------------------------------------------------------------------------- 1 | process MULTIQC_CUSTOM_PEAKS { 2 | tag "$meta.id" 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 | 'nf-core/ubuntu:20.04' }" 8 | 9 | input: 10 | tuple val(meta), path(peak), path(frip) 11 | path peak_count_header 12 | path frip_score_header 13 | 14 | output: 15 | tuple val(meta), path("*.count_mqc.tsv"), emit: count 16 | tuple val(meta), path("*.FRiP_mqc.tsv") , emit: frip 17 | path "versions.yml" , emit: versions 18 | 19 | when: 20 | task.ext.when == null || task.ext.when 21 | 22 | script: 23 | def prefix = task.ext.prefix ?: "${meta.id}" 24 | """ 25 | cat $peak | wc -l | awk -v OFS='\t' '{ print "${prefix}", \$1 }' | cat $peak_count_header - > ${prefix}.count_mqc.tsv 26 | cat $frip_score_header $frip > ${prefix}.FRiP_mqc.tsv 27 | 28 | cat <<-END_VERSIONS > versions.yml 29 | "${task.process}": 30 | sed: \$(echo \$(sed --version 2>&1) | sed 's/^.*GNU sed) //; s/ .*\$//') 31 | END_VERSIONS 32 | """ 33 | } 34 | -------------------------------------------------------------------------------- /modules/local/plot_homer_annotatepeaks.nf: -------------------------------------------------------------------------------- 1 | process PLOT_HOMER_ANNOTATEPEAKS { 2 | label 'process_medium' 3 | 4 | conda "conda-forge::r-base=4.0.3 conda-forge::r-reshape2=1.4.4 conda-forge::r-optparse=1.6.6 conda-forge::r-ggplot2=3.3.3 conda-forge::r-scales=1.1.1 conda-forge::r-viridis=0.5.1 conda-forge::r-tidyverse=1.3.0 bioconda::bioconductor-biostrings=2.58.0 bioconda::bioconductor-complexheatmap=2.6.2" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/mulled-v2-ad9dd5f398966bf899ae05f8e7c54d0fb10cdfa7:05678da05b8e5a7a5130e90a9f9a6c585b965afa-0': 7 | 'biocontainers/mulled-v2-ad9dd5f398966bf899ae05f8e7c54d0fb10cdfa7:05678da05b8e5a7a5130e90a9f9a6c585b965afa-0' }" 8 | 9 | input: 10 | path annos 11 | path mqc_header 12 | val suffix 13 | 14 | output: 15 | path '*.txt' , emit: txt 16 | path '*.pdf' , emit: pdf 17 | path '*.tsv' , emit: tsv 18 | path "versions.yml", emit: versions 19 | 20 | when: 21 | task.ext.when == null || task.ext.when 22 | 23 | script: // This script is bundled with the pipeline, in nf-core/chipseq/bin/ 24 | def args = task.ext.args ?: '' 25 | def prefix = task.ext.prefix ?: "annotatepeaks" 26 | """ 27 | plot_homer_annotatepeaks.r \\ 28 | -i ${annos.join(',')} \\ 29 | -s ${annos.join(',').replaceAll("${suffix}","")} \\ 30 | -p $prefix \\ 31 | $args 32 | 33 | find ./ -type f -name "*summary.txt" -exec cat {} \\; | cat $mqc_header - > ${prefix}.summary_mqc.tsv 34 | 35 | cat <<-END_VERSIONS > versions.yml 36 | "${task.process}": 37 | r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') 38 | END_VERSIONS 39 | """ 40 | } 41 | -------------------------------------------------------------------------------- /modules/local/plot_macs2_qc.nf: -------------------------------------------------------------------------------- 1 | process PLOT_MACS2_QC { 2 | label 'process_medium' 3 | 4 | conda "conda-forge::r-base=4.0.3 conda-forge::r-reshape2=1.4.4 conda-forge::r-optparse=1.6.6 conda-forge::r-ggplot2=3.3.3 conda-forge::r-scales=1.1.1 conda-forge::r-viridis=0.5.1 conda-forge::r-tidyverse=1.3.0 bioconda::bioconductor-biostrings=2.58.0 bioconda::bioconductor-complexheatmap=2.6.2" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/mulled-v2-ad9dd5f398966bf899ae05f8e7c54d0fb10cdfa7:05678da05b8e5a7a5130e90a9f9a6c585b965afa-0': 7 | 'biocontainers/mulled-v2-ad9dd5f398966bf899ae05f8e7c54d0fb10cdfa7:05678da05b8e5a7a5130e90a9f9a6c585b965afa-0' }" 8 | 9 | input: 10 | path peaks 11 | val is_narrow_peak 12 | 13 | output: 14 | path '*.txt' , emit: txt 15 | path '*.pdf' , emit: pdf 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/atacseq/bin/ 22 | def args = task.ext.args ?: '' 23 | def peak_type = is_narrow_peak ? 'narrowPeak' : 'broadPeak' 24 | """ 25 | plot_macs2_qc.r \\ 26 | -i ${peaks.join(',')} \\ 27 | -s ${peaks.join(',').replaceAll("_peaks.${peak_type}","")} \\ 28 | $args 29 | 30 | cat <<-END_VERSIONS > versions.yml 31 | "${task.process}": 32 | r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') 33 | END_VERSIONS 34 | """ 35 | } 36 | -------------------------------------------------------------------------------- /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 | 'biocontainers/python:3.8.3' }" 9 | 10 | input: 11 | path samplesheet 12 | 13 | output: 14 | path '*.csv' , emit: csv 15 | path "versions.yml", emit: versions 16 | 17 | when: 18 | task.ext.when == null || task.ext.when 19 | 20 | script: // This script is bundled with the pipeline, in nf-core/atacseq/bin/ 21 | def args = task.ext.args ?: '' 22 | """ 23 | check_samplesheet.py \\ 24 | $samplesheet \\ 25 | $args 26 | 27 | cat <<-END_VERSIONS > versions.yml 28 | "${task.process}": 29 | python: \$(python --version | sed 's/Python //g') 30 | END_VERSIONS 31 | """ 32 | } 33 | -------------------------------------------------------------------------------- /modules/local/star_align.nf: -------------------------------------------------------------------------------- 1 | process STAR_ALIGN { 2 | tag "$meta.id" 3 | label 'process_high' 4 | 5 | // Note: 2.7X indices incompatible with AWS iGenomes. 6 | conda "bioconda::star=2.6.1d" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/star:2.6.1d--0' : 9 | 'biocontainers/star:2.6.1d--0' }" 10 | 11 | input: 12 | tuple val(meta), path(reads) 13 | path index 14 | val seq_center 15 | 16 | output: 17 | tuple val(meta), path('*d.out.bam') , emit: bam 18 | tuple val(meta), path('*Log.final.out') , emit: log_final 19 | tuple val(meta), path('*Log.out') , emit: log_out 20 | tuple val(meta), path('*Log.progress.out'), emit: log_progress 21 | path "versions.yml" , emit: versions 22 | 23 | tuple val(meta), path('*sortedByCoord.out.bam') , optional:true, emit: bam_sorted 24 | tuple val(meta), path('*toTranscriptome.out.bam'), optional:true, emit: bam_transcript 25 | tuple val(meta), path('*Aligned.unsort.out.bam') , optional:true, emit: bam_unsorted 26 | tuple val(meta), path('*fastq.gz') , optional:true, emit: fastq 27 | tuple val(meta), path('*.tab') , optional:true, emit: tab 28 | 29 | when: 30 | task.ext.when == null || task.ext.when 31 | 32 | script: 33 | def args = task.ext.args ?: '' 34 | def prefix = task.ext.prefix ?: "${meta.id}" 35 | def seq_center_tag = seq_center ? "--outSAMattrRGline ID:$prefix 'CN:$seq_center' 'SM:$prefix'" : "--outSAMattrRGline ID:$prefix 'SM:$prefix'" 36 | def out_sam_type = (args.contains('--outSAMtype')) ? '' : '--outSAMtype BAM Unsorted' 37 | def mv_unsorted_bam = (args.contains('--outSAMtype BAM Unsorted SortedByCoordinate')) ? "mv ${prefix}.Aligned.out.bam ${prefix}.Aligned.unsort.out.bam" : '' 38 | """ 39 | STAR \\ 40 | --genomeDir $index \\ 41 | --readFilesIn $reads \\ 42 | --runThreadN $task.cpus \\ 43 | --outFileNamePrefix $prefix. \\ 44 | $out_sam_type \\ 45 | $seq_center_tag \\ 46 | $args 47 | $mv_unsorted_bam 48 | if [ -f ${prefix}.Unmapped.out.mate1 ]; then 49 | mv ${prefix}.Unmapped.out.mate1 ${prefix}.unmapped_1.fastq 50 | gzip ${prefix}.unmapped_1.fastq 51 | fi 52 | if [ -f ${prefix}.Unmapped.out.mate2 ]; then 53 | mv ${prefix}.Unmapped.out.mate2 ${prefix}.unmapped_2.fastq 54 | gzip ${prefix}.unmapped_2.fastq 55 | fi 56 | cat <<-END_VERSIONS > versions.yml 57 | "${task.process}": 58 | star: \$(STAR --version | sed -e "s/STAR_//g") 59 | END_VERSIONS 60 | """ 61 | } 62 | -------------------------------------------------------------------------------- /modules/local/star_genomegenerate.nf: -------------------------------------------------------------------------------- 1 | process STAR_GENOMEGENERATE { 2 | tag "$fasta" 3 | label 'process_high' 4 | 5 | // Note: 2.7X indices incompatible with AWS iGenomes. 6 | conda "bioconda::star=2.6.1d bioconda::samtools=1.10 conda-forge::gawk=5.1.0" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:59cdd445419f14abac76b31dd0d71217994cbcc9-0' : 9 | 'biocontainers/mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:59cdd445419f14abac76b31dd0d71217994cbcc9-0' }" 10 | 11 | input: 12 | path fasta 13 | path gtf 14 | 15 | output: 16 | path "star" , emit: index 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 ?: '').tokenize() 24 | def memory = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' 25 | if (args.contains('--genomeSAindexNbases')) { 26 | """ 27 | mkdir star 28 | STAR \\ 29 | --runMode genomeGenerate \\ 30 | --genomeDir star/ \\ 31 | --genomeFastaFiles $fasta \\ 32 | --sjdbGTFfile $gtf \\ 33 | --runThreadN $task.cpus \\ 34 | $memory \\ 35 | ${args.join(' ')} 36 | cat <<-END_VERSIONS > versions.yml 37 | "${task.process}": 38 | star: \$(STAR --version | sed -e "s/STAR_//g") 39 | END_VERSIONS 40 | """ 41 | } else { 42 | """ 43 | samtools faidx $fasta 44 | NUM_BASES=`gawk '{sum = sum + \$2}END{if ((log(sum)/log(2))/2 - 1 > 14) {printf "%.0f", 14} else {printf "%.0f", (log(sum)/log(2))/2 - 1}}' ${fasta}.fai` 45 | mkdir star 46 | STAR \\ 47 | --runMode genomeGenerate \\ 48 | --genomeDir star/ \\ 49 | --genomeFastaFiles $fasta \\ 50 | --sjdbGTFfile $gtf \\ 51 | --runThreadN $task.cpus \\ 52 | --genomeSAindexNbases \$NUM_BASES \\ 53 | $memory \\ 54 | ${args.join(' ')} 55 | cat <<-END_VERSIONS > versions.yml 56 | "${task.process}": 57 | star: \$(STAR --version | sed -e "s/STAR_//g") 58 | END_VERSIONS 59 | """ 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /modules/local/tss_extract.nf: -------------------------------------------------------------------------------- 1 | process TSS_EXTRACT { 2 | 3 | conda "conda-forge::sed=4.7" 4 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 5 | 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : 6 | 'nf-core/ubuntu:20.04' }" 7 | 8 | input: 9 | path bed 10 | 11 | output: 12 | path "*.bed" , emit: tss 13 | path "versions.yml", emit: versions 14 | 15 | when: 16 | task.ext.when == null || task.ext.when 17 | 18 | script: 19 | """ 20 | cat $bed | awk -v FS='\t' -v OFS='\t' '{ if(\$6=="+") \$3=\$2+1; else \$2=\$3-1; print \$1, \$2, \$3, \$4, \$5, \$6;}' > ${bed.baseName}.tss.bed 21 | 22 | cat <<-END_VERSIONS > versions.yml 23 | "${task.process}": 24 | sed: \$(echo \$(sed --version 2>&1) | sed 's/^.*GNU sed) //; s/ .*\$//') 25 | END_VERSIONS 26 | """ 27 | } 28 | -------------------------------------------------------------------------------- /modules/nf-core/ataqv/ataqv/main.nf: -------------------------------------------------------------------------------- 1 | process ATAQV_ATAQV { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda 'bioconda::ataqv=1.3.1' 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/ataqv:1.3.1--py310ha155cf9_1' : 8 | 'biocontainers/ataqv:1.3.1--py310ha155cf9_1' }" 9 | 10 | input: 11 | tuple val(meta), path(bam), path(bai), path(peak_file) 12 | val organism 13 | val mito_name 14 | path tss_file 15 | path excl_regs_file 16 | path autosom_ref_file 17 | 18 | output: 19 | tuple val(meta), path("*.ataqv.json"), emit: json 20 | tuple val(meta), path("*.problems") , emit: problems, optional: true 21 | path "versions.yml" , emit: versions 22 | 23 | when: 24 | task.ext.when == null || task.ext.when 25 | 26 | script: 27 | def args = task.ext.args ?: '' 28 | def mito = mito_name ? "--mitochondrial-reference-name ${mito_name}" : '' 29 | def prefix = task.ext.prefix ?: "${meta.id}" 30 | def peak = peak_file ? "--peak-file $peak_file" : '' 31 | def tss = tss_file ? "--tss-file $tss_file" : '' 32 | def excl_regs = excl_regs_file ? "--excluded-region-file $excl_regs_file" : '' 33 | def autosom_ref = autosom_ref_file ? "--autosomal-reference-file $autosom_ref_file" : '' 34 | """ 35 | ataqv \\ 36 | $args \\ 37 | $mito \\ 38 | $peak \\ 39 | $tss \\ 40 | $excl_regs \\ 41 | $autosom_ref \\ 42 | --metrics-file "${prefix}.ataqv.json" \\ 43 | --threads $task.cpus \\ 44 | --name $prefix \\ 45 | $organism \\ 46 | $bam 47 | 48 | cat <<-END_VERSIONS > versions.yml 49 | "${task.process}": 50 | ataqv: \$( ataqv --version ) 51 | END_VERSIONS 52 | """ 53 | } 54 | -------------------------------------------------------------------------------- /modules/nf-core/ataqv/mkarv/main.nf: -------------------------------------------------------------------------------- 1 | process ATAQV_MKARV { 2 | label 'process_medium' 3 | 4 | conda 'bioconda::ataqv=1.3.1' 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/ataqv:1.3.1--py310ha155cf9_1': 7 | 'biocontainers/ataqv:1.3.1--py310ha155cf9_1' }" 8 | 9 | input: 10 | path "jsons/*" 11 | 12 | output: 13 | path "html" , emit: html 14 | path "versions.yml", emit: versions 15 | 16 | when: 17 | task.ext.when == null || task.ext.when 18 | 19 | script: 20 | def args = task.ext.args ?: '' 21 | """ 22 | mkarv \\ 23 | $args \\ 24 | --concurrency $task.cpus \\ 25 | --force \\ 26 | ./html/ \\ 27 | jsons/* 28 | 29 | cat <<-END_VERSIONS > versions.yml 30 | "${task.process}": 31 | # mkarv: \$( mkarv --version ) # Use this when version string has been fixed 32 | ataqv: \$( ataqv --version ) 33 | END_VERSIONS 34 | """ 35 | } 36 | -------------------------------------------------------------------------------- /modules/nf-core/ataqv/mkarv/meta.yml: -------------------------------------------------------------------------------- 1 | name: "ataqv_mkarv" 2 | description: mkarv function of a corresponding ataqv tool 3 | keywords: 4 | - ataqv 5 | - ATAC-seq 6 | - qc 7 | - ataqv 8 | - mkarv 9 | 10 | tools: 11 | - "ataqv": 12 | description: "ataqv is a toolkit for measuring and comparing ATAC-seq results. It was written to help understand how well ATAC-seq assays have worked, and to make it easier to spot differences that might be caused by library prep or sequencing." 13 | homepage: "https://github.com/ParkerLab/ataqv/blob/master/README.rst" 14 | documentation: "https://github.com/ParkerLab/ataqv/blob/master/README.rst" 15 | tool_dev_url: "https://github.com/ParkerLab/ataqv" 16 | 17 | licence: "['GPL v3']" 18 | 19 | input: 20 | - json: 21 | type: file 22 | description: The JSON file with ataqv metrics 23 | pattern: "*.json" 24 | 25 | output: 26 | - versions: 27 | type: file 28 | description: File containing software versions 29 | pattern: "versions.yml" 30 | - html: 31 | type: directory 32 | description: Web application to visualize results in HTML format 33 | pattern: "*.html" 34 | 35 | authors: 36 | - "@bjlang" 37 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/align/meta.yml: -------------------------------------------------------------------------------- 1 | name: bowtie2_align 2 | description: Align reads to a reference genome using bowtie2 3 | keywords: 4 | - align 5 | - map 6 | - fasta 7 | - fastq 8 | - genome 9 | - reference 10 | tools: 11 | - bowtie2: 12 | description: | 13 | Bowtie 2 is an ultrafast and memory-efficient tool for aligning 14 | sequencing reads to long reference sequences. 15 | homepage: http://bowtie-bio.sourceforge.net/bowtie2/index.shtml 16 | documentation: http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml 17 | doi: 10.1038/nmeth.1923 18 | licence: ["GPL-3.0-or-later"] 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 | - meta2: 31 | type: map 32 | description: | 33 | Groovy Map containing reference information 34 | e.g. [ id:'test', single_end:false ] 35 | - index: 36 | type: file 37 | description: Bowtie2 genome index files 38 | pattern: "*.ebwt" 39 | - save_unaligned: 40 | type: boolean 41 | description: | 42 | Save reads that do not map to the reference (true) or discard them (false) 43 | (default: false) 44 | - sort_bam: 45 | type: boolean 46 | description: use samtools sort (true) or samtools view (false) 47 | pattern: "true or false" 48 | output: 49 | - aligned: 50 | type: file 51 | description: Output BAM/SAM file containing read alignments 52 | pattern: "*.{bam,sam}" 53 | - versions: 54 | type: file 55 | description: File containing software versions 56 | pattern: "versions.yml" 57 | - fastq: 58 | type: file 59 | description: Unaligned FastQ files 60 | pattern: "*.fastq.gz" 61 | - log: 62 | type: file 63 | description: Aligment log 64 | pattern: "*.log" 65 | authors: 66 | - "@joseespinosa" 67 | - "@drpatelh" 68 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/build/main.nf: -------------------------------------------------------------------------------- 1 | process BOWTIE2_BUILD { 2 | tag "$fasta" 3 | label 'process_high' 4 | 5 | conda "bioconda::bowtie2=2.4.4" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bowtie2:2.4.4--py39hbb4e92a_0' : 8 | 'biocontainers/bowtie2:2.4.4--py39hbb4e92a_0' }" 9 | 10 | input: 11 | tuple val(meta), path(fasta) 12 | 13 | output: 14 | tuple val(meta), path('bowtie2') , emit: index 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 | """ 23 | mkdir bowtie2 24 | bowtie2-build $args --threads $task.cpus $fasta bowtie2/${fasta.baseName} 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | bowtie2: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') 28 | END_VERSIONS 29 | """ 30 | 31 | stub: 32 | """ 33 | mkdir bowtie2 34 | touch bowtie2/${fasta.baseName}.{1..4}.bt2 35 | touch bowtie2/${fasta.baseName}.rev.{1,2}.bt2 36 | 37 | cat <<-END_VERSIONS > versions.yml 38 | "${task.process}": 39 | bowtie2: \$(echo \$(bowtie2 --version 2>&1) | sed 's/^.*bowtie2-align-s version //; s/ .*\$//') 40 | END_VERSIONS 41 | """ 42 | } 43 | -------------------------------------------------------------------------------- /modules/nf-core/bowtie2/build/meta.yml: -------------------------------------------------------------------------------- 1 | name: bowtie2_build 2 | description: Builds bowtie index for reference genome 3 | keywords: 4 | - build 5 | - index 6 | - fasta 7 | - genome 8 | - reference 9 | tools: 10 | - bowtie2: 11 | description: | 12 | Bowtie 2 is an ultrafast and memory-efficient tool for aligning 13 | sequencing reads to long reference sequences. 14 | homepage: http://bowtie-bio.sourceforge.net/bowtie2/index.shtml 15 | documentation: http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml 16 | doi: 10.1038/nmeth.1923 17 | licence: ["GPL-3.0-or-later"] 18 | input: 19 | - meta: 20 | type: map 21 | description: | 22 | Groovy Map containing reference information 23 | e.g. [ id:'test', single_end:false ] 24 | - fasta: 25 | type: file 26 | description: Input genome fasta file 27 | output: 28 | - meta: 29 | type: map 30 | description: | 31 | Groovy Map containing reference information 32 | e.g. [ id:'test', single_end:false ] 33 | - index: 34 | type: file 35 | description: Bowtie2 genome index files 36 | pattern: "*.bt2" 37 | - versions: 38 | type: file 39 | description: File containing software versions 40 | pattern: "versions.yml" 41 | authors: 42 | - "@joseespinosa" 43 | - "@drpatelh" 44 | -------------------------------------------------------------------------------- /modules/nf-core/bwa/index/main.nf: -------------------------------------------------------------------------------- 1 | process BWA_INDEX { 2 | tag "$fasta" 3 | label 'process_single' 4 | 5 | conda "bioconda::bwa=0.7.17" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/bwa:0.7.17--hed695b0_7' : 8 | 'biocontainers/bwa:0.7.17--hed695b0_7' }" 9 | 10 | input: 11 | tuple val(meta), path(fasta) 12 | 13 | output: 14 | tuple val(meta), path(bwa) , emit: index 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 | """ 23 | mkdir bwa 24 | bwa \\ 25 | index \\ 26 | $args \\ 27 | -p bwa/${fasta.baseName} \\ 28 | $fasta 29 | 30 | cat <<-END_VERSIONS > versions.yml 31 | "${task.process}": 32 | bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') 33 | END_VERSIONS 34 | """ 35 | 36 | stub: 37 | """ 38 | mkdir bwa 39 | 40 | touch bwa/genome.amb 41 | touch bwa/genome.ann 42 | touch bwa/genome.bwt 43 | touch bwa/genome.pac 44 | touch bwa/genome.sa 45 | 46 | cat <<-END_VERSIONS > versions.yml 47 | "${task.process}": 48 | bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') 49 | END_VERSIONS 50 | """ 51 | } 52 | -------------------------------------------------------------------------------- /modules/nf-core/bwa/index/meta.yml: -------------------------------------------------------------------------------- 1 | name: bwa_index 2 | description: Create BWA index for reference genome 3 | keywords: 4 | - index 5 | - fasta 6 | - genome 7 | - reference 8 | tools: 9 | - bwa: 10 | description: | 11 | BWA is a software package for mapping DNA sequences against 12 | a large reference genome, such as the human genome. 13 | homepage: http://bio-bwa.sourceforge.net/ 14 | documentation: http://www.htslib.org/doc/samtools.html 15 | arxiv: arXiv:1303.3997 16 | licence: ["GPL-3.0-or-later"] 17 | input: 18 | - meta: 19 | type: map 20 | description: | 21 | Groovy Map containing reference information. 22 | e.g. [ id:'test', single_end:false ] 23 | - fasta: 24 | type: file 25 | description: Input genome fasta file 26 | output: 27 | - meta: 28 | type: map 29 | description: | 30 | Groovy Map containing reference information. 31 | e.g. [ id:'test', single_end:false ] 32 | - index: 33 | type: file 34 | description: BWA genome index files 35 | pattern: "*.{amb,ann,bwt,pac,sa}" 36 | - versions: 37 | type: file 38 | description: File containing software versions 39 | pattern: "versions.yml" 40 | authors: 41 | - "@drpatelh" 42 | - "@maxulysse" 43 | -------------------------------------------------------------------------------- /modules/nf-core/bwa/mem/main.nf: -------------------------------------------------------------------------------- 1 | process BWA_MEM { 2 | tag "$meta.id" 3 | label 'process_high' 4 | 5 | conda "bioconda::bwa=0.7.17 bioconda::samtools=1.16.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:219b6c272b25e7e642ae3ff0bf0c5c81a5135ab4-0' : 8 | 'biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:219b6c272b25e7e642ae3ff0bf0c5c81a5135ab4-0' }" 9 | 10 | input: 11 | tuple val(meta), path(reads) 12 | tuple val(meta2), path(index) 13 | val sort_bam 14 | 15 | output: 16 | tuple val(meta), path("*.bam"), emit: bam 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 args2 = task.ext.args2 ?: '' 25 | def prefix = task.ext.prefix ?: "${meta.id}" 26 | def samtools_command = sort_bam ? 'sort' : 'view' 27 | """ 28 | INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'` 29 | 30 | bwa mem \\ 31 | $args \\ 32 | -t $task.cpus \\ 33 | \$INDEX \\ 34 | $reads \\ 35 | | samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam - 36 | 37 | cat <<-END_VERSIONS > versions.yml 38 | "${task.process}": 39 | bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//') 40 | samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 41 | END_VERSIONS 42 | """ 43 | } 44 | -------------------------------------------------------------------------------- /modules/nf-core/bwa/mem/meta.yml: -------------------------------------------------------------------------------- 1 | name: bwa_mem 2 | description: Performs fastq alignment to a fasta reference using BWA 3 | keywords: 4 | - mem 5 | - bwa 6 | - alignment 7 | - map 8 | - fastq 9 | - bam 10 | - sam 11 | tools: 12 | - bwa: 13 | description: | 14 | BWA is a software package for mapping DNA sequences against 15 | a large reference genome, such as the human genome. 16 | homepage: http://bio-bwa.sourceforge.net/ 17 | documentation: http://www.htslib.org/doc/samtools.html 18 | arxiv: arXiv:1303.3997 19 | licence: ["GPL-3.0-or-later"] 20 | input: 21 | - meta: 22 | type: map 23 | description: | 24 | Groovy Map containing sample information 25 | e.g. [ id:'test', single_end:false ] 26 | - reads: 27 | type: file 28 | description: | 29 | List of input FastQ files of size 1 and 2 for single-end and paired-end data, 30 | respectively. 31 | - meta2: 32 | type: map 33 | description: | 34 | Groovy Map containing reference information. 35 | e.g. [ id:'test', single_end:false ] 36 | - index: 37 | type: file 38 | description: BWA genome index files 39 | pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" 40 | - sort_bam: 41 | type: boolean 42 | description: use samtools sort (true) or samtools view (false) 43 | pattern: "true or false" 44 | output: 45 | - bam: 46 | type: file 47 | description: Output BAM file containing read alignments 48 | pattern: "*.{bam}" 49 | - versions: 50 | type: file 51 | description: File containing software versions 52 | pattern: "versions.yml" 53 | authors: 54 | - "@drpatelh" 55 | - "@jeremy1805" 56 | -------------------------------------------------------------------------------- /modules/nf-core/chromap/chromap/meta.yml: -------------------------------------------------------------------------------- 1 | name: chromap_chromap 2 | description: | 3 | Performs preprocessing and alignment of chromatin fastq files to 4 | fasta reference files using chromap. 5 | keywords: 6 | - chromap 7 | - alignment 8 | - map 9 | - fastq 10 | - bam 11 | - sam 12 | - hi-c 13 | - atac-seq 14 | - chip-seq 15 | - trimming 16 | - duplicate removal 17 | tools: 18 | - chromap: 19 | description: Fast alignment and preprocessing of chromatin profiles 20 | homepage: https://github.com/haowenz/chromap 21 | documentation: https://github.com/haowenz/chromap 22 | tool_dev_url: https://github.com/haowenz/chromap 23 | 24 | licence: ["GPL v3"] 25 | input: 26 | - meta: 27 | type: map 28 | description: | 29 | Groovy Map containing sample information 30 | e.g. [ id:'test', single_end:false ] 31 | - reads: 32 | type: file 33 | description: | 34 | List of input FastQ files of size 1 and 2 for single-end and paired-end data, 35 | respectively. 36 | - meta2: 37 | type: map 38 | description: | 39 | Groovy Map containing information for the fasta 40 | e.g. [ id:'test' ] 41 | - fasta: 42 | type: file 43 | description: | 44 | The fasta reference file. 45 | - meta3: 46 | type: map 47 | description: | 48 | Groovy Map containing information for the index 49 | e.g. [ id:'test' ] 50 | - index: 51 | type: file 52 | description: | 53 | Chromap genome index files (*.index) 54 | - barcodes: 55 | type: file 56 | description: | 57 | Cell barcode files 58 | - whitelist: 59 | type: file 60 | description: | 61 | Cell barcode whitelist file 62 | - chr_order: 63 | type: file 64 | description: | 65 | Custom chromosome order 66 | - pairs_chr_order: 67 | type: file 68 | description: | 69 | Natural chromosome order for pairs flipping 70 | output: 71 | - meta: 72 | type: map 73 | description: | 74 | Groovy Map containing sample information 75 | e.g. [ id:'test', single_end:false ] 76 | - versions: 77 | type: file 78 | description: File containing software versions 79 | pattern: "versions.yml" 80 | - bed: 81 | type: file 82 | description: BED file 83 | pattern: "*.bed.gz" 84 | - bam: 85 | type: file 86 | description: BAM file 87 | pattern: "*.bam" 88 | - tagAlign: 89 | type: file 90 | description: tagAlign file 91 | pattern: "*.tagAlign.gz" 92 | - pairs: 93 | type: file 94 | description: pairs file 95 | pattern: "*.pairs.gz" 96 | 97 | authors: 98 | - "@mahesh-panchal" 99 | - "@joseespinosa" 100 | -------------------------------------------------------------------------------- /modules/nf-core/chromap/index/main.nf: -------------------------------------------------------------------------------- 1 | process CHROMAP_INDEX { 2 | tag "$fasta" 3 | label 'process_medium' 4 | 5 | conda "bioconda::chromap=0.2.4" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/chromap:0.2.4--hd03093a_0' : 8 | 'biocontainers/chromap:0.2.4--hd03093a_0' }" 9 | 10 | input: 11 | tuple val(meta), path(fasta) 12 | 13 | output: 14 | tuple val(meta), path ("*.index"), emit: index 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 = fasta.baseName 23 | """ 24 | chromap \\ 25 | -i \\ 26 | $args \\ 27 | -t $task.cpus \\ 28 | -r $fasta \\ 29 | -o ${prefix}.index 30 | 31 | cat <<-END_VERSIONS > versions.yml 32 | "${task.process}": 33 | chromap: \$(echo \$(chromap --version 2>&1)) 34 | END_VERSIONS 35 | """ 36 | } 37 | -------------------------------------------------------------------------------- /modules/nf-core/chromap/index/meta.yml: -------------------------------------------------------------------------------- 1 | name: chromap_index 2 | description: Indexes a fasta reference genome ready for chromatin profiling. 3 | keywords: 4 | - index 5 | - fasta 6 | - genome 7 | - reference 8 | tools: 9 | - chromap: 10 | description: Fast alignment and preprocessing of chromatin profiles 11 | homepage: https://github.com/haowenz/chromap 12 | documentation: https://github.com/haowenz/chromap 13 | tool_dev_url: https://github.com/haowenz/chromap 14 | 15 | licence: ["GPL v3"] 16 | 17 | input: 18 | - meta: 19 | type: map 20 | description: | 21 | Groovy Map containing reference information 22 | e.g. [ id:'test' ] 23 | - fasta: 24 | type: file 25 | description: Fasta reference file. 26 | 27 | output: 28 | - versions: 29 | type: file 30 | description: File containing software versions 31 | pattern: "versions.yml" 32 | - meta: 33 | type: map 34 | description: | 35 | Groovy Map containing reference information 36 | e.g. [ id:'test' ] 37 | - index: 38 | type: file 39 | description: Index file of the reference genome 40 | pattern: "*.{index}" 41 | 42 | authors: 43 | - "@mahesh-panchal" 44 | - "@joseespinosa" 45 | -------------------------------------------------------------------------------- /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.14" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/multiqc:1.14--pyhdfd78af_0' : 8 | 'biocontainers/multiqc:1.14--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 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json 2 | name: custom_dumpsoftwareversions 3 | description: Custom module used to dump software versions within the nf-core pipeline template 4 | keywords: 5 | - custom 6 | - dump 7 | - version 8 | tools: 9 | - custom: 10 | description: Custom module used to dump software versions within the nf-core pipeline template 11 | homepage: https://github.com/nf-core/tools 12 | documentation: https://github.com/nf-core/tools 13 | licence: ["MIT"] 14 | input: 15 | - versions: 16 | type: file 17 | description: YML file containing software versions 18 | pattern: "*.yml" 19 | 20 | output: 21 | - yml: 22 | type: file 23 | description: Standard YML file containing software versions 24 | pattern: "software_versions.yml" 25 | - mqc_yml: 26 | type: file 27 | description: MultiQC custom content YML file containing software versions 28 | pattern: "software_versions_mqc.yml" 29 | - versions: 30 | type: file 31 | description: File containing software versions 32 | pattern: "versions.yml" 33 | 34 | authors: 35 | - "@drpatelh" 36 | - "@grst" 37 | -------------------------------------------------------------------------------- /modules/nf-core/custom/getchromsizes/main.nf: -------------------------------------------------------------------------------- 1 | process CUSTOM_GETCHROMSIZES { 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 | 'biocontainers/samtools:1.16.1--h6899075_1' }" 9 | 10 | input: 11 | tuple val(meta), path(fasta) 12 | 13 | output: 14 | tuple val(meta), path ("*.sizes"), emit: sizes 15 | tuple val(meta), path ("*.fai") , emit: fai 16 | tuple val(meta), path ("*.gzi") , emit: gzi, optional: true 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 faidx $fasta 26 | cut -f 1,2 ${fasta}.fai > ${fasta}.sizes 27 | 28 | cat <<-END_VERSIONS > versions.yml 29 | "${task.process}": 30 | getchromsizes: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 31 | END_VERSIONS 32 | """ 33 | 34 | stub: 35 | """ 36 | touch ${fasta}.fai 37 | touch ${fasta}.sizes 38 | 39 | cat <<-END_VERSIONS > versions.yml 40 | "${task.process}": 41 | getchromsizes: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') 42 | END_VERSIONS 43 | """ 44 | } 45 | -------------------------------------------------------------------------------- /modules/nf-core/custom/getchromsizes/meta.yml: -------------------------------------------------------------------------------- 1 | name: custom_getchromsizes 2 | description: Generates a FASTA file of chromosome sizes and a fasta index file 3 | keywords: 4 | - fasta 5 | - chromosome 6 | - indexing 7 | tools: 8 | - samtools: 9 | description: Tools for dealing with SAM, BAM and CRAM files 10 | homepage: http://www.htslib.org/ 11 | documentation: http://www.htslib.org/doc/samtools.html 12 | tool_dev_url: https://github.com/samtools/samtools 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 | - fasta: 23 | type: file 24 | description: FASTA file 25 | pattern: "*.{fa,fasta,fna,fas}" 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 | - sizes: 34 | type: file 35 | description: File containing chromosome lengths 36 | pattern: "*.{sizes}" 37 | - fai: 38 | type: file 39 | description: FASTA index file 40 | pattern: "*.{fai}" 41 | - gzi: 42 | type: file 43 | description: Optional gzip index file for compressed inputs 44 | pattern: "*.gzi" 45 | - versions: 46 | type: file 47 | description: File containing software versions 48 | pattern: "versions.yml" 49 | 50 | authors: 51 | - "@tamara-hodgetts" 52 | - "@chris-cheshire" 53 | - "@muffato" 54 | -------------------------------------------------------------------------------- /modules/nf-core/deeptools/computematrix/main.nf: -------------------------------------------------------------------------------- 1 | process DEEPTOOLS_COMPUTEMATRIX { 2 | tag "$meta.id" 3 | label 'process_high' 4 | 5 | conda "bioconda::deeptools=3.5.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : 8 | 'biocontainers/deeptools:3.5.1--py_0' }" 9 | 10 | input: 11 | tuple val(meta), path(bigwig) 12 | path bed 13 | 14 | output: 15 | tuple val(meta), path("*.mat.gz") , emit: matrix 16 | tuple val(meta), path("*.mat.tab"), emit: table 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 | computeMatrix \\ 27 | $args \\ 28 | --regionsFileName $bed \\ 29 | --scoreFileName $bigwig \\ 30 | --outFileName ${prefix}.computeMatrix.mat.gz \\ 31 | --outFileNameMatrix ${prefix}.computeMatrix.vals.mat.tab \\ 32 | --numberOfProcessors $task.cpus 33 | 34 | cat <<-END_VERSIONS > versions.yml 35 | "${task.process}": 36 | deeptools: \$(computeMatrix --version | sed -e "s/computeMatrix //g") 37 | END_VERSIONS 38 | """ 39 | } 40 | -------------------------------------------------------------------------------- /modules/nf-core/deeptools/computematrix/meta.yml: -------------------------------------------------------------------------------- 1 | name: deeptools_computematrix 2 | description: calculates scores per genome regions for other deeptools plotting utilities 3 | keywords: 4 | - genome 5 | - regions 6 | - scores 7 | - matrix 8 | tools: 9 | - deeptools: 10 | description: A set of user-friendly tools for normalization and visualization of deep-sequencing data 11 | documentation: https://deeptools.readthedocs.io/en/develop/index.html 12 | tool_dev_url: https://github.com/deeptools/deepTools 13 | doi: "10.1093/nar/gku365" 14 | licence: ["GPL v3"] 15 | 16 | input: 17 | - meta: 18 | type: map 19 | description: | 20 | Groovy Map containing sample information 21 | e.g. [ id:'test' ] 22 | - bigwig: 23 | type: file 24 | description: bigwig file containing genomic scores 25 | pattern: "*.{bw,bigwig}" 26 | - bed: 27 | type: file 28 | description: bed file containing genomic regions 29 | pattern: "*.{bed}" 30 | 31 | output: 32 | - meta: 33 | type: map 34 | description: | 35 | Groovy Map containing sample information 36 | e.g. [ id:'test', single_end:false ] 37 | - matrix: 38 | type: file 39 | description: | 40 | gzipped matrix file needed by the plotHeatmap and plotProfile 41 | deeptools utilities 42 | pattern: "*.{computeMatrix.mat.gz}" 43 | - table: 44 | type: file 45 | description: | 46 | tabular file containing the scores of the generated matrix 47 | pattern: "*.{computeMatrix.vals.mat.tab}" 48 | - versions: 49 | type: file 50 | description: File containing software versions 51 | pattern: "versions.yml" 52 | 53 | authors: 54 | - "@jeremy1805" 55 | - "@emiller88" 56 | - "@drpatelh" 57 | - "@joseespinosa" 58 | -------------------------------------------------------------------------------- /modules/nf-core/deeptools/plotfingerprint/main.nf: -------------------------------------------------------------------------------- 1 | process DEEPTOOLS_PLOTFINGERPRINT { 2 | tag "$meta.id" 3 | label 'process_high' 4 | 5 | conda "bioconda::deeptools=3.5.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : 8 | 'biocontainers/deeptools:3.5.1--py_0' }" 9 | 10 | input: 11 | tuple val(meta), path(bams), path(bais) 12 | 13 | output: 14 | tuple val(meta), path("*.pdf") , emit: pdf 15 | tuple val(meta), path("*.raw.txt") , emit: matrix 16 | tuple val(meta), path("*.qcmetrics.txt"), emit: metrics 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 | def extend = (meta.single_end && params.fragment_size > 0) ? "--extendReads ${params.fragment_size}" : '' 26 | """ 27 | plotFingerprint \\ 28 | $args \\ 29 | $extend \\ 30 | --bamfiles ${bams.join(' ')} \\ 31 | --plotFile ${prefix}.plotFingerprint.pdf \\ 32 | --outRawCounts ${prefix}.plotFingerprint.raw.txt \\ 33 | --outQualityMetrics ${prefix}.plotFingerprint.qcmetrics.txt \\ 34 | --numberOfProcessors $task.cpus 35 | 36 | cat <<-END_VERSIONS > versions.yml 37 | "${task.process}": 38 | deeptools: \$(plotFingerprint --version | sed -e "s/plotFingerprint //g") 39 | END_VERSIONS 40 | """ 41 | } 42 | -------------------------------------------------------------------------------- /modules/nf-core/deeptools/plotfingerprint/meta.yml: -------------------------------------------------------------------------------- 1 | name: deeptools_plotfingerprint 2 | description: plots cumulative reads coverages by BAM file 3 | keywords: 4 | - plot 5 | - fingerprint 6 | - cumulative coverage 7 | - bam 8 | tools: 9 | - deeptools: 10 | description: A set of user-friendly tools for normalization and visualization of deep-sequencing data 11 | documentation: https://deeptools.readthedocs.io/en/develop/index.html 12 | tool_dev_url: https://github.com/deeptools/deepTools 13 | doi: "10.1093/nar/gku365" 14 | licence: ["GPL v3"] 15 | 16 | input: 17 | - meta: 18 | type: map 19 | description: | 20 | Groovy Map containing sample information 21 | e.g. [ id:'test' ] 22 | - bam: 23 | type: file 24 | description: One or more BAM files 25 | pattern: "*.{bam}" 26 | - bais: 27 | type: file 28 | description: Corresponding BAM file indexes 29 | pattern: "*.bam.bai" 30 | 31 | output: 32 | - meta: 33 | type: map 34 | description: | 35 | Groovy Map containing sample information 36 | e.g. [ id:'test', single_end:false ] 37 | - pdf: 38 | type: file 39 | description: | 40 | Output figure containing resulting plot 41 | pattern: "*.{plotFingerprint.pdf}" 42 | - matrix: 43 | type: file 44 | description: | 45 | Output file summarizing the read counts per bin 46 | pattern: "*.{plotFingerprint.raw.txt}" 47 | - metrics: 48 | type: file 49 | description: | 50 | file containing BAM file quality metrics 51 | pattern: "*.{qcmetrics.txt}" 52 | - versions: 53 | type: file 54 | description: File containing software versions 55 | pattern: "versions.yml" 56 | 57 | authors: 58 | - "@emiller88" 59 | - "@drpatelh" 60 | - "@joseespinosa" 61 | -------------------------------------------------------------------------------- /modules/nf-core/deeptools/plotheatmap/main.nf: -------------------------------------------------------------------------------- 1 | process DEEPTOOLS_PLOTHEATMAP { 2 | tag "$meta.id" 3 | label 'process_low' 4 | 5 | conda "bioconda::deeptools=3.5.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : 8 | 'biocontainers/deeptools:3.5.1--py_0' }" 9 | 10 | input: 11 | tuple val(meta), path(matrix) 12 | 13 | output: 14 | tuple val(meta), path("*.pdf"), emit: pdf 15 | tuple val(meta), path("*.tab"), emit: table 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 | """ 25 | plotHeatmap \\ 26 | $args \\ 27 | --matrixFile $matrix \\ 28 | --outFileName ${prefix}.plotHeatmap.pdf \\ 29 | --outFileNameMatrix ${prefix}.plotHeatmap.mat.tab 30 | 31 | cat <<-END_VERSIONS > versions.yml 32 | "${task.process}": 33 | deeptools: \$(plotHeatmap --version | sed -e "s/plotHeatmap //g") 34 | END_VERSIONS 35 | """ 36 | } 37 | -------------------------------------------------------------------------------- /modules/nf-core/deeptools/plotheatmap/meta.yml: -------------------------------------------------------------------------------- 1 | name: deeptools_plotheatmap 2 | description: plots values produced by deeptools_computematrix as a heatmap 3 | keywords: 4 | - plot 5 | - heatmap 6 | - scores 7 | - matrix 8 | tools: 9 | - deeptools: 10 | description: A set of user-friendly tools for normalization and visualization of deep-sequencing data 11 | documentation: https://deeptools.readthedocs.io/en/develop/index.html 12 | tool_dev_url: https://github.com/deeptools/deepTools 13 | doi: "10.1093/nar/gku365" 14 | licence: ["GPL v3"] 15 | 16 | input: 17 | - meta: 18 | type: map 19 | description: | 20 | Groovy Map containing sample information 21 | e.g. [ id:'test' ] 22 | - matrix: 23 | type: file 24 | description: | 25 | gzipped matrix file produced by deeptools_ 26 | computematrix deeptools utility 27 | pattern: "*.{mat.gz}" 28 | 29 | output: 30 | - meta: 31 | type: map 32 | description: | 33 | Groovy Map containing sample information 34 | e.g. [ id:'test', single_end:false ] 35 | - pdf: 36 | type: file 37 | description: | 38 | Output figure containing resulting plot 39 | pattern: "*.{plotHeatmap.pdf}" 40 | - matrix: 41 | type: file 42 | description: | 43 | File containing the matrix of values 44 | used to generate the heatmap 45 | pattern: "*.{plotHeatmap.mat.tab}" 46 | - versions: 47 | type: file 48 | description: File containing software versions 49 | pattern: "versions.yml" 50 | 51 | authors: 52 | - "@emiller88" 53 | - "@drpatelh" 54 | - "@joseespinosa" 55 | -------------------------------------------------------------------------------- /modules/nf-core/deeptools/plotprofile/main.nf: -------------------------------------------------------------------------------- 1 | process DEEPTOOLS_PLOTPROFILE { 2 | tag "$meta.id" 3 | label 'process_low' 4 | 5 | conda "bioconda::deeptools=3.5.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0' : 8 | 'biocontainers/deeptools:3.5.1--py_0' }" 9 | 10 | input: 11 | tuple val(meta), path(matrix) 12 | 13 | output: 14 | tuple val(meta), path("*.pdf"), emit: pdf 15 | tuple val(meta), path("*.tab"), emit: table 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 | """ 25 | plotProfile \\ 26 | $args \\ 27 | --matrixFile $matrix \\ 28 | --outFileName ${prefix}.plotProfile.pdf \\ 29 | --outFileNameData ${prefix}.plotProfile.tab 30 | 31 | cat <<-END_VERSIONS > versions.yml 32 | "${task.process}": 33 | deeptools: \$(plotProfile --version | sed -e "s/plotProfile //g") 34 | END_VERSIONS 35 | """ 36 | } 37 | -------------------------------------------------------------------------------- /modules/nf-core/deeptools/plotprofile/meta.yml: -------------------------------------------------------------------------------- 1 | name: deeptools_plotprofile 2 | description: plots values produced by deeptools_computematrix as a profile plot 3 | keywords: 4 | - plot 5 | - profile 6 | - scores 7 | - matrix 8 | tools: 9 | - deeptools: 10 | description: A set of user-friendly tools for normalization and visualization of deep-sequencing data 11 | documentation: https://deeptools.readthedocs.io/en/develop/index.html 12 | tool_dev_url: https://github.com/deeptools/deepTools 13 | doi: "10.1093/nar/gku365" 14 | licence: ["GPL v3"] 15 | 16 | input: 17 | - meta: 18 | type: map 19 | description: | 20 | Groovy Map containing sample information 21 | e.g. [ id:'test' ] 22 | - matrix: 23 | type: file 24 | description: | 25 | gzipped matrix file produced by deeptools_ 26 | computematrix deeptools utility 27 | pattern: "*.{mat.gz}" 28 | 29 | output: 30 | - meta: 31 | type: map 32 | description: | 33 | Groovy Map containing sample information 34 | e.g. [ id:'test', single_end:false ] 35 | - pdf: 36 | type: file 37 | description: | 38 | Output figure containing resulting plot 39 | pattern: "*.{plotProfile.pdf}" 40 | - matrix: 41 | type: file 42 | description: | 43 | File containing the matrix of values 44 | used to generate the profile 45 | pattern: "*.{plotProfile.mat.tab}" 46 | - versions: 47 | type: file 48 | description: File containing software versions 49 | pattern: "versions.yml" 50 | 51 | authors: 52 | - "@emiller88" 53 | - "@drpatelh" 54 | - "@joseespinosa" 55 | -------------------------------------------------------------------------------- /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 | '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 | 33 | fastqc \\ 34 | $args \\ 35 | --threads $task.cpus \\ 36 | $renamed_files 37 | 38 | cat <<-END_VERSIONS > versions.yml 39 | "${task.process}": 40 | fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) 41 | END_VERSIONS 42 | """ 43 | 44 | stub: 45 | def prefix = task.ext.prefix ?: "${meta.id}" 46 | """ 47 | touch ${prefix}.html 48 | touch ${prefix}.zip 49 | 50 | cat <<-END_VERSIONS > versions.yml 51 | "${task.process}": 52 | fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) 53 | END_VERSIONS 54 | """ 55 | } 56 | -------------------------------------------------------------------------------- /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/gffread/main.nf: -------------------------------------------------------------------------------- 1 | process GFFREAD { 2 | tag "$gff" 3 | label 'process_low' 4 | 5 | conda "bioconda::gffread=0.12.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/gffread:0.12.1--h8b12597_0' : 8 | 'biocontainers/gffread:0.12.1--h8b12597_0' }" 9 | 10 | input: 11 | path gff 12 | 13 | output: 14 | path "*.gtf" , emit: gtf 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 ?: "${gff.baseName}" 23 | """ 24 | gffread \\ 25 | $gff \\ 26 | $args \\ 27 | -o ${prefix}.gtf 28 | cat <<-END_VERSIONS > versions.yml 29 | "${task.process}": 30 | gffread: \$(gffread --version 2>&1) 31 | END_VERSIONS 32 | """ 33 | } 34 | -------------------------------------------------------------------------------- /modules/nf-core/gffread/meta.yml: -------------------------------------------------------------------------------- 1 | name: gffread 2 | description: Validate, filter, convert and perform various other operations on GFF files 3 | keywords: 4 | - gff 5 | - conversion 6 | - validation 7 | tools: 8 | - gffread: 9 | description: GFF/GTF utility providing format conversions, region filtering, FASTA sequence extraction and more. 10 | homepage: http://ccb.jhu.edu/software/stringtie/gff.shtml#gffread 11 | documentation: http://ccb.jhu.edu/software/stringtie/gff.shtml#gffread 12 | tool_dev_url: https://github.com/gpertea/gffread 13 | doi: 10.12688/f1000research.23297.1 14 | licence: ["MIT"] 15 | 16 | input: 17 | - gff: 18 | type: file 19 | description: A reference file in either the GFF3, GFF2 or GTF format. 20 | pattern: "*.{gff, gtf}" 21 | 22 | output: 23 | - gtf: 24 | type: file 25 | description: GTF file resulting from the conversion of the GFF input file 26 | pattern: "*.{gtf}" 27 | - versions: 28 | type: file 29 | description: File containing software versions 30 | pattern: "versions.yml" 31 | 32 | authors: 33 | - "@emiller88" 34 | -------------------------------------------------------------------------------- /modules/nf-core/gunzip/main.nf: -------------------------------------------------------------------------------- 1 | process GUNZIP { 2 | tag "$archive" 3 | label 'process_single' 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/ubuntu:20.04' : 8 | 'nf-core/ubuntu:20.04' }" 9 | 10 | input: 11 | tuple val(meta), path(archive) 12 | 13 | output: 14 | tuple val(meta), path("$gunzip"), emit: gunzip 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 | gunzip = archive.toString() - '.gz' 23 | """ 24 | # Not calling gunzip itself because it creates files 25 | # with the original group ownership rather than the 26 | # default one for that user / the work directory 27 | gzip \\ 28 | -cd \\ 29 | $args \\ 30 | $archive \\ 31 | > $gunzip 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//') 36 | END_VERSIONS 37 | """ 38 | 39 | stub: 40 | gunzip = archive.toString() - '.gz' 41 | """ 42 | touch $gunzip 43 | cat <<-END_VERSIONS > versions.yml 44 | "${task.process}": 45 | gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//') 46 | END_VERSIONS 47 | """ 48 | } 49 | -------------------------------------------------------------------------------- /modules/nf-core/gunzip/meta.yml: -------------------------------------------------------------------------------- 1 | name: gunzip 2 | description: Compresses and decompresses files. 3 | keywords: 4 | - gunzip 5 | - compression 6 | - decompression 7 | tools: 8 | - gunzip: 9 | description: | 10 | gzip is a file format and a software application used for file compression and decompression. 11 | documentation: https://www.gnu.org/software/gzip/manual/gzip.html 12 | licence: ["GPL-3.0-or-later"] 13 | input: 14 | - meta: 15 | type: map 16 | description: | 17 | Optional groovy Map containing meta information 18 | e.g. [ id:'test', single_end:false ] 19 | - archive: 20 | type: file 21 | description: File to be compressed/uncompressed 22 | pattern: "*.*" 23 | output: 24 | - gunzip: 25 | type: file 26 | description: Compressed/uncompressed file 27 | pattern: "*.*" 28 | - versions: 29 | type: file 30 | description: File containing software versions 31 | pattern: "versions.yml" 32 | authors: 33 | - "@joseespinosa" 34 | - "@drpatelh" 35 | - "@jfy133" 36 | -------------------------------------------------------------------------------- /modules/nf-core/homer/annotatepeaks/main.nf: -------------------------------------------------------------------------------- 1 | process HOMER_ANNOTATEPEAKS { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. 6 | conda "bioconda::homer=4.11" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/homer:4.11--pl526hc9558a2_3' : 9 | 'biocontainers/homer:4.11--pl526hc9558a2_3' }" 10 | 11 | input: 12 | tuple val(meta), path(peak) 13 | path fasta 14 | path gtf 15 | 16 | output: 17 | tuple val(meta), path("*annotatePeaks.txt"), emit: txt 18 | tuple val(meta), path("*annStats.txt"), emit: stats, optional: true 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 prefix = task.ext.prefix ?: "${meta.id}" 27 | def VERSION = '4.11' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. 28 | """ 29 | annotatePeaks.pl \\ 30 | $peak \\ 31 | $fasta \\ 32 | $args \\ 33 | -gtf $gtf \\ 34 | -cpu $task.cpus \\ 35 | > ${prefix}.annotatePeaks.txt 36 | 37 | cat <<-END_VERSIONS > versions.yml 38 | "${task.process}": 39 | homer: $VERSION 40 | END_VERSIONS 41 | """ 42 | } 43 | -------------------------------------------------------------------------------- /modules/nf-core/homer/annotatepeaks/meta.yml: -------------------------------------------------------------------------------- 1 | name: homer_annotatepeaks 2 | description: Annotate peaks with HOMER suite 3 | keywords: 4 | - annotations 5 | - peaks 6 | - bed 7 | tools: 8 | - homer: 9 | description: | 10 | HOMER (Hypergeometric Optimization of Motif EnRichment) is a suite of tools for Motif Discovery and next-gen sequencing analysis. 11 | documentation: http://homer.ucsd.edu/homer/ 12 | doi: 10.1016/j.molcel.2010.05.004. 13 | licence: ["GPL-3.0-or-later"] 14 | input: 15 | - meta: 16 | type: map 17 | description: | 18 | Groovy Map containing sample information 19 | e.g. [ id:'test', single_end:false ] 20 | - peaks: 21 | type: file 22 | description: The peak files in bed format 23 | pattern: "*.bed" 24 | - fasta: 25 | type: file 26 | description: Fasta file of reference genome 27 | pattern: "*.fasta" 28 | - gtf: 29 | type: file 30 | description: GTF file of reference genome 31 | pattern: "*.gtf" 32 | output: 33 | - meta: 34 | type: map 35 | description: | 36 | Groovy Map containing sample information 37 | e.g. [ id:'test', single_end:false ] 38 | - annotated_peaks: 39 | type: file 40 | description: The annotated peaks 41 | pattern: "*annotatePeaks.txt" 42 | - annotation_stats: 43 | type: file 44 | description: the annStats file output from -annStats parameter 45 | pattern: "*annStats.txt" 46 | - versions: 47 | type: file 48 | description: File containing software versions 49 | pattern: "versions.yml" 50 | authors: 51 | - "@drpatelh" 52 | - "@kevinmenden" 53 | -------------------------------------------------------------------------------- /modules/nf-core/khmer/uniquekmers/main.nf: -------------------------------------------------------------------------------- 1 | process KHMER_UNIQUEKMERS { 2 | tag "$fasta" 3 | label 'process_low' 4 | 5 | conda "bioconda::khmer=3.0.0a3" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/khmer:3.0.0a3--py37haa7609a_2' : 8 | 'biocontainers/khmer:3.0.0a3--py37haa7609a_2' }" 9 | 10 | input: 11 | path fasta 12 | val kmer_size 13 | 14 | output: 15 | path "report.txt" , emit: report 16 | path "kmers.txt" , emit: kmers 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 | unique-kmers.py \\ 26 | -k $kmer_size \\ 27 | -R report.txt \\ 28 | $args \\ 29 | $fasta 30 | 31 | grep ^number report.txt | sed 's/^.*:.[[:blank:]]//g' > kmers.txt 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | khmer: \$( unique-kmers.py --version 2>&1 | grep ^khmer | sed 's/^khmer //;s/ .*\$//' ) 36 | END_VERSIONS 37 | """ 38 | } 39 | -------------------------------------------------------------------------------- /modules/nf-core/khmer/uniquekmers/meta.yml: -------------------------------------------------------------------------------- 1 | name: "khmer_uniquekmers" 2 | description: In-memory nucleotide sequence k-mer counting, filtering, graph traversal and more 3 | keywords: 4 | - khmer 5 | - k-mer 6 | - effective genome size 7 | 8 | tools: 9 | - "khmer": 10 | description: khmer k-mer counting library 11 | homepage: https://github.com/dib-lab/khmer 12 | documentation: https://khmer.readthedocs.io/en/latest/ 13 | tool_dev_url: https://github.com/dib-lab/khmer 14 | doi: "10.12688/f1000research.6924.1" 15 | licence: ["BSD License"] 16 | 17 | input: 18 | - fasta: 19 | type: file 20 | description: fasta file 21 | pattern: "*.{fa,fasta}" 22 | - kmer_size: 23 | type: value 24 | description: k-mer size to use 25 | pattern: "[0-9]+" 26 | 27 | output: 28 | - report: 29 | type: file 30 | description: Text file containing unique-kmers.py execution report 31 | pattern: "report.txt" 32 | - kmers: 33 | type: file 34 | description: Text file containing number of kmers 35 | pattern: "kmers.txt" 36 | - versions: 37 | type: file 38 | description: File containing software versions 39 | pattern: "versions.yml" 40 | 41 | authors: 42 | - "@JoseEspinosa" 43 | -------------------------------------------------------------------------------- /modules/nf-core/macs2/callpeak/main.nf: -------------------------------------------------------------------------------- 1 | process MACS2_CALLPEAK { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::macs2=2.2.7.1" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/macs2:2.2.7.1--py38h4a8c8d9_3' : 8 | 'biocontainers/macs2:2.2.7.1--py38h4a8c8d9_3' }" 9 | 10 | input: 11 | tuple val(meta), path(ipbam), path(controlbam) 12 | val macs2_gsize 13 | 14 | output: 15 | tuple val(meta), path("*.{narrowPeak,broadPeak}"), emit: peak 16 | tuple val(meta), path("*.xls") , emit: xls 17 | path "versions.yml" , emit: versions 18 | 19 | tuple val(meta), path("*.gappedPeak"), optional:true, emit: gapped 20 | tuple val(meta), path("*.bed") , optional:true, emit: bed 21 | tuple val(meta), path("*.bdg") , optional:true, emit: bdg 22 | 23 | when: 24 | task.ext.when == null || task.ext.when 25 | 26 | script: 27 | def args = task.ext.args ?: '' 28 | def prefix = task.ext.prefix ?: "${meta.id}" 29 | def args_list = args.tokenize() 30 | def format = meta.single_end ? 'BAM' : 'BAMPE' 31 | def control = controlbam ? "--control $controlbam" : '' 32 | if(args_list.contains('--format')){ 33 | def id = args_list.findIndexOf{it=='--format'} 34 | format = args_list[id+1] 35 | args_list.remove(id+1) 36 | args_list.remove(id) 37 | } 38 | """ 39 | macs2 \\ 40 | callpeak \\ 41 | ${args_list.join(' ')} \\ 42 | --gsize $macs2_gsize \\ 43 | --format $format \\ 44 | --name $prefix \\ 45 | --treatment $ipbam \\ 46 | $control 47 | 48 | cat <<-END_VERSIONS > versions.yml 49 | "${task.process}": 50 | macs2: \$(macs2 --version | sed -e "s/macs2 //g") 51 | END_VERSIONS 52 | """ 53 | } 54 | -------------------------------------------------------------------------------- /modules/nf-core/macs2/callpeak/meta.yml: -------------------------------------------------------------------------------- 1 | name: macs2_callpeak 2 | description: Peak calling of enriched genomic regions of ChIP-seq and ATAC-seq experiments 3 | keywords: 4 | - alignment 5 | - atac-seq 6 | - chip-seq 7 | - peak-calling 8 | tools: 9 | - macs2: 10 | description: Model Based Analysis for ChIP-Seq data 11 | 12 | documentation: https://docs.csc.fi/apps/macs2/ 13 | tool_dev_url: https://github.com/macs3-project/MACS 14 | doi: "10.1101/496521" 15 | licence: ["BSD"] 16 | 17 | input: 18 | - meta: 19 | type: map 20 | description: | 21 | Groovy Map containing sample information 22 | e.g. [ id:'test', single_end:false ] 23 | - ipbam: 24 | type: file 25 | description: The ChIP-seq treatment file 26 | - controlbam: 27 | type: file 28 | description: The control file 29 | - macs2_gsize: 30 | type: string 31 | description: Effective genome size. It can be 1.0e+9 or 1000000000, or shortcuts:'hs' for human (2.7e9), 32 | 'mm' for mouse (1.87e9), 'ce' for C. elegans (9e7) and 'dm' for fruitfly (1.2e8) 33 | 34 | output: 35 | - versions: 36 | type: file 37 | description: File containing software version 38 | pattern: "versions.yml" 39 | - peak: 40 | type: file 41 | description: BED file containing annotated peaks 42 | pattern: "*.gappedPeak,*.narrowPeak}" 43 | - xls: 44 | type: file 45 | description: xls file containing annotated peaks 46 | pattern: "*.xls" 47 | - gapped: 48 | type: file 49 | description: Optional BED file containing gapped peak 50 | pattern: "*.gappedPeak" 51 | - bed: 52 | type: file 53 | description: Optional BED file containing peak summits locations for every peak 54 | pattern: "*.bed" 55 | - bdg: 56 | type: file 57 | description: Optional bedGraph files for input and treatment input samples 58 | pattern: "*.bdg" 59 | 60 | authors: 61 | - "@ntoda03" 62 | - "@JoseEspinosa" 63 | - "@jianhong" 64 | -------------------------------------------------------------------------------- /modules/nf-core/picard/collectmultiplemetrics/main.nf: -------------------------------------------------------------------------------- 1 | process PICARD_COLLECTMULTIPLEMETRICS { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "bioconda::picard=3.0.0" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/picard:3.0.0--hdfd78af_1' : 8 | 'biocontainers/picard:3.0.0--hdfd78af_1' }" 9 | 10 | input: 11 | tuple val(meta) , path(bam), path(bai) 12 | tuple val(meta2), path(fasta) 13 | tuple val(meta3), path(fai) 14 | 15 | output: 16 | tuple val(meta), path("*_metrics"), emit: metrics 17 | tuple val(meta), path("*.pdf") , emit: pdf 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 prefix = task.ext.prefix ?: "${meta.id}" 26 | def reference = fasta ? "--REFERENCE_SEQUENCE ${fasta}" : "" 27 | def avail_mem = 3072 28 | if (!task.memory) { 29 | log.info '[Picard CollectMultipleMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' 30 | } else { 31 | avail_mem = (task.memory.mega*0.8).intValue() 32 | } 33 | """ 34 | picard \\ 35 | -Xmx${avail_mem}M \\ 36 | CollectMultipleMetrics \\ 37 | $args \\ 38 | --INPUT $bam \\ 39 | --OUTPUT ${prefix}.CollectMultipleMetrics \\ 40 | $reference 41 | 42 | cat <<-END_VERSIONS > versions.yml 43 | "${task.process}": 44 | picard: \$(picard CollectMultipleMetrics --version 2>&1 | grep -o 'Version.*' | cut -f2- -d:) 45 | END_VERSIONS 46 | """ 47 | 48 | stub: 49 | def prefix = task.ext.prefix ?: "${meta.id}" 50 | """ 51 | touch ${prefix}.CollectMultipleMetrics.alignment_summary_metrics 52 | touch ${prefix}.CollectMultipleMetrics.insert_size_metrics 53 | touch ${prefix}.CollectMultipleMetrics.quality_distribution.pdf 54 | touch ${prefix}.CollectMultipleMetrics.base_distribution_by_cycle_metrics 55 | touch ${prefix}.CollectMultipleMetrics.quality_by_cycle_metrics 56 | touch ${prefix}.CollectMultipleMetrics.read_length_histogram.pdf 57 | touch ${prefix}.CollectMultipleMetrics.base_distribution_by_cycle.pdf 58 | touch ${prefix}.CollectMultipleMetrics.quality_by_cycle.pdf 59 | touch ${prefix}.CollectMultipleMetrics.insert_size_histogram.pdf 60 | touch ${prefix}.CollectMultipleMetrics.quality_distribution_metrics 61 | 62 | cat <<-END_VERSIONS > versions.yml 63 | "${task.process}": 64 | picard: \$(echo \$(picard CollectMultipleMetrics --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:) 65 | END_VERSIONS 66 | """ 67 | } 68 | -------------------------------------------------------------------------------- /modules/nf-core/picard/collectmultiplemetrics/meta.yml: -------------------------------------------------------------------------------- 1 | name: picard_collectmultiplemetrics 2 | description: Collect multiple metrics from a BAM file 3 | keywords: 4 | - alignment 5 | - metrics 6 | - statistics 7 | - insert 8 | - quality 9 | - bam 10 | tools: 11 | - picard: 12 | description: | 13 | A set of command line tools (in Java) for manipulating high-throughput sequencing (HTS) 14 | data and formats such as SAM/BAM/CRAM and VCF. 15 | homepage: https://broadinstitute.github.io/picard/ 16 | documentation: https://broadinstitute.github.io/picard/ 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: SAM/BAM/CRAM file 27 | pattern: "*.{sam,bam,cram}" 28 | - bai: 29 | type: file 30 | description: Optional SAM/BAM/CRAM file index 31 | pattern: "*.{sai,bai,crai}" 32 | - meta2: 33 | type: map 34 | description: | 35 | Groovy Map containing reference information 36 | e.g. [ id:'genome'] 37 | - fasta: 38 | type: file 39 | description: Genome fasta file 40 | - meta3: 41 | type: map 42 | description: | 43 | Groovy Map containing reference information 44 | e.g. [ id:'genome'] 45 | - fai: 46 | type: file 47 | description: Index of FASTA file. Only needed when fasta is supplied. 48 | pattern: "*.fai" 49 | output: 50 | - meta: 51 | type: map 52 | description: | 53 | Groovy Map containing sample information 54 | e.g. [ id:'test', single_end:false ] 55 | - metrics: 56 | type: file 57 | description: Alignment metrics files generated by picard 58 | pattern: "*_{metrics}" 59 | - pdf: 60 | type: file 61 | description: PDF plots of metrics 62 | pattern: "*.{pdf}" 63 | - versions: 64 | type: file 65 | description: File containing software versions 66 | pattern: "versions.yml" 67 | authors: 68 | - "@drpatelh" 69 | -------------------------------------------------------------------------------- /modules/nf-core/picard/markduplicates/main.nf: -------------------------------------------------------------------------------- 1 | process PICARD_MARKDUPLICATES { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::picard=3.0.0" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/picard:3.0.0--hdfd78af_1' : 8 | 'biocontainers/picard:3.0.0--hdfd78af_1' }" 9 | 10 | input: 11 | tuple val(meta), path(bam) 12 | tuple val(meta2), path(fasta) 13 | tuple val(meta3), path(fai) 14 | 15 | output: 16 | tuple val(meta), path("*.bam") , emit: bam 17 | tuple val(meta), path("*.bai") , optional:true, emit: bai 18 | tuple val(meta), path("*.metrics.txt"), emit: metrics 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 prefix = task.ext.prefix ?: "${meta.id}" 27 | def avail_mem = 3072 28 | if (!task.memory) { 29 | log.info '[Picard MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' 30 | } else { 31 | avail_mem = (task.memory.mega*0.8).intValue() 32 | } 33 | """ 34 | picard \\ 35 | -Xmx${avail_mem}M \\ 36 | MarkDuplicates \\ 37 | $args \\ 38 | --INPUT $bam \\ 39 | --OUTPUT ${prefix}.bam \\ 40 | --REFERENCE_SEQUENCE $fasta \\ 41 | --METRICS_FILE ${prefix}.MarkDuplicates.metrics.txt 42 | 43 | cat <<-END_VERSIONS > versions.yml 44 | "${task.process}": 45 | picard: \$(echo \$(picard MarkDuplicates --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:) 46 | END_VERSIONS 47 | """ 48 | 49 | stub: 50 | def prefix = task.ext.prefix ?: "${meta.id}" 51 | """ 52 | touch ${prefix}.bam 53 | touch ${prefix}.bam.bai 54 | touch ${prefix}.MarkDuplicates.metrics.txt 55 | 56 | cat <<-END_VERSIONS > versions.yml 57 | "${task.process}": 58 | picard: \$(echo \$(picard MarkDuplicates --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:) 59 | END_VERSIONS 60 | """ 61 | } 62 | -------------------------------------------------------------------------------- /modules/nf-core/picard/markduplicates/meta.yml: -------------------------------------------------------------------------------- 1 | name: picard_markduplicates 2 | description: Locate and tag duplicate reads in a BAM file 3 | keywords: 4 | - markduplicates 5 | - pcr 6 | - duplicates 7 | - bam 8 | - sam 9 | - cram 10 | tools: 11 | - picard: 12 | description: | 13 | A set of command line tools (in Java) for manipulating high-throughput sequencing (HTS) 14 | data and formats such as SAM/BAM/CRAM and VCF. 15 | homepage: https://broadinstitute.github.io/picard/ 16 | documentation: https://broadinstitute.github.io/picard/ 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 file 27 | pattern: "*.{bam,cram,sam}" 28 | - meta2: 29 | type: map 30 | description: | 31 | Groovy Map containing reference information 32 | e.g. [ id:'genome' ] 33 | - fasta: 34 | type: file 35 | description: Reference genome fasta file 36 | pattern: "*.{fasta,fa}" 37 | - meta3: 38 | type: map 39 | description: | 40 | Groovy Map containing reference information 41 | e.g. [ id:'genome' ] 42 | - fai: 43 | type: file 44 | description: Reference genome fasta index 45 | pattern: "*.{fai}" 46 | output: 47 | - meta: 48 | type: map 49 | description: | 50 | Groovy Map containing sample information 51 | e.g. [ id:'test', single_end:false ] 52 | - bam: 53 | type: file 54 | description: BAM file with duplicate reads marked/removed 55 | pattern: "*.{bam}" 56 | - bai: 57 | type: file 58 | description: An optional BAM index file. If desired, --CREATE_INDEX must be passed as a flag 59 | pattern: "*.{bai}" 60 | - metrics: 61 | type: file 62 | description: Duplicate metrics file generated by picard 63 | pattern: "*.{metrics.txt}" 64 | - versions: 65 | type: file 66 | description: File containing software versions 67 | pattern: "versions.yml" 68 | authors: 69 | - "@drpatelh" 70 | - "@projectoriented" 71 | - "@ramprasadn" 72 | -------------------------------------------------------------------------------- /modules/nf-core/picard/mergesamfiles/main.nf: -------------------------------------------------------------------------------- 1 | process PICARD_MERGESAMFILES { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::picard=3.0.0" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/picard:3.0.0--hdfd78af_1' : 8 | 'biocontainers/picard:3.0.0--hdfd78af_1' }" 9 | 10 | input: 11 | tuple val(meta), path(bams) 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 | def args = task.ext.args ?: '' 22 | def prefix = task.ext.prefix ?: "${meta.id}" 23 | def bam_files = bams.sort() 24 | def avail_mem = 3072 25 | if (!task.memory) { 26 | log.info '[Picard MergeSamFiles] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' 27 | } else { 28 | avail_mem = (task.memory.mega*0.8).intValue() 29 | } 30 | if (bam_files.size() > 1) { 31 | """ 32 | picard \\ 33 | -Xmx${avail_mem}M \\ 34 | MergeSamFiles \\ 35 | $args \\ 36 | ${'--INPUT '+bam_files.join(' --INPUT ')} \\ 37 | --OUTPUT ${prefix}.bam 38 | cat <<-END_VERSIONS > versions.yml 39 | "${task.process}": 40 | picard: \$( echo \$(picard MergeSamFiles --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:) 41 | END_VERSIONS 42 | """ 43 | } else { 44 | """ 45 | ln -s ${bam_files[0]} ${prefix}.bam 46 | cat <<-END_VERSIONS > versions.yml 47 | "${task.process}": 48 | picard: \$( echo \$(picard MergeSamFiles --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:) 49 | END_VERSIONS 50 | """ 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /modules/nf-core/picard/mergesamfiles/meta.yml: -------------------------------------------------------------------------------- 1 | name: picard_mergesamfiles 2 | description: Merges multiple BAM files into a single file 3 | keywords: 4 | - merge 5 | - alignment 6 | - bam 7 | - sam 8 | tools: 9 | - picard: 10 | description: | 11 | A set of command line tools (in Java) for manipulating high-throughput sequencing (HTS) 12 | data and formats such as SAM/BAM/CRAM and VCF. 13 | homepage: https://broadinstitute.github.io/picard/ 14 | documentation: https://broadinstitute.github.io/picard/ 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 | - bam: 23 | type: file 24 | description: List of BAM files 25 | pattern: "*.{bam}" 26 | output: 27 | - meta: 28 | type: map 29 | description: | 30 | Groovy Map containing sample information 31 | e.g. [ id:'test', single_end:false ] 32 | - bam: 33 | type: file 34 | description: Merged BAM file 35 | pattern: "*.{bam}" 36 | - versions: 37 | type: file 38 | description: File containing software versions 39 | pattern: "versions.yml" 40 | authors: 41 | - "@drpatelh" 42 | -------------------------------------------------------------------------------- /modules/nf-core/preseq/lcextrap/main.nf: -------------------------------------------------------------------------------- 1 | process PRESEQ_LCEXTRAP { 2 | tag "$meta.id" 3 | label 'process_single' 4 | label 'error_ignore' 5 | 6 | conda "bioconda::preseq=3.1.2" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/preseq:3.1.2--h445547b_2': 9 | 'biocontainers/preseq:3.1.2--h445547b_2' }" 10 | 11 | input: 12 | tuple val(meta), path(bam) 13 | 14 | output: 15 | tuple val(meta), path("*.lc_extrap.txt"), emit: lc_extrap 16 | tuple val(meta), 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 | def paired_end = meta.single_end ? '' : '-pe' 26 | """ 27 | preseq \\ 28 | lc_extrap \\ 29 | $args \\ 30 | $paired_end \\ 31 | -output ${prefix}.lc_extrap.txt \\ 32 | $bam 33 | cp .command.err ${prefix}.command.log 34 | 35 | cat <<-END_VERSIONS > versions.yml 36 | "${task.process}": 37 | preseq: \$(echo \$(preseq 2>&1) | sed 's/^.*Version: //; s/Usage:.*\$//') 38 | END_VERSIONS 39 | """ 40 | } 41 | -------------------------------------------------------------------------------- /modules/nf-core/preseq/lcextrap/meta.yml: -------------------------------------------------------------------------------- 1 | name: preseq_lcextrap 2 | description: Software for predicting library complexity and genome coverage in high-throughput sequencing 3 | keywords: 4 | - preseq 5 | - library 6 | - complexity 7 | tools: 8 | - preseq: 9 | description: Software for predicting library complexity and genome coverage in high-throughput sequencing 10 | homepage: http://smithlabresearch.org/software/preseq/ 11 | documentation: http://smithlabresearch.org/wp-content/uploads/manual.pdf 12 | tool_dev_url: https://github.com/smithlabcode/preseq 13 | 14 | licence: ["GPL"] 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 | - bam: 23 | type: file 24 | description: BAM/CRAM/SAM file 25 | pattern: "*.{bam,cram,sam}" 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 | - lc_extrap: 38 | type: file 39 | description: File containing output of Preseq lcextrap 40 | pattern: "*.{lc_extrap.txt}" 41 | - log: 42 | type: file 43 | description: Log file containing stderr produced by Preseq 44 | pattern: "*.{log}" 45 | 46 | authors: 47 | - "@drpatelh" 48 | - "@Emiller88" 49 | -------------------------------------------------------------------------------- /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.17" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : 8 | 'biocontainers/samtools:1.17--h00cdaf9_0' }" 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: http://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.17" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : 8 | 'biocontainers/samtools:1.17--h00cdaf9_0' }" 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: http://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.17" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : 8 | 'biocontainers/samtools:1.17--h00cdaf9_0' }" 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: http://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.17" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : 8 | 'biocontainers/samtools:1.17--h00cdaf9_0' }" 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 \\ 27 | $args \\ 28 | -@ $task.cpus \\ 29 | -o ${prefix}.bam \\ 30 | -T $prefix \\ 31 | $bam 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}.bam 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/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: http://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.17" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : 8 | 'biocontainers/samtools:1.17--h00cdaf9_0' }" 9 | 10 | input: 11 | tuple val(meta), path(input), path(input_index) 12 | tuple val(meta2), 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: http://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 | - meta2: 34 | type: map 35 | description: | 36 | Groovy Map containing reference information 37 | e.g. [ id:'genome' ] 38 | - fasta: 39 | type: file 40 | description: Reference file the CRAM was created with (optional) 41 | pattern: "*.{fasta,fa}" 42 | output: 43 | - meta: 44 | type: map 45 | description: | 46 | Groovy Map containing sample information 47 | e.g. [ id:'test', single_end:false ] 48 | - stats: 49 | type: file 50 | description: File containing samtools stats output 51 | pattern: "*.{stats}" 52 | - versions: 53 | type: file 54 | description: File containing software versions 55 | pattern: "versions.yml" 56 | authors: 57 | - "@drpatelh" 58 | - "@FriederikeHanssen" 59 | - "@ramprasadn" 60 | -------------------------------------------------------------------------------- /modules/nf-core/subread/featurecounts/main.nf: -------------------------------------------------------------------------------- 1 | process SUBREAD_FEATURECOUNTS { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 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 | 'biocontainers/subread:2.0.1--hed695b0_0' }" 9 | 10 | input: 11 | tuple val(meta), path(bams), path(annotation) 12 | 13 | output: 14 | tuple val(meta), path("*featureCounts.txt") , emit: counts 15 | tuple val(meta), path("*featureCounts.txt.summary"), emit: summary 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 paired_end = meta.single_end ? '' : '-p' 25 | 26 | def strandedness = 0 27 | if (meta.strandedness == 'forward') { 28 | strandedness = 1 29 | } else if (meta.strandedness == 'reverse') { 30 | strandedness = 2 31 | } 32 | """ 33 | featureCounts \\ 34 | $args \\ 35 | $paired_end \\ 36 | -T $task.cpus \\ 37 | -a $annotation \\ 38 | -s $strandedness \\ 39 | -o ${prefix}.featureCounts.txt \\ 40 | ${bams.join(' ')} 41 | 42 | cat <<-END_VERSIONS > versions.yml 43 | "${task.process}": 44 | subread: \$( echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g") 45 | END_VERSIONS 46 | """ 47 | } 48 | -------------------------------------------------------------------------------- /modules/nf-core/subread/featurecounts/meta.yml: -------------------------------------------------------------------------------- 1 | name: subread_featurecounts 2 | description: Count reads that map to genomic features 3 | keywords: 4 | - counts 5 | - fasta 6 | - genome 7 | - reference 8 | 9 | tools: 10 | - featurecounts: 11 | description: featureCounts is a highly efficient general-purpose read summarization program that counts mapped reads for genomic features such as genes, exons, promoter, gene bodies, genomic bins and chromosomal locations. It can be used to count both RNA-seq and genomic DNA-seq reads. 12 | homepage: http://bioinf.wehi.edu.au/featureCounts/ 13 | documentation: http://bioinf.wehi.edu.au/subread-package/SubreadUsersGuide.pdf 14 | doi: "10.1093/bioinformatics/btt656" 15 | licence: ["GPL v3"] 16 | 17 | input: 18 | - meta: 19 | type: map 20 | description: | 21 | Groovy Map containing sample information 22 | e.g. [ id:'test', single_end:false ] 23 | - bam: 24 | type: file 25 | description: BAM/SAM file containing read alignments 26 | pattern: "*.{bam}" 27 | - annotation: 28 | type: file 29 | description: Genomic features annotation in GTF or SAF 30 | pattern: "*.{gtf,saf}" 31 | 32 | output: 33 | - meta: 34 | type: map 35 | description: | 36 | Groovy Map containing sample information 37 | e.g. [ id:'test', single_end:false ] 38 | - counts: 39 | type: file 40 | description: Counts of reads mapping to features 41 | pattern: "*featureCounts.txt" 42 | - summary: 43 | type: file 44 | description: Summary log file 45 | pattern: "*.featureCounts.txt.summary" 46 | - versions: 47 | type: file 48 | description: File containing software versions 49 | pattern: "versions.yml" 50 | 51 | authors: 52 | - "@ntoda03" 53 | -------------------------------------------------------------------------------- /modules/nf-core/trimgalore/meta.yml: -------------------------------------------------------------------------------- 1 | name: trimgalore 2 | description: Trim FastQ files using Trim Galore! 3 | keywords: 4 | - trimming 5 | - adapters 6 | - sequencing adapters 7 | - fastq 8 | tools: 9 | - trimgalore: 10 | description: | 11 | A wrapper tool around Cutadapt and FastQC to consistently apply quality 12 | and adapter trimming to FastQ files, with some extra functionality for 13 | MspI-digested RRBS-type (Reduced Representation Bisufite-Seq) libraries. 14 | homepage: https://www.bioinformatics.babraham.ac.uk/projects/trim_galore/ 15 | documentation: https://github.com/FelixKrueger/TrimGalore/blob/master/Docs/Trim_Galore_User_Guide.md 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 | - reads: 24 | type: file 25 | description: | 26 | List of input FastQ files of size 1 and 2 for single-end and paired-end data, 27 | respectively. 28 | output: 29 | - meta: 30 | type: map 31 | description: | 32 | Groovy Map containing sample information 33 | e.g. [ id:'test', single_end:false ] 34 | - reads: 35 | type: file 36 | description: | 37 | List of input adapter trimmed FastQ files of size 1 and 2 for 38 | single-end and paired-end data, respectively. 39 | pattern: "*{3prime,5prime,trimmed,val}*.fq.gz" 40 | - unpaired: 41 | type: file 42 | description: | 43 | FastQ files containing unpaired reads from read 1 or read 2 44 | pattern: "*unpaired*.fq.gz" 45 | - html: 46 | type: file 47 | description: FastQC report (optional) 48 | pattern: "*_{fastqc.html}" 49 | - zip: 50 | type: file 51 | description: FastQC report archive (optional) 52 | pattern: "*_{fastqc.zip}" 53 | - log: 54 | type: file 55 | description: Trim Galore! trimming report 56 | pattern: "*_{report.txt}" 57 | - versions: 58 | type: file 59 | description: File containing software versions 60 | pattern: "versions.yml" 61 | authors: 62 | - "@drpatelh" 63 | - "@ewels" 64 | - "@FelixKrueger" 65 | -------------------------------------------------------------------------------- /modules/nf-core/ucsc/bedgraphtobigwig/main.nf: -------------------------------------------------------------------------------- 1 | process UCSC_BEDGRAPHTOBIGWIG { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. 6 | conda "bioconda::ucsc-bedgraphtobigwig=445" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/ucsc-bedgraphtobigwig:445--h954228d_0' : 9 | 'biocontainers/ucsc-bedgraphtobigwig:445--h954228d_0' }" 10 | 11 | input: 12 | tuple val(meta), path(bedgraph) 13 | path sizes 14 | 15 | output: 16 | tuple val(meta), path("*.bigWig"), emit: bigwig 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 | def VERSION = '445' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. 26 | """ 27 | bedGraphToBigWig \\ 28 | $bedgraph \\ 29 | $sizes \\ 30 | ${prefix}.bigWig 31 | 32 | cat <<-END_VERSIONS > versions.yml 33 | "${task.process}": 34 | ucsc: $VERSION 35 | END_VERSIONS 36 | """ 37 | 38 | stub: 39 | def prefix = task.ext.prefix ?: "${meta.id}" 40 | def VERSION = '445' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. 41 | """ 42 | touch ${prefix}.bigWig 43 | 44 | cat <<-END_VERSIONS > versions.yml 45 | "${task.process}": 46 | ucsc: $VERSION 47 | END_VERSIONS 48 | """ 49 | } 50 | -------------------------------------------------------------------------------- /modules/nf-core/ucsc/bedgraphtobigwig/meta.yml: -------------------------------------------------------------------------------- 1 | name: ucsc_bedgraphtobigwig 2 | description: Convert a bedGraph file to bigWig format. 3 | keywords: 4 | - bedgraph 5 | - bigwig 6 | - ucsc 7 | - bedgraphtobigwig 8 | - converter 9 | tools: 10 | - ucsc: 11 | description: Convert a bedGraph file to bigWig format. 12 | homepage: http://hgdownload.cse.ucsc.edu/admin/exe/ 13 | documentation: https://genome.ucsc.edu/goldenPath/help/bigWig.html 14 | licence: ["varies; see http://genome.ucsc.edu/license"] 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 | - bedgraph: 23 | type: file 24 | description: bedGraph file 25 | pattern: "*.{bedGraph}" 26 | - sizes: 27 | type: file 28 | description: chromosome sizes file 29 | pattern: "*.{sizes}" 30 | 31 | output: 32 | - meta: 33 | type: map 34 | description: | 35 | Groovy Map containing sample information 36 | e.g. [ id:'test', single_end:false ] 37 | - versions: 38 | type: file 39 | description: File containing software versions 40 | pattern: "versions.yml" 41 | - bigwig: 42 | type: file 43 | description: bigWig file 44 | pattern: "*.{bigWig}" 45 | 46 | authors: 47 | - "@drpatelh" 48 | -------------------------------------------------------------------------------- /modules/nf-core/umitools/extract/main.nf: -------------------------------------------------------------------------------- 1 | process UMITOOLS_EXTRACT { 2 | tag "$meta.id" 3 | label "process_single" 4 | label "process_long" 5 | 6 | conda "bioconda::umi_tools=1.1.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/umi_tools:1.1.4--py38hbff2b2d_1' : 9 | 'biocontainers/umi_tools:1.1.4--py38hbff2b2d_1' }" 10 | 11 | input: 12 | tuple val(meta), path(reads) 13 | 14 | output: 15 | tuple val(meta), path("*.fastq.gz"), emit: reads 16 | tuple val(meta), 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 | if (meta.single_end) { 26 | """ 27 | umi_tools \\ 28 | extract \\ 29 | -I $reads \\ 30 | -S ${prefix}.umi_extract.fastq.gz \\ 31 | $args \\ 32 | > ${prefix}.umi_extract.log 33 | 34 | cat <<-END_VERSIONS > versions.yml 35 | "${task.process}": 36 | umitools: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') 37 | END_VERSIONS 38 | """ 39 | } else { 40 | """ 41 | umi_tools \\ 42 | extract \\ 43 | -I ${reads[0]} \\ 44 | --read2-in=${reads[1]} \\ 45 | -S ${prefix}.umi_extract_1.fastq.gz \\ 46 | --read2-out=${prefix}.umi_extract_2.fastq.gz \\ 47 | $args \\ 48 | > ${prefix}.umi_extract.log 49 | 50 | cat <<-END_VERSIONS > versions.yml 51 | "${task.process}": 52 | umitools: \$(umi_tools --version 2>&1 | sed 's/^.*UMI-tools version://; s/ *\$//') 53 | END_VERSIONS 54 | """ 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /modules/nf-core/umitools/extract/meta.yml: -------------------------------------------------------------------------------- 1 | name: umitools_extract 2 | description: Extracts UMI barcode from a read and add it to the read name, leaving any sample barcode in place 3 | keywords: 4 | - umitools 5 | - extract 6 | tools: 7 | - umi_tools: 8 | description: > 9 | UMI-tools contains tools for dealing with Unique Molecular Identifiers (UMIs)/Random Molecular Tags (RMTs) 10 | and single cell RNA-Seq cell barcodes 11 | documentation: https://umi-tools.readthedocs.io/en/latest/ 12 | license: ["MIT"] 13 | input: 14 | - meta: 15 | type: map 16 | description: | 17 | Groovy Map containing sample information 18 | e.g. [ id:'test', single_end:false ] 19 | - reads: 20 | type: list 21 | description: | 22 | List of input FASTQ files whose UMIs will be extracted. 23 | output: 24 | - meta: 25 | type: map 26 | description: | 27 | Groovy Map containing sample information 28 | e.g. [ id:'test', single_end:false ] 29 | - reads: 30 | type: file 31 | description: > 32 | Extracted FASTQ files. | 33 | For single-end reads, pattern is \${prefix}.umi_extract.fastq.gz. | 34 | For paired-end reads, pattern is \${prefix}.umi_extract_{1,2}.fastq.gz. 35 | pattern: "*.{fastq.gz}" 36 | - log: 37 | type: file 38 | description: Logfile for umi_tools 39 | pattern: "*.{log}" 40 | - versions: 41 | type: file 42 | description: File containing software versions 43 | pattern: "versions.yml" 44 | 45 | authors: 46 | - "@drpatelh" 47 | - "@grst" 48 | -------------------------------------------------------------------------------- /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 | 'nf-core/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 | - extract 7 | tools: 8 | - untar: 9 | description: | 10 | Extract tar.gz files. 11 | documentation: https://www.gnu.org/software/tar/manual/ 12 | licence: ["GPL-3.0-or-later"] 13 | input: 14 | - meta: 15 | type: map 16 | description: | 17 | Groovy Map containing sample information 18 | e.g. [ id:'test', single_end:false ] 19 | - archive: 20 | type: file 21 | description: File to be untar 22 | pattern: "*.{tar}.{gz}" 23 | output: 24 | - meta: 25 | type: map 26 | description: | 27 | Groovy Map containing sample information 28 | e.g. [ id:'test', single_end:false ] 29 | - untar: 30 | type: directory 31 | description: Directory containing contents of archive 32 | pattern: "*/" 33 | - versions: 34 | type: file 35 | description: File containing software versions 36 | pattern: "versions.yml" 37 | authors: 38 | - "@joseespinosa" 39 | - "@drpatelh" 40 | - "@matthdsm" 41 | - "@jfy133" 42 | -------------------------------------------------------------------------------- /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_star.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Map reads, sort, index BAM file and run samtools stats, flagstat and idxstats 3 | */ 4 | 5 | include { STAR_ALIGN } from '../../modules/local/star_align' 6 | include { BAM_SORT_STATS_SAMTOOLS } from '../nf-core/bam_sort_stats_samtools/main' 7 | 8 | workflow ALIGN_STAR { 9 | take: 10 | ch_reads // channel: [ val(meta), [ reads ] ] 11 | ch_index // channel: /path/to/star/index/ 12 | ch_fasta // channel: /path/to/fasta 13 | seq_center // string: sequencing center 14 | 15 | main: 16 | 17 | ch_versions = Channel.empty() 18 | 19 | // 20 | // Map reads with STAR 21 | // 22 | STAR_ALIGN ( ch_reads, ch_index, seq_center ) 23 | ch_versions = ch_versions.mix(STAR_ALIGN.out.versions.first()) 24 | 25 | // 26 | // Sort, index BAM file and run samtools stats, flagstat and idxstats 27 | // 28 | BAM_SORT_STATS_SAMTOOLS ( STAR_ALIGN.out.bam, ch_fasta ) 29 | ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) 30 | 31 | emit: 32 | orig_bam = STAR_ALIGN.out.bam // channel: [ val(meta), bam ] 33 | log_final = STAR_ALIGN.out.log_final // channel: [ val(meta), log_final ] 34 | log_out = STAR_ALIGN.out.log_out // channel: [ val(meta), log_out ] 35 | log_progress = STAR_ALIGN.out.log_progress // channel: [ val(meta), log_progress ] 36 | bam_sorted = STAR_ALIGN.out.bam_sorted // channel: [ val(meta), bam_sorted ] 37 | bam_transcript = STAR_ALIGN.out.bam_transcript // channel: [ val(meta), bam_transcript ] 38 | fastq = STAR_ALIGN.out.fastq // channel: [ val(meta), fastq ] 39 | tab = STAR_ALIGN.out.tab // channel: [ val(meta), tab ] 40 | 41 | bam = BAM_SORT_STATS_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ] 42 | bai = BAM_SORT_STATS_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ] 43 | stats = BAM_SORT_STATS_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ] 44 | flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ] 45 | idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ] 46 | 47 | versions = ch_versions // channel: [ versions.yml ] 48 | } 49 | -------------------------------------------------------------------------------- /subworkflows/local/bam_bedgraph_bigwig_bedtools_ucsc.nf: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // Convert BAM to normalised bigWig via bedGraph using BEDTools and UCSC 4 | // 5 | 6 | include { BEDTOOLS_GENOMECOV } from '../../modules/local/bedtools_genomecov' 7 | include { UCSC_BEDGRAPHTOBIGWIG } from '../../modules/nf-core/ucsc/bedgraphtobigwig/main' 8 | 9 | workflow BAM_BEDGRAPH_BIGWIG_BEDTOOLS_UCSC { 10 | take: 11 | ch_bam_flagstat // channel: [ val(meta), [bam], [flagstat] ] 12 | ch_chrom_sizes // channel: [ bed ] 13 | 14 | main: 15 | 16 | ch_versions = Channel.empty() 17 | 18 | // 19 | // Create bedGraph coverage track 20 | // 21 | BEDTOOLS_GENOMECOV ( 22 | ch_bam_flagstat 23 | ) 24 | ch_versions = ch_versions.mix(BEDTOOLS_GENOMECOV.out.versions.first()) 25 | 26 | // 27 | // Create bigWig coverage tracks 28 | // 29 | UCSC_BEDGRAPHTOBIGWIG ( 30 | BEDTOOLS_GENOMECOV.out.bedgraph, 31 | ch_chrom_sizes 32 | ) 33 | ch_versions = ch_versions.mix(UCSC_BEDGRAPHTOBIGWIG.out.versions.first()) 34 | 35 | emit: 36 | bedgraph = BEDTOOLS_GENOMECOV.out.bedgraph // channel: [ val(meta), [ bedgraph ] ] 37 | scale_factor = BEDTOOLS_GENOMECOV.out.scale_factor // channel: [ val(meta), [ txt ] ] 38 | 39 | bigwig = UCSC_BEDGRAPHTOBIGWIG.out.bigwig // channel: [ val(meta), [ bigwig ] ] 40 | 41 | versions = ch_versions // channel: [ versions.yml ] 42 | } 43 | -------------------------------------------------------------------------------- /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 | seq_center // string: sequencing center for read group 11 | with_control // boolean: samplesheet contains controls 12 | 13 | 14 | main: 15 | SAMPLESHEET_CHECK ( samplesheet ) 16 | .csv 17 | .splitCsv ( header:true, sep:',' ) 18 | .map { create_fastq_channel(it, seq_center) } 19 | .set { reads } 20 | 21 | emit: 22 | reads // channel: [ val(meta), [ reads ] ] 23 | versions = SAMPLESHEET_CHECK.out.versions // channel: [ versions.yml ] 24 | } 25 | 26 | // Function to get list of [ meta, [ fastq_1, fastq_2 ] ] 27 | def create_fastq_channel(LinkedHashMap row, String seq_center) { 28 | def meta = [:] 29 | meta.id = row.sample 30 | meta.single_end = row.single_end.toBoolean() 31 | meta.control = row.control 32 | 33 | def read_group = "\'@RG\\tID:${meta.id}\\tSM:${meta.id - ~/_T\d+$/}\\tPL:ILLUMINA\\tLB:${meta.id}\\tPU:1\'" 34 | if (seq_center) { 35 | read_group = "\'@RG\\tID:${meta.id}\\tSM:${meta.id - ~/_T\d+$/}\\tPL:ILLUMINA\\tLB:${meta.id}\\tPU:1\\tCN:${seq_center}\'" 36 | } 37 | meta.read_group = read_group 38 | 39 | // add path(s) of the fastq file(s) to the meta map 40 | def fastq_meta = [] 41 | if (!file(row.fastq_1).exists()) { 42 | exit 1, "ERROR: Please check input samplesheet -> Read 1 FastQ file does not exist!\n${row.fastq_1}" 43 | } 44 | if (meta.single_end) { 45 | fastq_meta = [ meta, [ file(row.fastq_1) ] ] 46 | } else { 47 | if (!file(row.fastq_2).exists()) { 48 | exit 1, "ERROR: Please check input samplesheet -> Read 2 FastQ file does not exist!\n${row.fastq_2}" 49 | } 50 | fastq_meta = [ meta, [ file(row.fastq_1), file(row.fastq_2) ] ] 51 | } 52 | return fastq_meta 53 | } 54 | -------------------------------------------------------------------------------- /subworkflows/nf-core/bam_markduplicates_picard/main.nf: -------------------------------------------------------------------------------- 1 | // 2 | // Picard MarkDuplicates, index BAM file and run samtools stats, flagstat and idxstats 3 | // 4 | 5 | include { PICARD_MARKDUPLICATES } from '../../../modules/nf-core/picard/markduplicates/main' 6 | include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' 7 | include { BAM_STATS_SAMTOOLS } from '../bam_stats_samtools/main' 8 | 9 | workflow BAM_MARKDUPLICATES_PICARD { 10 | 11 | take: 12 | ch_bam // channel: [ val(meta), path(bam) ] 13 | ch_fasta // channel: [ path(fasta) ] 14 | ch_fai // channel: [ path(fai) ] 15 | 16 | main: 17 | 18 | ch_versions = Channel.empty() 19 | 20 | PICARD_MARKDUPLICATES ( ch_bam, ch_fasta, ch_fai ) 21 | ch_versions = ch_versions.mix(PICARD_MARKDUPLICATES.out.versions.first()) 22 | 23 | SAMTOOLS_INDEX ( PICARD_MARKDUPLICATES.out.bam ) 24 | ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) 25 | 26 | ch_bam_bai = PICARD_MARKDUPLICATES.out.bam 27 | .join(SAMTOOLS_INDEX.out.bai, by: [0], remainder: true) 28 | .join(SAMTOOLS_INDEX.out.csi, by: [0], remainder: true) 29 | .map { 30 | meta, bam, bai, csi -> 31 | if (bai) { 32 | [ meta, bam, bai ] 33 | } else { 34 | [ meta, bam, csi ] 35 | } 36 | } 37 | 38 | BAM_STATS_SAMTOOLS ( ch_bam_bai, ch_fasta ) 39 | ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) 40 | 41 | emit: 42 | bam = PICARD_MARKDUPLICATES.out.bam // channel: [ val(meta), path(bam) ] 43 | metrics = PICARD_MARKDUPLICATES.out.metrics // channel: [ val(meta), path(bam) ] 44 | bai = SAMTOOLS_INDEX.out.bai // channel: [ val(meta), path(bai) ] 45 | csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), path(csi) ] 46 | 47 | stats = BAM_STATS_SAMTOOLS.out.stats // channel: [ val(meta), path(stats) ] 48 | flagstat = BAM_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), path(flagstat) ] 49 | idxstats = BAM_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), path(idxstats) ] 50 | 51 | versions = ch_versions // channel: [ versions.yml ] 52 | } 53 | -------------------------------------------------------------------------------- /subworkflows/nf-core/bam_markduplicates_picard/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: "bam_markduplicates_picard" 3 | description: Picard MarkDuplicates, index BAM file and run samtools stats, flagstat and idxstats 4 | keywords: 5 | - markduplicates 6 | - bam 7 | - sam 8 | - cram 9 | 10 | modules: 11 | - picard/markduplicates 12 | - samtools/index 13 | - samtools/stats 14 | - samtools/idxstats 15 | - samtools/flagstat 16 | 17 | input: 18 | - ch_bam: 19 | description: | 20 | BAM/CRAM/SAM file 21 | Structure: [ val(meta), path(bam) ] 22 | - ch_fasta: 23 | description: | 24 | Reference genome fasta file 25 | Structure: [ path(fasta) ] 26 | - ch_fasta: 27 | description: | 28 | Index of the reference genome fasta file 29 | Structure: [ path(fai) ] 30 | output: 31 | - bam: 32 | description: | 33 | processed BAM/CRAM/SAM file 34 | Structure: [ val(meta), path(bam) ] 35 | - bai: 36 | description: | 37 | BAM/CRAM/SAM samtools index 38 | Structure: [ val(meta), path(bai) ] 39 | - csi: 40 | description: | 41 | CSI samtools index 42 | Structure: [ val(meta), path(csi) ] 43 | - stats: 44 | description: | 45 | File containing samtools stats output 46 | Structure: [ val(meta), path(stats) ] 47 | - flagstat: 48 | description: | 49 | File containing samtools flagstat output 50 | Structure: [ val(meta), path(flagstat) ] 51 | - idxstats: 52 | description: | 53 | File containing samtools idxstats output 54 | Structure: [ val(meta), path(idxstats) ] 55 | - versions: 56 | description: | 57 | Files containing software versions 58 | Structure: [ path(versions.yml) ] 59 | authors: 60 | - "@dmarron" 61 | - "@drpatelh" 62 | -------------------------------------------------------------------------------- /subworkflows/nf-core/bam_sort_stats_samtools/main.nf: -------------------------------------------------------------------------------- 1 | // 2 | // Sort, index BAM file and run samtools stats, flagstat and idxstats 3 | // 4 | 5 | include { SAMTOOLS_SORT } from '../../../modules/nf-core/samtools/sort/main' 6 | include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' 7 | include { BAM_STATS_SAMTOOLS } from '../bam_stats_samtools/main' 8 | 9 | workflow BAM_SORT_STATS_SAMTOOLS { 10 | take: 11 | ch_bam // channel: [ val(meta), [ bam ] ] 12 | ch_fasta // channel: [ val(meta), path(fasta) ] 13 | 14 | main: 15 | 16 | ch_versions = Channel.empty() 17 | 18 | SAMTOOLS_SORT ( ch_bam ) 19 | ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) 20 | 21 | SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ) 22 | ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) 23 | 24 | SAMTOOLS_SORT.out.bam 25 | .join(SAMTOOLS_INDEX.out.bai, by: [0], remainder: true) 26 | .join(SAMTOOLS_INDEX.out.csi, by: [0], remainder: true) 27 | .map { 28 | meta, bam, bai, csi -> 29 | if (bai) { 30 | [ meta, bam, bai ] 31 | } else { 32 | [ meta, bam, csi ] 33 | } 34 | } 35 | .set { ch_bam_bai } 36 | 37 | BAM_STATS_SAMTOOLS ( ch_bam_bai, ch_fasta ) 38 | ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) 39 | 40 | emit: 41 | bam = SAMTOOLS_SORT.out.bam // channel: [ val(meta), [ bam ] ] 42 | bai = SAMTOOLS_INDEX.out.bai // channel: [ val(meta), [ bai ] ] 43 | csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), [ csi ] ] 44 | 45 | stats = BAM_STATS_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ] 46 | flagstat = BAM_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ] 47 | idxstats = BAM_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ] 48 | 49 | versions = ch_versions // channel: [ versions.yml ] 50 | } 51 | -------------------------------------------------------------------------------- /subworkflows/nf-core/bam_sort_stats_samtools/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: bam_sort_stats_samtools 3 | description: Sort SAM/BAM/CRAM file 4 | keywords: 5 | - sort 6 | - bam 7 | - sam 8 | - cram 9 | modules: 10 | - samtools/sort 11 | - samtools/index 12 | - samtools/stats 13 | - samtools/idxstats 14 | - samtools/flagstat 15 | input: 16 | - meta: 17 | type: map 18 | description: | 19 | Groovy Map containing sample information 20 | e.g. [ id:'test', single_end:false ] 21 | - bam: 22 | type: file 23 | description: BAM/CRAM/SAM file 24 | pattern: "*.{bam,cram,sam}" 25 | - fasta: 26 | type: file 27 | description: Reference genome fasta file 28 | pattern: "*.{fasta,fa}" 29 | # TODO Update when we decide on a standard for subworkflow docs 30 | output: 31 | - meta: 32 | type: map 33 | description: | 34 | Groovy Map containing sample information 35 | e.g. [ id:'test', single_end:false ] 36 | - bam: 37 | type: file 38 | description: Sorted BAM/CRAM/SAM file 39 | pattern: "*.{bam,cram,sam}" 40 | - bai: 41 | type: file 42 | description: BAM/CRAM/SAM index file 43 | pattern: "*.{bai,crai,sai}" 44 | - crai: 45 | type: file 46 | description: BAM/CRAM/SAM index file 47 | pattern: "*.{bai,crai,sai}" 48 | - stats: 49 | type: file 50 | description: File containing samtools stats output 51 | pattern: "*.{stats}" 52 | - flagstat: 53 | type: file 54 | description: File containing samtools flagstat output 55 | pattern: "*.{flagstat}" 56 | - idxstats: 57 | type: file 58 | description: File containing samtools idxstats output 59 | pattern: "*.{idxstats}" 60 | - versions: 61 | type: file 62 | description: File containing software versions 63 | pattern: "versions.yml" 64 | authors: 65 | - "@drpatelh" 66 | - "@ewels" 67 | -------------------------------------------------------------------------------- /subworkflows/nf-core/bam_stats_samtools/main.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), path(bam), path(bai) ] 12 | ch_fasta // channel: [ val(meta), path(fasta) ] 13 | 14 | main: 15 | ch_versions = Channel.empty() 16 | 17 | SAMTOOLS_STATS ( ch_bam_bai, ch_fasta ) 18 | ch_versions = ch_versions.mix(SAMTOOLS_STATS.out.versions) 19 | 20 | SAMTOOLS_FLAGSTAT ( ch_bam_bai ) 21 | ch_versions = ch_versions.mix(SAMTOOLS_FLAGSTAT.out.versions) 22 | 23 | SAMTOOLS_IDXSTATS ( ch_bam_bai ) 24 | ch_versions = ch_versions.mix(SAMTOOLS_IDXSTATS.out.versions) 25 | 26 | emit: 27 | stats = SAMTOOLS_STATS.out.stats // channel: [ val(meta), path(stats) ] 28 | flagstat = SAMTOOLS_FLAGSTAT.out.flagstat // channel: [ val(meta), path(flagstat) ] 29 | idxstats = SAMTOOLS_IDXSTATS.out.idxstats // channel: [ val(meta), path(idxstats) ] 30 | 31 | versions = ch_versions // channel: [ path(versions.yml) ] 32 | } 33 | -------------------------------------------------------------------------------- /subworkflows/nf-core/bam_stats_samtools/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: bam_stats_samtools 3 | description: Produces comprehensive statistics from SAM/BAM/CRAM file 4 | keywords: 5 | - statistics 6 | - counts 7 | - bam 8 | - sam 9 | - cram 10 | modules: 11 | - samtools/stats 12 | - samtools/idxstats 13 | - samtools/flagstat 14 | input: 15 | - ch_bam_bai: 16 | description: | 17 | The input channel containing the BAM/CRAM and it's index 18 | Structure: [ val(meta), path(bam), path(bai) ] 19 | - ch_fasta: 20 | description: | 21 | Reference genome fasta file 22 | Structure: [ path(fasta) ] 23 | output: 24 | - stats: 25 | description: | 26 | File containing samtools stats output 27 | Structure: [ val(meta), path(stats) ] 28 | - flagstat: 29 | description: | 30 | File containing samtools flagstat output 31 | Structure: [ val(meta), path(flagstat) ] 32 | - idxstats: 33 | description: | 34 | File containing samtools idxstats output 35 | Structure: [ val(meta), path(idxstats)] 36 | - versions: 37 | description: | 38 | Files containing software versions 39 | Structure: [ path(versions.yml) ] 40 | authors: 41 | - "@drpatelh" 42 | -------------------------------------------------------------------------------- /subworkflows/nf-core/fastq_align_bowtie2/main.nf: -------------------------------------------------------------------------------- 1 | // 2 | // Alignment with Bowtie2 3 | // 4 | 5 | include { BOWTIE2_ALIGN } from '../../../modules/nf-core/bowtie2/align/main' 6 | include { BAM_SORT_STATS_SAMTOOLS } from '../bam_sort_stats_samtools/main' 7 | 8 | workflow FASTQ_ALIGN_BOWTIE2 { 9 | take: 10 | ch_reads // channel: [ val(meta), [ reads ] ] 11 | ch_index // channel: /path/to/bowtie2/index/ 12 | save_unaligned // val 13 | sort_bam // val 14 | ch_fasta // channel: /path/to/reference.fasta 15 | 16 | main: 17 | 18 | ch_versions = Channel.empty() 19 | 20 | // 21 | // Map reads with Bowtie2 22 | // 23 | BOWTIE2_ALIGN ( ch_reads, ch_index, save_unaligned, sort_bam ) 24 | ch_versions = ch_versions.mix(BOWTIE2_ALIGN.out.versions) 25 | 26 | // 27 | // Sort, index BAM file and run samtools stats, flagstat and idxstats 28 | // 29 | BAM_SORT_STATS_SAMTOOLS ( BOWTIE2_ALIGN.out.aligned, ch_fasta ) 30 | ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) 31 | 32 | emit: 33 | bam_orig = BOWTIE2_ALIGN.out.aligned // channel: [ val(meta), aligned ] 34 | log_out = BOWTIE2_ALIGN.out.log // channel: [ val(meta), log ] 35 | fastq = BOWTIE2_ALIGN.out.fastq // channel: [ val(meta), fastq ] 36 | 37 | bam = BAM_SORT_STATS_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ] 38 | bai = BAM_SORT_STATS_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ] 39 | csi = BAM_SORT_STATS_SAMTOOLS.out.csi // channel: [ val(meta), [ csi ] ] 40 | stats = BAM_SORT_STATS_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ] 41 | flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ] 42 | idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ] 43 | 44 | versions = ch_versions // channel: [ versions.yml ] 45 | } 46 | -------------------------------------------------------------------------------- /subworkflows/nf-core/fastq_align_bowtie2/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: fastq_align_bowtie2 3 | description: Align reads to a reference genome using bowtie2 then sort with samtools 4 | keywords: 5 | - align 6 | - fasta 7 | - genome 8 | - reference 9 | modules: 10 | - bowtie2/align 11 | - samtools/sort 12 | - samtools/index 13 | - samtools/stats 14 | - samtools/idxstats 15 | - samtools/flagstat 16 | input: 17 | - meta: 18 | type: map 19 | description: | 20 | Groovy Map containing sample information 21 | e.g. [ id:'test', single_end:false ] 22 | - ch_reads: 23 | type: file 24 | description: | 25 | List of input FastQ files of size 1 and 2 for single-end and paired-end data, 26 | respectively. 27 | - ch_index: 28 | type: file 29 | description: Bowtie2 genome index files 30 | pattern: "*.ebwt" 31 | - save_unaligned: 32 | type: boolean 33 | description: | 34 | Save reads that do not map to the reference (true) or discard them (false) 35 | (default: false) 36 | - sort_bam: 37 | type: boolean 38 | description: | 39 | Save reads that do not map to the reference (true) or discard them (false) 40 | default: false 41 | - ch_fasta: 42 | type: file 43 | description: Reference fasta file 44 | pattern: "*.{fasta,fa}" 45 | # TODO Update when we decide on a standard for subworkflow docs 46 | output: 47 | - bam: 48 | type: file 49 | description: Output BAM file containing read alignments 50 | pattern: "*.{bam}" 51 | - versions: 52 | type: file 53 | description: File containing software versions 54 | pattern: "versions.yml" 55 | - fastq: 56 | type: file 57 | description: Unaligned FastQ files 58 | pattern: "*.fastq.gz" 59 | - log: 60 | type: file 61 | description: Alignment log 62 | pattern: "*.log" 63 | # TODO Add samtools outputs 64 | authors: 65 | - "@drpatelh" 66 | -------------------------------------------------------------------------------- /subworkflows/nf-core/fastq_align_bwa/main.nf: -------------------------------------------------------------------------------- 1 | // 2 | // Alignment with BWA 3 | // 4 | 5 | include { BWA_MEM } from '../../../modules/nf-core/bwa/mem/main' 6 | include { BAM_SORT_STATS_SAMTOOLS } from '../bam_sort_stats_samtools/main' 7 | 8 | workflow FASTQ_ALIGN_BWA { 9 | take: 10 | ch_reads // channel (mandatory): [ val(meta), [ path(reads) ] ] 11 | ch_index // channel (mandatory): [ val(meta2), path(index) ] 12 | val_sort_bam // boolean (mandatory): true or false 13 | ch_fasta // channel (optional) : [ path(fasta) ] 14 | 15 | main: 16 | ch_versions = Channel.empty() 17 | 18 | // 19 | // Map reads with BWA 20 | // 21 | 22 | BWA_MEM ( ch_reads, ch_index, val_sort_bam ) 23 | ch_versions = ch_versions.mix(BWA_MEM.out.versions.first()) 24 | 25 | // 26 | // Sort, index BAM file and run samtools stats, flagstat and idxstats 27 | // 28 | 29 | BAM_SORT_STATS_SAMTOOLS ( BWA_MEM.out.bam, ch_fasta ) 30 | ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) 31 | 32 | emit: 33 | bam_orig = BWA_MEM.out.bam // channel: [ val(meta), path(bam) ] 34 | 35 | bam = BAM_SORT_STATS_SAMTOOLS.out.bam // channel: [ val(meta), path(bam) ] 36 | bai = BAM_SORT_STATS_SAMTOOLS.out.bai // channel: [ val(meta), path(bai) ] 37 | csi = BAM_SORT_STATS_SAMTOOLS.out.csi // channel: [ val(meta), path(csi) ] 38 | stats = BAM_SORT_STATS_SAMTOOLS.out.stats // channel: [ val(meta), path(stats) ] 39 | flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), path(flagstat) ] 40 | idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), path(idxstats) ] 41 | 42 | versions = ch_versions // channel: [ path(versions.yml) ] 43 | } 44 | -------------------------------------------------------------------------------- /subworkflows/nf-core/fastq_align_bwa/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: fastq_align_bwa 3 | description: Align reads to a reference genome using bwa then sort with samtools 4 | keywords: 5 | - align 6 | - fasta 7 | - genome 8 | - reference 9 | modules: 10 | - bwa/align 11 | - samtools/sort 12 | - samtools/index 13 | - samtools/stats 14 | - samtools/idxstats 15 | - samtools/flagstat 16 | input: 17 | - ch_reads: 18 | description: | 19 | List of input FastQ files of size 1 and 2 for single-end and paired-end data, 20 | respectively. 21 | Structure: [ val(meta), [ path(reads) ] ] 22 | - ch_index: 23 | description: | 24 | BWA genome index files 25 | Structure: [ val(meta2), path(index) ] 26 | - val_sort_bam: 27 | type: boolean 28 | description: If true bwa modules sort resulting bam files 29 | pattern: "true|false" 30 | - ch_fasta: 31 | type: file 32 | description: | 33 | Optional reference fasta file. This only needs to be given if val_sort_bam = true 34 | Structure: [ path(fasta) ] 35 | 36 | output: 37 | - bam_orig: 38 | description: | 39 | BAM file produced by bwa 40 | Structure: [ val(meta), path(bam) ] 41 | - bam: 42 | description: | 43 | BAM file ordered by samtools 44 | Structure: [ val(meta), path(bam) ] 45 | - bai: 46 | description: | 47 | BAI index of the ordered BAM file 48 | Structure: [ val(meta), path(bai) ] 49 | - csi: 50 | description: | 51 | CSI index of the ordered BAM file 52 | Structure: [ val(meta), path(csi) ] 53 | - stats: 54 | description: | 55 | File containing samtools stats output 56 | Structure: [ val(meta), path(stats) ] 57 | - flagstat: 58 | description: | 59 | File containing samtools flagstat output 60 | Structure: [ val(meta), path(flagstat) ] 61 | - idxstats: 62 | description: | 63 | File containing samtools idxstats output 64 | Structure: [ val(meta), path(idxstats) ] 65 | - versions: 66 | description: | 67 | Files containing software versions 68 | Structure: [ path(versions.yml) ] 69 | authors: 70 | - "@JoseEspinosa" 71 | -------------------------------------------------------------------------------- /subworkflows/nf-core/fastq_align_chromap/main.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Map reads, sort, index BAM file and run samtools stats, flagstat and idxstats 3 | */ 4 | 5 | include { CHROMAP_CHROMAP } from '../../../modules/nf-core/chromap/chromap/main' 6 | include { BAM_SORT_STATS_SAMTOOLS } from '../bam_sort_stats_samtools/main' 7 | 8 | workflow FASTQ_ALIGN_CHROMAP { 9 | take: 10 | ch_reads // channel (mandatory): [ val(meta), [ reads ] ] 11 | ch_index // channel (mandatory): [ val(meta2, [ index ] ] 12 | ch_fasta // channel (mandatory): [ val(meta2, [ fasta ] ] 13 | ch_barcodes // channel (optional): [ barcodes ] 14 | ch_whitelist // channel (optional): [ whitelist ] 15 | ch_chr_order // channel (optional): [ chr_order ] 16 | ch_pairs_chr_order // channel (optional): [ pairs_chr_order ] 17 | 18 | main: 19 | ch_versions = Channel.empty() 20 | 21 | // 22 | // Map reads with CHROMAP 23 | // 24 | CHROMAP_CHROMAP(ch_reads, ch_fasta, ch_index, ch_barcodes, ch_whitelist, ch_chr_order, ch_pairs_chr_order) 25 | ch_versions = ch_versions.mix(CHROMAP_CHROMAP.out.versions) 26 | 27 | // 28 | // Sort, index BAM file and run samtools stats, flagstat and idxstats 29 | // 30 | BAM_SORT_STATS_SAMTOOLS(CHROMAP_CHROMAP.out.bam, ch_fasta) 31 | ch_versions = ch_versions.mix(BAM_SORT_STATS_SAMTOOLS.out.versions) 32 | 33 | emit: 34 | bam = BAM_SORT_STATS_SAMTOOLS.out.bam // channel: [ val(meta), [ bam ] ] 35 | bai = BAM_SORT_STATS_SAMTOOLS.out.bai // channel: [ val(meta), [ bai ] ] 36 | stats = BAM_SORT_STATS_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ] 37 | flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ] 38 | idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ] 39 | 40 | versions = ch_versions // path: versions.yml 41 | } 42 | -------------------------------------------------------------------------------- /tower.yml: -------------------------------------------------------------------------------- 1 | reports: 2 | multiqc_report.html: 3 | display: "MultiQC HTML report" 4 | samplesheet.csv: 5 | display: "Auto-created samplesheet with collated metadata and FASTQ paths" 6 | macs2_peak.mLb.clN.plots.pdf: 7 | display: "Merged library all samples MACS2 peak QC PDF plots" 8 | macs2_peak.mRp.clN.plots.pdf: 9 | display: "Merged replicate all samples MACS2 peak QC PDF plots" 10 | macs2_annotatePeaks.mLb.clN.plots.pdf: 11 | display: "Merged library all samples HOMER annotatePeaks.pl QC PDF plots" 12 | macs2_annotatePeaks.mRp.clN.plots.pdf: 13 | display: "Merged replicate all samples HOMER annotatePeaks.pl QC PDF plots" 14 | consensus_peaks.mLb.clN.plots.pdf: 15 | display: "Merged library consensus peaks DESeq2 QC PDF plots" 16 | consensus_peaks.mRp.clN.plots.pdf: 17 | display: "Merged replicate consensus peaks DESeq2 QC PDF plots" 18 | consensus_peaks.mLb.clN.boolean.intersect.plot.pdf: 19 | display: "Merged library consensus peaks UpSetR intersection PDF plots" 20 | consensus_peaks.mRp.clN.boolean.intersect.plot.pdf: 21 | display: "Merged replicate consensus peaks UpSetR intersection PDF plots" 22 | consensus_peaks.mLb.clN.annotatePeaks.txt: 23 | display: "Merged library consensus peaks annotated by HOMER" 24 | consensus_peaks.mRp.clN.annotatePeaks.txt: 25 | display: "Merged replicate consensus peaks annotated by HOMER" 26 | "*.plotHeatmap.pdf": 27 | display: "Merged library per-sample deepTools plotHeatmap PDF plots" 28 | "*mLb.clN_peaks.broadPeak": 29 | display: "Merged library per-sample MACS2 broadPeak file" 30 | "*mRp.clN_peaks.broadPeak": 31 | display: "Merged replicate per-sample MACS2 broadPeak file" 32 | "*mLb.clN_peaks.narrowPeak": 33 | display: "Merged library per-sample MACS2 narrowPeak file" 34 | "*mRp.clN_peaks.narrowPeak": 35 | display: "Merged replicate per-sample MACS2 narrowPeak file" 36 | --------------------------------------------------------------------------------