-
Notifications
You must be signed in to change notification settings - Fork 51
XicGrouping part2 #2573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XicGrouping part2 #2573
Conversation
Precursor/FragmentRank removed
nbollis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So close to being ready, I just want a few summary comments on important methods and parameters. Good work!
MetaMorpheus/EngineLayer/DIA/PrecursorFragmentGrouping/UmpirePfGroupingEngine.cs
Show resolved
Hide resolved
MetaMorpheus/EngineLayer/DIA/PrecursorFragmentGrouping/XicGroupingEngine.cs
Show resolved
Hide resolved
MetaMorpheus/EngineLayer/DIA/XicConstruction/HighestIsotopePeakXicConstructor.cs
Outdated
Show resolved
Hide resolved
| /// DIAEngine defines a workflow of generating DDA-like pseudo MS2 scans for DIA data analysis. It includes the processes of extracting precursor and | ||
| /// fragment XICs, grouping them into PrecursorFragmentsGroup objects, and constructing pseudo MS2 scans. | ||
| /// </summary> | ||
| public class DIAEngine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A future refactor should make DIAEngine a child class of MetaMorpheusEngine to take advantage of our time tracking, result writing, file specific parameters, and status and warning messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
MetaMorpheus/EngineLayer/DIA/PrecursorFragmentGrouping/XicGroupingEngine.cs:1
- The XicLinearSpline instantiation on line 98 of TestPfPairAndPfGroup.cs is missing the scanIndexBased parameter that was used in the removed test on line 93 of TestXicGrouping.cs, potentially changing test behavior.
using System;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| var xic2 = new ExtractedIonChromatogram(peakList2); | ||
| double corr = PrecursorFragmentsGroup.CalculateXicCorrelation(xic1, xic2); | ||
| //Assert.That(corr, Is.EqualTo(1.0).Within(1e-6)); |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out assertions or replace with actual test logic. These lines (210, 221, 231) appear to be debugging remnants.
| if (arrayA[idx] == 0f) | ||
| { | ||
| arrayA[idx] = (arrayA[idx - 1] + arrayA[idx + 1]) / 2; | ||
| } | ||
| if (arrayB[idx] == 0f) | ||
| { | ||
| arrayB[idx] = (arrayB[idx - 1] + arrayB[idx + 1]) / 2; | ||
| } |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The zero-filling logic uses magic number comparisons (0f). Consider extracting this interpolation logic into a named helper method or add comments explaining why zero values are being interpolated.
Co-authored-by: Copilot <[email protected]>
Alexander-Sol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
This pull request introduces significant enhancements and new features to the DIA (Data Independent Acquisition) analysis engine, particularly focusing on improved precursor-fragment grouping algorithms and support for ISD (In-Source Decay) data. The main changes include the addition of a new
ISDEngineclass, integration of DIA-Umpire inspired grouping logic, expanded configuration options, and new correlation/overlap calculation methods. These updates provide more flexibility and accuracy in DIA data analysis workflows.New Engines and Grouping Algorithms:
ISDEngineclass that inherits fromDIAEngine, enabling ISD data analysis using a workflow similar to DIA, including ISD-specific scan grouping, relabeling, and pseudo-MS2 scan generation. (MetaMorpheus/EngineLayer/DIA/ISDEngine.cs)UmpirePfGroupingEngineclass, implementing precursor-fragment grouping algorithms based on DIA-Umpire (Nat Methods 2015) with custom overlap and correlation calculations. (MetaMorpheus/EngineLayer/DIA/PrecursorFragmentGrouping/UmpirePfGroupingEngine.cs)Precursor-Fragment Grouping Enhancements:
XicGroupingEngineto support configurable precursor and fragment rank thresholds, improved parallelization, and post-filtering of groups based on these ranks. (MetaMorpheus/EngineLayer/DIA/PrecursorFragmentGrouping/XicGroupingEngine.cs,PfGroupingEngine.cs) [1] [2] [3] [4]FilterPfPairsByRankinPfGroupingEngineto filter precursor-fragment pairs within groups according to rank thresholds. (MetaMorpheus/EngineLayer/DIA/PrecursorFragmentGrouping/PfGroupingEngine.cs)Correlation and Overlap Calculation Methods:
CalculateXicCorrXYData_UmpireandCalculateXicOverlapRatio_Umpire. (MetaMorpheus/EngineLayer/DIA/PrecursorFragmentGroup.cs) [1] [2]SetFragmentRankForPfPairsto rank fragments within precursor-fragment groups. (MetaMorpheus/EngineLayer/DIA/PrecursorFragmentGroup.cs)Configuration and API Improvements:
DIAparametersto include aCombineFragmentsboolean option and an updated constructor to control whether fragment XICs from different groups are combined before PF grouping. (MetaMorpheus/EngineLayer/DIA/DIAparameters.cs)GetPseudoMs2ScansinDIAEnginevirtual to allow overriding in derived engines such asISDEngine. (MetaMorpheus/EngineLayer/DIA/DIAEngine.cs)These changes collectively expand the analytical capabilities of the DIA engine, improve configurability, and lay the groundwork for more advanced DIA and ISD data processing.This PR is a follow up of the first DIA PR, which includes the following updates: