Skip to content

[FIX] QPX export: three columns that were silently wrong - #9834

Merged
timosachsenberg merged 1 commit into
developfrom
qpx-pg-column-consistency
Jul 31, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
qpx-pg-column-consistency

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Three defects in the QPX export columns, found by an adversarial review after #9832. All three are in already-merged code, none came from that PR, and each produces plausible-looking wrong data with no diagnostic — which is why the test suite never saw them.

1. Gene lists lose positional alignment with pg_accessions

ProteinGroupArrowExport.cpp (ConsensusMap overload). pg_accessions gets one entry per group member unconditionally, and pg_names appends "" on a lookup miss — but gg_accessions/gg_names appended only inside if (it != hit_lookup.end()) and if (has_ga || has_gn). A member with no ProteinHit, or with a hit but no gene metavalue, contributed nothing.

So the gene lists come out shorter than pg_accessions and every subsequent gene shifts down one index, silently attributed to the wrong protein. A partially gene-annotated FASTA is all it takes — group {PROT_A, PROT_B} with a gene on PROT_B only yields gg_names = ["GENE_OF_B"], which a consumer zips onto PROT_A.

The comment claimed "keep lists symmetric so they can be zipped". The two gene lists were symmetric with each other, which is not the symmetry a consumer needs. The identification-only overload of the same view already did this correctly; this aligns the ConsensusMap one to it.

2. peptide_counts.total_sequences counted features, not sequences

Same file, two lines apart:

(void)pc_total_b->Append(static_cast<int>(group_features.size()));   // peptide_counts.total_sequences
(void)fc_total_b->Append(static_cast<int>(group_features.size()));   // feature_counts.total_features

Character-identical expressions, so total_sequences was always equal to total_features — while the peptides[] list in the same row was built from distinct sequences. One row asserting peptides = [{PROT_A, 1}] next to total_sequences = 2 is self-contradictory, and distinguishing peptidoform and charge is what feature_counts exists for.

total_sequences is now accumulated from the same per-member seqs.size() that peptides[] emits, so the two agree by construction.

This is the sibling field of the unique_sequences divergence fixed in #9832 — that PR corrected one half of the struct and left the other, so the two overloads still disagreed.

3. The psm view wrote an empty primary key with no log output

QPXFile.cpp appended File::stemName(run_file) unguarded. When neither the hit metavalue nor the mapper resolves anything, that is "" — and QPX makes run_file_name a non-nullable primary-key component, and the key the psm view is joined to feature and pg on. An empty string satisfies Arrow while violating the spec.

Protein-inference output triggers it with no malformed metadata and no exception: inference commonly drops spectra_data entirely. The same input through the pg exporter emits a full warning naming the remedy; the psm exporter said nothing at all.

The row is still written. A PSM is a primary record and dropping it would discard an identification — unlike a protein group, which is a per-run aggregate that cannot exist without a run. Only the diagnostic was missing, so only the diagnostic is added: a count of unattributable PSMs and one aggregated warning naming setPrimaryMSRunPath().

buildQPXPSMTableRange runs inside an OpenMP region, so the counter is an out-parameter written through a per-worker slot and summed by the caller after the region — the serial counter idiom used elsewhere would have been a data race. Both the streaming and single-shot paths report once per export.

Why no test caught these

Each was invisible for a specific, checkable reason:

  • no fixture had a partially gene-annotated group — every member either had a gene or none did, the two cases where the lists happen to line up;
  • every fixture had exactly one feature per sequence — the single configuration in which "feature count" and "sequence count" coincide;
  • the empty-key path produced a valid file with zero log output, so nothing distinguished it from success.

The new sections target exactly those gaps: a two-member group with one gene, and one sequence at two charge states. Both were confirmed to fail against the previous code before being kept.

Verification

  • new class-test sections for defects 1 and 2, each verified to fail without its fix
  • Arrow/QPX class tests and the ProteomicsLFQ / ProSE / ProteinQuantifier / IsobaricAnalyzer TOPP suite
  • no reference-file churn

🤖 Generated with Claude Code

https://claude.ai/code/session_01DF2YUewPQTC5tJWqn23pUm

Summary by CodeRabbit

  • Bug Fixes

    • Protein-group exports now preserve one aligned gene entry per protein, including empty entries when annotations are unavailable.
    • Consensus-map peptide totals now accurately count distinct sequences for each group member.
    • QPX exports now retain run-file information and report unresolved source files with a single summary warning.
    • Streaming exports now provide complete unresolved-file counts across all processing batches.
  • Tests

    • Added coverage for protein-group alignment and distinct peptide-sequence counting.

Found by an adversarial review after #9832. All three predate that PR.

1. gg_accessions/gg_names lost positional alignment with pg_accessions.
   pg_accessions appends one entry per group member unconditionally and
   pg_names appends "" on a lookup miss, but the gene lists appended only
   inside `if (hit found)` AND `if (has_ga || has_gn)`. An unannotated member
   contributed nothing, so the lists came out short and every later gene
   shifted onto the wrong protein -- a partially gene-annotated FASTA is all
   it takes. The comment claimed the lists were "symmetric so they can be
   zipped"; they were symmetric with each other, which is not the symmetry a
   consumer needs. The identification-only overload already did this right.

2. peptide_counts.total_sequences counted features. It was
   `group_features.size()`, character-identical to the feature_counts
   expression two lines below, so total_sequences always equalled
   total_features -- while peptides[] in the same row was built from distinct
   sequences. Now accumulated from the same per-member seqs.size() that
   peptides[] emits, so the two agree by construction. This is the sibling
   field of the unique_sequences divergence fixed in #9832, which corrected
   one half of the struct and left the other.

3. The psm view wrote an empty run_file_name with no log output. QPX makes it
   a non-nullable primary-key component and the key psm is joined to feature
   and pg on; an empty string satisfies Arrow while violating the spec.
   Protein-inference output triggers it with no malformed metadata, since
   inference commonly drops spectra_data -- and the pg exporter warns loudly
   on the same input while the psm exporter said nothing.

   The row is still written: a PSM is a primary record and dropping it would
   discard an identification, unlike a protein group, which is a per-run
   aggregate that cannot exist without a run. Only the diagnostic was
   missing. buildQPXPSMTableRange runs inside an OpenMP region, so the count
   is an out-parameter written through a per-worker slot and summed by the
   caller after the region; both the streaming and single-shot paths report
   once per export.

Each defect was invisible for a specific reason: no fixture had a partially
gene-annotated group, every fixture had exactly one feature per sequence (the
one case where the two count meanings coincide), and the empty-key path wrote
a valid file silently. The two new sections target those gaps and were both
confirmed to fail against the previous code -- reverting gives "GENE_OF_B" at
index 0 and total_sequences 2 instead of 1.

153/153 TOPP tests; Arrow/QPX class tests green; no reference-file churn.

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

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Protein-group export corrections

Layer / File(s) Summary
Aligned gene metadata and peptide sequence totals
src/openms/source/FORMAT/ProteinGroupArrowExport.cpp, src/tests/class_tests/openms/source/ProteinGroupArrowExport_test.cpp
Gene arrays now retain one entry per group member. Missing metadata produces empty strings. Total sequence counts now sum per-member distinct sequences, while unique sequences remain group-deduplicated. Tests cover both behaviors.

QPX origin reporting

Layer / File(s) Summary
Unresolved PSM origin counting
src/openms/source/FORMAT/QPXFile.cpp
Regular and streaming exporters count PSMs with empty run-file stems and report the totals after export. Streaming workers accumulate their counters across batches.

Sequence Diagram(s)

sequenceDiagram
  participant QPXExporter
  participant buildQPXPSMTableRange
  participant QPXWriter
  QPXExporter->>buildQPXPSMTableRange: Build PSM range and update unresolved-origin counter
  buildQPXPSMTableRange->>QPXWriter: Provide PSM rows with run-file stems
  QPXWriter-->>QPXExporter: Close writer and output stream
  QPXExporter->>QPXExporter: Report accumulated unresolved-origin count
Loading

Possibly related issues

Possibly related PRs

  • OpenMS/OpenMS#9697 — Introduces the QPX streaming range-building behavior refined by this PR.
  • OpenMS/OpenMS#9818 — Modifies the same QPX export paths and run-file resolution behavior.
  • OpenMS/OpenMS#9825 — Establishes related QPX metadata and evidence-attribution infrastructure.

Poem

A rabbit checked the protein rows,
And lined each gene where it belongs.
Empty fields now stay in place,
QPX counts origins it cannot trace.
Peptide totals hop true and bright—
“Export looks tidy!” thumps the night.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies the QPX export fixes, which are a real part of the pull request, but it does not mention the related Arrow export corrections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch qpx-pg-column-consistency

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: 1

🧹 Nitpick comments (3)
src/openms/source/FORMAT/QPXFile.cpp (3)

1273-1273: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Place braces on separate aligned lines.

Line 1273 and Line 1708 put the braces and statements on one line. Expand both blocks to match the required C++ format.

As per coding guidelines, **/*.{h,hpp,cpp,cc,cxx} requires braces on their own aligned lines.

Proposed formatting fix
-        if (run_stem.empty()) { ++unattributable_psms; }
+        if (run_stem.empty())
+        {
+          ++unattributable_psms;
+        }

-    for (int t = 0; t < W; ++t) { unattributable_total += unattr[t]; }
+    for (int t = 0; t < W; ++t)
+    {
+      unattributable_total += unattr[t];
+    }

Also applies to: 1708-1708

🤖 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/QPXFile.cpp` at line 1273, The if statement checking
run_stem.empty() at line 1273 has its opening brace and body statement on the
same line as the condition. Expand this block to place the opening brace on a
new line, the statement body (incrementing unattributable_psms) on the next
line, and the closing brace on its own aligned line. Apply the same multi-line
formatting fix to the identical block at line 1708.

Source: Coding guidelines


1496-1496: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use \n instead of std::endl in the new warnings.

std::endl flushes the log stream. Replace it with '\n' in both warning statements.

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

Proposed logging fix
-                       "ProteinIdentification::setPrimaryMSRunPath() before exporting." << std::endl;
+                       "ProteinIdentification::setPrimaryMSRunPath() before exporting." << '\n';

Also applies to: 1778-1778

🤖 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/QPXFile.cpp` at line 1496, In the QPXFile.cpp file,
locate the two warning statements that currently use std::endl at the end of
their messages (one related to ProteinIdentification::setPrimaryMSRunPath() and
another similar warning). Replace std::endl with a newline character '\n' in
both warning statements to eliminate unnecessary stream flushing and align with
the coding guidelines that prefer '\n' over std::endl for log output.

Source: Coding guidelines


1267-1274: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add regression coverage for unresolved QPX origins.

QPXFile_test.cpp exercises the normal export paths, but the new unresolved-origin behavior still needs coverage. Add a test for exportPSMsToQPXArrow and multithreaded exportToParquetStreaming (multiple batches/workers) that intentionally includes PSMs without a primary MS run path, asserts the PSM row is retained with an empty run_file_name, and checks the returned count aggregates across workers. Register the class test in src/tests/class_tests/openms/srcs.cmake with NEW_TMP_FILE for output files.

🤖 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/QPXFile.cpp` around lines 1267 - 1274, Add
regression tests covering unresolved-origin PSMs in exportPSMsToQPXArrow and
multithreaded exportToParquetStreaming, using multiple batches/workers. Assert
the PSM row remains present with an empty run_file_name and that the returned
unattributable count aggregates across workers; register the test class in
srcs.cmake with NEW_TMP_FILE for generated outputs.

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/tests/class_tests/openms/source/ProteinGroupArrowExport_test.cpp`:
- Around line 393-435: The test currently verifies only the length of the
gg_accessions list but does not validate the actual accession values, which
leaves a regression undetected if an accession is emitted incorrectly. Set a
distinct gene_accession metadata value on the PROT_B ProteinHit (similar to how
gene_name is already set), then add assertions after the gg_accessions length
check to retrieve and verify the accession values from the gg_accessions array
using value_offset and GetString, checking for an empty string at member 0
(PROT_A) and the assigned gene_accession at member 1 (PROT_B).

---

Nitpick comments:
In `@src/openms/source/FORMAT/QPXFile.cpp`:
- Line 1273: The if statement checking run_stem.empty() at line 1273 has its
opening brace and body statement on the same line as the condition. Expand this
block to place the opening brace on a new line, the statement body (incrementing
unattributable_psms) on the next line, and the closing brace on its own aligned
line. Apply the same multi-line formatting fix to the identical block at line
1708.
- Line 1496: In the QPXFile.cpp file, locate the two warning statements that
currently use std::endl at the end of their messages (one related to
ProteinIdentification::setPrimaryMSRunPath() and another similar warning).
Replace std::endl with a newline character '\n' in both warning statements to
eliminate unnecessary stream flushing and align with the coding guidelines that
prefer '\n' over std::endl for log output.
- Around line 1267-1274: Add regression tests covering unresolved-origin PSMs in
exportPSMsToQPXArrow and multithreaded exportToParquetStreaming, using multiple
batches/workers. Assert the PSM row remains present with an empty run_file_name
and that the returned unattributable count aggregates across workers; register
the test class in srcs.cmake with NEW_TMP_FILE for generated outputs.
🪄 Autofix (Beta)

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: 38970f35-45dc-4671-a156-27918b5370f6

📥 Commits

Reviewing files that changed from the base of the PR and between 0c0c399 and 09a8f3b.

📒 Files selected for processing (3)
  • src/openms/source/FORMAT/ProteinGroupArrowExport.cpp
  • src/openms/source/FORMAT/QPXFile.cpp
  • src/tests/class_tests/openms/source/ProteinGroupArrowExport_test.cpp

Comment on lines +393 to +435
ProteinHit pa; pa.setAccession("PROT_A"); // no gene annotation
ProteinHit pb; pb.setAccession("PROT_B");
pb.setMetaValue("gene_name", "GENE_OF_B");
prot.setHits({pa, pb});
ProteinIdentification::ProteinGroup g;
g.accessions = {"PROT_A", "PROT_B"};
g.probability = 0.01;
prot.insertIndistinguishableProteins(g);
cmap.setProteinIdentifications({prot});

PeptideIdentification pid;
pid.setIdentifier("run");
pid.setScoreType("q-value");
pid.setHigherScoreBetter(false);
PeptideHit hit;
hit.setSequence(AASequence::fromString("PEPTIDEK"));
hit.setCharge(2);
PeptideEvidence ev; ev.setProteinAccession("PROT_A");
hit.setPeptideEvidences({ev});
pid.setHits({hit});

ConsensusFeature cf;
cf.setMZ(500.0); cf.setRT(100.0); cf.setCharge(2);
BaseFeature bf; bf.setIntensity(10.0f); bf.setMZ(500.0); bf.setRT(100.0); bf.setCharge(2);
cf.insert(0, bf);
cf.setPeptideIdentifications({pid});
cmap.push_back(cf);

auto t = ProteinGroupArrowExport::exportToArrow(cmap);
TEST_NOT_EQUAL(t, nullptr)
TEST_EQUAL(t->num_rows(), 1)

auto pg_acc = std::static_pointer_cast<arrow::ListArray>(t->GetColumnByName("pg_accessions")->chunk(0));
auto gg_acc = std::static_pointer_cast<arrow::ListArray>(t->GetColumnByName("gg_accessions")->chunk(0));
auto gg_nam = std::static_pointer_cast<arrow::ListArray>(t->GetColumnByName("gg_names")->chunk(0));
TEST_EQUAL(gg_acc->value_length(0), pg_acc->value_length(0))
TEST_EQUAL(gg_nam->value_length(0), pg_acc->value_length(0))

// The gene belongs to PROT_B, which is member 1 -- not member 0.
auto names = std::static_pointer_cast<arrow::StringArray>(gg_nam->values());
const int64_t off = gg_nam->value_offset(0);
TEST_STRING_EQUAL(names->GetString(off), "")
TEST_STRING_EQUAL(names->GetString(off + 1), "GENE_OF_B")

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 | 🟡 Minor | ⚡ Quick win

Assert gg_accessions values.

Lines 425-429 verify only the gg_accessions list length. The fixture does not assign gene_accession to PROT_B. A regression that emits an empty or wrong accession for the annotated member will pass.

Set a distinct gene_accession on PROT_B. Assert an empty value at member 0 and that accession at member 1.

Proposed test update
 ProteinHit pb; pb.setAccession("PROT_B");
+pb.setMetaValue("gene_accession", "GENE_ACC_OF_B");
 pb.setMetaValue("gene_name", "GENE_OF_B");
@@
 auto names = std::static_pointer_cast<arrow::StringArray>(gg_nam->values());
+auto accessions = std::static_pointer_cast<arrow::StringArray>(gg_acc->values());
 const int64_t off = gg_nam->value_offset(0);
+const int64_t acc_off = gg_acc->value_offset(0);
+TEST_STRING_EQUAL(accessions->GetString(acc_off), "")
+TEST_STRING_EQUAL(accessions->GetString(acc_off + 1), "GENE_ACC_OF_B")
 TEST_STRING_EQUAL(names->GetString(off), "")
 TEST_STRING_EQUAL(names->GetString(off + 1), "GENE_OF_B")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ProteinHit pa; pa.setAccession("PROT_A"); // no gene annotation
ProteinHit pb; pb.setAccession("PROT_B");
pb.setMetaValue("gene_name", "GENE_OF_B");
prot.setHits({pa, pb});
ProteinIdentification::ProteinGroup g;
g.accessions = {"PROT_A", "PROT_B"};
g.probability = 0.01;
prot.insertIndistinguishableProteins(g);
cmap.setProteinIdentifications({prot});
PeptideIdentification pid;
pid.setIdentifier("run");
pid.setScoreType("q-value");
pid.setHigherScoreBetter(false);
PeptideHit hit;
hit.setSequence(AASequence::fromString("PEPTIDEK"));
hit.setCharge(2);
PeptideEvidence ev; ev.setProteinAccession("PROT_A");
hit.setPeptideEvidences({ev});
pid.setHits({hit});
ConsensusFeature cf;
cf.setMZ(500.0); cf.setRT(100.0); cf.setCharge(2);
BaseFeature bf; bf.setIntensity(10.0f); bf.setMZ(500.0); bf.setRT(100.0); bf.setCharge(2);
cf.insert(0, bf);
cf.setPeptideIdentifications({pid});
cmap.push_back(cf);
auto t = ProteinGroupArrowExport::exportToArrow(cmap);
TEST_NOT_EQUAL(t, nullptr)
TEST_EQUAL(t->num_rows(), 1)
auto pg_acc = std::static_pointer_cast<arrow::ListArray>(t->GetColumnByName("pg_accessions")->chunk(0));
auto gg_acc = std::static_pointer_cast<arrow::ListArray>(t->GetColumnByName("gg_accessions")->chunk(0));
auto gg_nam = std::static_pointer_cast<arrow::ListArray>(t->GetColumnByName("gg_names")->chunk(0));
TEST_EQUAL(gg_acc->value_length(0), pg_acc->value_length(0))
TEST_EQUAL(gg_nam->value_length(0), pg_acc->value_length(0))
// The gene belongs to PROT_B, which is member 1 -- not member 0.
auto names = std::static_pointer_cast<arrow::StringArray>(gg_nam->values());
const int64_t off = gg_nam->value_offset(0);
TEST_STRING_EQUAL(names->GetString(off), "")
TEST_STRING_EQUAL(names->GetString(off + 1), "GENE_OF_B")
ProteinHit pa; pa.setAccession("PROT_A"); // no gene annotation
ProteinHit pb; pb.setAccession("PROT_B");
pb.setMetaValue("gene_accession", "GENE_ACC_OF_B");
pb.setMetaValue("gene_name", "GENE_OF_B");
prot.setHits({pa, pb});
ProteinIdentification::ProteinGroup g;
g.accessions = {"PROT_A", "PROT_B"};
g.probability = 0.01;
prot.insertIndistinguishableProteins(g);
cmap.setProteinIdentifications({prot});
PeptideIdentification pid;
pid.setIdentifier("run");
pid.setScoreType("q-value");
pid.setHigherScoreBetter(false);
PeptideHit hit;
hit.setSequence(AASequence::fromString("PEPTIDEK"));
hit.setCharge(2);
PeptideEvidence ev; ev.setProteinAccession("PROT_A");
hit.setPeptideEvidences({ev});
pid.setHits({hit});
ConsensusFeature cf;
cf.setMZ(500.0); cf.setRT(100.0); cf.setCharge(2);
BaseFeature bf; bf.setIntensity(10.0f); bf.setMZ(500.0); bf.setRT(100.0); bf.setCharge(2);
cf.insert(0, bf);
cf.setPeptideIdentifications({pid});
cmap.push_back(cf);
auto t = ProteinGroupArrowExport::exportToArrow(cmap);
TEST_NOT_EQUAL(t, nullptr)
TEST_EQUAL(t->num_rows(), 1)
auto pg_acc = std::static_pointer_cast<arrow::ListArray>(t->GetColumnByName("pg_accessions")->chunk(0));
auto gg_acc = std::static_pointer_cast<arrow::ListArray>(t->GetColumnByName("gg_accessions")->chunk(0));
auto gg_nam = std::static_pointer_cast<arrow::ListArray>(t->GetColumnByName("gg_names")->chunk(0));
TEST_EQUAL(gg_acc->value_length(0), pg_acc->value_length(0))
TEST_EQUAL(gg_nam->value_length(0), pg_acc->value_length(0))
// The gene belongs to PROT_B, which is member 1 -- not member 0.
auto names = std::static_pointer_cast<arrow::StringArray>(gg_nam->values());
auto accessions = std::static_pointer_cast<arrow::StringArray>(gg_acc->values());
const int64_t off = gg_nam->value_offset(0);
const int64_t acc_off = gg_acc->value_offset(0);
TEST_STRING_EQUAL(accessions->GetString(acc_off), "")
TEST_STRING_EQUAL(accessions->GetString(acc_off + 1), "GENE_ACC_OF_B")
TEST_STRING_EQUAL(names->GetString(off), "")
TEST_STRING_EQUAL(names->GetString(off + 1), "GENE_OF_B")
🤖 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/class_tests/openms/source/ProteinGroupArrowExport_test.cpp` around
lines 393 - 435, The test currently verifies only the length of the
gg_accessions list but does not validate the actual accession values, which
leaves a regression undetected if an accession is emitted incorrectly. Set a
distinct gene_accession metadata value on the PROT_B ProteinHit (similar to how
gene_name is already set), then add assertions after the gg_accessions length
check to retrieve and verify the accession values from the gg_accessions array
using value_offset and GetString, checking for an empty string at member 0
(PROT_A) and the assigned gene_accession at member 1 (PROT_B).

Source: Coding guidelines

@timosachsenberg timosachsenberg mentioned this pull request Jul 31, 2026
8 of 11 tasks
@timosachsenberg
timosachsenberg merged commit a273195 into develop Jul 31, 2026
35 checks passed
@timosachsenberg
timosachsenberg deleted the qpx-pg-column-consistency branch July 31, 2026 16:16
timosachsenberg added a commit that referenced this pull request Aug 3, 2026
…9835, #9836 (#9841)

Backfills the QPX export spec-conformance series, the macOS PKG
notarization fix, and the Windows GUI DLL export fix that merged into
develop without changelog entries. #9805 and #9821 were intentionally
skipped (test-only / comment-only, no user-visible behavior change),
and #9818 was already documented.


Claude-Session: https://claude.ai/code/session_0118Yt3TZEMzhMhH6FwZPDVt

Co-authored-by: Claude <[email protected]>
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