Repository navigation
[FIX] ProteinIdentification: an empty file list ('spectra_data') is not stored - #10548
Merged
Merged
Conversation
…ot stored An empty 'spectra_data' (or 'spectra_data_raw') list names no files and could not be told from a missing one: getPrimaryMSRunPath() returns no files for both, and no code checks whether the meta value exists. The Parquet formats wrote both as an empty list and read an empty list back, so converting a run without files (e.g. featureXML -> consensusparquet -> consensusXML) added one. - setPrimaryMSRunPath() with an empty list removes the meta value (it stored an empty list and warned); addPrimaryMSRunPath() with an empty list changes nothing. - removeEmptyPrimaryMSRunPaths() removes empty lists; idXML, featureXML, consensusXML and the Parquet formats call it when they load a protein run, so files with an empty list stay readable. - pyOpenMS binds removeEmptyPrimaryMSRunPaths(). - Expected outputs: 17 files lose the empty 'spectra_data' line (18 lines; nothing else changes, each test passes FuzzyDiff against its expected file with only that line removed). Inputs with an empty list are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
Contributor
Author
|
CI: The step "Restore the vcpkg binary cache" fails like this:
No fix exists in this repository yet. I'll re-run the failed job once other Windows jobs get past that step again. Generated by Claude Code |
timosachsenberg
pushed a commit
that referenced
this pull request
Oct 13, 2026
QualityControl keeps the consensus map and the feature maps as identification data instead of converting them to peptide identifications and sorting those by score (#10470): - The metrics annotate the identifications of each feature map and their best matches; their meta values pass to the identifications of the consensus map with the same file and spectrum reference (and their best matches). 'cf_id' annotates the identifications that a consensus feature links. - Unidentified MS2 spectra (Ms2SpectrumStats) are observations that RTAlignment annotates; they become identifications without matches after all others, in the run without score type of their run (IdentificationDataAdapter::unscoredRun()), as the legacy peptide identifications without score type were. - The MaxQuant exporters read identification data: MQExporterHelper::linkedIdentifications() gives the identifications of a feature best first, bestIdentification() picks the one to export (MULTI-MSMS/MULTI-MATCH as before). - ConsensusMap::split() splits the identification data of a map too (through a converted copy, each part holding its share as identification data); it dropped them before. QualityControl splits the consensus map without feature maps. The identifications of a feature keep their order (the best match is the one with the best primary score), as agreed for this migration: - QualityControl_2_out.featureXML: the three identifications of one feature are in their input order (spectrum 999, 217, 334) instead of best first; nothing else changes. - QualityControl_1_out.consensusXML/mzTab: back to the goldens before 4fb5551: IDConflictResolver unassigns the two LHHLVDDK identifications in identification order. Against legacy QualityControl (PR branch build) the outputs differ only in the order of unassigned identifications (see the IDConflictResolver entry); all values, score types included, are the same. - MQEvidence_result.txt/MQMsms_result.txt: the class tests pass unsorted maps, which the old exporters read in file order (first identification = best). The new outputs are byte-identical to those of the legacy exporters (PR branch build) on the same fixtures with every feature's peptide identifications sorted as #10470 sorts them; the legacy exporters on the unsorted fixtures reproduce the previous results (within the test tolerance). New ConsensusMap_test section: split() of a map with identification data gives the identifications of the legacy split, as identification data. Validation (Linux, GCC, Debug, without OpenTIMS): all class and TOPP tests pass except the six CometAdapter comparisons (Bruker options) and FileConverter_35 (empty spectra_data list, removed by #10548), as before. Labeled-mode QualityControl (consensus map split, no feature maps) on IDMapper_6_output and MzTabExporter_1_input gives the consensusXML and mzTab of legacy QualityControl. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
timosachsenberg
commented
Oct 13, 2026
timosachsenberg
left a comment
Contributor
Author
There was a problem hiding this comment.
Seems good to me
timosachsenberg
pushed a commit
that referenced
this pull request
Oct 13, 2026
…der) Conflicts: IDMerger_idparquet_output.idXML keeps this branch's version (no 'spectra_data' and no 'file_origin', which the native .idparquet does not write); FeatureXMLFile_test and ConsensusXMLFile_test keep the new sections of both sides. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
timosachsenberg
pushed a commit
that referenced
this pull request
Oct 13, 2026
With #10548, an empty 'spectra_data' list names no files and is not stored, as no list. Run settings kept an empty list as an exception so that legacy runs without files kept it through a round trip; that exception goes: - IdentificationDataAdapter::settingsFromLegacy() always removes 'spectra_data' (the files of a run are its sources), and the merged protein run of pooled inference gets no list without files (setPrimaryMSRunPath()). - Run::setSettings() rejects any 'spectra_data', also an empty list. Outputs unchanged: the legacy loaders already drop empty lists. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
timosachsenberg
pushed a commit
that referenced
this pull request
Oct 13, 2026
The XML handlers drop an empty file list of the protein runs they read into the identifications of a map (removeEmptyPrimaryMSRunPaths()). The new FeatureXMLFile/ConsensusXMLFile sections write the empty lists into a stored file, as older versions wrote them, since a map cannot hold one, and read them through proteinIdentifications(). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
An empty
spectra_data(orspectra_data_raw) list on aProteinIdentificationnames no files, but it could not be told apart from a missing one:getPrimaryMSRunPath()returns no files in both cases, and no code checks whether the meta value exists. IDRipper and IdentifierMSRunMapper already treat both cases the same. The only existence check,FeatureMap.cpp:454, is on the map's ownspectra_data, not on a protein run.setPrimaryMSRunPath({})stored an empty list and logged "Setting an empty value for primary MS runs paths."setPrimaryMSRunPath({}). Converting a run without files added a list it never had. One example isTOPP_FileConverter_35: featureXML → consensusparquet → consensusXML. Its input has nospectra_data, but the expected output hasspectra_data = [].This PR establishes the following rule: an empty list means the same as no list, and it is not stored.
setPrimaryMSRunPath()with an empty list removes the meta value. Before, it stored an empty list and warned.addPrimaryMSRunPath()with an empty list changes nothing.ProteinIdentification::removeEmptyPrimaryMSRunPaths()removes empty lists. The idXML, featureXML, consensusXML and Parquet loaders call it for each protein run, so files written before this change still load and their empty lists disappear. pyOpenMS binds the method.spectra_dataof feature and consensus maps themselves, and code that sets an empty list directly withsetMetaValue(). The latter does not happen in OpenMS.Context: in the identification data refactoring (#10423), the files of a run are its sources. There, the run settings had to keep an empty
spectra_datalist as an exception so that idXML round trips stayed exact. With this rule, that exception and its helper code can go.Expected outputs
17 expected files each lose one or two lines of the form
<UserParam type="stringList" name="spectra_data" value="[]"/>, 18 lines in total, and nothing else changes. Before editing, I ran each failing test's own FuzzyDiff command against a copy of its expected file with only that line removed. All 18 FuzzyDiff checks that could be rerun this way passed.PercolatorAdapter_string_features_outshares an expected file withPercolatorAdapter_1_inproc_outand passes after the edit. Input files that contain an empty list (IDMapper_4/5_input.idXML,MzTabExporter_3_input.featureXML,comet.topperc_check.idXML, the pyOpenMS docs copy ofOpenPepXL_output.idXML) are unchanged.Tests
Linux, GCC 13, Debug, without OpenTIMS, on
a4438c1:TOPP_CometAdapter_*_out1: the outputs differ only by the three Bruker options, which exist only with OpenTIMS.TOPP_ProSE_11_rescore*: a Debug-only assertion in the vendored Percolator (BaseSpline.cpp:236).setPrimaryMSRunPath/addPrimaryMSRunPathwith an empty list, andremoveEmptyPrimaryMSRunPaths(ProteinIdentification_test);IdXMLFile_test);FeatureXMLFile_test,ConsensusXMLFile_test);ProteinIdentificationArrowIO_test).bind_kernel.cppwith-fsyntax-onlyagainst these headers. The Python tests were not run locally.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
Generated by Claude Code
Summary by CodeRabbit