Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sim

Calculates a Similarity Matrix for a Set of Fingerprints


Description

Given a set of fingerprints, a pairwise similarity can be calculated using the various distance metrics defined for binary strings. This function calculates the pairwise similarity matrix for a set of fingerprint or featvec objects supplied in a list structure. Any of the distance metrics provided by distance can be used and the default is the Tanimoto metric.

Note that if the the Euclidean distance is specified then the resultant matrix is a distance matrix and not a similarity matrix

Usage

fp.sim.matrix(fplist, fplist2=NULL, method='tanimoto')

Arguments

fplist

A list structure with each element being an object of class fingerprint or featvec. These can be constructed by hand or read from disk via fp.read

fplist2

A list structure with each element being an object of class fingerprint or featvec. if NULL then traditional pairwise similarity is calculated with each member in fplist, otherwise the resultant N x M matrix is derived from the similarity between each member of fplist and fplist2

method

The type of distance metric to use. The default is tanimoto. Partial matching is supported.

Value

A matrix with dimensions equal to (length(fplist), length(fplist)) if fplist2 is NULL, otherwise (length(fplist), length(fplist2))

Author(s)

See Also

Examples

# make fingerprint objects
fp1 <- new("fingerprint", nbit=6, bits=c(1,2,5,6))
fp2 <- new("fingerprint", nbit=6, bits=c(1,4,5,6))
fp3 <- new("fingerprint", nbit=6, bits=c(2,3,4,5,6))

fp.sim.matrix( list(fp1,fp2,fp3) )

fingerprint

Functions to Operate on Binary Fingerprint Data

v3.5.7
GPL
Authors
Rajarshi Guha <rajarshi.guha@gmail.com>
Initial release
2018-01-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.