Пример #1
0
        public void TestSMSDAdpAtpSubgraph()
        {
            var    sp   = CDK.SmilesParser;
            string adp  = "NC1=NC=NC2=C1N=CN2[C@@H]1O[C@H](COP(O)(=O)OP(O)(O)=O)[C@@H](O)[C@H]1O";
            string atp  = "NC1=NC=NC2=C1N=CN2[C@@H]1O[C@H](COP(O)(=O)OP(O)(=O)OP(O)(O)=O)[C@@H](O)[C@H]1O";
            var    mol1 = sp.ParseSmiles(adp);
            var    mol2 = sp.ParseSmiles(atp);

            ExtAtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol1);
            ExtAtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol2);

            //    Calling the main algorithm to perform MCS cearch

            Aromaticity.CDKLegacy.Apply(mol1);
            Aromaticity.CDKLegacy.Apply(mol2);

            bool bondSensitive        = true;
            bool removeHydrogen       = true;
            bool stereoMatch          = true;
            bool fragmentMinimization = true;
            bool energyMinimization   = true;

            Isomorphism comparison = new Isomorphism(Algorithm.Default, bondSensitive);

            comparison.Init(mol1, mol2, removeHydrogen, true);
            comparison.SetChemFilters(stereoMatch, fragmentMinimization, energyMinimization);

            //      Get modified Query and Target Molecules as Mappings will correspond to these molecules
            Assert.IsTrue(comparison.IsSubgraph());
            Assert.AreEqual(2, comparison.GetAllMapping().Count);
            Assert.AreEqual(27, comparison.GetFirstMapping().Count);
        }
Пример #2
0
        public void TestSMSDChemicalFilters()
        {
            Isomorphism ebimcs = new Isomorphism(Algorithm.Default, false);

            ebimcs.Init(Cyclohexane, Benzene, true, true);
            ebimcs.SetChemFilters(true, true, true);
            Assert.AreEqual(12, ebimcs.GetAllMapping().Count);
            Assert.IsTrue(ebimcs.IsSubgraph());
        }
Пример #3
0
        public void TestSMSDChemicalFilters()
        {
            Isomorphism ebimcs1 = new Isomorphism(Algorithm.Default, true);

            ebimcs1.Init(Napthalene, Benzene, true, true);
            ebimcs1.SetChemFilters(true, true, true);
            Assert.AreEqual(6, ebimcs1.GetAllMapping().Count);
            Assert.IsFalse(ebimcs1.IsSubgraph());
        }
Пример #4
0
        public void TestGetAllMapping()
        {
            var sp      = new SmilesParser(ChemObjectBuilder.Instance, false);
            var target  = sp.ParseSmiles("C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C");
            var queryac = sp.ParseSmiles("Nc1ccccc1");

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(target);
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(queryac);
            Aromaticity.CDKLegacy.Apply(target);
            Aromaticity.CDKLegacy.Apply(queryac);

            Isomorphism smsd1 = new Isomorphism(Algorithm.Default, true);

            smsd1.Init(queryac, target, true, true);
            smsd1.SetChemFilters(true, true, true);
            Assert.IsNotNull(smsd1.GetFirstMapping());

            Assert.AreEqual(2, smsd1.GetAllMapping().Count);
        }
Пример #5
0
        public void TestSingleMappingTesting()
        {
            var sp            = CDK.SmilesParser;
            var atomContainer = sp.ParseSmiles("C");

            IAtomContainer mol2 = Create4Toluene();

            ExtAtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol2);
            Aromaticity.CDKLegacy.Apply(mol2);

            bool bondSensitive        = false;
            bool removeHydrogen       = true;
            bool stereoMatch          = false;
            bool fragmentMinimization = false;
            bool energyMinimization   = false;

            Isomorphism comparison = new Isomorphism(Algorithm.Default, bondSensitive);

            comparison.Init(atomContainer, mol2, removeHydrogen, true);
            comparison.SetChemFilters(stereoMatch, fragmentMinimization, energyMinimization);

            Assert.IsTrue(comparison.IsSubgraph());
            Assert.AreEqual(7, comparison.GetAllMapping().Count);
        }