Пример #1
0
        public void PeptideCountElements()
        {
            Peptide pep = new Peptide("G");

            pep.AddModification(new OldSchoolModification(1));
            Assert.AreEqual(5, pep.ElementCountWithIsotopes("H"));

            pep.AddModification(new OldSchoolChemicalFormulaModification(ChemicalFormula.ParseFormula("H{1}")));
            Assert.AreEqual(5, pep.ElementCountWithIsotopes("H")); // NOTHING HAS BEEN ADDED!

            pep.AddModification(new OldSchoolChemicalFormulaModification(ChemicalFormula.ParseFormula("H{1}"), ModificationSites.G));
            Assert.AreEqual(6, pep.ElementCountWithIsotopes("H"));

            Isotope isotope = PeriodicTable.GetElement("H").PrincipalIsotope;

            Assert.AreEqual(1, pep.SpecificIsotopeCount(isotope));
        }