Repository navigation
Fix MSExperiment::reset() to clear chromatograms, preventing data duplication on reload - #9211
Merged
Merged
Conversation
…ment::reset(), improve applyRTBlockFiltering safety, fix Deisotoper_input2 test data Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/5af4aeef-2340-4727-b161-3364b83203dd Co-authored-by: jpfeuffer <[email protected]>
…pectrum removal Agent-Logs-Url: https://github.com/OpenMS/OpenMS/sessions/5af4aeef-2340-4727-b161-3364b83203dd Co-authored-by: jpfeuffer <[email protected]>
Copilot
AI
changed the title
[WIP] Fix FileFilter extracting scans twice when called with -rt start:stop
Fix MSExperiment::reset() to clear chromatograms, preventing data duplication on reload
Apr 23, 2026
Contributor
|
looks legit |
Contributor
|
Feel free to merge.. I used Opus this time so not surprised it's better this time. |
jpfeuffer
marked this pull request as ready for review
April 23, 2026 13:49
This was referenced Apr 24, 2026
timosachsenberg
pushed a commit
that referenced
this pull request
Apr 24, 2026
- Add Fix entry for MSExperiment::reset() not clearing chromatograms (#9211) Co-authored-by: GitHub Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
timosachsenberg
pushed a commit
that referenced
this pull request
Apr 24, 2026
…9215) The implementation of reset() was updated in #9211 to also clear chromatograms, preventing data duplication on reload. The Doxygen comment on the declaration in MSExperiment.h still said only "spectra, ranges, metadata" — update it to accurately reflect that chromatograms are also cleared. Co-authored-by: GitHub Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
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.
FileFilter produces duplicate data when using
-rt start:stopwith block-aware RT filtering modes. The root cause isMSExperiment::reset()clearing spectra but not chromatograms — so whenapplyRTBlockFilteringreloads the file viaMzMLFile::load()→map.reset(), chromatograms from the first (metadata-only) load persist and get duplicated by the second load.Changes
MSExperiment::reset()— Addchromatograms_.clear(), making it consistent withclear(true)applyRTBlockFiltering()— Replace--exp.end()withstd::next(last_spec) == exp.end()to avoid fragile temporary iterator semantics; add bounds checks before decrementinglast_specwhen it equalsexp.begin()(previously UB in edge cases)Deisotoper_input2.mzML— Remove duplicate spectrum (same native IDscan=2136appeared twice with different charge states, artifact of the bug); fix indexed mzML byte offsetsMSExperiment_test.cpp— Extendreset()test to verify chromatograms are cleared