Skip to content

Commit 9c02bdc

Browse files
committed
Fix for MzLib PR #939 failed integration tests
1 parent 6c817b6 commit 9c02bdc

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

MetaMorpheus/Test/MetaDraw/MetaDrawTest.cs

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -384,21 +384,13 @@ public static void MetaDraw_SearchTaskTest()
384384
// test that the stationary sequence annotation was drawn
385385
string modifiedBaseSeq = psm.BaseSeq.Substring(MetaDrawSettings.FirstAAonScreenIndex, MetaDrawSettings.NumberOfAAOnScreen);
386386
string fullSequence = psm.BaseSeq;
387-
Dictionary<int, List<string>> modDictionary = PsmFromTsv.ParseModifications(psm.FullSequence);
387+
Dictionary<int, string> modDictionary = PsmFromTsv.ParseModifications(psm.FullSequence);
388388
foreach (var mod in modDictionary.OrderByDescending(p => p.Key))
389389
{
390390
// if modification is within the visible region
391391
if (mod.Key >= MetaDrawSettings.FirstAAonScreenIndex && mod.Key < (MetaDrawSettings.FirstAAonScreenIndex + MetaDrawSettings.NumberOfAAOnScreen))
392392
{
393-
// account for multiple modifications on the same amino acid
394-
for (int i = mod.Value.Count - 1; i > -1; i--)
395-
{
396-
fullSequence = fullSequence.Insert(mod.Key - MetaDrawSettings.FirstAAonScreenIndex, "[" + mod.Value[i] + "]");
397-
if (i >= 1)
398-
{
399-
fullSequence = fullSequence.Insert(mod.Key, "|");
400-
}
401-
}
393+
fullSequence = fullSequence.Insert(mod.Key - MetaDrawSettings.FirstAAonScreenIndex, "[" + mod.Value + "]");
402394
}
403395
}
404396
List<MatchedFragmentIon> matchedIons = psm.MatchedIons.Where(p => p.NeutralTheoreticalProduct.ResiduePosition > MetaDrawSettings.FirstAAonScreenIndex &&
@@ -432,15 +424,7 @@ public static void MetaDraw_SearchTaskTest()
432424
// if modification is within the visible region
433425
if (mod.Key >= MetaDrawSettings.FirstAAonScreenIndex && mod.Key < (MetaDrawSettings.FirstAAonScreenIndex + MetaDrawSettings.NumberOfAAOnScreen))
434426
{
435-
// account for multiple modifications on the same amino acid
436-
for (int i = mod.Value.Count - 1; i > -1; i--)
437-
{
438-
fullSequence = fullSequence.Insert(mod.Key - MetaDrawSettings.FirstAAonScreenIndex, "[" + mod.Value[i] + "]");
439-
if (i >= 1)
440-
{
441-
fullSequence = fullSequence.Insert(mod.Key, "|");
442-
}
443-
}
427+
fullSequence = fullSequence.Insert(mod.Key - MetaDrawSettings.FirstAAonScreenIndex, "[" + mod.Value + "]");
444428
}
445429
}
446430
matchedIons = modPsm.MatchedIons.Where(p => p.NeutralTheoreticalProduct.ResiduePosition > MetaDrawSettings.FirstAAonScreenIndex &&

MetaMorpheus/Test/PsvTsvTest.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,8 @@ public static void TestParseModification()
174174
modDict = PsmFromTsv.ParseModifications(twoMods.FullSequence);
175175
Assert.That(modDict.Count == 2);
176176
Assert.That(modDict.ContainsKey(0) && modDict.ContainsKey(104));
177-
Assert.That(modDict[0].Count == 1);
178177
Assert.That(modDict[0].Contains("UniProt:N-acetylserine on S"));
179-
Assert.That(modDict[104].Count == 1);
180178
Assert.That(modDict[104].Contains("UniProt:N5-methylglutamine on Q"));
181-
182-
183-
// psm with two mods on the same amino acid
184-
string fullSeq = "[Common Fixed:Carbamidomethyl on C]|[UniProt:N-acetylserine on S]KPRKIEEIKDFLLTARRKDAKSVKIKKNKDNVKFK";
185-
modDict = PsmFromTsv.ParseModifications(fullSeq);
186-
Assert.That(modDict.Count == 1);
187-
Assert.That(modDict.ContainsKey(0));
188-
Assert.That(modDict[0].Count == 2);
189-
Assert.That(modDict[0].Contains("Common Fixed:Carbamidomethyl on C"));
190-
Assert.That(modDict[0].Contains("UniProt:N-acetylserine on S"));
191179
}
192180

193181
[Test]

0 commit comments

Comments
 (0)