Exemple #1
0
        public void TestFingerprint()
        {
            var            parser  = CDK.SmilesParser;
            IFingerprinter printer = new GraphOnlyFingerprinter();

            IBitFingerprint bs1 = printer.GetBitFingerprint(parser.ParseSmiles("C=C-C#N"));
            IBitFingerprint bs2 = printer.GetBitFingerprint(parser.ParseSmiles("CCCN"));

            Assert.AreEqual(bs1, bs2);
        }
Exemple #2
0
        public void TestFingerPrint()
        {
            IFingerprinter printer = new GraphOnlyFingerprinter();

            IAtomContainer mol1 = CreateMolecule(molecule_test_2);
            IAtomContainer mol2 = CreateMolecule(ethanolamine);

            Assert.IsTrue(new UniversalIsomorphismTester().IsSubgraph(mol1, mol2), "SubGraph does NOT match");

            BitArray bs1 = printer.GetBitFingerprint((IAtomContainer)mol1.Clone()).AsBitSet();
            BitArray bs2 = printer.GetBitFingerprint((IAtomContainer)mol2.Clone()).AsBitSet();

            Assert.IsTrue(FingerprinterTool.IsSubset(bs1, bs2), "Subset (with fingerprint) does NOT match");

            // Match OK
            Debug.WriteLine("Subset (with fingerprint) does match");
        }