fix: IsobaricWorkflow - auto-detect labelling type, pass isotope correction and extraction params#693
Conversation
…rection - Use labelling_type from SDRF meta (auto-detected) instead of hardcoded params.type='itraq4plex' default - Pass isotope correction matrix when params.isotope_correction is enabled, matching the IsobaricAnalyzer module behavior - Pass extraction parameters (min_precursor_purity, precursor_isotope_deviation, min_reporter_intensity) that were missing from the IsobaricWorkflow invocation - Remove unused 'type' parameter from nextflow.config Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
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 |
ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan Review Summary by QodoAuto-detect IsobaricWorkflow labelling type and pass correction parameters
WalkthroughsDescription• Auto-detect labelling type from SDRF metadata instead of hardcoded parameter • Pass isotope correction matrix when enabled, matching IsobaricAnalyzer behavior • Add missing extraction parameters to IsobaricWorkflow invocation • Remove unused hardcoded type parameter from configuration Diagramflowchart LR
SDRF["SDRF metadata"]
META["Meta channel<br/>labelling_type"]
TMT["TMT workflow"]
ISO["IsobaricWorkflow<br/>process"]
PARAMS["Extraction &<br/>correction params"]
SDRF -- "auto-detected" --> META
META -- "extracted" --> TMT
TMT -- "labelling_type" --> ISO
PARAMS -- "passed" --> ISO
File Changes1. modules/local/openms/isobaric_workflow/main.nf
|
Code Review by Qodo
1. Isotope correction silently skipped
|
Up to standards ✅🟢 Issues
|
| // Build isotope correction matrix argument if enabled | ||
| def isotope_correction = "" | ||
| if (params.isotope_correction && params.plex_corr_matrix_file != null) { | ||
| def matrix_lines = new File(params.plex_corr_matrix_file).readLines() | ||
| .findAll { !it.startsWith('#') && it.trim() } | ||
| .drop(1) | ||
| .collect { line -> | ||
| def values = line.split('/') | ||
| if (labelling_type == 'tmt18plex' || labelling_type == 'tmt16plex') { | ||
| return "\"${values[1]}/${values[2]}/${values[3]}/${values[4]}/${values[5]}/${values[6]}/${values[7]}/${values[8]}\"" | ||
| } else { | ||
| return "\"${values[1]}/${values[2]}/${values[3]}/${values[4]}\"" | ||
| } | ||
| } | ||
| def correction_matrix = matrix_lines.join(" ") | ||
| isotope_correction = "-quantification:isotope_correction true -${labelling_type}:correction_matrix ${correction_matrix}" | ||
| } |
There was a problem hiding this comment.
1. Isotope correction silently skipped 🐞 Bug ≡ Correctness
In ISOBARIC_WORKFLOW, enabling params.isotope_correction without setting params.plex_corr_matrix_file results in no isotope-correction flags being passed to IsobaricWorkflow, producing uncorrected reporter quantification without any error. This differs from ISOBARIC_ANALYZER, which hard-fails when the matrix path is missing, making the workflow behavior inconsistent and error-prone.
Agent Prompt
### Issue description
`ISOBARIC_WORKFLOW` silently omits isotope-correction flags when `params.isotope_correction` is true but `params.plex_corr_matrix_file` is null. This produces incorrect (uncorrected) quantification without failing.
### Issue Context
`ISOBARIC_ANALYZER` already enforces the expected contract by erroring when `isotope_correction` is enabled but the matrix file is missing. `ISOBARIC_WORKFLOW` should match that behavior.
### Fix Focus Areas
- modules/local/openms/isobaric_workflow/main.nf[42-58]
- modules/local/openms/isobaric_workflow/main.nf[60-79]
- modules/local/openms/isobaric_analyzer/main.nf[28-35]
### Suggested fix
- If `params.isotope_correction` is true and `params.plex_corr_matrix_file` is null/empty, `error("plex_corr_matrix_file is required when isotope_correction is enabled")`.
- Optionally mirror `ISOBARIC_ANALYZER` and always pass `-quantification:isotope_correction true/false` explicitly for clarity/consistency.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
Fixes several issues in the IsobaricWorkflow integration (PR #604) to make it ready for merge:
params.type='itraq4plex'. Thelabelling_typeis extracted from the meta channel (already parsed from SDRF), matching howIsobaricAnalyzerworks.params.isotope_correctionis enabled, using the same correction matrix parsing logic asIsobaricAnalyzermin_precursor_purity,precursor_isotope_deviation,min_reporter_intensity) that were missing from the IsobaricWorkflow invocationtypeparameter fromnextflow.config(no longer needed since type is auto-detected)Changes
modules/local/openms/isobaric_workflow/main.nflabelling_typeinput, isotope correction matrix handling, extraction paramsworkflows/tmt.nflabelling_typefrom meta channel and pass to IsobaricWorkflownextflow.configtype = 'itraq4plex'Test plan
🤖 Generated with Claude Code