Пример #1
0
        public void TestSet_IAtomContainer_IAtomContainer()
        {
            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");

            VFlibSubStructureHandler smsd1 = new VFlibSubStructureHandler();
            MolHandler mol1 = new MolHandler(queryac, true, true);
            MolHandler mol2 = new MolHandler(target, true, true);

            smsd1.Set(mol1, mol2);
            Assert.IsTrue(smsd1.IsSubgraph(true));
        }
Пример #2
0
        public void TestSet_MolHandler_MolHandler()
        {
            var sp = CDK.SmilesParser;

            var        target1 = sp.ParseSmiles("C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C");
            var        queryac = sp.ParseSmiles("Nc1ccccc1");
            MolHandler source  = new MolHandler(queryac, true, true);
            MolHandler target  = new MolHandler(target1, true, true);
            VFlibSubStructureHandler instance = new VFlibSubStructureHandler();

            instance.Set(source, target);
            Assert.IsTrue(instance.IsSubgraph(true));
        }
Пример #3
0
        public void TestGetFirstMapping()
        {
            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");

            VFlibSubStructureHandler smsd1 = new VFlibSubStructureHandler();
            MolHandler mol1 = new MolHandler(queryac, true, true);
            MolHandler mol2 = new MolHandler(target, true, true);

            smsd1.Set(mol1, mol2);
            smsd1.IsSubgraph(true);

            Assert.AreEqual(7, smsd1.GetFirstMapping().Count);
        }
Пример #4
0
        public void TestSet_String_String()
        {
            string         molfile   = "NCDK.Data.MDL.decalin.mol";
            string         queryfile = "NCDK.Data.MDL.decalin.mol";
            IAtomContainer query     = new AtomContainer();
            IAtomContainer target    = new AtomContainer();

            var ins    = ResourceLoader.GetAsStream(molfile);
            var reader = new MDLV2000Reader(ins, ChemObjectReaderMode.Strict);

            reader.Read(query);
            ins    = ResourceLoader.GetAsStream(queryfile);
            reader = new MDLV2000Reader(ins, ChemObjectReaderMode.Strict);
            reader.Read(target);

            VFlibSubStructureHandler smsd1 = new VFlibSubStructureHandler();
            MolHandler mol1 = new MolHandler(query, true, true);
            MolHandler mol2 = new MolHandler(target, true, true);

            smsd1.Set(mol1, mol2);
            Assert.IsTrue(smsd1.IsSubgraph(true));
        }