use of org.openscience.cdk.fingerprint.IntArrayCountFingerprint in project cdk by cdk.
the class SignatureFingerprintTanimotoTest method testCountMethod1and2.
@Test
public void testCountMethod1and2() throws CDKException {
ICountFingerprint fp1 = new IntArrayCountFingerprint(new HashMap<String, Integer>() {
{
put("A", 3);
}
});
ICountFingerprint fp2 = new IntArrayCountFingerprint(new HashMap<String, Integer>() {
{
put("A", 4);
}
});
Assert.assertEquals(0.923, Tanimoto.method1(fp1, fp2), 0.001);
Assert.assertEquals(0.75, Tanimoto.method2(fp1, fp2), 0.001);
IAtomContainer mol1 = TestMoleculeFactory.makeIndole();
IAtomContainer mol2 = TestMoleculeFactory.makeIndole();
SignatureFingerprinter fingerprinter = new SignatureFingerprinter();
fp1 = fingerprinter.getCountFingerprint(mol1);
fp2 = fingerprinter.getCountFingerprint(mol2);
Assert.assertEquals(1.0, Tanimoto.method1(fp1, fp2), 0.001);
Assert.assertEquals(1.0, Tanimoto.method2(fp1, fp2), 0.001);
}
use of org.openscience.cdk.fingerprint.IntArrayCountFingerprint in project cdk by cdk.
the class TanimotoTest method method1.
@Test
public void method1() throws CDKException {
ICountFingerprint fp1 = new IntArrayCountFingerprint(new HashMap<String, Integer>() {
{
put("A", 3);
}
});
ICountFingerprint fp2 = new IntArrayCountFingerprint(new HashMap<String, Integer>() {
{
put("A", 4);
}
});
Assert.assertEquals(0.923, Tanimoto.method1(fp1, fp2), 0.001);
}
use of org.openscience.cdk.fingerprint.IntArrayCountFingerprint in project cdk by cdk.
the class TanimotoTest method method2.
@Test
public void method2() throws CDKException {
ICountFingerprint fp1 = new IntArrayCountFingerprint(new HashMap<String, Integer>() {
{
put("A", 3);
}
});
ICountFingerprint fp2 = new IntArrayCountFingerprint(new HashMap<String, Integer>() {
{
put("A", 4);
}
});
Assert.assertEquals(0.75, Tanimoto.method2(fp1, fp2), 0.001);
}
Aggregations