Skip to content

Fix ProteomicsLFQ mzTab crash on non-string spectrum_reference - #9519

Merged
timosachsenberg merged 1 commit into
developfrom
claude/fervent-dirac-64hipn
Jun 15, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
claude/fervent-dirac-64hipn

Conversation

@timosachsenberg

Copy link
Copy Markdown
Contributor

The String->std::string refactor (#9450) made DataValue::operator
std::string() strict (throws on non-string types). The PeptideIdentification
string accessors getSpectrumReference()/getBaseName()/getExperimentLabel()
do return getMetaValue(...), which previously used the lenient
String(DataValue) stringification but now hit the strict operator.

When spectrum_reference is stored as an integer (e.g. a scan index loaded
from idparquet/mzIdentML), ProteomicsLFQ crashed during mzTab export with:
"Could not convert non-string DataValue of type 'Int' and value '0' to string"

The crash originated in MzTab's CMMzTabStream constructor via
getMSRunSpectrumIdentifierType_(), which read spectrum_reference directly
into a std::string; getSpectrumReference() (used in the peptide section)
would have thrown next. A sibling site was already wrapped with
StringUtils::toStr() in #9450, but these were missed.

Restore the lenient stringification (the documented StringUtils::toStr
replacement for the old String(DataValue) behavior) in the three accessors,
and use getSpectrumReference() at the direct mzTab call site. Add a
PeptideIdentification regression test for an integer spectrum_reference /
base_name.

The String->std::string refactor (#9450) made DataValue::operator
std::string() strict (throws on non-string types). The PeptideIdentification
string accessors getSpectrumReference()/getBaseName()/getExperimentLabel()
do `return getMetaValue(...)`, which previously used the lenient
String(DataValue) stringification but now hit the strict operator.

When spectrum_reference is stored as an integer (e.g. a scan index loaded
from idparquet/mzIdentML), ProteomicsLFQ crashed during mzTab export with:
  "Could not convert non-string DataValue of type 'Int' and value '0' to string"

The crash originated in MzTab's CMMzTabStream constructor via
getMSRunSpectrumIdentifierType_(), which read spectrum_reference directly
into a std::string; getSpectrumReference() (used in the peptide section)
would have thrown next. A sibling site was already wrapped with
StringUtils::toStr() in #9450, but these were missed.

Restore the lenient stringification (the documented StringUtils::toStr
replacement for the old String(DataValue) behavior) in the three accessors,
and use getSpectrumReference() at the direct mzTab call site. Add a
PeptideIdentification regression test for an integer spectrum_reference /
base_name.
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@timosachsenberg, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 2 minutes and 15 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9580e0ef-31a2-455a-b360-a5977d9a62c0

📥 Commits

Reviewing files that changed from the base of the PR and between 68eb1a5 and 1562570.

📒 Files selected for processing (3)
  • src/openms/source/FORMAT/MzTab.cpp
  • src/openms/source/METADATA/PeptideIdentification.cpp
  • src/tests/class_tests/openms/source/PeptideIdentification_test.cpp
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fervent-dirac-64hipn

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

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

@timosachsenberg
timosachsenberg merged commit ed2a1b8 into develop Jun 15, 2026
16 checks passed
@timosachsenberg
timosachsenberg deleted the claude/fervent-dirac-64hipn branch June 15, 2026 10:18
@github-actions

Copy link
Copy Markdown
Contributor

@timosachsenberg The following names might be missing from the AUTHORS file:

  • Claude

Please consider applying the following patch:

--- AUTHORS	2026-06-15 10:57:16.439741187 +0000
+++ AUTHORS.new	2026-06-15 10:57:21.305628110 +0000
@@ -23,8 +23,9 @@
  - Chirag Dave
  - Chris Bauer
  - Chris Bielow
- - Christie Mathews
  - Christian Ehrlich
+ - Christie Mathews
+ - Claude
  - Clemens Groepl
  - Cornelia Friedle
  - Daniel Jameson

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.

2 participants