# sim: Calculates a Similarity Matrix for a Set of Fingerprints In fingerprint: Functions to operate on binary fingerprint data

## 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` objectssupplied 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

 `1` ```fp.sim.matrix(fplist, method='tanimoto') ```

## Arguments

 `fplist` A list structure with each element being an object of class `fingerprint`. These will can be constructed by hand or read from disk via `fp.read` `method` The type of distance metric to use. Alternatives are `euclidean` and `dice` and `mt`. The default is `tanimoto`. Partial matching is supported.

## Value

A matrix with dimensions equal to `(length(fplist), length(fplist))`

## Author(s)

Rajarshi Guha [email protected]

## See Also

`distance`, `fp.read`

## Examples

 ```1 2 3 4 5 6``` ```# 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) ) ```

### Example output

```     [,1] [,2] [,3]
[1,]  1.0  0.6  0.5
[2,]  0.6  1.0  0.5
[3,]  0.5  0.5  1.0
```

fingerprint documentation built on May 31, 2017, 1:29 a.m.