public override IEnumerable <AAModInfo> GetCurrentSequenceInfos() { int prevIndexAA = -1; bool prevHeavy = false; int countModsPerAA = 0; foreach (var info in EnumerateSequenceInfos(_sequences.Current ?? string.Empty, false)) { int indexAA = info.IndexAA; countModsPerAA = prevIndexAA != indexAA ? 1 : countModsPerAA + 1; bool tooManyMods = countModsPerAA > 1 && prevHeavy == info.UserIndicatedHeavy; prevIndexAA = indexAA; prevHeavy = info.UserIndicatedHeavy; if (!tooManyMods) { yield return(info); } else { var unmatchedSeq = GetSeqModUnmatchedStr(info.IndexAAInSeq); if (!UnmatchedSequences.Contains(unmatchedSeq)) { UnmatchedSequences.Add(unmatchedSeq); } } } }
public override void UpdateMatcher(AAModInfo info, AAModMatch?match) { if (match == null) { var unmatchedSeq = GetSeqModUnmatchedStr(info.IndexAAInSeq); if (!UnmatchedSequences.Contains(unmatchedSeq)) { UnmatchedSequences.Add(unmatchedSeq); } } }
public override void UpdateMatcher(AAModInfo info, AAModMatch?match) { // Update unmatched sequences. if (match == null && !UnmatchedSequences.Contains(info.ModKey.ToString())) { UnmatchedSequences.Add(info.ModKey.ToString()); } if (match == null || match.Value.StructuralMod == null) { return; } // Update the conflicting mod array. if (!string.IsNullOrEmpty(match.Value.StructuralMod.AAs)) { AddConflictKey((byte)info.AA, info.Terminus, false); } if (info.Terminus != null) { AddConflictKey(null, info.Terminus, false); } }