Repository navigation
[FIX,FORMAT,TOPP] #9864 Phase 0b: drop qpx_version from native Arrow writers, warn on paired MSstats_BioReplicate, fix Epifany -exp_design docs - #9900
Conversation
…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
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe changes add warnings for biological replicates spanning conditions, document Epifany experimental-design behavior, and remove ChangesExperimental-design handling
Native Parquet metadata
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/openms/source/FORMAT/MSstatsFile.cpp (1)
53-58: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winUse
'\n'instead ofstd::endl.This warning only needs a line terminator.
std::endlflushes the log stream and adds unnecessary work.Proposed change
- << bioreplicate << " values." << std::endl; + << bioreplicate << " values." << '\n';As per coding guidelines,
src/**/*.cppprefers\noverstd::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
📒 Files selected for processing (7)
CHANGELOGsrc/openms/source/FORMAT/ConsensusMapArrowIO.cppsrc/openms/source/FORMAT/FeatureMapArrowIO.cppsrc/openms/source/FORMAT/MSstatsFile.cppsrc/openms/source/FORMAT/ProteinIdentificationArrowIO.cppsrc/tests/class_tests/openms/source/ProteinIdentificationArrowIO_test.cppsrc/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
|
|
||
| // 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; | ||
| } | ||
| } |
There was a problem hiding this comment.
🎯 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 -200Repository: 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 -300Repository: 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"
doneRepository: OpenMS/OpenMS
Length of output: 39575
Add regression coverage for the new warning contract.
Cover both cases:
- A
MSstats_BioReplicatevalue reused under differentMSstats_Conditionvalues emits the warning and does not fail. - A
MSstats_BioReplicatevalue reused under oneMSstats_Conditionvalue 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
| 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); |
There was a problem hiding this comment.
🗄️ 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.
Audited PRs merged since the last CHANGELOG update (#9881): most of them (#9879, #9880, #9882, #9884, #9886, #9892, #9896, #9898, #9900, #9901, #9888) already carried their own CHANGELOG entries. Only the Docker library-stage fix (#9891) was missing one. Claude-Session: https://claude.ai/code/session_01Jgrv6mFL3oawgLdYs1efPH Co-authored-by: Claude <[email protected]>
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_versionConsensusMapArrowIO.cpp,FeatureMapArrowIO.cppandProteinIdentificationArrowIO.cppeach 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_typetokens likeconsensus_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:
validateQPXValuesForWriteuses the mere presence ofqpx_versionto decide a table is QPX. Today it then passes any unrecognizedfile_typestraight 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_versionare for the real QPX writers, at1.1, and those are untouched.§B7 / 0.6 — warn when a
MSstats_BioReplicatespans conditionscheckConditionLFQ_previously only checked that the two columns exist, with no value validation at all.A
MSstats_BioReplicatevalue recurring under two differentMSstats_Conditionvalues 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.It reaches
ProteomicsLFQ -out_msstatsand the isobaric path too, sincecheckConditionISO_delegates here.§B6 / 0.7a — Epifany
-exp_designis not "(Currently unused)"It has never been unused. On consensusXML input it selects
mergeProteinsAcrossFractionsAndReplicatesovermergeAllIDRuns(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
qpx_versionassertion was confirmed to fail on purpose. Re-adding the literal makesProteinIdentificationArrowIO_testfail withgot '5', expected '-1'at both sites; removing it passes again.MSstatsConverterTOPP tests pass unchanged."Currently unused"appears in no test data, and theWRITEINItests 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
qpx_versionmetadata entry.Documentation