Repository navigation
Make FeatureLinker consensus output order reproducible (supersedes #9748) - #10660
Conversation
FeatureGroupingAlgorithm::postprocess_ ordered the consensus features with a chain of stable sorts (quality, maps, size). These keys tie on many consensus features (e.g. all singletons share size and quality), so tied features kept the grouping order, which depends on the input features' randomly assigned unique ids and is not reproducible across runs. Replace the chain with a single stable_sort whose comparator makes position (RT, m/z) the primary, unique-id independent key; size/maps/quality only break exact-position ties. Ordering is equivalent to the previous chain followed by a sortByPosition().
FeatureGroupingAlgorithm now sorts the consensus features by position, so the FeatureLinkerUnlabeledQT/KD, ProteomicsLFQ and MS1LabeledWorkflow references list the same consensus features in a new order. Checked for each file: the set of consensus features (and of mzTab rows) is unchanged, only the order differs. Machine paths in the regenerated files are kept as they were. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01N27gUPMwAazeK8SAKECuCa
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
Conflicts in the ProteomicsLFQ_3 and ProteomicsLFQ_3_seedRT references: develop (#10660) reordered their consensus features and gave them new unique ids, without changing their contents. Resolved by taking develop's references and adding the 16 mbr_transfer_map_indices values of this branch to the same consensus features, matched by content (centroid, grouped elements, peptide hits), plus the mzTab column, matched by opt_global_feature_id. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MzD9y3qFyEZWkAYVLqcghM
…enMS#9748) (OpenMS#10660) * Sort consensus map by position after grouping for reproducible output FeatureGroupingAlgorithm::postprocess_ ordered the consensus features with a chain of stable sorts (quality, maps, size). These keys tie on many consensus features (e.g. all singletons share size and quality), so tied features kept the grouping order, which depends on the input features' randomly assigned unique ids and is not reproducible across runs. Replace the chain with a single stable_sort whose comparator makes position (RT, m/z) the primary, unique-id independent key; size/maps/quality only break exact-position ties. Ordering is equivalent to the previous chain followed by a sortByPosition(). * [TEST] Update references for the position-sorted consensus output FeatureGroupingAlgorithm now sorts the consensus features by position, so the FeatureLinkerUnlabeledQT/KD, ProteomicsLFQ and MS1LabeledWorkflow references list the same consensus features in a new order. Checked for each file: the set of consensus features (and of mzTab rows) is unchanged, only the order differs. Machine paths in the regenerated files are kept as they were. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01N27gUPMwAazeK8SAKECuCa --------- Co-authored-by: jonasscheid <[email protected]> Co-authored-by: Claude <[email protected]>
…#10677, ...) Conflicts: - ConsensusMap::appendColumns: develop shifts the map indices of match-between-runs transfers (#10672); the identification data of the branch keeps its own map index shift. - FileTypes: .raw is compressed-readable (#10647); .oms stays a removed format. - CHANGELOG: both entries. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
…tively - #10660: the feature grouping algorithms sort the consensus map by position in postprocessMaps(). - #10633: the PIP-ECHO donor gate reads the q-value of a donor's identifications from the identification data of its map: the primary score if it is a q-value, else a q-value meta value or supplementary score of the first match (as legacy export gives them to the peptide hit). The test covers both and builds its maps as identification data. - #10672: IDConflictResolverAlgorithm::annotateTransfers() reads the "map_index" of the identifications that a consensus feature links; its C++ and Python tests build their maps as identification data. ConsensusMap::appendColumns() shifts the transfer map indices. - #10656: FeatureFinderIdentificationAlgorithm extracts the seeds of a FAIMS CV only at that CV. - bfc1c83/1781d9e621: protein inference on a consensus map skips grouping and resolution of an empty graph; the new test runs on identification data. - #10652: the mzTab tests build their consensus maps as identification data. ProteomicsLFQ reference outputs: develop's new references with the order of the identifications that this branch writes (the same consensus features, identifications and values; mzTab: the PSM rows of develop, in this branch's order and numbering). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
Requested by Timo · project thread
Description
This carries @jonasscheid's fix from #9748 onto the current develop. The fix commit is cherry-picked with its original author. I opened a new PR because the fork branch can't be pushed to from here, and #9748 conflicts with develop in 8 reference files.
FeatureGroupingAlgorithm::postprocess_used to order the consensus features with a chain of stable sorts (quality, maps, size). Many features tie on these keys, so tied features kept the grouping order. That order depends on the random unique ids of the input features. The fix sorts by position (RT, m/z) first, and uses size, maps and quality only to break exact-position ties.The second commit regenerates the references whose order changes. #9748 had covered only the FeatureLinker files, so its CI failed on every platform. This PR updates 33 files:
For every regenerated file I checked that the new output contains the same consensus features (and the same mzTab rows) as the old reference, in a different order. In the regenerated files, the machine-specific paths were reset to the values they had before. The mzTab MTD sections are unchanged.
Local check (Linux, clang 18): I ran the TOPP_FeatureLinker*, TOPP_ProteomicsLFQ* and TOPP_MS1LabeledWorkflow* tests and the FeatureGrouping/QTClusterFinder/StablePairFinder/PipEcho/MS1Labeled class tests, with and without the change. With the new references, the failing set is the same as on develop: 22 tests that fail locally on develop too, presumably because helper tools and test data aren't built in my partial build. The full suite, the FeatureLinkerWNet test (
WITH_WNETALIGN) and the pyOpenMS tests are left to CI.Checklist
Generated by Claude Code
Summary by CodeRabbit
Bug Fixes
Tests