Skip to content

[FIX,FORMAT,TOPP] #9864 Phase 0b: drop qpx_version from native Arrow writers, warn on paired MSstats_BioReplicate, fix Epifany -exp_design docs - #9900

Merged
timosachsenberg merged 3 commits into
developfrom
fix/9864-phase0b
Aug 10, 2026

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Three small, independent, non-breaking fixes from the #9864 queue — §G 0.5, 0.6 and 0.7a. None changes a reported number and none touches a reference file.

§C4 / 0.5 — native Arrow writers no longer claim a qpx_version

ConsensusMapArrowIO.cpp, FeatureMapArrowIO.cpp and ProteinIdentificationArrowIO.cpp each stamped {"qpx_version", "1.0"} into the Parquet footer of .consensusparquet / .featureparquet / .idparquet.

Those are OpenMS-native round-trip files, not QPX exchange views — they use the native schemas and file_type tokens like consensus_features / features / proteins / protein_groups / search_params, none of which is a QPX view. The claim was also stale: the real QPX exporters stamp 1.1 (ArrowIOHelpers::qpxFileMetadata).

It matters slightly beyond cosmetics: validateQPXValuesForWrite uses the mere presence of qpx_version to decide a table is QPX. Today it then passes any unrecognized file_type straight through, so the key was inert — but the marker was wrong. Deleting it is what §C4 prescribes; bumping it "would only make the claim more precise and no less false".

Verified no reader consumes the key — the only assertions on qpx_version are for the real QPX writers, at 1.1, and those are untouched.

§B7 / 0.6 — warn when a MSstats_BioReplicate spans conditions

checkConditionLFQ_ previously only checked that the two columns exist, with no value validation at all.

A MSstats_BioReplicate value recurring under two different MSstats_Condition values declares the same biological unit measured in each — a paired / repeated-measures design, which MSstats models differently from an unpaired one. sdrf-pipelines assigns a globally unique id per source name, so a recurrence normally means a hand-written design. It is legitimate when intended, so this warns rather than refuses, exactly as §G 0.6 asks.

Warning: MSstats_BioReplicate '1' occurs under 4 different MSstats_Condition values (1, 2, 3, 4).
MSstats will treat it as one biological unit measured in each, i.e. a paired design.
If these are unrelated samples, give them distinct MSstats_BioReplicate values.

It reaches ProteomicsLFQ -out_msstats and the isobaric path too, since checkConditionISO_ delegates here.

§B6 / 0.7a — Epifany -exp_design is not "(Currently unused)"

It has never been unused. On consensusXML input it selects mergeProteinsAcrossFractionsAndReplicates over mergeAllIDRuns (Epifany.cpp:275-278) — a real behavioural difference. The description now says what it does, and adds the nuance that it is ignored for idXML input, which is true and was not documented anywhere.

Verification

  • The new qpx_version assertion was confirmed to fail on purpose. Re-adding the literal makes ProteinIdentificationArrowIO_test fail with got '5', expected '-1' at both sites; removing it passes again.
  • The BioReplicate warning was confirmed to fire and not to false-positive: it triggers on a constructed paired design (bioreplicate 1 under conditions 1–4) and stays silent on the shipped unpaired designs — all 8 MSstatsConverter TOPP tests pass unchanged.
  • 88 Arrow/QPX/parquet/IDRipper tests and 20 MSstats/Epifany/ArrowIO tests pass.
  • No reference-file churn: "Currently unused" appears in no test data, and the WRITEINI tests check only the section name, not the INI body.

Closes §G 0.5, §G 0.6 and the Epifany half of §G 0.7 in #9864. Related: #9898 (the Triqler half of 0.7).

🤖 Generated with Claude Code

https://claude.ai/code/session_01S7QNzj4dhRnX5htcHZFmDm

Summary by CodeRabbit

  • Bug Fixes

    • Added warnings when biological replicate identifiers span multiple experimental conditions.
    • Native Parquet exports no longer include the qpx_version metadata entry.
  • Documentation

    • Clarified Epifany’s experimental design option, including its behavior for consensusXML and idXML inputs.

…ats BioReplicate warning, Epifany doc

Three small, independent, non-breaking fixes from the #9864 queue (§G 0.5, 0.6, 0.7a).
None changes a reported number and none touches a reference file.

§C4 / 0.5 -- the native Arrow round-trip writers no longer stamp qpx_version.
ConsensusMapArrowIO, FeatureMapArrowIO and ProteinIdentificationArrowIO each wrote
{"qpx_version", "1.0"} into the Parquet footer of .consensusparquet / .featureparquet /
.idparquet. Those are OpenMS-native round-trip files, not QPX exchange views: they use
the native schemas and file_type tokens such as consensus_features / features / proteins
/ protein_groups / search_params, none of which is a QPX view. The claim was also stale --
the real QPX exporters stamp 1.1 (ArrowIOHelpers::qpxFileMetadata). It mattered beyond
cosmetics because validateQPXValuesForWrite uses the mere presence of qpx_version to
decide a table is QPX; today it then passes any unrecognized file_type through, so the
key was inert, but the marker was wrong. Deleting it is what #9864 C4 prescribes --
bumping it would only make a false claim more precise. Verified no reader consumes the
key; the only assertions on it are for the real QPX writers, at 1.1.

§B7 / 0.6 -- warn when one MSstats_BioReplicate occurs under several MSstats_Condition
values. checkConditionLFQ_ previously only checked that both columns exist, with no value
validation. A recurring label declares the same biological unit measured in each
condition, i.e. a paired / repeated-measures design, which MSstats models differently
from an unpaired one. sdrf-pipelines assigns a globally unique id per source name, so a
recurrence normally means a hand-written design. Legitimate when intended, hence a
warning and not a refusal. Reaches ProteomicsLFQ -out_msstats and the ISO path too, since
checkConditionISO_ delegates here.

§B6 / 0.7a -- Epifany -exp_design was documented "(Currently unused)" and has never been
unused: on consensusXML input it selects mergeProteinsAcrossFractionsAndReplicates over
mergeAllIDRuns (Epifany.cpp:275-278). The description now states what it does and that it
is ignored for idXML input.

Verification:
- The new qpx_version assertion was confirmed to fail on purpose: re-adding the literal
  makes ProteinIdentificationArrowIO_test fail with "got '5', expected '-1'" at both
  sites, and pass again once removed.
- The BioReplicate warning fires on a constructed paired design (bioreplicate 1 under
  conditions 1,2,3,4) and stays silent on the shipped unpaired designs -- all 8
  MSstatsConverter TOPP tests pass unchanged.
- 88 Arrow/QPX/parquet/IDRipper tests and 20 MSstats/Epifany/ArrowIO tests pass.
- No reference-file churn: "Currently unused" appears in no test data, and the WRITEINI
  tests check only the section name, not the INI body.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01S7QNzj4dhRnX5htcHZFmDm
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 10a422e6-9403-4c65-ade4-ac29146304d0

📥 Commits

Reviewing files that changed from the base of the PR and between 18e991e and 87d063e.

📒 Files selected for processing (1)
  • CHANGELOG

📝 Walkthrough

Walkthrough

The changes add warnings for biological replicates spanning conditions, document Epifany experimental-design behavior, and remove qpx_version from native Parquet metadata. Protein and protein-group export tests verify the metadata change.

Changes

Experimental-design handling

Layer / File(s) Summary
Validation warning and option documentation
src/openms/source/FORMAT/MSstatsFile.cpp, src/topp/Epifany.cpp, CHANGELOG
MSstats validation warns when one biological replicate spans multiple conditions. Epifany documents exp_design behavior for consensusXML and idXML inputs.

Native Parquet metadata

Layer / File(s) Summary
Remove native qpx_version metadata
src/openms/source/FORMAT/*ArrowIO.cpp, src/tests/class_tests/openms/source/ProteinIdentificationArrowIO_test.cpp, CHANGELOG
Native Parquet writers no longer emit qpx_version. Protein and protein-group export tests verify its absence. QPX exporters remain unchanged.

Possibly related PRs

Poem

A rabbit checks each file with care,
No qpx_version lingers there.
Crossing replicates raise a sign,
Epifany documents the design.
Tests confirm the output stays—
Clean metadata marks the way.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 summarizes all three primary fixes and identifies the related issue, although it is longer than preferred.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/9864-phase0b

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/openms/source/FORMAT/MSstatsFile.cpp (1)

53-58: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Use '\n' instead of std::endl.

This warning only needs a line terminator. std::endl flushes the log stream and adds unnecessary work.

Proposed change
-                      << bioreplicate << " values." << std::endl;
+                      << bioreplicate << " values." << '\n';

As per coding guidelines, src/**/*.cpp prefers \n over std::endl.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openms/source/FORMAT/MSstatsFile.cpp` around lines 53 - 58, Update the
warning output in the MSstats file parsing code to use the newline character
'\n' instead of std::endl, preserving the existing message and stream behavior
without forcing a flush.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/openms/source/FORMAT/MSstatsFile.cpp`:
- Around line 36-60: Add regression tests covering the warning logic in
storeISO() and the corresponding LFQ path through checkConditionISO_() and
checkConditionLFQ_(): verify reused MSstats_BioReplicate values across different
MSstats_Condition values emit a warning without failing, while reuse within one
condition emits no warning. Use the existing MSstats test utilities and
logging-capture conventions, and cover both label-free and isobaric designs.

In `@src/topp/Epifany.cpp`:
- Line 107: The experimental-design description must state that protein
identifications are merged across fractions and replicates within each
Condition, rather than referring ambiguously to each sample. Update the
registration text in src/topp/Epifany.cpp at lines 107-107 and apply the same
condition-based wording to the release note in CHANGELOG at lines 505-508.

---

Nitpick comments:
In `@src/openms/source/FORMAT/MSstatsFile.cpp`:
- Around line 53-58: Update the warning output in the MSstats file parsing code
to use the newline character '\n' instead of std::endl, preserving the existing
message and stream behavior without forcing a flush.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d25ca9e8-f5df-48fd-ad17-a559d53238c1

📥 Commits

Reviewing files that changed from the base of the PR and between 9dce983 and d6e75d2.

📒 Files selected for processing (7)
  • CHANGELOG
  • src/openms/source/FORMAT/ConsensusMapArrowIO.cpp
  • src/openms/source/FORMAT/FeatureMapArrowIO.cpp
  • src/openms/source/FORMAT/MSstatsFile.cpp
  • src/openms/source/FORMAT/ProteinIdentificationArrowIO.cpp
  • src/tests/class_tests/openms/source/ProteinIdentificationArrowIO_test.cpp
  • src/topp/Epifany.cpp
💤 Files with no reviewable changes (3)
  • src/openms/source/FORMAT/FeatureMapArrowIO.cpp
  • src/openms/source/FORMAT/ConsensusMapArrowIO.cpp
  • src/openms/source/FORMAT/ProteinIdentificationArrowIO.cpp

Comment on lines +36 to +60

// A BioReplicate label that recurs under two different Conditions declares the same biological
// unit measured in both -- i.e. a paired / repeated-measures design, which MSstats models
// differently from an unpaired one. sdrf-pipelines assigns a globally unique id per source name,
// so a recurrence normally means a hand-written design and is worth surfacing. It is a legitimate
// encoding when intended, so warn rather than refuse (#9864 B7).
std::map<std::string, std::set<std::string>> bioreplicate_to_conditions;
for (const std::string& sample : sampleSection.getSamples())
{
bioreplicate_to_conditions[sampleSection.getFactorValue(sample, bioreplicate)].insert(
sampleSection.getFactorValue(sample, condition));
}

for (const auto& [replicate, conditions] : bioreplicate_to_conditions)
{
if (conditions.size() > 1)
{
OPENMS_LOG_WARN << "Warning: " << bioreplicate << " '" << replicate << "' occurs under "
<< conditions.size() << " different " << condition << " values ("
<< ListUtils::concatenate(std::vector<std::string>(conditions.begin(), conditions.end()), ", ")
<< "). MSstats will treat it as one biological unit measured in each, i.e. a "
"paired design. If these are unrelated samples, give them distinct "
<< bioreplicate << " values." << std::endl;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate files =="
git ls-files | rg '(^|/)MSstatsFile\.(cpp|h)$|test.*MSstats|MSstats.*test|MSstatsFileTest' || true

echo
echo "== inspect MSstatsFile.cpp around relevant area =="
if [ -f src/openms/source/FORMAT/MSstatsFile.cpp ]; then
  nl -ba src/openms/source/FORMAT/MSstatsFile.cpp | sed -n '1,120p'
fi

echo
echo "== search for MSstatsFile symbols/tests =="
rg -n "MSstatsFile|checkConditionIso|checkConditionLFQ|checkConditionISO|BioReplicate|conditionISO|ConditionISO" -S . \
  --glob '!test_results/**' --glob '!build/**' --glob '!dist/**' | head -200

Repository: OpenMS/OpenMS

Length of output: 971


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== MSstatsFile.cpp relevant section =="
cat -n src/openms/source/FORMAT/MSstatsFile.cpp | sed -n '1,110p'

echo
echo "== header mentions/exporter methods =="
cat -n src/openms/include/OpenMS/FORMAT/MSstatsFile.h | sed -n '1,220p'

echo
echo "== MSstatsFile_test.cpp =="
cat -n src/tests/class_tests/openms/source/MSstatsFile_test.cpp | sed -n '1,260p'

echo
echo "== TOPP MSstats tests =="
for f in $(git ls-files 'src/tests/topp/MSstatsConverter*'); do
  echo "--- $f"
  sed -n '1,220p' "$f"
done

echo
echo "== search for relevant warnings/errors =="
rg -n "BioReplicate|ConditionISO|checkConditionISO|checkConditionLFQ|MSstatsFile|MSstatsConverter|paired|unpaired|Warning:|warn|warning" -S src/tests/openms src/tests/topp src/openms/source/FORMAT/MSstatsFile.cpp src/openms/include/OpenMS/FORMAT/MSstatsFile.h --glob '!test_results/**' --glob '!build/**' --glob '!dist/**' | head -300

Repository: OpenMS/OpenMS

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Relevant warnings/searches in MSstats sources and tests =="
rg -n "BioReplicate|ConditionISO|checkConditionISO|checkConditionLFQ|MSstatsFile|MSstatsConverter|paired design|paired design|distinct Bio|distinct BioReplicate|distinct" -S \
  src/tests src/openms/source/FORMAT/MSstatsFile.cpp src/openms/include/OpenMS/FORMAT/MSstatsFile.h \
  --glob '!test_results/**' --glob '!build/**' --glob '!dist/**' \
  | sed -n '1,240p'

echo
echo "== MSstats converter test scripts =="
for f in MSstatsConverter_1 MSstatsConverter_2 MSstatsConverter_3 MSstatsConverter_subset; do
  file="src/tests/topp/${f}.topp"
  if [ -f "$file" ]; then
    echo "--- $file"
    sed -n '1,180p' "$file"
  fi
done

echo
echo "== design files for BioReplicate reuse =="
for f in src/tests/topp/MSstatsConverter_*_design.tsv src/tests/topp/MSstatsConverter_subset_design.tsv; do
  [ -f "$f" ] || continue
  echo "--- $f"
  sed -n '1,220p' "$f"
done

Repository: OpenMS/OpenMS

Length of output: 39575


Add regression coverage for the new warning contract.

Cover both cases:

  • A MSstats_BioReplicate value reused under different MSstats_Condition values emits the warning and does not fail.
  • A MSstats_BioReplicate value reused under one MSstats_Condition value does not emit the warning.

storeISO() delegates to checkConditionLFQ_() through checkConditionISO_(), so include coverage for an isobaric design as well. Existing MSstats tests do not cover this branch.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openms/source/FORMAT/MSstatsFile.cpp` around lines 36 - 60, Add
regression tests covering the warning logic in storeISO() and the corresponding
LFQ path through checkConditionISO_() and checkConditionLFQ_(): verify reused
MSstats_BioReplicate values across different MSstats_Condition values emit a
warning without failing, while reuse within one condition emits no warning. Use
the existing MSstats test utilities and logging-capture conventions, and cover
both label-free and isobaric designs.

Source: Coding guidelines

Comment thread src/topp/Epifany.cpp
registerInputFileList_("in", "<file>", StringList(), "Input: identification results");
setValidFormats_("in", {"idXML","consensusXML"});
registerInputFile_("exp_design", "<file>", "", "(Currently unused) Input: experimental design", false);
registerInputFile_("exp_design", "<file>", "", "Input: experimental design. Only read when the input is consensusXML, where it merges protein identifications across the fractions and replicates of each sample; without it every ID run is merged into one. Ignored for idXML input.", false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Describe the merge scope as condition-based in both locations.

The runtime groups entries by Condition and creates one identification run per condition. “Each sample” is ambiguous because Sample, MSstats_Condition, and MSstats_BioReplicate are separate design fields.

  • src/topp/Epifany.cpp#L107-L107: replace “each sample” with explicit condition-based wording.
  • CHANGELOG#L505-L508: use the same condition-based wording in the release note.
📍 Affects 2 files
  • src/topp/Epifany.cpp#L107-L107 (this comment)
  • CHANGELOG#L505-L508
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/topp/Epifany.cpp` at line 107, The experimental-design description must
state that protein identifications are merged across fractions and replicates
within each Condition, rather than referring ambiguously to each sample. Update
the registration text in src/topp/Epifany.cpp at lines 107-107 and apply the
same condition-based wording to the release note in CHANGELOG at lines 505-508.

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.

1 participant