Skip to content

Commit 866d6d2

Browse files
authored
Merge branch 'master' into RnaTaskAndGUI
2 parents 53d3002 + 6e70a05 commit 866d6d2

File tree

13 files changed

+86
-80
lines changed

13 files changed

+86
-80
lines changed

MetaMorpheus/CMD/CMD.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<PackageReference Include="Microsoft.ML.CpuMath" Version="3.0.1" />
2525
<PackageReference Include="Microsoft.ML.FastTree" Version="3.0.1" />
2626
<PackageReference Include="Microsoft.NETCore.App" Version="2.2.8" />
27-
<PackageReference Include="mzLib" Version="1.0.569" />
27+
<PackageReference Include="mzLib" Version="1.0.571" />
2828
<PackageReference Include="Nett" Version="0.15.0" />
2929
<PackageReference Include="SQLite.Interop.dll" Version="1.0.103" />
3030
<PackageReference Include="System.Data.SQLite" Version="1.0.118" />

MetaMorpheus/EngineLayer/EngineLayer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<PackageReference Include="Microsoft.ML.CpuMath" Version="3.0.1" />
3030
<PackageReference Include="Microsoft.ML.FastTree" Version="3.0.1" />
3131
<PackageReference Include="Microsoft.NETCore.App" Version="2.2.8" />
32-
<PackageReference Include="mzLib" Version="1.0.569" />
32+
<PackageReference Include="mzLib" Version="1.0.571" />
3333
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
3434
<PackageReference Include="Nett" Version="0.15.0" />
3535
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

MetaMorpheus/EngineLayer/GlycoSearch/GlycoSpectralMatch.cs

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -124,37 +124,38 @@ public static bool MotifExist(string baseSeq, string[] motifs)
124124
public static string GetTabSepHeaderSingle() //Most complicate part in this class
125125
{
126126
var sb = new StringBuilder();
127-
sb.Append("File Name" + '\t');
128-
sb.Append("Scan Number" + '\t');
129-
sb.Append("Retention Time" + '\t');
130-
sb.Append("Precursor Scan Number" + '\t');
131-
sb.Append("Precursor MZ" + '\t');
132-
sb.Append("Precursor Charge" + '\t');
133-
sb.Append("Precursor Mass" + '\t');
134-
135-
sb.Append("Protein Accession" + '\t');
136-
sb.Append("Organism" + '\t');
137-
sb.Append("Protein Name" + '\t');
138-
sb.Append("Start and End Residues In Protein" + '\t');
139-
sb.Append("Base Sequence" + '\t');
140-
sb.Append("FlankingResidues" + '\t');
141-
sb.Append("Full Sequence" + '\t');
142-
sb.Append("Number of Mods" + '\t');
143-
sb.Append("Peptide Monoisotopic Mass" + '\t');
144-
sb.Append("Score" + '\t');
145-
sb.Append("Rank" + '\t');
146-
147-
sb.Append("Matched Ion Series" + '\t');
148-
sb.Append("Matched Ion Mass-To-Charge Ratios" + '\t');
149-
sb.Append("Matched Ion Mass Diff (Da)" + '\t');
150-
sb.Append("Matched Ion Mass Diff (Ppm)" + '\t');
151-
sb.Append("Matched Ion Intensities" + '\t');
152-
153-
sb.Append("Matched Ion Counts" + '\t');
154-
sb.Append("Decoy/Contaminant/Target" + '\t');
155-
sb.Append("QValue" + '\t');
156-
sb.Append("PEP" + '\t');
157-
sb.Append("PEP_QValue");
127+
sb.Append(SpectrumMatchFromTsvHeader.FileName + '\t');
128+
sb.Append(SpectrumMatchFromTsvHeader.Ms2ScanNumber + '\t');
129+
sb.Append(SpectrumMatchFromTsvHeader.Ms2ScanRetentionTime + '\t');
130+
sb.Append(SpectrumMatchFromTsvHeader.PrecursorScanNum + '\t');
131+
sb.Append(SpectrumMatchFromTsvHeader.PrecursorMz + '\t');
132+
sb.Append(SpectrumMatchFromTsvHeader.PrecursorCharge + '\t');
133+
sb.Append(SpectrumMatchFromTsvHeader.PrecursorMass + '\t');
134+
135+
sb.Append(SpectrumMatchFromTsvHeader.ProteinAccession + '\t');
136+
sb.Append(SpectrumMatchFromTsvHeader.OrganismName + '\t');
137+
sb.Append(SpectrumMatchFromTsvHeader.ProteinName + '\t');
138+
sb.Append(SpectrumMatchFromTsvHeader.MissedCleavages + '\t');
139+
sb.Append(SpectrumMatchFromTsvHeader.StartAndEndResiduesInProtein + '\t');
140+
sb.Append(SpectrumMatchFromTsvHeader.BaseSequence + '\t');
141+
sb.Append(SpectrumMatchFromTsvHeader.FlankingResidues + '\t');
142+
sb.Append(SpectrumMatchFromTsvHeader.FullSequence + '\t');
143+
sb.Append(SpectrumMatchFromTsvHeader.NumberOfMods + '\t');
144+
sb.Append(SpectrumMatchFromTsvHeader.PeptideMonoMass + '\t');
145+
sb.Append(SpectrumMatchFromTsvHeader.Score + '\t');
146+
sb.Append(SpectrumMatchFromTsvHeader.RankLabel + '\t');
147+
148+
sb.Append(SpectrumMatchFromTsvHeader.MatchedIonSeries + '\t');
149+
sb.Append(SpectrumMatchFromTsvHeader.MatchedIonMzRatios + '\t');
150+
sb.Append(SpectrumMatchFromTsvHeader.MatchedIonMassDiffDa + '\t');
151+
sb.Append(SpectrumMatchFromTsvHeader.MatchedIonMassDiffPpm + '\t');
152+
sb.Append(SpectrumMatchFromTsvHeader.MatchedIonIntensities + '\t');
153+
154+
sb.Append(SpectrumMatchFromTsvHeader.MatchedIonCounts + '\t');
155+
sb.Append(SpectrumMatchFromTsvHeader.DecoyContaminantTarget + '\t');
156+
sb.Append(SpectrumMatchFromTsvHeader.QValue + '\t');
157+
sb.Append(SpectrumMatchFromTsvHeader.PEP + '\t');
158+
sb.Append(SpectrumMatchFromTsvHeader.PEP_QValue);
158159

159160
return sb.ToString();
160161
}
@@ -166,22 +167,23 @@ public static string GetTabSepHeaderSingle() //Most complicate part in this clas
166167
public static string GetTabSeperatedHeaderGlyco()
167168
{
168169
var sb = new StringBuilder();
170+
169171
sb.Append("\t");//provides the separation needed from GetTabSepHeaderSingle()
170-
sb.Append("Localization Score" + '\t');
171-
sb.Append("Yion Score" + '\t');
172-
sb.Append("DiagonosticIon Score" + '\t');
173-
sb.Append("Plausible Number Of Glycans" + '\t');//Not used for N-Glyco
174-
sb.Append("Total Glycosylation sites" + '\t');//Not used for N-Glyco
175-
sb.Append("GlycanMass" + '\t');
176-
sb.Append("Plausible GlycanComposition" + '\t');
177-
sb.Append("N-Glycan motif Check" + '\t');//Not used for N-Glyco
178-
sb.Append("R138/144" + '\t');
179-
sb.Append("Plausible GlycanStructure" + '\t');
180-
sb.Append("GlycanLocalizationLevel" + '\t');
181-
sb.Append("Localized Glycans with Peptide Site Specific Probability" + '\t');
182-
sb.Append("Localized Glycans with Protein Site Specific Probability" + '\t');
183-
sb.Append("All potential glycan localizations" + '\t');//Not used for N-Glyco
184-
sb.Append("AllSiteSpecificLocalizationProbability");//Not used for N-Glyco
172+
sb.Append(SpectrumMatchFromTsvHeader.LocalizationScore + '\t');
173+
sb.Append(SpectrumMatchFromTsvHeader.YionScore + '\t');
174+
sb.Append(SpectrumMatchFromTsvHeader.DiagonosticIonScore + '\t');
175+
sb.Append(SpectrumMatchFromTsvHeader.NumberOfGlycan + '\t');//Not used for N-Glyco
176+
sb.Append(SpectrumMatchFromTsvHeader.TotalGlycanSite + '\t');//Not used for N-Glyco
177+
sb.Append(SpectrumMatchFromTsvHeader.GlycanMass + '\t');
178+
sb.Append(SpectrumMatchFromTsvHeader.GlycanComposition + '\t');
179+
sb.Append(SpectrumMatchFromTsvHeader.NGlycanMotifCheck + '\t');//Not used for N-Glyco
180+
sb.Append(SpectrumMatchFromTsvHeader.R138144 + '\t');
181+
sb.Append(SpectrumMatchFromTsvHeader.GlycanStructure + '\t');
182+
sb.Append(SpectrumMatchFromTsvHeader.GlycanLocalizationLevel + '\t');
183+
sb.Append(SpectrumMatchFromTsvHeader.LocalizedGlycanInPeptide + '\t');
184+
sb.Append(SpectrumMatchFromTsvHeader.LocalizedGlycanInProtein + '\t');
185+
sb.Append(SpectrumMatchFromTsvHeader.AllPotentialGlycanLocalization + '\t');//Not used for N-Glyco
186+
sb.Append(SpectrumMatchFromTsvHeader.AllSiteSpecificLocalizationProbability);//Not used for N-Glyco
185187

186188
return sb.ToString();
187189
}
@@ -205,6 +207,7 @@ public string SingleToString()
205207
sb.Append(proteinAccessionString + "\t");
206208
sb.Append(Organism + "\t");
207209
sb.Append(PsmTsvWriter.Resolve(BestMatchingBioPolymersWithSetMods.Select(b => b.SpecificBioPolymer.Parent.FullName), FullSequence).ResolvedString + "\t"); //protein name
210+
sb.Append(PsmTsvWriter.Resolve(BestMatchingBioPolymersWithSetMods.Select(b => b.SpecificBioPolymer.MissedCleavages)).ResolvedString + "\t");
208211
int _FirstOneBasedStartResidueInProtein = OneBasedStartResidue.HasValue ? OneBasedStartResidue.Value : BestMatchingBioPolymersWithSetMods.First().SpecificBioPolymer.OneBasedStartResidue;
209212
int _FirstOneBasedEndResidueInProtein = OneBasedEndResidue.HasValue ? OneBasedEndResidue.Value : BestMatchingBioPolymersWithSetMods.First().SpecificBioPolymer.OneBasedEndResidue; ;
210213

MetaMorpheus/GUI/GUI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<PackageReference Include="Microsoft.ML.CpuMath" Version="3.0.1" />
6464
<PackageReference Include="Microsoft.ML.FastTree" Version="3.0.1" />
6565
<PackageReference Include="Microsoft.NETCore.App" Version="2.2.8" />
66-
<PackageReference Include="mzLib" Version="1.0.569" />
66+
<PackageReference Include="mzLib" Version="1.0.571" />
6767
<PackageReference Include="Nett" Version="0.15.0" />
6868
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
6969
<PackageReference Include="OxyPlot.Core" Version="2.0.0" />

MetaMorpheus/GuiFunctions/GuiFunctions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<ItemGroup>
1717
<PackageReference Include="itext7" Version="8.0.5" />
1818
<PackageReference Include="itext7.bouncy-castle-adapter" Version="8.0.5" />
19-
<PackageReference Include="mzLib" Version="1.0.569" />
19+
<PackageReference Include="mzLib" Version="1.0.571" />
2020
<PackageReference Include="OxyPlot.Wpf" Version="2.0.0" />
2121
<PackageReference Include="Svg" Version="3.4.7" />
2222
</ItemGroup>

MetaMorpheus/GuiFunctions/MetaDraw/DrawnSequence.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ public static void AnnotateModifications(SpectrumMatchFromTsv spectrumMatch, Can
208208

209209
// read glycans if applicable
210210
List<Tuple<int, string, double>> localGlycans = null;
211-
if (spectrumMatch is PsmFromTsv { GlycanLocalizationLevel: not null } psm)
211+
if (spectrumMatch is GlycoPsmFromTsv { GlycanLocalizationLevel: not null } psm)
212212
{
213-
localGlycans = SpectrumMatchFromTsv.ReadLocalizedGlycan(psm.LocalizedGlycan);
213+
localGlycans = GlycoPsmFromTsv.ReadLocalizedGlycan(psm.LocalizedGlycanInPeptide);
214214
}
215215

216216
// annotate mods
@@ -227,7 +227,7 @@ public static void AnnotateModifications(SpectrumMatchFromTsv spectrumMatch, Can
227227

228228
if (mod.Value.ModificationType == "O-linked glycosylation")
229229
{
230-
if (localGlycans.Where(p => p.Item1 + 1 == mod.Key).Count() > 0)
230+
if (localGlycans?.Count(p => p.Item1 + 1 == mod.Key) > 0)
231231
{
232232
DrawCircle(sequenceDrawingCanvas, new Point(xLocation, yLocation), ParseColorBrushFromOxyColor(MetaDrawSettings.GetValueOrDefault(MetaDrawSettings.ModificationTypeToColor, mod.Value.IdWithMotif, OxyColors.Blue)));
233233
}

MetaMorpheus/GuiFunctions/MetaDraw/MetaDrawLogic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ public void FilterPsms()
720720
{
721721
FilteredListOfPsms.Clear();
722722

723-
foreach (var psm in AllSpectralMatches.Where(p => MetaDrawSettings.FilterAcceptsPsm(p)))
723+
foreach (var psm in AllSpectralMatches.Where(MetaDrawSettings.FilterAcceptsPsm))
724724
{
725725
FilteredListOfPsms.Add(psm);
726726
}

MetaMorpheus/GuiFunctions/MetaDraw/MetaDrawSettings.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ public static bool FilterAcceptsPsm(SpectrumMatchFromTsv sm)
142142
if (sm.QValue <= QValueFilter
143143
&& (sm.QValueNotch == null || sm.QValueNotch <= QValueFilter)
144144
&& (sm.DecoyContamTarget == "T" || (sm.DecoyContamTarget == "D" && ShowDecoys) || (sm.DecoyContamTarget == "C" && ShowContaminants))
145-
&& (!sm.IsCrossLinkedPeptide() || (sm is PsmFromTsv { BetaPeptideBaseSequence: not null } psm && (!psm.GlycanLocalizationLevel.HasValue || psm.GlycanLocalizationLevel.Value >= LocalizationLevelStart && psm.GlycanLocalizationLevel.Value <= LocalizationLevelEnd))))
145+
// Glyco localization level filtering - only applies to glyco psms that have localization levels
146+
&& (sm is not GlycoPsmFromTsv { GlycanLocalizationLevel: not null } gly || (gly.GlycanLocalizationLevel.Value >= LocalizationLevelStart && gly.GlycanLocalizationLevel.Value <= LocalizationLevelEnd)))
146147
{
147148
// Ambiguity filtering conditionals, should only be hit if Ambiguity Filtering is selected
148149
if (AmbiguityFilter == "No Filter" || sm.AmbiguityLevel == AmbiguityFilter)

MetaMorpheus/TaskLayer/TaskLayer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<PackageReference Include="Microsoft.ML.CpuMath" Version="3.0.1" />
2222
<PackageReference Include="Microsoft.ML.FastTree" Version="3.0.1" />
2323
<PackageReference Include="Microsoft.NETCore.App" Version="2.2.8" />
24-
<PackageReference Include="mzLib" Version="1.0.569" />
24+
<PackageReference Include="mzLib" Version="1.0.571" />
2525
<PackageReference Include="NetSerializer" Version="4.1.2" />
2626
<PackageReference Include="Nett" Version="0.15.0" />
2727
<PackageReference Include="SQLite.Interop.dll" Version="1.0.103" />

MetaMorpheus/Test/DIATests/TestXicGrouping.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,19 @@ public static void TestCorrelationCalculationWithSpline()
8585
var xic3 = new ExtractedIonChromatogram(peakList3);
8686

8787
//It should still return 1.0 for two perfectly aligned XICs (xic1 and xic2)
88-
var cubicSpline = new XicCubicSpline();
89-
cubicSpline.SetXicSplineXYData(xic1, true);
90-
cubicSpline.SetXicSplineXYData(xic2, true);
88+
var cubicSpline = new XicCubicSpline(scanIndexBased: true);
89+
cubicSpline.SetXicSplineXYData(xic1);
90+
cubicSpline.SetXicSplineXYData(xic2);
9191
var corr = PrecursorFragmentsGroup.CalculateXicCorrelation(xic1, xic2);
9292
Assert.That(corr, Is.EqualTo(1.0).Within(1e-6));
93-
var linearSpline = new XicLinearSpline();
94-
linearSpline.SetXicSplineXYData(xic1, true);
95-
linearSpline.SetXicSplineXYData(xic2, true);
93+
var linearSpline = new XicLinearSpline(scanIndexBased: true);
94+
linearSpline.SetXicSplineXYData(xic1);
95+
linearSpline.SetXicSplineXYData(xic2);
9696
corr = PrecursorFragmentsGroup.CalculateXicCorrelation(xic1, xic2);
9797
Assert.That(corr, Is.EqualTo(1.0).Within(1e-6));
9898

9999
//For the XICs with insufficient overlap points (xic1 and xic3), it should return NaN
100-
linearSpline.SetXicSplineXYData(xic3, true);
100+
linearSpline.SetXicSplineXYData(xic3);
101101
corr = PrecursorFragmentsGroup.CalculateXicCorrelation(xic1, xic3);
102102
Assert.That(corr, Is.NaN);
103103
}

0 commit comments

Comments
 (0)