Repository navigation
Add round-trip test for QPX/Parquet peptidoform modification preservation - #9500
Conversation
Add a ProFormaParser_test [EXTRA] section asserting that the exact write/read chain QPXFile and FeatureMapArrowIO use for the peptidoform column -- write: ProForma::toString(fromAASequence(seq), WriteMode::CANONICAL) read: ProForma::toAASequence(parse(str), ConversionPolicy::BEST_EFFORT) -- preserves modifications across a round-trip for common UNIMOD mods (Oxidation, Phospho, Carbamidomethyl) plus an unmodified backbone. Mirrors the existing round-trip sections: it asserts backbone, length, and per-position isModified() rather than exact toString (notation may normalize), so a silently dropped modification in the Parquet/QPX lane -- which feeds the new quant outputs -- fails at the unit level. Implements the "ProForma fidelity through the Parquet/QPX lane" item from the OpenMS 3.6 release-testing plan (#9460). https://claude.ai/code/session_018EZ5DVWpC74wbXSo9utFBC
|
@timosachsenberg The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-06-12 14:20:25.153486946 +0000
+++ AUTHORS.new 2026-06-12 14:20:30.457643292 +0000
@@ -22,8 +22,9 @@
- Chirag Dave
- Chris Bauer
- Chris Bielow
- - Christie Mathews
- Christian Ehrlich
+ - Christie Mathews
+ - Claude
- Clemens Groepl
- Cornelia Friedle
- Daniel Jameson |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds three unit-test sections: a ProForma canonical round-trip test checking backbone, length, and per-residue modification preservation; a Bruker TDF native ID test validating regex extraction and scan-number parsing; and a PSMArrowIO test asserting exportToParquet rejects duplicate ProteinIdentification run identifiers. ChangesParser unit tests
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
The method-level sections only exercised scan=/MS:1000776; the parser supports the Bruker timsTOF .d (TDF) native-ID format "frame=<F> scan=<S>" (with optional trailing precursor=/windowGroup=/merged= tokens emitted by the DDA/DIA-PASEF reader) but no test pinned it. Add an [EXTRA] section asserting isNativeID() recognizes the frame= prefix, getRegExFromNativeID() targets the scan= token, and extractScanNumber(..., "MS:1002818") returns the scan= integer (last scan= for merged PASEF spectra). Implements the §6 "SpectrumNativeIDParser MS:1002818/frame=" item from the OpenMS 3.6 release-testing plan (#9460). https://claude.ai/code/session_018EZ5DVWpC74wbXSo9utFBC
FeatureMapArrowIO_test and ConsensusMapArrowIO_test assert that exportToParquet throws Exception::InvalidValue on duplicate ProteinIdentification run identifiers (#9400 Fix #2b), but the PSM lane guard (PSMArrowIO.cpp) was not directly unit-tested. Add an [EXTRA] section mirroring the sibling tests: a second ProteinIdentification colliding on the same run identifier must be rejected before any parquet is written. Implements the §3 PSM-lane duplicate-id item from the OpenMS 3.6 release-testing plan (#9460). https://claude.ai/code/session_018EZ5DVWpC74wbXSo9utFBC
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/tests/class_tests/openms/source/PSMArrowIO_test.cpp (1)
283-304: ⚡ Quick winAdd cleanup code for test hygiene.
The test correctly validates that duplicate ProteinIdentification identifiers trigger
Exception::InvalidValue. However, all other test sections in this file include cleanup code (see lines 114, 136, 154, 177, 222, 279). If the test fails unexpectedly (no exception thrown),exportToParquetwould create the directory, leaving test artifacts.🧹 Add conditional cleanup after TEST_EXCEPTION
TEST_EXCEPTION(Exception::InvalidValue, PSMArrowIO::exportToParquet(prot_ids, pep_ids, dir)) + +if (File::exists(dir)) +{ + File::removeDirRecursively(dir); +}🤖 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/PSMArrowIO_test.cpp` around lines 283 - 304, Add conditional cleanup to remove the created .idparquet artifact if the test does not throw: after the TEST_EXCEPTION(TEST_EXCEPTION(Exception::InvalidValue, PSMArrowIO::exportToParquet(prot_ids, pep_ids, dir))) block, check whether the path in dir exists and delete it (use the project file utility used elsewhere in this file, e.g. File::removeDir or File::removeDirRecursively / File::remove depending on available API) so the temporary directory is removed when the test fails to throw; reference variables/functions: dir, PSMArrowIO::exportToParquet, TEST_EXCEPTION.
🤖 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/PSMArrowIO_test.cpp`:
- Around line 283-304: Add conditional cleanup to remove the created .idparquet
artifact if the test does not throw: after the
TEST_EXCEPTION(TEST_EXCEPTION(Exception::InvalidValue,
PSMArrowIO::exportToParquet(prot_ids, pep_ids, dir))) block, check whether the
path in dir exists and delete it (use the project file utility used elsewhere in
this file, e.g. File::removeDir or File::removeDirRecursively / File::remove
depending on available API) so the temporary directory is removed when the test
fails to throw; reference variables/functions: dir, PSMArrowIO::exportToParquet,
TEST_EXCEPTION.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f5554364-96fa-4ea5-9911-a8f410633dac
📒 Files selected for processing (1)
src/tests/class_tests/openms/source/PSMArrowIO_test.cpp
Addresses a CodeRabbit review nitpick: the new duplicate-identifier section was the only one not removing its NEW_TMP_FILE directory. Add the same conditional File::removeDirRecursively cleanup the other sections use, so a regression that let the export run (instead of throwing) does not leave an .idparquet artifact behind. https://claude.ai/code/session_018EZ5DVWpC74wbXSo9utFBC
Per review of #9500: the per-position isModified() check confirms a modification is still present but not its identity/mass. Add a TEST_REAL_SIMILAR on AASequence::getMonoWeight() so a modification silently changed to a different mass (not just dropped) also fails the round-trip test, without depending on canonical-notation equality. https://claude.ai/code/session_018EZ5DVWpC74wbXSo9utFBC
Description
This PR adds a unit test to verify that the ProForma serialization chain used by QPXFile and FeatureMapArrowIO correctly preserves peptide modifications during write-read cycles.
The test pins the exact serialization chain:
ProForma::toString(ProForma::fromAASequence(seq), WriteMode::CANONICAL)ProForma::toAASequence(ProForma::parse(str), ConversionPolicy::BEST_EFFORT)This ensures that silent modification drops or mangles in the Parquet/QPX lane (which feeds new quantification outputs) are caught at the unit test level rather than only in end-to-end data validation.
The test covers:
It validates that:
Checklist
https://claude.ai/code/session_018EZ5DVWpC74wbXSo9utFBC
Summary by CodeRabbit