Add MostAbundantMassDiffPpm psmtsv column header#1086
Merged
trishorts merged 3 commits intoJul 9, 2026
Merged
Conversation
Registers the optional "Most Abundant Mass Diff (ppm)" column in the canonical psmtsv header set (SpectrumMatchFromTsvHeader), alongside MassDiffPpm. This is the most-abundant-mode analogue of the monoisotopic Mass Diff (ppm): the observed most-abundant isotopic peak vs the candidate's theoretical averagine-apex mass. Previously the header string was defined locally in MetaMorpheus's PsmTsvWriter; moving it here makes mzLib the single source of truth for psmtsv column names, so MetaMorpheus (PR #2671) can reference the constant instead of duplicating the literal, and any mzLib reader can map the column by name. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirrors MassDiffPpm on the read side so the optional "Most Abundant Mass Diff (ppm)" column round-trips through the psmtsv reader, not just the header registry: - SpectrumMatchFromTsv.MostAbundantMassDiffPpm string property (null when the column is absent, matching how MassDiffPpm is read). - ParseHeader registers the column; GetOptionalValue reads it only when present, so monoisotopic-mode files (no column) are unaffected and nothing throws. - Disambiguation constructor copies/splits it null-safely (via ?.) for ambiguous matches, matching the MassDiffPpm treatment. Test: MostAbundantMassDiffPpm_OptionalColumn_ReadsAndDisambiguates covers absent->null, present-value read, non-ambiguous copy, and both disambiguation branches (single- and multi-segment monoisotopic mass). FileReadingTests 609/609 pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pcruzparri
approved these changes
Jul 9, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1086 +/- ##
==========================================
- Coverage 91.49% 91.49% -0.01%
==========================================
Files 390 390
Lines 50854 50860 +6
Branches 6154 6156 +2
==========================================
+ Hits 46529 46534 +5
Misses 3133 3133
- Partials 1192 1193 +1
🚀 New features to boost your workflow:
|
nbollis
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Registers the optional "Most Abundant Mass Diff (ppm)" psmtsv column in the canonical header set (
SpectrumMatchFromTsvHeader), alongsideMassDiffPpm. It is the most-abundant-mode analogue of the monoisotopicMass Diff (ppm): the observed most-abundant isotopic peak vs the candidate's theoretical averagine-apex mass.Why
The header string was previously defined locally inside MetaMorpheus's
PsmTsvWriter. Putting it here makes mzLib the single source of truth for psmtsv column names, so MetaMorpheus (smith-chem-wisc/MetaMorpheus#2671) can reference the constant instead of duplicating the literal, and any mzLib reader can map the column by name.Change
SpectrumMatchFromTsvHeader. No behavior change in mzLib; write/read of the column is driven entirely by the consumer.🤖 Generated with Claude Code