Skip to content

Commit

Permalink
Added Decon Parameters to Calibration Window (#2459)
Browse files Browse the repository at this point in the history
* Added decon choice to calibration

* Add DetermineAnalyteType call in UpdateFieldsFromTask

Added MetaMorpheusTask.DetermineAnalyteType(TheTask.CommonParameters)
at the beginning of the UpdateFieldsFromTask method in task windows. This ensures analyte type is determined
before updating fields from the task.

* Refactor charge state settings in CalibrateTaskWindow

Replaced method calls for setting max charge states with direct
assignment to PrecursorDeconvolutionParameters.MaxAssumedChargeState.
This change simplifies the configuration of deconvolution parameters.

* Removed Peak Filtering from calibration

* oof
  • Loading branch information
nbollis authored Feb 3, 2025
1 parent e6cf8e7 commit b48a3f6
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
7 changes: 7 additions & 0 deletions MetaMorpheus/GUI/TaskWindows/CalibrateTaskWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@
</TextBox.Style>
</TextBox>
</StackPanel>
<GroupBox Header="File Loading Parameters" DockPanel.Dock="Top">
<Expander x:Name="FileLoadExpander" >
<StackPanel>
<local:HostDeconParamControl x:Name="DeisotopingControl" DataContext="{Binding}"/>
</StackPanel>
</Expander>
</GroupBox>
<GroupBox Header="Search Parameters" DockPanel.Dock="Top">
<Expander x:Name="SearchModeExpander">
<StackPanel>
Expand Down
28 changes: 24 additions & 4 deletions MetaMorpheus/GUI/TaskWindows/CalibrateTaskWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public partial class CalibrateTaskWindow : Window
private readonly ObservableCollection<ModTypeForLoc> LocalizeModTypeForTreeViewObservableCollection = new ObservableCollection<ModTypeForLoc>();
private bool AutomaticallyAskAndOrUpdateParametersBasedOnProtease = true;
private CustomFragmentationWindow CustomFragmentationWindow;
private DeconHostViewModel DeconHostViewModel;

public CalibrateTaskWindow(CalibrationTask myCalibrateTask)
{
Expand All @@ -38,6 +39,7 @@ public CalibrateTaskWindow(CalibrationTask myCalibrateTask)
PopulateChoices();
UpdateFieldsFromTask(TheTask);
AutomaticallyAskAndOrUpdateParametersBasedOnProtease = true;
DeisotopingControl.DataContext = DeconHostViewModel;

if (myCalibrateTask == null)
{
Expand All @@ -51,6 +53,10 @@ public CalibrateTaskWindow(CalibrationTask myCalibrateTask)

private void UpdateFieldsFromTask(CalibrationTask task)
{
MetaMorpheusTask.DetermineAnalyteType(TheTask.CommonParameters);
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
MissedCleavagesTextBox.Text = task.CommonParameters.DigestionParams.MaxMissedCleavages == int.MaxValue ? "" : task.CommonParameters.DigestionParams.MaxMissedCleavages.ToString(CultureInfo.InvariantCulture);
MinPeptideLengthTextBox.Text = task.CommonParameters.DigestionParams.MinPeptideLength.ToString(CultureInfo.InvariantCulture);
Expand Down Expand Up @@ -255,6 +261,10 @@ 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;

//the below parameters are optimized for top-down but do not exist in the GUI as of Nov. 13, 2019
if (((Protease)ProteaseComboBox.SelectedItem).Name.Contains("top-down"))
Expand All @@ -272,9 +282,11 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)
assumeOrphanPeaksAreZ1Fragments: protease.Name != "top-down",
minVariantDepth: minVariantDepth,
maxHeterozygousVariants: maxHeterozygousVariants,
useProvidedPrecursorInfo: false, //Updated
deconvolutionMaxAssumedChargeState: 60, //Updated
trimMsMsPeaks: false); //Updated
trimMsMsPeaks: false,
doPrecursorDeconvolution: doPrecursorDeconvolution,
precursorDeconParams: precursorDeconvolutionParameters,
productDeconParams: productDeconvolutionParameters,
useProvidedPrecursorInfo: useProvidedPrecursorInfo);
TheTask.CommonParameters = commonParamsToSave;
}
else //bottom-up
Expand All @@ -291,7 +303,11 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)
precursorMassTolerance: precursorMassTolerance,
assumeOrphanPeaksAreZ1Fragments: protease.Name != "top-down",
minVariantDepth: minVariantDepth,
maxHeterozygousVariants: maxHeterozygousVariants);
maxHeterozygousVariants: maxHeterozygousVariants,
useProvidedPrecursorInfo: useProvidedPrecursorInfo,
doPrecursorDeconvolution: doPrecursorDeconvolution,
precursorDeconParams: precursorDeconvolutionParameters,
productDeconParams: productDeconvolutionParameters);
TheTask.CommonParameters = commonParamsToSave;
}

Expand Down Expand Up @@ -381,6 +397,10 @@ private void ProteaseSpecificUpdate(object sender, SelectionChangedEventArgs e)
{
//many variables are not present in the calibrate task gui, but we modify them when saving
//uncheck all variable mods
DeconHostViewModel.UseProvidedPrecursors = false;
DeconHostViewModel.DoPrecursorDeconvolution = true;
DeconHostViewModel.PrecursorDeconvolutionParameters.MaxAssumedChargeState = 60;

foreach (var mod in VariableModTypeForTreeViewObservableCollection)
{
mod.Use = false;
Expand Down
1 change: 1 addition & 0 deletions MetaMorpheus/GUI/TaskWindows/GPTMDTaskWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ private void Row_DoubleClick(object sender, MouseButtonEventArgs e)

private void UpdateFieldsFromTask(GptmdTask task)
{
MetaMorpheusTask.DetermineAnalyteType(TheTask.CommonParameters);
DeconHostViewModel = new DeconHostViewModel(TheTask.CommonParameters.PrecursorDeconvolutionParameters,
TheTask.CommonParameters.ProductDeconvolutionParameters,
TheTask.CommonParameters.UseProvidedPrecursorInfo, TheTask.CommonParameters.DoPrecursorDeconvolution);
Expand Down
1 change: 1 addition & 0 deletions MetaMorpheus/GUI/TaskWindows/GlycoSearchTaskWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ private void PopulateChoices()

private void UpdateFieldsFromTask(GlycoSearchTask task)
{
MetaMorpheusTask.DetermineAnalyteType(TheTask.CommonParameters);
RbtOGlycoSearch.IsChecked = task._glycoSearchParameters.GlycoSearchType == EngineLayer.GlycoSearch.GlycoSearchType.OGlycanSearch;
RbtNGlycoSearch.IsChecked = task._glycoSearchParameters.GlycoSearchType == EngineLayer.GlycoSearch.GlycoSearchType.NGlycanSearch;
Rbt_N_O_GlycoSearch.IsChecked = task._glycoSearchParameters.GlycoSearchType == EngineLayer.GlycoSearch.GlycoSearchType.N_O_GlycanSearch;
Expand Down
1 change: 1 addition & 0 deletions MetaMorpheus/GUI/TaskWindows/SearchTaskWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ private void PopulateChoices()
/// <param name="task"></param>
private void UpdateFieldsFromTask(SearchTask task)
{
MetaMorpheusTask.DetermineAnalyteType(TheTask.CommonParameters);
ProteaseComboBox.SelectedItem = task.CommonParameters.DigestionParams.SpecificProtease; //needs to be first, so nonspecific can override if necessary
ClassicSearchRadioButton.IsChecked = task.SearchParameters.SearchType == SearchType.Classic;
ModernSearchRadioButton.IsChecked = task.SearchParameters.SearchType == SearchType.Modern;
Expand Down
1 change: 1 addition & 0 deletions MetaMorpheus/GUI/TaskWindows/XLSearchTaskWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ private void PopulateChoices()

private void UpdateFieldsFromTask(XLSearchTask task)
{
MetaMorpheusTask.DetermineAnalyteType(TheTask.CommonParameters);
cbCrosslinkers.SelectedItem = task.XlSearchParameters.Crosslinker;
txtXLTopNum.Text = task.XlSearchParameters.CrosslinkSearchTopNum.ToString(CultureInfo.InvariantCulture);
ckbAddCompIon.IsChecked = task.CommonParameters.AddCompIons;
Expand Down

0 comments on commit b48a3f6

Please sign in to comment.