public class Distance
extends java.lang.Object
The Measures program takes as input any fixed length bit strings, these can be from the Mesa Fingerprint programs or user supplied fingerprints. User supplied fingerprints must take the form of ASCII 1's and 0's, (e.g. 011100001111000....), ASCII CDK fingerprints inside the FP<> data type are also valid input to Measures . The Measures program produces a similarity or dissimilarity matrix (user's choice) using one of the following user selected measures: Tversky, Tanimoto, Euclidean, Hamman, or Ochia (1-Cosine). In similarity form: Tanimoto(A,B) = c / [a + b - c] (symmetric) Euclidean(A,B) = 1 - {[(a + b)] / n}(1/2) (symmetric) Hamman(A,B) = [c + d] /n (symmetric) Ochia(A,B) = 1 - Cosine(A,B) = c / [(c + a) * (c + b)](1/2) (symmetric) Tversky(A,B) = c / [(alpha) * a + (beta) * b + c] (asymmetric) a : Unique bits turned on in molecule "A" b: Unique bits turned on in molecule "B" c: Common bits turned on in both molecule "A" and molecule "B" d: Common bits turned off in both molecule "A" and molecule "B" n: The total number of bits in the fingerprint Note:The Tanimoto, Euclidean, Hamman, and Ochai are all symmetric measures. This means that the comparison of A to B yields the same number as the comparison of compound B to compound A. Note: The dissimilarity is just 1 - similarity.
Modifier and Type | Method and Description |
---|---|
static double |
getEuclideanDistance(java.util.BitSet Molecule1,
java.util.BitSet Molecule2) |
static double |
getHammingDistance(java.util.BitSet Molecule1,
java.util.BitSet Molecule2) |
static double |
getNormalizedEuclideanDistance(java.util.BitSet Molecule1,
java.util.BitSet Molecule2) |
static double |
getNormalizedHammingDistance(java.util.BitSet Molecule1,
java.util.BitSet Molecule2) |
static double |
getSoergelDistance(java.util.BitSet Molecule1,
java.util.BitSet Molecule2) |
public static double getEuclideanDistance(java.util.BitSet Molecule1, java.util.BitSet Molecule2) throws java.lang.Exception
Molecule1
- BitSetMolecule2
- BitSet
Note: Can be Normalized to the range 1 to 0 if all attributes are normalized to this range and the result
is divided in Njava.lang.Exception
public static double getNormalizedEuclideanDistance(java.util.BitSet Molecule1, java.util.BitSet Molecule2) throws java.lang.Exception
Molecule1
- BitSetMolecule2
- BitSet
Note: Can be Normalized to the range 1 to 0 if all attributes are normalized to this range and the result
is divided in Njava.lang.Exception
public static double getHammingDistance(java.util.BitSet Molecule1, java.util.BitSet Molecule2) throws java.lang.Exception
Molecule1
- Molecule2
- java.lang.Exception
public static double getNormalizedHammingDistance(java.util.BitSet Molecule1, java.util.BitSet Molecule2) throws java.lang.Exception
Molecule1
- Molecule2
- java.lang.Exception
public static double getSoergelDistance(java.util.BitSet Molecule1, java.util.BitSet Molecule2) throws java.lang.Exception
Molecule1
- Molecule2
- java.lang.Exception