Class Tanimoto

  • public class Tanimoto
    extends Object
    Calculates the Tanimoto coefficient for a given pair of two fingerprint bitsets or real valued feature vectors. The Tanimoto coefficient is one way to quantitatively measure the "distance" or similarity of two chemical structures.

    You can use the FingerPrinter class to retrieve two fingerprint bitsets. We assume that you have two structures stored in cdk.Molecule objects. A tanimoto coefficient can then be calculated like:

       BitSet fingerprint1 = Fingerprinter.getBitFingerprint(molecule1);
       BitSet fingerprint2 = Fingerprinter.getBitFingerprint(molecule2);
       float tanimoto_coefficient = Tanimoto.calculate(fingerprint1, fingerprint2);

    The FingerPrinter assumes that hydrogens are explicitely given, if this is desired!

    Note that the continuous Tanimoto coefficient does not lead to a metric space

    Source code:
    Belongs to CDK module:
    jaccard, similarity, tanimoto
    Created on: