Skip to content

Commit

Permalink
Merge branch 'master' into computeSpectrumSimilarityInMetaDraw
Browse files Browse the repository at this point in the history
  • Loading branch information
nbollis authored Sep 20, 2023
2 parents 0fed513 + d9ee565 commit 90c58d5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 43 deletions.
41 changes: 0 additions & 41 deletions MetaMorpheus/EngineLayer/Ms2ScanWithSpecificMass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,46 +152,5 @@ public IsotopicEnvelope[] GetClosestExperimentalIsotopicEnvelopeList(double mini
IsotopicEnvelope[] isotopicEnvelopes = ExperimentalFragments.Skip(startIndex).Take(length).ToArray();
return isotopicEnvelopes;
}

public double? GetClosestExperimentalFragmentMz(double theoreticalMz, out double? intensity)
{
if (TheScan.MassSpectrum.XArray.Length == 0)
{
intensity = null;
return null;
}
intensity = TheScan.MassSpectrum.YArray[GetClosestFragmentMzIndex(theoreticalMz).Value];
return TheScan.MassSpectrum.XArray[GetClosestFragmentMzIndex(theoreticalMz).Value];
}

private int? GetClosestFragmentMzIndex(double mz)
{
if (TheScan.MassSpectrum.XArray.Length == 0)
{
return null;
}
int index = Array.BinarySearch(TheScan.MassSpectrum.XArray, mz);
if (index >= 0)
{
return index;
}
index = ~index;

if (index >= TheScan.MassSpectrum.XArray.Length)
{
return index - 1;
}
if (index == 0)
{
return index;
}

if (mz - TheScan.MassSpectrum.XArray[index - 1] > TheScan.MassSpectrum.XArray[index] - mz)
{
return index;
}
return index - 1;

}
}
}
2 changes: 1 addition & 1 deletion MetaMorpheus/GUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@
<Button Name="AddCalibTaskButton" Grid.Column="0" Content="+ADD CALIBRATION" HorizontalAlignment="Right" Click="AddCalibrateTaskButton_Click"
Style="{StaticResource ImportantButtonStyle}" Margin="0,0,1,0" Width="140"/>
<Button Name="AddAveragingTaskButton" Grid.Column="1" Content="+AVERAGE SPECTRA" HorizontalAlignment="Right" Click="AddAveragingTaskButton_OnClick"
Style="{StaticResource ImportantButtonStyle}" Margin="0, 0, 1, 0" Width="140" FontSize="11" Visibility="Collapsed"/>
Style="{StaticResource ImportantButtonStyle}" Margin="0, 0, 1, 0" Width="140" FontSize="11" Visibility="Visible"/>
<Button Name="AddGptmdTaskButton" Grid.Column="2" Content="+ADD PTM DISCOVERY" HorizontalAlignment="Right" Click="AddGPTMDTaskButton_Click"
Style="{StaticResource ImportantButtonStyle}" Margin="0,0,1,0" Width="140"/>
<Button Name="AddSearchTaskButton" Grid.Column="3" Content="+ADD SEARCH" HorizontalAlignment="Right" Click="AddSearchTaskButton_Click"
Expand Down
3 changes: 3 additions & 0 deletions MetaMorpheus/MetaMorpheusSetup/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@
<Component Id="src_MassSpectrometry.dll" Guid="d6241678-3d48-4c7a-becf-9c1160fbe06b">
<File Id="src_MassSpectrometry.dll" Name="MassSpectrometry.dll" Source="$(var.GUI_TargetDir)MassSpectrometry.dll" />
</Component>
<Component Id="src_SpectralAveraging.dll" Guid="{1B9EB148-6FC3-4DA1-82D0-935EDE76E8D7}">
<File Id="src_SpectralAveraging.dll" Name="SpectralAveraging.dll" Source="$(var.GUI_TargetDir)SpectralAveraging.dll" />
</Component>
<Component Id="src_MathNet.Numerics.dll" Guid="dea92905-719e-48e1-8a64-e845dca06dac">
<File Id="src_MathNet.Numerics.dll" Name="MathNet.Numerics.dll" Source="$(var.GUI_TargetDir)MathNet.Numerics.dll" />
</Component>
Expand Down
1 change: 0 additions & 1 deletion MetaMorpheus/Test/GPTMDengineTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ public static void TestUniProtGptmdConflict()
{
// this unit test checks to make sure GPTMD does not annotate mods at residues on
// proteins where the equivalent uniprot mod already exists

Modification uniProtPhospho = GlobalVariables.AllModsKnown.First(p => p.ModificationType == "UniProt" && p.IdWithMotif.Contains("Phosphoserine"));
Modification mmPhospho = GlobalVariables.AllModsKnown.First(p => p.ModificationType == "Common Biological" && p.IdWithMotif.Contains("Phosphorylation on S"));

Expand Down

0 comments on commit 90c58d5

Please sign in to comment.