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

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

            Assert.AreEqual(79, printer.Length);

            Assert.IsTrue(bs1[7]);
            Assert.IsTrue(bs1[10]);
            Assert.IsTrue(FingerprinterTool.IsSubset(bs2.AsBitSet(), bs1.AsBitSet()));
        }
Example #2
0
        public override void TestBug706786()
        {
            IAtomContainer superStructure = Bug706786_1();
            IAtomContainer subStructure   = Bug706786_2();

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(superStructure);
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(subStructure);
            AddImplicitHydrogens(superStructure);
            AddImplicitHydrogens(subStructure);

            // SMARTS is now correct and D will include H atoms, CDK had this wrong
            // for years (had it has non-H count). Whilst you can set the optional
            // SMARTS flavor CDK_LEGACY this is not correct
            AtomContainerManipulator.SuppressHydrogens(superStructure);
            AtomContainerManipulator.SuppressHydrogens(subStructure);

            IFingerprinter  fpr       = new EStateFingerprinter();
            IBitFingerprint superBits = fpr.GetBitFingerprint(superStructure);
            IBitFingerprint subBits   = fpr.GetBitFingerprint(subStructure);

            Assert.IsTrue(BitArrays.Equals(AsBitSet(6, 11, 12, 15, 16, 18, 33, 34, 35), superBits.AsBitSet()));
            Assert.IsTrue(BitArrays.Equals(AsBitSet(8, 11, 16, 35), subBits.AsBitSet()));
        }
Example #3
0
        public void TestGetSize()
        {
            IFingerprinter printer = new EStateFingerprinter();

            Assert.AreEqual(79, printer.Length);
        }