From 7dab3700f5b10702d03bcd8f178fe578c960d0fa Mon Sep 17 00:00:00 2001 From: Nic Bollis Date: Fri, 26 Jul 2024 09:20:09 -0500 Subject: [PATCH] Added new features to Top-Down PEP (#2377) * Updated to MzLib 1.0.548 and fixed custom ions in search tasks * reverted calibration task change * merged in master bbbyy * merged in master * corrected errors from merge * Added in new features and removed noralization from top down * removed multiplier for top down * fixed an issue with my norm cancelization * put the mult back * put the mult back in * added precursor fractional intensity * count only terminal ions * fixed bug in counting terminal only * added internal ion count to top down features * added internal ions as seperate categor * removed excess code --- .../FdrAnalysis/PEPValueAnalysisGeneric.cs | 54 +++++++++++++++--- .../EngineLayer/FdrAnalysis/PsmData.cs | 55 +++++++++++++++++-- .../EngineLayer/Ms2ScanWithSpecificMass.cs | 4 +- MetaMorpheus/EngineLayer/SpectralMatch.cs | 14 +++++ MetaMorpheus/TaskLayer/MetaMorpheusTask.cs | 27 ++++++--- MetaMorpheus/Test/FdrTest.cs | 41 +++++++++++--- 6 files changed, 166 insertions(+), 29 deletions(-) diff --git a/MetaMorpheus/EngineLayer/FdrAnalysis/PEPValueAnalysisGeneric.cs b/MetaMorpheus/EngineLayer/FdrAnalysis/PEPValueAnalysisGeneric.cs index a42d919da..56230f449 100644 --- a/MetaMorpheus/EngineLayer/FdrAnalysis/PEPValueAnalysisGeneric.cs +++ b/MetaMorpheus/EngineLayer/FdrAnalysis/PEPValueAnalysisGeneric.cs @@ -25,7 +25,21 @@ public static class PEP_Analysis_Cross_Validation private static Dictionary>> fileSpecificTimeDependantHydrophobicityAverageAndDeviation_unmodified = new Dictionary>>(); private static Dictionary>> fileSpecificTimeDependantHydrophobicityAverageAndDeviation_modified = new Dictionary>>(); private static Dictionary>> fileSpecificTimeDependantHydrophobicityAverageAndDeviation_CZE = new Dictionary>>(); + + /// + /// A dictionary which stores the chimeric ID string in the key and the number of chimeric identifications as the vale + /// + private static Dictionary chimeraCountDictionary = new Dictionary(); + + /// + /// This method is used to compute the PEP values for all PSMs in a dataset. + /// + /// + /// + /// + /// + /// public static string ComputePEPValuesForAllPSMsGeneric(List psms, string searchType, List<(string fileName, CommonParameters fileSpecificParameters)> fileSpecificParameters, string outputFolder) { string[] trainingVariables = PsmData.trainingInfos[searchType]; @@ -84,6 +98,10 @@ public static string ComputePEPValuesForAllPSMsGeneric(List psms, } } + if (trainingVariables.Contains("ChimeraCount")) + chimeraCountDictionary = psms.GroupBy(p => p.ChimeraIdString) + .ToDictionary(p => p.Key, p => p.Count()); + MLContext mlContext = new MLContext(); //the number of groups used for cross-validation is hard-coded at four. Do not change this number without changes other areas of effected code. @@ -751,6 +769,7 @@ public static PsmData CreateOnePsmDataEntry(string searchType, List<(string file { double normalizationFactor = selectedPeptide.BaseSequence.Length; float totalMatchingFragmentCount = 0; + float internalMatchingFragmentCount = 0; float intensity = 0; float chargeDifference = 0; float deltaScore = 0; @@ -758,6 +777,12 @@ public static PsmData CreateOnePsmDataEntry(string searchType, List<(string file float ambiguity = 0; float modCount = 0; float absoluteFragmentMassError = 0; + float spectralAngle = 0; + float hasSpectralAngle = 0; + float chimeraCount = 0; + float peaksInPrecursorEnvelope = 0; + float mostAbundantPrecursorPeakIntensity = 0; + float fractionalIntensity = 0; float missedCleavages = 0; float longestSeq = 0; @@ -774,19 +799,20 @@ public static PsmData CreateOnePsmDataEntry(string searchType, List<(string file float isLoop = 0; float isInter = 0; float isIntra = 0; - float spectralAngle = 0; - float hasSpectralAngle = 0; + double multiplier = 10; if (searchType != "crosslink") { if (searchType == "top-down") { - normalizationFactor /= 10.0; + normalizationFactor = 1.0; } - totalMatchingFragmentCount = (float)(Math.Round(psm.BioPolymersWithSetModsToMatchingFragments[selectedPeptide].Count / normalizationFactor * 10, 0)); - intensity = (float)Math.Min(50, Math.Round((psm.Score - (int)psm.Score) / normalizationFactor * 100.0, 0)); + // count only terminal fragment ions + totalMatchingFragmentCount = (float)(Math.Round(psm.BioPolymersWithSetModsToMatchingFragments[selectedPeptide].Count(p => p.NeutralTheoreticalProduct.SecondaryProductType == null) / normalizationFactor * multiplier, 0)); + internalMatchingFragmentCount = (float)(Math.Round(psm.BioPolymersWithSetModsToMatchingFragments[selectedPeptide].Count(p => p.NeutralTheoreticalProduct.SecondaryProductType != null) / normalizationFactor * multiplier, 0)); + intensity = (float)Math.Min(50, Math.Round((psm.Score - (int)psm.Score) / normalizationFactor * Math.Pow(multiplier, 2), 0)); chargeDifference = -Math.Abs(chargeStateMode - psm.ScanPrecursorCharge); - deltaScore = (float)Math.Round(psm.DeltaScore / normalizationFactor * 10.0, 0); + deltaScore = (float)Math.Round(psm.DeltaScore / normalizationFactor * multiplier, 0); notch = notchToUse; modCount = Math.Min((float)selectedPeptide.AllModsOneIsNterminus.Keys.Count(), 10); if (psm.BioPolymersWithSetModsToMatchingFragments[selectedPeptide]?.Count() > 0) @@ -795,10 +821,15 @@ public static PsmData CreateOnePsmDataEntry(string searchType, List<(string file } ambiguity = Math.Min((float)(psm.BioPolymersWithSetModsToMatchingFragments.Keys.Count - 1), 10); - longestSeq = (float)Math.Round(SpectralMatch.GetLongestIonSeriesBidirectional(psm.BioPolymersWithSetModsToMatchingFragments, selectedPeptide) / normalizationFactor * 10, 0); - complementaryIonCount = (float)Math.Round(SpectralMatch.GetCountComplementaryIons(psm.BioPolymersWithSetModsToMatchingFragments, selectedPeptide) / normalizationFactor * 10, 0); + longestSeq = (float)Math.Round(SpectralMatch.GetLongestIonSeriesBidirectional(psm.BioPolymersWithSetModsToMatchingFragments, selectedPeptide) / normalizationFactor * multiplier, 0); + complementaryIonCount = (float)Math.Round(SpectralMatch.GetCountComplementaryIons(psm.BioPolymersWithSetModsToMatchingFragments, selectedPeptide) / normalizationFactor * multiplier, 0); isVariantPeptide = PeptideIsVariant(selectedPeptide); spectralAngle = (float)psm.SpectralAngle; + if (chimeraCountDictionary.TryGetValue(psm.ChimeraIdString, out int val)) + chimeraCount = val; + peaksInPrecursorEnvelope = psm.PrecursorScanEnvelopePeakCount; + mostAbundantPrecursorPeakIntensity = (float)Math.Round((float)psm.PrecursorScanIntensity / normalizationFactor * multiplier, 0); + fractionalIntensity = (float)psm.PrecursorFractionalIntensity; if (PsmHasSpectralAngle(psm)) { @@ -910,7 +941,12 @@ public static PsmData CreateOnePsmDataEntry(string searchType, List<(string file Label = label, SpectralAngle = spectralAngle, - HasSpectralAngle = hasSpectralAngle + HasSpectralAngle = hasSpectralAngle, + PeaksInPrecursorEnvelope = peaksInPrecursorEnvelope, + ChimeraCount = chimeraCount, + MostAbundantPrecursorPeakIntensity = mostAbundantPrecursorPeakIntensity, + PrecursorFractionalIntensity = fractionalIntensity, + InternalIonCount = internalMatchingFragmentCount, }; return psm.PsmData_forPEPandPercolator; diff --git a/MetaMorpheus/EngineLayer/FdrAnalysis/PsmData.cs b/MetaMorpheus/EngineLayer/FdrAnalysis/PsmData.cs index 2f3438221..9a6617d5d 100644 --- a/MetaMorpheus/EngineLayer/FdrAnalysis/PsmData.cs +++ b/MetaMorpheus/EngineLayer/FdrAnalysis/PsmData.cs @@ -9,9 +9,36 @@ public class PsmData { public static readonly IImmutableDictionary trainingInfos = new Dictionary { - { "standard", new [] { "TotalMatchingFragmentCount", "Intensity", "PrecursorChargeDiffToMode", "DeltaScore", "Notch", "ModsCount", "AbsoluteAverageFragmentMassErrorFromMedian", "MissedCleavagesCount", "Ambiguity", "LongestFragmentIonSeries", "ComplementaryIonCount", "HydrophobicityZScore", "IsVariantPeptide", "IsDeadEnd", "IsLoop", "SpectralAngle", "HasSpectralAngle" } }, - { "top-down", new [] { "TotalMatchingFragmentCount", "Intensity", "PrecursorChargeDiffToMode", "DeltaScore", "Notch", "ModsCount", "AbsoluteAverageFragmentMassErrorFromMedian", "Ambiguity", "LongestFragmentIonSeries", "ComplementaryIonCount", "SpectralAngle", "HasSpectralAngle" } }, - { "crosslink", new [] { "TotalMatchingFragmentCount", "AbsoluteAverageFragmentMassErrorFromMedian", "PrecursorChargeDiffToMode", "DeltaScore", "AlphaIntensity", "BetaIntensity", "LongestFragmentIonSeries_Alpha", "LongestFragmentIonSeries_Beta", "IsInter", "IsIntra" } } + { + "standard", new[] + { + "TotalMatchingFragmentCount", "Intensity", "PrecursorChargeDiffToMode", "DeltaScore", + "Notch", "ModsCount", "AbsoluteAverageFragmentMassErrorFromMedian", "MissedCleavagesCount", + "Ambiguity", "LongestFragmentIonSeries", "ComplementaryIonCount", "HydrophobicityZScore", + "IsVariantPeptide", "IsDeadEnd", "IsLoop", "SpectralAngle", "HasSpectralAngle", + } + }, + + { + "top-down", new[] + { + "TotalMatchingFragmentCount", "Intensity", "PrecursorChargeDiffToMode", "DeltaScore", + "Notch", "ModsCount", "AbsoluteAverageFragmentMassErrorFromMedian", "Ambiguity", + "LongestFragmentIonSeries", "ComplementaryIonCount", "SpectralAngle", + "HasSpectralAngle", "PeaksInPrecursorEnvelope", "ChimeraCount", + "MostAbundantPrecursorPeakIntensity", "PrecursorFractionalIntensity", "InternalIonCount" + } + }, + + { + "crosslink", + new[] + { + "TotalMatchingFragmentCount", "AbsoluteAverageFragmentMassErrorFromMedian", + "PrecursorChargeDiffToMode", "DeltaScore", "AlphaIntensity", "BetaIntensity", + "LongestFragmentIonSeries_Alpha", "LongestFragmentIonSeries_Beta", "IsInter", "IsIntra" + } + } }.ToImmutableDictionary(); /// @@ -42,7 +69,12 @@ public class PsmData { "IsInter", -1 }, { "IsIntra", -1 }, { "SpectralAngle", 1 }, - { "HasSpectralAngle", 1 } + { "HasSpectralAngle", 1 }, + { "PeaksInPrecursorEnvelope", 1 }, + { "ChimeraCount", -1 }, + { "MostAbundantPrecursorPeakIntensity", 1 }, + { "PrecursorFractionalIntensity", 1 }, + { "InternalIonCount", 1}, }.ToImmutableDictionary(); public string ToString(string searchType) @@ -132,5 +164,20 @@ public string ToString(string searchType) [LoadColumn(23)] public float HasSpectralAngle { get; set; } + + [LoadColumn(24)] + public float PeaksInPrecursorEnvelope { get; set; } + + [LoadColumn(25)] + public float ChimeraCount { get; set; } + + [LoadColumn(26)] + public float MostAbundantPrecursorPeakIntensity { get; set; } + + [LoadColumn(27)] + public float PrecursorFractionalIntensity { get; set; } + + [LoadColumn(28)] + public float InternalIonCount { get; set; } } } \ No newline at end of file diff --git a/MetaMorpheus/EngineLayer/Ms2ScanWithSpecificMass.cs b/MetaMorpheus/EngineLayer/Ms2ScanWithSpecificMass.cs index effef3a63..889822c88 100644 --- a/MetaMorpheus/EngineLayer/Ms2ScanWithSpecificMass.cs +++ b/MetaMorpheus/EngineLayer/Ms2ScanWithSpecificMass.cs @@ -9,13 +9,14 @@ namespace EngineLayer public class Ms2ScanWithSpecificMass { public Ms2ScanWithSpecificMass(MsDataScan mzLibScan, double precursorMonoisotopicPeakMz, int precursorCharge, string fullFilePath, CommonParameters commonParam, - IsotopicEnvelope[] neutralExperimentalFragments = null, double? precursorIntensity = null, int? envelopePeakCount = null) + IsotopicEnvelope[] neutralExperimentalFragments = null, double? precursorIntensity = null, int? envelopePeakCount = null, double? precursorFractionalIntensity = null) { PrecursorMonoisotopicPeakMz = precursorMonoisotopicPeakMz; PrecursorCharge = precursorCharge; PrecursorMass = PrecursorMonoisotopicPeakMz.ToMass(precursorCharge); PrecursorIntensity = precursorIntensity ?? 1; PrecursorEnvelopePeakCount = envelopePeakCount ?? 1; + PrecursorFractionalIntensity = precursorFractionalIntensity ?? -1; FullFilePath = fullFilePath; ChildScans = new List(); NativeId = mzLibScan.NativeId; @@ -42,6 +43,7 @@ public Ms2ScanWithSpecificMass(MsDataScan mzLibScan, double precursorMonoisotopi public int PrecursorCharge { get; } public double PrecursorIntensity { get; } public int PrecursorEnvelopePeakCount { get; } + public double PrecursorFractionalIntensity { get; } public string FullFilePath { get; } public IsotopicEnvelope[] ExperimentalFragments { get; private set; } public List ChildScans { get; set; } // MS2/MS3 scans that are children of this MS2 scan diff --git a/MetaMorpheus/EngineLayer/SpectralMatch.cs b/MetaMorpheus/EngineLayer/SpectralMatch.cs index e04e82fa5..1e4caa45a 100644 --- a/MetaMorpheus/EngineLayer/SpectralMatch.cs +++ b/MetaMorpheus/EngineLayer/SpectralMatch.cs @@ -30,6 +30,7 @@ protected SpectralMatch(IBioPolymerWithSetMods peptide, int notch, double score, ScanPrecursorMonoisotopicPeakMz = scan.PrecursorMonoisotopicPeakMz; ScanPrecursorMass = scan.PrecursorMass; PrecursorScanEnvelopePeakCount = scan.PrecursorEnvelopePeakCount; + PrecursorFractionalIntensity = scan.PrecursorFractionalIntensity; DigestionParams = commonParameters.DigestionParams; BioPolymersWithSetModsToMatchingFragments = new Dictionary>(); Xcorr = xcorr; @@ -67,6 +68,7 @@ protected SpectralMatch(IBioPolymerWithSetMods peptide, int notch, double score, public double ScanPrecursorMonoisotopicPeakMz { get; } public double PrecursorScanIntensity { get; } public int PrecursorScanEnvelopePeakCount { get; } + public double PrecursorFractionalIntensity { get; } public double ScanPrecursorMass { get; } public string FullFilePath { get; private set; } public int ScanIndex { get; } @@ -366,7 +368,17 @@ protected SpectralMatch(SpectralMatch psm, List<(int Notch, IBioPolymerWithSetMo #endregion + #region FDR + private string _chimeraIdString; + public string ChimeraIdString => _chimeraIdString ??= $"{ScanNumber}{FullFilePath}{PrecursorScanNumber}"; + + /// + /// Returns an integer representing the longest continuous number of residues in the match covered on both sides by fragment ions + /// + /// + /// + /// public static int GetLongestIonSeriesBidirectional(Dictionary> PeptidesToMatchingFragments, IBioPolymerWithSetMods peptide) { List maxDiffs = new List { 1 }; @@ -518,6 +530,8 @@ public static int GetCountComplementaryIons(Dictionary /// There are a few key locations in MetaMorpheus where we want to have psms sorted in a consistent manner. /// These are for q-value determination and for when we write the psms to psmtsv. diff --git a/MetaMorpheus/TaskLayer/MetaMorpheusTask.cs b/MetaMorpheus/TaskLayer/MetaMorpheusTask.cs index 56c77012a..cbc70c44b 100644 --- a/MetaMorpheus/TaskLayer/MetaMorpheusTask.cs +++ b/MetaMorpheus/TaskLayer/MetaMorpheusTask.cs @@ -131,7 +131,7 @@ public static List[] _GetMs2Scans(MsDataFile myMSDataFi Parallel.ForEach(Partitioner.Create(0, ms2Scans.Length), new ParallelOptions { MaxDegreeOfParallelism = commonParameters.MaxThreadsToUsePerFile }, (partitionRange, loopState) => { - List<(double, int, double, int)> precursors = new List<(double, int, double, int)>(); + var precursors = new List<(double MonoPeakMz, int Charge, double Intensity, int PeakCount, double? FractionalIntensity)>(); for (int i = partitionRange.Item1; i < partitionRange.Item2; i++) { @@ -175,7 +175,16 @@ public static List[] _GetMs2Scans(MsDataFile myMSDataFi { intensity = envelope.Peaks.Sum(p => p.intensity); } - precursors.Add((monoPeakMz, envelope.Charge, intensity, peakCount)); + + var fractionalIntensity = envelope.TotalIntensity / + (double)precursorSpectrum.MassSpectrum.YArray + [ + precursorSpectrum.MassSpectrum.GetClosestPeakIndex(ms2scan.IsolationRange.Minimum) + .. + precursorSpectrum.MassSpectrum.GetClosestPeakIndex(ms2scan.IsolationRange.Maximum) + ].Sum(); + precursors.Add((monoPeakMz, envelope.Charge, intensity, peakCount, + fractionalIntensity)); } } } @@ -195,7 +204,7 @@ public static List[] _GetMs2Scans(MsDataFile myMSDataFi commonParameters.DeconvolutionMassTolerance.Within( precursorMZ.ToMass(precursorCharge), b.Item1.ToMass(b.Item2)))) { - precursors.Add((precursorMZ, precursorCharge, precursorIntensity, 1)); + precursors.Add((precursorMZ, precursorCharge, precursorIntensity, 1, null)); } } else @@ -206,7 +215,7 @@ public static List[] _GetMs2Scans(MsDataFile myMSDataFi commonParameters.DeconvolutionMassTolerance.Within( precursorMZ.ToMass(precursorCharge), b.Item1.ToMass(b.Item2)))) { - precursors.Add((precursorMZ, precursorCharge, precursorIntensity, 1)); + precursors.Add((precursorMZ, precursorCharge, precursorIntensity, 1, null)); } } } @@ -235,8 +244,9 @@ public static List[] _GetMs2Scans(MsDataFile myMSDataFi foreach (var precursor in precursors) { // assign precursor for this MS2 scan - var scan = new Ms2ScanWithSpecificMass(ms2scan, precursor.Item1, - precursor.Item2, fullFilePath, commonParameters, neutralExperimentalFragments, precursor.Item3, precursor.Item4); + var scan = new Ms2ScanWithSpecificMass(ms2scan, precursor.MonoPeakMz, + precursor.Charge, fullFilePath, commonParameters, neutralExperimentalFragments, + precursor.Intensity, precursor.PeakCount, precursor.FractionalIntensity); // assign precursors for MS2 child scans if (ms2ChildScans != null) @@ -249,8 +259,9 @@ public static List[] _GetMs2Scans(MsDataFile myMSDataFi { childNeutralExperimentalFragments = Ms2ScanWithSpecificMass.GetNeutralExperimentalFragments(ms2ChildScan, commonParameters); } - var theChildScan = new Ms2ScanWithSpecificMass(ms2ChildScan, precursor.Item1, - precursor.Item2, fullFilePath, commonParameters, childNeutralExperimentalFragments, precursor.Item3, precursor.Item4); + var theChildScan = new Ms2ScanWithSpecificMass(ms2ChildScan, precursor.MonoPeakMz, + precursor.Charge, fullFilePath, commonParameters, childNeutralExperimentalFragments, + precursor.Intensity, precursor.PeakCount, precursor.FractionalIntensity); scan.ChildScans.Add(theChildScan); } } diff --git a/MetaMorpheus/Test/FdrTest.cs b/MetaMorpheus/Test/FdrTest.cs index 610293c90..310b011cf 100644 --- a/MetaMorpheus/Test/FdrTest.cs +++ b/MetaMorpheus/Test/FdrTest.cs @@ -406,7 +406,7 @@ public static void TestComputePEPValueTopDown() }; var maxPsmData = PEP_Analysis_Cross_Validation.CreateOnePsmDataEntry("top-down", fsp, maxScorePsm, fileSpecificRetTimeHI_behavior, fileSpecificRetTemHI_behaviorModifiedPeptides, massError, chargeStateMode, pwsm, notch, !pwsm.Parent.IsDecoy); Assert.That(maxScorePsm.BioPolymersWithSetModsToMatchingFragments.Count - 1, Is.EqualTo(maxPsmData.Ambiguity)); - double normalizationFactor = (double)pwsm.BaseSequence.Length / 10.0; + double normalizationFactor = 1; float maxPsmDeltaScore = (float)Math.Round(maxScorePsm.DeltaScore / normalizationFactor * 10.0, 0); Assert.That(maxPsmDeltaScore, Is.EqualTo(maxPsmData.DeltaScore).Within(0.05)); float maxPsmIntensity = (float)Math.Min(50, Math.Round((maxScorePsm.Score - (int)maxScorePsm.Score) / normalizationFactor * 100.0, 0)); @@ -639,16 +639,38 @@ public static void TestPsmData() { string searchType = "standard"; string[] trainingInfoStandard = PsmData.trainingInfos[searchType]; - string[] expectedTrainingInfoStandard = new[] { "TotalMatchingFragmentCount", "Intensity", "PrecursorChargeDiffToMode", "DeltaScore", "Notch", "ModsCount", "AbsoluteAverageFragmentMassErrorFromMedian", "MissedCleavagesCount", "Ambiguity", "LongestFragmentIonSeries", "ComplementaryIonCount", "HydrophobicityZScore", "IsVariantPeptide", "IsDeadEnd", "IsLoop", "SpectralAngle", "HasSpectralAngle" }; + string[] expectedTrainingInfoStandard = new[] + { + "TotalMatchingFragmentCount", "Intensity", "PrecursorChargeDiffToMode", "DeltaScore", "Notch", + "ModsCount", "AbsoluteAverageFragmentMassErrorFromMedian", "MissedCleavagesCount", "Ambiguity", + "LongestFragmentIonSeries", "ComplementaryIonCount", "HydrophobicityZScore", "IsVariantPeptide", + "IsDeadEnd", "IsLoop", "SpectralAngle", "HasSpectralAngle" + }; Assert.AreEqual(expectedTrainingInfoStandard, trainingInfoStandard); searchType = "top-down"; string[] trainingInfoTopDown = PsmData.trainingInfos[searchType]; - string[] expectedTrainingInfoTopDown = new[] { "TotalMatchingFragmentCount", "Intensity", "PrecursorChargeDiffToMode", "DeltaScore", "Notch", "ModsCount", "AbsoluteAverageFragmentMassErrorFromMedian", "Ambiguity", "LongestFragmentIonSeries", "ComplementaryIonCount", "SpectralAngle", "HasSpectralAngle" }; + string[] expectedTrainingInfoTopDown = new[] + { + "TotalMatchingFragmentCount", "Intensity", "PrecursorChargeDiffToMode", "DeltaScore", "Notch", + "ModsCount", "AbsoluteAverageFragmentMassErrorFromMedian", "Ambiguity", "LongestFragmentIonSeries", + "ComplementaryIonCount", "SpectralAngle", "HasSpectralAngle", "PeaksInPrecursorEnvelope", + "ChimeraCount", "MostAbundantPrecursorPeakIntensity", "PrecursorFractionalIntensity", "InternalIonCount" + }; Assert.AreEqual(expectedTrainingInfoTopDown, trainingInfoTopDown); - List positiveAttributes = new List { "TotalMatchingFragmentCount", "Intensity", "PrecursorChargeDiffToMode", "DeltaScore", "LongestFragmentIonSeries", "ComplementaryIonCount", "AlphaIntensity", "BetaIntensity", "LongestFragmentIonSeries_Alpha", "LongestFragmentIonSeries_Beta" }; - List negativeAttributes = new List { "Notch", "ModsCount", "AbsoluteAverageFragmentMassErrorFromMedian", "MissedCleavagesCount", "Ambiguity", "HydrophobicityZScore", "IsVariantPeptide", "IsDeadEnd", "IsLoop", "IsInter", "IsIntra" }; + List positiveAttributes = new List + { + "TotalMatchingFragmentCount", "Intensity", "PrecursorChargeDiffToMode", "DeltaScore", + "LongestFragmentIonSeries", "ComplementaryIonCount", "AlphaIntensity", "BetaIntensity", + "LongestFragmentIonSeries_Alpha", "LongestFragmentIonSeries_Beta", "PeaksInPrecursorEnvelope", + "MostAbundantPrecursorPeakIntensity", "PrecursorFractionalIntensity", "InternalIonCount" + }; + List negativeAttributes = new List + { + "Notch", "ModsCount", "AbsoluteAverageFragmentMassErrorFromMedian", "MissedCleavagesCount", "Ambiguity", + "HydrophobicityZScore", "IsVariantPeptide", "IsDeadEnd", "IsLoop", "IsInter", "IsIntra", "ChimeraCount" + }; foreach (string attribute in positiveAttributes) { @@ -684,13 +706,18 @@ public static void TestPsmData() IsIntra = 20, Label = false, SpectralAngle = 21, - HasSpectralAngle = 22 + HasSpectralAngle = 22, + PeaksInPrecursorEnvelope = 23, + ChimeraCount = 24, + MostAbundantPrecursorPeakIntensity = 25, + PrecursorFractionalIntensity = 26, + InternalIonCount = 27, }; string standardToString = "\t0\t1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t17\t18\t21\t22"; Assert.AreEqual(standardToString, pd.ToString("standard")); - string topDownToString = "\t0\t1\t2\t3\t4\t5\t6\t8\t9\t10\t21\t22"; + string topDownToString = "\t0\t1\t2\t3\t4\t5\t6\t8\t9\t10\t21\t22\t23\t24\t25\t26\t27"; Assert.AreEqual(topDownToString, pd.ToString("top-down")); } }