Skip to content

Set AlignmentChromPeakFeature quant mass in gap filling#717

Merged
YukiMatsuzawa merged 3 commits intomasterfrom
bugfix/update-quantmass-gcms
Mar 19, 2026
Merged

Set AlignmentChromPeakFeature quant mass in gap filling#717
YukiMatsuzawa merged 3 commits intomasterfrom
bugfix/update-quantmass-gcms

Conversation

@YukiMatsuzawa
Copy link
Copy Markdown
Contributor

Set AlignmentChromPeakFeature quant mass in gap filling

@YukiMatsuzawa YukiMatsuzawa requested a review from Copilot March 19, 2026 02:37
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 ensures GC-MS gap filling keeps AlignmentChromPeakFeature.Mass synchronized with the spot’s quant mass during gap filling and quant-mass update flows, preventing persistent NeedsGapFill mismatches.

Changes:

  • Set target.Mass from the computed chromatogram center (chromXCenter.Mz.Value) before running GapFillCore() in GapFill().
  • Set target.Mass similarly in UpdateQuantMass() before running GapFillCore().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Introduced GcmsGapFillerTests with a test verifying that UpdateQuantMass sets the target peak's Mass to the spot's QuantMass. Includes a stubbed GcmsGapFiller implementation and necessary setup.
@YukiMatsuzawa YukiMatsuzawa requested a review from Copilot March 19, 2026 03:18
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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 ensures GCMS gap filling updates AlignmentChromPeakFeature.Mass (used as the GCMS quant mass) to match the spot’s quant mass, and adds a regression test around the quant-mass update behavior.

Changes:

  • Set target.Mass from the computed center m/z during GapFill(...) and UpdateQuantMass(...).
  • Add an MSTest verifying UpdateQuantMass(...) updates the target peak’s Mass.
  • Remove an unnecessary <Folder Include=...> entry from the GCMS API test project file.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/MSDIAL5/MsdialGcMsApiTests/MsdialGcMsApiTests.csproj Removes an explicit folder entry now that the folder contains code.
tests/MSDIAL5/MsdialGcMsApiTests/Algorithm/Alignment/GcmsGapFillerTests.cs Adds a regression test for UpdateQuantMass updating AlignmentChromPeakFeature.Mass.
src/MSDIAL5/MsdialGcMsApi/Algorithm/Alignment/GcmsGapFiller.cs Updates GCMS gap filling to set the target peak’s quant mass (Mass) from the computed center.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 48 to 50
var peaklist = GetPeaks(rawSpectra, chromXCenter, peakWidth, fileID, _smoothingMethod, _smoothingLevel);
target.Mass = spot.QuantMass;
GapFillCore(peaklist, chromXCenter, AxTol, target);
@YukiMatsuzawa YukiMatsuzawa merged commit 684ba02 into master Mar 19, 2026
9 checks passed
@YukiMatsuzawa YukiMatsuzawa deleted the bugfix/update-quantmass-gcms branch March 19, 2026 04:32
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.

2 participants