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

Require More Evidence to Write mod to Pruned Database #2444

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions MetaMorpheus/CMD/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ private static int Run(CommandLineSettings settings)
MetaMorpheusTask.FinishedSingleTaskHandler += MyTaskEngine_finishedSingleTaskHandler;
MetaMorpheusTask.FinishedWritingFileHandler += MyTaskEngine_finishedWritingFileHandler;

PrunedDatabaseWriter.FinishedWritingFileHandler += MyTaskEngine_finishedWritingFileHandler;

bool containsRawFiles = settings.Spectra.Select(v => Path.GetExtension(v).ToLowerInvariant()).Any(v => v == ".raw");
if (containsRawFiles && !GlobalVariables.GlobalSettings.UserHasAgreedToThermoRawFileReaderLicence)
{
Expand Down
18 changes: 18 additions & 0 deletions MetaMorpheus/EngineLayer/Util/DictionaryExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Collections.Generic;

namespace EngineLayer;

public static class DictionaryExtensions
{
public static void AddOrCreate<TKey, TValue>(this IDictionary<TKey, List<TValue>> dictionary, TKey key, TValue value)
{
if (dictionary.TryGetValue(key, out var list))
{
list.Add(value);
}
else
{
dictionary[key] = [value];
}
}
}
2 changes: 2 additions & 0 deletions MetaMorpheus/GUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public MainWindow()
MetaMorpheusEngine.OutLabelStatusHandler += NewoutLabelStatus;
MetaMorpheusEngine.WarnHandler += NotificationHandler;

PrunedDatabaseWriter.FinishedWritingFileHandler += FinishedWritingFile;

MyFileManager.WarnHandler += NotificationHandler;
Application.Current.MainWindow.Closing += new CancelEventHandler(MainWindow_Closing);
}
Expand Down
33 changes: 23 additions & 10 deletions MetaMorpheus/GUI/TaskWindows/SearchTaskWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1130,21 +1130,34 @@
</GroupBox>
<GroupBox Header="Pruned Database Writing">
<StackPanel Margin="5">
<CheckBox Margin="0 0 0 5" x:Name="WritePrunedDBCheckBox" Content="Write Two Pruned Databases (Mod and Mod+Protein pruned)" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500">
<CheckBox Margin="0 0 0 5" x:Name="WritePrunedDBCheckBox" VerticalAlignment="Center"
Content="Write Two Pruned Databases (Mod and Mod+Protein pruned)" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500">
<ToolTipService.ToolTip>
<TextBlock>
This is very uncommon and not recommended for the typical user.
<LineBreak />
This option writes two databases:
<LineBreak />
1) Retain all proteins but only keeps modifications found at a 1% FDR.
<LineBreak />
2) Retain only proteins and modifications found at a 1% FDR.
<LineBreak />
This is intended for further analysis, such as importing into Proteoform Suite to analyse top-down and intact-mass data.
This is very uncommon and not recommended for the typical user.
<LineBreak />
This option writes two databases:
<LineBreak />
1) Retain all proteins but only keeps modifications found at a 1% FDR.
<LineBreak />
2) Retain only proteins and modifications found at a 1% FDR.
<LineBreak />
This is intended for further analysis, such as importing into Proteoform Suite to analyse top-down and intact-mass data.
</TextBlock>
</ToolTipService.ToolTip>
</CheckBox>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<local:IntegerTexBoxControl x:Name="PrunedDatabaseEvidenceTextBox" Width="30" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500" >
<ToolTipService.ToolTip>
<TextBlock>
Only Retain a modified residue position if there is n pieces of unique information supporting it.
<LineBreak />
Unique information here is defined by the following criteria: Dissociation Type, Digestion Agent, and Missed Cleavage Product.
</TextBlock>
</ToolTipService.ToolTip>
</local:IntegerTexBoxControl>
<Label Content="Unique observations required to write modifications to pruned database" />
</StackPanel>
<DataGrid x:Name="ModSelectionGrid" AutoGenerateColumns = "false" ItemsSource="{Binding UpdateSourceTrigger=LostFocus, Mode=OneWay}" Visibility="{Binding prunedVisible, UpdateSourceTrigger=LostFocus}" IsEnabled="{Binding IsChecked, ElementName=WritePrunedDBCheckBox}" IsReadOnly="False" AlternatingRowBackground="LightGray" AlternationCount="2">
<DataGrid.Columns>
<DataGridTextColumn Header="Mod Type" Width="1*" Binding="{Binding ModName}" />
Expand Down
2 changes: 2 additions & 0 deletions MetaMorpheus/GUI/TaskWindows/SearchTaskWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ private void UpdateFieldsFromTask(SearchTask task)
NumberOfWindowsTextBox.Text = task.CommonParameters.NumberOfWindows == int.MaxValue || !task.CommonParameters.NumberOfWindows.HasValue ? "" : task.CommonParameters.NumberOfWindows.Value.ToString(CultureInfo.InvariantCulture);
NormalizePeaksInWindowCheckBox.IsChecked = task.CommonParameters.NormalizePeaksAccrossAllWindows;

PrunedDatabaseEvidenceTextBox.Text = task.SearchParameters.EvidenceRequiredToWriteLocalizedMod.ToString(CultureInfo.InvariantCulture);
MaxThreadsTextBox.Text = task.CommonParameters.MaxThreadsToUsePerFile.ToString(CultureInfo.InvariantCulture);
MinVariantDepthTextBox.Text = task.CommonParameters.MinVariantDepth.ToString(CultureInfo.InvariantCulture);
MaxHeterozygousVariantsTextBox.Text = task.CommonParameters.MaxHeterozygousVariants.ToString(CultureInfo.InvariantCulture);
Expand Down Expand Up @@ -639,6 +640,7 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)
TheTask.SearchParameters.UpdateSpectralLibrary = UpdateSpectralLibraryCheckBox.IsChecked.Value;
TheTask.SearchParameters.CompressIndividualFiles = CompressIndividualResultsCheckBox.IsChecked.Value;
TheTask.SearchParameters.IncludeModMotifInMzid = IncludeMotifInModNamesCheckBox.IsChecked.Value;
TheTask.SearchParameters.EvidenceRequiredToWriteLocalizedMod = PrunedDatabaseEvidenceTextBox.Text.Equals("") ? 1 : uint.Parse(PrunedDatabaseEvidenceTextBox.Text, CultureInfo.InvariantCulture);

if (RemoveContaminantRadioBox.IsChecked.Value)
{
Expand Down
Loading