Repository navigation
feat: expose FDR conservative parameter - #690
Conversation
Add `fdr_conservative` parameter (default true for backward compatibility) that controls whether the FDR estimation uses the conservative formula (D+1)/T or the tighter (D+1)/(T+D). The conservative formula provides an upper bound on the true FDR but can be overly conservative, especially at low FDR thresholds. Keich & Noble (2025, Nature Methods) showed that (D+1)/T is useful for guaranteeing FDR control but inflates q-values by ~20-40% in the borderline range compared to (D+1)/(T+D). In benchmarking against ProteomeDiscoverer, we found that 429 PD-confirmed peptides with Percolator PEP < 0.01 were filtered out because the conservative FDR formula inflated their q-values above the 1% threshold. Setting fdr_conservative=false may recover a portion of these peptides while maintaining valid FDR control. 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 |
Review Summary by QodoExpose FDR conservative parameter for flexible FDR estimation
WalkthroughsDescription• Expose fdr_conservative parameter to control FDR estimation formula • Default true maintains backward compatibility with conservative (D+1)/T formula • Setting false uses tighter (D+1)/(T+D) estimate per Keich & Noble (2025) • Recovers peptides filtered by overly conservative q-value inflation Diagramflowchart LR
A["fdr_conservative parameter"] -->|true| B["Conservative formula (D+1)/T"]
A -->|false| C["Tighter formula (D+1)/(T+D)"]
B --> D["Upper bound on FDR"]
C --> E["Tighter q-value estimates"]
D --> F["Backward compatible default"]
E --> G["Recover borderline peptides"]
File Changes1. modules/local/openms/false_discovery_rate/main.nf
|
Code Review by Qodo
1. Invalid schema JSON
|
Up to standards ✅🟢 Issues
|
| }, | ||
| "protein_inference_debug": { |
There was a problem hiding this comment.
1. Invalid schema json 🐞 Bug ≡ Correctness
nextflow_schema.json is syntactically invalid because the newly added fdr_conservative property block is not followed by a comma even though additional properties follow. Any consumer parsing the schema will fail (e.g., nf-core launch / parameter schema validation tooling).
Agent Prompt
## Issue description
`nextflow_schema.json` is invalid JSON because the `fdr_conservative` property definition is not followed by a comma, but another property (`protein_inference_debug`) follows immediately after.
## Issue Context
This breaks JSON parsing for any tooling that reads `nextflow_schema.json`.
## Fix
Add a trailing comma after the closing brace of the `fdr_conservative` property block.
## Fix Focus Areas
- nextflow_schema.json[969-976]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Pull request overview
Exposes an OpenMS FalseDiscoveryRate “conservative” toggle as a workflow parameter to control which FDR estimation formula is used, keeping the current behavior as the default.
Changes:
- Add
params.fdr_conservative(defaulttrue) to the pipeline configuration - Wire
params.fdr_conservativeinto the OpenMSFalseDiscoveryRateinvocation via-algorithm:conservative - Document the new parameter in
nextflow_schema.json
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| nextflow_schema.json | Adds schema/documentation for the new fdr_conservative boolean parameter |
| nextflow.config | Introduces the default fdr_conservative = true pipeline parameter |
| modules/local/openms/false_discovery_rate/main.nf | Passes params.fdr_conservative through to OpenMS FalseDiscoveryRate |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pmultiqc 0.0.45 -> 0.0.46 bigbio#714 bumped to 0.0.45, which fails every test_dda_id_* profile: ValueError: No pmultiqc plugin selected; skipping. AttributeError: module 'rich' has no attribute 'panel' Those profiles do not export an mzTab, so `--quantms-plugin` is never added and 0.0.45 raises instead of degrading. pmultiqc 0.0.46 is exactly the fix: "Allow successful execution without mzTab file" (bigbio/pmultiqc#688), "gracefully handle plugin execution errors" (bigbio#689) and "Support pmultiqc without mzTab" (bigbio#690). quantms-rescoring 0.0.21 -> 0.0.22 (8 references: 4 docker, 4 singularity) 0.0.21 is broken for multi-engine runs. On a comet+msgf merge it collapsed the Percolator feature table to four raw scores with a single global imputation constant; ~80% of PSMs in such a run are single-engine and those are ~45% decoy, so protein-level FDR never cleared 1% and EPIFANY returned "No proteins left after FDR filtering" (exit 8). 0.0.22 feeds Percolator the union of every engine's features with orientation-aware per-feature imputation and engine-source indicators. Validated on MSV000085836 (552 TMT fractions): ISOBARIC_WORKFLOW merged 41,391 proteins where 0.0.21 produced zero, and the full run yields +4.4% peptides / +0.6% protein groups at 1% FDR vs the comet-only reference. It also generalises to SAGE (comet+sage, msgf+sage, comet+msgf+sage), with the Sage feature set verified against a real SageAdapter idparquet. Single-engine runs are unchanged: the consensus path only activates for multi-engine merges, and the default remains search_engines=comet. CAVEAT: multi-engine consensus feeds Percolator explicit engine-source indicators, and engine source correlates strongly with decoy status. There is no stratified or entrapment calibration evidence yet that protein-level FDR stays calibrated under that mixture, so multi-engine should stay opt-in and be validated per dataset. This bump does not change any default.
Summary
fdr_conservativeparameter (defaulttrue) to control the FDR estimation formula inFalseDiscoveryRatetrue(default): uses(D+1)/T— conservative upper bound, backward compatiblefalse: uses(D+1)/(T+D)— tighter estimate per Keich & Noble (2025, Nature Methods)Motivation
In a benchmarking study comparing quantms against ProteomeDiscoverer on TMTpro 16-plex data, we traced a significant source of peptide loss to the conservative FDR formula. The
(D+1)/Tformula inflates q-values by ~20-40% compared to(D+1)/(T+D), which causes borderline peptides with good Percolator PEP scores (< 0.01) to be filtered out when the inflated q-value exceeds the PSM-level FDR cutoff.Specifically, X PD-confirmed peptides had original Percolator PEP < 0.01 but were removed (we suspected) because the conservative FDR formula pushed their q-values above the 1% threshold.
The parameter was already available in the OpenMS
FalseDiscoveryRatetool as-algorithm:conservativebut was not exposed in the quantms workflow.Changes
nextflow.configfdr_conservative = truedefault parametermodules/local/openms/false_discovery_rate/main.nf-algorithm:conservative ${params.fdr_conservative}nextflow_schema.jsonReferences
Test plan
fdr_conservative=true) produces identical results to current versionfdr_conservative=falsereduces q-values and recovers additional peptides/proteinsfdr_conservative=false(verify with entrapment or target-decoy analysis)🤖 Generated with Claude Code