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

Added Decon Parameters to Calibration Window #2459

Merged
merged 6 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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