Skip to content

[TEST] PercolatorInfile: validate getStandardFeatureSet / .pin header columns (#9460) - #9536

Merged
timosachsenberg merged 1 commit into
OpenMS:developfrom
timosachsenberg:test/9460-percolatorinfile-featureset
Jun 17, 2026
Merged

timosachsenberg merged 1 commit into
OpenMS:developfrom
timosachsenberg:test/9460-percolatorinfile-featureset

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds a PercolatorInfile_test section pinning getStandardFeatureSet(min_charge, max_charge) — the source of the Percolator .pin header columns. It asserts the exact, ordered feature set:

  • the three mandatory columns SpecId, Label, ScanNr;
  • mass/length features ExpMass, CalcMass, mass, peplen;
  • one charge<c> column per charge state in [min,max] — verified for 2..4 (charge2,charge3,charge4) and the single-state 3..3 case (charge3 only);
  • enzyme / mass-delta features enzN, enzC, enzInt, dm, absdm;

and that the assembled header (features + Peptide + Proteins) begins with SpecId and ends with Peptide, Proteins — the exact shape Percolator parses.

Why

Closes the SDK-free part of the §5 (ProSE / Percolator) [AUTO] task in the OpenMS 3.6.0 pre-release testing plan (#9460):

Validate .pin output (#9195) … add a -out_pin header/column validation test. Pass: header begins SpecId Label ScanNr, ends Peptide Proteins, and contains the enzyme/mass feature columns.

PercolatorInfile_test previously only covered load(). The header writer (getStandardFeatureSet) — the contract the full -out_pin path depends on — was untested. This pins it directly at the class level (no Percolator binary or search run needed). A full tool-level -out_pin round-trip remains a complementary, data-backed follow-up.

Test plan

Tests only — no production code changed. Verified locally: -fsyntax-only clean, full build green, test runs PASSED (exact column lists for charges 2..4 and 3..3, and the SpecId … Peptide Proteins header bounds all match).

Part of #9460. Follows #9524, #9525, #9526, #9528, #9530, #9531, #9532, #9533, #9534, #9535.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Enhanced test coverage for Percolator feature column validation, ensuring correct feature naming, proper ordering across charge state configurations, and accurate header assembly with mandatory and data columns.

… columns (OpenMS#9460)

PercolatorInfile_test only covered load(); the .pin feature-set / header writer
(getStandardFeatureSet, used to assemble the Percolator input header) was untested.

Adds a section asserting the exact ordered feature set:
- the three mandatory columns SpecId, Label, ScanNr
- mass/length features (ExpMass, CalcMass, mass, peplen)
- one "charge<c>" column per charge state in [min,max] (verified for 2..4 and the
  single-state 3..3 case)
- enzyme / mass-delta features (enzN, enzC, enzInt, dm, absdm)
and that the assembled header (features + Peptide + Proteins) begins with SpecId
and ends with Peptide, Proteins -- the exact shape Percolator parses (OpenMS#9195).

Verified: builds clean and the test runs PASSED.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

A new START_SECTION test block is added to PercolatorInfile_test.cpp to validate getStandardFeatureSet(min_charge, max_charge). It checks feature-set size and exact column ordering for charge ranges 2–4 and 3–3, and verifies the final assembled header structure including mandatory fields, charge columns, Peptide, and Proteins.

Changes

PercolatorInfile getStandardFeatureSet test coverage

Layer / File(s) Summary
getStandardFeatureSet charge range and header validation
src/tests/class_tests/openms/source/PercolatorInfile_test.cpp
Adds a test section asserting exact feature column names and ordering for multi-charge range (2–4) and single-charge range (3–3), and verifies that the assembled header prepends mandatory fields, contains the correct charge<c> columns, and appends Peptide and Proteins at expected positions.

Possibly Related PRs

  • OpenMS/OpenMS#9195: Introduces and uses PercolatorInfile::getStandardFeatureSet(min_charge, max_charge) to fix Percolator .pin header/feature columns — the exact method this PR's new tests cover.
  • OpenMS/OpenMS#9166: Builds the Percolator feature list and writes .pin output via PercolatorInfile::store(...), directly relevant to the header layout and charge<c>/Peptide/Proteins column assertions added here.

Poem

A rabbit hops through columns neat,
charge2, charge3, charge4 — complete!
Peptide follows, Proteins last,
The header tested, ordered fast.
🐇 "No misplaced column shall slip past me!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a test for getStandardFeatureSet and validating .pin header columns in PercolatorInfile.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@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.

🧹 Nitpick comments (1)
src/tests/class_tests/openms/source/PercolatorInfile_test.cpp (1)

83-86: 💤 Low value

Optional: Remove redundant verification already covered by the loop.

The loop at lines 78-81 already verifies that fs[0], fs[1], and fs[2] match the expected values "SpecId", "Label", and "ScanNr". These explicit checks are redundant.

♻️ Proposed simplification
-  // the three mandatory leading columns
-  TEST_STRING_EQUAL(fs[0], "SpecId")
-  TEST_STRING_EQUAL(fs[1], "Label")
-  TEST_STRING_EQUAL(fs[2], "ScanNr")
-
   // a single charge state yields exactly one "charge3" column and no other charge column
🤖 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/PercolatorInfile_test.cpp` around lines
83 - 86, The TEST_STRING_EQUAL assertions for fs[0], fs[1], and fs[2] at lines
83-86 are redundant because the loop at lines 78-81 already verifies these three
mandatory leading columns match the expected values "SpecId", "Label", and
"ScanNr". Remove these three redundant TEST_STRING_EQUAL calls to simplify the
test and avoid duplicate verification of the same conditions.
🤖 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/class_tests/openms/source/PercolatorInfile_test.cpp`:
- Around line 83-86: The TEST_STRING_EQUAL assertions for fs[0], fs[1], and
fs[2] at lines 83-86 are redundant because the loop at lines 78-81 already
verifies these three mandatory leading columns match the expected values
"SpecId", "Label", and "ScanNr". Remove these three redundant TEST_STRING_EQUAL
calls to simplify the test and avoid duplicate verification of the same
conditions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9c861fae-66f6-48ac-8bfb-37d2bf026418

📥 Commits

Reviewing files that changed from the base of the PR and between aacd941 and 34ff293.

📒 Files selected for processing (1)
  • src/tests/class_tests/openms/source/PercolatorInfile_test.cpp

@github-actions

Copy link
Copy Markdown
Contributor

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

  • Timo Sachsenberg

Please consider applying the following patch:

--- AUTHORS	2026-06-15 16:37:56.562105403 +0000
+++ AUTHORS.new	2026-06-15 16:38:01.819824793 +0000
@@ -23,8 +23,8 @@
  - Chirag Dave
  - Chris Bauer
  - Chris Bielow
- - Christie Mathews
  - Christian Ehrlich
+ - Christie Mathews
  - Clemens Groepl
  - Cornelia Friedle
  - Daniel Jameson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant