From f700535a49556ed75d05448ea78515e6c74d9088 Mon Sep 17 00:00:00 2001 From: "DESKTOP-382ETUR\\Hiroshi Tsugawa" Date: Tue, 17 Feb 2026 09:58:42 +0900 Subject: [PATCH] Try to fix gcms alignment processing bugs --- .../MsdialGcMsApi/Algorithm/Alignment/GcmsAlignmentRefiner.cs | 4 ++-- .../MsdialGcMsApi/Algorithm/Alignment/GcmsPeakJoiner.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MSDIAL5/MsdialGcMsApi/Algorithm/Alignment/GcmsAlignmentRefiner.cs b/src/MSDIAL5/MsdialGcMsApi/Algorithm/Alignment/GcmsAlignmentRefiner.cs index 03127cc4d..ca117ec18 100644 --- a/src/MSDIAL5/MsdialGcMsApi/Algorithm/Alignment/GcmsAlignmentRefiner.cs +++ b/src/MSDIAL5/MsdialGcMsApi/Algorithm/Alignment/GcmsAlignmentRefiner.cs @@ -19,10 +19,10 @@ protected override List GetCleanedSpots(List(); - cSpots.AddRange(alignmentSpotList.Where(spot => spot.IsReferenceMatched(evaluator))); + cSpots.AddRange(alignmentSpotList.Where(spot => spot.IsReferenceMatched(evaluator) && !spot.Name.StartsWith("Putative"))); //if both Quant mass and Retention is same, exclude the spot information. - foreach (var aSpot in alignmentSpotList.Where(spot => !spot.IsReferenceMatched(evaluator))) { + foreach (var aSpot in alignmentSpotList.Where(spot => !spot.IsReferenceMatched(evaluator) || spot.Name.StartsWith("Putative"))) { var aSpotRt = aSpot.TimesCenter.RT.Value; var aSpotRi = aSpot.TimesCenter.RI.Value; var aSpotMass = aSpot.QuantMass; diff --git a/src/MSDIAL5/MsdialGcMsApi/Algorithm/Alignment/GcmsPeakJoiner.cs b/src/MSDIAL5/MsdialGcMsApi/Algorithm/Alignment/GcmsPeakJoiner.cs index 1c516b44c..19660d59b 100644 --- a/src/MSDIAL5/MsdialGcMsApi/Algorithm/Alignment/GcmsPeakJoiner.cs +++ b/src/MSDIAL5/MsdialGcMsApi/Algorithm/Alignment/GcmsPeakJoiner.cs @@ -137,7 +137,7 @@ private bool QuantMassExists(double quantMass, MSDecResult result) { protected bool IsSimilarTo(SpectrumFeature x, SpectrumFeature y) { var result = MsScanMatching.CompareEIMSScanProperties(x.AnnotatedMSDecResult.MSDecResult, y.AnnotatedMSDecResult.MSDecResult, _msMatchParam, - _alignmentParameter.Ms1AlignmentTolerance, _alignmentParameter.RetentionTimeAlignmentTolerance, _alignmentParameter.RetentionTimeAlignmentTolerance, + _alignmentParameter.Ms1AlignmentTolerance, _alignmentParameter.RetentionTimeAlignmentTolerance, _parameter.RetentionIndexAlignmentTolerance, _alignmentParameter.Ms1AlignmentFactor, _alignmentParameter.RetentionTimeAlignmentFactor, _indextype == AlignmentIndexType.RI); var isRetentionMatch = _indextype == AlignmentIndexType.RI ? result.IsRiMatch : result.IsRtMatch; return result.IsSpectrumMatch && isRetentionMatch; @@ -145,7 +145,7 @@ protected bool IsSimilarTo(SpectrumFeature x, SpectrumFeature y) { protected double GetSimilality(SpectrumFeature x, SpectrumFeature y) { var result = MsScanMatching.CompareEIMSScanProperties(x.AnnotatedMSDecResult.MSDecResult, y.AnnotatedMSDecResult.MSDecResult, _msMatchParam, - _alignmentParameter.Ms1AlignmentTolerance, _alignmentParameter.RetentionTimeAlignmentTolerance, _alignmentParameter.RetentionTimeAlignmentTolerance, + _alignmentParameter.Ms1AlignmentTolerance, _alignmentParameter.RetentionTimeAlignmentTolerance, _parameter.RetentionIndexAlignmentTolerance, _alignmentParameter.Ms1AlignmentFactor, _alignmentParameter.RetentionTimeAlignmentFactor, _indextype == AlignmentIndexType.RI); return result.TotalScore; }