Repository navigation
Add option to PeakFileOption to ignore loading (#7901) - #7902
Conversation
|
""" WalkthroughThe changes introduce functionality to the Changes
Possibly related issues
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/openms/include/OpenMS/FORMAT/OPTIONS/PeakFileOptions.h (1)
209-210: Add documentation for the new methodsThese new methods lack documentation comments explaining their purpose, unlike most other methods in this file. Consider adding documentation that describes what skipping chromatograms means and when this option would be useful.
+ /// Sets whether to skip loading chromatograms from the file (useful when only spectra data is needed) void setSkipChromatograms(bool skip); + /// Returns whether chromatograms should be skipped during loading bool getSkipChromatograms() const;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/openms/include/OpenMS/FORMAT/OPTIONS/PeakFileOptions.h(2 hunks)src/openms/source/FORMAT/MzMLFile.cpp(1 hunks)src/openms/source/FORMAT/OPTIONS/PeakFileOptions.cpp(1 hunks)src/tests/class_tests/openms/source/MzMLFile_test.cpp(1 hunks)src/tests/class_tests/openms/source/PeakFileOptions_test.cpp(1 hunks)
🔇 Additional comments (4)
src/openms/source/FORMAT/MzMLFile.cpp (1)
151-155: New feature to optimize memory usage and performance when only spectra data is needed.The added code checks if chromatograms should be skipped based on the user's preferences and clears them if needed. This implementation is clean and efficient, as it first loads all data and then conditionally removes the chromatograms.
src/tests/class_tests/openms/source/PeakFileOptions_test.cpp (1)
223-230: Test case for the new skipChromatograms functionality looks good.The test verifies both the default value (false) and the ability to change the setting, following the established pattern for testing properties in this class.
src/tests/class_tests/openms/source/MzMLFile_test.cpp (1)
1221-1232: Integration test for skipChromatograms feature is properly implemented.The test effectively validates that when the skipChromatograms option is enabled, no chromatograms are loaded from the test file. This provides good coverage for the new feature.
src/openms/source/FORMAT/OPTIONS/PeakFileOptions.cpp (1)
315-323: Implementation of getter and setter for skipChromatograms is clean and follows class conventions.These methods follow the established pattern for property getters and setters in this class. The implementation is straightforward and consistent with the rest of the codebase.
|
|
||
| if (options_.getSkipChromatograms()) | ||
| { | ||
| map.getChromatograms().clear(); |
There was a problem hiding this comment.
I think this is a suboptimal solution as it will still parse the chromatograms.
skipping should be done in the parser
|
note that there exists already skip_chromatogram_ in MzMLHandler |
| handler.setOptions(options_); | ||
| if (options_.getSkipChromatograms()) | ||
| { | ||
| handler.setLoadDetail(Internal::XMLHandler::LD_NO_CHROMATOGRAMS); |
There was a problem hiding this comment.
where is this defined?
cbielow
left a comment
There was a problem hiding this comment.
Nice.
A few things to consider below.
@adityamuzumdar see my comment. Do you think the enum is even needed? I think it should work just with the peak file option. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
CHANGELOG (1)
41-41: Improve clarity of the CHANGELOG entryThe current entry is a bit unclear about what the PeakFileOption actually does and includes a redundant "fix" term at the end. Since this entry is already in the "Fixes:" section, the term "fix" is redundant.
- Add option to PeakFileOption to ignore loading of chromatograms or spectra from mzML fix (#7901) + Add option to PeakFileOption to ignore loading of chromatograms from mzML files to optimize memory usage and performance (#7901)This change clarifies that the option specifically targets chromatogram loading (which aligns with the PR description) and mentions the benefits of this feature.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
AUTHORS(1 hunks)CHANGELOG(1 hunks)
🔇 Additional comments (1)
AUTHORS (1)
9-9: Author addition is properly formatted and in alphabetical order.The addition of "Aditya Muzumdar" to the AUTHORS file follows the project's formatting conventions and maintains the alphabetical ordering of contributors.
|
please resolve merge conflicts |
|
if it builds and tests passes it is ready to go. Thanks! |
User description
This PR adds the skip_chromatograms_ option to PeakFileOptions, allowing users to skip loading chromatogram data from MzML files. This is useful when only spectra data is needed, optimizing memory usage and performance.
Key Changes:
• Added setSkipChromatograms(bool) and getSkipChromatograms() methods to PeakFileOptions.
• Updated MzMLFile::load() to respect the skip_chromatograms_ flag and clear chromatogram data if set.
• Added unit tests in MzMLFile_test.cpp and PeakFileOptions_test.cpp to validate the new functionality.
PR Type
Enhancement, Tests
Description
Added
skip_chromatograms_option inPeakFileOptionsto skip chromatogram loading.Updated
MzMLFile::load()to respect theskip_chromatograms_flag.Introduced new unit tests to validate
skip_chromatograms_functionality.Enhanced memory optimization by clearing chromatogram data when not needed.
Changes walkthrough 📝
MzMLFile.cpp
Update `MzMLFile::load()` to handle chromatogram skippingsrc/openms/source/FORMAT/MzMLFile.cpp
skip_chromatograms_isenabled.
MzMLFile::load()respects the newskip_chromatograms_flag.PeakFileOptions.cpp
Add methods to configure chromatogram skippingsrc/openms/source/FORMAT/OPTIONS/PeakFileOptions.cpp
setSkipChromatogramsandgetSkipChromatogramsmethods.skip_chromatograms_flag.PeakFileOptions.h
Declare chromatogram skipping methods and variablesrc/openms/include/OpenMS/FORMAT/OPTIONS/PeakFileOptions.h
setSkipChromatogramsandgetSkipChromatogramsmethods.skip_chromatograms_private member variable.MzMLFile_test.cpp
Add unit test for chromatogram skipping in `MzMLFile`src/tests/class_tests/openms/source/MzMLFile_test.cpp
MzMLFile.PeakFileOptions_test.cpp
Add unit test for `PeakFileOptions` chromatogram skippingsrc/tests/class_tests/openms/source/PeakFileOptions_test.cpp
setSkipChromatogramsandgetSkipChromatograms.skip_chromatograms_flag.Summary by CodeRabbit