Skip to content

Added Raw Dot Product Properties Alongside Renamed Squared Metrics for Spectrum Matching#589

Merged
YukiMatsuzawa merged 10 commits intomasterfrom
bugfix/dot-product-threshold
Jun 25, 2025
Merged

Added Raw Dot Product Properties Alongside Renamed Squared Metrics for Spectrum Matching#589
YukiMatsuzawa merged 10 commits intomasterfrom
bugfix/dot-product-threshold

Conversation

@YukiMatsuzawa
Copy link
Copy Markdown
Contributor

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.

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.
@YukiMatsuzawa YukiMatsuzawa requested a review from Bujee415 June 25, 2025 05:56
@YukiMatsuzawa YukiMatsuzawa merged commit 4b39b84 into master Jun 25, 2025
9 checks passed
@YukiMatsuzawa YukiMatsuzawa deleted the bugfix/dot-product-threshold branch June 25, 2025 07:21
@YukiMatsuzawa YukiMatsuzawa restored the bugfix/dot-product-threshold branch June 25, 2025 10:51
@YukiMatsuzawa YukiMatsuzawa deleted the bugfix/dot-product-threshold branch June 25, 2025 11:26
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