/fingerprint/man/sim.Rd

http://github.com/rajarshi/cdkr · Unknown · 52 lines · 50 code · 2 blank · 0 comment · 0 complexity · a0c7e4abd4c8f6c862240cc08764cd50 MD5 · raw file

  1. \name{fp.sim.matrix}
  2. \alias{fp.sim.matrix}
  3. \title{
  4. Calculates a Similarity Matrix for a Set of Fingerprints
  5. }
  6. \description{
  7. Given a set of fingerprints, a pairwise similarity can be calculated using the
  8. various distance metrics defined for binary strings. This function calculates
  9. the pairwise similarity matrix for a set of \code{fingerprint} or
  10. \code{featvec} objects supplied in a \code{list}
  11. structure. Any of the distance metrics provided by \code{\link{distance}} can be used and the
  12. default is the Tanimoto metric.
  13. Note that if the the Euclidean distance is specified then the resultant matrix is a
  14. distance matrix and not a similarity matrix
  15. }
  16. \usage{
  17. fp.sim.matrix(fplist, fplist2=NULL, method='tanimoto')
  18. }
  19. \arguments{
  20. \item{fplist}{
  21. A list structure with each element being an object of class
  22. \code{fingerprint} or \code{featvec}. These can be constructed by hand or
  23. read from disk via \code{\link{fp.read}}
  24. }
  25. \item{fplist2}{A list structure with each element being an object of class
  26. \code{fingerprint} or \code{featvec}. if \code{NULL} then traditional pairwise
  27. similarity is calculated with each member in \code{fplist}, otherwise the
  28. resultant N x M matrix is derived from the similarity between each member of
  29. \code{fplist} and \code{fplist2}}
  30. \item{method}{
  31. The type of distance metric to use. The default is \code{tanimoto}. Partial
  32. matching is supported.
  33. }
  34. }
  35. \value{
  36. A matrix with dimensions equal to \code{(length(fplist), length(fplist))} if
  37. \code{fplist2} is NULL, otherwise \code{(length(fplist), length(fplist2))}
  38. }
  39. \seealso{
  40. \code{\link{distance}}, \code{\link{fp.read}}
  41. }
  42. \examples{
  43. # make fingerprint objects
  44. fp1 <- new("fingerprint", nbit=6, bits=c(1,2,5,6))
  45. fp2 <- new("fingerprint", nbit=6, bits=c(1,4,5,6))
  46. fp3 <- new("fingerprint", nbit=6, bits=c(2,3,4,5,6))
  47. fp.sim.matrix( list(fp1,fp2,fp3) )
  48. }
  49. \keyword{logic}
  50. \author{Rajarshi Guha \email{rajarshi.guha@gmail.com}}