|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openscience.cdk.similarity.Tanimoto
@TestClass(value="org.openscience.cdk.similarity.TanimotoTest") public class Tanimoto
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.getFingerprint(molecule1); BitSet fingerprint2 = Fingerprinter.getFingerprint(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
| Constructor Summary | |
|---|---|
Tanimoto()
|
|
| Method Summary | |
|---|---|
static float |
calculate(java.util.BitSet bitset1,
java.util.BitSet bitset2)
Evaluates Tanimoto coefficient for two bit sets. |
static float |
calculate(double[] features1,
double[] features2)
Evaluates the continuous Tanimoto coefficient for two real valued vectors. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Tanimoto()
| Method Detail |
|---|
@TestMethod(value="testTanimoto1,testTanimoto2")
public static float calculate(java.util.BitSet bitset1,
java.util.BitSet bitset2)
throws CDKException
bitset1 - A bitset (such as a fingerprint) for the first moleculebitset2 - A bitset (such as a fingerprint) for the second molecule
CDKException - if bitsets are not of the same length
@TestMethod(value="testTanimoto3")
public static float calculate(double[] features1,
double[] features2)
throws CDKException
features1 - The first feature vectorfeatures2 - The second feature vector
CDKException - if the features are not of the same length
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||