Esempio n. 1
0
        public void TestRecursive29_cdkAromaticModel()
        {
            SMARTSQueryTool sqt = CreateFromSmarts("[NX3;H2,H1;!$(NC=O)]");
            IAtomContainer  smi = CreateFromSmiles("Cc1cc(=O)c(c[nH]1)C(=O)NC(c1ccc(cc1)O)C(=O)NC1C(=O)N2C1SCC(=C2C(=O)O)CSc1nnnn1C");

            sqt.SetAromaticity(new Aromaticity(ElectronDonation.CDKModel, Cycles.CDKAromaticSetFinder));
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(smi);
            int[] result = SMARTSSearchTest.Match(sqt, smi);
            Assert.AreEqual(1, result[0]);
            Assert.AreEqual(1, result[1]);
        }
Esempio n. 2
0
        public void TestRecursiveSmarts27_cdkAromaticModel()
        {
            SMARTSQueryTool sqt = CreateFromSmarts("[NX3;H2,H1;!$(NC=O)]");
            IAtomContainer  smi = CreateFromSmiles("CCCc1nc(c2n1[nH]c(nc2=O)c1cc(ccc1OCC)S(=O)(=O)N1CCN(CC1)CC)C");

            sqt.SetAromaticity(new Aromaticity(ElectronDonation.CDKModel, Cycles.CDKAromaticSetFinder));
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(smi);
            int[] result = SMARTSSearchTest.Match(sqt, smi);
            Assert.AreEqual(1, result[0]);
            Assert.AreEqual(1, result[1]);
        }
Esempio n. 3
0
        public void TestBasicAmineOnDrugs_cdkAromaticModel()
        {
            var filename = "drugs.smi";
            var ins      = ResourceLoader.GetAsStream(GetType(), filename);

            using (EnumerableSMILESReader reader = new EnumerableSMILESReader(ins, ChemObjectBuilder.Instance))
            {
                SMARTSQueryTool sqt = new SMARTSQueryTool("[NX3;H2,H1;!$(NC=O)]", ChemObjectBuilder.Instance);
                sqt.SetAromaticity(new Aromaticity(ElectronDonation.CDKModel, Cycles.CDKAromaticSetFinder));
                int nmatch = 0;
                int nmol   = 0;
                foreach (var container in reader)
                {
                    AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(container);

                    // skip un-typed atoms, they can't be run through the CDK aromatic
                    // model
                    foreach (var atom in container.Atoms)
                    {
                        if (atom.AtomTypeName == null)
                        {
                            goto continue_READ;
                        }
                    }

                    if (sqt.Matches(container))
                    {
                        nmatch++;
                    }
                    nmol++;
continue_READ:
                    ;
                }
                Assert.AreEqual(141, nmol);
                Assert.AreEqual(4, nmatch);
            }
        }