Add hco3 for other lipid classes#542
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR extends the spectrum generation for lipid classes by adding support for the HCO3 adduct and related neutral losses, while also refactoring some loops and updating fragment labels. Key changes include the removal of unused constants in the TG generator, introduction of new constants and conditions for HCO3 in SM, PC, LPC, and other generators, and new parser and generator classes for LPA and PA lipids.
Reviewed Changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| TGOadSpectrumGenerator.cs | Removed unused H2O and CH3O constants and refactored chain iteration. |
| SMOadSpectrumGenerator.cs | Added HCO3 and C2H2 constants and updated spectrum generation for the HCO3 adduct. |
| Several other spectrum generator files | Updated adduct conditions and fragment labels to support HCO3-based lipid classes and added new generator classes (e.g. LPAOadSpectrumGenerator, PAOadSpectrumGenerator). |
| LipidParsers.cs & FacadeLipidParser.cs | Introduced a new LPALipidParser to support LPA lipids. |
| CommonEnums.cs & AdductIon.cs | Updated enums and added a new IsHco3 property to support the HCO3 adduct. |
Files not reviewed (1)
- src/Common/CommonStandard/Lipidomics/MsdialLipidModel.xml: Language not supported
Comments suppressed due to low confidence (2)
src/Common/CommonStandard/Lipidomics/SMOadSpectrumGenerator.cs:156
- The constant C3H9N is used in the spectrum calculation but is not defined in this diff. Please ensure that C3H9N is declared and that its mass value is correct for the intended fragment.
new SpectrumPeak(adduct.ConvertToMz(lipid.Mass- HCO3 - MassDiffDictionary.HydrogenMass - C3H9N - C2H2), 999d, "NL of HCO3 and C3H9N and C2H2") { SpectrumComment = SpectrumComment.metaboliteclass },
src/Common/CommonStandard/Lipidomics/SMOadSpectrumGenerator.cs:162
- [nitpick] The fragment label refers to 'C2H8' while the calculation subtracts C2H2; please confirm and update the label so that it accurately reflects the computed neutral loss.
new SpectrumPeak(adduct.ConvertToMz(lipid.Mass - HCO3 - acyl.Mass - C2H2 - MassDiffDictionary.HydrogenMass*6), 10d, $"-{acyl} - C2H8") { SpectrumComment = SpectrumComment.acylchain });
| new[] { | ||
| new SpectrumPeak(adduct.ConvertToMz(lipid.Mass) - H2O - CH5O - MassDiffDictionary.HydrogenMass*2, 200d, "Precursor-H2O-CH5O") { SpectrumComment = SpectrumComment.metaboliteclass }, | ||
| new SpectrumPeak(adduct.ConvertToMz(lipid.Mass) - H2O - MassDiffDictionary.HydrogenMass*2, 200d, "Precursor-H2O") { SpectrumComment = SpectrumComment.metaboliteclass }, | ||
| new SpectrumPeak(adduct.ConvertToMz(lipid.Mass) - CH2O, 300d, "Precursor-CH2O") { SpectrumComment = SpectrumComment.metaboliteclass }, |
There was a problem hiding this comment.
The updated fragment labels in the negative ion block (e.g. 'Precursor-CH2O') replace previous labels such as 'Precursor-H2O-CH5O'. Verify that these new labels accurately reflect the intended neutral losses and are consistent with the mass calculations.
| new SpectrumPeak(adduct.ConvertToMz(lipid.Mass) - CH2O, 300d, "Precursor-CH2O") { SpectrumComment = SpectrumComment.metaboliteclass }, | |
| new SpectrumPeak(adduct.ConvertToMz(lipid.Mass) - CH2O, 300d, $"Precursor-CH2O ({CH2O:F4} Da)") { SpectrumComment = SpectrumComment.metaboliteclass }, |
No description provided.