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 option to quantify ambiguous peptides #2277

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
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: 1 addition & 1 deletion MetaMorpheus/CMD/CMD.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PackageReference Include="Microsoft.ML.CpuMath" Version="2.0.0" />
<PackageReference Include="Microsoft.ML.FastTree" Version="2.0.0" />
<PackageReference Include="Microsoft.NETCore.App" Version="2.2.8" />
<PackageReference Include="mzLib" Version="1.0.539" />
<PackageReference Include="mzLib" Version="5.0.542" />
<PackageReference Include="Nett" Version="0.15.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion MetaMorpheus/EngineLayer/EngineLayer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageReference Include="Microsoft.ML.CpuMath" Version="2.0.0" />
<PackageReference Include="Microsoft.ML.FastTree" Version="2.0.0" />
<PackageReference Include="Microsoft.NETCore.App" Version="2.2.8" />
<PackageReference Include="mzLib" Version="1.0.539" />
<PackageReference Include="mzLib" Version="5.0.542" />
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
<PackageReference Include="Nett" Version="0.15.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
3 changes: 3 additions & 0 deletions MetaMorpheus/EngineLayer/GlobalVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ private static void SetMetaMorpheusVersion()
}
MetaMorpheusVersion = MetaMorpheusVersion.Substring(0, foundIndexes.Last());
}

// Change this before release!!!
MetaMorpheusVersion = "Alpha - Multi-Run Consensus v1.2.2";
}

private static void SetUpDataDirectory()
Expand Down
2 changes: 1 addition & 1 deletion MetaMorpheus/GUI/GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<PackageReference Include="Microsoft.ML.CpuMath" Version="2.0.0" />
<PackageReference Include="Microsoft.ML.FastTree" Version="2.0.0" />
<PackageReference Include="Microsoft.NETCore.App" Version="2.2.8" />
<PackageReference Include="mzLib" Version="1.0.539" />
<PackageReference Include="mzLib" Version="5.0.542" />
<PackageReference Include="Nett" Version="0.15.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="OxyPlot.Core" Version="2.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions MetaMorpheus/GUI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.2.0")]
[assembly: AssemblyFileVersion("1.1.2.0")]
51 changes: 51 additions & 0 deletions MetaMorpheus/GUI/TaskWindows/SearchTaskWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,40 @@
<ToolTip Content="Use the 'Experimental Design' to normalize intensity values from FlashLFQ" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500" />
</ToolTipService.ToolTip>
</CheckBox>
<CheckBox x:Name="CheckBoxReportPeptideRt" Content="Report peptide retention times">
<CheckBox.IsEnabled>
<MultiBinding Converter="{StaticResource boolOrConverter}">
<Binding ElementName="CheckBoxLFQ" Path ="IsChecked"/>
<Binding ElementName="CheckBoxLFQwSpectralRecovery" Path ="IsChecked"/>
</MultiBinding>
</CheckBox.IsEnabled>
<CheckBox.Visibility>
<MultiBinding Converter="{StaticResource boolOr2VisConverter}">
<Binding ElementName="CheckBoxLFQ" Path ="IsChecked"/>
<Binding ElementName="CheckBoxLFQwSpectralRecovery" Path ="IsChecked"/>
</MultiBinding>
</CheckBox.Visibility>
<ToolTipService.ToolTip>
<ToolTip Content="Report the retention time of the chromatographic peak apex for each peptide in the AllQuantifiedPeptides.tsv file" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500" />
</ToolTipService.ToolTip>
</CheckBox>
<CheckBox x:Name="CheckBoxReportInSourceOxidation" Content="Report in-source oxidation as distinct peptides">
<CheckBox.IsEnabled>
<MultiBinding Converter="{StaticResource boolOrConverter}">
<Binding ElementName="CheckBoxLFQ" Path ="IsChecked"/>
<Binding ElementName="CheckBoxLFQwSpectralRecovery" Path ="IsChecked"/>
</MultiBinding>
</CheckBox.IsEnabled>
<CheckBox.Visibility>
<MultiBinding Converter="{StaticResource boolOr2VisConverter}">
<Binding ElementName="CheckBoxLFQ" Path ="IsChecked"/>
<Binding ElementName="CheckBoxLFQwSpectralRecovery" Path ="IsChecked"/>
</MultiBinding>
</CheckBox.Visibility>
<ToolTipService.ToolTip>
<ToolTip Content="Labels oxidized peptides the co-elute with their unoxidized counterparts" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500" />
</ToolTipService.ToolTip>
</CheckBox>

<!-- Multiplex Options -->
<StackPanel Orientation="Horizontal" Margin="5 5 5 0" Grid.Column="0" Grid.Row="0">
Expand All @@ -546,6 +580,23 @@
</ComboBox>
</StackPanel>

<CheckBox x:Name="CheckBoxQuantifyAmbiguousPeptides" Content="Quantify ambiguous peptides">
<CheckBox.IsEnabled>
<MultiBinding Converter="{StaticResource boolOrConverter}">
<Binding ElementName="CheckBoxLFQ" Path ="IsChecked"/>
<Binding ElementName="CheckBoxLFQwSpectralRecovery" Path ="IsChecked"/>
</MultiBinding>
</CheckBox.IsEnabled>
<CheckBox.Visibility>
<MultiBinding Converter="{StaticResource boolOr2VisConverter}">
<Binding ElementName="CheckBoxLFQ" Path ="IsChecked"/>
<Binding ElementName="CheckBoxLFQwSpectralRecovery" Path ="IsChecked"/>
</MultiBinding>
</CheckBox.Visibility>
<ToolTipService.ToolTip>
<ToolTip Content="Reports identical intensity values for all ambiguous peptides associated with a given chromatographic peak" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500" />
</ToolTipService.ToolTip>
</CheckBox>
</StackPanel>
</GroupBox>

Expand Down
8 changes: 8 additions & 0 deletions MetaMorpheus/GUI/TaskWindows/SearchTaskWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ private void UpdateFieldsFromTask(SearchTask task)
CheckBoxLFQ.IsChecked = task.SearchParameters.DoLabelFreeQuantification;
CheckBoxMultiplex.IsChecked = task.SearchParameters.DoMultiplexQuantification;
MultiplexComboBox.SelectedItem = task.SearchParameters.MultiplexModId ?? _defaultMultiplexType;
CheckBoxNoQuant.IsChecked = !task.SearchParameters.DoLabelFreeQuantification && !task.SearchParameters.DoMultiplexQuantification;
CheckBoxLFQ.IsChecked = task.SearchParameters.DoLabelFreeQuantification;
CheckBoxQuantifyAmbiguousPeptides.IsChecked = task.SearchParameters.QuantifyAmbiguousPeptides;
CheckBoxReportPeptideRt.IsChecked = task.SearchParameters.ReportQuantifiedPeptideRetentionTime;
CheckBoxReportInSourceOxidation.IsChecked = task.SearchParameters.ReportInSourceOxidation;
// If Spectral Recovery is enabled
if (task.SearchParameters.WriteSpectralLibrary & task.SearchParameters.MatchBetweenRuns)
{
Expand Down Expand Up @@ -630,6 +635,9 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)
TheTask.SearchParameters.DoMultiplexQuantification = CheckBoxMultiplex.IsChecked.Value;
TheTask.SearchParameters.MultiplexModId = (string)MultiplexComboBox.SelectedItem;
TheTask.SearchParameters.Normalize = CheckBoxNormalize.IsChecked.Value;
TheTask.SearchParameters.QuantifyAmbiguousPeptides = CheckBoxQuantifyAmbiguousPeptides.IsChecked.Value;
TheTask.SearchParameters.ReportQuantifiedPeptideRetentionTime = CheckBoxReportPeptideRt.IsChecked.Value;
TheTask.SearchParameters.ReportInSourceOxidation = CheckBoxReportInSourceOxidation.IsChecked.Value;
TheTask.SearchParameters.MatchBetweenRuns = CheckBoxMatchBetweenRuns.IsChecked.Value;
TheTask.SearchParameters.ModPeptidesAreDifferent = ModPepsAreUnique.IsChecked.Value;
TheTask.SearchParameters.QuantifyPpmTol = double.Parse(PeakFindingToleranceTextBox.Text, CultureInfo.InvariantCulture);
Expand Down
2 changes: 1 addition & 1 deletion MetaMorpheus/GuiFunctions/GuiFunctions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="itext7" Version="7.1.13" />
<PackageReference Include="mzLib" Version="1.0.539" />
<PackageReference Include="mzLib" Version="5.0.542" />
<PackageReference Include="OxyPlot.Wpf" Version="2.0.0" />
<PackageReference Include="Svg" Version="3.4.3" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions MetaMorpheus/MetaMorpheus.sln
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Global
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Release|Any CPU.Build.0 = Release|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Release|Any CPU.Build.0 = Release|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Release|Any CPU.Build.0 = Debug|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
26 changes: 24 additions & 2 deletions MetaMorpheus/TaskLayer/SearchTask/PostSearchAnalysisTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -584,14 +584,36 @@ private void QuantificationAnalysis()
allIdentifications: flashLFQIdentifications,
normalize: Parameters.SearchParameters.Normalize,
ppmTolerance: Parameters.SearchParameters.QuantifyPpmTol,
quantifyAmbiguousPeptides: Parameters.SearchParameters.QuantifyAmbiguousPeptides,
reportPeptideRetentionTimes: Parameters.SearchParameters.ReportQuantifiedPeptideRetentionTime,
reportInSourceOxidation: Parameters.SearchParameters.ReportInSourceOxidation,
matchBetweenRunsPpmTolerance: Parameters.SearchParameters.QuantifyPpmTol, // If these tolerances are not equivalent, then MBR will falsely classify peptides found in the initial search as MBR peaks
matchBetweenRuns: Parameters.SearchParameters.MatchBetweenRuns,
silent: true,
maxThreads: CommonParameters.MaxThreadsToUsePerFile);


if (flashLFQIdentifications.Any())
{
Parameters.FlashLfqResults = FlashLfqEngine.Run();
Parameters.FlashLfqResults = FlashLfqEngine.Run(out List<Exception> exceptions);
if(Parameters.SearchParameters.QuantifyAmbiguousPeptides)
{
var outputFile = Path.Combine(Parameters.OutputFolder, "QuantificationErrorList.txt");
using (StreamWriter writer = new StreamWriter(outputFile))
{
if (exceptions.IsNotNullOrEmpty())
{
foreach(Exception e in exceptions)
{
writer.WriteLine(e.ToString());
}
}
else
{
writer.WriteLine("No errors to report. Great job!");
}
}
}
}

// get protein intensity back from FlashLFQ
Expand Down Expand Up @@ -649,7 +671,7 @@ private void HistogramAnalysis()
/// included, with each ion being reported in a separate column.
/// </summary>
/// <param name="psms">PSMs to be written</param>
/// <param name="filePath">Full file path, up to and including the filename and extensioh. </param>
/// <param name="filePath">Full file path, up to and including the filename and extension. </param>
protected void WritePsmsToTsv(IEnumerable<PeptideSpectralMatch> psms, string filePath)
{
if (Parameters.SearchParameters.DoMultiplexQuantification &&
Expand Down
5 changes: 5 additions & 0 deletions MetaMorpheus/TaskLayer/SearchTask/SearchParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public SearchParameters()
DoLabelFreeQuantification = true;
DoSpectralRecovery = false;
QuantifyPpmTol = 5;
QuantifyAmbiguousPeptides = false;
ReportQuantifiedPeptideRetentionTime = false;
SearchTarget = true;
DecoyType = DecoyType.Reverse;
DoHistogramAnalysis = false;
Expand Down Expand Up @@ -67,6 +69,9 @@ public SearchParameters()
public bool MatchBetweenRuns { get; set; }
public bool Normalize { get; set; }
public double QuantifyPpmTol { get; set; }
public bool QuantifyAmbiguousPeptides { get; set; }
public bool ReportQuantifiedPeptideRetentionTime { get; set; }
public bool ReportInSourceOxidation { get; set; }
public bool DoHistogramAnalysis { get; set; }
public bool SearchTarget { get; set; }
public DecoyType DecoyType { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion MetaMorpheus/TaskLayer/TaskLayer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageReference Include="Microsoft.ML.CpuMath" Version="2.0.0" />
<PackageReference Include="Microsoft.ML.FastTree" Version="2.0.0" />
<PackageReference Include="Microsoft.NETCore.App" Version="2.2.8" />
<PackageReference Include="mzLib" Version="1.0.539" />
<PackageReference Include="mzLib" Version="5.0.542" />
<PackageReference Include="NetSerializer" Version="4.1.1" />
<PackageReference Include="Nett" Version="0.15.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion MetaMorpheus/Test/Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<PackageReference Include="Microsoft.ML" Version="2.0.0" />
<PackageReference Include="Microsoft.ML.CpuMath" Version="2.0.0" />
<PackageReference Include="Microsoft.ML.FastTree" Version="2.0.0" />
<PackageReference Include="mzLib" Version="1.0.539" />
<PackageReference Include="mzLib" Version="5.0.542" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
Expand Down