Add ignoreRtCorrection support in measurement loading#648
Add ignoreRtCorrection support in measurement loading#648YukiMatsuzawa merged 1 commit intomasterfrom
Conversation
- Modified LoadMeasurementAsync to accept ignoreRtCorrection parameter. - Added new constructor in StandardDataProvider for ignoreRtCorrection. - Updated StandardDataProviderFactory to include IgnoreRtCorrection property. - Set IgnoreRtCorrection to true in RtCorrectionProcessModelLegacy for parallel processing. - Enhanced documentation for StandardDataProvider constructors.
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for ignoring retention time (RT) correction during measurement loading, primarily to enable parallel processing in the RT correction workflow. The key change allows the RT correction process to load raw data without applying existing RT corrections, preventing corruption when multiple threads process files simultaneously.
Key Changes:
- Added
ignoreRtCorrectionparameter to the measurement loading pipeline - Introduced a new property and constructor to control RT correction behavior in
StandardDataProvider - Configured parallel RT correction processing to ignore existing RT corrections
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| RtCorrectionProcessModelLegacy.cs | Sets IgnoreRtCorrection = true when creating data providers for parallel RT correction processing |
| StandardDataProvider.cs | Adds new constructor and factory property to support the ignoreRtCorrection parameter |
| BaseDataProvider.cs | Modifies LoadMeasurementAsync to conditionally apply RT correction based on the new parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| protected static async Task<RawMeasurement> LoadMeasurementAsync(AnalysisFileBean file, bool isProfile, bool isImagingMs, bool isGuiProcess, int retry, CancellationToken token) { | ||
| using (var access = new RawDataAccess(file.AnalysisFilePath, 0, isProfile, isImagingMs, isGuiProcess, file.RetentionTimeCorrectionBean.PredictedRt)) { | ||
| protected static async Task<RawMeasurement> LoadMeasurementAsync(AnalysisFileBean file, bool isProfile, bool isImagingMs, bool isGuiProcess, int retry, bool ignoreRtCorrection, CancellationToken token) { | ||
| List<double> correctedRts = ignoreRtCorrection ? null : file.RetentionTimeCorrectionBean.PredictedRt; |
There was a problem hiding this comment.
Consider using a conditional access operator for safer null handling. If file.RetentionTimeCorrectionBean or PredictedRt could be null, this could throw a NullReferenceException. The logic should handle the case where RT correction data might not exist: List<double> correctedRts = ignoreRtCorrection ? null : file.RetentionTimeCorrectionBean?.PredictedRt;
| List<double> correctedRts = ignoreRtCorrection ? null : file.RetentionTimeCorrectionBean.PredictedRt; | |
| List<double> correctedRts = ignoreRtCorrection ? null : file.RetentionTimeCorrectionBean?.PredictedRt; |
| private readonly int retry = 5; | ||
|
|
||
| /// <summary> | ||
| /// Whether to ignore RT correction when reading raw spectra. |
There was a problem hiding this comment.
[nitpick] The documentation comment uses 'RT' abbreviation while the property name uses the full 'RtCorrection'. For consistency, consider expanding 'RT' to 'retention time' in the comment: 'Whether to ignore retention time correction when reading raw spectra.'
| /// Whether to ignore RT correction when reading raw spectra. | |
| /// Whether to ignore retention time correction when reading raw spectra. |
Add ignoreRtCorrection support in measurement loading