public int GenerateIsoforms(bool ignoreCTerminalMods = false) { PeptideIsoforms = new HashSet <PeptideIsoform>(); foreach (PeptideIsoform isoform in BasePeptide.GenerateIsoforms(true, VariabledModifications.ToArray()).Select(pep => new PeptideIsoform(pep, Spectrum, Charge))) { if (ignoreCTerminalMods) { IMass[] mods = isoform.GetModifications(); var cTerminalMod = mods[mods.Length - 2]; if (cTerminalMod is ModificationCollection) { var modCollection = cTerminalMod as ModificationCollection; if (modCollection.Any(mod => Lotor.QuantifiedModifications.Contains(mod))) { continue; } } else { if (Lotor.QuantifiedModifications.Contains(cTerminalMod)) { continue; } } } PeptideIsoforms.Add(isoform); } Isoforms = PeptideIsoforms.Count; return(Isoforms); }