Skip to content

Add hco3 for other lipid classes#542

Merged
YukiMatsuzawa merged 23 commits intomasterfrom
oad_addHCO3forOtherClasses
Apr 24, 2025
Merged

Add hco3 for other lipid classes#542
YukiMatsuzawa merged 23 commits intomasterfrom
oad_addHCO3forOtherClasses

Conversation

@Bujee415
Copy link
Copy Markdown
Collaborator

No description provided.

@Bujee415 Bujee415 requested a review from YukiMatsuzawa April 24, 2025 06:10
@YukiMatsuzawa YukiMatsuzawa requested a review from Copilot April 24, 2025 06:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 },
Copy link

Copilot AI Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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 },

Copilot uses AI. Check for mistakes.
@YukiMatsuzawa YukiMatsuzawa merged commit f585638 into master Apr 24, 2025
9 checks passed
@YukiMatsuzawa YukiMatsuzawa deleted the oad_addHCO3forOtherClasses branch April 24, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants