Repository navigation
Add idparquet support to PeptideIndexer, IDScoreSwitcher, PSMFeatureExtractor and IDFilter - #9396
Conversation
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Co-Authored-By: Claude Opus 4.7 <[email protected]>
…cklist peptide inputs Co-Authored-By: Claude Opus 4.7 <[email protected]>
…cs to mention idparquet support Co-Authored-By: Claude Opus 4.7 <[email protected]>
…Switcher/PSMFeatureExtractor/IDFilter (OpenMS#9396) Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
@jonasscheid The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-05-22 16:26:07.293744613 +0000
+++ AUTHORS.new 2026-05-22 16:26:12.589556899 +0000
@@ -59,6 +59,7 @@
- Johannes Veit
- Johannes von Kleist
- Johan Teleman
+ - jonasscheid
- Joshua Charkow
- Juliane Schmachtenberg
- Julianus Pfeuffer |
📝 WalkthroughWalkthroughFour TOPP identification processing tools—PeptideIndexer, IDFilter, IDScoreSwitcher, and PSMFeatureExtractor—are updated to accept and produce idparquet identification bundles alongside idXML. Documentation, CLI parameter validation, FileHandler invocations, and the CHANGELOG are harmonized to reflect this extended format support. Changesidparquet Format Support in TOPP Tools
Possibly related PRs
Suggested reviewers
🚥 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 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 (1)
src/topp/PeptideIndexer.cpp (1)
89-90: 🏗️ Heavy liftAdd integration coverage for the new
idparquetI/O path.This change extends core read/write behavior but the PR notes no new CTests. Please add TOPP integration tests that exercise
idparquetinput/output for this tool (round-trip/behavior parity withidXML).As per coding guidelines "TOPP tools must add integration tests in
src/tests/topp/CMakeLists.txtand tool documentation must be added todoc/doxygen/public/TOPP.doxygen".Also applies to: 118-118, 179-179
🤖 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/PeptideIndexer.cpp` around lines 89 - 90, The tool PeptideIndexer was extended to accept "idparquet" via registerInputFile_ and setValidFormats_, so add TOPP integration tests that exercise idparquet I/O parity with idXML: update src/tests/topp/CMakeLists.txt to add new tests invoking the PeptideIndexer executable with idparquet input and producing idparquet output (and a round-trip test converting idXML->idparquet->idXML to verify behavior parity), include appropriate expected output comparisons, and add documentation entries for PeptideIndexer in doc/doxygen/public/TOPP.doxygen describing the new idparquet support and the test coverage; ensure tests reference the PeptideIndexer binary name and use the same command-line options used in existing idXML tests so they validate equivalent behavior.
🤖 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/topp/PeptideIndexer.cpp`:
- Around line 89-90: The tool PeptideIndexer was extended to accept "idparquet"
via registerInputFile_ and setValidFormats_, so add TOPP integration tests that
exercise idparquet I/O parity with idXML: update src/tests/topp/CMakeLists.txt
to add new tests invoking the PeptideIndexer executable with idparquet input and
producing idparquet output (and a round-trip test converting
idXML->idparquet->idXML to verify behavior parity), include appropriate expected
output comparisons, and add documentation entries for PeptideIndexer in
doc/doxygen/public/TOPP.doxygen describing the new idparquet support and the
test coverage; ensure tests reference the PeptideIndexer binary name and use the
same command-line options used in existing idXML tests so they validate
equivalent behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9ccbba37-fc6a-48c7-b7ee-2f7849380bee
📒 Files selected for processing (5)
CHANGELOGsrc/topp/IDFilter.cppsrc/topp/IDScoreSwitcher.cppsrc/topp/PSMFeatureExtractor.cppsrc/topp/PeptideIndexer.cpp
…ndexer/PSMFeatureExtractor
Widening storeIdentifications' allowed_types from {IDXML} to {IDXML, IDPARQUET}
broke TOPPAS pipelines: intermediate files are named ".unknown" when a tool has
multiple valid output formats and no out_type is set, and FileHandler only falls
back from an UNKNOWN filename to a single allowed type. With two allowed types
it threw InvalidFileType.
Pass a single concrete type to storeIdentifications, derived from the input
file type (or the pre-computed out_type in PSMFeatureExtractor). Document the
size-1 fallback contract on FileHandler::storeIdentifications so future tools
adding format support don't hit the same regression.
Fixes TOPP_ExecutePipeline_Ecoli_Identification.toppas and
TOPP_ExecutePipeline_FDR_NeighborSearch.toppas in PR OpenMS#9396.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/topp/PSMFeatureExtractor.cpp`:
- Line 291: The change adds idparquet support via
FileHandler().storeIdentifications but lacks integration coverage; add a TOPP
integration test that runs the PSMFeatureExtractor idparquet read/write flow
(write identifications using the new idparquet path and read them back) and
register that test in the TOPP tests CMakeLists so it runs in CI, and also add
the corresponding tool documentation entry to the TOPP.doxygen file; ensure the
test invokes the same code paths that call FileHandler().storeIdentifications
and validates round-trip correctness of all_protein_ids/all_peptide_ids.
🪄 Autofix (Beta)
❌ Autofix failed (check again to retry)
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
Run ID: 7710f4c5-dc1c-43e5-9282-03cb313f8dc4
📒 Files selected for processing (5)
src/openms/include/OpenMS/FORMAT/FileHandler.hsrc/topp/IDFilter.cppsrc/topp/IDScoreSwitcher.cppsrc/topp/PSMFeatureExtractor.cppsrc/topp/PeptideIndexer.cpp
✅ Files skipped from review due to trivial changes (1)
- src/openms/include/OpenMS/FORMAT/FileHandler.h
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found. |
|
Nice! Let us know which benfits you observe. For some things like IDFilter, one could even think about streaming solutions now. |
|
Will do @jpfeuffer Implementing support for parquet based formats for the quant tools used in mhcquant and then I'll report back to you! |
|
@jpfeuffer @timosachsenberg seeing ~ 15x reduced storage occupation, which is great. Speed did not increase on small test dataset, could that be improved with streaming? |
|
Writing was typically quite fast for idXML already. I would have hoped that reading is also faster. I can take a look at some point where we loose time. |
Extend the CONSENSUSXML branch (both load and store sides) with CONSENSUSPARQUET. The store uses the single-concrete pattern from OpenMS#9396 ({infiletype}), already in use on the idXML/idparquet branch.
* Add parquet read/write to MapRTTransformer Extend the featureXML/consensusXML/idXML dispatch branches to also accept their parquet siblings. Load whitelists are multi-element; store calls pass a single concrete type derived from the input file type, preserving the size-1 .unknown fallback contract (FileHandler.h:288-294, established by 30d2f9b). * Add parquet read/write to FeatureFinderIdentification TOPP tool widens -id/-id_ext to idparquet and -out/-candidates_in/-candidates_out to featureparquet. Load whitelists are multi-element; the -out store derives a single concrete type from -id (main path) or -candidates_in (re-score path). Library change: FeatureFinderIdentificationAlgorithm::storeFeatures(candidates_out_) now passes a single concrete type derived from the candidates_out filename, with FEATUREXML fallback for TOPPAS .unknown intermediates (FileHandler.h:286-294 contract from 30d2f9b). * Add parquet read/write to FeatureLinker* tools (5 binaries) Touches FeatureLinkerBase.cpp, FeatureLinkerLabeled.cpp, FeatureLinkerUnlabeled.cpp. - FeatureLinkerBase covers FLULKD, FLULQT, FLWNet via common_main_ (3 binaries). - FeatureLinkerLabeled overrides registerOptionsAndFlags_; widened locally (1 binary). - FeatureLinkerUnlabeled has its own complete main_; recipe applied with FEATUREPARQUET reference-selection fallback to index 0 (FeatureXMLFile::loadSize is XML-only). Load whitelists multi-element; stores use single-concrete output derived via consensusOutTypeFor() helper. The helper is available in FeatureLinkerUnlabeled.cpp via the textual #include "FeatureLinkerBase.cpp" (static linkage, no duplication needed). * Add parquet read/write to FileConverter (+ 5 TOPP-tests) Format lists, in_type/out_type dispatch branches, and rejection guards updated for featureparquet and consensusparquet. Stores at the featureXML and consensusXML out_type branches now use {out_type} (single-concrete from out_type) and serve both XML and parquet sinks from one branch. Five new TOPP-tests (TOPP_FileConverter_32-36) exercise the full conversion-cell matrix: - 32 featureparquet -> featureXML (round-trip identity) - 33 consensusparquet -> consensusXML (round-trip identity) - 34 featureparquet -> consensusparquet (mhcquant parquet-lane promote, content verified via XML round-trip) - 35 featureXML -> consensusparquet (cross-serialization, content verified via XML round-trip) - 36 featureparquet -> consensusXML (cross-serialization) Bundles .featureparquet and .consensusparquet are directories of parquet files (one per logical table: features/consensus_features + 4 id tables). Two committed parquet test-input fixtures (FileConverter_9_output.featureparquet, FileConverter_14_output.consensusparquet) generated via FileConverter from their XML siblings. Five dedicated XML output fixtures (FileConverter_32-36_output.*) freeze the expected round-trip content (extra dataProcessing entries from each FileConverter pass and the parquet schema's spectra_data empty-stringList UserParam are part of the recorded baseline). * Add parquet read/write to IDConflictResolver Extend featureXML/consensusXML dispatch branches with FEATUREPARQUET/CONSENSUSPARQUET. Load whitelists multi-element; store calls pass single concrete type derived from in_type. The implicit else-branch is made explicit (else if CONSENSUSXML || CONSENSUSPARQUET) for readability. * Add parquet read to MzTabExporter Extend featureXML/consensusXML/idXML dispatch branches with parquet siblings. Output is always mzTab, so no store-side changes are needed. * Add parquet read to TextExporter Extend featureXML/consensusXML/idXML dispatch branches with parquet siblings. Output is always tsv/csv/txt, so no store-side changes are needed. * Add consensusparquet read/write to IDFilter Extend the CONSENSUSXML branch (both load and store sides) with CONSENSUSPARQUET. The store uses the single-concrete pattern from #9396 ({infiletype}), already in use on the idXML/idparquet branch. * Document size-1 .unknown fallback contract on storeFeatures/storeConsensusFeatures Verbatim mirror of the wording added to storeIdentifications in 30d2f9b. Same code-level behavior; documenting it here so future format additions to TOPP tools dispatching FeatureMap/ConsensusMap use the single-concrete type pattern and don't break TOPPAS .unknown intermediates. * Refactor MapAlignerIdentification to FileHandler + parquet support Refactor loadInitialMaps_ and storeTransformedMaps_ helpers from direct FeatureXMLFile/ConsensusXMLFile dispatches to FileHandler with if-constexpr template specialization, preserving the 'avoid code duplication' intent. Add featureparquet/consensusparquet/idparquet support to the in/out/reference:file parameters and to all three dispatch branches (FEATUREXML, CONSENSUSXML, IDXML). The reference-file switch and main_ switch use case-fall-through to share each parquet+XML pair. storeTransformedMaps_ derives a single concrete output type from in_type (output format follows input format). Audit of MapAlignerBase.h:206 reference-format-must-match check: only fires for REF_RESTRICTED tools (PoseClustering, TreeGuided), which are not getting parquet support in this PR. MAI uses REF_FLEXIBLE and bypasses the check. No MapAlignerBase.h change needed. Drop unused #include <FeatureXMLFile.h> and <ConsensusXMLFile.h>. * CHANGELOG: parquet support for QUANT-chain TOPP tools Per-tool entries for the 8 newly-touched binaries (MapRTTransformer, MapAlignerIdentification, FeatureFinderIdentification, FileConverter, IDConflictResolver, MzTabExporter, TextExporter, IDFilter) plus a consolidated FeatureLinker* entry covering all 5 inheritance binaries. Library entry mirrors the size-1 .unknown fallback contract documentation onto storeFeatures/storeConsensusFeatures, parallel to the storeIdentifications wording from 30d2f9b. All entries reference #TBD pending the upstream PR. * test(INIUpdater): update TOPPAS refs for FeatureLinker parquet formats FeatureLinkerBase now advertises featureparquet/consensusparquet in its in/out supported_formats. INIUpdater regenerates each node's parameter description from the live tool, so the FeatureLinkerUnlabeled node in the _1_noupdate and _3_old_out reference toppas files diverged. Sync the two references to the new format lists. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * Address CodeRabbit review: parquet gates + user-facing text Valid findings fixed: - FileConverter: CSV/IBSpectra and OMS output gates rejected already-loaded parquet maps despite featureparquet/consensusparquet being advertised inputs. Widen the in_type guards so consensusparquet->ibspectra and feature/consensusparquet->oms reach the same code path as their XML counterparts (verified: featureparquet->oms is byte-identical to featureXML->oms; consensusparquet->ibspectra now matches consensusXML behavior). - MzTabExporter/TextExporter: tool descriptions still said "XML formats"; updated to mention parquet. - FeatureLinkerBase: keep_subelements flag help and the fractionated-design error said "consensusXML" only; now mention consensusparquet (also fixed an "als"->"as" typo). Regenerated the two INIUpdater .toppas references that embed the keep_subelements description. Skipped (with reason): - "Add unknown to setValidFormats_" (out params, 3x): TOPPBase already accepts UNKNOWN/.unknown extensions for in/out (TOPPBase.cpp ~1428/1495/1514) and setValidFormats_(force_OpenMS_format=true) would throw "format 'unknown' is invalid" at registration. Would break tool startup; not applied. - FeatureLinkerUnlabeled parquet reference selection: no lightweight parquet feature-count API exists (FeatureMapArrowIO only does full import/export); index-0 is a correct documented fallback. Enhancement, not a bug. - MapAlignerIdentification single in_type for mixed input lists: only affects mixed-format input lists with .unknown outputs; uniform lists (the norm) work. Belongs with the broader output-track-coupling discussion. - Brace nitpick: braceless single-statement if is valid and idiomatic here. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Timo Sachsenberg <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Summary
Extends the native
.idparquetidentification format (introduced in #9225 / #9232) to fouridentification-processing TOPP tools that previously accepted only
.idXML:-in/-out-in/-out-in/-out/-out_type-in/-out, plus thewhitelist:peptides/blacklist:peptidesfilter inputsThis lets identification workflows — e.g. the nf-core/mhcquant search→rescore chain
(
CometAdapter → PeptideIndexer → IDMerger → PSMFeatureExtractor → PercolatorAdapter → IDScoreSwitcher → IDFilter) — run end-to-end in.idparquetwithoutIDFileConverterbridge conversions.
Implementation
FileHandler::loadIdentifications/storeIdentificationsalready dispatchFileTypes::IDPARQUET, so no new I/O logic is needed. Each tool received the uniformchange already used for the idparquet-capable tools (IDMerger, PercolatorAdapter, IDRipper):
idparquetto thesetValidFormats_/setValidStrings_lists for identification I/O parameters;FileTypes::IDPARQUETto the explicitallowed_typeswhitelist in everyloadIdentifications/storeIdentificationscall;in_type/infiletypedispatch guards (PSMFeatureExtractor, IDFilter).No directory-shaped-output handling is required for these tools —
FileHandler::getTypeand
TOPPBase::inputFileReadable_already accommodate the.idparquetdirectory bundle.Validation
Built locally and validated against real immunopeptidomics data (PRIDE PXD011628, 2 runs).
The mhcquant search→rescore chain was run end-to-end in
.idparquetwith noIDFileConverterbridges; each tool's idparquet output is content-equivalent to its idXMLoutput — identical peptide-identification counts, PSM counts, peptide-sequence sets and
protein-accession sets.
Scope
This PR covers the search→rescore identification tools. The quantification-stage tools
(
MapAlignerIdentification,MapRTTransformer,FeatureFinderIdentification,TextExporter) do not yet accept.idparquetand are left for a follow-up. No CTest casesare added here — happy to add idparquet round-trip tests if preferred.
Summary by CodeRabbit
New Features
Documentation