Repository navigation
feat: add DIA-NN scoring mode parameter (Generic/Proteoforms/Peptidoforms) - #45
Conversation
Add diann_scoring_mode parameter with three options: - 'generic' (default): standard scoring, maximizes protein IDs - 'proteoforms': single-residue mutation decoys, recommended for proteogenomics/variant detection (requires DIA-NN >= 2.0) - 'peptidoforms': extra peptidoform q-values for PTM analysis The flag is passed to all 5 DIA-NN steps and added to each module's blocked flags list. Version validation ensures proteoforms mode is only used with DIA-NN >= 2.0. Closes #43 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Pull request overview
Adds a new pipeline-level DIA-NN scoring-mode knob to support proteogenomics (variant detection) and PTM-focused analyses by exposing DIA-NN’s --proteoforms / --peptidoforms modes and enforcing a minimum DIA-NN version where required.
Changes:
- Introduces
diann_scoring_mode(genericdefault,proteoforms,peptidoforms) in config, schema, and docs. - Threads the scoring-mode flag through all DIA-NN execution steps and blocks manual override via
diann_extra_args. - Adds a workflow-level version guard requiring DIA-NN
>= 2.0forproteoforms.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| workflows/dia.nf | Adds DIA-NN version guard for proteoforms scoring mode. |
| nextflow.config | Defines default params.diann_scoring_mode = 'generic'. |
| nextflow_schema.json | Adds schema entry for diann_scoring_mode with enum + help text. |
| modules/local/diann/insilico_library_generation/main.nf | Adds scoring-mode flag injection and blocks --proteoforms/--peptidoforms in extra args. |
| modules/local/diann/preliminary_analysis/main.nf | Adds scoring-mode flag injection and blocks --proteoforms/--peptidoforms in extra args. |
| modules/local/diann/assemble_empirical_library/main.nf | Adds scoring-mode flag injection and blocks --proteoforms/--peptidoforms in extra args. |
| modules/local/diann/individual_analysis/main.nf | Adds scoring-mode flag injection and blocks --proteoforms/--peptidoforms in extra args. |
| modules/local/diann/final_quantification/main.nf | Adds scoring-mode flag injection and blocks --proteoforms/--peptidoforms in extra args. |
| docs/parameters.md | Documents --diann_scoring_mode in the parameter table. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // Version guard for scoring mode | ||
| if (params.diann_scoring_mode == 'proteoforms' && VersionUtils.versionLessThan(params.diann_version, '2.0')) { | ||
| error("--proteoforms scoring mode requires DIA-NN >= 2.0. Current version: ${params.diann_version}. Use -profile diann_v2_1_0 or later") |
There was a problem hiding this comment.
The version-guard error message references "--proteoforms scoring mode", but users enable this behavior via the pipeline parameter --diann_scoring_mode proteoforms. Consider updating the message to reference the pipeline param/value (and optionally list allowed values) to reduce confusion when the guard triggers.
| error("--proteoforms scoring mode requires DIA-NN >= 2.0. Current version: ${params.diann_version}. Use -profile diann_v2_1_0 or later") | |
| error("--diann_scoring_mode proteoforms requires DIA-NN >= 2.0. Current version: ${params.diann_version}. Use -profile diann_v2_1_0 or later") |
| if (params.diann_scoring_mode == 'proteoforms' && VersionUtils.versionLessThan(params.diann_version, '2.0')) { | ||
| error("--proteoforms scoring mode requires DIA-NN >= 2.0. Current version: ${params.diann_version}. Use -profile diann_v2_1_0 or later") | ||
| } | ||
|
|
There was a problem hiding this comment.
diann_scoring_mode can be set to peptidoforms while diann_no_peptidoforms is also true, which will cause the modules to pass both --peptidoforms and --no-peptidoforms in the same DIA-NN invocation. Add a validation/guard (e.g., error out or explicitly ignore one of the settings) to prevent conflicting flags.
| // Guard against conflicting peptidoform flags | |
| if (params.diann_scoring_mode == 'peptidoforms' && params.diann_no_peptidoforms) { | |
| error("Conflicting DIA-NN settings: --diann_scoring_mode peptidoforms cannot be used together with --diann_no_peptidoforms, as they would pass both --peptidoforms and --no-peptidoforms in the same DIA-NN invocation.") | |
| } |
| // Version guard for scoring mode | ||
| if (params.diann_scoring_mode == 'proteoforms' && VersionUtils.versionLessThan(params.diann_version, '2.0')) { | ||
| error("--proteoforms scoring mode requires DIA-NN >= 2.0. Current version: ${params.diann_version}. Use -profile diann_v2_1_0 or later") | ||
| } | ||
|
|
||
| // Version guard for DIA-NN 2.0+ features | ||
| if ((params.diann_light_models || params.diann_export_quant || params.diann_site_ms1_quant) && VersionUtils.versionLessThan(params.diann_version, '2.0')) { | ||
| def enabled = [] |
There was a problem hiding this comment.
This PR adds new runtime behavior (conditional injection of --proteoforms/--peptidoforms across all DIA-NN steps plus a DIA-NN version guard), but there are no new nf-test cases covering these branches. Add at least one test that exercises --diann_scoring_mode proteoforms (with a DIA-NN 2.x profile) and one that asserts a failure for proteoforms with DIA-NN 1.8.1, so regressions in command construction/guards are caught automatically.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Since quantmsdiann is a DIA-NN-only pipeline, the diann_ prefix on parameters is redundant. Renamed all user-facing params: diann_debug -> debug_level diann_speclib -> speclib diann_extra_args -> extra_args diann_dda -> dda diann_light_models -> light_models diann_export_quant -> export_quant diann_site_ms1_quant -> site_ms1_quant diann_pre_select -> pre_select diann_report_decoys -> report_decoys diann_export_xic -> export_xic diann_normalize -> normalize diann_use_quant -> use_quant diann_tims_sum -> tims_sum diann_im_window -> im_window diann_channel_run_norm -> channel_run_norm diann_channel_spec_norm -> channel_spec_norm Removed diann_no_peptidoforms entirely — superseded by the new scoring_mode parameter (generic/proteoforms/peptidoforms). --no-peptidoforms remains in blocked flags lists. Note: diann_version is NOT renamed (used in profile names). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
diann_scoring_modeparameter with enum:generic(default),proteoforms,peptidoforms--proteoformsand--peptidoformsadded to blocked flags in all modulesproteoformsmode requires DIA-NN >= 2.0Why
For proteogenomics with variant databases (e.g., COSMIC missense mutations), the default Generic scoring mode generates fully shuffled decoys that don't model single-residue differences between canonical and variant peptides. Proteoforms mode generates single-residue mutation decoys, providing proper FDR estimation for variant-specific peptides.
Usage
Closes #43
Test plan
generic— verify no--proteoforms/--peptidoformsin DIA-NN commandsproteoforms+ DIA-NN 2.x — verify--proteoformsappears in all stepsproteoforms+ DIA-NN 1.8.1 — verify version guard errorpeptidoforms— verify--peptidoformsappears in all steps🤖 Generated with Claude Code