Skip to content

Add MostAbundantMassDiffPpm psmtsv column header#1086

Merged
trishorts merged 3 commits into
smith-chem-wisc:masterfrom
trishorts:most-abundant-mass-diff-psmtsv-header
Jul 9, 2026
Merged

Add MostAbundantMassDiffPpm psmtsv column header#1086
trishorts merged 3 commits into
smith-chem-wisc:masterfrom
trishorts:most-abundant-mass-diff-psmtsv-header

Conversation

@trishorts

Copy link
Copy Markdown
Contributor

Summary

Registers the optional "Most Abundant Mass Diff (ppm)" psmtsv column in the canonical header set (SpectrumMatchFromTsvHeader), alongside MassDiffPpm. It 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.

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

  • One added constant in SpectrumMatchFromTsvHeader. No behavior change in mzLib; write/read of the column is driven entirely by the consumer.

🤖 Generated with Claude Code

trishorts and others added 2 commits July 8, 2026 09:24
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>
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.49%. Comparing base (0897f21) to head (345918b).

Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
...ts/IndividualResultRecords/SpectrumMatchFromTsv.cs 89.07% <100.00%> (+0.11%) ⬆️
...ividualResultRecords/SpectrumMatchFromTsvHeader.cs 100.00% <ø> (ø)
...ernalResults/ResultFiles/SpectrumMatchTsvReader.cs 97.31% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@trishorts trishorts merged commit 9467ef5 into smith-chem-wisc:master Jul 9, 2026
5 checks passed
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