Repository navigation
[TEST] Verify unknown-charge deisotoping matches precursor-free results - #10074
Conversation
…known Both deisotopeAndSingleCharge() and deisotopeWithAveragineModel() enabled the precursor-mass constraint whenever a single precursor was present, computing the neutral mass from the precursor charge. A charge of 0 (unknown, see Precursor.h) produced a zero precursor mass, so every positive-mass fragment cluster exceeded it and was rejected: with keep_only_deisotoped=true the spectrum was emptied, otherwise peaks were left unprocessed. Only activate the constraint when a known charge yields a valid positive neutral mass; otherwise fall back to the configured fragment-charge search. This also handles negative/invalid masses gracefully. Adds regression tests covering absent, unknown (charge 0), and known precursor charge for both algorithms. Fixes #10067
Add a 3.6.0 Fixes entry for the Deisotoper change so the user-facing behaviour fix is recorded in the top-level CHANGELOG. Refs #10067
Address review feedback on #10073: the regression tests only exercised keep_only_deisotoped=true with a known precursor mass above the fragment mass, so they never verified the constraint is actually applied for known charges. Add, for both algorithms: - a known charge whose neutral mass is below the cluster, which must reject it (empty spectrum with keep_only_deisotoped) - a charge-array annotation check on the retained monoisotopic peak - a retention-mode case (keep_only_deisotoped=false) confirming an unassigned peak is kept Refs #10067
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change gates precursor-mass filtering on valid precursor charge data in both deisotoping methods. Regression tests cover unknown, valid, incompatible, and absent precursor metadata. ChangesDeisotoping precursor filtering
Suggested reviewers: Poem
Merge Risk: ⚪ Minimal · up to Unknown precursor charges now behave like spectra without precursor metadata while known valid precursor constraints remain enforced. The change is covered by targeted regression tests and is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
thanks! |
Extends the regression tests from #10073 to compare unknown-charge precursors directly with spectra without precursor metadata.
Both algorithms now check retained m/z values and charge arrays in both keep-only and retention modes, including charge 0 on an unrelated retained peak. The existing known-precursor checks remain in place.
This branch is based on #10073 because the connector cannot push to the contributor's fork. Merge #10073 first; this PR will then contain only the additional test assertions.
Validation: C++ test execution is delegated to CI; no local OpenMS build was run.
Summary by CodeRabbit
Bug Fixes
Tests