Exemple #1
0
        public void SetAromaticity()
        {
            SMARTSQueryTool sqt = new SMARTSQueryTool("[a]", ChemObjectBuilder.Instance);

            IAtomContainer furan = CreateFromSmiles("O1C=CC=C1");

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(furan);

            sqt.SetAromaticity(new Aromaticity(ElectronDonation.CDKModel, Cycles.MCBFinder));
            Assert.IsTrue(sqt.Matches(furan, true));

            sqt.SetAromaticity(new Aromaticity(ElectronDonation.PiBondsModel, Cycles.MCBFinder));
            Assert.IsFalse(sqt.Matches(furan, true));
        }
 static void Main()
 {
     {
         #region
         SmilesParser    sp            = new SmilesParser();
         IAtomContainer  atomContainer = sp.ParseSmiles("CC(=O)OC(=O)C");
         SMARTSQueryTool querytool     = new SMARTSQueryTool("O=CO");
         bool            status        = querytool.Matches(atomContainer);
         if (status)
         {
             int nmatch   = querytool.MatchesCount;
             var mappings = querytool.GetMatchingAtoms();
             foreach (var atomIndices in mappings)
             {
                 // do something
             }
         }
         #endregion
     }
     {
         string someSmartsPattern = null;
         IChemObjectSet <IAtomContainer> molecules = null;
         #region SetAromaticity
         SMARTSQueryTool sqt = new SMARTSQueryTool(someSmartsPattern);
         sqt.SetAromaticity(new Aromaticity(ElectronDonation.CDKModel, Cycles.CDKAromaticSetFinder));
         foreach (var molecule in molecules)
         {
             // CDK Aromatic model needs atom types
             AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(molecule);
             sqt.Matches(molecule);
         }
         #endregion
     }
 }
Exemple #3
0
        public void NullAromaticity()
        {
            SMARTSQueryTool sqt = new SMARTSQueryTool("CC", ChemObjectBuilder.Instance);

            sqt.SetAromaticity(null);
        }
        public void NullAromaticity()
        {
            SMARTSQueryTool sqt = new SMARTSQueryTool("CC");

            sqt.SetAromaticity(null);
        }