distance {fingerprint} | R Documentation |
A number of distance metrics can be calculated for binary fingerprints. Some of these are actually similarity metrics and thus represent the reverse of a distance metric.
The following are distance (dissimilarity) metrics
The following metrics are similarity metrics and so the distance can be obtained by subtracting the value fom 1.0
Finally the method also provides a set of composite and asymmetric distance metrics
The default metric is the Tanimoto coefficient.
distance(fp1, fp2, method)
fp1 |
An object of class fingerprint
|
fp2 |
An object of class fingerprint
|
method |
The type of distance metric desired. Partial matching is
supported and the deault is tanimoto . Alternative values are
|
Numeric value representing the distance in the specified metric between the supplied fingerprint objects
Rajarshi Guha rguha@indiana.edu
Fligner, M.A.; Verducci, J.S.; Blower, P.E.; A Modification of the Jaccard-Tanimoto Similarity Index for Diverse Selection of Chemical Compounds Using Binary Strings, Technometrics, 2002, 44(2), 110-119
Monve, V.; Introduction to Similarity Searching in Chemistry, MATCH - Comm. Math. Comp. Chem., 2004, 51, 7-38
# make a 2 fingerprint vectors fp1 <- new("fingerprint", nbit=6, bits=c(1,2,5,6)) fp2 <- new("fingerprint", nbit=6, bits=c(1,2,5,6)) # calculate the tanimoto coefficient distance(fp1,fp2) # should be 1 # Invert the second fingerprint fp3 <- !fp2 distance(fp1,fp3) # should be 0