Beispiel #1
0
        public void TestSMSD()
        {
            //        Isomorphism ebimcs = new Isomorphism(Algorithm.VFLibMCS, true);
            //        ebimcs.Init(Cyclohexane, Benzene, true, true);
            //        ebimcs.SetChemFilters(true, true, true);
            //        Assert.AreEqual(1, ebimcs.GetFirstMapping().Count);

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

            ebimcs1.Init(Benzene, Napthalene, true, true);
            ebimcs1.SetChemFilters(true, true, true);
            Assert.AreEqual(6, ebimcs1.GetFirstAtomMapping().Count);

            ebimcs1 = new Isomorphism(Algorithm.Default, false);
            ebimcs1.Init(Benzene, Napthalene, true, true);
            ebimcs1.SetChemFilters(true, true, true);
            Assert.AreEqual(6, ebimcs1.GetFirstAtomMapping().Count);

            ebimcs1 = new Isomorphism(Algorithm.VFLibMCS, true);
            ebimcs1.Init(Benzene, Napthalene, true, true);
            ebimcs1.SetChemFilters(true, true, true);
            Assert.AreEqual(6, ebimcs1.GetFirstAtomMapping().Count);

            ebimcs1 = new Isomorphism(Algorithm.CDKMCS, true);
            ebimcs1.Init(Benzene, Napthalene, true, true);
            ebimcs1.SetChemFilters(true, true, true);
            Assert.AreEqual(6, ebimcs1.GetFirstAtomMapping().Count);

            ebimcs1 = new Isomorphism(Algorithm.MCSPlus, true);
            ebimcs1.Init(Benzene, Napthalene, true, true);
            ebimcs1.SetChemFilters(true, true, true);
            Assert.AreEqual(6, ebimcs1.GetFirstAtomMapping().Count);
        }
Beispiel #2
0
        public void TestSMSDBondInSensitive()
        {
            Isomorphism ebimcs1 = new Isomorphism(Algorithm.Default, false);

            ebimcs1.Init(Cyclohexane, Benzene, true, true);
            ebimcs1.SetChemFilters(true, true, true);
            Assert.AreEqual(6, ebimcs1.GetFirstAtomMapping().Count);

            Isomorphism ebimcs2 = new Isomorphism(Algorithm.Default, false);

            ebimcs2.Init(Benzene, Napthalene, true, true);
            ebimcs2.SetChemFilters(true, true, true);
            Assert.AreEqual(6, ebimcs2.GetFirstAtomMapping().Count);
        }
Beispiel #3
0
        public void TestGetFirstAtomMapping()
        {
            var sp      = CDK.SmilesParser;
            var target  = sp.ParseSmiles("C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C");
            var queryac = sp.ParseSmiles("Nc1ccccc1");

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

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

            Assert.AreEqual(7, smsd1.GetFirstAtomMapping().Count);
        }
Beispiel #4
0
        public void TestSMSDBondSensitive()
        {
            Isomorphism ebimcs3 = new Isomorphism(Algorithm.CDKMCS, true);

            ebimcs3.Init(Cyclohexane, Benzene, true, true);
            ebimcs3.SetChemFilters(false, false, false);
            Assert.IsFalse(ebimcs3.IsSubgraph());

            Isomorphism ebimcs4 = new Isomorphism(Algorithm.CDKMCS, true);

            ebimcs4.Init(Benzene, Napthalene, true, true);
            ebimcs4.SetChemFilters(true, true, true);
            Assert.AreEqual(6, ebimcs4.GetFirstAtomMapping().Count);

            Isomorphism ebimcs5 = new Isomorphism(Algorithm.VFLibMCS, true);

            ebimcs5.Init(Cyclohexane, Benzene, true, true);
            ebimcs5.SetChemFilters(true, true, true);
            Assert.IsFalse(ebimcs5.IsSubgraph());

            Isomorphism ebimcs6 = new Isomorphism(Algorithm.VFLibMCS, true);

            ebimcs6.Init(Benzene, Napthalene, true, true);
            ebimcs6.SetChemFilters(true, true, true);
            Assert.AreEqual(6, ebimcs6.GetFirstAtomMapping().Count);

            Isomorphism ebimcs7 = new Isomorphism(Algorithm.MCSPlus, true);

            ebimcs7.Init(Cyclohexane, Benzene, true, true);
            ebimcs7.SetChemFilters(true, true, true);
            Assert.IsFalse(ebimcs7.IsSubgraph());

            Isomorphism ebimcs8 = new Isomorphism(Algorithm.MCSPlus, true);

            ebimcs8.Init(Benzene, Napthalene, true, true);
            ebimcs8.SetChemFilters(true, true, true);
            Assert.AreEqual(6, ebimcs8.GetFirstAtomMapping().Count);
        }
Beispiel #5
0
 public void TestSearchMCS()
 {
     try
     {
         var            sp     = new SmilesParser(ChemObjectBuilder.Instance, false);
         IAtomContainer target = null;
         target = sp.ParseSmiles("C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C");
         AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(target);
         var queryac = sp.ParseSmiles("Nc1ccccc1");
         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.AreEqual(7, smsd1.GetFirstAtomMapping().Count);
         Assert.AreEqual(2, smsd1.GetAllAtomMapping().Count);
         Assert.IsNotNull(smsd1.GetFirstMapping());
     }
     catch (InvalidSmilesException ex)
     {
         Trace.TraceError(ex.Message);
     }
 }