Address Nextflow linting, add param validation, reformatting#68
Merged
Address Nextflow linting, add param validation, reformatting#68
Conversation
- Removed utils.py code, placed functions into compare_calc.py - Refactored compare_calc.py for efficient access of dataframes - Fixed bug where NaN `junction_aa` values were not dropped prior to calculation of Jaccard and Sorensen matrices
Reformated code to address new Nextflow linting issues for strict syntax compatibility, namely: - moving statements into workflows - making implicit closure parameters explicit - removing use of projectDir in processes Added nf-schema for parameter validation
Unit Test Results10 tests 10 ✅ 2m 44s ⏱️ Results for commit bfa4f50. ♻️ This comment has been updated with latest results. |
Moving container to modules.config instead of specifying in every process
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the TCRtoolkit pipeline to improve code quality through linting compliance, centralized parameter validation, and modernized infrastructure. The changes introduce the nf-schema plugin for schema-based parameter validation, relocate configuration functions, remove redundant code, and optimize the Docker build process.
Key changes:
- Added JSON schema for parameter validation with the nf-schema plugin, replacing manual validation code
- Centralized container directives and relocated the check_max function to conf/base.config
- Refactored Python comparison calculations to eliminate dependencies and improve performance
- Optimized Dockerfile by switching to micromamba base image and consolidating build steps
Reviewed changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| workflows/tcrtoolkit.nf | Removed manual parameter validation code and added VALIDATE_PARAMS subworkflow call |
| subworkflows/local/validate_params.nf | New subworkflow that uses nf-schema plugin for parameter validation |
| nextflow_schema.json | New JSON schema defining all pipeline parameters with validation rules |
| nextflow.config | Added nf-schema plugin configuration and default parameter values |
| conf/base.config | Relocated check_max function from nextflow.config |
| conf/modules.config | Added centralized container directive for all processes |
| subworkflows/local/sample.nf | Improved lambda parameter naming for better code clarity |
| subworkflows/local/resolve_samplesheet.nf | Added samplesheet_utf8 input to SAMPLESHEET_RESOLVE and improved lambda naming |
| subworkflows/local/input_check.nf | Improved lambda parameter naming using underscore prefix for unused variable |
| modules/local/samplesheet/samplesheet_resolve.nf | Rewrote script using awk for improved row ordering and error handling |
| modules/local/samplesheet/samplesheet_check.nf | Removed process-level container directive |
| modules/local/sample/*.nf | Removed process-level container directives from multiple sample modules |
| modules/local/sample/tcrdist3.nf | Reformatted conditional expressions using ternary operators for conciseness |
| modules/local/compare/*.nf | Removed process-level container directives from compare modules |
| modules/local/airr_convert/*.nf | Removed process-level container directives from conversion modules |
| notebooks/*.qmd | Removed unused project_dir parameter from all notebook templates |
| bin/compare_calc.py | Refactored to inline similarity functions and optimize memory usage |
| bin/utils.py | Removed file as functions are now inlined in compare_calc.py |
| Dockerfile | Switched to micromamba base, optimized build layers, and improved cleanup |
| env.yml | Added r-grr=0.9.5 dependency |
| main.nf | Removed commented onComplete workflow section |
| LICENSE | Added MIT License file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update docker
Collaborator
|
lgtm! |
dimalvovs
approved these changes
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.