Skip to content

[FIX] Sanitize NaN MS-GF+ fragment error stdevs - #10382

Merged
timosachsenberg merged 2 commits into
developfrom
jpfeuffer-fix-tmt-percolator-nan-feature
Oct 1, 2026
Merged

timosachsenberg merged 2 commits into
developfrom
jpfeuffer-fix-tmt-percolator-nan-feature

Conversation

@jpfeuffer

@jpfeuffer jpfeuffer commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Set non-finite MS-GF+ fragment error standard deviations to 0 in PercolatorFeatureSetHelper::addMSGFFeatures.
  • Add a unit test covering string-typed and double NaNs while verifying finite values and unrelated features remain unchanged.
  • Document the fix in the CHANGELOG.

MS-GF+ computes these standard deviations as sqrt(E[x^2] - mean^2) in single precision. When fragment errors are identical, rounding can produce a slightly negative variance and MS-GF+ writes NaN. PercolatorAdapter began rejecting non-finite features in 3.6.0, causing the quantms TMT PERCOLATOR step to fail.

Validation

Reproduced the quantms TMT failure with the v3.6.0 container and the test dataset/settings from bigbio/quantms#736. Replacing the two NaN stdev values in the reproduced input with 0.0 allowed PercolatorAdapter to complete. The OpenMS change has not yet been compiled or run through the C++ unit test locally.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where non-finite MS-GF+ fragment-error standard-deviation values could cause Percolator to reject rescoring output. Affected values are now set to zero before rescoring, while finite standard-deviation values and other fragment-error measurements remain unchanged. This helps ensure that MS-GF+ results with invalid standard deviations can be processed successfully.

MS-GF+ computes the -addFeatures fragment error standard deviations as
sqrt(E[x^2] - mean^2) in single precision; with identical fragment errors
the variance rounds below 0 and MS-GF+ writes "NaN". Since #10314 the
in-process PercolatorAdapter rejects non-finite features, which broke the
quantms TMT tests with OpenMS 3.6.0 (bigbio/quantms#736). The variance is
~0, so addMSGFFeatures now sets these features to 0.

Co-authored-by: Copilot App <[email protected]>
@jpfeuffer

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 00e23fb0-9f99-427a-bce4-b86b1b8e1b20

📥 Commits

Reviewing files that changed from the base of the PR and between 21db2a8 and 3bdad29.

📒 Files selected for processing (1)
  • CHANGELOG
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

addMSGFFeatures now replaces non-finite values in four MS-GF+ fragment-error standard-deviation features with zero. The change includes tests for conversion and value preservation, plus documentation of the behavior.

Changes

MS-GF+ feature normalization

Layer / File(s) Summary
Detect and normalize non-finite features
src/openms/include/OpenMS/ANALYSIS/ID/PercolatorFeatureSetHelper.h, src/openms/source/ANALYSIS/ID/PercolatorFeatureSetHelper.cpp, src/tests/class_tests/openms/source/PercolatorFeatureSetHelper_test.cpp, CHANGELOG
addMSGFFeatures checks four standard-deviation fields and replaces non-finite numeric values and recognized numeric strings with zero. String values remain strings. The test checks conversion, unchanged fields, and absent fields. The documentation and changelog describe the behavior.

Priority: ➖ Normal

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 3bdad

The change handles non-finite MS-GF+ fragment-error standard deviations while preserving finite values and unrelated metadata. No actionable merge-blocking issue remains, subject to normal build and test checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: sanitizing NaN MS-GF+ fragment-error standard deviations in Percolator feature processing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

A rabbit checks the features with care,
And turns NaN to zero there.
Four small fields now pass the test,
String types stay as they were set.
The changelog records the change,
While Percolator gets values in range.

Comment @coderabbitai help to get the list of available commands.

…percolator-nan-feature

# Conflicts:
#	CHANGELOG

Co-authored-by: jpfeuffer <[email protected]>

Copilot AI commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Merged develop and resolved the CHANGELOG conflict, preserving both entries. Merge commit: 3bdad29.

@timosachsenberg
timosachsenberg merged commit be727ad into develop Oct 1, 2026
16 of 17 checks passed
@timosachsenberg
timosachsenberg deleted the jpfeuffer-fix-tmt-percolator-nan-feature branch October 1, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants