PageRenderTime 35ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/fingerprint/man/fingerprint.Rd

http://github.com/rajarshi/cdkr
Unknown | 80 lines | 75 code | 5 blank | 0 comment | 0 complexity | 49b6393f52ba81a7d27388712fa5311a MD5 | raw file
  1. \name{fingerprint-class}
  2. \docType{class}
  3. \alias{fingerprint-class}
  4. \alias{euc.vector,fingerprint-method}
  5. \alias{fold,fingerprint-method}
  6. \alias{random.fingerprint,numeric,numeric-method}
  7. \title{Class "fingerpint"}
  8. \description{This class represents binary fingerprints, usually
  9. generated by a variety of cheminformatics software, but not
  10. restricted to such
  11. }
  12. \section{Objects from the Class}{
  13. Objects can be created by calls of the form \code{new("fingerprint", ...)}.
  14. Fingerprints can traditionally thought of as a vector of 1's and
  15. 0's. However for large fingerprints this is inefficient and
  16. instead we simply store the positions of the bits that are
  17. on. Certain operations also need to know the length of the
  18. original bit string and this length is stored in the object at
  19. construction. Even though we store extra information along with
  20. the bit positions, conceptually we still consider the objects as
  21. simple bit strings. Thus the usual bitwise logical operations
  22. (&, |, !, xor) can be applied to objects of this class.
  23. }
  24. \section{Slots}{
  25. \describe{
  26. \item{\code{bits}:}{Object of class \code{"numeric"} ~~ A vector
  27. indicating the bit positions that are on. }
  28. \item{\code{nbit}:}{Object of class \code{"numeric"} ~~ Indicates the length of the original bit string.}
  29. \item{\code{folded}:}{Object of class \code{"logical"} ~~ Indicates
  30. whether the fingerprint has been folded.}
  31. \item{\code{provider}:}{Object of class \code{"character"} ~~
  32. Indicates the source of the fingerprint. Can be useful to keep
  33. track of what software generated the fingerprint.}
  34. \item{\code{name}:}{Object of class \code{"character"} ~~
  35. The name associated with the fingerprint. If not name is available
  36. this gets set to an empty string}
  37. \item{\code{misc}:}{Object of class \code{"list"} ~~
  38. A holder for arbitrary items that may have been stored along with the fingerprint. Only
  39. certain formats allow extra items to be stored with the fingerprint, so in many cases
  40. this field is just an empty list}
  41. }
  42. }
  43. \section{Methods}{
  44. \describe{
  45. \item{distance}{\code{signature(fp1 = "fingerprint", fp2 = "fingerprint", method = "missing", a = "missing", b = "missing")}: ... }
  46. \item{distance}{\code{signature(fp1 = "fingerprint", fp2 = "fingerprint", method = "character", a = "missing", b = "missing")}: ... }
  47. \item{euc.vector}{\code{signature(fp = "fingerprint")}: ... }
  48. \item{fold}{\code{signature(fp = "fingerprint")}: ... }
  49. \item{random.fingerprint}{\code{signature(nbit = "numeric", on = "numeric")}: ... }
  50. }
  51. }
  52. \author{Rajarshi Guha \email{rajarshi.guha@gmail.com}}
  53. \seealso{
  54. \code{\link{fp.read}}, \code{\link{fp.read.to.matrix}}
  55. \code{\link{fp.sim.matrix}}, \code{\link{fp.to.matrix}},
  56. \code{\link{fp.factor.matrix}}
  57. \code{\link{random.fingerprint}}
  58. }
  59. \examples{
  60. ## make fingerprints
  61. x <- new("fingerprint", nbit=128, bits=sample(1:128, 100))
  62. y <- x
  63. distance(x,y) # should be 1
  64. x <- new("fingerprint", nbit=128, bits=sample(1:128, 100))
  65. distance(x,y)
  66. folded <- fold(x)
  67. ## binary operations on fingerprints
  68. x <- new("fingerprint", nbit=8, bits=c(1,2,3,6,8))
  69. y <- new("fingerprint", nbit=8, bits=c(1,2,4,5,7,8))
  70. x & y
  71. x | y
  72. !x
  73. }
  74. \keyword{classes}
  75. \keyword{logic}