Пример #1
0
        public void TestCheckAndCleanMolecule()
        {
            string         fragmentMolSmiles = "C1=CC=CC=C1.C1=CC2=C(C=C1)C=CC=C2";
            var            sp        = CDK.SmilesParser;
            var            molecule  = sp.ParseSmiles(fragmentMolSmiles);
            var            expResult = sp.ParseSmiles("C1=CC2=C(C=C1)C=CC=C2");
            IAtomContainer result    = MoleculeSanityCheck.CheckAndCleanMolecule(molecule);

            Assert.AreEqual(expResult.Bonds.Count, result.Bonds.Count);
        }
Пример #2
0
        public void TestFixAromaticity()
        {
            string rawMolSmiles = "C1=CC2=C(C=C1)C=CC=C2";
            var    sp           = CDK.SmilesParser;
            var    mol          = sp.ParseSmiles(rawMolSmiles);

            MoleculeSanityCheck.CheckAndCleanMolecule(mol);
            int count = 0;

            foreach (var b in mol.Bonds)
            {
                if (b.IsAromatic && b.Order.Equals(BondOrder.Double))
                {
                    count++;
                }
            }
            Assert.AreEqual(5, count);
        }