Ejemplo n.º 1
0
        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);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void CreateMatches(SrmSettings settings, IEnumerable <string> sequences,
                           MappedList <string, StaticMod> defSetStatic, MappedList <string, StaticMod> defSetHeavy)
 {
     _sequences = sequences.GetEnumerator();
     InitMatcherSettings(settings, defSetStatic, defSetHeavy);
     if (UnmatchedSequences.Count > 0)
     {
         UnmatchedSequences.Sort();
         throw new FormatException(UninterpretedMods);
     }
 }
Ejemplo n.º 3
0
 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);
            }
        }