Repository navigation
[FIX,TEST] Correct ProteinQuantifier charge selection - #9847
Conversation
|
Note Status after rebase
The detailed findings are retained below for follow-up. Code review — 15 findingsThe dominant theme: the new A. New validator refuses inputs that exported fine before1.
Evidence from the PR: it added 2.
Direct in-PR evidence that this is not hypothetical: 3. The feature-view key is (peptidoform, charge, run_file_name, rt), with So for a ProteomicsLFQ/FeatureLinker map with tens of thousands of unidentified features in one run, most sharing a charge, the key is RT alone. 4.
5. The deleted comment enumerated the reachable inputs — "Two ProteinIdentifications whose paths share a stem, a repeated accession group, or two identifiers mapping to one path list" — and concluded "Emitting both is deliberate -- dropping a row loses data and no merge rule exists for two group probabilities". The id-only overload emits one row per (prot_id, group, evidence run) with no cross-prot_id dedup, so an idXML with two runs sharing an anchor accession and a run stem now trips both the PK check and the new B. Label canonicalisation6.
7.
8. (a) For a mixed heavy label such as (b) Conversely, The added tests cover C. Partial / truncated output9. Its own comment says it exists to "Catch both before the feature and PSM writers can leave a partial collection behind", and the CHANGELOG for #9843 claims "a refused -out_qpx export no longer leaves a partial collection for deterministic input errors". It checks protein IDs/groups, merge indices, channel labels, design samples and fraction groups — but no PK uniqueness, no scan emptiness, no run_file_name emptiness, no label value; 10. The new D. Quantification semantics (
|
|
@timosachsenberg one thing we should make sure and double check is the handling of technical replicates of the same sample. I am not sure about our current samplesheet definitions but when we are checking that channels in a fraction group must map to the same sample and not be reused across fraction groups, we need to do that in a way that considers biological and technical replicates also. I think the idea was to avoid redefining sample properties for replicates so you can have the same "sample" in multiple channels if they are replicates of each other. Do you know what I mean? |
Select a single charge state per peptide across all samples by prevalence and summed abundance, then retain all observations for the chosen charge. Correct file/channel peptide aggregation so detailed and QPX outputs use consistent quantities. Fixes #9796
a343297 to
263ec86
Compare
|
@jpfeuffer Yes — and I double-checked this against the current implementation.
This is covered by |
That's what worries me! I am not sure if they should. A replicate of a sample is technically a "different" sample (for quantification purposes, not annotation purposes) and should have another normalization factor |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/ANALYSIS/QUANTITATION/PeptideAndProteinQuant.cpp`:
- Around line 332-337: Update the best-charge handling around getBestCharge_ in
the pep_quant_ loop so a missing selected charge skips only abundance
aggregation, not the subsequent PSM-count aggregation and quant_peptides
statistic. Preserve best_charge_by_peptidoform_ updates for selected charges and
ensure peptidoforms with no valid charge still reach the total_psm_counts logic.
In `@src/tests/topp/CMakeLists.txt`:
- Around line 2900-2902: Rename the temporary output file used by the new
TOPP_ProteinQuantifier_19 test and update TOPP_ProteinQuantifier_19_out1 to
consume that same renamed path, ensuring it differs from the output owned by
TOPP_ProteinQuantifier_19_qpx. Leave the non-colliding _18 paths unchanged.
🪄 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: e7967fdd-15a2-43b4-a5bb-9eba58bd5ea4
⛔ Files ignored due to path filters (2)
src/tests/topp/ProteinQuantifier_18_input.tsvis excluded by!**/*.tsvsrc/tests/topp/ProteinQuantifier_20_input.tsvis excluded by!**/*.tsv
📒 Files selected for processing (13)
CHANGELOGsrc/openms/include/OpenMS/ANALYSIS/QUANTITATION/PeptideAndProteinQuant.hsrc/openms/source/ANALYSIS/QUANTITATION/PeptideAndProteinQuant.cppsrc/tests/class_tests/openms/source/PeptideAndProteinQuant_test.cppsrc/tests/topp/CMakeLists.txtsrc/tests/topp/ProteinQuantifier_18_input.consensusXMLsrc/tests/topp/ProteinQuantifier_18_output.txtsrc/tests/topp/ProteinQuantifier_19_output.txtsrc/tests/topp/ProteinQuantifier_20_input.consensusXMLsrc/tests/topp/ProteinQuantifier_20_output.txtsrc/tests/topp/ProteinQuantifier_21_output.txtsrc/tests/topp/ProteinQuantifier_22_output.txtsrc/topp/ProteinQuantifier.cpp
| Int best_charge = 0; | ||
| if (!getBestCharge_(pep_q.second.abundances, best_charge)) | ||
| { | ||
| continue; | ||
| } | ||
|
|
||
| // quantify according to the best combination only: | ||
| size_t best_fraction = std::get<0>(best_combination); | ||
| std::string best_filename = std::get<1>(best_combination); | ||
| size_t best_charge = std::get<2>(best_combination); | ||
| UInt best_channel = std::get<3>(best_combination); | ||
|
|
||
| double abundance = pep_q.second.abundances[best_fraction][best_filename][best_charge][best_channel]; | ||
| const DesignCell& cell = getDesignCellFromFilenameAndChannel_(best_filename, best_channel); | ||
| pep_q.second.total_abundances[cell.sample] = abundance; | ||
| pep_q.second.fraction_group_abundances[cell.fraction_group][best_channel] = abundance; | ||
| best_charge_by_peptidoform_[pep_q.first] = best_charge; |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Do not skip PSM-count aggregation when no charge is selected.
The continue at line 335 exits the whole pep_quant_ loop body. It therefore also skips the PSM-count aggregation at lines 383-400 and the quant_peptides statistic at line 403. The default (non-best-charge) branch always runs those blocks. A peptidoform with only zero abundances (for example an isobaric reporter that IsobaricChannelExtractor stored as 0.0) then loses its total_psm_counts, so spectral-counting output differs between the two modes for the same input.
Restrict the early exit to the abundance aggregation only.
🐛 Proposed fix to keep PSM counts for peptidoforms without a selected charge
Int best_charge = 0;
- if (!getBestCharge_(pep_q.second.abundances, best_charge))
- {
- continue;
- }
- best_charge_by_peptidoform_[pep_q.first] = best_charge;
-
- // Retain every observation of the selected charge. Sample abundances span all fractions;
- // fraction-group/label abundances retain the QPX quantification grain. Explicit zeros are
- // kept in both maps but did not count as evidence when the charge was selected above.
- for (const auto& fa : pep_q.second.abundances)
- {
- for (const auto& fna : fa.second)
- {
- auto charge_it = fna.second.find(best_charge);
- if (charge_it == fna.second.end()) { continue; }
- for (const auto& [channel, abundance] : charge_it->second)
- {
- const DesignCell& cell = getDesignCellFromFilenameAndChannel_(fna.first, channel);
- pep_q.second.total_abundances[cell.sample] += abundance;
- pep_q.second.fraction_group_abundances[cell.fraction_group][channel] += abundance;
- }
- }
- }
+ if (getBestCharge_(pep_q.second.abundances, best_charge))
+ {
+ best_charge_by_peptidoform_[pep_q.first] = best_charge;
+
+ // Retain every observation of the selected charge. Sample abundances span all fractions;
+ // fraction-group/label abundances retain the QPX quantification grain. Explicit zeros are
+ // kept in both maps but did not count as evidence when the charge was selected above.
+ for (const auto& fa : pep_q.second.abundances)
+ {
+ for (const auto& fna : fa.second)
+ {
+ auto charge_it = fna.second.find(best_charge);
+ if (charge_it == fna.second.end()) { continue; }
+ for (const auto& [channel, abundance] : charge_it->second)
+ {
+ const DesignCell& cell = getDesignCellFromFilenameAndChannel_(fna.first, channel);
+ pep_q.second.total_abundances[cell.sample] += abundance;
+ pep_q.second.fraction_group_abundances[cell.fraction_group][channel] += abundance;
+ }
+ }
+ }
+ }🤖 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/ANALYSIS/QUANTITATION/PeptideAndProteinQuant.cpp` around
lines 332 - 337, Update the best-charge handling around getBestCharge_ in the
pep_quant_ loop so a missing selected charge skips only abundance aggregation,
not the subsequent PSM-count aggregation and quant_peptides statistic. Preserve
best_charge_by_peptidoform_ updates for selected charges and ensure peptidoforms
with no valid charge still reach the total_psm_counts logic.
I am not sure if this design should be allowed! Exactly the same sample without a technical replication annotation should not be measurable across fraction_groups. Either we implicitly assume those are technical replicates when such a case is found or (probably better) we should error out! |
|
An exception might be Bridge channels across TMT plexes (fraction_groups). In this case I think we need a more flexible sample normalization algorithm however. I think for qpx this all might be fine as long as sample normalization is off. I agree that if you write it out per "grouped_run" it should be fine. |
…t paths Addresses review findings 11, 12 and 14 on #9847, and updates the ProteomicsLFQ reference values that the file+channel aggregation fix changes. writePeptideTable_ ('-peptide_out' with 'best_charge_and_fraction'): - the header keyed the design's spectra file paths by fraction group, so all fractions of a group collapsed onto whichever file the design listed last (11 of 12 files vanished for a 12-fraction group). Now keyed by (fraction group, fraction), like the protein table already was. - two of the three "no value here" cases emitted nothing instead of 0.0, so a peptide absent from a file shifted every later cell of its row one column left and the trailing 'fraction' value landed under an abundance header. Every (file, channel) cell now always writes a value. Pinned by the new TOPP test ProteinQuantifier_28 on a fractionated design. quantifyPeptides(): a peptidoform with no positive observation skipped the rest of the loop body via 'continue', which also skipped the PSM-count aggregation. Spectral counts are identification evidence and must not depend on the charge-selection flag. (Latent today: PeptideData::psm_counts is never written anywhere, so the loop it skipped is currently a no-op.) Tests: the new TOPP tests were numbered 18-22, but 18 and 19 are already taken by the "_qpx" tests and TOPP_ProteinQuantifier_19 shared a temp output path with TOPP_ProteinQuantifier_19_qpx. Under a parallel ctest one run could clobber the other's output between producer and FuzzyDiff. Renumbered to 23-27. References: nine 'indistinguishable_proteins_N_file_channel_level_abundance' values across the eight ProteomicsLFQ consensusXML references. Verified rather than regenerated - rebuilding the same tree with only PeptideAndProteinQuant reverted isolates these nine lines as the whole effect of the change, and the unchanged sample-level 'abundances' prove the new values right: both spectral-counting tests run 'top:N' 0 with 'top:aggregate' sum, where a sample's cells must sum exactly to its sample-level value, and only the new cells do (ProteomicsLFQ_4: 19+16, 16+15, 15+10 = 35, 31, 25, against 24, 29, 18 before). Recomputing the feature-intensity cells from the consensus features independently reproduces the new values and disagrees with the old ones on exactly the two cells that change. Everything else in those files is untouched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ
Review response — findings 11–14Worked through the four findings that were still actionable here. Summary of what changed, what did not, and one correction to the review. 11 — detailed peptide TSV: confirmed, fixedBoth halves reproduce. Running the pre-fix binary on a fractionated two-file design: fileA's two columns are gone — Now keyed by 12 — confirmed mechanically, but the stated impact does not existThe But the loop it skipped is dead code today: The fix is still right — it restores the invariant for whenever those counts get populated upstream — but it could not be given a failing test, since the member is unreachable from the public C++ API. 13 — confirmed as behaviour, deliberately not changedThe retention loop does materialise Fixing it only here would make "quantified in a sample" mean two different things depending on a flag. Fixing it globally in 14 — confirmed, renumbered
The eight ProteomicsLFQ referencesRoot-caused rather than refreshed. Rebuilding the identical tree with only The unchanged sample-level values are what prove the new numbers right. Both spectral-counting tests run Same for both groups of ProteomicsLFQ_6. And recomputing the feature-intensity cells independently from the consensus features in the output — "per file, one summed value per peptide over its peptidoforms and charges, top 3, median" — reproduces all six new cells exactly while disagreeing with the old values on precisely the two that changed. Only those nine lines were edited. That matters because this machine cannot reproduce the references byte-for-byte (feature intensities drift up to 8.4e-5 relative against a 1e-2 FuzzyDiff tolerance), so a wholesale regeneration would have baked hundreds of lines of local noise into them for no reason. Findings 1–10 and 15Followed up separately in #9849: 3, 9 and 10 turned out to be reachable and are fixed there, along with 15 ( #9850 fixes an unrelated pre-existing break found on the way: |
📝 WalkthroughWalkthrough
ChangesBest-charge selection and detailed protein aggregation
Sequence Diagram(s)sequenceDiagram
participant ProteinQuantifier
participant PeptideAndProteinQuant
participant ChargeSelector
participant ProteinOutput
ProteinQuantifier->>PeptideAndProteinQuant: quantify peptide observations
PeptideAndProteinQuant->>ChargeSelector: select charge by prevalence and abundance
ChargeSelector-->>PeptideAndProteinQuant: selected charge per peptidoform
PeptideAndProteinQuant->>ProteinOutput: aggregate selected peptides by sample and file/channel
ProteinOutput-->>ProteinQuantifier: write protein and detailed peptide output
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (3)
src/topp/ProteinQuantifier.cpp (2)
464-471: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueFix brace placement and rename the misleading
abundancevariable.The
forloops at lines 467 and 468 place the opening brace on the same line as theforstatement. The rest of this diff (for example line 480) places the opening brace on its own line. As per coding guidelines: "format C++ with 2-space indentation, Unix line endings, spaces after control-flow keywords, spaces around binary operators, and braces on their own aligned lines; always use braces for blocks."Separately, at line 468,
abundancein the structured binding is amap<UInt, double>(channel → value), not a scalar abundance. It shares its name with the unrelateddouble abundancedeclared later at line 489 in a different scope, which makes the function harder to read. Rename it, for examplechannel_abundancesor_if unused.🔧 Proposed fix
- for (const auto& filenames : filename_to_chargemap) { - for (const auto& [charge, abundance] : filenames.second) { + for (const auto& filenames : filename_to_chargemap) + { + for (const auto& [charge, channel_abundances] : filenames.second) + { charge_of_peptide.insert(charge); // store the charge state for this peptide } }🤖 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/ProteinQuantifier.cpp` around lines 464 - 471, Update the nested loops in the charge-state collection block to place each opening brace on its own aligned line, preserving the existing two-space indentation and brace style. In the structured binding within the loop over filename_to_chargemap, rename the unused abundance binding to a descriptive name such as channel_abundances, without changing the iteration or charge_of_peptide behavior.Source: Coding guidelines
399-413: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the (fraction_group, fraction) → filename map building into a shared helper.
Lines 399-413 rebuild the same map that
writeProteinTable_already builds at lines 605-613, both by iteratingmsfile_section. The bug this PR fixes (finding 11: keying by fraction group alone collapsed all fractions onto one filename) affected one of these two independent copies. Keeping two separate implementations of the same mapping risks the same class of bug recurring if only one copy is updated in the future.Extract a private helper, for example
buildDesignFractionFilenameMap_(const ExperimentalDesign& ed), and call it from bothwritePeptideTable_andwriteProteinTable_.🤖 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/ProteinQuantifier.cpp` around lines 399 - 413, Extract the loop that builds design_group_fraction_filename by iterating msfile_section into a private helper method (such as buildDesignFractionFilenameMap_) that accepts the ExperimentalDesign as a parameter and returns the map keyed by (fraction_group, fraction). Replace the current loop in writePeptideTable_ with a call to this helper. Update the existing duplicate loop in writeProteinTable_ at lines 605-613 to also call this shared helper, eliminating the separate implementation and preventing future divergence between the two independent copies.src/tests/topp/ProteinQuantifier_27_output.txt (1)
2-4: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winMake the top-N regression distinguish zero observations.
The
top:N=3setting on Line [2] selects all three peptides. The zero-only record on Line [4] cannot detect whether explicit zeros affect quantified-sample coverage or top-N ranking. Add at least four candidate peptides with mixed zero and positive selected-charge observations, then assert the selected top-N peptides and aggregate.🤖 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/tests/topp/ProteinQuantifier_27_output.txt` around lines 2 - 4, The top-N regression fixture does not distinguish zero observations from missing coverage. Update the test data and expected output for the top:N=3, top:aggregate=median case to include at least four candidate peptides with mixed zero and positive selected-charge observations, and assert which three peptides are selected along with their resulting median aggregate.
🤖 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.
Nitpick comments:
In `@src/tests/topp/ProteinQuantifier_27_output.txt`:
- Around line 2-4: The top-N regression fixture does not distinguish zero
observations from missing coverage. Update the test data and expected output for
the top:N=3, top:aggregate=median case to include at least four candidate
peptides with mixed zero and positive selected-charge observations, and assert
which three peptides are selected along with their resulting median aggregate.
In `@src/topp/ProteinQuantifier.cpp`:
- Around line 464-471: Update the nested loops in the charge-state collection
block to place each opening brace on its own aligned line, preserving the
existing two-space indentation and brace style. In the structured binding within
the loop over filename_to_chargemap, rename the unused abundance binding to a
descriptive name such as channel_abundances, without changing the iteration or
charge_of_peptide behavior.
- Around line 399-413: Extract the loop that builds
design_group_fraction_filename by iterating msfile_section into a private helper
method (such as buildDesignFractionFilenameMap_) that accepts the
ExperimentalDesign as a parameter and returns the map keyed by (fraction_group,
fraction). Replace the current loop in writePeptideTable_ with a call to this
helper. Update the existing duplicate loop in writeProteinTable_ at lines
605-613 to also call this shared helper, eliminating the separate implementation
and preventing future divergence between the two independent copies.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ec950d1a-0670-40dc-922d-ed0c5f995314
⛔ Files ignored due to path filters (2)
src/tests/topp/ProteinQuantifier_23_input.tsvis excluded by!**/*.tsvsrc/tests/topp/ProteinQuantifier_25_input.tsvis excluded by!**/*.tsv
📒 Files selected for processing (20)
CHANGELOGsrc/openms/source/ANALYSIS/QUANTITATION/PeptideAndProteinQuant.cppsrc/tests/topp/CMakeLists.txtsrc/tests/topp/ProteinQuantifier_23_input.consensusXMLsrc/tests/topp/ProteinQuantifier_23_output.txtsrc/tests/topp/ProteinQuantifier_24_output.txtsrc/tests/topp/ProteinQuantifier_25_input.consensusXMLsrc/tests/topp/ProteinQuantifier_25_output.txtsrc/tests/topp/ProteinQuantifier_26_output.txtsrc/tests/topp/ProteinQuantifier_27_output.txtsrc/tests/topp/ProteinQuantifier_28_output.txtsrc/tests/topp/ProteomicsLFQ_1_out.consensusXMLsrc/tests/topp/ProteomicsLFQ_1_subset_out.consensusXMLsrc/tests/topp/ProteomicsLFQ_2_out.consensusXMLsrc/tests/topp/ProteomicsLFQ_3_out.consensusXMLsrc/tests/topp/ProteomicsLFQ_3_seedRT_out.consensusXMLsrc/tests/topp/ProteomicsLFQ_4_out.consensusXMLsrc/tests/topp/ProteomicsLFQ_5_out.consensusXMLsrc/tests/topp/ProteomicsLFQ_6_out.consensusXMLsrc/topp/ProteinQuantifier.cpp
🚧 Files skipped from review as they are similar to previous changes (3)
- CHANGELOG
- src/tests/topp/CMakeLists.txt
- src/openms/source/ANALYSIS/QUANTITATION/PeptideAndProteinQuant.cpp
Finding 13 — followed up in #9851Taking the semantics question back off the table: it is fixed, in its own PR, scoped so that no quantity moves. The mechanism, precisely. Narrower than the finding states, and worse where it lands. Both Not a regression of this PR. The default path has always materialised zeros this way. The old best-charge path did not — but only because it assigned exactly one sample entry, for the single winning (fraction, file, charge, channel) combination, which is the bug #9796 is about. "Before" was not better behaviour; it was the artefact of quantifying each peptide in exactly one sample. Why it is a defect at all. The class has already ruled on what a zero means, twice in the opposite direction: Correcting something I said earlier in this thread. I wrote that fixing this globally would change mzTab and QPX output for all isobaric data. That is wrong if the fix is scoped to the counting rather than the data. #9851 changes only Two class-test sections cover the two branches on an isobaric fixture, which nothing had before; both were confirmed to fail without the fix (600 instead of 100, and 1000 instead of 100). All 15 findings are now resolved or dispositioned:
Unrelated pre-existing break found along the way: #9850. |
CodeRabbit review — both items were already addressedBoth comments were posted against 1. "Do not skip PSM-count aggregation when no charge is selected" — correct, and fixed exactly as proposed: the early exit became 2. "Rename the temporary output path; it collides with |
…e a partial collection (#9849) * [FIX,TEST] QPX: separate unmapped features, never leave a partial collection Three defects in the QPX export contract added by #9846/#9843, found reviewing #9847. Tightening the contract is fine where the producers can satisfy it; these are cases where they cannot, or where the enforcement is not clean. 1. Feature primary key refused maps OpenMS itself produces. The key is (peptidoform, charge, run_file_name, rt). QPX permits unmapped features and ConsensusMapArrowExport writes them with an empty peptidoform, so for those rows the key collapses to (charge, run_file_name, rt) - and 'rt' is narrowed to float32 on write, one ULP being 244 us at 3000 s. Two co-eluting unmapped features of the same charge in one run then share a key although they are plainly different features, and the whole table is refused. Not a corner case for the tools that write QPX: ProteomicsLFQ with seeds leaves 79 % of the ProteomicsLFQ_3 fixture's consensus features unidentified, and a real run carries tens of thousands, where the birthday bound over the ~2.2e7 representable float32 retention times makes a collision expected. The only ProteomicsLFQ QPX test uses the unseeded configuration, whose features are all identified, so nothing exercised it. 'observed_mz' - written one column over, previously excluded - joins the key. Genuine duplicates (same run, charge, rt AND m/z) are still refused. 2. A refused collection left its earlier files behind. requireExportable() catches everything decidable from the input, but a view can still refuse a row it only sees while building its table, and a write can fail on I/O; by then quantms.feature.parquet is on disk, and a directory holding it without a PSM file is indistinguishable from a complete export of a smaller dataset. New QPXCollectionExport::Transaction scope guard: constructed before the first write, committed after the last, and on any other exit - a view returning false, a writer throwing, an early return - it removes every collection file present. Used by ProteinQuantifier, ProteomicsLFQ and IsobaricWorkflow. Guarding the scope rather than enumerating the failure sites covers the next refusal mode without anyone having to remember it. 3. QPXFile::exportToParquetStreaming() left a truncated PSM file. One validator spans all batches so it can fail on a late one, and the writer and sink are closed regardless, so the footer is written and the file reads as a valid, merely smaller, PSM table. It is now removed, matching what ConsensusMapArrowExport's streaming writer already did for the same situation. Each fix ships with a test that was confirmed to fail without it: the feature-key section fails at the validate() of two co-eluting unmapped features, and the streaming section at TEST_FALSE(File::exists(duplicate_file)). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ * [DOC,TEST] QPX: record the input contract once, and test the validator directly Documentation and tests only; no behaviour change. The QPX input contract was not written down anywhere a user could find it: the tools that offer -out_qpx just fail with UnableToCreateFile, and the four requirements a foreign consensus map can miss (a scan per identification, a resolvable origin file, uniqueness per (peptidoform, charge, run, scan), and a channel label from the QPX vocabulary) were only discoverable by reading QPXValueValidation. It is now stated on that class - the code that enforces it, so it cannot drift - and nowhere else. ProteinQuantifier's -out_qpx parameter and its documentation page point there rather than restating it, naming ProteomicsLFQ and IsobaricWorkflow as the producers that satisfy the contract by construction. QPXValueValidation had no test file of its own although every sibling QPX class has one, and it is a 600-line OPENMS_DLLAPI class that decides whether an export happens at all. QPXValueValidation_test covers all three views: the psm view's empty-scan, empty/blank run_file_name and duplicate-key refusals, the feature view's separation of unmapped rows by observed_mz and its non-finite coordinate refusals, the documented statefulness (a validator spans batches so a key repeated after a batch boundary is caught; a rejected batch does not advance the key state; reset() starts a new file), the schema-mismatch path, multi-chunk columns, null and 0-row tables, and Result::toString(). The invalid inputs are built through the exporters rather than by patching columns, so each section exercises a shape a producer really emits - an identification without a spectrum reference, or the one-MS2-on-two-features duplication IDMapper creates. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ * [FIX,TEST] Transaction must not delete a collection that predates it Addresses the CodeRabbit review on #9849. The scope guard removed every collection file in the output directory on a failed export, including files that were already there. Re-running a pipeline into the same -out_qpx directory is the normal case, so a failed re-run destroyed the previous, complete result. The test encoded that behaviour by creating its stub files before constructing the guard. The guard now records which of the three files exist at construction and removes only the ones this export created. A run that fails after overwriting a pre-existing file still leaves the directory mixing two exports - that cannot be undone without staging - so the destructor names the surviving files in a warning instead of letting the directory look coherent. The test creates its files inside the guard's lifetime, as an export does, and gains coverage that a failed export preserves a complete previous collection; that assertion fails without the fix. Also from the same review: - QPXFile and ConsensusMapArrowExport left a zero-byte .parquet behind when parquet::arrow::FileWriter::Open failed: arrow::io::FileOutputStream::Open had already created and truncated the file, and this early return happens before the close-and-remove block that covers every later failure. Both now close and remove it. (ConsensusMapArrowExport is not otherwise part of this PR's changes, but the two writers are deliberately symmetric here.) - Doxygen: the Transaction constructor, destructor and commit() use /** */ with @brief, and the constructor documents @PARAM[in] directory. - Style: braces on their own aligned lines, and '\n' instead of std::endl in the new logging. Verified end to end: a failed export into a fresh directory still leaves it empty, and a failed export into a directory holding a previous collection leaves all three of its files in place with the warning. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ * [FIX] Link QPXValueValidation_test against Arrow Fixes the windows-2025/cl.exe build failure on this branch: 37 LNK2019s, all unresolved __declspec(dllimport) arrow:: symbols, on QPXValueValidation_test.exe. The test was added to executables.cmake without the matching target_link_libraries(... ${OPENMS_ARROW_TARGET} ${OPENMS_PARQUET_TARGET}) that every other Arrow-using class test carries. It builds its invalid inputs with arrow::FloatBuilder and ArrayData::Make rather than through the exporters - deliberately, so each section exercises a shape a producer really emits - so it needs Arrow itself, not just what OpenMS re-exports. On Linux/macOS libOpenMS statically links Arrow and re-exports its symbols, so the link happens to succeed; on Windows they are dllimport and nothing satisfies them. QPXCollectionExport_test, added alongside it, uses no Arrow type and correctly stays unlinked. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ * [FIX,TEST] Remove the partial file when a one-shot Parquet write fails This PR taught both streaming writers to clean up after themselves, but the one-shot writers next to them still leak. arrow::io::FileOutputStream::Open creates and truncates the file before the table is written, so a write that fails afterwards leaves a fragment carrying little more than the Parquet magic bytes - no footer, so a reader reports it as corrupt rather than as the smaller table it looks like. Two sites, both now closing the stream and removing the file on any failure after the open: - ConsensusMapArrowExport::exportToParquet, directly above the streaming function this PR already fixed. - ArrowIOHelpers::writeTableToParquet, the shared path behind the psm, pg, OpenSwath and MSExperiment exports. ConsensusMapArrowExport::exportToParquet additionally closes explicitly instead of leaving it to the stream's destructor, which discards the error: the final flush is where a full disk surfaces, and that used to be reported as success with a truncated file on disk. Inside the three tools this was contained by QPXCollectionExport::Transaction, which is why it did not show up as a bug; it was not contained for pyOpenMS and library callers, or for ProSE, whose -out_qpx layout the guard cannot cover. Each fix ships with a test confirmed to fail without it - both at the TEST_FALSE(File::exists(...)) line, with the write failing for the intended reason. A row group size of 0 is refused by Parquet for a non-empty table, which reaches a post-open write failure deterministically on every platform. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ * [TEST] Cover -out_qpx from the seeded ProteomicsLFQ configuration The feature-key defect this PR fixes reached develop because the only ProteomicsLFQ QPX test runs -targeted_only true, whose consensus features are all identified: 0 of its 60 feature rows are unmapped, so nothing ever exported the shape the key could not distinguish. The class test added here reproduces that shape synthetically, but nothing asserts that the tool still produces it. New TOPP_ProteomicsLFQ_qpx_seeds runs TOPP_ProteomicsLFQ_3's seeded configuration with -out_qpx: 210 of 298 feature rows are unmapped, and all three collection files must exist afterwards. Kept as a separate run rather than folded into TOPP_ProteomicsLFQ_3 so no reference file is touched. What it guards is that the shape reaches the exporter and clears it end to end. It is not a reproducer for the float32-rt collision itself - measured on the produced table, the pre-fix key happens not to collide at this fixture's size - and the comment says so rather than implying more; ConsensusMapArrowExport_test covers that directly. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Same defect as at the sample level, in the array that feeds the abundance|<file>|ch<N> columns and the QPX pg view. Stacked on #9847, which rewrites this function. calculateFileAndChannelLevelProteinAbundances_ contributed one value per selected peptide and (fraction, file, channel) cell whether or not that peptide had a reporter there. IsobaricChannelExtractor writes a reporter it could not find - or one below 'min_reporter_intensity' - as an explicit 0.0 and inserts the handle regardless, so undetected peptides both satisfied the per-file "at least N peptides" gate and entered the aggregate. With the default median, a cell in which most of a protein's peptides went undetected was reported as 0: absent from a channel the protein was measured in. Only detected (positive) abundances are collected and counted now. 'sum' is numerically unaffected. A cell whose peptides were all undetected still keeps its zero entry, so it does not drop out of the parallel (filename, channel, abundance) arrays - the previous 'if (all_abundances.empty()) continue' guard was unreachable, since the key was only ever created by a push, and is now the case that must NOT be skipped. The IsobaricWorkflow_1 reference shows it on real data: its only changed line is the file+channel array of group 1 (PROTB, two peptides). MYFINGERK has no reporter in channels 1, 3, 6, 7, 9 and 10, exactly the six channels whose value doubles - the old median of (GIRAFFERK, 0) reported half the single measurement. The four channels where both peptides were detected are byte-identical. Note the reference is internally inconsistent until #9851 lands: the sample-level 'abundances' array in the same file still carries the halved values, because that is the other half of this fix and is independent of #9847. The two agree once both are merged. Label-free data is unaffected: a feature that was not found has no entry at all. 129/129 PeptideAndProteinQuant/ProteinQuantifier/IsobaricWorkflow/ProteomicsLFQ tests pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ
…ptide (#9851) * [FIX,TEST] fix_peptides: a stored zero is not a sample the peptide occurs in 'consensus:fix_peptides' ranks peptides by the size() of their sample->abundance map. That map has an entry wherever quantifyFeature_ saw a feature handle, and IsobaricChannelExtractor writes a reporter it could not find - or one below 'min_reporter_intensity' - as an explicit 0.0, so every peptide of an isobaric run reported the full channel count: - with 'top:N' 0, "all peptides that occur in every sample" admitted every peptide seen anywhere; the filter stopped filtering. - with 'top:N' > 0, all peptides tied at the channel count, so the tie-break by total abundance decided alone and a peptide with a large signal in 2 of 10 channels took the slot from one genuinely measured in 6. Both now count only the samples with a positive abundance, via one helper. This is the rule the class already applies elsewhere and the inconsistency is the actual defect: normalizePeptides_() excludes zeros from its medians, with a comment explaining that a zero means "not detected" rather than "no protein", and the charge-prevalence count in 'best_charge_and_fraction' does the same. Scoped deliberately to the counting. total_abundances is untouched, so peptide and protein abundances, mzTab and QPX values do not move; only which peptides are selected changes, and only when 'consensus:fix_peptides' is enabled - off by default and set by no OpenMS tool. The five in-tree fix_peptides tests (TOPP_ProteinQuantifier_7/8/9/12/13) use a fixture with no zero intensities, so no reference file changes. Two class-test sections cover the two branches on an isobaric fixture, which nothing had before. Both were confirmed to fail without the fix, reporting 600 instead of 100 (the undetected peptide admitted) and 1000 instead of 100 (the taller peptide taking the top:N slot). Reported as finding 13 of the #9847 review. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ * [FIX,TEST] protein aggregation: a stored zero is not a detected peptide Third and most consequential site of the same defect: calculateProteinAbundances_ aggregated peptides that were never detected, so an isobaric protein could be reported as absent from a sample it was measured in. quantifyFeature_ records every feature handle, and IsobaricChannelExtractor writes a reporter it could not find - or one below 'min_reporter_intensity' - as an explicit 0.0 and inserts the handle regardless (IsobaricChannelExtractor.cpp:620/658/663). Every peptide of an isobaric run therefore carries an entry for every channel. Those entries were pushed into the per-sample list, where they both counted towards the "enough peptides in this sample" gate and fed the aggregate: with the default median, a channel in which most of a protein's peptides went undetected got a median of exactly 0; with mean it was diluted towards 0. That is the artefact normalizePeptides_() already excludes zeros to avoid, and the opposite of what the tool documents - "(intensity weighted) mean and median ignore missing cases, averaging only present values", with only 'sum' documented as treating missing values as zero. Only detected (positive) abundances are aggregated and counted now. 'sum' is numerically unaffected, since summing zeros changes nothing. Samples are tracked separately from their values, so a sample in which nothing was detected keeps its zero entry under 'top:include_all' rather than disappearing from the output. Unlike the two earlier sites this is not opt-in: IsobaricWorkflow sets 'top:include_all', otherwise takes the defaults, and passes no aggregation override - and so does quantms, whose ISOBARIC_WORKFLOW module supplies no -ProteinQuantification:* arguments and has no ext.args. The IsobaricWorkflow_1 reference shows it on real data. Its only changed line is the protein-abundance array of group 1 (PROTB, two peptides): MYFINGERK has no reporter in channels 1, 3, 6, 7, 9 and 10, which are exactly the six channels whose value doubles - the old median of (GIRAFFERK, 0) reported the protein at half its single measurement. The four channels where both peptides were detected are byte-identical. Label-free data is unaffected: a feature that was not found has no entry at all, rather than an entry of zero. All 97 ProteomicsLFQ/MzTab tests are unchanged. Both new class-test sections were confirmed to fail without the fix, reporting 0 (median) and 333.33 (mean) where the protein was measured at 1000. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ * [STYLE] expand a short if-block per review Addresses the CodeRabbit nitpick on #9851. The repository's own .clang-format permits the compact form (AllowShortBlocksOnASingleLine: true), and the file already contains several instances of it, so this is cosmetic rather than a correctness or guideline fix - applied for consistency with the same change made on #9849. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Same defect as at the sample level, in the array that feeds the abundance|<file>|ch<N> columns and the QPX pg view. Stacked on #9847, which rewrites this function. calculateFileAndChannelLevelProteinAbundances_ contributed one value per selected peptide and (fraction, file, channel) cell whether or not that peptide had a reporter there. IsobaricChannelExtractor writes a reporter it could not find - or one below 'min_reporter_intensity' - as an explicit 0.0 and inserts the handle regardless, so undetected peptides both satisfied the per-file "at least N peptides" gate and entered the aggregate. With the default median, a cell in which most of a protein's peptides went undetected was reported as 0: absent from a channel the protein was measured in. Only detected (positive) abundances are collected and counted now. 'sum' is numerically unaffected. A cell whose peptides were all undetected still keeps its zero entry, so it does not drop out of the parallel (filename, channel, abundance) arrays - the previous 'if (all_abundances.empty()) continue' guard was unreachable, since the key was only ever created by a push, and is now the case that must NOT be skipped. The IsobaricWorkflow_1 reference shows it on real data: its only changed line is the file+channel array of group 1 (PROTB, two peptides). MYFINGERK has no reporter in channels 1, 3, 6, 7, 9 and 10, exactly the six channels whose value doubles - the old median of (GIRAFFERK, 0) reported half the single measurement. The four channels where both peptides were detected are byte-identical. Note the reference is internally inconsistent until #9851 lands: the sample-level 'abundances' array in the same file still carries the halved values, because that is the other half of this fix and is independent of #9847. The two agree once both are merged. Label-free data is unaffected: a feature that was not found has no entry at all. 129/129 PeptideAndProteinQuant/ProteinQuantifier/IsobaricWorkflow/ProteomicsLFQ tests pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ
#9852) * [FIX,TEST] file+channel level: a stored zero is not a detected peptide Same defect as at the sample level, in the array that feeds the abundance|<file>|ch<N> columns and the QPX pg view. Stacked on #9847, which rewrites this function. calculateFileAndChannelLevelProteinAbundances_ contributed one value per selected peptide and (fraction, file, channel) cell whether or not that peptide had a reporter there. IsobaricChannelExtractor writes a reporter it could not find - or one below 'min_reporter_intensity' - as an explicit 0.0 and inserts the handle regardless, so undetected peptides both satisfied the per-file "at least N peptides" gate and entered the aggregate. With the default median, a cell in which most of a protein's peptides went undetected was reported as 0: absent from a channel the protein was measured in. Only detected (positive) abundances are collected and counted now. 'sum' is numerically unaffected. A cell whose peptides were all undetected still keeps its zero entry, so it does not drop out of the parallel (filename, channel, abundance) arrays - the previous 'if (all_abundances.empty()) continue' guard was unreachable, since the key was only ever created by a push, and is now the case that must NOT be skipped. The IsobaricWorkflow_1 reference shows it on real data: its only changed line is the file+channel array of group 1 (PROTB, two peptides). MYFINGERK has no reporter in channels 1, 3, 6, 7, 9 and 10, exactly the six channels whose value doubles - the old median of (GIRAFFERK, 0) reported half the single measurement. The four channels where both peptides were detected are byte-identical. Note the reference is internally inconsistent until #9851 lands: the sample-level 'abundances' array in the same file still carries the halved values, because that is the other half of this fix and is independent of #9847. The two agree once both are merged. Label-free data is unaffected: a feature that was not found has no entry at all. 129/129 PeptideAndProteinQuant/ProteinQuantifier/IsobaricWorkflow/ProteomicsLFQ tests pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ * [FIX,TEST] fraction group level: a stored zero is not a detected peptide The third and last copy of this aggregation. calculateFractionGroupLevelProteinAbundances_ pushed every stored abundance into its per-(fraction group, label) cell, zeros included, so undetected peptides both satisfied its 'top_n' gate and dragged the cell's median or mean towards zero - exactly what the sample level (#9851) and the file+channel level (the commit before this one) already fix. It now contributes only positive abundances while still touching every cell the selected peptides reach, so a cell whose peptides all went undetected reports zero rather than dropping out. Same idiom as its two siblings. This is not a theoretical third site. The three levels describe one measurement at different granularities and must agree where the granularities coincide, and they did not: IsobaricWorkflow_1 is one file x 10 channels, so a cell IS a sample, yet its fraction-group array sat at exactly half the sample-level values in the six channels where a peptide went undetected - the signature of mean(x, 0). All three arrays are now byte-identical there, which is the invariant, and that one line of IsobaricWorkflow_1_out.consensusXML is the only reference value that moves. The array feeds ProteinData::fraction_group_abundances, which is what the QPX 1.1 pg view is keyed on. The new class-test section mirrors the file+channel one on the same fixture and additionally asserts the two levels agree. Confirmed to fail without the fix: the cell reports 0 instead of 1000 (lines 1732/1737), the top_n gate section fails at 1774, and TOPP_IsobaricWorkflow_1_out1 fails once the tool is re-run. 176 tests across PeptideAndProteinQuant, ProteinQuantifier, IsobaricWorkflow, ProteomicsLFQ, MzTab and QPX pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VcFtJVe1PcMsBzMnnnpWBJ --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Summary
Fixes #9796.
This also incorporates the relevant file/channel aggregation correction from #9793, without its unrelated vcpkg submodule change.
Review status
The 15-finding review below has been worked through.
Fixed in this PR — findings 11, 12 and 14:
writePeptideTable_— the header keyed the design's spectra file paths by fraction group, so all fractions of a group collapsed onto whichever file the design listed last (11 of 12 files vanished for a 12-fraction group); and two of the three "no value here" cases emitted nothing instead of0.0, shifting every later cell of the row one column left so the trailingfractionvalue landed under an abundance header. Both confirmed by running the pre-fix binary. Now keyed by(fraction group, fraction)like the protein table already was, and every cell always writes a value. Pinned by the newTOPP_ProteinQuantifier_28on a fractionated design, verified to fail without the fix.continuedid skip the PSM-count aggregation, and is fixed. One correction to the finding as written: its stated impact does not exist today, becausePeptideData::psm_countsis never written anywhere in OpenMS (ConsensusXMLHandler.cpp:974already documents this), so the loop it skipped is currently a no-op. The fix restores the invariant for when those counts are populated upstream; it could not be given a failing test, as the member is unreachable from the public API.TOPP_ProteinQuantifier_19_qpxand the new_19shared${TESTS_TEMP_DIR}/ProteinQuantifier_19_output.tmp. The new tests are renumbered to 23–27, as suggested.Fixed separately — finding 13. Confirmed as a behaviour description, but it is not introduced here: the default path has always materialised a
total_abundancesentry for an explicit0.0(quantifyFeature_records every handle, including zero-intensity ones), so best-charge mode now matches the long-standing default rather than diverging from it. The real defect is older and narrower than the finding states: bothsize()-dependent branches are gated onconsensus:fix_peptides, which is off by default and set by no OpenMS tool. Fixed in #9851, scoped to the counting only —selectPeptidesForQuantification_andorderBest_now count samples with a positive abundance, which is the rulenormalizePeptides_()andgetBestCharge_()already apply.total_abundancesis untouched, so no abundance, mzTab or QPX value moves and no reference file changes.Moved out — findings 1–10 and 15. These reviewed the #9846 validation work, which is merged; this branch was rebased and those files are no longer in the diff. Findings 3, 9 and 10 turned out to be reachable and are fixed in #9849, together with 15 (
QPXValueValidation_test) and the contract documentation. The remainder (1, 2, 4, 5, 6, 7, 8) are accepted as a deliberate tightening of the QPX input contract: the supported producers are ProteomicsLFQ and IsobaricWorkflow, whose output satisfies it by construction. #9849 writes that contract down in one place.Reference files
The eight ProteomicsLFQ references now change — the earlier "no reference files change" claim was wrong. Exactly nine lines, all
indistinguishable_proteins_N_file_channel_level_abundance, verified rather than regenerated:Rebuilding the same tree with only
PeptideAndProteinQuantreverted to develop isolates those nine lines as the entire effect of this change. Everything else that differs locally is environment noise (this machine drifts up to 8.4e-5 relative from the CI-generated references, against a FuzzyDiff tolerance of 1e-2), so only those nine lines were edited; the rest of every file is untouched.The unchanged sample-level
abundancesnext to them are what proves the new values right. Both spectral-counting tests runtop:N 0withtop:aggregate sum, where a sample's cells must sum exactly to its sample-level value — and only the new cells do:Same for both protein groups of ProteomicsLFQ_6. Re-running the feature-intensity input under
top:N 0+sumshows 1 of 5 protein groups violating the invariant with the old code and 0 of 5 with this change.The feature-intensity cells (
top:N 3, median) were recomputed independently from the consensus features and protein-group definitions in the output itself: the rule "per file, one summed value per peptide over its peptidoforms and charges, top 3, median" reproduces all six new cells exactly and disagrees with the old values on precisely the two that changed.Experimental-design and replicate semantics
The QPX protein-quantity grain remains
(fraction_group, label):grouped_runsunitCovered by the existing
ProteinGroupArrowExport_testcase "fraction groups stay distinct when a sample repeats".Validation
ctest(2782 tests): no failure in anything this PR touches. The remaining failures are the known-environmental set (Thermo .NET, Comet version string, percolator numerics),Doxygen_Warning_test(HAVE_DOT in two pre-existing files), one very slow Bruker real-data test, andTOPP_SimpleSearchEngine_DDA— a pre-existing break on develop, fixed separately in [FIX] TOPP_SimpleSearchEngine_DDA passed an argument to a flag #9850TOPP_ProteinQuantifier_*andPeptideAndProteinQuant_testTOPP_ProteomicsLFQ_*Merge order
These four PRs are all descendants of the same review of #9847. Test-merged locally in this order; only one conflict exists and it is trivial.
codex/fix-best-charge-and-fractionfix/file-channel-zeros-not-detectedfix/zero-abundances-not-evidencefix/qpx-feature-key-and-atomic-exportsrc/tests/topp/IsobaricWorkflow_1_out.consensusXML, on adjacent lines — [FIX,TEST] PeptideAndProteinQuant: a stored zero is not a detected peptide #9851 the sample-levelindistinguishable_proteins_1_abundances, [FIX,TEST] file+channel level: a stored zero is not a detected peptide #9852 the..._file_channel_level_abundance. Resolution: take both. They are the two halves of one fix, and afterwards the two arrays are byte-identical, which is the invariant to check (one file × N channels means a cell is a sample).Verified locally: all four merged together, conflicts resolved as above, 63/63
PeptideAndProteinQuant_test/TOPP_ProteinQuantifier_*/TOPP_IsobaricWorkflow_*/ QPX / Arrow tests pass, and the two isobaric abundance arrays agree exactly.