Added Raw Dot Product Properties Alongside Renamed Squared Metrics for Spectrum Matching#589
Merged
YukiMatsuzawa merged 10 commits intomasterfrom Jun 25, 2025
Merged
Conversation
Updated `MsRefSearchParameterBase.cs`, `MsRefSearchParameterBaseViewModel.cs`, and `ConfigParser.cs` to replace squared dot product properties with new weighted, simple, and reverse dot product cutoffs. Adjusted initialization, validation, and parsing of these properties, along with output formatting to align with the new naming conventions.
This commit updates the variable name `weightedDotProduct` to `sqweightedDotProduct` across multiple files in the `CompMs` namespace. This change clarifies that the new variable represents the square of a typical dot product, enhancing consistency in the naming convention and improving the readability of the scoring and matching logic in the codebase.
This commit introduces a new variable `sqsimpleDotProduct` to replace the previous `simpleDotProduct` variable across multiple files. This change enhances the accuracy and performance of the scoring algorithms by utilizing squared values. Updates are made in several classes, including `MsScanMatching`, `LipidMs2MatchCalculator`, `MassAnnotator`, and `Ms2MatchCalculator`, ensuring consistent usage of the new variable. Additionally, return values and validity checks for dot product calculations have been updated accordingly.
This commit updates the variable name `reverseDotProduct` to `sqreverseDotProduct` across multiple files in the `CompMs.Common.Algorithm.Scoring` and `CompMs.MsdialCore.Algorithm.Annotation` namespaces. This change reflects a new naming convention that emphasizes the squared nature of the dot product calculation. Additionally, comments have been added to the `GetReverseDotProduct` method to clarify that it represents the square of a typical dot product.
Updated `LipidMs2MatchResult`, `IMs2MatchResult`, and `Ms2MatchResult` to utilize squared dot product values. Modified constructors and properties accordingly. Adjusted `TotalScore` and `Scores` calculations to reflect these changes. Updated tests in `Ms2MatchCalculatorTests` to assert squared dot product values and recalculate expected scores.
Renamed `WeightedDotProduct`, `SimpleDotProduct`, and `ReverseDotProduct` in `MsScanMatchResult` to `SquaredWeightedDotProduct`, `SquaredSimpleDotProduct`, and `SquaredReverseDotProduct`. Updated logic for spectrum match validation to use squared values. Adjusted serialization in `MsdecResultsReader.cs` and `MsdecResultsWriter.cs` to accommodate new properties. Modified test cases across various files to ensure correctness with the new property names and logic. These changes improve clarity and performance in the scoring system.
Added a `HeaderedContentControl` with an important notice about changes to the definition of cutoff values for dot product calculations. Users are informed that cutoff values have been updated from version 5.5.250625, replacing previous squared values with native dot product values. Instructions for using square root values for equivalent thresholds are provided, along with a note on the impact to the total score value in the MS-DIAL output.
This commit updates the cutoff values for various dot product calculations in several classes. Key changes include: - Replacing squared cutoff values with their new squared equivalents in `MsRefSearchParameterBase.cs` and `MsdialDimsParameter.cs`. - Similar updates in `DimsAnnotatorSettingModel.cs`, `ImmsAnnotatorSettingModel.cs`, `LcimmsAnnotatorSettingModel.cs`, and `DatasetParameterSettingModel.cs`. - Added a notice in `AnnotationSettingStyle.xaml` regarding the change in definition for cutoff values. - Consistent updates in `MsdialImmsParameter.cs` to standardize the use of dot product values. These changes aim to enhance the accuracy and consistency of calculations throughout the application.
Bujee415
approved these changes
Jun 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Classification
Refactor to clarify spectrum matching logic by adding raw dot product properties alongside existing squared values.
PR Summary
This pull request enhances clarity in spectrum similarity calculations by distinguishing between raw and squared dot product values. Existing properties were renamed to explicitly indicate squared values, and new properties were introduced for raw dot product calculations.
MsScanMatching.cs: Introduced raw versions of WeightedDotProduct, SimpleDotProduct, and ReverseDotProduct while retaining squared versions.
MsRefSearchParameterBase.cs: Updated naming to differentiate between raw and squared cutoff parameters.
MsScanMatchResult.cs: Added properties to store raw dot product values, with existing squared properties renamed accordingly.
LipidMs2MatchCalculator.cs: Updated logic to calculate and store both raw and squared dot product values for evaluation.
Tests: Extended test cases to cover both raw and squared metrics, ensuring consistent and accurate comparisons.