Example #1
0
        public void Match(string smarts, string smiles)
        {
            SMARTSQueryTool sqt           = new SMARTSQueryTool(smarts, ChemObjectBuilder.Instance);
            var             sp            = CDK.SmilesParser;
            var             atomContainer = sp.ParseSmiles(smiles);

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(atomContainer);
            Aromaticity.CDKLegacy.Apply(atomContainer);
            bool status = sqt.Matches(atomContainer);

            if (status)
            {
                nmatch  = sqt.MatchesCount;
                nqmatch = sqt.GetUniqueMatchingAtoms().Count();
            }
            else
            {
                nmatch  = 0;
                nqmatch = 0;
            }
        }
Example #2
0
 static void AssertMatch(SMARTSQueryTool sqt, IAtomContainer m, int hits, int usaHits)
 {
     sqt.Matches(m);
     Assert.AreEqual(hits, sqt.GetMatchingAtoms().Count());
     Assert.AreEqual(usaHits, sqt.GetUniqueMatchingAtoms().Count());
 }