use of org.openscience.cdk.fingerprint.LingoFingerprinter in project cdk by cdk.
the class LingoSimilarityTest method testLingoSim.
@Test
public void testLingoSim() throws Exception {
IAtomContainer mol1 = TestMoleculeFactory.makeIndole();
IAtomContainer mol2 = TestMoleculeFactory.makeIndole();
addImplicitHydrogens(mol1);
addImplicitHydrogens(mol2);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol1);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol2);
LingoFingerprinter fingerprinter = new LingoFingerprinter();
Map<String, Integer> bs1 = fingerprinter.getRawFingerprint(mol1);
Map<String, Integer> bs2 = fingerprinter.getRawFingerprint(mol2);
float lingosim = LingoSimilarity.calculate(bs1, bs2);
Assert.assertEquals(1.0, lingosim, 0.01);
}
use of org.openscience.cdk.fingerprint.LingoFingerprinter in project cdk by cdk.
the class TanimotoTest method testExactMatch.
@Test
public void testExactMatch() throws Exception {
IAtomContainer mol1 = TestMoleculeFactory.makeIndole();
IAtomContainer mol2 = TestMoleculeFactory.makeIndole();
addImplicitHydrogens(mol1);
addImplicitHydrogens(mol2);
LingoFingerprinter fingerprinter = new LingoFingerprinter();
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol1);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol2);
Map<String, Integer> feat1 = fingerprinter.getRawFingerprint(mol1);
Map<String, Integer> feat2 = fingerprinter.getRawFingerprint(mol2);
float tanimoto = Tanimoto.calculate(feat1, feat2);
Assert.assertEquals(1.0, tanimoto, 0.001);
}
Aggregations