Exemple #1
0
        public void TestLingoSim()
        {
            var mol1 = TestMoleculeFactory.MakeIndole();
            var mol2 = TestMoleculeFactory.MakeIndole();

            AddImplicitHydrogens(mol1);
            AddImplicitHydrogens(mol2);
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol1);
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol2);
            var fingerprinter = new LingoFingerprinter();
            var bs1           = fingerprinter.GetRawFingerprint(mol1);
            var bs2           = fingerprinter.GetRawFingerprint(mol2);
            var lingosim      = LingoSimilarity.Calculate(bs1, bs2);

            Assert.AreEqual(1.0, lingosim, 0.01);
        }
Exemple #2
0
        public void TestExactMatch()
        {
            IAtomContainer mol1 = TestMoleculeFactory.MakeIndole();
            IAtomContainer mol2 = TestMoleculeFactory.MakeIndole();

            AddImplicitHydrogens(mol1);
            AddImplicitHydrogens(mol2);
            var fingerprinter = new LingoFingerprinter();

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol1);
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol2);
            var feat1    = fingerprinter.GetRawFingerprint(mol1);
            var feat2    = fingerprinter.GetRawFingerprint(mol2);
            var tanimoto = Tanimoto.Calculate(feat1, feat2);

            Assert.AreEqual(1.0, tanimoto, 0.001);
        }