Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deconvolution GUI Modularity #2429

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

nbollis
Copy link
Member

@nbollis nbollis commented Oct 27, 2024

Refactored the deconvolution parameters handling in the MetaMorpheus GUI to use custom controls and view models for better modularity and extensibility.

  • SearchTaskWindow.xaml and .xaml.cs: Replaced stack panels and checkboxes with HostDeconParamControl and bound to DeconHostViewModel.
  • GPTMDTaskWindow.xaml and SearchTaskWindow.xaml: Replaced GroupBox for "Deisotoping" with HostDeconParamControl bound to DeconHostViewModel.
  • Added DeconvolutionTypeToControlConverter for converting DeconParamsViewModel to appropriate controls.
  • Introduced new user controls ClassicDeconParamsControl and HostDeconParamControl.
  • Added new view models ClassicDeconParamsViewModel, DeconHostViewModel, and IsoDecDeconParamsViewModel.
  • Updated MetaMorpheus.sln.DotSettings to include "Decon" and "Deconvolute" in the user dictionary.

To Consider:
Do we want to expose the product deconvolution parameters?
Do we want to add decon parameter setting to calibration?

nbollis and others added 23 commits May 21, 2024 15:08
* Updated to MzLib 1.0.548 and fixed custom ions in search tasks

* reverted calibration task change

* merged in master bbbyy

* Enabled Library Loading from command line
Streamlined deconvolution parameter management by introducing `DeconHostViewModel` and custom control `HostDeconParamControl`. Updated `CommonParameters.cs` to change default `ProductDeconvolutionParameters` in negative mode from `-10` to `-20`. Modified `SearchTaskWindow.xaml` and `SearchTaskWindow.xaml.cs` to use the new view model, improving separation of concerns and maintainability. Updated `SaveButton_Click` and other relevant methods to retrieve parameters via the view model.
… set from the GUI with the new code structure
Refactored several XAML files to improve UI structure and readability:
- Removed unnecessary `GroupBox` in `SearchTaskWindow.xaml` and added a new one for "Peak Trimming".
- Adjusted layout in `ClassicDeconParamsControl.xaml` and `HostDeconParamControl.xaml`.

Enhanced ViewModel logic:
- Updated `DeconHostViewModel.cs` and `DeconParamsViewModel.cs` to include additional properties and validation logic.
- Added `[ExcludeFromCodeCoverage]` attribute to `IsoDecDeconParamsViewModel.cs`.

Expanded unit tests:
- Removed obsolete `GuiFunctionsTest.cs`.
- Added new test classes for `ClassicDeconParamsViewModel`, `DeconParamsViewModel`, `DeconHostViewModel`, and `MzLibExtensions`.
- Included tests for property changes, validation logic, and conversion methods.
Copy link

codecov bot commented Oct 27, 2024

Codecov Report

Attention: Patch coverage is 97.82609% with 4 lines in your changes missing coverage. Please review.

Project coverage is 93.73%. Comparing base (97d1761) to head (9a3b9db).

Files with missing lines Patch % Lines
...ons/ViewModels/Deconvolution/DeconHostViewModel.cs 97.05% 1 Missing and 1 partial ⚠️
...s/ViewModels/Deconvolution/DeconParamsViewModel.cs 97.75% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2429      +/-   ##
==========================================
+ Coverage   93.69%   93.73%   +0.03%     
==========================================
  Files         141      145       +4     
  Lines       21883    22067     +184     
  Branches     3001     3043      +42     
==========================================
+ Hits        20504    20684     +180     
- Misses        927      929       +2     
- Partials      452      454       +2     
Files with missing lines Coverage Δ
MetaMorpheus/GuiFunctions/MzLibExtensions.cs 100.00% <100.00%> (ø)
...odels/Deconvolution/ClassicDeconParamsViewModel.cs 100.00% <100.00%> (ø)
...ons/ViewModels/Deconvolution/DeconHostViewModel.cs 97.05% <97.05%> (ø)
...s/ViewModels/Deconvolution/DeconParamsViewModel.cs 97.75% <97.75%> (ø)

@Alexander-Sol
Copy link
Contributor

"Minimum intensity ratio" and "Nominal window width" won't accept non-integer inputs.

@Alexander-Sol
Copy link
Contributor

Also, can't set assumed charge states to negative when no data is loaded in.

@nbollis
Copy link
Member Author

nbollis commented Oct 28, 2024

Also, can't set assumed charge states to negative when no data is loaded in.

It is set to positive mode. No negatives can be input. Once RNA is added, then the toggle between positive and negative will be exposed.

@nbollis nbollis marked this pull request as ready for review October 29, 2024 00:16
trishorts
trishorts previously approved these changes Nov 4, 2024
elaboy
elaboy previously approved these changes Nov 4, 2024
@nbollis nbollis dismissed stale reviews from elaboy and trishorts via c222ba7 November 5, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants