public void AddModification(StaticMod mod, IsotopeLabelType labelType)
 {
     if (MatcherPepMods.GetModificationTypes().Contains(labelType))
     {
         var newMods = MatcherPepMods.GetModifications(labelType)
                       .Where(existingMod => !existingMod.Equivalent(mod)).ToList();
         newMods.Add(mod);
         MatcherPepMods = MatcherPepMods.ChangeModifications(labelType, newMods);
     }
     else if (labelType.IsLight)
     {
         MatcherPepMods =
             new PeptideModifications(new List <StaticMod> {
             mod
         }, MatcherPepMods.GetHeavyModifications().ToArray());
     }
     else
     {
         var typedHeavyMods =
             new List <TypedModifications>(MatcherPepMods.GetHeavyModifications())
         {
             new TypedModifications(labelType, new List <StaticMod> {
                 mod
             })
         };
         MatcherPepMods = new PeptideModifications(MatcherPepMods.StaticModifications, typedHeavyMods);
     }
     MatchesUpdated = true;
 }
 public void RemoveModification(StaticMod mod, IsotopeLabelType labelType)
 {
     if (MatcherPepMods.GetModificationTypes().Contains(labelType))
     {
         var newMods = MatcherPepMods.GetModifications(labelType)
                       .Where(existingMod => !existingMod.Equivalent(mod)).ToArray();
         MatcherPepMods = MatcherPepMods.ChangeModifications(labelType, newMods);
     }
     MatchesUpdated = true;
 }