├── .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 │ ├── ci_immcantation.yml │ ├── clean-up.yml │ ├── download_pipeline.yml │ ├── fix-linting.yml │ ├── linting.yml │ ├── linting_comment.yml │ ├── release-announcements.yml │ └── template_version_comment.yml ├── .gitignore ├── .gitpod.yml ├── .nf-core.yml ├── .pre-commit-config.yaml ├── .prettierignore ├── .prettierrc.yml ├── .vscode └── settings.json ├── CHANGELOG.md ├── CITATIONS.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── assets ├── adaptivecard.json ├── email_template.html ├── email_template.txt ├── methods_description_template.yml ├── multiqc_config.yml ├── nf-core-airrflow_logo_light.png ├── nf-core-airrflow_logo_reports.png ├── nf-core_style.css ├── repertoire_comparison.Rmd ├── reveal │ └── mapping_MiAIRR_BioSample_v1.3.1.tsv ├── schema_input.json ├── sendmail_template.txt ├── single_cell_tutorial │ ├── airrflow.sh │ └── samplesheet.tsv └── slackreport.json ├── bin ├── add_metadata.R ├── check_samplesheet.py ├── clean_imgtdb.py ├── execute_report.R ├── fetch_databases.sh ├── fetch_igblastdb.sh ├── fetch_imgt.sh ├── imgt2igblast.sh ├── log_parsing.py ├── log_parsing_no-umi.py ├── merge_R1_umi.py ├── merge_graphs.sh ├── reveal_add_metadata.R ├── reveal_collapseDuplicates.R ├── reveal_filter_quality.R └── reveal_mod_3_junction.R ├── conf ├── base.config ├── clontech_umi_bcr.config ├── clontech_umi_tcr.config ├── igenomes_ignored.config ├── modules.config ├── nebnext_umi_bcr.config ├── nebnext_umi_tcr.config ├── test.config ├── test_10x_sc.config ├── test_assembled_hs.config ├── test_assembled_immcantation_devel_hs.config ├── test_assembled_immcantation_devel_mm.config ├── test_assembled_mm.config ├── test_clontech_umi.config ├── test_embeddings_H.config ├── test_embeddings_HL.config ├── test_fetchimgt.config ├── test_full.config ├── test_maskprimers_align.config ├── test_maskprimers_extract.config ├── test_nebnext_umi.config ├── test_no_umi.config ├── test_nocluster.config ├── test_raw_immcantation_devel.config ├── test_rnaseq_bulk.config ├── test_rnaseq_sc.config └── test_tcr.config ├── docs ├── README.md ├── images │ ├── Primers_R1_UMI_C.png │ ├── Primers_R1_UMI_V.png │ ├── Primers_R1_V.png │ ├── TAKARA_RACE_BCR.png │ ├── TAKARA_RACE_TCR.png │ ├── airrflow_workflow_overview.ai │ ├── airrflow_workflow_overview.pdf │ ├── airrflow_workflow_overview.png │ ├── metro-map-airrflow.ai │ ├── metro-map-airrflow.pdf │ ├── metro-map-airrflow.png │ ├── metro-map-airrflow.svg │ ├── nf-core-airrflow_logo_dark.png │ └── nf-core-airrflow_logo_light.png ├── output.md ├── usage.md └── usage │ ├── FAQ.md │ ├── bulk_tutorial.md │ ├── bulk_tutorial │ └── bulk_sample_code │ │ ├── airrflow_bulk_b_fastq.sh │ │ ├── metadata_pcr_umi_airr_300.tsv │ │ └── resource.config │ ├── single_cell_tutorial.md │ └── single_cell_tutorial │ └── sample_data_code │ ├── 10x_sc_raw.tsv │ ├── airrflow_sc_from_assembled.sh │ ├── airrflow_sc_from_fastq.sh │ ├── assembled_samplesheet.tsv │ ├── assembled_samplesheet_missing_sex.tsv │ └── resource.config ├── main.nf ├── modules.json ├── modules ├── local │ ├── airrflow_report │ │ └── airrflow_report.nf │ ├── changeo │ │ ├── changeo_assigngenes.nf │ │ ├── changeo_convertdb_fasta.nf │ │ ├── changeo_creategermlines.nf │ │ ├── changeo_makedb.nf │ │ ├── changeo_parsedb_select_locus.nf │ │ └── changeo_parsedb_split.nf │ ├── enchantr │ │ ├── collapse_duplicates.nf │ │ ├── define_clones.nf │ │ ├── detect_contamination.nf │ │ ├── dowser_lineages.nf │ │ ├── find_threshold.nf │ │ ├── remove_chimeric.nf │ │ ├── report_file_size.nf │ │ ├── single_cell_qc.nf │ │ └── validate_input.nf │ ├── fastqc_postassembly.nf │ ├── fetch_databases.nf │ ├── gunzip.nf │ ├── merge_UMI.nf │ ├── parse_logs.nf │ ├── prepare_trust4_reference.nf │ ├── presto │ │ ├── presto_assemblepairs.nf │ │ ├── presto_assemblepairs_sequential.nf │ │ ├── presto_buildconsensus.nf │ │ ├── presto_clustersets.nf │ │ ├── presto_collapseseq.nf │ │ ├── presto_filterseq.nf │ │ ├── presto_filterseq_postassembly.nf │ │ ├── presto_maskprimers.nf │ │ ├── presto_maskprimers_align.nf │ │ ├── presto_maskprimers_extract.nf │ │ ├── presto_maskprimers_postassembly.nf │ │ ├── presto_maskprimers_score.nf │ │ ├── presto_pairseq.nf │ │ ├── presto_parse_cluster.nf │ │ ├── presto_parseheaders.nf │ │ ├── presto_parseheaders_metadata.nf │ │ ├── presto_parseheaders_primers.nf │ │ ├── presto_postconsensus_pairseq.nf │ │ └── presto_splitseq.nf │ ├── rename_fastq.nf │ ├── rename_file.nf │ ├── reveal │ │ ├── add_meta_to_tab.nf │ │ ├── filter_junction_mod3.nf │ │ └── filter_quality.nf │ ├── samplesheet_check.nf │ ├── unzip_cellrangerdb.nf │ └── unzip_db.nf └── nf-core │ ├── amulety │ ├── antiberta2 │ │ ├── environment.yml │ │ ├── main.nf │ │ ├── meta.yml │ │ └── tests │ │ │ ├── gpu.nf.test │ │ │ ├── gpu.nf.test.snap │ │ │ ├── main.nf.test │ │ │ ├── main.nf.test.snap │ │ │ └── nextflow.config │ ├── antiberty │ │ ├── environment.yml │ │ ├── main.nf │ │ ├── meta.yml │ │ └── tests │ │ │ ├── gpu.nf.test │ │ │ ├── gpu.nf.test.snap │ │ │ ├── main.nf.test │ │ │ ├── main.nf.test.snap │ │ │ └── nextflow.config │ ├── balmpaired │ │ ├── environment.yml │ │ ├── main.nf │ │ ├── meta.yml │ │ └── tests │ │ │ ├── gpu.nf.test │ │ │ ├── gpu.nf.test.snap │ │ │ ├── main.nf.test │ │ │ ├── main.nf.test.snap │ │ │ └── nextflow.config │ ├── esm2 │ │ ├── environment.yml │ │ ├── main.nf │ │ ├── meta.yml │ │ └── tests │ │ │ ├── gpu.nf.test │ │ │ ├── gpu.nf.test.snap │ │ │ ├── main.nf.test │ │ │ ├── main.nf.test.snap │ │ │ └── nextflow.config │ └── translate │ │ ├── environment.yml │ │ ├── main.nf │ │ ├── meta.yml │ │ └── tests │ │ ├── main.nf.test │ │ └── main.nf.test.snap │ ├── cat │ └── fastq │ │ ├── environment.yml │ │ ├── main.nf │ │ ├── meta.yml │ │ └── tests │ │ ├── main.nf.test │ │ ├── main.nf.test.snap │ │ └── tags.yml │ ├── cellranger │ ├── mkvdjref │ │ ├── environment.yml │ │ ├── main.nf │ │ └── meta.yml │ └── vdj │ │ ├── main.nf │ │ └── meta.yml │ ├── fastp │ ├── environment.yml │ ├── main.nf │ ├── meta.yml │ └── tests │ │ ├── main.nf.test │ │ ├── main.nf.test.snap │ │ ├── nextflow.config │ │ └── tags.yml │ ├── fastqc │ ├── environment.yml │ ├── main.nf │ ├── meta.yml │ └── tests │ │ ├── main.nf.test │ │ └── main.nf.test.snap │ ├── multiqc │ ├── environment.yml │ ├── main.nf │ ├── meta.yml │ └── tests │ │ ├── main.nf.test │ │ ├── main.nf.test.snap │ │ ├── nextflow.config │ │ └── tags.yml │ └── trust4 │ ├── environment.yml │ ├── main.nf │ ├── meta.yml │ └── tests │ ├── main.nf.test │ ├── main.nf.test.snap │ └── tags.yml ├── nextflow.config ├── nextflow_schema.json ├── ro-crate-metadata.json ├── subworkflows ├── local │ ├── assembled_input_check.nf │ ├── bulk_qc_and_filter.nf │ ├── clonal_analysis.nf │ ├── databases.nf │ ├── fastq_input_check.nf │ ├── presto_sans_umi.nf │ ├── presto_umi.nf │ ├── repertoire_analysis_reporting.nf │ ├── rnaseq_input.nf │ ├── sc_raw_input.nf │ ├── sequence_assembly.nf │ ├── single_cell_qc_and_filtering.nf │ ├── translate_embed.nf │ ├── utils_nfcore_airrflow_pipeline │ │ └── main.nf │ └── vdj_annotation.nf └── nf-core │ ├── utils_nextflow_pipeline │ ├── main.nf │ ├── meta.yml │ └── tests │ │ ├── main.function.nf.test │ │ ├── main.function.nf.test.snap │ │ ├── main.workflow.nf.test │ │ ├── nextflow.config │ │ └── tags.yml │ ├── utils_nfcore_pipeline │ ├── main.nf │ ├── meta.yml │ └── tests │ │ ├── main.function.nf.test │ │ ├── main.function.nf.test.snap │ │ ├── main.workflow.nf.test │ │ ├── main.workflow.nf.test.snap │ │ ├── nextflow.config │ │ └── tags.yml │ └── utils_nfschema_plugin │ ├── main.nf │ ├── meta.yml │ └── tests │ ├── main.nf.test │ ├── nextflow.config │ └── nextflow_schema.json ├── tower.yml └── workflows └── airrflow.nf /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nfcore", 3 | "image": "nfcore/gitpod:latest", 4 | "remoteUser": "gitpod", 5 | "runArgs": ["--privileged"], 6 | 7 | // Configure tool-specific properties. 8 | "customizations": { 9 | // Configure properties specific to VS Code. 10 | "vscode": { 11 | // Set *default* container specific settings.json values on container create. 12 | "settings": { 13 | "python.defaultInterpreterPath": "/opt/conda/bin/python" 14 | }, 15 | 16 | // Add the IDs of extensions you want installed when the container is created. 17 | "extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"] 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.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 | [*.json] 15 | insert_final_newline = unset 16 | 17 | [*.tsv] 18 | insert_final_newline = unset 19 | trim_trailing_whitespace = false 20 | 21 | # These files are edited and tested upstream in nf-core/modules 22 | [/modules/nf-core/**] 23 | charset = unset 24 | end_of_line = unset 25 | insert_final_newline = unset 26 | trim_trailing_whitespace = unset 27 | indent_style = unset 28 | [/subworkflows/nf-core/**] 29 | charset = unset 30 | end_of_line = unset 31 | insert_final_newline = unset 32 | trim_trailing_whitespace = unset 33 | indent_style = unset 34 | 35 | [/assets/email*] 36 | indent_size = unset 37 | 38 | [/assets/*.Rmd] 39 | indent_size = unset 40 | 41 | [/assets/*.Rmd] 42 | indent_size = unset 43 | 44 | # ignore python and markdown 45 | [*.{py,md}] 46 | indent_style = unset 47 | 48 | # ignore ro-crate metadata files 49 | [**/ro-crate-metadata.json] 50 | insert_final_newline = unset 51 | -------------------------------------------------------------------------------- /.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/airrflow pipeline documentation](https://nf-co.re/airrflow/usage) 12 | - type: textarea 13 | id: description 14 | attributes: 15 | label: Description of the bug 16 | description: A clear and concise description of what the bug is. 17 | validations: 18 | required: true 19 | 20 | - type: textarea 21 | id: command_used 22 | attributes: 23 | label: Command used and terminal output 24 | description: Steps to reproduce the behaviour. Please paste the command you used to launch the pipeline and the output from your terminal. 25 | render: console 26 | placeholder: | 27 | $ nextflow run ... 28 | 29 | Some output where something broke 30 | 31 | - type: textarea 32 | id: files 33 | attributes: 34 | label: Relevant files 35 | description: | 36 | Please drag and drop the relevant files here. Create a `.zip` archive if the extension is not allowed. 37 | 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. 38 | 39 | - type: textarea 40 | id: system 41 | attributes: 42 | label: System information 43 | description: | 44 | * Nextflow version _(eg. 23.04.0)_ 45 | * Hardware _(eg. HPC, Desktop, Cloud)_ 46 | * Executor _(eg. slurm, local, awsbatch)_ 47 | * Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter, Charliecloud, or Apptainer)_ 48 | * OS _(eg. CentOS Linux, macOS, Linux Mint)_ 49 | * Version of nf-core/airrflow _(eg. 1.1, 1.5, 1.8.2)_ 50 | -------------------------------------------------------------------------------- /.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 #airrflow channel" 6 | url: https://nfcore.slack.com/channels/airrflow 7 | about: Discussion about the nf-core/airrflow pipeline 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for the nf-core/airrflow 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/airrflow/tree/master/.github/CONTRIBUTING.md) 19 | - [ ] If necessary, also make a PR on the nf-core/airrflow _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. 20 | - [ ] Make sure your code lints (`nf-core pipelines lint`). 21 | - [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir `). 22 | - [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir `). 23 | - [ ] Usage Documentation in `docs/usage.md` is updated. 24 | - [ ] Output Documentation in `docs/output.md` is updated. 25 | - [ ] `CHANGELOG.md` is updated. 26 | - [ ] `README.md` is updated (including new tool citations and authors/contributors). 27 | -------------------------------------------------------------------------------- /.github/workflows/awsfulltest.yml: -------------------------------------------------------------------------------- 1 | name: nf-core AWS full size tests 2 | # This workflow is triggered on PRs opened against the main/master branch. 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 | workflow_dispatch: 8 | pull_request_review: 9 | types: [submitted] 10 | release: 11 | types: [published] 12 | 13 | jobs: 14 | run-platform: 15 | name: Run AWS full tests 16 | # run only if the PR is approved by at least 2 reviewers and against the master/main branch or manually triggered 17 | if: github.repository == 'nf-core/airrflow' && github.event.review.state == 'approved' && (github.event.pull_request.base.ref == 'master' || github.event.pull_request.base.ref == 'main') || github.event_name == 'workflow_dispatch' || github.event_name == 'release' 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: Set revision variable 21 | id: revision 22 | run: | 23 | echo "revision=${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'release') && github.sha || 'dev' }}" >> "$GITHUB_OUTPUT" 24 | 25 | - name: Launch workflow via Seqera Platform 26 | uses: seqeralabs/action-tower-launch@v2 27 | with: 28 | workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} 29 | access_token: ${{ secrets.TOWER_ACCESS_TOKEN }} 30 | compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} 31 | revision: ${{ steps.revision.outputs.revision }} 32 | workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/airrflow/work-${{ steps.revision.outputs.revision }} 33 | parameters: | 34 | { 35 | "hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}", 36 | "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/airrflow/results-${{ steps.revision.outputs.revision }}" 37 | } 38 | profiles: test_full 39 | 40 | - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 41 | with: 42 | name: Seqera Platform debug log file 43 | path: | 44 | seqera_platform_action_*.log 45 | seqera_platform_action_*.json 46 | -------------------------------------------------------------------------------- /.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-platform: 9 | name: Run AWS tests 10 | if: github.repository == 'nf-core/airrflow' 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Launch workflow using Seqera Platform CLI tool action 14 | - name: Launch workflow via Seqera Platform 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/airrflow/work-${{ github.sha }} 22 | parameters: | 23 | { 24 | "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/airrflow/results-test-${{ github.sha }}" 25 | } 26 | profiles: test 27 | 28 | - uses: actions/upload-artifact@v4 29 | with: 30 | name: Seqera Platform debug log file 31 | path: | 32 | seqera_platform_action_*.log 33 | seqera_platform_action_*.json 34 | -------------------------------------------------------------------------------- /.github/workflows/ci_immcantation.yml: -------------------------------------------------------------------------------- 1 | name: Immcantation 2 | # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors 3 | on: 4 | workflow_dispatch: 5 | 6 | env: 7 | NXF_ANSI_LOG: false 8 | 9 | concurrency: 10 | group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" 11 | cancel-in-progress: true 12 | 13 | jobs: 14 | test_container: 15 | name: Run workflow with immcantation devel test_container 16 | if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/airrflow') }} 17 | runs-on: ubuntu-latest 18 | strategy: 19 | matrix: 20 | NXF_VER: 21 | - 24.04.2 22 | - latest-everything 23 | profile: 24 | [ 25 | "test_assembled_immcantation_devel_hs", 26 | "test_assembled_immcantation_devel_mm", 27 | "test_raw_immcantation_devel", 28 | ] 29 | fail-fast: false 30 | steps: 31 | - name: Check out pipeline code 32 | uses: actions/checkout@v3 33 | 34 | - name: Install Nextflow 35 | uses: nf-core/setup-nextflow@v2 36 | with: 37 | version: "${{ matrix.NXF_VER }}" 38 | 39 | - name: Run pipeline with test data 40 | run: | 41 | nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.profile }},docker --outdir ./results 42 | 43 | - name: Upload logs on failure 44 | if: failure() 45 | uses: actions/upload-artifact@v4 46 | with: 47 | name: logs-${{ matrix.profile }} 48 | path: | 49 | /home/runner/.nextflow.log 50 | /home/runner/work 51 | !/home/runner/work/conda 52 | !/home/runner/work/singularity 53 | -------------------------------------------------------------------------------- /.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@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9 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/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@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8 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@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # 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 | -------------------------------------------------------------------------------- /.github/workflows/release-announcements.yml: -------------------------------------------------------------------------------- 1 | name: release-announcements 2 | # Automatic release toot and tweet anouncements 3 | on: 4 | release: 5 | types: [published] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | toot: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: get topics and convert to hashtags 13 | id: get_topics 14 | run: | 15 | echo "topics=$(curl -s https://nf-co.re/pipelines.json | jq -r '.remote_workflows[] | select(.full_name == "${{ github.repository }}") | .topics[]' | awk '{print "#"$0}' | tr '\n' ' ')" | sed 's/-//g' >> $GITHUB_OUTPUT 16 | 17 | - uses: rzr/fediverse-action@master 18 | with: 19 | access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} 20 | host: "mstdn.science" # custom host if not "mastodon.social" (default) 21 | # GitHub event payload 22 | # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release 23 | message: | 24 | Pipeline release! ${{ github.repository }} v${{ github.event.release.tag_name }} - ${{ github.event.release.name }}! 25 | 26 | Please see the changelog: ${{ github.event.release.html_url }} 27 | 28 | ${{ steps.get_topics.outputs.topics }} #nfcore #openscience #nextflow #bioinformatics 29 | 30 | bsky-post: 31 | runs-on: ubuntu-latest 32 | steps: 33 | - uses: zentered/bluesky-post-action@80dbe0a7697de18c15ad22f4619919ceb5ccf597 # v0.1.0 34 | with: 35 | post: | 36 | Pipeline release! ${{ github.repository }} v${{ github.event.release.tag_name }} - ${{ github.event.release.name }}! 37 | 38 | Please see the changelog: ${{ github.event.release.html_url }} 39 | env: 40 | BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }} 41 | BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }} 42 | # 43 | -------------------------------------------------------------------------------- /.github/workflows/template_version_comment.yml: -------------------------------------------------------------------------------- 1 | name: nf-core template version comment 2 | # This workflow is triggered on PRs to check if the pipeline template version matches the latest nf-core version. 3 | # It posts a comment to the PR, even if it comes from a fork. 4 | 5 | on: pull_request_target 6 | 7 | jobs: 8 | template_version: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Check out pipeline code 12 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 13 | with: 14 | ref: ${{ github.event.pull_request.head.sha }} 15 | 16 | - name: Read template version from .nf-core.yml 17 | uses: nichmor/minimal-read-yaml@v0.0.2 18 | id: read_yml 19 | with: 20 | config: ${{ github.workspace }}/.nf-core.yml 21 | 22 | - name: Install nf-core 23 | run: | 24 | python -m pip install --upgrade pip 25 | pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} 26 | 27 | - name: Check nf-core outdated 28 | id: nf_core_outdated 29 | run: echo "OUTPUT=$(pip list --outdated | grep nf-core)" >> ${GITHUB_ENV} 30 | 31 | - name: Post nf-core template version comment 32 | uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 33 | if: | 34 | contains(env.OUTPUT, 'nf-core') 35 | with: 36 | repo-token: ${{ secrets.NF_CORE_BOT_AUTH_TOKEN }} 37 | allow-repeats: false 38 | message: | 39 | > [!WARNING] 40 | > Newer version of the nf-core template is available. 41 | > 42 | > Your pipeline is using an old version of the nf-core template: ${{ steps.read_yml.outputs['nf_core_version'] }}. 43 | > Please update your pipeline to the latest version. 44 | > 45 | > For more documentation on how to update your pipeline, please see the [nf-core documentation](https://github.com/nf-core/tools?tab=readme-ov-file#sync-a-pipeline-with-the-template) and [Synchronisation documentation](https://nf-co.re/docs/contributing/sync). 46 | # 47 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .nextflow* 2 | work/ 3 | data/ 4 | results/ 5 | .DS_Store 6 | testing/ 7 | testing* 8 | *.pyc 9 | null/ 10 | -------------------------------------------------------------------------------- /.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: 10 | - nf-core.nf-core-extensionpack # https://github.com/nf-core/vscode-extensionpack 11 | -------------------------------------------------------------------------------- /.nf-core.yml: -------------------------------------------------------------------------------- 1 | lint: 2 | files_exist: 3 | - conf/igenomes.config 4 | included_configs: false 5 | multiqc_config: 6 | - report_comment 7 | nextflow_config: 8 | - config_defaults: 9 | - params.miairr 10 | - params.report_rmd 11 | - params.report_css 12 | - params.report_logo 13 | - params.report_logo_img 14 | - params.config_profile_url 15 | nf_core_version: 3.2.0 16 | repository_type: pipeline 17 | template: 18 | author: Gisela Gabernet, Susanna Marquez, Alexander Peltzer, Simon Heumos 19 | description: B and T cell repertoire analysis pipeline with the Immcantation framework. 20 | force: false 21 | is_nfcore: true 22 | name: airrflow 23 | org: nf-core 24 | outdir: . 25 | version: 4.1.0 26 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/mirrors-prettier 3 | rev: "v3.1.0" 4 | hooks: 5 | - id: prettier 6 | additional_dependencies: 7 | - prettier@3.2.5 8 | 9 | - repo: https://github.com/editorconfig-checker/editorconfig-checker.python 10 | rev: "3.1.2" 11 | hooks: 12 | - id: editorconfig-checker 13 | alias: ec 14 | -------------------------------------------------------------------------------- /.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 | ro-crate-metadata.json 14 | modules/nf-core/ 15 | subworkflows/nf-core/ 16 | -------------------------------------------------------------------------------- /.prettierrc.yml: -------------------------------------------------------------------------------- 1 | printWidth: 120 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "markdown.styles": ["public/vscode_markdown.css"] 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) The nf-core/airrflow team 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/email_template.txt: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------- 2 | ,--./,-. 3 | ___ __ __ __ ___ /,-._.--~\\ 4 | |\\ | |__ __ / ` / \\ |__) |__ } { 5 | | \\| | \\__, \\__/ | \\ |___ \\`-._,-`-, 6 | `._,._,' 7 | nf-core/airrflow ${version} 8 | ---------------------------------------------------- 9 | Run Name: $runName 10 | 11 | <% if (success){ 12 | out << "## nf-core/airrflow execution completed successfully! ##" 13 | } else { 14 | out << """#################################################### 15 | ## nf-core/airrflow 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/airrflow 39 | https://github.com/nf-core/airrflow 40 | -------------------------------------------------------------------------------- /assets/multiqc_config.yml: -------------------------------------------------------------------------------- 1 | report_comment: >2 2 | 3 | This report has been generated by the nf-core/airrflow analysis pipeline. For information about how 5 | to interpret these results, please see the documentation. 7 | 8 | module_order: 9 | - fastqc: 10 | name: "FastQC (raw)" 11 | info: "This section of the report shows FastQC results from the original reads" 12 | path_filters: 13 | - "./*.zip" 14 | path_filters_exclude: 15 | - "./*_ASSEMBLED_fastqc.zip" 16 | - fastqc: 17 | name: "FastQC (post-assembly)" 18 | info: "This section of the report shows FastQC results after paired reads are 19 | assembled and QC filtered but before collapsing duplicates." 20 | path_filters: 21 | - "./*_ASSEMBLED_fastqc.zip" 22 | 23 | report_section_order: 24 | "nf-core-airrflow-methods-description": 25 | order: -1000 26 | software_versions: 27 | order: -1001 28 | "nf-core-airrflow-summary": 29 | order: -1002 30 | 31 | export_plots: true 32 | 33 | disable_version_detection: true 34 | -------------------------------------------------------------------------------- /assets/nf-core-airrflow_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/assets/nf-core-airrflow_logo_light.png -------------------------------------------------------------------------------- /assets/nf-core-airrflow_logo_reports.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/assets/nf-core-airrflow_logo_reports.png -------------------------------------------------------------------------------- /assets/nf-core_style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Calibri, helvetica, sans-serif; 3 | } 4 | 5 | h1 { 6 | color: rgb(36, 176, 100); 7 | font-size: 200%; 8 | } 9 | 10 | h2 { 11 | color: rgb(36, 176, 100); 12 | font-size: 150%; 13 | } 14 | 15 | h3 { 16 | font-size: 100%; 17 | font-weight: bold; 18 | } 19 | 20 | h3.subtitle { 21 | font-size: 120%; 22 | color: rgb(0, 0, 0); 23 | font-weight: bold; 24 | } 25 | 26 | h4 { 27 | font-size: 100%; 28 | font-weight: bold; 29 | font-style: italic; 30 | } 31 | 32 | .watermark { 33 | opacity: 0.1; 34 | position: fixed; 35 | top: 50%; 36 | left: 50%; 37 | font-size: 500%; 38 | color: #24b064; 39 | } 40 | 41 | .list-group-item.active { 42 | z-index: 2; 43 | color: #fff; 44 | background-color: #24b064; 45 | border-color: #24b064; 46 | } 47 | .list-group-item.active:hover { 48 | z-index: 2; 49 | color: #fff; 50 | background-color: #24b064; 51 | border-color: #24b064; 52 | } 53 | 54 | #TOC { 55 | background: url("nf-core-airrflow_logo_light.png"); 56 | background-size: contain; 57 | padding-top: 120px !important; 58 | background-repeat: no-repeat; 59 | } 60 | 61 | .nav-pills > li.active > a, 62 | .nav-pills > li.active > a:hover, 63 | .nav-pills > li.active > a:focus { 64 | color: #fff; 65 | background-color: #24b064; 66 | } 67 | 68 | a { 69 | color: #24b064; 70 | text-decoration: none; 71 | } 72 | -------------------------------------------------------------------------------- /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-airrflow_logo.png" 13 | Content-Transfer-Encoding: base64 14 | Content-ID: 15 | Content-Disposition: inline; filename="nf-core-airrflow_logo_light.png" 16 | 17 | <% out << new File("$projectDir/assets/nf-core-airrflow_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/single_cell_tutorial/airrflow.sh: -------------------------------------------------------------------------------- 1 | nextflow run nf-core/airrflow -r 4.2.0 \ 2 | -profile docker \ 3 | --mode assembled \ 4 | --input samplesheet.tsv \ 5 | --outdir results \ 6 | -w work \ 7 | --skip_multiqc 8 | -------------------------------------------------------------------------------- /assets/single_cell_tutorial/samplesheet.tsv: -------------------------------------------------------------------------------- 1 | filename species subject_id sample_id day tissue sex age biomaterial_provider pcr_target_locus single_cell 2 | https://zenodo.org/records/11373741/files/AIRR_subject1_FNA_d0_1_Y1.tsv human S1 S1_d0 d0 PMBC NA NA NA IG TRUE 3 | https://zenodo.org/records/11373741/files/AIRR_subject1_FNA_d12_3_Y1.tsv human S1 S1_d12 d12 PMBC NA NA NA IG TRUE 4 | https://zenodo.org/records/11373741/files/AIRR_subject2_FNA_d0_1_Y1.tsv human S2 S2_d0 d0 PMBC NA NA NA IG TRUE 5 | https://zenodo.org/records/11373741/files/AIRR_subject2_FNA_d12_2_Y1.tsv human S2 S2_d12 d12 PMBC NA NA NA IG TRUE 6 | 7 | -------------------------------------------------------------------------------- /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/airrflow ${version} - ${runName}", 7 | "author_icon": "https://www.nextflow.io/docs/latest/_static/favicon.ico", 8 | "text": "<% if (success) { %>Pipeline completed successfully!<% } else { %>Pipeline completed with errors<% } %>", 9 | "fields": [ 10 | { 11 | "title": "Command used to launch the workflow", 12 | "value": "```${commandLine}```", 13 | "short": false 14 | } 15 | <% 16 | if (!success) { %> 17 | , 18 | { 19 | "title": "Full error message", 20 | "value": "```${errorReport}```", 21 | "short": false 22 | }, 23 | { 24 | "title": "Pipeline configuration", 25 | "value": "<% out << summary.collect{ k,v -> k == "hook_url" ? "_${k}_: (_hidden_)" : ( ( v.class.toString().contains('Path') || ( v.class.toString().contains('String') && v.contains('/') ) ) ? "_${k}_: `${v}`" : (v.class.toString().contains('DateTime') ? ("_${k}_: " + v.format(java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle.MEDIUM))) : "_${k}_: ${v}") ) }.join(",\n") %>", 26 | "short": false 27 | } 28 | <% } 29 | %> 30 | ], 31 | "footer": "Completed at <% out << dateComplete.format(java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle.MEDIUM)) %> (duration: ${duration})" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /bin/add_metadata.R: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | # Written by Gisela Gabernet and released under the MIT license (2020). 3 | 4 | 5 | # Add metadata to repertoire: 6 | # Arguments: 7 | # --repertoire Tabulated data in AIRR (TSV) format with clonal assignments and germline assignments. 8 | # --samplesheet Names of the metadata column to be used as node label on the tree plots 9 | # --outname Filename for the output repertoire 10 | # -h Display help. 11 | # Example: ./add_metadata.R --repertoire igblast_germ-pass.tsv --samplesheet samplesheet.tsv --outname my-repertoire 12 | 13 | # Libraries 14 | suppressPackageStartupMessages(library(dplyr)) 15 | suppressPackageStartupMessages(library(optparse)) 16 | 17 | # Define commmandline arguments 18 | opt_list <- list( 19 | make_option(c("--repertoire"), default=NULL, 20 | help="Input repertoire .tsv file after clone definition and germline definition."), 21 | make_option(c("--samplesheet"), default=NULL, 22 | help="Samplesheet providing extra metadata"), 23 | make_option(c("--outname"), default=NULL) 24 | ) 25 | opt <- parse_args(OptionParser(option_list=opt_list)) 26 | 27 | # Read repertoire 28 | repertoire <- read.csv(opt$repertoire, sep="\t", header=TRUE, stringsAsFactors = F) 29 | samplesheet <- read.csv(opt$samplesheet, sep="\t", header=TRUE, stringsAsFactors = F) 30 | 31 | parsed_fields <- 32 | c( 33 | "subject_id", 34 | "species", 35 | "pcr_target_locus", 36 | "filename_R1", 37 | "filename_R2", 38 | "filename_I1" 39 | ) 40 | 41 | samplesheet_colnames <- colnames(samplesheet) 42 | 43 | # merge tables only in case the samplesheet contains more columns than the required ones 44 | print( samplesheet_colnames[!(samplesheet_colnames %in% parsed_fields)]) 45 | 46 | if (length(samplesheet_colnames[!(samplesheet_colnames %in% parsed_fields)]) > 1 ) { 47 | print("None in parsed fields") 48 | samplesheet <- samplesheet[, !colnames(samplesheet) %in% parsed_fields] 49 | anno_repertoire <- base::merge(x=repertoire, y=samplesheet, by.x = "sample_id", by.y = "sample_id", all.x=T) 50 | } else { 51 | print("Some in parsed fields") 52 | anno_repertoire <- repertoire 53 | } 54 | 55 | # save repertoire table with metadata fields 56 | write.table(anno_repertoire, opt$outname, quote=F, sep="\t", row.names = F) 57 | -------------------------------------------------------------------------------- /bin/clean_imgtdb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Author: Jason Anthony Vander Heiden 3 | # Date: 2016.11.21 4 | # Licence: AGPL-3 5 | """ 6 | Clean IMGT germline fasta files for IgBLAST database build 7 | """ 8 | import Bio 9 | from pkg_resources import parse_version 10 | from sys import argv 11 | from Bio import SeqIO 12 | from Bio.SeqRecord import SeqRecord 13 | 14 | # Get input and output file names 15 | in_file = argv[1] 16 | out_file = argv[2] 17 | 18 | # Load sequences into memory and process them 19 | name_set = set() 20 | seq_list = list() 21 | for rec in SeqIO.parse(in_file, "fasta"): 22 | name = rec.description.split("|")[1] 23 | if name not in name_set: 24 | name_set.add(name) 25 | seq = SeqRecord(rec.seq.ungap(".").upper(), id=name, name=name, description=name) 26 | seq_list.append(seq) 27 | 28 | # Overwrite file 29 | with open(out_file, "w") as out_handle: 30 | if parse_version(Bio.__version__) >= parse_version("1.71"): 31 | # Biopython >= v1.71 32 | SeqIO.write(seq_list, out_handle, format="fasta-2line") 33 | else: 34 | # Biopython < v1.71 35 | writer = SeqIO.FastaIO.FastaWriter(out_handle, wrap=None) 36 | writer.write_file(seq_list) 37 | -------------------------------------------------------------------------------- /bin/execute_report.R: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | # Written by Gisela Gabernet and released under the MIT license (2020). 3 | 4 | library(rmarkdown) 5 | library(optparse) 6 | 7 | 8 | option_list = list( 9 | make_option(c("-r", "--report_file"), type="character", default=NULL, help="report rmarkdown file", metavar="character") 10 | ) 11 | 12 | 13 | opt_parser = OptionParser(option_list=option_list) 14 | opt = parse_args(opt_parser) 15 | 16 | 17 | #Set pandoc stack size memory 18 | options(pandoc.stack.size="4000m") 19 | 20 | wd=getwd() 21 | 22 | rmarkdown::render(opt$report_file, output_file = "Airrflow_report.html", knit_root_dir = wd, output_dir = wd) 23 | -------------------------------------------------------------------------------- /bin/fetch_databases.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Written by Gisela Gabernet and released under the MIT license (2020). 3 | echo "Fetching databases..." 4 | 5 | fetch_imgt.sh -o imgtdb_base 6 | 7 | fetch_igblastdb.sh -x -o igblast_base 8 | 9 | imgt2igblast.sh -i ./imgtdb_base -o igblast_base 10 | 11 | echo "FetchDBs process finished." 12 | -------------------------------------------------------------------------------- /bin/fetch_igblastdb.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Download IgBLAST database files 3 | # 4 | # Author: Jason Vander Heiden 5 | # Date: 2020.08.11 6 | # Licence: AGPL-3 7 | # 8 | # Arguments: 9 | # -o = Output directory for downloaded files. Defaults to current directory. 10 | # -x = Include download of internal_data and optional_file bundles. 11 | # -h = Display help. 12 | 13 | # Default argument values 14 | OUTDIR="." 15 | DOWNLOAD_ALL=false 16 | 17 | # Print usage 18 | usage () { 19 | echo "Usage: `basename $0` [OPTIONS]" 20 | echo " -o Output directory for downloaded files. Defaults to current directory." 21 | echo " -x Include download of legacy internal_data and optional_file bundles." 22 | echo " -h This message." 23 | } 24 | 25 | # Get commandline arguments 26 | while getopts "o:xh" OPT; do 27 | case "$OPT" in 28 | o) OUTDIR=$OPTARG 29 | OUTDIR_SET=true 30 | ;; 31 | x) DOWNLOAD_ALL=true 32 | ;; 33 | h) usage 34 | exit 35 | ;; 36 | \?) echo "Invalid option: -$OPTARG" >&2 37 | exit 1 38 | ;; 39 | :) echo "Option -$OPTARG requires an argument" >&2 40 | exit 1 41 | ;; 42 | esac 43 | done 44 | 45 | # Make output directory if it does not exist 46 | if $OUTDIR_SET && [ ! -d "${OUTDIR}" ]; then 47 | mkdir -p $OUTDIR 48 | fi 49 | 50 | # Fetch database 51 | wget -q -r -nH --cut-dirs=5 --no-parent \ 52 | ftp://ftp.ncbi.nlm.nih.gov/blast/executables/igblast/release/database \ 53 | -P ${OUTDIR}/database 54 | 55 | # Extract 56 | tar -C ${OUTDIR}/database -xf ${OUTDIR}/database/mouse_gl_VDJ.tar 57 | tar -C ${OUTDIR}/database -xf ${OUTDIR}/database/rhesus_monkey_VJ.tar 58 | 59 | if $DOWNLOAD_ALL; then 60 | # Fetch internal_data 61 | wget -q -r -nH --cut-dirs=5 --no-parent \ 62 | ftp://ftp.ncbi.nlm.nih.gov/blast/executables/igblast/release/old_internal_data \ 63 | -P ${OUTDIR}/internal_data 64 | 65 | # Fetch optional_file 66 | wget -q -r -nH --cut-dirs=5 --no-parent \ 67 | ftp://ftp.ncbi.nlm.nih.gov/blast/executables/igblast/release/old_optional_file \ 68 | -P ${OUTDIR}/optional_file 69 | fi 70 | -------------------------------------------------------------------------------- /bin/merge_R1_umi.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Written by Gisela Gabernet and released under the MIT license (2020). 3 | 4 | from Bio import SeqIO 5 | from gzip import open as gzopen 6 | import argparse 7 | 8 | parser = argparse.ArgumentParser() 9 | parser.add_argument("-R1", "--R1_filename", type=str, help="Path of R1 fastq.gz file.") 10 | parser.add_argument( 11 | "-I1", 12 | "--I1_filename", 13 | type=str, 14 | help="Path of I1 fastq.gz file containing the UMI barcode.", 15 | ) 16 | parser.add_argument("-s", "--umi_start", type=int, help="UMI start position in index file.") 17 | parser.add_argument("-l", "--umi_length", type=int, help="UMI length.") 18 | parser.add_argument("-o", "--outname", type=str, default="UMI_R1.fastq.gz", help="Name of output file.") 19 | 20 | args = parser.parse_args() 21 | 22 | records_I1 = SeqIO.parse(gzopen(args.I1_filename, "rt"), format="fastq") 23 | records_R1 = SeqIO.parse(gzopen(args.R1_filename, "rt"), format="fastq") 24 | umi_start = args.umi_start 25 | umi_end = args.umi_start + args.umi_length 26 | 27 | i = 0 28 | 29 | with gzopen(args.outname, "wt") as out_handle: 30 | for record_I1 in records_I1: 31 | i += 1 32 | record_R1 = next(records_R1) 33 | record_I1 = record_I1[umi_start:umi_end] 34 | if record_R1.id == record_I1.id: 35 | record_UMI_R1 = record_I1 + record_R1 36 | SeqIO.write(record_UMI_R1, out_handle, "fastq") 37 | if i % 100000 == 0: 38 | print(i) 39 | else: 40 | print(record_I1, record_R1) 41 | exit(1) 42 | -------------------------------------------------------------------------------- /bin/merge_graphs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Written by Gisela Gabernet and released under the MIT license (2020). 3 | 4 | DIR="Graphml_trees" # input files 5 | 6 | IDX=0 7 | for FILE in ${DIR}/*.graphml # get the file names you want to work on 8 | do 9 | if [ $IDX -eq 0 ] 10 | then 11 | awk '/ "${DIR}/head.txt" 12 | tail -n 1 $FILE > "${DIR}/tail.txt" 13 | awk '//' "${FILE}" >> "${DIR}/All_graphs_patient_nohead.txt" 14 | ((IDX++)) 15 | else 16 | awk '//' "${FILE}" >> "${DIR}/All_graphs_patient_nohead.txt" 17 | ((IDX++)) 18 | fi 19 | done 20 | cat "${DIR}/head.txt" "${DIR}/All_graphs_patient_nohead.txt" "${DIR}/tail.txt" > "${DIR}/All_graphs_patient.graphml" 21 | rm "${DIR}/All_graphs_patient_nohead.txt" "${DIR}/head.txt" "${DIR}/tail.txt" 22 | 23 | -------------------------------------------------------------------------------- /bin/reveal_mod_3_junction.R: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | # Written by Susanna Marquez and released under the MIT license (2021). 3 | 4 | # Junction length multiple of 3 filter: 5 | # Arguments: 6 | # --repertoire Tabulated data, in Change-O (TAB) or AIRR (TSV) format. 7 | # -h Display help. 8 | # Example: ./reveal_mod_3_junction.R --repertoire test-results/assign-genes/sc5p_v2_hs_PBMC_1k_b_airr_rearrangement_sequences_igblast_db-pass.tsv 9 | 10 | # Libraries 11 | suppressPackageStartupMessages(library("optparse")) 12 | suppressPackageStartupMessages(library("alakazam")) 13 | suppressPackageStartupMessages(library("airr")) 14 | 15 | 16 | # Define commmandline arguments 17 | opt_list <- list( 18 | make_option(c("-r", "--repertoire"), dest="REPERTOIRE", default=NULL,help="Input repertoire .tsv file"), 19 | make_option(c("-o", "--outname"), dest="OUTNAME", default=NULL, help="Output name") 20 | ) 21 | 22 | # Parse arguments 23 | opt <- parse_args(OptionParser(option_list=opt_list)) 24 | #opt 25 | #getwd() 26 | 27 | # Check input file 28 | if (!("REPERTOIRE" %in% names(opt))) { 29 | stop("You must provide an input repertoire file with --repertoire") 30 | } 31 | 32 | # Read metadata file 33 | db <- read_rearrangement(opt$REPERTOIRE) 34 | 35 | # Filter and save 36 | filter_pass <- db$junction_length %% 3 == 0 37 | #table(filter_pass) 38 | 39 | if (!is.null(opt$OUTNAME)) { 40 | output_fn <- paste0(opt$OUTNAME,"_junction-pass.tsv") 41 | } else { 42 | output_fn <- sub(".tsv$", "_junction-pass.tsv", basename(opt$REPERTOIRE)) 43 | } 44 | 45 | write_rearrangement(db[filter_pass,], file=output_fn) 46 | 47 | write("START> FilterJunctionMod3", stdout()) 48 | write(paste0("FILE> ",basename(opt$REPERTOIRE)), stdout()) 49 | write(paste0("OUTPUT> ",basename(output_fn)), stdout()) 50 | write(paste0("PASS> ",sum(filter_pass)), stdout()) 51 | write(paste0("FAIL> ",sum(!filter_pass)), stdout()) 52 | -------------------------------------------------------------------------------- /conf/clontech_umi_bcr.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/airrflow -profile clontech_umi_bcr, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'Takara Bio / SMART-seq' 15 | config_profile_description = 'Profile to run pipeline for the Takara Bio / Clontech SMARTer v2 (UMI) BCR protocol profile' 16 | 17 | mode = 'fastq' 18 | 19 | library_generation_method = 'dt_5p_race_umi' 20 | 21 | cprimers = 'https://github.com/immcantation/immcantation/raw/refs/heads/master/protocols/Universal/Human_IG_CRegion_RC.fasta' 22 | 23 | // primer options 24 | cprimer_position = 'R1' 25 | cprimer_start = 0 26 | vprimer_start = 0 27 | umi_length = 12 28 | umi_position = 'R2' 29 | cluster_sets = false 30 | 31 | 32 | // Mask primer options 33 | maskprimers_align_race = true 34 | primer_r2_extract_len = 7 35 | primer_r1_mask_mode = 'cut' 36 | primer_r2_mask_mode = 'cut' 37 | primer_maxlen = 70 38 | primer_r1_maxerror = 0.2 39 | assemblepairs_sequential = true 40 | primer_consensus = 0.6 41 | } 42 | -------------------------------------------------------------------------------- /conf/clontech_umi_tcr.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/airrflow -profile clontech_umi_tcr, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'Takara Bio / Clontech SMARTer v2 TCR' 15 | config_profile_description = 'Profile to run pipeline for the Takara Bio / Clontech SMARTer v2 (UMI) TCR protocol profile' 16 | 17 | mode = 'fastq' 18 | 19 | library_generation_method = 'dt_5p_race_umi' 20 | 21 | cprimers = 'https://github.com/immcantation/immcantation/raw/refs/heads/master/protocols/Universal/Human_TR_CRegion_RC.fasta' 22 | 23 | // primer options 24 | cprimer_position = 'R1' 25 | cprimer_start = 0 26 | vprimer_start = 0 27 | umi_length = 12 28 | umi_position = 'R2' 29 | cluster_sets = false 30 | 31 | 32 | // Mask primer options 33 | maskprimers_align_race = true 34 | primer_r2_extract_len = 7 35 | primer_r1_mask_mode = 'cut' 36 | primer_r2_mask_mode = 'cut' 37 | primer_maxlen = 70 38 | primer_r1_maxerror = 0.2 39 | assemblepairs_sequential = true 40 | primer_consensus = 0.6 41 | 42 | // TCR options 43 | clonal_threshold = 0 44 | } 45 | -------------------------------------------------------------------------------- /conf/igenomes_ignored.config: -------------------------------------------------------------------------------- 1 | /* 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | Nextflow config file for iGenomes paths 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | Empty genomes dictionary to use when igenomes is ignored. 6 | ---------------------------------------------------------------------------------------- 7 | */ 8 | 9 | params.genomes = [:] 10 | -------------------------------------------------------------------------------- /conf/nebnext_umi_bcr.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/airrflow -profile nebnext_umi_bcr, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'NEBNext - AbSeq BCR profile' 15 | config_profile_description = 'Profile to run pipeline for the NEBNext - AbSeq (UMI) BCR experimental protocol' 16 | 17 | mode = 'fastq' 18 | cprimers = 'https://github.com/immcantation/immcantation/raw/refs/heads/master/protocols/AbSeq/AbSeq_R1_Human_IG_Primers.fasta' 19 | race_linker = 'https://github.com/immcantation/immcantation/raw/refs/heads/master/protocols/AbSeq/AbSeq_R2_TS.fasta' 20 | 21 | library_generation_method = 'dt_5p_race_umi' 22 | cprimer_position = 'R1' 23 | cprimer_start = 0 24 | umi_length = 17 25 | umi_position = 'R2' 26 | cluster_sets = false 27 | 28 | //presto options 29 | primer_r1_maxerror = 0.2 30 | primer_r2_maxerror = 0.5 31 | assemblepairs_sequential = true 32 | maskprimers_align = false 33 | align_cregion = true 34 | internal_cregion_sequences = 'https://github.com/immcantation/immcantation/raw/refs/heads/master/protocols/AbSeq/AbSeq_Human_IG_InternalCRegion.fasta' 35 | cregion_maxlen = 100 36 | cregion_maxerror = 0.3 37 | cregion_mask_mode = 'tag' 38 | } 39 | -------------------------------------------------------------------------------- /conf/nebnext_umi_tcr.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/airrflow -profile nebnext_umi_tcr, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | params { 14 | config_profile_name = 'NEBNext - AbSeq TCR profile' 15 | config_profile_description = 'Profile to run pipeline for the NEBNext - AbSeq (UMI) TCR experimental protocol' 16 | 17 | mode = 'fastq' 18 | cprimers = 'https://github.com/immcantation/immcantation/raw/refs/heads/master/protocols/AbSeq/AbSeq_R1_Human_TR_Primers.fasta' 19 | race_linker = 'https://github.com/immcantation/immcantation/raw/refs/heads/master/protocols/AbSeq/AbSeq_R2_TS.fasta' 20 | 21 | library_generation_method = 'dt_5p_race_umi' 22 | cprimer_position = 'R1' 23 | cprimer_start = 0 24 | umi_length = 17 25 | umi_position = 'R2' 26 | cluster_sets = false 27 | 28 | //presto options 29 | primer_r1_maxerror = 0.2 30 | primer_r2_maxerror = 0.5 31 | assemblepairs_sequential = true 32 | maskprimers_align = false 33 | align_cregion = false 34 | cregion_maxlen = 100 35 | cregion_maxerror = 0.3 36 | cregion_mask_mode = 'tag' 37 | 38 | //TCR options 39 | clonal_threshold = 0 40 | } 41 | -------------------------------------------------------------------------------- /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/airrflow -profile test, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | process { 14 | resourceLimits = [ 15 | cpus: 4, 16 | memory: '15.GB', 17 | time: '1.h' 18 | ] 19 | } 20 | 21 | params { 22 | config_profile_name = 'Test profile' 23 | config_profile_description = 'Minimal test dataset to check pipeline function' 24 | 25 | // Input data 26 | input = pipelines_testdata_base_path + 'testdata-bcr/Metadata_test_airr.tsv' 27 | cprimers = pipelines_testdata_base_path + 'testdata-bcr/C_primers.fasta' 28 | vprimers = pipelines_testdata_base_path + 'testdata-bcr/V_primers.fasta' 29 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 30 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 31 | 32 | mode = 'fastq' 33 | 34 | library_generation_method = 'specific_pcr_umi' 35 | cprimer_position = 'R1' 36 | umi_length = 8 37 | umi_start = 6 38 | umi_position = 'R1' 39 | index_file = true 40 | lineage_trees = true 41 | } 42 | 43 | process{ 44 | withName:"DEFINE_CLONES*"{ 45 | ext.args = ['outname':'', 'model':'hierarchical', 46 | 'method':'nt', 'linkage':'single', 47 | 'outputby':'sample_id', 'min_n':10] 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /conf/test_10x_sc.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/airrflow -profile test_10x_sc, 8 | */ 9 | 10 | process { 11 | resourceLimits = [ 12 | cpus: 2, 13 | memory: '6.GB', 14 | time: '6.h' 15 | ] 16 | } 17 | 18 | params { 19 | config_profile_name = 'Test 10xGenomics single cell data' 20 | config_profile_description = 'Minimal test dataset to check pipeline function with raw single cell data from 10xGenomics' 21 | 22 | // params 23 | mode = 'fastq' 24 | library_generation_method = 'sc_10x_genomics' 25 | clonal_threshold = 0 26 | 27 | 28 | // Input data 29 | input = pipelines_testdata_base_path + 'testdata-sc/10x_sc_raw.tsv' 30 | reference_10x = pipelines_testdata_base_path + 'testdata-sc/refdata-cellranger-vdj-GRCh38-alts-ensembl-5.0.0.tar.gz' 31 | } 32 | -------------------------------------------------------------------------------- /conf/test_assembled_hs.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/airrflow -profile test, 8 | */ 9 | 10 | process { 11 | resourceLimits = [ 12 | cpus: 4, 13 | memory: '15.GB', 14 | time: '1.h' 15 | ] 16 | } 17 | 18 | params { 19 | config_profile_name = 'Test assembled mode' 20 | config_profile_description = 'Minimal test dataset to test assembled mode' 21 | 22 | // Input data 23 | mode = 'assembled' 24 | input = pipelines_testdata_base_path + 'testdata-reveal/test_assembled_metadata_hs.tsv' 25 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 26 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 27 | 28 | reassign = true 29 | productive_only = true 30 | collapseby = 'filename' 31 | cloneby = 'subject_id' 32 | remove_chimeric = true 33 | lineage_trees = true 34 | } 35 | 36 | -------------------------------------------------------------------------------- /conf/test_assembled_immcantation_devel_hs.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/airrflow -profile test_assembled_immcantation_hs_devel, 8 | */ 9 | 10 | process { 11 | resourceLimits = [ 12 | cpus: 4, 13 | memory: '15.GB', 14 | time: '1.h' 15 | ] 16 | } 17 | 18 | params { 19 | config_profile_name = 'Test assembled mode with Immcantation custom_container' 20 | config_profile_description = 'Minimal human test dataset to check pipeline function on assembled mode with Immcantation custom_container' 21 | 22 | // Input data 23 | mode = 'assembled' 24 | input = pipelines_testdata_base_path + 'testdata-reveal/test_assembled_metadata_hs.tsv' 25 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 26 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 27 | 28 | reassign = true 29 | productive_only = true 30 | collapseby = 'filename' 31 | cloneby = 'subject_id' 32 | crossby = 'subject_id' 33 | remove_chimeric = true 34 | } 35 | 36 | process{ 37 | 38 | // all process with label 'immcantation' will be tested with this container instead. 39 | withLabel:immcantation{ 40 | container = 'docker.io/immcantation/suite:devel' 41 | } 42 | } 43 | 44 | env { 45 | PYTHONNOUSERSITE = 0 46 | } 47 | -------------------------------------------------------------------------------- /conf/test_assembled_immcantation_devel_mm.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/airrflow -profile test_assembled_immcantation_devel_mm, 8 | */ 9 | 10 | process { 11 | resourceLimits = [ 12 | cpus: 4, 13 | memory: '15.GB', 14 | time: '1.h' 15 | ] 16 | } 17 | 18 | params { 19 | config_profile_name = 'Test assembled mode with Immcantation custom_container' 20 | config_profile_description = 'Minimal mouse test dataset to check pipeline function on assembled mode with Immcantation custom_container' 21 | 22 | // Input data 23 | mode = 'assembled' 24 | input = pipelines_testdata_base_path + 'testdata-reveal/test_assembled_metadata_mm.tsv' 25 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 26 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 27 | 28 | reassign = true 29 | productive_only = true 30 | collapseby = 'filename' 31 | cloneby = 'subject_id' 32 | crossby = 'subject_id' 33 | remove_chimeric = true 34 | } 35 | 36 | process{ 37 | 38 | // all process with label 'immcantation' will be tested with this container instead. 39 | withLabel:immcantation{ 40 | container = 'docker.io/immcantation/suite:devel' 41 | } 42 | } 43 | 44 | env { 45 | PYTHONNOUSERSITE = 0 46 | } 47 | -------------------------------------------------------------------------------- /conf/test_assembled_mm.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/airrflow -profile test, 8 | */ 9 | 10 | process { 11 | resourceLimits = [ 12 | cpus: 4, 13 | memory: '15.GB', 14 | time: '1.h' 15 | ] 16 | } 17 | 18 | params { 19 | config_profile_name = 'Test assembled mode' 20 | config_profile_description = 'Minimal mouse test dataset to test assembled mode' 21 | 22 | // Input data 23 | mode = 'assembled' 24 | input = pipelines_testdata_base_path + 'testdata-reveal/test_assembled_metadata_mm.tsv' 25 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 26 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 27 | 28 | reassign = true 29 | productive_only = true 30 | collapseby = 'filename' 31 | cloneby = 'subject_id' 32 | remove_chimeric = true 33 | 34 | lineage_trees = true 35 | } 36 | 37 | -------------------------------------------------------------------------------- /conf/test_clontech_umi.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/airrflow -profile test_clontech_umi, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | includeConfig 'clontech_umi_bcr.config' 13 | 14 | process { 15 | resourceLimits = [ 16 | cpus: 4, 17 | memory: '15.GB', 18 | time: '6.h' 19 | ] 20 | } 21 | 22 | params { 23 | config_profile_name = 'Test profile for TAKARA protocol' 24 | config_profile_description = 'Minimal test dataset to check pipeline function' 25 | 26 | // Input data 27 | input = pipelines_testdata_base_path +'testdata-clontech/samplesheet.tsv' 28 | 29 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 30 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 31 | 32 | clonal_threshold = 0.1 33 | 34 | } 35 | -------------------------------------------------------------------------------- /conf/test_embeddings_H.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/airrflow -profile test_embeddings, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | process { 14 | resourceLimits = [ 15 | cpus: 4, 16 | memory: '15.GB', 17 | time: '1.h' 18 | ] 19 | } 20 | 21 | params { 22 | config_profile_name = 'Test H embeddings' 23 | config_profile_description = 'Minimal test dataset to test embeddings' 24 | 25 | // Input data 26 | mode = 'assembled' 27 | input = pipelines_testdata_base_path + 'testdata-reveal/test_assembled_metadata_hs.tsv' 28 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 29 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 30 | 31 | reassign = true 32 | productive_only = true 33 | collapseby = 'filename' 34 | cloneby = 'subject_id' 35 | lineage_trees = false 36 | clonal_threshold = 0.1 37 | skip_report_threshold = true 38 | skip_all_clones_report = true 39 | skip_clonal_analysis = true 40 | embeddings = 'antiberty,antiberta2,balmpaired,esm2' 41 | embedding_chain = "H" 42 | } 43 | 44 | process{ 45 | withName:"DEFINE_CLONES*"{ 46 | ext.args = ['outname':'', 'model':'hierarchical', 47 | 'method':'nt', 'linkage':'single', 48 | 'outputby':'sample_id', 'min_n':10] 49 | } 50 | 51 | withName:"AMULETY_ESM2"{ 52 | ext.args = '--batch-size 20' 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /conf/test_embeddings_HL.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/airrflow -profile test_embeddings, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | process { 14 | resourceLimits = [ 15 | cpus: 4, 16 | memory: '15.GB', 17 | time: '1.h' 18 | ] 19 | } 20 | 21 | params { 22 | config_profile_name = 'Test HL embeddings' 23 | config_profile_description = 'Minimal test dataset to test embeddings' 24 | 25 | // Input data 26 | mode = 'assembled' 27 | input = pipelines_testdata_base_path + 'testdata-reveal/test_assembled_sc_hs_small.tsv' 28 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 29 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 30 | 31 | reassign = true 32 | productive_only = true 33 | collapseby = 'filename' 34 | cloneby = 'subject_id' 35 | lineage_trees = false 36 | clonal_threshold = 0.1 37 | skip_report_threshold = true 38 | skip_all_clones_report = true 39 | skip_clonal_analysis = true 40 | embeddings = 'antiberty,antiberta2,balmpaired,esm2' 41 | embedding_chain = "HL" 42 | } 43 | 44 | process{ 45 | withName:"DEFINE_CLONES*"{ 46 | ext.args = ['outname':'', 'model':'hierarchical', 47 | 'method':'nt', 'linkage':'single', 48 | 'outputby':'sample_id', 'min_n':10] 49 | } 50 | 51 | withName:"AMULETY_ESM2"{ 52 | ext.args = '--batch-size 20' 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /conf/test_fetchimgt.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/airrflow -profile test_fetchimgt, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | process { 13 | resourceLimits = [ 14 | cpus: 4, 15 | memory: '15.GB', 16 | time: '1.h' 17 | ] 18 | } 19 | 20 | params { 21 | config_profile_name = 'Test IMGTdb fetch' 22 | config_profile_description = 'Test pipeline when fetching the latest version of the IMGT references.' 23 | 24 | // Input data 25 | input = pipelines_testdata_base_path + 'testdata-bcr/Metadata_test_airr.tsv' 26 | cprimers = pipelines_testdata_base_path + 'testdata-bcr/C_primers.fasta' 27 | vprimers = pipelines_testdata_base_path + 'testdata-bcr/V_primers.fasta' 28 | fetch_imgt = true 29 | 30 | mode = 'fastq' 31 | 32 | library_generation_method = 'specific_pcr_umi' 33 | cprimer_position = 'R1' 34 | umi_length = 8 35 | umi_start = 6 36 | umi_position = 'R1' 37 | index_file = true 38 | } 39 | 40 | process{ 41 | withName:"DEFINE_CLONES*"{ 42 | ext.args = ['outname':'', 'model':'hierarchical', 43 | 'method':'nt', 'linkage':'single', 44 | 'outputby':'sample_id', 'min_n':10] 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /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/airrflow -profile test_full, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | process { 13 | resourceLimits = [ 14 | cpus: 16, 15 | memory: '60.GB', 16 | time: '24.h' 17 | ] 18 | } 19 | 20 | params { 21 | config_profile_name = 'Full test profile' 22 | config_profile_description = 'Full test dataset to check pipeline function' 23 | 24 | // Input data 25 | input = pipelines_testdata_base_path + 'testdata-bcr/metadata_pcr_umi_airr_300.tsv' 26 | cprimers = 's3://ngi-igenomes/test-data/airrflow/pcr_umi/cprimers.fasta' 27 | vprimers = 's3://ngi-igenomes/test-data/airrflow/pcr_umi/vprimers.fasta' 28 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 29 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 30 | 31 | // Other params 32 | library_generation_method = 'specific_pcr_umi' 33 | cprimer_position = 'R1' 34 | umi_length = 15 35 | umi_start = 0 36 | umi_position = 'R1' 37 | lineage_trees = true 38 | embeddings = 'antiberty,antiberta2,balmpaired,esm2' 39 | embedding_chain = "HL" 40 | use_gpu = true 41 | } 42 | 43 | process { 44 | withName:DOWSER_LINEAGES{ 45 | ext.args = ['minseq':5, 46 | 'traits':'c_call', 47 | 'tips':'c_call'] 48 | } 49 | 50 | withName:DEFINE_CLONES_COMPUTE{ 51 | ext.args = ['outname':'', 'model':'hierarchical', 52 | 'method':'nt', 'linkage':'single', 53 | 'min_n':30] 54 | 55 | } 56 | withName:DEFINE_CLONES_REPORT{ 57 | ext.args = ['outname':'', 'model':'hierarchical', 58 | 'method':'nt', 'linkage':'single', 59 | 'min_n':30] 60 | 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /conf/test_maskprimers_align.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/airrflow -profile test_maskprimers_align, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | process { 13 | resourceLimits = [ 14 | cpus: 4, 15 | memory: '15.GB', 16 | time: '1.h' 17 | ] 18 | } 19 | 20 | params { 21 | config_profile_name = 'Test maskprimers align' 22 | config_profile_description = 'Minimal test dataset to check pipeline function' 23 | 24 | // Input data 25 | input = pipelines_testdata_base_path + 'testdata-bcr/Metadata_test_airr.tsv' 26 | cprimers = pipelines_testdata_base_path + 'testdata-bcr/C_primers.fasta' 27 | vprimers = pipelines_testdata_base_path + 'testdata-bcr/V_primers.fasta' 28 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 29 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 30 | 31 | mode = 'fastq' 32 | 33 | library_generation_method = 'specific_pcr_umi' 34 | cprimer_position = 'R1' 35 | umi_length = 8 36 | umi_start = 6 37 | umi_position = 'R1' 38 | index_file = true 39 | maskprimers_align = true 40 | } 41 | -------------------------------------------------------------------------------- /conf/test_maskprimers_extract.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/airrflow -profile test, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | process { 13 | resourceLimits = [ 14 | cpus: 4, 15 | memory: '15.GB', 16 | time: '1.h' 17 | ] 18 | } 19 | 20 | params { 21 | config_profile_name = 'Test extract primers profile' 22 | config_profile_description = 'Minimal test dataset to check pipeline function' 23 | 24 | // Input data 25 | input = pipelines_testdata_base_path + 'testdata-bcr/Metadata_test_airr.tsv' 26 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 27 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 28 | 29 | mode = 'fastq' 30 | 31 | library_generation_method = 'specific_pcr_umi' 32 | maskprimers_extract = true 33 | cprimer_position = 'R1' 34 | umi_length = 8 35 | umi_start = 6 36 | umi_position = 'R1' 37 | index_file = true 38 | lineage_trees = false 39 | primer_r1_mask_mode = 'trim' 40 | primer_r2_mask_mode = 'cut' 41 | primer_r1_extract_len = 28 42 | primer_r2_extract_len = 29 43 | } 44 | 45 | process{ 46 | withName:"DEFINE_CLONES*"{ 47 | ext.args = ['outname':'', 'model':'hierarchical', 48 | 'method':'nt', 'linkage':'single', 49 | 'outputby':'sample_id', 'min_n':10] 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /conf/test_nebnext_umi.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/airrflow -profile test_nebnext_umi, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | 13 | includeConfig 'nebnext_umi_bcr.config' 14 | 15 | process { 16 | resourceLimits = [ 17 | cpus: 4, 18 | memory: '15.GB', 19 | time: '1.h' 20 | ] 21 | } 22 | 23 | params { 24 | config_profile_name = 'Test profile for NEBNext protocol' 25 | config_profile_description = 'Minimal test dataset to check pipeline function' 26 | 27 | // Input data 28 | input = pipelines_testdata_base_path + 'testdata-neb/samplesheet.tsv' 29 | 30 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 31 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 32 | 33 | clonal_threshold = 0.1 34 | 35 | } 36 | -------------------------------------------------------------------------------- /conf/test_no_umi.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/airrflow -profile -c conf/test_no-umi.config 8 | */ 9 | process { 10 | resourceLimits = [ 11 | cpus: 4, 12 | memory: '15.GB', 13 | time: '1.h' 14 | ] 15 | } 16 | 17 | params { 18 | config_profile_name = 'Test profile without UMIs' 19 | config_profile_description = 'Test dataset without UMIs to check pipeline function.' 20 | 21 | mode = 'fastq' 22 | 23 | cprimer_position = 'R1' 24 | library_generation_method = 'specific_pcr' 25 | cprimer_start = 4 26 | vprimer_start = 4 27 | primer_revpr = true 28 | umi_length = 0 29 | 30 | // Input data 31 | input = pipelines_testdata_base_path + 'testdata-no-umi/Metadata_test-no-umi_airr.tsv' 32 | cprimers = pipelines_testdata_base_path + 'testdata-no-umi/Greiff2014_CPrimers.fasta' 33 | vprimers = pipelines_testdata_base_path + 'testdata-no-umi/Greiff2014_VPrimers.fasta' 34 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 35 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 36 | 37 | 38 | } 39 | process { 40 | // When not using UMIs, set the coord parameter based on source (e.g., sra or illumina) 41 | withName: PRESTO_ASSEMBLEPAIRS_SANS_UMI { 42 | ext.args = '--rc tail --coord sra --maxerror 0.3' 43 | } 44 | withName:"DEFINE_CLONES*"{ 45 | ext.args = ['outname':'', 'model':'hierarchical', 46 | 'method':'nt', 'linkage':'single', 47 | 'outputby':'sample_id', 'min_n':10] 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /conf/test_nocluster.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/airrflow -profile test_nocluster, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | process { 13 | resourceLimits = [ 14 | cpus: 4, 15 | memory: '15.GB', 16 | time: '1.h' 17 | ] 18 | } 19 | 20 | params { 21 | config_profile_name = 'Test profile no cluster sets' 22 | config_profile_description = 'Test pipeline without the cluster sets process' 23 | 24 | // Input data 25 | input = pipelines_testdata_base_path + 'testdata-bcr/Metadata_test_airr.tsv' 26 | cprimers = pipelines_testdata_base_path + 'testdata-bcr/C_primers.fasta' 27 | vprimers = pipelines_testdata_base_path + 'testdata-bcr/V_primers.fasta' 28 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 29 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 30 | 31 | mode = 'fastq' 32 | 33 | library_generation_method = 'specific_pcr_umi' 34 | cprimer_position = 'R1' 35 | umi_length = 8 36 | umi_start = 6 37 | umi_position = 'R1' 38 | cluster_sets = false 39 | index_file = true 40 | clonal_threshold = 0.15 41 | } 42 | 43 | process{ 44 | withName:"DEFINE_CLONES*"{ 45 | ext.args = ['outname':'', 'model':'hierarchical', 46 | 'method':'nt', 'linkage':'single', 47 | 'outputby':'sample_id', 'min_n':10] 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /conf/test_raw_immcantation_devel.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/airrflow -profile test_raw_immcantation_devel, --outdir 9 | 10 | ---------------------------------------------------------------------------------------- 11 | */ 12 | process { 13 | resourceLimits = [ 14 | cpus: 4, 15 | memory: '15.GB', 16 | time: '1.h' 17 | ] 18 | } 19 | 20 | params { 21 | config_profile_name = 'Test immcantation raw profile' 22 | config_profile_description = 'Minimal test dataset to check pipeline function with the immcantation container' 23 | 24 | // Input data 25 | input = pipelines_testdata_base_path + 'testdata-bcr/Metadata_test_airr.tsv' 26 | cprimers = pipelines_testdata_base_path + 'testdata-bcr/C_primers.fasta' 27 | vprimers = pipelines_testdata_base_path + 'testdata-bcr/V_primers.fasta' 28 | 29 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 30 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 31 | 32 | mode = 'fastq' 33 | 34 | library_generation_method = 'specific_pcr_umi' 35 | cprimer_position = 'R1' 36 | umi_length = 8 37 | umi_start = 6 38 | umi_position = 'R1' 39 | index_file = true 40 | } 41 | 42 | process{ 43 | // all process with label 'immcantation' will be tested with this container instead. 44 | withLabel:immcantation{ 45 | container = 'docker.io/immcantation/suite:devel' 46 | } 47 | withName:"DEFINE_CLONES*"{ 48 | ext.args = ['outname':'', 'model':'hierarchical', 49 | 'method':'nt', 'linkage':'single', 50 | 'outputby':'sample_id', 'min_n':10] 51 | } 52 | } 53 | 54 | env { 55 | PYTHONNOUSERSITE = 0 56 | } 57 | -------------------------------------------------------------------------------- /conf/test_rnaseq_bulk.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/airrflow -profile test_rnaseq_bulk, 8 | */ 9 | process { 10 | resourceLimits = [ 11 | cpus: 4, 12 | memory: '15.GB', 13 | time: '1.h' 14 | ] 15 | } 16 | 17 | params { 18 | config_profile_name = 'Test bulk RNA-seq based workflow using TRUST4' 19 | config_profile_description = 'Minimal test dataset to check pipeline function with raw bulk RNA-seq data' 20 | 21 | // params 22 | mode = 'fastq' 23 | library_generation_method = 'trust4' 24 | clonal_threshold = 0 25 | 26 | // Input data 27 | input = 'https://raw.githubusercontent.com/nf-core/test-datasets/airrflow/testdata-rnaseq/rnaseq_metadata.tsv' 28 | } 29 | -------------------------------------------------------------------------------- /conf/test_rnaseq_sc.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/airrflow -profile test_rnaseq_sc, 8 | */ 9 | process { 10 | resourceLimits = [ 11 | cpus: 4, 12 | memory: '15.GB', 13 | time: '1.h' 14 | ] 15 | } 16 | 17 | params { 18 | config_profile_name = 'Test single-cell RNA-seq based workflow using TRUST4' 19 | config_profile_description = 'Minimal test dataset to check pipeline function with raw single-cell RNA-seq data' 20 | 21 | // params 22 | mode = 'fastq' 23 | library_generation_method = 'trust4' 24 | clonal_threshold = 0 25 | cell_barcode_read = "R1" 26 | umi_read = "R1" 27 | read_format = "bc:0:15,um:16:27" 28 | 29 | // Input data 30 | input = 'https://raw.githubusercontent.com/nf-core/test-datasets/airrflow/testdata-rnaseq/sc_rnaseq_metadata.tsv' 31 | } 32 | -------------------------------------------------------------------------------- /conf/test_tcr.config: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------------- 3 | * Nextflow config file for running tests 4 | * ------------------------------------------------- 5 | * Defines bundled input files and everything required 6 | * to run a fast and simple test. Use as follows: 7 | * nextflow run nf-core/airrflow -profile test_tcr, 8 | */ 9 | 10 | process { 11 | resourceLimits = [ 12 | cpus: 4, 13 | memory: '15.GB', 14 | time: '1.h' 15 | ] 16 | } 17 | 18 | params { 19 | config_profile_name = 'Test TCR' 20 | config_profile_description = 'Minimal test dataset to check pipeline function with TCR data' 21 | 22 | // params 23 | mode = 'fastq' 24 | umi_length = 12 25 | umi_position = 'R2' 26 | cprimer_start = 5 27 | skip_report = false 28 | library_generation_method = 'dt_5p_race_umi' 29 | cprimer_position = 'R1' 30 | clonal_threshold = 0 31 | 32 | 33 | // Input data 34 | input = pipelines_testdata_base_path + 'testdata-tcr/TCR_metadata_airr.tsv' 35 | cprimers = pipelines_testdata_base_path + 'testdata-tcr/cprimers.fasta' 36 | race_linker = pipelines_testdata_base_path + 'testdata-tcr/linker.fasta' 37 | reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip' 38 | reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip' 39 | 40 | } 41 | 42 | process{ 43 | withName:"DEFINE_CLONES*"{ 44 | ext.args = ['outname':'', 'model':'hierarchical', 45 | 'method':'nt', 'linkage':'single', 46 | 'outputby':'sample_id', 'min_n':10] 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # nf-core/airrflow: Documentation 2 | 3 | The nf-core/airrflow 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/Primers_R1_UMI_C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/Primers_R1_UMI_C.png -------------------------------------------------------------------------------- /docs/images/Primers_R1_UMI_V.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/Primers_R1_UMI_V.png -------------------------------------------------------------------------------- /docs/images/Primers_R1_V.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/Primers_R1_V.png -------------------------------------------------------------------------------- /docs/images/TAKARA_RACE_BCR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/TAKARA_RACE_BCR.png -------------------------------------------------------------------------------- /docs/images/TAKARA_RACE_TCR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/TAKARA_RACE_TCR.png -------------------------------------------------------------------------------- /docs/images/airrflow_workflow_overview.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/airrflow_workflow_overview.ai -------------------------------------------------------------------------------- /docs/images/airrflow_workflow_overview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/airrflow_workflow_overview.pdf -------------------------------------------------------------------------------- /docs/images/airrflow_workflow_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/airrflow_workflow_overview.png -------------------------------------------------------------------------------- /docs/images/metro-map-airrflow.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/metro-map-airrflow.ai -------------------------------------------------------------------------------- /docs/images/metro-map-airrflow.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/metro-map-airrflow.pdf -------------------------------------------------------------------------------- /docs/images/metro-map-airrflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/metro-map-airrflow.png -------------------------------------------------------------------------------- /docs/images/nf-core-airrflow_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/nf-core-airrflow_logo_dark.png -------------------------------------------------------------------------------- /docs/images/nf-core-airrflow_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nf-core/airrflow/eb11e2e7e653e3353d3e3dbb687bb5d71b4990dc/docs/images/nf-core-airrflow_logo_light.png -------------------------------------------------------------------------------- /docs/usage/bulk_tutorial/bulk_sample_code/airrflow_bulk_b_fastq.sh: -------------------------------------------------------------------------------- 1 | #! usr/bin/bash 2 | 3 | nextflow run nf-core/airrflow -r 4.2.0 \ 4 | -profile docker \ 5 | --mode fastq \ 6 | --input metadata_pcr_umi_airr_300.tsv \ 7 | --cprimers 's3://ngi-igenomes/test-data/airrflow/pcr_umi/cprimers.fasta' \ 8 | --vprimers 's3://ngi-igenomes/test-data/airrflow/pcr_umi/vprimers.fasta' \ 9 | --library_generation_method specific_pcr_umi \ 10 | --cprimer_position R1 \ 11 | --umi_length 15 \ 12 | --umi_start 0 \ 13 | --umi_position R1 \ 14 | -c resource.config \ 15 | --outdir bulk_fastq_results \ 16 | -resume 17 | -------------------------------------------------------------------------------- /docs/usage/bulk_tutorial/bulk_sample_code/resource.config: -------------------------------------------------------------------------------- 1 | process { 2 | resourceLimits = [cpus:4, memory: 20.GB, time: 24.h] 3 | } 4 | -------------------------------------------------------------------------------- /docs/usage/single_cell_tutorial/sample_data_code/10x_sc_raw.tsv: -------------------------------------------------------------------------------- 1 | sample_id filename_R1 filename_R2 subject_id species pcr_target_locus single_cell tissue sex age biomaterial_provider 2 | Sample1 https://raw.githubusercontent.com/nf-core/test-datasets/airrflow/testdata-sc/subsampled_S1_L001_R1_001.fastq.gz https://raw.githubusercontent.com/nf-core/test-datasets/airrflow/testdata-sc/subsampled_S1_L001_R2_001.fastq.gz Patient1 human TR TRUE blood NA NA test_data 3 | -------------------------------------------------------------------------------- /docs/usage/single_cell_tutorial/sample_data_code/airrflow_sc_from_assembled.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/bash 2 | 3 | nextflow run nf-core/airrflow -r 4.2.0 \ 4 | -profile docker \ 5 | --mode assembled \ 6 | --input assembled_samplesheet.tsv \ 7 | --outdir sc_from_assembled_results \ 8 | -c resource.config \ 9 | -resume 10 | -------------------------------------------------------------------------------- /docs/usage/single_cell_tutorial/sample_data_code/airrflow_sc_from_fastq.sh: -------------------------------------------------------------------------------- 1 | #! usr/bin/bash 2 | 3 | nextflow run nf-core/airrflow -r 4.2.0 \ 4 | -profile docker \ 5 | --mode fastq \ 6 | --input 10x_sc_raw.tsv \ 7 | --library_generation_method sc_10x_genomics \ 8 | --reference_10x refdata-cellranger-vdj-GRCh38-alts-ensembl-7.1.0 \ 9 | -c resource.config \ 10 | --clonal_threshold 0 \ 11 | --outdir sc_from_fastq_results \ 12 | -resume 13 | -------------------------------------------------------------------------------- /docs/usage/single_cell_tutorial/sample_data_code/assembled_samplesheet.tsv: -------------------------------------------------------------------------------- 1 | filename species subject_id sample_id day tissue sex age biomaterial_provider pcr_target_locus single_cell 2 | https://zenodo.org/records/11373741/files/AIRR_subject1_FNA_d0_1_Y1.tsv human S1 S1_d0 d0 PMBC NA NA NA IG TRUE 3 | https://zenodo.org/records/11373741/files/AIRR_subject1_FNA_d12_3_Y1.tsv human S1 S1_d12 d12 PMBC NA NA NA IG TRUE 4 | https://zenodo.org/records/11373741/files/AIRR_subject2_FNA_d0_1_Y1.tsv human S2 S2_d0 d0 PMBC NA NA NA IG TRUE 5 | https://zenodo.org/records/11373741/files/AIRR_subject2_FNA_d12_2_Y1.tsv human S2 S2_d12 d12 PMBC NA NA NA IG TRUE 6 | -------------------------------------------------------------------------------- /docs/usage/single_cell_tutorial/sample_data_code/assembled_samplesheet_missing_sex.tsv: -------------------------------------------------------------------------------- 1 | filename species subject_id sample_id day tissue age biomaterial_provider pcr_target_locus single_cell 2 | https://zenodo.org/records/11373741/files/AIRR_subject1_FNA_d0_1_Y1.tsv human S1 S1_d0 d0 PMBC NA NA IG TRUE 3 | https://zenodo.org/records/11373741/files/AIRR_subject1_FNA_d12_3_Y1.tsv human S1 S1_d12 d12 PMBC NA NA IG TRUE 4 | https://zenodo.org/records/11373741/files/AIRR_subject2_FNA_d0_1_Y1.tsv human S2 S2_d0 d0 PMBC NA NA IG TRUE 5 | https://zenodo.org/records/11373741/files/AIRR_subject2_FNA_d12_2_Y1.tsv human S2 S2_d12 d12 PMBC NA NA IG TRUE 6 | -------------------------------------------------------------------------------- /docs/usage/single_cell_tutorial/sample_data_code/resource.config: -------------------------------------------------------------------------------- 1 | process { 2 | resourceLimits = [ memory: 16.GB, time: 24.h, cpus: 8 ] 3 | } 4 | -------------------------------------------------------------------------------- /modules/local/airrflow_report/airrflow_report.nf: -------------------------------------------------------------------------------- 1 | process AIRRFLOW_REPORT { 2 | tag "${meta.id}" 3 | label 'process_high' 4 | 5 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 6 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 7 | } 8 | container "docker.io/immcantation/airrflow:4.3.0" 9 | 10 | input: 11 | tuple val(meta), path(tab) // sequence tsv table in AIRR format 12 | path("Table_sequences.tsv") 13 | path("Table_sequences_assembled.tsv") 14 | path(repertoire_report) 15 | path(css) 16 | path(logo) 17 | 18 | output: 19 | path "versions.yml" , emit: versions 20 | path("repertoire_comparison"), emit: results_folder 21 | path("*.html"), emit: report_html 22 | 23 | script: 24 | """ 25 | execute_report.R --report_file ${repertoire_report} 26 | 27 | cat <<-END_VERSIONS > versions.yml 28 | "${task.process}": 29 | alakazam: \$(Rscript -e "library(alakazam); cat(paste(packageVersion('alakazam'), collapse='.'))") 30 | shazam: \$(Rscript -e "library(shazam); cat(paste(packageVersion('shazam'), collapse='.'))") 31 | stringr: \$(Rscript -e "library(stringr); cat(paste(packageVersion('stringr'), collapse='.'))") 32 | dplyr: \$(Rscript -e "library(dplyr); cat(paste(packageVersion('dplyr'), collapse='.'))") 33 | knitr: \$(Rscript -e "library(knitr); cat(paste(packageVersion('knitr'), collapse='.'))") 34 | R: \$(echo \$(R --version 2>&1) | awk -F' ' '{print \$3}') 35 | END_VERSIONS 36 | """ 37 | } 38 | -------------------------------------------------------------------------------- /modules/local/changeo/changeo_assigngenes.nf: -------------------------------------------------------------------------------- 1 | process CHANGEO_ASSIGNGENES { 2 | tag "$meta.id" 3 | label 'process_low' 4 | label 'immcantation' 5 | 6 | conda "bioconda::changeo=1.3.0 bioconda::igblast=1.22.0 conda-forge::wget=1.20.1" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' : 9 | 'biocontainers/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' }" 10 | 11 | input: 12 | tuple val(meta), path(reads) // reads in fasta format 13 | path(igblast) // igblast references 14 | 15 | output: 16 | path("*igblast.fmt7"), emit: blast 17 | tuple val(meta), path("$reads"), emit: fasta 18 | path "versions.yml" , emit: versions 19 | path("*_command_log.txt"), emit: logs //process logs 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | """ 24 | AssignGenes.py igblast -s $reads -b $igblast --organism $meta.species --loci ${meta.locus.toLowerCase()} $args --nproc $task.cpus --outname $meta.id > ${meta.id}_changeo_assigngenes_command_log.txt 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) 29 | changeo: \$( AssignGenes.py --version | awk -F' ' '{print \$2}' ) 30 | END_VERSIONS 31 | """ 32 | } 33 | -------------------------------------------------------------------------------- /modules/local/changeo/changeo_convertdb_fasta.nf: -------------------------------------------------------------------------------- 1 | process CHANGEO_CONVERTDB_FASTA { 2 | tag "$meta.id" 3 | label 'process_low' 4 | label 'immcantation' 5 | 6 | 7 | conda "bioconda::changeo=1.3.0 bioconda::igblast=1.22.0 conda-forge::wget=1.20.1" 8 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 9 | 'https://depot.galaxyproject.org/singularity/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' : 10 | 'biocontainers/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' }" 11 | 12 | input: 13 | tuple val(meta), path(tab) // sequence tsv in AIRR format 14 | 15 | output: 16 | tuple val(meta), path("*.fasta"), emit: fasta // sequence in fasta format 17 | path "versions.yml" , emit: versions 18 | path "*_command_log.txt" , emit: logs 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | """ 23 | ConvertDb.py fasta -d $tab $args > ${meta.id}_convertdb_command_log.txt 24 | 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) 28 | changeo: \$( ConvertDb.py --version | awk -F' ' '{print \$2}' ) 29 | END_VERSIONS 30 | """ 31 | } 32 | -------------------------------------------------------------------------------- /modules/local/changeo/changeo_creategermlines.nf: -------------------------------------------------------------------------------- 1 | process CHANGEO_CREATEGERMLINES { 2 | tag "$meta.id" 3 | label 'process_low' 4 | label 'immcantation' 5 | 6 | 7 | conda "bioconda::changeo=1.3.0 bioconda::igblast=1.22.0 conda-forge::wget=1.20.1" 8 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 9 | 'https://depot.galaxyproject.org/singularity/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' : 10 | 'biocontainers/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' }" 11 | 12 | input: 13 | tuple val(meta), path(tab) // sequence tsv table in AIRR format 14 | path(reference_fasta) // reference fasta 15 | 16 | output: 17 | tuple val(meta), path("*germ-pass.tsv"), emit: tab 18 | path("*_command_log.txt"), emit: logs 19 | path "versions.yml" , emit: versions 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | """ 24 | CreateGermlines.py -d ${tab} \\ 25 | -r ${reference_fasta}/${meta.species}/vdj/ \\ 26 | -g dmask --format airr \\ 27 | --log ${meta.id}.log --outname ${meta.id} $args > ${meta.id}_create-germlines_command_log.txt 28 | ParseLog.py -l ${meta.id}.log -f ID V_CALL D_CALL J_CALL 29 | 30 | cat <<-END_VERSIONS > versions.yml 31 | "${task.process}": 32 | igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) 33 | changeo: \$( CreateGermlines.py --version | awk -F' ' '{print \$2}' ) 34 | END_VERSIONS 35 | """ 36 | } 37 | -------------------------------------------------------------------------------- /modules/local/changeo/changeo_makedb.nf: -------------------------------------------------------------------------------- 1 | process CHANGEO_MAKEDB { 2 | tag "$meta.id" 3 | label 'process_low' 4 | label 'immcantation' 5 | 6 | 7 | conda "bioconda::changeo=1.3.0 bioconda::igblast=1.22.0 conda-forge::wget=1.20.1" 8 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 9 | 'https://depot.galaxyproject.org/singularity/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' : 10 | 'biocontainers/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' }" 11 | 12 | input: 13 | tuple val(meta), path(reads) // reads in fasta format 14 | path(igblast) // igblast fasta from ch_igblast_db_for_process_igblast.mix(ch_igblast_db_for_process_igblast_mix).collect() 15 | path(reference_fasta) 16 | 17 | output: 18 | tuple val(meta), path("*db-pass.tsv"), emit: tab //sequence table in AIRR format 19 | path("*_command_log.txt"), emit: logs //process logs 20 | path "versions.yml" , emit: versions 21 | 22 | script: 23 | def args = task.ext.args ?: '' 24 | def partial = meta.species.toLowerCase()=='mouse' && meta.locus.toLowerCase()=='tr' ? '--partial' : '' 25 | """ 26 | MakeDb.py igblast -i $igblast -s $reads -r \\ 27 | ${reference_fasta}/${meta.species.toLowerCase()}/vdj/ \\ 28 | $args $partial \\ 29 | --outname ${meta.id} > ${meta.id}_makedb_command_log.txt 30 | 31 | cat <<-END_VERSIONS > versions.yml 32 | "${task.process}": 33 | igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) 34 | changeo: \$( MakeDb.py --version | awk -F' ' '{print \$2}' ) 35 | END_VERSIONS 36 | """ 37 | } 38 | -------------------------------------------------------------------------------- /modules/local/changeo/changeo_parsedb_select_locus.nf: -------------------------------------------------------------------------------- 1 | process CHANGEO_PARSEDB_SELECT_LOCUS { 2 | tag "$meta.id" 3 | label 'process_low' 4 | label 'immcantation' 5 | 6 | 7 | conda "bioconda::changeo=1.3.0 bioconda::igblast=1.22.0 conda-forge::wget=1.20.1" 8 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 9 | 'https://depot.galaxyproject.org/singularity/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' : 10 | 'biocontainers/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' }" 11 | 12 | input: 13 | tuple val(meta), path(tab) // sequence tsv in AIRR format 14 | 15 | output: 16 | tuple val(meta), path("*parse-select.tsv"), emit: tab // sequence tsv in AIRR format 17 | path("*_command_log.txt"), emit: logs //process logs 18 | path "versions.yml" , emit: versions 19 | 20 | script: 21 | if (meta.locus.toUpperCase() == 'IG'){ 22 | """ 23 | ParseDb.py select -d $tab -f locus -u "IG[HKL]" --regex --outname ${meta.id} > ${meta.id}_select_command_log.txt 24 | 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | changeo: \$( ParseDb.py --version | awk -F' ' '{print \$2}' ) 28 | END_VERSIONS 29 | """ 30 | } else if (meta.locus.toUpperCase() == 'TR'){ 31 | """ 32 | ParseDb.py select -d $tab -f locus -u "TR[ABDG]" --regex --outname ${meta.id} > "${meta.id}_command_log.txt" 33 | 34 | cat <<-END_VERSIONS > versions.yml 35 | "${task.process}": 36 | changeo: \$( ParseDb.py --version | awk -F' ' '{print \$2}' ) 37 | END_VERSIONS 38 | """ 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /modules/local/changeo/changeo_parsedb_split.nf: -------------------------------------------------------------------------------- 1 | process CHANGEO_PARSEDB_SPLIT { 2 | tag "$meta.id" 3 | label 'process_low' 4 | label 'immcantation' 5 | 6 | 7 | conda "bioconda::changeo=1.3.0 bioconda::igblast=1.22.0 conda-forge::wget=1.20.1" 8 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 9 | 'https://depot.galaxyproject.org/singularity/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' : 10 | 'biocontainers/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' }" 11 | 12 | input: 13 | tuple val(meta), path(tab) // sequence tsv in AIRR format 14 | 15 | output: 16 | tuple val(meta), path("*productive-T.tsv"), emit: tab //sequence tsv in AIRR format 17 | tuple val(meta), path("*productive-F.tsv"), emit: unproductive, optional: true //optional non-productive sequences 18 | path("*_command_log.txt"), emit: logs //process logs 19 | path "versions.yml" , emit: versions 20 | 21 | script: 22 | """ 23 | ParseDb.py split -d $tab -f productive --outname ${meta.id} > ${meta.id}_split_command_log.txt 24 | 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | changeo: \$( ParseDb.py --version | awk -F' ' '{print \$2}' ) 28 | END_VERSIONS 29 | """ 30 | } 31 | -------------------------------------------------------------------------------- /modules/local/enchantr/collapse_duplicates.nf: -------------------------------------------------------------------------------- 1 | process COLLAPSE_DUPLICATES { 2 | tag "$meta.id" 3 | 4 | label 'process_long_parallelized' 5 | label 'immcantation' 6 | 7 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 8 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 9 | } 10 | container "docker.io/immcantation/airrflow:4.3.0" 11 | 12 | input: 13 | tuple val(meta), path(tabs) // tuple [val(meta), sequence tsv in AIRR format ] 14 | 15 | output: 16 | tuple val(meta), path("*/*/*collapse-pass.tsv"), emit: tab // sequence tsv in AIRR format 17 | path("*_command_log.txt"), emit: logs //process logs 18 | path "*_report" 19 | path "versions.yml" , emit: versions 20 | 21 | script: 22 | """ 23 | echo "${tabs.join('\n')}" > tabs.txt 24 | Rscript -e "enchantr::enchantr_report('collapse_duplicates', \\ 25 | report_params=list('input'='tabs.txt',\\ 26 | 'collapseby'='${params.collapseby}',\\ 27 | 'outdir'=getwd(),\\ 28 | 'nproc'=${task.cpus},\\ 29 | 'outname'='${meta.id}',\\ 30 | 'log'='${meta.id}_collapse_command_log'))" 31 | 32 | cp -r enchantr ${meta.id}_collapse_report && rm -r enchantr 33 | 34 | echo "${task.process}": > versions.yml 35 | Rscript -e "cat(paste0(' enchantr: ',packageVersion('enchantr'),'\n'))" >> versions.yml 36 | """ 37 | } 38 | -------------------------------------------------------------------------------- /modules/local/enchantr/detect_contamination.nf: -------------------------------------------------------------------------------- 1 | process DETECT_CONTAMINATION { 2 | tag "multi_repertoire" 3 | 4 | label 'process_long_parallelized' 5 | label 'immcantation' 6 | 7 | 8 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 9 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 10 | } 11 | container "docker.io/immcantation/airrflow:4.3.0" 12 | 13 | input: 14 | path(tabs) 15 | 16 | output: 17 | path("*cont-flag.tsv"), emit: tab // sequence tsv in AIRR format 18 | path("*_command_log.txt"), emit: logs //process logs 19 | path "*_report" 20 | path "versions.yml" , emit: versions 21 | 22 | script: 23 | """ 24 | echo "${tabs.join('\n')}" > tabs.txt 25 | Rscript -e "enchantr::enchantr_report('contamination', \\ 26 | report_params=list('input'='tabs.txt',\\ 27 | 'input_id'='id','outdir'=getwd(), \\ 28 | 'outname'='cont-flag', \\ 29 | 'log'='all_reps_contamination_command_log'))" 30 | 31 | cp -r enchantr all_reps_cont_report && rm -rf enchantr 32 | 33 | echo "${task.process}": > versions.yml 34 | Rscript -e "cat(paste0(' enchantr: ',packageVersion('enchantr'),'\n'))" >> versions.yml 35 | """ 36 | } 37 | -------------------------------------------------------------------------------- /modules/local/enchantr/dowser_lineages.nf: -------------------------------------------------------------------------------- 1 | def asString (args) { 2 | def s = "" 3 | def value = "" 4 | if (args.size()>0) { 5 | if (args[0] != 'none') { 6 | for (param in args.keySet().sort()){ 7 | value = args[param].toString() 8 | if (!value.isNumber()) { 9 | value = "'"+value+"'" 10 | } 11 | s = s + ",'"+param+"'="+value 12 | } 13 | } 14 | } 15 | return s 16 | } 17 | 18 | process DOWSER_LINEAGES { 19 | tag "${meta.id}" 20 | 21 | label 'process_long_parallelized' 22 | label 'immcantation' 23 | 24 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 25 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 26 | } 27 | container "docker.io/immcantation/airrflow:4.3.0" 28 | 29 | input: 30 | tuple val(meta), path(tabs) 31 | 32 | output: 33 | path("*_command_log.txt"), emit: logs //process logs 34 | path "*_report" 35 | path "versions.yml", emit: versions 36 | 37 | script: 38 | def args = task.ext.args ? asString(task.ext.args) : '' 39 | def id_name = "$tabs".replaceFirst('__.*','') 40 | // TODO use nice outname, not tabs 41 | """ 42 | Rscript -e "enchantr::enchantr_report('dowser_lineage', \\ 43 | report_params=list('input'='${tabs}', \\ 44 | 'build'='${params.lineage_tree_builder}', \\ 45 | 'exec'='${params.lineage_tree_exec}', \\ 46 | 'outdir'=getwd(), \\ 47 | 'nproc'=${task.cpus},\\ 48 | 'log'='${id_name}_dowser_command_log' ${args}))" 49 | 50 | cp -r enchantr ${id_name}_dowser_report && rm -rf enchantr 51 | 52 | echo "${task.process}": > versions.yml 53 | Rscript -e "cat(paste0(' enchantr: ',packageVersion('enchantr'),'\n'))" >> versions.yml 54 | """ 55 | } 56 | -------------------------------------------------------------------------------- /modules/local/enchantr/find_threshold.nf: -------------------------------------------------------------------------------- 1 | def asString (args) { 2 | def s = "" 3 | def value = "" 4 | if (args.size()>0) { 5 | if (args[0] != 'none') { 6 | for (param in args.keySet().sort()){ 7 | value = args[param].toString() 8 | if (!value.isNumber()) { 9 | value = "'"+value+"'" 10 | } 11 | s = s + ",'"+param+"'="+value 12 | } 13 | } 14 | } 15 | return s 16 | } 17 | 18 | process FIND_THRESHOLD { 19 | tag "all_reps" 20 | 21 | label 'process_long_parallelized' 22 | label 'immcantation' 23 | 24 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 25 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 26 | } 27 | container "docker.io/immcantation/airrflow:4.3.0" 28 | 29 | 30 | input: 31 | path tab // sequence tsv in AIRR format 32 | path logo 33 | path tabs_samplesheet 34 | 35 | output: 36 | // tuple val(meta), path("*threshold-pass.tsv"), emit: tab // sequence tsv in AIRR format 37 | path("*_command_log.txt"), emit: logs //process logs 38 | path "*_report" 39 | path "all_reps_dist_report/tables/*_threshold-summary.tsv", emit: threshold_summary, optional:true 40 | path "all_reps_dist_report/tables/*_threshold-mean.tsv", emit: mean_threshold 41 | path "versions.yml", emit: versions 42 | 43 | script: 44 | def args = task.ext.args ? asString(task.ext.args) : '' 45 | """ 46 | Rscript -e "enchantr::enchantr_report('find_threshold', \\ 47 | report_params=list('input'='${tabs_samplesheet}',\\ 48 | 'cloneby'='${params.cloneby}',\\ 49 | 'crossby'='${params.crossby}',\\ 50 | 'singlecell'='${params.singlecell}',\\ 51 | 'outdir'=getwd(),\\ 52 | 'nproc'=${task.cpus},\\ 53 | 'outname'='all_reps',\\ 54 | 'log'='all_reps_threshold_command_log',\\ 55 | 'logo'='${logo}' ${args}))" 56 | 57 | cp -r enchantr all_reps_dist_report && rm -rf enchantr 58 | 59 | echo "${task.process}": > versions.yml 60 | Rscript -e "cat(paste0(' enchantr: ',packageVersion('enchantr'),'\n'))" >> versions.yml 61 | """ 62 | } 63 | -------------------------------------------------------------------------------- /modules/local/enchantr/remove_chimeric.nf: -------------------------------------------------------------------------------- 1 | process REMOVE_CHIMERIC { 2 | tag "$meta.id" 3 | 4 | label 'process_long_parallelized' 5 | label 'immcantation' 6 | 7 | 8 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 9 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 10 | } 11 | container "docker.io/immcantation/airrflow:4.3.0" 12 | 13 | 14 | input: 15 | tuple val(meta), path(tab) // sequence tsv in AIRR format 16 | path(reference_fasta) 17 | 18 | output: 19 | tuple val(meta), path("*chimera-pass.tsv"), emit: tab // sequence tsv in AIRR format 20 | path("*_command_log.txt"), emit: logs //process logs 21 | path "*_report" //, emit: chimera_report 22 | path "versions.yml" , emit: versions 23 | 24 | script: 25 | """ 26 | Rscript -e "enchantr:::enchantr_report('chimera_analysis', \\ 27 | report_params=list('input'='${tab}',\\ 28 | 'outdir'=getwd(), \\ 29 | 'nproc'=${task.cpus},\\ 30 | 'outname'='${meta.id}', \\ 31 | 'log'='${meta.id}_chimeric_command_log'))" 32 | 33 | cp -r enchantr ${meta.id}_chimera_report && rm -rf enchantr 34 | 35 | echo "\"${task.process}\":" > versions.yml 36 | Rscript -e "cat(paste0(' enchantr: ',packageVersion('enchantr'),'\n'))" >> versions.yml 37 | """ 38 | } 39 | -------------------------------------------------------------------------------- /modules/local/enchantr/report_file_size.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Generate file size report 3 | */ 4 | process REPORT_FILE_SIZE { 5 | tag "file_size" 6 | label 'immcantation' 7 | label 'process_single' 8 | 9 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 10 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 11 | } 12 | container "docker.io/immcantation/airrflow:4.3.0" 13 | 14 | input: 15 | path logs 16 | path metadata 17 | path logs_tabs 18 | 19 | output: 20 | path "*_report", emit: file_size 21 | path "versions.yml", emit: versions 22 | path "file_size_report/tables/log_data.tsv", emit: table 23 | 24 | script: 25 | """ 26 | Rscript -e "enchantr::enchantr_report('file_size', \\ 27 | report_params=list('input'='${logs_tabs}', 'metadata'='${metadata}',\\ 28 | 'outdir'=getwd()))" 29 | 30 | cp -r enchantr file_size_report && rm -rf enchantr 31 | 32 | echo "\"${task.process}\":" > versions.yml 33 | Rscript -e "cat(paste0(' enchantr: ',packageVersion('enchantr'),'\n'))" >> versions.yml 34 | 35 | """ 36 | } 37 | -------------------------------------------------------------------------------- /modules/local/enchantr/single_cell_qc.nf: -------------------------------------------------------------------------------- 1 | def asString (args) { 2 | def s = "" 3 | def value = "" 4 | if (args.size()>0) { 5 | if (args[0] != 'none') { 6 | for (param in args.keySet().sort()){ 7 | value = args[param].toString() 8 | if (!value.isNumber()) { 9 | value = "'"+value+"'" 10 | } 11 | s = s + ",'"+param+"'="+value 12 | } 13 | } 14 | } 15 | return s 16 | } 17 | 18 | process SINGLE_CELL_QC { 19 | tag 'all_single_cell' 20 | label 'immcantation' 21 | label 'process_medium' 22 | 23 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 24 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 25 | } 26 | container "docker.io/immcantation/airrflow:4.3.0" 27 | 28 | input: 29 | path(tabs) 30 | 31 | output: 32 | path("*/*/*scqc-pass.tsv"), emit: tab // sequence tsv in AIRR format 33 | path("*_command_log.txt"), emit: logs //process logs 34 | path("*_report"), emit: report 35 | path("versions.yml"), emit: versions 36 | 37 | script: 38 | def args = task.ext.args ? asString(task.ext.args) : '' 39 | """ 40 | echo "${tabs.join('\n')}" > tabs.txt 41 | Rscript -e "enchantr::enchantr_report('single_cell_qc', \\ 42 | report_params=list('input'='tabs.txt',\\ 43 | 'outdir'=getwd(), \\ 44 | 'log'='all_reps_scqc_command_log' ${args} ))" 45 | 46 | cp -r enchantr all_reps_scqc_report && rm -rf enchantr 47 | 48 | echo "${task.process}": > versions.yml 49 | Rscript -e "cat(paste0(' enchantr: ',packageVersion('enchantr'),'\n'))" >> versions.yml 50 | """ 51 | } 52 | -------------------------------------------------------------------------------- /modules/local/enchantr/validate_input.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Reformat design file and check validity 3 | */ 4 | process VALIDATE_INPUT { 5 | tag "$samplesheet" 6 | label 'immcantation' 7 | label 'process_single' 8 | 9 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 10 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 11 | } 12 | container "docker.io/immcantation/airrflow:4.3.0" 13 | 14 | input: 15 | file samplesheet 16 | path miairr 17 | val collapseby 18 | val cloneby 19 | 20 | output: 21 | path "*/validated_input.tsv", emit: validated_input 22 | path "*/validated_input_not-valid.tsv", emit: not_valid_input, optional: true 23 | path "versions.yml", emit: versions 24 | 25 | script: 26 | """ 27 | Rscript -e "enchantr:::enchantr_report('validate_input', report_params=list('input'='${samplesheet}','collapseby'='${collapseby}','cloneby'='${cloneby}','reassign'='${params.reassign}','miairr'='${miairr}','outdir'=getwd()))" 28 | 29 | cp -r enchantr validate_input_report && rm -rf enchantr 30 | 31 | echo "\"${task.process}\":" > versions.yml 32 | Rscript -e "cat(paste0(' enchantr: ',packageVersion('enchantr'),'\n'))" >> versions.yml 33 | """ 34 | } 35 | -------------------------------------------------------------------------------- /modules/local/fastqc_postassembly.nf: -------------------------------------------------------------------------------- 1 | // Generate QC stats after reads paired and filtered but before collapsed 2 | process FASTQC_POSTASSEMBLY { 3 | tag "$meta.id" 4 | label 'process_medium' 5 | 6 | conda "bioconda::fastqc=0.12.1" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/fastqc:0.12.1--hdfd78af_0' : 9 | 'biocontainers/fastqc:0.12.1--hdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(reads) 13 | 14 | output: 15 | tuple val(meta), path("*.html"), emit: html 16 | tuple val(meta), path("*.zip") , emit: zip 17 | path "versions.yml" , emit: versions 18 | 19 | script: 20 | def args = task.ext.args ?: '' 21 | def prefix = task.ext.prefix ?: "${meta.id}" 22 | """ 23 | [ ! -f ${prefix}.fastq ] && ln -s $reads ${prefix}_ASSEMBLED.fastq 24 | fastqc $args --threads $task.cpus ${prefix}_ASSEMBLED.fastq 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) 29 | END_VERSIONS 30 | """ 31 | } 32 | -------------------------------------------------------------------------------- /modules/local/fetch_databases.nf: -------------------------------------------------------------------------------- 1 | process FETCH_DATABASES { 2 | tag "IMGT IGBLAST" 3 | label 'process_low' 4 | label 'immcantation' 5 | 6 | conda "bioconda::changeo=1.3.0 bioconda::igblast=1.22.0 conda-forge::wget=1.20.1" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' : 9 | 'biocontainers/mulled-v2-7d8e418eb73acc6a80daea8e111c94cf19a4ecfd:a9ee25632c9b10bbb012da76e6eb539acca8f9cd-1' }" 10 | 11 | output: 12 | path("igblast_base"), emit: igblast 13 | path("imgtdb_base"), emit: reference_fasta 14 | path "versions.yml" , emit: versions 15 | path("igblast_base/database/imgt_human_ig_v.ndb"), emit: igblast_human_ig_v 16 | path("igblast_base/database/imgt_human_ig_d.ndb"), emit: igblast_human_ig_d 17 | path("igblast_base/database/imgt_human_ig_j.ndb"), emit: igblast_human_ig_j 18 | path("igblast_base/database/imgt_human_tr_v.ndb"), emit: igblast_human_tr_v 19 | path("igblast_base/database/imgt_human_tr_d.ndb"), emit: igblast_human_tr_d 20 | path("igblast_base/database/imgt_human_tr_j.ndb"), emit: igblast_human_tr_j 21 | 22 | script: 23 | """ 24 | fetch_databases.sh 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | IMGT download date: \$( echo \$(date "+%F") ) 29 | igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) 30 | changeo: \$( AssignGenes.py --version | awk -F' ' '{print \$2}' ) 31 | END_VERSIONS 32 | """ 33 | } 34 | -------------------------------------------------------------------------------- /modules/local/gunzip.nf: -------------------------------------------------------------------------------- 1 | process GUNZIP { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "conda-forge::sed=4.7" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : 8 | 'docker.io/biocontainers/biocontainers:v1.2.0_cv1' }" 9 | 10 | input: 11 | tuple val(meta), path(R1), path(R2) 12 | 13 | output: 14 | tuple val(meta), path("${R1.simpleName}*"), path("${R2.simpleName}*") , emit: reads 15 | path "versions.yml", emit: versions 16 | 17 | script: 18 | """ 19 | gunzip -f "${R1}" 20 | gunzip -f "${R2}" 21 | 22 | cat <<-END_VERSIONS > versions.yml 23 | "${task.process}": 24 | gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//') 25 | END_VERSIONS 26 | """ 27 | } 28 | -------------------------------------------------------------------------------- /modules/local/merge_UMI.nf: -------------------------------------------------------------------------------- 1 | // Import generic module functions 2 | process MERGE_UMI { 3 | tag "$meta.id" 4 | label 'process_low' 5 | 6 | conda "conda-forge::biopython=1.81" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/biopython:1.81' : 9 | 'biocontainers/biopython:1.81' }" 10 | 11 | input: 12 | tuple val(meta), path(R1), path(R2), path(I1) 13 | 14 | output: 15 | tuple val(meta), path('*_R1.fastq.gz'), path('*_R2.fastq.gz') , emit: reads 16 | path "versions.yml" , emit: versions 17 | 18 | script: 19 | """ 20 | merge_R1_umi.py -R1 "${R1}" -I1 "${I1}" -o UMI_R1.fastq.gz --umi_start $params.umi_start --umi_length $params.umi_length 21 | mv "UMI_R1.fastq.gz" "${meta.id}_UMI_R1.fastq.gz" 22 | mv "${R2}" "${meta.id}_R2.fastq.gz" 23 | 24 | cat <<-END_VERSIONS > versions.yml 25 | "${task.process}": 26 | python: \$( echo \$(python --version | grep -o "[0-9\\. ]\\+") ) 27 | biopython: \$(echo \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('biopython').version)")) 28 | END_VERSIONS 29 | """ 30 | } 31 | -------------------------------------------------------------------------------- /modules/local/parse_logs.nf: -------------------------------------------------------------------------------- 1 | // Import generic module functions 2 | process PARSE_LOGS { 3 | tag "logs" 4 | label 'process_low' 5 | 6 | conda "bioconda::pandas=1.1.5" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/pandas:1.1.5' : 9 | 'biocontainers/pandas:1.1.5' }" 10 | 11 | input: 12 | path('filter_by_sequence_quality/*') //PRESTO_FILTERSEQ logs 13 | path('mask_primers/*') //PRESTO_MASKPRIMERS logs 14 | path('pair_sequences/*') //PRESTO_PAIRSEQ logs 15 | path('cluster_sets/*') //PRESTO_CLUTSERSETS logs 16 | path('build_consensus/*') //PRESTO_BUILDCONSENSUS logs 17 | path('repair_mates/*') //PRESTO_POSTCONSESUS_PAIRSEQ logs 18 | path('assemble_pairs/*') //PRESTO_ASSEMBLEPAIRS logs 19 | path('deduplicates/*') //PRESTO_COLLAPSESEQ logs 20 | path('filter_representative_2/*') //PRESTO_SPLITSEQ logs 21 | path('igblast/*') //CHANGEO_MAKEDB logs 22 | path('metadata.tsv') //METADATA 23 | 24 | output: 25 | path "Table_sequences_process.tsv", emit: logs 26 | path "Table*.tsv", emit:tables 27 | path "versions.yml" , emit: versions 28 | 29 | script: 30 | if (params.umi_length == 0) { 31 | """ 32 | log_parsing_no-umi.py 33 | 34 | cat <<-END_VERSIONS > versions.yml 35 | "${task.process}": 36 | python: \$( echo \$(python --version | grep -o "[0-9\\. ]\\+") ) 37 | pandas: \$(echo \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('pandas').version)")) 38 | END_VERSIONS 39 | """ 40 | } else { 41 | def clustersets = params.cluster_sets? "--cluster_sets":"" 42 | """ 43 | log_parsing.py $clustersets 44 | 45 | cat <<-END_VERSIONS > versions.yml 46 | "${task.process}": 47 | python: \$( echo \$(python --version | grep -o "[0-9\\. ]\\+") ) 48 | pandas: \$(echo \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('pandas').version)")) 49 | END_VERSIONS 50 | """ 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /modules/local/prepare_trust4_reference.nf: -------------------------------------------------------------------------------- 1 | process PREPARE_TRUST4_REFERENCE { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | 5 | conda "bioconda::trust4=1.0.13" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/trust4:1.0.13--h43eeafb_0': 8 | 'biocontainers/trust4:1.0.13--h43eeafb_0' }" 9 | 10 | input: 11 | tuple val(meta), path(R1), path(R2) 12 | path(reference_igblast) 13 | 14 | output: 15 | path("trust4_reference.fa") , emit: trust4_reference 16 | 17 | script: 18 | """ 19 | cat ${reference_igblast}/fasta/imgt_${meta.species.toLowerCase()}_*.fasta \\ 20 | ${reference_igblast}/fasta/imgt_${meta.species.toLowerCase()}_*.fasta >> trust4_reference.fa 21 | """ 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /modules/local/presto/presto_assemblepairs.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_ASSEMBLEPAIRS { 2 | tag "$meta.id" 3 | label 'process_long_parallelized' 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(R1), path(R2) 13 | 14 | output: 15 | tuple val(meta), path("*_assemble-pass.fastq"), emit: reads 16 | path("*_command_log.txt"), emit: logs 17 | path("*_table.tab") 18 | path "versions.yml" , emit: versions 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | def args2 = task.ext.args2 ?: '' 23 | """ 24 | AssemblePairs.py align -1 $R1 -2 $R2 --nproc ${task.cpus} \\ 25 | $args \\ 26 | --outname ${meta.id} --log ${meta.id}.log > ${meta.id}_command_log.txt 27 | ParseLog.py -l ${meta.id}.log $args2 28 | 29 | cat <<-END_VERSIONS > versions.yml 30 | "${task.process}": 31 | presto: \$( AssemblePairs.py --version | awk -F' ' '{print \$2}' ) 32 | END_VERSIONS 33 | """ 34 | } 35 | -------------------------------------------------------------------------------- /modules/local/presto/presto_assemblepairs_sequential.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_ASSEMBLEPAIRS_SEQUENTIAL { 2 | tag "$meta.id" 3 | label 'process_long_parallelized' 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.1 bioconda::igblast=1.22.0 conda-forge::wget=1.20.1 conda-forge::biopython=1.79" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/mulled-v2-865ad74e0cfd6de39e9e3ade759d826fce726425:eb705f041731c0cf4f5e7595889cf9d14a05031b-0' : 9 | 'biocontainers/mulled-v2-865ad74e0cfd6de39e9e3ade759d826fce726425:eb705f041731c0cf4f5e7595889cf9d14a05031b-0' }" 10 | 11 | input: 12 | tuple val(meta), path(R1), path(R2) // reads in fastq format 13 | path(igblast) // igblast references 14 | 15 | output: 16 | tuple val(meta), path("*_assemble-pass.fastq"), emit: reads 17 | path("*_command_log.txt"), emit: logs 18 | path("*_table.tab") 19 | path "versions.yml" , emit: versions 20 | 21 | script: 22 | def args = task.ext.args ?: '' 23 | def args2 = task.ext.args2 ?: '' 24 | """ 25 | AssemblePairs.py sequential -1 $R2 -2 $R1 --nproc ${task.cpus} \\ 26 | -r "${igblast}/fasta/imgt_${meta.species}_${meta.locus.toLowerCase()}_v.fasta" \\ 27 | $args \\ 28 | --outname ${meta.id} --log ${meta.id}.log > ${meta.id}_command_log.txt 29 | ParseLog.py -l ${meta.id}.log $args2 30 | 31 | cat <<-END_VERSIONS > versions.yml 32 | "${task.process}": 33 | presto: \$( AssemblePairs.py --version | awk -F' ' '{print \$2}' ) 34 | END_VERSIONS 35 | """ 36 | } 37 | -------------------------------------------------------------------------------- /modules/local/presto/presto_buildconsensus.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_BUILDCONSENSUS { 2 | tag "$meta.id" 3 | label "process_long_parallelized" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(R1), path(R2) 13 | 14 | output: 15 | tuple val(meta), path("*_R1_consensus-pass.fastq"), path("*_R2_consensus-pass.fastq"), emit: reads 16 | path("*_command_log.txt"), emit: logs 17 | path("*.tab"), emit: log_tab 18 | path "versions.yml" , emit: versions 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | def args2 = task.ext.args2 ?: '' 23 | def args3 = task.ext.args3 ?: '' 24 | """ 25 | BuildConsensus.py -s $R1 --nproc ${task.cpus} ${args} --outname ${meta.id}_R1 --log ${meta.id}_R1.log > ${meta.id}_command_log.txt 26 | BuildConsensus.py -s $R2 --nproc ${task.cpus} ${args2} --outname ${meta.id}_R2 --log ${meta.id}_R2.log >> ${meta.id}_command_log.txt 27 | ParseLog.py -l ${meta.id}_R1.log ${meta.id}_R2.log ${args3} 28 | 29 | cat <<-END_VERSIONS > versions.yml 30 | "${task.process}": 31 | presto: \$( BuildConsensus.py --version | awk -F' ' '{print \$2}' ) 32 | END_VERSIONS 33 | """ 34 | } 35 | -------------------------------------------------------------------------------- /modules/local/presto/presto_clustersets.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_CLUSTERSETS { 2 | tag "$meta.id" 3 | label "process_long_parallelized" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(R1), path(R2) 13 | 14 | output: 15 | tuple val(meta), path("*_R1_cluster-pass.fastq"), path("*_R2_cluster-pass.fastq"), emit: reads 16 | path "*_command_log.txt", emit: logs 17 | path "*.tab", emit: log_tab 18 | path("versions.yml"), emit: versions 19 | 20 | script: 21 | def args = task.ext.args ?: '' 22 | def args2 = task.ext.args2 ?: '' 23 | """ 24 | ClusterSets.py set --nproc ${task.cpus} -s $R1 --outname ${meta.id}_R1 $args --log ${meta.id}_R1.log > ${meta.id}_command_log.txt 25 | ClusterSets.py set --nproc ${task.cpus} -s $R2 --outname ${meta.id}_R2 $args --log ${meta.id}_R2.log >> ${meta.id}_command_log.txt 26 | ParseLog.py -l ${meta.id}_R1.log ${meta.id}_R2.log $args2 27 | 28 | cat <<-END_VERSIONS > versions.yml 29 | "${task.process}": 30 | presto: \$( ClusterSets.py --version | awk -F' ' '{print \$2}' ) 31 | vsearch: \$( vsearch --version &> vsearch.txt; cat vsearch.txt | head -n 1 | grep -o 'v[0-9\\.]\\+' ) 32 | END_VERSIONS 33 | """ 34 | } 35 | -------------------------------------------------------------------------------- /modules/local/presto/presto_collapseseq.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_COLLAPSESEQ { 2 | tag "$meta.id" 3 | label "process_medium" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(reads) 13 | 14 | output: 15 | tuple val(meta), path("*_collapse-unique.fastq") , emit: reads 16 | path("*_command_log.txt") , emit: logs 17 | path("*_table.tab") 18 | path("versions.yml"), emit: versions 19 | 20 | 21 | 22 | script: 23 | def args = task.ext.args ?: '' 24 | def args2 = task.ext.args2 ?: '' 25 | """ 26 | CollapseSeq.py -s $reads $args --outname ${meta.id} --log ${meta.id}.log > ${meta.id}_command_log.txt 27 | ParseLog.py -l ${meta.id}.log $args2 28 | 29 | cat <<-END_VERSIONS > versions.yml 30 | "${task.process}": 31 | presto: \$( CollapseSeq.py --version | awk -F' ' '{print \$2}' ) 32 | END_VERSIONS 33 | """ 34 | } 35 | -------------------------------------------------------------------------------- /modules/local/presto/presto_filterseq.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_FILTERSEQ { 2 | tag "$meta.id" 3 | label "process_medium" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(R1), path(R2) 13 | 14 | output: 15 | tuple val(meta), path("*R1_quality-pass.fastq"), path("*R2_quality-pass.fastq") , emit: reads 16 | path "*_command_log_R?.txt" , emit: logs 17 | path "versions.yml" , emit: versions 18 | path "*.tab" , emit: log_tab 19 | 20 | script: 21 | """ 22 | FilterSeq.py quality -s $R1 -q ${params.filterseq_q} --outname ${meta.id}_R1 --log ${R1.baseName}_R1.log --nproc ${task.cpus} > ${meta.id}_command_log_R1.txt 23 | FilterSeq.py quality -s $R2 -q ${params.filterseq_q} --outname ${meta.id}_R2 --log ${R2.baseName}_R2.log --nproc ${task.cpus} >> ${meta.id}_command_log_R2.txt 24 | ParseLog.py -l ${R1.baseName}_R1.log ${R2.baseName}_R2.log -f ID QUALITY 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | presto: \$( FilterSeq.py --version | awk -F' ' '{print \$2}' ) 29 | END_VERSIONS 30 | """ 31 | } 32 | -------------------------------------------------------------------------------- /modules/local/presto/presto_filterseq_postassembly.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_FILTERSEQ_POSTASSEMBLY { 2 | tag "$meta.id" 3 | label "process_medium" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(reads) 13 | 14 | output: 15 | tuple val(meta), path("*quality-pass.fastq") , emit: reads 16 | path "*_command_log.txt" , emit: logs 17 | path "versions.yml" , emit: versions 18 | path "*.tab" , emit: log_tab 19 | 20 | script: 21 | """ 22 | FilterSeq.py quality -s $reads -q ${params.filterseq_q} --outname ${meta.id} --log ${reads.baseName}.log --nproc ${task.cpus} > ${meta.id}_command_log.txt 23 | ParseLog.py -l ${reads.baseName}.log -f ID QUALITY 24 | 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | presto: \$( FilterSeq.py --version | awk -F' ' '{print \$2}' ) 28 | END_VERSIONS 29 | """ 30 | } 31 | -------------------------------------------------------------------------------- /modules/local/presto/presto_maskprimers_align.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_MASKPRIMERS_ALIGN { 2 | tag "$meta.id" 3 | label "process_high" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(R1) 13 | path(primers) 14 | val(max_len) 15 | val(barcode) 16 | val(max_error) 17 | val(mask_mode) 18 | val(reverse_primers) 19 | val(suffix) 20 | 21 | output: 22 | tuple val(meta), path("*_primers-pass.fastq") , emit: reads 23 | path "*.txt", emit: logs 24 | path "*.tab", emit: log_tab 25 | path "versions.yml" , emit: versions 26 | 27 | script: 28 | def barcode = barcode ? '--barcode' : '' 29 | def revpr = reverse_primers ? '--revpr' : '' 30 | def args = task.ext.args?: '' 31 | def args2 = task.ext.args2?: '' 32 | """ 33 | MaskPrimers.py align --nproc ${task.cpus} \\ 34 | -s $R1 \\ 35 | -p ${primers} \\ 36 | --maxlen ${max_len} \\ 37 | --maxerror ${max_error} \\ 38 | --mode ${mask_mode} \\ 39 | $barcode \\ 40 | $args \\ 41 | --outname ${meta.id}_${suffix} \\ 42 | --log ${meta.id}_${suffix}.log > ${meta.id}_command_log_${suffix}.txt 43 | ParseLog.py -l ${meta.id}_${suffix}.log $args2 44 | 45 | cat <<-END_VERSIONS > versions.yml 46 | "${task.process}": 47 | presto: \$( MaskPrimers.py --version | awk -F' ' '{print \$2}' ) 48 | END_VERSIONS 49 | """ 50 | } 51 | -------------------------------------------------------------------------------- /modules/local/presto/presto_maskprimers_extract.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_MASKPRIMERS_EXTRACT { 2 | tag "$meta.id" 3 | label "process_high" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(read) 13 | val(extract_start) 14 | val(extract_length) 15 | val(extract_mode) 16 | val(barcode) 17 | val(suffix) 18 | 19 | output: 20 | tuple val(meta), path("*_primers-pass.fastq") , emit: reads 21 | path "*.txt", emit: logs 22 | path "*.tab", emit: log_tab 23 | path "versions.yml" , emit: versions 24 | 25 | script: 26 | def args = task.ext.args?: '' 27 | def args2 = task.ext.args2?: '' 28 | def barcode = barcode ? '--barcode' : '' 29 | """ 30 | MaskPrimers.py extract \\ 31 | --nproc ${task.cpus} \\ 32 | -s $read \\ 33 | --start ${extract_start} \\ 34 | --len ${extract_length} \\ 35 | $barcode \\ 36 | $args \\ 37 | --mode ${extract_mode} \\ 38 | --outname ${meta.id}_${suffix} \\ 39 | --log ${meta.id}_${suffix}.log >> ${meta.id}_command_log_${suffix}.txt 40 | ParseLog.py -l *.log $args2 41 | 42 | cat <<-END_VERSIONS > versions.yml 43 | "${task.process}": 44 | presto: \$( MaskPrimers.py --version | awk -F' ' '{print \$2}' ) 45 | END_VERSIONS 46 | """ 47 | } 48 | -------------------------------------------------------------------------------- /modules/local/presto/presto_maskprimers_score.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_MASKPRIMERS_SCORE { 2 | tag "$meta.id" 3 | label "process_high" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(read) 13 | path(primers) 14 | val(primer_start) 15 | val(barcode) 16 | val(primer_maxerror) 17 | val(primer_mask_mode) 18 | val(reverse_primers) 19 | val(suffix) 20 | 21 | output: 22 | tuple val(meta), path("*_primers-pass.fastq"), emit: reads 23 | path "*.txt", emit: logs 24 | path "*.tab", emit: log_tab 25 | path "versions.yml" , emit: versions 26 | 27 | 28 | script: 29 | def args = task.ext.args?: '' 30 | def args2 = task.ext.args2?: '' 31 | def revpr = reverse_primers ? '--revpr' : '' 32 | def barcode = barcode ? '--barcode' : '' 33 | """ 34 | MaskPrimers.py score \\ 35 | --nproc ${task.cpus} \\ 36 | -s $read \\ 37 | -p ${primers} \\ 38 | --maxerror ${primer_maxerror} \\ 39 | --mode ${primer_mask_mode} \\ 40 | --start ${primer_start} \\ 41 | $barcode $revpr \\ 42 | $args \\ 43 | --outname ${meta.id}_${suffix} \\ 44 | --log ${meta.id}_${suffix}.log > ${meta.id}_command_log_${suffix}.txt 45 | ParseLog.py -l *.log $args2 46 | 47 | cat <<-END_VERSIONS > versions.yml 48 | "${task.process}": 49 | presto: \$( MaskPrimers.py --version | awk -F' ' '{print \$2}' ) 50 | END_VERSIONS 51 | """ 52 | } 53 | -------------------------------------------------------------------------------- /modules/local/presto/presto_pairseq.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_PAIRSEQ { 2 | tag "$meta.id" 3 | label "process_low" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path("${meta.id}_R1.fastq"), path("${meta.id}_R2.fastq") 13 | val(barcode_position) 14 | 15 | output: 16 | tuple val(meta), path("*R1_pair-pass.fastq"), path("*R2_pair-pass.fastq") , emit: reads 17 | path "*_command_log.txt", emit: logs 18 | path "versions.yml" , emit: versions 19 | 20 | script: 21 | def copyfield = (barcode_position == 'R1')? '--1f BARCODE' : (barcode_position == 'R2')? '--2f BARCODE' : (barcode_position == 'R1R2')? '--1f BARCODE --2f BARCODE' : (barcode_position == 'clustersets')? '--1f CLUSTER --2f CLUSTER' : '' 22 | def args = task.ext.args?: '' 23 | """ 24 | PairSeq.py -1 ${meta.id}_R1.fastq -2 ${meta.id}_R2.fastq $copyfield $args > ${meta.id}_command_log.txt 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | presto: \$( PairSeq.py --version | awk -F' ' '{print \$2}' ) 29 | END_VERSIONS 30 | """ 31 | } 32 | -------------------------------------------------------------------------------- /modules/local/presto/presto_parse_cluster.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_PARSE_CLUSTER { 2 | tag "$meta.id" 3 | label "process_low" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(R1), path(R2) 13 | 14 | output: 15 | tuple val(meta), path("*R1_cluster-pass_reheader.fastq"), path("*R2_cluster-pass_reheader.fastq"), emit: reads 16 | path("*_log.txt"), emit: logs 17 | path "versions.yml" , emit: versions 18 | 19 | 20 | script: 21 | """ 22 | ParseHeaders.py copy -s $R1 -f BARCODE -k CLUSTER --act cat > ${meta.id}_command_log.txt 23 | ParseHeaders.py copy -s $R2 -f BARCODE -k CLUSTER --act cat >> ${meta.id}_command_log.txt 24 | 25 | cat <<-END_VERSIONS > versions.yml 26 | "${task.process}": 27 | presto: \$( ParseHeaders.py --version | awk -F' ' '{print \$2}' ) 28 | END_VERSIONS 29 | """ 30 | } 31 | -------------------------------------------------------------------------------- /modules/local/presto/presto_parseheaders.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_PARSEHEADERS { 2 | tag "$meta.id" 3 | label "process_low" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(reads) 13 | 14 | output: 15 | tuple val(meta), path("*_reheader-pass.fastq"), emit: reads 16 | path "versions.yml" , emit: versions 17 | 18 | script: 19 | def subcommand = task.ext.subcommand?: '' 20 | def args = task.ext.args?: '' 21 | """ 22 | ParseHeaders.py $subcommand -s $reads -o ${reads.baseName}_reheader-pass.fastq $args 23 | 24 | cat <<-END_VERSIONS > versions.yml 25 | "${task.process}": 26 | presto: \$( ParseHeaders.py --version | awk -F' ' '{print \$2}' ) 27 | END_VERSIONS 28 | """ 29 | } 30 | -------------------------------------------------------------------------------- /modules/local/presto/presto_parseheaders_metadata.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_PARSEHEADERS_METADATA { 2 | tag "$meta.id" 3 | label "process_low" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(reads) 13 | 14 | output: 15 | tuple val(meta), path("*_reheader-pass.fastq"), emit: reads 16 | path "versions.yml" , emit: versions 17 | 18 | script: 19 | def args = task.ext.args ?: '' 20 | """ 21 | ParseHeaders.py add -s $reads -o ${reads.baseName}_reheader-pass.fastq $args -u ${meta.id} ${meta.subject_id} ${meta.species} ${meta.locus} 22 | 23 | cat <<-END_VERSIONS > versions.yml 24 | "${task.process}": 25 | presto: \$( ParseHeaders.py --version | awk -F' ' '{print \$2}' ) 26 | END_VERSIONS 27 | """ 28 | } 29 | -------------------------------------------------------------------------------- /modules/local/presto/presto_parseheaders_primers.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_PARSEHEADERS_PRIMERS { 2 | tag "$meta.id" 3 | label "process_low" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(reads) 13 | 14 | output: 15 | tuple val(meta), path("*_reheader-pass.fastq"), emit: reads 16 | path "versions.yml" , emit: versions 17 | 18 | script: 19 | def args = task.ext.args ?: '' 20 | if (params.cprimer_position == "R1") { 21 | """ 22 | ParseHeaders.py copy -s $reads -o ${reads.baseName}_reheader-pass.fastq -f $args --act first last -k C_PRIMER V_PRIMER 23 | 24 | cat <<-END_VERSIONS > versions.yml 25 | "${task.process}": 26 | presto: \$( ParseHeaders.py --version | awk -F' ' '{print \$2}' ) 27 | END_VERSIONS 28 | """ 29 | } else if (params.cprimer_position == "R2") { 30 | """ 31 | ParseHeaders.py copy -s $reads -o ${reads.baseName}_reheader-pass.fastq -f $args --act first last -k V_PRIMER C_PRIMER 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | presto: \$( ParseHeaders.py --version | awk -F' ' '{print \$2}' ) 36 | END_VERSIONS 37 | """ 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /modules/local/presto/presto_postconsensus_pairseq.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_POSTCONSENSUS_PAIRSEQ { 2 | tag "$meta.id" 3 | label "process_low" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path("${meta.id}_R1.fastq"), path("${meta.id}_R2.fastq") 13 | 14 | output: 15 | tuple val(meta), path("*R1_pair-pass.fastq"), path("*R2_pair-pass.fastq") , emit: reads 16 | path "*_command_log.txt", emit: logs 17 | path "versions.yml" , emit: versions 18 | 19 | script: 20 | """ 21 | PairSeq.py -1 ${meta.id}_R1.fastq -2 ${meta.id}_R2.fastq --coord presto > ${meta.id}_command_log.txt 22 | 23 | cat <<-END_VERSIONS > versions.yml 24 | "${task.process}": 25 | presto: \$( PairSeq.py --version | awk -F' ' '{print \$2}' ) 26 | END_VERSIONS 27 | """ 28 | } 29 | -------------------------------------------------------------------------------- /modules/local/presto/presto_splitseq.nf: -------------------------------------------------------------------------------- 1 | process PRESTO_SPLITSEQ { 2 | tag "$meta.id" 3 | label "process_low" 4 | label 'immcantation' 5 | 6 | conda "bioconda::presto=0.7.4" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/presto:0.7.4--pyhdfd78af_0' : 9 | 'biocontainers/presto:0.7.4--pyhdfd78af_0' }" 10 | 11 | input: 12 | tuple val(meta), path(reads) 13 | 14 | output: 15 | tuple val(meta), path("${meta.id}_atleast-*.fasta"), emit: fasta 16 | path("*_command_log.txt"), emit: logs 17 | path "versions.yml" , emit: versions 18 | 19 | script: 20 | def args = task.ext.args ?: '' 21 | """ 22 | SplitSeq.py group -s $reads \\ 23 | $args \\ 24 | --outname ${meta.id} \\ 25 | --fasta > ${meta.id}_command_log.txt 26 | 27 | cat <<-END_VERSIONS > versions.yml 28 | "${task.process}": 29 | presto: \$( SplitSeq.py --version | awk -F' ' '{print \$2}' ) 30 | END_VERSIONS 31 | """ 32 | } 33 | -------------------------------------------------------------------------------- /modules/local/rename_fastq.nf: -------------------------------------------------------------------------------- 1 | // Import generic module functions 2 | process RENAME_FASTQ { 3 | tag "$meta.id" 4 | label 'process_low' 5 | 6 | conda "conda-forge::biopython=1.81" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/biopython:1.81' : 9 | 'biocontainers/biopython:1.81' }" 10 | 11 | input: 12 | tuple val(meta), path(R1), path(R2) 13 | 14 | output: 15 | tuple val(meta), path('*_R1.fastq.gz'), path('*_R2.fastq.gz') , emit: reads 16 | 17 | script: 18 | """ 19 | mv "${R1}" "${meta.id}_R1.fastq.gz" 20 | mv "${R2}" "${meta.id}_R2.fastq.gz" 21 | """ 22 | } 23 | -------------------------------------------------------------------------------- /modules/local/rename_file.nf: -------------------------------------------------------------------------------- 1 | // Import generic module functions 2 | process RENAME_FILE { 3 | tag "$meta.id" 4 | label 'process_low' 5 | 6 | conda "conda-forge::biopython=1.81" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'https://depot.galaxyproject.org/singularity/biopython:1.81' : 9 | 'biocontainers/biopython:1.81' }" 10 | 11 | input: 12 | tuple val(meta), path(file) 13 | 14 | output: 15 | tuple val(meta), path("${meta.id}.${file.extension}") , emit: file 16 | 17 | script: 18 | """ 19 | mv ${file} ${meta.id}.${file.extension} 20 | """ 21 | } 22 | -------------------------------------------------------------------------------- /modules/local/reveal/add_meta_to_tab.nf: -------------------------------------------------------------------------------- 1 | process ADD_META_TO_TAB { 2 | tag "$meta.id" 3 | label 'immcantation' 4 | label 'process_single' 5 | 6 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 7 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 8 | } 9 | container "docker.io/immcantation/airrflow:4.3.0" 10 | 11 | cache 'deep' // Without 'deep' this process would run when using -resume 12 | 13 | input: 14 | tuple val(meta), path(tab) // sequence tsv in AIRR format 15 | path(validated_input) 16 | 17 | output: 18 | tuple val(meta), path("*meta-pass.tsv"), emit: tab // sequence tsv in AIRR format 19 | path("*_command_log.txt"), emit: logs //process logs 20 | path "versions.yml", emit: versions 21 | 22 | script: 23 | """ 24 | reveal_add_metadata.R --repertoire ${tab} --metadata ${validated_input} --input_id ${meta.id} --outname ${meta.id} > ${meta.id}_add-meta_command_log.txt 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | dplyr: \$(Rscript -e "library(dplyr); cat(paste(packageVersion('dplyr'), collapse='.'))") 29 | optparse: \$(Rscript -e "library(optparse); cat(paste(packageVersion('optparse'), collapse='.'))") 30 | R: \$(echo \$(R --version 2>&1) | awk -F' ' '{print \$3}') 31 | END_VERSIONS 32 | """ 33 | } 34 | -------------------------------------------------------------------------------- /modules/local/reveal/filter_junction_mod3.nf: -------------------------------------------------------------------------------- 1 | process FILTER_JUNCTION_MOD3 { 2 | tag "$meta.id" 3 | label 'immcantation' 4 | label 'process_single' 5 | 6 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 7 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 8 | } 9 | container "docker.io/immcantation/airrflow:4.3.0" 10 | 11 | input: 12 | tuple val(meta), path(tab) // sequence tsv in AIRR format 13 | 14 | output: 15 | tuple val(meta), path("*junction-pass.tsv"), emit: tab // sequence tsv in AIRR format 16 | path("*_command_log.txt"), emit: logs //process logs 17 | path "versions.yml", emit: versions 18 | 19 | script: 20 | """ 21 | reveal_mod_3_junction.R --repertoire $tab --outname ${meta.id} > ${meta.id}_jmod3_command_log.txt 22 | 23 | cat <<-END_VERSIONS > versions.yml 24 | "${task.process}": 25 | alakazam: \$(Rscript -e "library(alakazam); cat(paste(packageVersion('alakazam'), collapse='.'))") 26 | optparse: \$(Rscript -e "library(optparse); cat(paste(packageVersion('optparse'), collapse='.'))") 27 | airr: \$(Rscript -e "library(airr); cat(paste(packageVersion('airr'), collapse='.'))") 28 | R: \$(echo \$(R --version 2>&1) | awk -F' ' '{print \$3}') 29 | END_VERSIONS 30 | """ 31 | } 32 | -------------------------------------------------------------------------------- /modules/local/reveal/filter_quality.nf: -------------------------------------------------------------------------------- 1 | process FILTER_QUALITY { 2 | tag "$meta.id" 3 | label 'immcantation' 4 | label 'process_single' 5 | 6 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 7 | error "nf-core/airrflow currently does not support Conda. Please use a container profile instead." 8 | } 9 | container "docker.io/immcantation/airrflow:4.3.0" 10 | 11 | input: 12 | tuple val(meta), path(tab) // sequence tsv in AIRR format 13 | 14 | output: 15 | tuple val(meta), path("*quality-pass.tsv"), emit: tab // sequence tsv in AIRR format 16 | path("*_command_log.txt"), emit: logs //process logs 17 | path "versions.yml", emit: versions 18 | 19 | script: 20 | """ 21 | reveal_filter_quality.R --repertoire $tab --outname ${meta.id} > ${meta.id}_fq_command_log.txt 22 | 23 | cat <<-END_VERSIONS > versions.yml 24 | "${task.process}": 25 | alakazam: \$(Rscript -e "library(alakazam); cat(paste(packageVersion('alakazam'), collapse='.'))") 26 | optparse: \$(Rscript -e "library(optparse); cat(paste(packageVersion('optparse'), collapse='.'))") 27 | stringi: \$(Rscript -e "library(stringi); cat(paste(packageVersion('stringi'), collapse='.'))") 28 | dplyr: \$(Rscript -e "library(dplyr); cat(paste(packageVersion('dplyr'), collapse='.'))") 29 | airr: \$(Rscript -e "library(airr); cat(paste(packageVersion('airr'), collapse='.'))") 30 | DT: \$(Rscript -e "library(DT); cat(paste(packageVersion('DT'), collapse='.'))") 31 | R: \$(echo \$(R --version 2>&1) | awk -F' ' '{print \$3}') 32 | END_VERSIONS 33 | """ 34 | } 35 | -------------------------------------------------------------------------------- /modules/local/samplesheet_check.nf: -------------------------------------------------------------------------------- 1 | process SAMPLESHEET_CHECK { 2 | tag "$samplesheet" 3 | label 'process_single' 4 | 5 | conda "conda-forge::pandas=1.5.3" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/pandas:1.1.5' : 8 | 'biocontainers/pandas:1.1.5' }" 9 | 10 | input: 11 | path samplesheet 12 | 13 | output: 14 | path '*.tsv', emit: tsv 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/airrflow/bin/ 21 | def args = task.ext.args ?: '' 22 | """ 23 | check_samplesheet.py $samplesheet $args 24 | cp $samplesheet samplesheet.valid.tsv 25 | 26 | cat <<-END_VERSIONS > versions.yml 27 | "${task.process}": 28 | python: \$( echo \$(python --version | grep -o "[0-9\\. ]\\+") ) 29 | pandas: \$(echo \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('pandas').version)")) 30 | END_VERSIONS 31 | """ 32 | } 33 | -------------------------------------------------------------------------------- /modules/local/unzip_cellrangerdb.nf: -------------------------------------------------------------------------------- 1 | process UNZIP_CELLRANGERDB { 2 | tag "unzip_cellrangerdb" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 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 | path(archive) 12 | 13 | output: 14 | path("$unzipped") , emit: unzipped 15 | path "versions.yml", emit: versions 16 | 17 | script: 18 | unzipped = archive.toString() - '.tar.gz' 19 | """ 20 | echo "${unzipped}" 21 | 22 | tar -xzvf ${archive} 23 | 24 | cat <<-END_VERSIONS > versions.yml 25 | "${task.process}": 26 | unzip_cellrangerdb: \$(echo \$(tar --version 2>&1 | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//') 27 | END_VERSIONS 28 | """ 29 | } 30 | -------------------------------------------------------------------------------- /modules/local/unzip_db.nf: -------------------------------------------------------------------------------- 1 | process UNZIP_DB { 2 | tag "unzip_db" 3 | label 'process_medium' 4 | 5 | conda "conda-forge::sed=4.7" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' : 8 | 'docker.io/biocontainers/biocontainers:v1.2.0_cv1' }" 9 | 10 | input: 11 | path(archive) 12 | 13 | output: 14 | path("$unzipped") , emit: unzipped 15 | path "versions.yml", emit: versions 16 | 17 | script: 18 | unzipped = archive.toString() - '.zip' 19 | """ 20 | unzip $archive 21 | 22 | cat <<-END_VERSIONS > versions.yml 23 | "${task.process}": 24 | unzip: \$(echo \$(unzip -help 2>&1) | sed 's/^.*UnZip //; s/ of.*\$//') 25 | END_VERSIONS 26 | """ 27 | } 28 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/antiberta2/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - "bioconda::amulety=1.1" 8 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/antiberta2/main.nf: -------------------------------------------------------------------------------- 1 | process AMULETY_ANTIBERTA2 { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | label 'process_gpu' 5 | 6 | conda "${moduleDir}/environment.yml" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'oras://community.wave.seqera.io/library/amulety_igblast:b2a7736f645c40e5': 9 | 'community.wave.seqera.io/library/amulety_igblast:659eaa872785adeb' }" 10 | 11 | input: 12 | tuple val(meta), path(tsv) 13 | val(chain) 14 | 15 | output: 16 | tuple val(meta), path("*.tsv"), emit: embedding 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 | TRANSFORMERS_CACHE="./cache" amulety \\ 27 | antiberta2 \\ 28 | $args \\ 29 | --cache-dir ./cache \\ 30 | $tsv \\ 31 | $chain \\ 32 | ${prefix}.tsv 33 | 34 | cat <<-END_VERSIONS > versions.yml 35 | "${task.process}": 36 | amulety: \$( amulety --help 2>&1 | grep -o "version [0-9\\.]\\+" | grep -o "[0-9\\.]\\+" ) 37 | END_VERSIONS 38 | """ 39 | 40 | stub: 41 | def args = task.ext.args ?: '' 42 | def prefix = task.ext.prefix ?: "${meta.id}" 43 | """ 44 | touch ${prefix}.tsv 45 | 46 | cat <<-END_VERSIONS > versions.yml 47 | "${task.process}": 48 | amulety: \$( amulety --help 2>&1 | grep -o "version [0-9\\.]\\+" | grep -o "[0-9\\.]\\+" ) 49 | END_VERSIONS 50 | """ 51 | } 52 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/antiberta2/meta.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json 3 | name: "amulety_antiberta2" 4 | description: A module to create antiberta2 embeddings of antibody (BCR) amino acid sequences using amulety. 5 | keywords: 6 | - embeddings 7 | - BCR 8 | - antibody 9 | - GPU-accelerated 10 | - immunoinformatics 11 | - immunology 12 | tools: 13 | - "amulety": 14 | description: "Python package to create embeddings of BCR and TCR amino acid sequences." 15 | homepage: "https://amulety.readthedocs.io/en/latest/" 16 | documentation: "https://amulety.readthedocs.io/en/latest/" 17 | tool_dev_url: "https://github.com/immcantation/amulety" 18 | doi: "10.1101/2025.03.21.644583" 19 | licence: ['GPL v3'] 20 | 21 | input: 22 | - - meta: 23 | type: map 24 | description: | 25 | Groovy Map containing sample information 26 | e.g. `[ id:'sample1', single_end:false ]` 27 | - tsv: 28 | type: file 29 | description: TSV with BCR/TCR nucleotide sequences in AIRR rearrangement format 30 | pattern: "*.{tsv}" 31 | - - chain: 32 | type: string 33 | description: | 34 | The chain to use for the embeddings. Can be either 'H' (heavy) or 'HL' (heavy + light, for single-cell data). 35 | 36 | output: 37 | - embedding: 38 | - meta: 39 | type: map 40 | description: | 41 | Groovy Map containing sample information 42 | e.g. `[ id:'sample1', single_end:false ]` 43 | - "*.tsv": 44 | type: file 45 | description: TSV with antiberta2 embeddings. 46 | pattern: "*.tsv" 47 | 48 | - versions: 49 | - "versions.yml": 50 | type: file 51 | description: File containing software versions 52 | pattern: "versions.yml" 53 | 54 | authors: 55 | - "@ggabernet" 56 | maintainers: 57 | - "@ggabernet" 58 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/antiberta2/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | cpus = 1 // Needed for deterministic results 3 | } 4 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/antiberty/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - "bioconda::amulety=1.1" 8 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/antiberty/main.nf: -------------------------------------------------------------------------------- 1 | process AMULETY_ANTIBERTY { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | label 'process_gpu' 5 | 6 | conda "${moduleDir}/environment.yml" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'oras://community.wave.seqera.io/library/amulety_igblast:b2a7736f645c40e5': 9 | 'community.wave.seqera.io/library/amulety_igblast:659eaa872785adeb' }" 10 | 11 | input: 12 | tuple val(meta), path(tsv) 13 | val(chain) 14 | 15 | output: 16 | tuple val(meta), path("*.tsv"), emit: embedding 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 | amulety \\ 27 | antiberty \\ 28 | $args \\ 29 | $tsv \\ 30 | $chain \\ 31 | ${prefix}.tsv 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | amulety: \$( amulety --help 2>&1 | grep -o "version [0-9\\.]\\+" | grep -o "[0-9\\.]\\+" ) 36 | END_VERSIONS 37 | """ 38 | 39 | stub: 40 | def args = task.ext.args ?: '' 41 | def prefix = task.ext.prefix ?: "${meta.id}" 42 | """ 43 | touch ${prefix}.tsv 44 | 45 | cat <<-END_VERSIONS > versions.yml 46 | "${task.process}": 47 | amulety: \$( amulety --help 2>&1 | grep -o "version [0-9\\.]\\+" | grep -o "[0-9\\.]\\+" ) 48 | END_VERSIONS 49 | """ 50 | } 51 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/antiberty/meta.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json 3 | name: "amulety_antiberty" 4 | description: A module to create antiberty embeddings of antibody (BCR) amino acid sequences using amulety. 5 | keywords: 6 | - embeddings 7 | - BCR 8 | - antibody 9 | - GPU-accelerated 10 | - immunoinformatics 11 | - immunology 12 | tools: 13 | - "amulety": 14 | description: "Python package to create embeddings of BCR and TCR amino acid sequences." 15 | homepage: "https://amulety.readthedocs.io/en/latest/" 16 | documentation: "https://amulety.readthedocs.io/en/latest/" 17 | tool_dev_url: "https://github.com/immcantation/amulety" 18 | doi: "10.1101/2025.03.21.644583" 19 | licence: ['GPL v3'] 20 | 21 | input: 22 | - - meta: 23 | type: map 24 | description: | 25 | Groovy Map containing sample information 26 | e.g. `[ id:'sample1', single_end:false ]` 27 | - tsv: 28 | type: file 29 | description: TSV with BCR/TCR nucleotide sequences in AIRR rearrangement format 30 | pattern: "*.{tsv}" 31 | - - chain: 32 | type: string 33 | description: | 34 | The chain to use for the embeddings. Can be either 'H' (heavy) or 'HL' (heavy + light, for single-cell data). 35 | 36 | output: 37 | - embedding: 38 | - meta: 39 | type: map 40 | description: | 41 | Groovy Map containing sample information 42 | e.g. `[ id:'sample1', single_end:false ]` 43 | - "*.tsv": 44 | type: file 45 | description: TSV with Antiberty embeddings. 46 | pattern: "*.tsv" 47 | 48 | - versions: 49 | - "versions.yml": 50 | type: file 51 | description: File containing software versions 52 | pattern: "versions.yml" 53 | 54 | authors: 55 | - "@ggabernet" 56 | maintainers: 57 | - "@ggabernet" 58 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/antiberty/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | cpus = 1 // Needed for deterministic results 3 | } 4 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/balmpaired/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - "bioconda::amulety=1.1" 8 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/balmpaired/main.nf: -------------------------------------------------------------------------------- 1 | process AMULETY_BALMPAIRED { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | label 'process_gpu' 5 | 6 | conda "${moduleDir}/environment.yml" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'oras://community.wave.seqera.io/library/amulety_wget:d69a2bc09a42a8b2': 9 | 'community.wave.seqera.io/library/amulety_wget:2ecd2554d8d6f58e' }" 10 | 11 | input: 12 | tuple val(meta), path(tsv) 13 | val(chain) 14 | 15 | output: 16 | tuple val(meta), path("*.tsv"), emit: embedding 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 | TRANSFORMERS_CACHE="./cache" amulety \\ 27 | balm-paired \\ 28 | $args \\ 29 | $tsv \\ 30 | $chain \\ 31 | ${prefix}.tsv 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | amulety: \$( amulety --help 2>&1 | grep -o "version [0-9\\.]\\+" | grep -o "[0-9\\.]\\+" ) 36 | END_VERSIONS 37 | """ 38 | 39 | stub: 40 | def args = task.ext.args ?: '' 41 | def prefix = task.ext.prefix ?: "${meta.id}" 42 | """ 43 | touch ${prefix}.tsv 44 | 45 | cat <<-END_VERSIONS > versions.yml 46 | "${task.process}": 47 | amulety: \$( amulety --help 2>&1 | grep -o "version [0-9\\.]\\+" | grep -o "[0-9\\.]\\+" ) 48 | END_VERSIONS 49 | """ 50 | } 51 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/balmpaired/meta.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json 3 | name: "amulety_balmpaired" 4 | description: A module to create BALM paired embeddings of antibody (BCR) amino acid sequences using amulety. 5 | keywords: 6 | - embeddings 7 | - BCR 8 | - antibody 9 | - GPU-accelerated 10 | - immunoinformatics 11 | - immunology 12 | tools: 13 | - "amulety": 14 | description: "Python package to create embeddings of BCR and TCR amino acid sequences." 15 | homepage: "https://amulety.readthedocs.io/en/latest/" 16 | documentation: "https://amulety.readthedocs.io/en/latest/" 17 | tool_dev_url: "https://github.com/immcantation/amulety" 18 | doi: "10.1101/2025.03.21.644583" 19 | licence: ['GPL v3'] 20 | 21 | input: 22 | - - meta: 23 | type: map 24 | description: | 25 | Groovy Map containing sample information 26 | e.g. `[ id:'sample1', single_end:false ]` 27 | - tsv: 28 | type: file 29 | description: TSV with BCR/TCR nucleotide sequences in AIRR rearrangement format 30 | pattern: "*.{tsv}" 31 | - - chain: 32 | type: string 33 | description: | 34 | The chain to use for the embeddings. Can be either 'H' (heavy) or 'HL' (heavy + light, for single-cell data). 35 | 36 | output: 37 | - embedding: 38 | - meta: 39 | type: map 40 | description: | 41 | Groovy Map containing sample information 42 | e.g. `[ id:'sample1', single_end:false ]` 43 | - "*.tsv": 44 | type: file 45 | description: TSV with BALM paired embeddings. 46 | pattern: "*.tsv" 47 | 48 | - versions: 49 | - "versions.yml": 50 | type: file 51 | description: File containing software versions 52 | pattern: "versions.yml" 53 | 54 | authors: 55 | - "@ggabernet" 56 | maintainers: 57 | - "@ggabernet" 58 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/balmpaired/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | cpus = 1 // Needed for deterministic results 3 | } 4 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/esm2/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - "bioconda::amulety=1.1" 8 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/esm2/main.nf: -------------------------------------------------------------------------------- 1 | process AMULETY_ESM2 { 2 | tag "$meta.id" 3 | label 'process_medium' 4 | label 'process_gpu' 5 | 6 | conda "${moduleDir}/environment.yml" 7 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 8 | 'oras://community.wave.seqera.io/library/amulety_igblast:b2a7736f645c40e5': 9 | 'community.wave.seqera.io/library/amulety_igblast:659eaa872785adeb' }" 10 | 11 | input: 12 | tuple val(meta), path(tsv) 13 | val(chain) 14 | 15 | output: 16 | tuple val(meta), path("*.tsv"), emit: embedding 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 | TRANSFORMERS_CACHE="./cache" amulety \\ 27 | esm2 \\ 28 | $args \\ 29 | $tsv \\ 30 | $chain \\ 31 | ${prefix}.tsv 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | amulety: \$( amulety --help 2>&1 | grep -o "version [0-9\\.]\\+" | grep -o "[0-9\\.]\\+" ) 36 | END_VERSIONS 37 | """ 38 | 39 | stub: 40 | def args = task.ext.args ?: '' 41 | def prefix = task.ext.prefix ?: "${meta.id}" 42 | """ 43 | touch ${prefix}.tsv 44 | 45 | cat <<-END_VERSIONS > versions.yml 46 | "${task.process}": 47 | amulety: \$( amulety --help 2>&1 | grep -o "version [0-9\\.]\\+" | grep -o "[0-9\\.]\\+" ) 48 | END_VERSIONS 49 | """ 50 | } 51 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/esm2/meta.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json 3 | name: "amulety_esm2" 4 | description: A module to create esm2 embeddings of antibody (BCR) amino acid sequences using amulety. 5 | keywords: 6 | - embeddings 7 | - BCR 8 | - antibody 9 | - GPU-accelerated 10 | - immunoinformatics 11 | - immunology 12 | tools: 13 | - "amulety": 14 | description: "Python package to create embeddings of BCR and TCR amino acid sequences." 15 | homepage: "https://amulety.readthedocs.io/en/latest/" 16 | documentation: "https://amulety.readthedocs.io/en/latest/" 17 | tool_dev_url: "https://github.com/immcantation/amulety" 18 | doi: "10.1101/2025.03.21.644583" 19 | licence: ['GPL v3'] 20 | 21 | input: 22 | - - meta: 23 | type: map 24 | description: | 25 | Groovy Map containing sample information 26 | e.g. `[ id:'sample1', single_end:false ]` 27 | - tsv: 28 | type: file 29 | description: TSV with BCR/TCR nucleotide sequences in AIRR rearrangement format 30 | pattern: "*.{tsv}" 31 | - - chain: 32 | type: string 33 | description: | 34 | The chain to use for the embeddings. Can be either 'H' (heavy) or 'HL' (heavy + light, for single-cell data). 35 | 36 | output: 37 | - embedding: 38 | - meta: 39 | type: map 40 | description: | 41 | Groovy Map containing sample information 42 | e.g. `[ id:'sample1', single_end:false ]` 43 | - "*.tsv": 44 | type: file 45 | description: TSV with esm2 embeddings. 46 | pattern: "*.tsv" 47 | 48 | - versions: 49 | - "versions.yml": 50 | type: file 51 | description: File containing software versions 52 | pattern: "versions.yml" 53 | 54 | authors: 55 | - "@ggabernet" 56 | maintainers: 57 | - "@ggabernet" 58 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/esm2/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | cpus = 1 // Needed for deterministic results 3 | 4 | withName: AMULETY_ESM2{ 5 | ext.args = '--batch-size 20' 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/translate/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - "bioconda::amulety=1.0" 8 | - "bioconda::igblast=1.22.0" 9 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/translate/main.nf: -------------------------------------------------------------------------------- 1 | process AMULETY_TRANSLATE { 2 | tag "$meta.id" 3 | label 'process_single' 4 | 5 | conda "${moduleDir}/environment.yml" 6 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 7 | 'https://depot.galaxyproject.org/singularity/mulled-v2-92ebbfc09fc136b8e201cb187cd9567ba335d439:459e6ebe51fb2818cb6de807f2c5fa99599b1214-0': 8 | 'biocontainers/mulled-v2-92ebbfc09fc136b8e201cb187cd9567ba335d439:459e6ebe51fb2818cb6de807f2c5fa99599b1214-0' }" 9 | 10 | input: 11 | tuple val(meta), path(tsv) 12 | path(reference_igblast) // igblast references 13 | 14 | output: 15 | tuple val(meta), path("*_translated.tsv") , emit: repertoire_translated 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 | export IGDATA=${reference_igblast} 26 | amulety translate-igblast $tsv . ${reference_igblast} 27 | 28 | mv *_translated.tsv ${prefix}_translated.tsv 29 | 30 | cat <<-END_VERSIONS > versions.yml 31 | "${task.process}": 32 | amulety: \$( amulety --help 2>&1 | grep -o "version [0-9\\.]\\+" | grep -o "[0-9\\.]\\+" ) 33 | igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) 34 | END_VERSIONS 35 | """ 36 | 37 | stub: 38 | def args = task.ext.args ?: '' 39 | def prefix = task.ext.prefix ?: "${meta.id}" 40 | """ 41 | touch ${prefix}_translated.tsv 42 | 43 | cat <<-END_VERSIONS > versions.yml 44 | "${task.process}": 45 | amulety: \$( amulety --help 2>&1 | grep -o "version [0-9\\.]\\+" | grep -o "[0-9\\.]\\+" ) 46 | igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" ) 47 | END_VERSIONS 48 | """ 49 | } 50 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/translate/meta.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json 3 | name: "amulety_translate" 4 | description: A module to translate BCR and TCR nucleotide sequences into amino acid sequences using amulety and igblast. 5 | keywords: 6 | - immunology 7 | - BCR 8 | - TCR 9 | - translation 10 | - amino acid 11 | - nucleotide 12 | - immunoinformatics 13 | tools: 14 | - "amulety": 15 | description: "Python package to create embeddings of BCR and TCR amino acid sequences." 16 | homepage: "https://amulety.readthedocs.io/en/latest/" 17 | documentation: "https://amulety.readthedocs.io/en/latest/" 18 | tool_dev_url: "https://github.com/immcantation/amulety" 19 | doi: "10.1101/2025.03.21.644583" 20 | licence: ['GPL v3'] 21 | - "igblast": 22 | description: "A tool for immunoglobulin (IG, BCR) and T cell receptor (TCR) V domain sequences blasting." 23 | homepage: "https://www.ncbi.nlm.nih.gov/igblast/" 24 | documentation: "https://ncbi.github.io/igblast/" 25 | tool_dev_url: "https://github.com/ncbi/igblast" 26 | doi: "10.1093/nar/gkt382" 27 | licence: ['United States Government Work'] 28 | 29 | input: 30 | - - meta: 31 | type: map 32 | description: | 33 | Groovy Map containing sample information 34 | e.g. `[ id:'sample1', single_end:false ]` 35 | - tsv: 36 | type: file 37 | description: TSV with BCR/TCR nucleotide sequences in AIRR rearrangement format 38 | pattern: "*.{tsv}" 39 | - - reference_igblast: 40 | type: file 41 | description: Built reference databases for igblast 42 | 43 | output: 44 | - repertoire_translated: 45 | - meta: 46 | type: map 47 | description: | 48 | Groovy Map containing sample information 49 | e.g. `[ id:'sample1', single_end:false ]` 50 | - "*_translated.tsv": 51 | type: file 52 | description: TSV with BCR/TCR amino acid sequences in AIRR rearrangement format 53 | pattern: "*.tsv" 54 | 55 | - versions: 56 | - "versions.yml": 57 | type: file 58 | description: File containing software versions 59 | pattern: "versions.yml" 60 | 61 | authors: 62 | - "@ggabernet" 63 | maintainers: 64 | - "@ggabernet" 65 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/translate/tests/main.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_process { 2 | 3 | name "Test Process AMULETY_TRANSLATE" 4 | script "../main.nf" 5 | process "AMULETY_TRANSLATE" 6 | 7 | tag "modules" 8 | tag "modules_nfcore" 9 | tag "amulety" 10 | tag "amulety/translate" 11 | tag "untar" 12 | 13 | setup { 14 | run ("UNTAR") { 15 | script "../../../untar/main.nf" 16 | process { 17 | """ 18 | input[0] = [ 19 | [id:'test'], 20 | file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/index/igblast/igblast_base.tar', checkIfExists: true) 21 | ] 22 | """ 23 | } 24 | } 25 | } 26 | 27 | test("human - AIRR rearrangement") { 28 | when { 29 | process { 30 | """ 31 | input[0] = [ 32 | [ id:'test', single_end:false ], // meta map 33 | file(params.modules_testdata_base_path + 'genomics/homo_sapiens/10xgenomics/cellranger/sc5p_v2_hs_PBMC_1k_bcr/sc5p_v2_hs_PBMC_1k_b_airr_rearrangement.tsv', checkIfExists: true), 34 | ] 35 | input[1] = UNTAR.out.untar.map{ it[1] } 36 | """ 37 | } 38 | } 39 | 40 | then { 41 | assertAll( 42 | { assert process.success }, 43 | { assert snapshot(process.out.repertoire_translated, 44 | process.out.versions).match() } 45 | ) 46 | } 47 | 48 | } 49 | 50 | test("human - AIRR rearrangement - stub") { 51 | 52 | options "-stub" 53 | 54 | when { 55 | process { 56 | """ 57 | input[0] = [ 58 | [ id:'test', single_end:false ], // meta map 59 | file(params.modules_testdata_base_path + 'genomics/homo_sapiens/10xgenomics/cellranger/sc5p_v2_hs_PBMC_1k_bcr/sc5p_v2_hs_PBMC_1k_b_airr_rearrangement.tsv', checkIfExists: true), 60 | ] 61 | input[1] = UNTAR.out.untar.map{ it[1] } 62 | """ 63 | } 64 | } 65 | 66 | then { 67 | assertAll( 68 | { assert process.success }, 69 | { assert snapshot(process.out).match() } 70 | ) 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /modules/nf-core/amulety/translate/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "human - AIRR rearrangement": { 3 | "content": [ 4 | [ 5 | [ 6 | { 7 | "id": "test", 8 | "single_end": false 9 | }, 10 | "sc5p_v2_hs_PBMC_1k_b_airr_rearrangement_translated.tsv:md5,70447131da302612108bdf10fc5cecef" 11 | ] 12 | ], 13 | [ 14 | "versions.yml:md5,f479f913cad0a01f42bf6d8cd63a6119" 15 | ] 16 | ], 17 | "meta": { 18 | "nf-test": "0.9.2", 19 | "nextflow": "24.10.5" 20 | }, 21 | "timestamp": "2025-04-15T11:05:01.88310925" 22 | }, 23 | "human - AIRR rearrangement - stub": { 24 | "content": [ 25 | { 26 | "0": [ 27 | [ 28 | { 29 | "id": "test", 30 | "single_end": false 31 | }, 32 | "test_translated.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" 33 | ] 34 | ], 35 | "1": [ 36 | "versions.yml:md5,f479f913cad0a01f42bf6d8cd63a6119" 37 | ], 38 | "repertoire_translated": [ 39 | [ 40 | { 41 | "id": "test", 42 | "single_end": false 43 | }, 44 | "test_translated.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" 45 | ] 46 | ], 47 | "versions": [ 48 | "versions.yml:md5,f479f913cad0a01f42bf6d8cd63a6119" 49 | ] 50 | } 51 | ], 52 | "meta": { 53 | "nf-test": "0.9.2", 54 | "nextflow": "24.10.5" 55 | }, 56 | "timestamp": "2025-04-15T11:05:15.9427482" 57 | } 58 | } -------------------------------------------------------------------------------- /modules/nf-core/cat/fastq/environment.yml: -------------------------------------------------------------------------------- 1 | name: cat_fastq 2 | channels: 3 | - conda-forge 4 | - bioconda 5 | - defaults 6 | dependencies: 7 | - conda-forge::sed=4.7 8 | -------------------------------------------------------------------------------- /modules/nf-core/cat/fastq/meta.yml: -------------------------------------------------------------------------------- 1 | name: cat_fastq 2 | description: Concatenates fastq files 3 | keywords: 4 | - cat 5 | - fastq 6 | - concatenate 7 | tools: 8 | - cat: 9 | description: | 10 | The cat utility reads files sequentially, writing them to the standard output. 11 | documentation: https://www.gnu.org/software/coreutils/manual/html_node/cat-invocation.html 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 | - reads: 20 | type: file 21 | description: | 22 | List of input FastQ files to be concatenated. 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: Merged fastq file 32 | pattern: "*.{merged.fastq.gz}" 33 | - versions: 34 | type: file 35 | description: File containing software versions 36 | pattern: "versions.yml" 37 | authors: 38 | - "@joseespinosa" 39 | - "@drpatelh" 40 | maintainers: 41 | - "@joseespinosa" 42 | - "@drpatelh" 43 | -------------------------------------------------------------------------------- /modules/nf-core/cat/fastq/tests/tags.yml: -------------------------------------------------------------------------------- 1 | cat/fastq: 2 | - modules/nf-core/cat/fastq/** 3 | -------------------------------------------------------------------------------- /modules/nf-core/cellranger/mkvdjref/environment.yml: -------------------------------------------------------------------------------- 1 | name: cellranger_mkvdjref 2 | channels: 3 | - conda-forge 4 | - bioconda 5 | - defaults 6 | -------------------------------------------------------------------------------- /modules/nf-core/cellranger/mkvdjref/main.nf: -------------------------------------------------------------------------------- 1 | process CELLRANGER_MKVDJREF { 2 | tag "$fasta" 3 | label 'process_high' 4 | 5 | container "nf-core/cellranger:7.1.0" 6 | 7 | input: 8 | path fasta 9 | path gtf 10 | val reference_name 11 | 12 | output: 13 | path "${reference_name}", emit: reference 14 | path "versions.yml" , emit: versions 15 | 16 | when: 17 | task.ext.when == null || task.ext.when 18 | 19 | script: 20 | // Exit if running this module with -profile conda / -profile mamba 21 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 22 | error "CELLRANGER_MKVDJREF module does not support Conda. Please use Docker / Singularity / Podman instead." 23 | } 24 | def args = task.ext.args ?: '' 25 | """ 26 | cellranger \\ 27 | mkvdjref \\ 28 | --genome=$reference_name \\ 29 | --fasta=$fasta \\ 30 | --genes=$gtf \\ 31 | $args 32 | 33 | cat <<-END_VERSIONS > versions.yml 34 | "${task.process}": 35 | cellranger: \$(echo \$( cellranger --version 2>&1) | sed 's/^.*[^0-9]\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*\$/\\1/' ) 36 | END_VERSIONS 37 | """ 38 | } 39 | -------------------------------------------------------------------------------- /modules/nf-core/cellranger/mkvdjref/meta.yml: -------------------------------------------------------------------------------- 1 | name: cellranger_mkvdjref 2 | description: Module to build the VDJ reference needed by the 10x Genomics Cell Ranger tool. Uses the cellranger mkvdjref command. 3 | keywords: 4 | - reference 5 | - mkvdjref 6 | - index 7 | - immunoprofiling 8 | - single-cell 9 | - cellranger 10 | tools: 11 | - cellranger: 12 | description: Cell Ranger processes data from 10X Genomics Chromium kits. `cellranger vdj` takes FASTQ files from `cellranger mkfastq` or `bcl2fastq` for V(D)J libraries and performs sequence assembly and paired clonotype calling. It uses the Chromium cellular barcodes and UMIs to assemble V(D)J transcripts per cell. Clonotypes and CDR3 sequences are output as a `.vloupe` file which can be loaded into Loupe V(D)J Browser. 13 | homepage: https://support.10xgenomics.com/single-cell-vdj/software/pipelines/latest/what-is-cell-ranger 14 | documentation: https://support.10xgenomics.com/single-cell-vdj/software/pipelines/latest/advanced/references 15 | tool_dev_url: https://support.10xgenomics.com/single-cell-vdj/software/pipelines/latest/advanced/references 16 | licence: 10x Genomics EULA 17 | input: 18 | - fasta: 19 | type: file 20 | description: Reference genome FASTA file 21 | pattern: "*.{fasta,fa}" 22 | - genes: 23 | type: file 24 | description: Reference transcriptome GTF file 25 | pattern: "*.gtf" 26 | - genome: 27 | type: string 28 | description: The name to give the new reference folder, e.g. `my_vdj_ref` 29 | pattern: str 30 | output: 31 | - reference: 32 | type: directory 33 | description: Folder containing all the reference indices needed by Cell Ranger 34 | - versions: 35 | type: file 36 | description: File containing software version 37 | pattern: "versions.yml" 38 | authors: 39 | - "@ggabernet" 40 | - "@klkeys" 41 | maintainers: 42 | - "@ggabernet" 43 | - "@klkeys" 44 | -------------------------------------------------------------------------------- /modules/nf-core/cellranger/vdj/main.nf: -------------------------------------------------------------------------------- 1 | process CELLRANGER_VDJ { 2 | tag "${meta.id}" 3 | label 'process_high' 4 | 5 | container "nf-core/cellranger:8.0.0" 6 | 7 | input: 8 | tuple val(meta), path(reads) 9 | path reference 10 | 11 | output: 12 | tuple val(meta), path("**/outs/**"), emit: outs 13 | path "versions.yml" , emit: versions 14 | 15 | when: 16 | task.ext.when == null || task.ext.when 17 | 18 | script: 19 | // Exit if running this module with -profile conda / -profile mamba 20 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 21 | error "CELLRANGER_VDJ module does not support Conda. Please use Docker / Singularity / Podman instead." 22 | } 23 | def args = task.ext.args ?: '' 24 | def prefix = task.ext.prefix ?: "${meta.id}" 25 | def reference_name = reference.name 26 | """ 27 | cellranger \\ 28 | vdj \\ 29 | --id='${prefix}' \\ 30 | --fastqs=. \\ 31 | --reference=$reference_name \\ 32 | --localcores=${task.cpus} \\ 33 | --localmem=${task.memory.toGiga()} \\ 34 | $args 35 | 36 | cat <<-END_VERSIONS > versions.yml 37 | "${task.process}": 38 | cellranger: \$(echo \$( cellranger --version 2>&1) | sed 's/^.*[^0-9]\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*\$/\\1/' ) 39 | END_VERSIONS 40 | """ 41 | 42 | stub: 43 | // Exit if running this module with -profile conda / -profile mamba 44 | if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { 45 | error "CELLRANGER_VDJ module does not support Conda. Please use Docker / Singularity / Podman instead." 46 | } 47 | def prefix = task.ext.prefix ?: "${meta.id}" 48 | """ 49 | mkdir -p "${meta.id}/outs/" 50 | touch ${meta.id}/outs/fake_file.txt 51 | 52 | cat <<-END_VERSIONS > versions.yml 53 | "${task.process}": 54 | cellranger: \$(echo \$( cellranger --version 2>&1) | sed 's/^.*[^0-9]\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*\$/\\1/' ) 55 | END_VERSIONS 56 | """ 57 | } 58 | -------------------------------------------------------------------------------- /modules/nf-core/fastp/environment.yml: -------------------------------------------------------------------------------- 1 | name: fastp 2 | channels: 3 | - conda-forge 4 | - bioconda 5 | - defaults 6 | dependencies: 7 | - bioconda::fastp=0.23.4 8 | -------------------------------------------------------------------------------- /modules/nf-core/fastp/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | 3 | withName: FASTP { 4 | ext.args = "--interleaved_in" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /modules/nf-core/fastp/tests/tags.yml: -------------------------------------------------------------------------------- 1 | fastp: 2 | - modules/nf-core/fastp/** 3 | -------------------------------------------------------------------------------- /modules/nf-core/fastqc/environment.yml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - bioconda 4 | dependencies: 5 | - bioconda::fastqc=0.12.1 6 | -------------------------------------------------------------------------------- /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 | 15 | You get information about adapter contamination and other 16 | overrepresented sequences. 17 | homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/ 18 | documentation: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/ 19 | licence: ["GPL-2.0-only"] 20 | identifier: biotools:fastqc 21 | input: 22 | - - meta: 23 | type: map 24 | description: | 25 | Groovy Map containing sample information 26 | e.g. [ id:'test', single_end:false ] 27 | - reads: 28 | type: file 29 | description: | 30 | List of input FastQ files of size 1 and 2 for single-end and paired-end data, 31 | respectively. 32 | output: 33 | - html: 34 | - meta: 35 | type: map 36 | description: | 37 | Groovy Map containing sample information 38 | e.g. [ id:'test', single_end:false ] 39 | - "*.html": 40 | type: file 41 | description: FastQC report 42 | pattern: "*_{fastqc.html}" 43 | - zip: 44 | - meta: 45 | type: map 46 | description: | 47 | Groovy Map containing sample information 48 | e.g. [ id:'test', single_end:false ] 49 | - "*.zip": 50 | type: file 51 | description: FastQC report archive 52 | pattern: "*_{fastqc.zip}" 53 | - versions: 54 | - versions.yml: 55 | type: file 56 | description: File containing software versions 57 | pattern: "versions.yml" 58 | authors: 59 | - "@drpatelh" 60 | - "@grst" 61 | - "@ewels" 62 | - "@FelixKrueger" 63 | maintainers: 64 | - "@drpatelh" 65 | - "@grst" 66 | - "@ewels" 67 | - "@FelixKrueger" 68 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/environment.yml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - bioconda 4 | dependencies: 5 | - bioconda::multiqc=1.27 6 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/main.nf: -------------------------------------------------------------------------------- 1 | process MULTIQC { 2 | label 'process_single' 3 | 4 | conda "${moduleDir}/environment.yml" 5 | container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 6 | 'https://depot.galaxyproject.org/singularity/multiqc:1.27--pyhdfd78af_0' : 7 | 'biocontainers/multiqc:1.27--pyhdfd78af_0' }" 8 | 9 | input: 10 | path multiqc_files, stageAs: "?/*" 11 | path(multiqc_config) 12 | path(extra_multiqc_config) 13 | path(multiqc_logo) 14 | path(replace_names) 15 | path(sample_names) 16 | 17 | output: 18 | path "*multiqc_report.html", emit: report 19 | path "*_data" , emit: data 20 | path "*_plots" , optional:true, emit: plots 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 prefix = task.ext.prefix ? "--filename ${task.ext.prefix}.html" : '' 29 | def config = multiqc_config ? "--config $multiqc_config" : '' 30 | def extra_config = extra_multiqc_config ? "--config $extra_multiqc_config" : '' 31 | def logo = multiqc_logo ? "--cl-config 'custom_logo: \"${multiqc_logo}\"'" : '' 32 | def replace = replace_names ? "--replace-names ${replace_names}" : '' 33 | def samples = sample_names ? "--sample-names ${sample_names}" : '' 34 | """ 35 | multiqc \\ 36 | --force \\ 37 | $args \\ 38 | $config \\ 39 | $prefix \\ 40 | $extra_config \\ 41 | $logo \\ 42 | $replace \\ 43 | $samples \\ 44 | . 45 | 46 | cat <<-END_VERSIONS > versions.yml 47 | "${task.process}": 48 | multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) 49 | END_VERSIONS 50 | """ 51 | 52 | stub: 53 | """ 54 | mkdir multiqc_data 55 | mkdir multiqc_plots 56 | touch multiqc_report.html 57 | 58 | cat <<-END_VERSIONS > versions.yml 59 | "${task.process}": 60 | multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) 61 | END_VERSIONS 62 | """ 63 | } 64 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/tests/main.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "multiqc_versions_single": { 3 | "content": [ 4 | [ 5 | "versions.yml:md5,8f3b8c1cec5388cf2708be948c9fa42f" 6 | ] 7 | ], 8 | "meta": { 9 | "nf-test": "0.9.2", 10 | "nextflow": "24.10.4" 11 | }, 12 | "timestamp": "2025-01-27T09:29:57.631982377" 13 | }, 14 | "multiqc_stub": { 15 | "content": [ 16 | [ 17 | "multiqc_report.html", 18 | "multiqc_data", 19 | "multiqc_plots", 20 | "versions.yml:md5,8f3b8c1cec5388cf2708be948c9fa42f" 21 | ] 22 | ], 23 | "meta": { 24 | "nf-test": "0.9.2", 25 | "nextflow": "24.10.4" 26 | }, 27 | "timestamp": "2025-01-27T09:30:34.743726958" 28 | }, 29 | "multiqc_versions_config": { 30 | "content": [ 31 | [ 32 | "versions.yml:md5,8f3b8c1cec5388cf2708be948c9fa42f" 33 | ] 34 | ], 35 | "meta": { 36 | "nf-test": "0.9.2", 37 | "nextflow": "24.10.4" 38 | }, 39 | "timestamp": "2025-01-27T09:30:21.44383553" 40 | } 41 | } -------------------------------------------------------------------------------- /modules/nf-core/multiqc/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | process { 2 | withName: 'MULTIQC' { 3 | ext.prefix = null 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /modules/nf-core/multiqc/tests/tags.yml: -------------------------------------------------------------------------------- 1 | multiqc: 2 | - modules/nf-core/multiqc/** 3 | -------------------------------------------------------------------------------- /modules/nf-core/trust4/environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json 3 | channels: 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - "bioconda::trust4=1.0.13" 8 | -------------------------------------------------------------------------------- /modules/nf-core/trust4/tests/tags.yml: -------------------------------------------------------------------------------- 1 | trust4: 2 | - "modules/nf-core/trust4/**" 3 | -------------------------------------------------------------------------------- /subworkflows/local/assembled_input_check.nf: -------------------------------------------------------------------------------- 1 | /* 2 | * Check input samplesheet and get channels 3 | */ 4 | 5 | include { VALIDATE_INPUT } from '../../modules/local/enchantr/validate_input' 6 | include { SAMPLESHEET_CHECK as SAMPLESHEET_CHECK_ASSEMBLED } from '../../modules/local/samplesheet_check' 7 | include { RENAME_FILE as RENAME_FILE_FASTA } from '../../modules/local/rename_file' 8 | include { RENAME_FILE as RENAME_FILE_TSV } from '../../modules/local/rename_file' 9 | 10 | workflow ASSEMBLED_INPUT_CHECK { 11 | take: 12 | samplesheet // file: /path/to/samplesheet.csv 13 | miairr 14 | collapseby 15 | cloneby 16 | 17 | main: 18 | SAMPLESHEET_CHECK_ASSEMBLED ( samplesheet ) 19 | VALIDATE_INPUT ( samplesheet, miairr, collapseby, cloneby ) //removed reassign 20 | ch_validated_input = VALIDATE_INPUT.out.validated_input 21 | ch_validated_input 22 | .splitCsv(header: true, sep:'\t') 23 | .map { get_meta(it) } 24 | .branch { it -> 25 | fasta: it[0].filename =~ /[fasta|fa]$/ 26 | tsv: it[0].filename =~ /tsv$/ 27 | } 28 | .set{ ch_metadata } 29 | 30 | ch_unique_fasta = RENAME_FILE_FASTA( ch_metadata.fasta ) 31 | ch_unique_tsv = RENAME_FILE_TSV( ch_metadata.tsv ) 32 | 33 | emit: 34 | ch_fasta = ch_unique_fasta 35 | ch_tsv = ch_unique_tsv 36 | validated_input = ch_validated_input 37 | versions = VALIDATE_INPUT.out.versions 38 | } 39 | 40 | // Function to map 41 | def get_meta (LinkedHashMap col) { 42 | 43 | def meta = [:] 44 | 45 | meta.id = col.sample_id 46 | meta.filename = col.filename 47 | meta.subject_id = col.subject_id 48 | meta.species = col.species 49 | meta.collapseby_group = col.collapseby_group 50 | meta.collapseby_size = col.collapseby_size 51 | meta.cloneby_group = col.cloneby_group 52 | meta.cloneby_size = col.cloneby_size 53 | meta.filetype = col.filetype 54 | meta.single_cell = col.single_cell 55 | meta.pcr_target_locus = col.pcr_target_locus 56 | meta.locus = col.locus 57 | 58 | if (!file(col.filename).exists()) { 59 | error "ERROR: Please check input samplesheet: filename does not exist!\n${col.filename}" 60 | } 61 | 62 | return [ meta, file(col.filename) ] 63 | } 64 | -------------------------------------------------------------------------------- /subworkflows/local/bulk_qc_and_filter.nf: -------------------------------------------------------------------------------- 1 | include { CHANGEO_CREATEGERMLINES } from '../../modules/local/changeo/changeo_creategermlines' 2 | include { REMOVE_CHIMERIC } from '../../modules/local/enchantr/remove_chimeric' 3 | include { DETECT_CONTAMINATION } from '../../modules/local/enchantr/detect_contamination' 4 | include { COLLAPSE_DUPLICATES } from '../../modules/local/enchantr/collapse_duplicates' 5 | 6 | workflow BULK_QC_AND_FILTER { 7 | 8 | take: 9 | ch_repertoire // tuple [meta, repertoire_tab] 10 | ch_reference_fasta 11 | 12 | main: 13 | 14 | ch_versions = Channel.empty() 15 | ch_logs = Channel.empty() 16 | 17 | // Remove chimeric sequences if requested 18 | if (params.remove_chimeric) { 19 | 20 | // Create germlines (not --cloned) 21 | CHANGEO_CREATEGERMLINES( 22 | ch_repertoire, 23 | ch_reference_fasta.collect() 24 | ) 25 | ch_logs = ch_logs.mix(CHANGEO_CREATEGERMLINES.out.logs) 26 | ch_versions = ch_versions.mix(CHANGEO_CREATEGERMLINES.out.versions) 27 | 28 | // Remove chimera 29 | REMOVE_CHIMERIC( 30 | CHANGEO_CREATEGERMLINES.out.tab, 31 | ch_reference_fasta.collect() 32 | ) 33 | ch_logs = ch_logs.mix(REMOVE_CHIMERIC.out.logs) 34 | ch_versions = ch_versions.mix(REMOVE_CHIMERIC.out.versions) 35 | ch_bulk_chimeric_pass = REMOVE_CHIMERIC.out.tab 36 | 37 | 38 | } else { 39 | ch_bulk_chimeric_pass = ch_repertoire 40 | } 41 | 42 | // For Bulk data, detect cross-contamination 43 | // This is only informative at this time 44 | // TODO: add a flag to specify remove suspicious sequences 45 | // and update file size log accordingly 46 | 47 | if (params.detect_contamination) { 48 | DETECT_CONTAMINATION( 49 | ch_bulk_chimeric_pass 50 | .map{ it -> [ it[1] ] } 51 | .collect() 52 | ) 53 | ch_logs = ch_logs.mix(DETECT_CONTAMINATION.out.logs) 54 | ch_versions = ch_versions.mix(DETECT_CONTAMINATION.out.versions) 55 | } 56 | 57 | COLLAPSE_DUPLICATES( 58 | ch_bulk_chimeric_pass 59 | ) 60 | 61 | ch_versions = ch_versions.mix(COLLAPSE_DUPLICATES.out.versions) 62 | ch_logs = ch_logs.mix(COLLAPSE_DUPLICATES.out.logs) 63 | 64 | emit: 65 | versions = ch_versions 66 | repertoires = COLLAPSE_DUPLICATES.out.tab 67 | logs = ch_logs 68 | 69 | } 70 | -------------------------------------------------------------------------------- /subworkflows/local/databases.nf: -------------------------------------------------------------------------------- 1 | include { FETCH_DATABASES } from '../../modules/local/fetch_databases' 2 | include { UNZIP_DB as UNZIP_IGBLAST } from '../../modules/local/unzip_db' 3 | include { UNZIP_DB as UNZIP_REFERENCE_FASTA } from '../../modules/local/unzip_db' 4 | 5 | workflow DATABASES { 6 | 7 | take: 8 | 9 | main: 10 | ch_versions = Channel.empty() 11 | 12 | // FETCH DATABASES 13 | if( !params.fetch_imgt ){ 14 | if (params.reference_igblast.endsWith(".zip")) { 15 | Channel.fromPath("${params.reference_igblast}") 16 | .ifEmpty{ error "IGBLAST DB not found: ${params.reference_igblast}" } 17 | .set { ch_igblast_zipped } 18 | UNZIP_IGBLAST( ch_igblast_zipped.collect() ) 19 | ch_igblast = UNZIP_IGBLAST.out.unzipped 20 | ch_versions = ch_versions.mix(UNZIP_IGBLAST.out.versions) 21 | } else { 22 | Channel.fromPath("${params.reference_igblast}") 23 | .ifEmpty { error "IGBLAST DB not found: ${params.reference_igblast}" } 24 | .set { ch_igblast } 25 | } 26 | } 27 | 28 | if( !params.fetch_imgt ){ 29 | if (params.reference_fasta.endsWith(".zip")) { 30 | Channel.fromPath("${params.reference_fasta}") 31 | .ifEmpty{ error "IMGTDB not found: ${params.reference_fasta}" } 32 | .set { ch_reference_fasta_zipped } 33 | UNZIP_REFERENCE_FASTA( ch_reference_fasta_zipped.collect() ) 34 | ch_reference_fasta = UNZIP_REFERENCE_FASTA.out.unzipped 35 | ch_versions = ch_versions.mix(UNZIP_REFERENCE_FASTA.out.versions) 36 | } else { 37 | Channel.fromPath("${params.reference_fasta}") 38 | .ifEmpty { error "IMGT DB not found: ${params.reference_fasta}" } 39 | .set { ch_reference_fasta } 40 | } 41 | } 42 | 43 | if (params.fetch_imgt) { 44 | FETCH_DATABASES() 45 | ch_igblast = FETCH_DATABASES.out.igblast 46 | ch_reference_fasta = FETCH_DATABASES.out.reference_fasta 47 | ch_versions = ch_versions.mix(FETCH_DATABASES.out.versions) 48 | } 49 | 50 | emit: 51 | versions = ch_versions 52 | reference_fasta = ch_reference_fasta 53 | igblast = ch_igblast 54 | } 55 | -------------------------------------------------------------------------------- /subworkflows/local/single_cell_qc_and_filtering.nf: -------------------------------------------------------------------------------- 1 | include { SINGLE_CELL_QC } from '../../modules/local/enchantr/single_cell_qc' 2 | 3 | workflow SINGLE_CELL_QC_AND_FILTERING { 4 | take: 5 | repertoires // tuple [meta, repertoire_tab] 6 | 7 | main: 8 | ch_versions = Channel.empty() 9 | ch_logs = Channel.empty() 10 | 11 | repertoires 12 | .map{ it -> [ it[0].id, 13 | it[0] ] } 14 | .set{ch_onlymeta} 15 | 16 | repertoires 17 | .map { it -> it[1]} 18 | .collect() 19 | .set{ch_repertoire_allsc} 20 | 21 | SINGLE_CELL_QC( 22 | ch_repertoire_allsc 23 | ) 24 | 25 | SINGLE_CELL_QC.out.tab 26 | .flatten() 27 | .map { it -> [ "${it.baseName}".replaceFirst("__scqc-pass", ""), it ] } 28 | .set{ch_repertoire_after_scqc_with_sampleid} 29 | 30 | ch_logs = ch_logs.mix(SINGLE_CELL_QC.out.logs) 31 | ch_versions = ch_versions.mix(SINGLE_CELL_QC.out.versions) 32 | 33 | ch_repertoire_after_scqc_withmeta = ch_onlymeta.join(ch_repertoire_after_scqc_with_sampleid) 34 | .map{ it -> [ it[1], it[2] ]} 35 | 36 | emit: 37 | versions = ch_versions 38 | repertoires = ch_repertoire_after_scqc_withmeta 39 | logs = ch_logs 40 | } 41 | -------------------------------------------------------------------------------- /subworkflows/local/translate_embed.nf: -------------------------------------------------------------------------------- 1 | include { AMULETY_TRANSLATE } from '../../modules/nf-core/amulety/translate/main' 2 | include { AMULETY_ANTIBERTY } from '../../modules/nf-core/amulety/antiberty/main' 3 | include { AMULETY_ANTIBERTA2 } from '../../modules/nf-core/amulety/antiberta2/main' 4 | include { AMULETY_BALMPAIRED } from '../../modules/nf-core/amulety/balmpaired/main' 5 | include { AMULETY_ESM2 } from '../../modules/nf-core/amulety/esm2/main' 6 | 7 | workflow TRANSLATE_EMBED { 8 | take: 9 | ch_repertoire 10 | ch_reference_igblast 11 | 12 | main: 13 | ch_versions = Channel.empty() 14 | 15 | AMULETY_TRANSLATE( 16 | ch_repertoire, 17 | ch_reference_igblast 18 | ) 19 | 20 | if (params.embeddings && params.embeddings.split(',').contains('antiberty') ){ 21 | AMULETY_ANTIBERTY( 22 | AMULETY_TRANSLATE.out.repertoire_translated, 23 | params.embedding_chain 24 | ) 25 | } 26 | 27 | if (params.embeddings && params.embeddings.split(',').contains('antiberta2') ){ 28 | AMULETY_ANTIBERTA2( 29 | AMULETY_TRANSLATE.out.repertoire_translated, 30 | params.embedding_chain 31 | ) 32 | } 33 | 34 | if (params.embeddings && params.embeddings.split(',').contains('esm2') ){ 35 | AMULETY_ESM2( 36 | AMULETY_TRANSLATE.out.repertoire_translated, 37 | params.embedding_chain 38 | ) 39 | } 40 | 41 | if (params.embeddings && params.embeddings.split(',').contains('balmpaired') ){ 42 | AMULETY_BALMPAIRED( 43 | AMULETY_TRANSLATE.out.repertoire_translated, 44 | params.embedding_chain 45 | ) 46 | } 47 | 48 | 49 | emit: 50 | versions = ch_versions 51 | } 52 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: "UTILS_NEXTFLOW_PIPELINE" 3 | description: Subworkflow with functionality that may be useful for any Nextflow pipeline 4 | keywords: 5 | - utility 6 | - pipeline 7 | - initialise 8 | - version 9 | components: [] 10 | input: 11 | - print_version: 12 | type: boolean 13 | description: | 14 | Print the version of the pipeline and exit 15 | - dump_parameters: 16 | type: boolean 17 | description: | 18 | Dump the parameters of the pipeline to a JSON file 19 | - output_directory: 20 | type: directory 21 | description: Path to output dir to write JSON file to. 22 | pattern: "results/" 23 | - check_conda_channel: 24 | type: boolean 25 | description: | 26 | Check if the conda channel priority is correct. 27 | output: 28 | - dummy_emit: 29 | type: boolean 30 | description: | 31 | Dummy emit to make nf-core subworkflows lint happy 32 | authors: 33 | - "@adamrtalbot" 34 | - "@drpatelh" 35 | maintainers: 36 | - "@adamrtalbot" 37 | - "@drpatelh" 38 | - "@maxulysse" 39 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test: -------------------------------------------------------------------------------- 1 | 2 | nextflow_function { 3 | 4 | name "Test Functions" 5 | script "subworkflows/nf-core/utils_nextflow_pipeline/main.nf" 6 | config "subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config" 7 | tag 'subworkflows' 8 | tag 'utils_nextflow_pipeline' 9 | tag 'subworkflows/utils_nextflow_pipeline' 10 | 11 | test("Test Function getWorkflowVersion") { 12 | 13 | function "getWorkflowVersion" 14 | 15 | then { 16 | assertAll( 17 | { assert function.success }, 18 | { assert snapshot(function.result).match() } 19 | ) 20 | } 21 | } 22 | 23 | test("Test Function dumpParametersToJSON") { 24 | 25 | function "dumpParametersToJSON" 26 | 27 | when { 28 | function { 29 | """ 30 | // define inputs of the function here. Example: 31 | input[0] = "$outputDir" 32 | """.stripIndent() 33 | } 34 | } 35 | 36 | then { 37 | assertAll( 38 | { assert function.success } 39 | ) 40 | } 41 | } 42 | 43 | test("Test Function checkCondaChannels") { 44 | 45 | function "checkCondaChannels" 46 | 47 | then { 48 | assertAll( 49 | { assert function.success }, 50 | { assert snapshot(function.result).match() } 51 | ) 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/main.function.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "Test Function getWorkflowVersion": { 3 | "content": [ 4 | "v9.9.9" 5 | ], 6 | "meta": { 7 | "nf-test": "0.8.4", 8 | "nextflow": "23.10.1" 9 | }, 10 | "timestamp": "2024-02-28T12:02:05.308243" 11 | }, 12 | "Test Function checkCondaChannels": { 13 | "content": null, 14 | "meta": { 15 | "nf-test": "0.8.4", 16 | "nextflow": "23.10.1" 17 | }, 18 | "timestamp": "2024-02-28T12:02:12.425833" 19 | } 20 | } -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | manifest { 2 | name = 'nextflow_workflow' 3 | author = """nf-core""" 4 | homePage = 'https://127.0.0.1' 5 | description = """Dummy pipeline""" 6 | nextflowVersion = '!>=23.04.0' 7 | version = '9.9.9' 8 | doi = 'https://doi.org/10.5281/zenodo.5070524' 9 | } 10 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nextflow_pipeline/tests/tags.yml: -------------------------------------------------------------------------------- 1 | subworkflows/utils_nextflow_pipeline: 2 | - subworkflows/nf-core/utils_nextflow_pipeline/** 3 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: "UTILS_NFCORE_PIPELINE" 3 | description: Subworkflow with utility functions specific to the nf-core pipeline template 4 | keywords: 5 | - utility 6 | - pipeline 7 | - initialise 8 | - version 9 | components: [] 10 | input: 11 | - nextflow_cli_args: 12 | type: list 13 | description: | 14 | Nextflow CLI positional arguments 15 | output: 16 | - success: 17 | type: boolean 18 | description: | 19 | Dummy output to indicate success 20 | authors: 21 | - "@adamrtalbot" 22 | maintainers: 23 | - "@adamrtalbot" 24 | - "@maxulysse" 25 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test: -------------------------------------------------------------------------------- 1 | nextflow_workflow { 2 | 3 | name "Test Workflow UTILS_NFCORE_PIPELINE" 4 | script "../main.nf" 5 | config "subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config" 6 | workflow "UTILS_NFCORE_PIPELINE" 7 | tag "subworkflows" 8 | tag "subworkflows_nfcore" 9 | tag "utils_nfcore_pipeline" 10 | tag "subworkflows/utils_nfcore_pipeline" 11 | 12 | test("Should run without failures") { 13 | 14 | when { 15 | workflow { 16 | """ 17 | input[0] = [] 18 | """ 19 | } 20 | } 21 | 22 | then { 23 | assertAll( 24 | { assert workflow.success }, 25 | { assert snapshot(workflow.out).match() } 26 | ) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/main.workflow.nf.test.snap: -------------------------------------------------------------------------------- 1 | { 2 | "Should run without failures": { 3 | "content": [ 4 | { 5 | "0": [ 6 | true 7 | ], 8 | "valid_config": [ 9 | true 10 | ] 11 | } 12 | ], 13 | "meta": { 14 | "nf-test": "0.8.4", 15 | "nextflow": "23.10.1" 16 | }, 17 | "timestamp": "2024-02-28T12:03:25.726491" 18 | } 19 | } -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | manifest { 2 | name = 'nextflow_workflow' 3 | author = """nf-core""" 4 | homePage = 'https://127.0.0.1' 5 | description = """Dummy pipeline""" 6 | nextflowVersion = '!>=23.04.0' 7 | version = '9.9.9' 8 | doi = 'https://doi.org/10.5281/zenodo.5070524' 9 | } 10 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfcore_pipeline/tests/tags.yml: -------------------------------------------------------------------------------- 1 | subworkflows/utils_nfcore_pipeline: 2 | - subworkflows/nf-core/utils_nfcore_pipeline/** 3 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfschema_plugin/main.nf: -------------------------------------------------------------------------------- 1 | // 2 | // Subworkflow that uses the nf-schema plugin to validate parameters and render the parameter summary 3 | // 4 | 5 | include { paramsSummaryLog } from 'plugin/nf-schema' 6 | include { validateParameters } from 'plugin/nf-schema' 7 | 8 | workflow UTILS_NFSCHEMA_PLUGIN { 9 | 10 | take: 11 | input_workflow // workflow: the workflow object used by nf-schema to get metadata from the workflow 12 | validate_params // boolean: validate the parameters 13 | parameters_schema // string: path to the parameters JSON schema. 14 | // this has to be the same as the schema given to `validation.parametersSchema` 15 | // when this input is empty it will automatically use the configured schema or 16 | // "${projectDir}/nextflow_schema.json" as default. This input should not be empty 17 | // for meta pipelines 18 | 19 | main: 20 | 21 | // 22 | // Print parameter summary to stdout. This will display the parameters 23 | // that differ from the default given in the JSON schema 24 | // 25 | if(parameters_schema) { 26 | log.info paramsSummaryLog(input_workflow, parameters_schema:parameters_schema) 27 | } else { 28 | log.info paramsSummaryLog(input_workflow) 29 | } 30 | 31 | // 32 | // Validate the parameters using nextflow_schema.json or the schema 33 | // given via the validation.parametersSchema configuration option 34 | // 35 | if(validate_params) { 36 | if(parameters_schema) { 37 | validateParameters(parameters_schema:parameters_schema) 38 | } else { 39 | validateParameters() 40 | } 41 | } 42 | 43 | emit: 44 | dummy_emit = true 45 | } 46 | 47 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfschema_plugin/meta.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json 2 | name: "utils_nfschema_plugin" 3 | description: Run nf-schema to validate parameters and create a summary of changed parameters 4 | keywords: 5 | - validation 6 | - JSON schema 7 | - plugin 8 | - parameters 9 | - summary 10 | components: [] 11 | input: 12 | - input_workflow: 13 | type: object 14 | description: | 15 | The workflow object of the used pipeline. 16 | This object contains meta data used to create the params summary log 17 | - validate_params: 18 | type: boolean 19 | description: Validate the parameters and error if invalid. 20 | - parameters_schema: 21 | type: string 22 | description: | 23 | Path to the parameters JSON schema. 24 | This has to be the same as the schema given to the `validation.parametersSchema` config 25 | option. When this input is empty it will automatically use the configured schema or 26 | "${projectDir}/nextflow_schema.json" as default. The schema should not be given in this way 27 | for meta pipelines. 28 | output: 29 | - dummy_emit: 30 | type: boolean 31 | description: Dummy emit to make nf-core subworkflows lint happy 32 | authors: 33 | - "@nvnieuwk" 34 | maintainers: 35 | - "@nvnieuwk" 36 | -------------------------------------------------------------------------------- /subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "nf-schema@2.1.0" 3 | } 4 | 5 | validation { 6 | parametersSchema = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" 7 | monochromeLogs = true 8 | } -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------