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
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8be2574
Updated to MzLib 1.0.548 and fixed custom ions in search tasks
nbollis May 21, 2024
a00af8a
reverted calibration task change
nbollis May 21, 2024
22c60ba
merged in master
nbollis May 30, 2024
f4695bb
merged in master bbbyy
nbollis Jun 10, 2024
d4f8b9d
Merge branch 'smith-chem-wisc:master' into master
nbollis Jun 19, 2024
1f0dc48
merged in master
nbollis Jun 21, 2024
5c0268b
idkman
nbollis Jul 3, 2024
b7e6a0f
merged in master
nbollis Jul 16, 2024
6446d89
Merge remote-tracking branch 'upstream/master'
nbollis Jul 24, 2024
322235d
Spectral Library from Command Line (#2386)
nbollis Jul 23, 2024
8b48c95
merged in master
nbollis Aug 6, 2024
2ef973f
Merge branch 'master' of https://github.com/nbollis/MetaMorpheus
nbollis Aug 6, 2024
0abcd9b
Merge branch 'master' of https://github.com/nbollis/MetaMorpheus
nbollis Aug 7, 2024
f9030f9
merged in master
nbollis Sep 4, 2024
046067e
merged in master
nbollis Sep 17, 2024
c38f081
Merge remote-tracking branch 'upstream/master'
nbollis Oct 3, 2024
0c04007
Merge remote-tracking branch 'upstream/master'
nbollis Oct 10, 2024
d66bf7b
Merge remote-tracking branch 'upstream/master'
Oct 18, 2024
57c4e69
Build ClassicDeconv Params View Model
Oct 26, 2024
0cef4fc
Built classic deconvolution control and the Deconvolution Host Control
Oct 26, 2024
2a73a02
Refactor deconvolution param management with ViewModel
Oct 26, 2024
1735439
Completed the first phase of the new structure. Parameters can now be…
Oct 26, 2024
4eff135
Refactor UI and add comprehensive unit tests
Oct 27, 2024
d32800c
Expanded test coverage and cleaned up code
Oct 27, 2024
fc8304d
added control to GPTMD window
Oct 27, 2024
f8d318a
Expanded test coverage
Oct 27, 2024
7aae734
Added control to the glyco and xl task windows
nbollis Oct 29, 2024
11227eb
Merge branch 'master' into IsoDecInLine
nbollis Nov 1, 2024
c222ba7
Merge branch 'master' into IsoDecInLine
nbollis Nov 5, 2024
9a3b9db
Merge branch 'master' into IsoDecInLine
nbollis Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 1 addition & 28 deletions MetaMorpheus/GUI/TaskWindows/GPTMDTaskWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,7 @@
<GroupBox Header="File Loading Parameters" DockPanel.Dock="Top">
<Expander x:Name="FileLoadExpander" >
<StackPanel>
<GroupBox Header="Deisotoping">
<StackPanel>
<CheckBox x:Name="UseProvidedPrecursor" Content="Use Provided Precursor" IsChecked="True" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500">
<CheckBox.ToolTip>
<TextBlock>
Use the charge states and precursor masses determined by the instrument controller.
</TextBlock>
</CheckBox.ToolTip>
</CheckBox>
<CheckBox x:Name="DeconvolutePrecursors" Content="Deconvolute Precursors" IsChecked="True" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500">
<CheckBox.ToolTip>
<TextBlock>
Additionally searches for coisolated peptides, allowing for multiple peptides to be identified from a single MS2.
</TextBlock>
</CheckBox.ToolTip>
</CheckBox>
<StackPanel Orientation="Horizontal" Margin="5">
<Label Content="Deconvolution Max Assumed Charge State" />
<TextBox x:Name="DeconvolutionMaxAssumedChargeStateTextBox" PreviewTextInput="CheckIfNumber" Width="45" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500">
<TextBox.ToolTip>
<TextBlock>
The maximum charge state that deconvolution should allow. Minimum is 1.
</TextBlock>
</TextBox.ToolTip>
</TextBox>
</StackPanel>
</StackPanel>
</GroupBox>
<local:HostDeconParamControl x:Name="DeisotopingControl" DataContext="{Binding}"/>
<GroupBox Header="Peak Trimming">
<StackPanel>
<CheckBox x:Name="TrimMs1" Content="Trim MS1 Peaks" IsChecked="True" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500">
Expand Down
28 changes: 18 additions & 10 deletions MetaMorpheus/GUI/TaskWindows/GPTMDTaskWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public partial class GptmdTaskWindow : Window
private readonly ObservableCollection<ModTypeForTreeViewModel> GptmdModTypeForTreeViewObservableCollection = new ObservableCollection<ModTypeForTreeViewModel>();
private bool AutomaticallyAskAndOrUpdateParametersBasedOnProtease = true;
private CustomFragmentationWindow CustomFragmentationWindow;
private DeconHostViewModel DeconHostViewModel;

public GptmdTaskWindow(GptmdTask myGPTMDtask)
{
Expand All @@ -39,6 +40,7 @@ public GptmdTaskWindow(GptmdTask myGPTMDtask)
PopulateChoices();
UpdateFieldsFromTask(TheTask);
AutomaticallyAskAndOrUpdateParametersBasedOnProtease = true;
DeisotopingControl.DataContext = DeconHostViewModel;

if (myGPTMDtask == null)
{
Expand All @@ -62,10 +64,10 @@ private void Row_DoubleClick(object sender, MouseButtonEventArgs e)

private void UpdateFieldsFromTask(GptmdTask task)
{
DeconHostViewModel = new DeconHostViewModel(TheTask.CommonParameters.PrecursorDeconvolutionParameters,
TheTask.CommonParameters.ProductDeconvolutionParameters,
TheTask.CommonParameters.UseProvidedPrecursorInfo, TheTask.CommonParameters.DoPrecursorDeconvolution);
ProteaseComboBox.SelectedItem = task.CommonParameters.DigestionParams.Protease; //protease needs to come first or recommended settings can overwrite the actual settings
UseProvidedPrecursor.IsChecked = task.CommonParameters.UseProvidedPrecursorInfo;
DeconvolutePrecursors.IsChecked = task.CommonParameters.DoPrecursorDeconvolution;
DeconvolutionMaxAssumedChargeStateTextBox.Text = task.CommonParameters.DeconvolutionMaxAssumedChargeState.ToString();
MissedCleavagesTextBox.Text = task.CommonParameters.DigestionParams.MaxMissedCleavages == int.MaxValue ? "" : task.CommonParameters.DigestionParams.MaxMissedCleavages.ToString(CultureInfo.InvariantCulture);
MinPeptideLengthTextBox.Text = task.CommonParameters.DigestionParams.MinPeptideLength.ToString(CultureInfo.InvariantCulture);
MaxPeptideLengthTextBox.Text = task.CommonParameters.DigestionParams.MaxPeptideLength == int.MaxValue ? "" : task.CommonParameters.DigestionParams.MaxPeptideLength.ToString(CultureInfo.InvariantCulture);
Expand Down Expand Up @@ -260,8 +262,8 @@ private void ProteaseSpecificUpdate(object sender, SelectionChangedEventArgs e)
case "top-down":
if (UpdateGUISettings.UseTopDownRecommendedSettings())
{
UseProvidedPrecursor.IsChecked = false;
DeconvolutionMaxAssumedChargeStateTextBox.Text = "60";
DeconHostViewModel.UseProvidedPrecursors = false;
DeconHostViewModel.PrecursorDeconvolutionParameters.MaxAssumedChargeState = 60;
TrimMsMs.IsChecked = false;
//uncheck all variable mods
foreach (var mod in VariableModTypeForTreeViewObservableCollection)
Expand Down Expand Up @@ -354,7 +356,7 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)

if (!GlobalGuiSettings.CheckTaskSettingsValidity(PrecursorMassToleranceTextBox.Text, ProductMassToleranceTextBox.Text, MissedCleavagesTextBox.Text,
MaxModificationIsoformsTextBox.Text, MinPeptideLengthTextBox.Text, MaxPeptideLengthTextBox.Text, MaxThreadsTextBox.Text, MinScoreAllowed.Text,
fieldNotUsed, fieldNotUsed, DeconvolutionMaxAssumedChargeStateTextBox.Text, NumberOfPeaksToKeepPerWindowTextBox.Text, MinimumAllowedIntensityRatioToBasePeakTexBox.Text,
fieldNotUsed, fieldNotUsed, DeconHostViewModel.PrecursorDeconvolutionParameters.MaxAssumedChargeState.ToString(), NumberOfPeaksToKeepPerWindowTextBox.Text, MinimumAllowedIntensityRatioToBasePeakTexBox.Text,
null, null, fieldNotUsed, fieldNotUsed, fieldNotUsed, null, null, null))
{
return;
Expand Down Expand Up @@ -441,10 +443,14 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)
}
bool parseMaxThreadsPerFile = int.Parse(MaxThreadsTextBox.Text, CultureInfo.InvariantCulture) <= Environment.ProcessorCount && int.Parse(MaxThreadsTextBox.Text, CultureInfo.InvariantCulture) > 0;

DeconvolutionParameters precursorDeconvolutionParameters = DeconHostViewModel.PrecursorDeconvolutionParameters.Parameters;
DeconvolutionParameters productDeconvolutionParameters = DeconHostViewModel.ProductDeconvolutionParameters.Parameters;
bool useProvidedPrecursorInfo = DeconHostViewModel.UseProvidedPrecursors;
bool doPrecursorDeconvolution = DeconHostViewModel.DoPrecursorDeconvolution;

CommonParameters commonParamsToSave = new CommonParameters(
useProvidedPrecursorInfo: UseProvidedPrecursor.IsChecked.Value,
deconvolutionMaxAssumedChargeState: int.Parse(DeconvolutionMaxAssumedChargeStateTextBox.Text, CultureInfo.InvariantCulture),
doPrecursorDeconvolution: DeconvolutePrecursors.IsChecked.Value,
useProvidedPrecursorInfo: useProvidedPrecursorInfo,
doPrecursorDeconvolution: doPrecursorDeconvolution,
taskDescriptor: OutputFileNameTextBox.Text != "" ? OutputFileNameTextBox.Text : "GPTMDTask",
maxThreadsToUsePerFile: parseMaxThreadsPerFile ? int.Parse(MaxThreadsTextBox.Text, CultureInfo.InvariantCulture) : new CommonParameters().MaxThreadsToUsePerFile,
digestionParams: new DigestionParams(
Expand All @@ -468,7 +474,9 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)
assumeOrphanPeaksAreZ1Fragments: protease.Name != "top-down",
addCompIons: AddCompIonCheckBox.IsChecked.Value,
minVariantDepth: minVariantDepth,
maxHeterozygousVariants: maxHeterozygousVariants);
maxHeterozygousVariants: maxHeterozygousVariants,
precursorDeconParams: precursorDeconvolutionParameters,
productDeconParams: productDeconvolutionParameters);

TheTask.GptmdParameters.ListOfModsGptmd = new List<(string, string)>();
foreach (var heh in GptmdModTypeForTreeViewObservableCollection)
Expand Down
15 changes: 1 addition & 14 deletions MetaMorpheus/GUI/TaskWindows/GlycoSearchTaskWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,7 @@
</Style>
</Expander.Style>
<StackPanel>
<GroupBox Header="File Load Parameters">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<StackPanel>
<StackPanel Margin="5">
<CheckBox x:Name="useProvidedPrecursor" Content="Use Provided Precursor"/>
<CheckBox x:Name="deconvolutePrecursors" Content="Deconvolute Precursors"/>
</StackPanel>
</StackPanel>
</Grid>
</GroupBox>
<local:HostDeconParamControl x:Name="DeisotopingControl" DataContext="{Binding}"/>
<GroupBox Header="Peak Trimming">
<StackPanel>
<CheckBox x:Name="trimMs1" Content="Trim MS1 Peaks"/>
Expand Down
22 changes: 16 additions & 6 deletions MetaMorpheus/GUI/TaskWindows/GlycoSearchTaskWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public partial class GlycoSearchTaskWindow : Window
private readonly ObservableCollection<ModTypeForTreeViewModel> FixedModTypeForTreeViewObservableCollection = new ObservableCollection<ModTypeForTreeViewModel>();
private readonly ObservableCollection<ModTypeForTreeViewModel> VariableModTypeForTreeViewObservableCollection = new ObservableCollection<ModTypeForTreeViewModel>();
private CustomFragmentationWindow CustomFragmentationWindow;
private DeconHostViewModel DeconHostViewModel;

public GlycoSearchTaskWindow() : this(null)
{
Expand All @@ -40,6 +41,7 @@ public GlycoSearchTaskWindow(GlycoSearchTask task)
PopulateChoices();
TheTask = task ?? new GlycoSearchTask();
UpdateFieldsFromTask(TheTask);
DeisotopingControl.DataContext = DeconHostViewModel;

if (task == null)
{
Expand Down Expand Up @@ -164,8 +166,9 @@ private void UpdateFieldsFromTask(GlycoSearchTask task)
CheckBoxDecoy.IsChecked = task._glycoSearchParameters.DecoyType != DecoyType.None;
RadioButtonReverseDecoy.IsChecked = task._glycoSearchParameters.DecoyType == DecoyType.Reverse;
RadioButtonSlideDecoy.IsChecked = task._glycoSearchParameters.DecoyType == DecoyType.Slide;
deconvolutePrecursors.IsChecked = task.CommonParameters.DoPrecursorDeconvolution;
useProvidedPrecursor.IsChecked = task.CommonParameters.UseProvidedPrecursorInfo;
DeconHostViewModel = new DeconHostViewModel(TheTask.CommonParameters.PrecursorDeconvolutionParameters,
TheTask.CommonParameters.ProductDeconvolutionParameters,
TheTask.CommonParameters.UseProvidedPrecursorInfo, TheTask.CommonParameters.DoPrecursorDeconvolution);
missedCleavagesTextBox.Text = task.CommonParameters.DigestionParams.MaxMissedCleavages.ToString(CultureInfo.InvariantCulture);
MinPeptideLengthTextBox.Text = task.CommonParameters.DigestionParams.MinPeptideLength.ToString(CultureInfo.InvariantCulture);
MaxPeptideLengthTextBox.Text = task.CommonParameters.DigestionParams.MaxPeptideLength == int.MaxValue ? "" : task.CommonParameters.DigestionParams.MaxPeptideLength.ToString(CultureInfo.InvariantCulture);
Expand Down Expand Up @@ -248,7 +251,7 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)

if (!GlobalGuiSettings.CheckTaskSettingsValidity(PrecusorMsTlTextBox.Text, productMassToleranceTextBox.Text, missedCleavagesTextBox.Text,
maxModificationIsoformsTextBox.Text, MinPeptideLengthTextBox.Text, MaxPeptideLengthTextBox.Text, maxThreadsTextBox.Text, minScoreAllowed.Text,
fieldNotUsed, fieldNotUsed, fieldNotUsed, TopNPeaksTextBox.Text, MinRatioTextBox.Text, null, null, numberOfDatabaseSearchesTextBox.Text, TxtBoxMaxModPerPep.Text,
fieldNotUsed, fieldNotUsed, DeconHostViewModel.PrecursorDeconvolutionParameters.MaxAssumedChargeState.ToString(), TopNPeaksTextBox.Text, MinRatioTextBox.Text, null, null, numberOfDatabaseSearchesTextBox.Text, TxtBoxMaxModPerPep.Text,
fieldNotUsed, null, null, null))
{
return;
Expand Down Expand Up @@ -374,12 +377,17 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)
listOfModsFixed.AddRange(heh.Children.Where(b => b.Use).Select(b => (b.Parent.DisplayName, b.ModName)));
}

DeconvolutionParameters precursorDeconvolutionParameters = DeconHostViewModel.PrecursorDeconvolutionParameters.Parameters;
DeconvolutionParameters productDeconvolutionParameters = DeconHostViewModel.ProductDeconvolutionParameters.Parameters;
bool useProvidedPrecursorInfo = DeconHostViewModel.UseProvidedPrecursors;
bool doPrecursorDeconvolution = DeconHostViewModel.DoPrecursorDeconvolution;

CommonParameters commonParamsToSave = new CommonParameters(
precursorMassTolerance: PrecursorMassTolerance,
taskDescriptor: OutputFileNameTextBox.Text != "" ? OutputFileNameTextBox.Text : "GlycoSearchTask",
productMassTolerance: ProductMassTolerance,
doPrecursorDeconvolution: deconvolutePrecursors.IsChecked.Value,
useProvidedPrecursorInfo: useProvidedPrecursor.IsChecked.Value,
doPrecursorDeconvolution: doPrecursorDeconvolution,
useProvidedPrecursorInfo: useProvidedPrecursorInfo,
digestionParams: digestionParamsToSave,
trimMs1Peaks: trimMs1.IsChecked.Value,
trimMsMsPeaks: trimMsMs.IsChecked.Value,
Expand All @@ -392,7 +400,9 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)
maxThreadsToUsePerFile: int.Parse(maxThreadsTextBox.Text, CultureInfo.InvariantCulture),
listOfModsVariable: listOfModsVariable,
listOfModsFixed: listOfModsFixed,
assumeOrphanPeaksAreZ1Fragments: protease.Name != "top-down");
assumeOrphanPeaksAreZ1Fragments: protease.Name != "top-down",
precursorDeconParams: precursorDeconvolutionParameters,
productDeconParams: productDeconvolutionParameters);

TheTask.CommonParameters = commonParamsToSave;

Expand Down
36 changes: 1 addition & 35 deletions MetaMorpheus/GUI/TaskWindows/SearchTaskWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -660,41 +660,7 @@
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox Header="Deisotoping">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="10,5,5,5">
<CheckBox x:Name="UseProvidedPrecursor" Content="Use Provided Precursor" IsChecked="True" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500">
<CheckBox.ToolTip>
<TextBlock>
Use the charge states and precursor masses determined by the instrument controller.
</TextBlock>
</CheckBox.ToolTip>
</CheckBox>
</StackPanel>

<!-- Deconvolute precursors -->
<StackPanel Orientation="Horizontal" Margin="10,5,5,5">
<CheckBox x:Name="DeconvolutePrecursors" Content="Deconvolute Precursors" IsChecked="True" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500">
<CheckBox.ToolTip>
<TextBlock>
Additionally searches for coisolated peptides, allowing for multiple peptides to be identified from a single MS2.
</TextBlock>
</CheckBox.ToolTip>
</CheckBox>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5">
<Label Content="Deconvolution Max Assumed Charge State:" />
<TextBox x:Name="DeconvolutionMaxAssumedChargeStateTextBox" PreviewTextInput="CheckIfNumber" Width="45" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500">
<TextBox.ToolTip>
<TextBlock>
The maximum charge state that deconvolution should allow. Minimum is 1.
</TextBlock>
</TextBox.ToolTip>
</TextBox>
</StackPanel>
</StackPanel>
</GroupBox>
<local:HostDeconParamControl x:Name="DeisotopingControl" DataContext="{Binding}"/>
<GroupBox Header="Peak Trimming">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="10,5,5,5">
Expand Down
Loading