Learn R Programming

fingerprint (version 3.5.7)

fingerprint-class: Class "fingerpint"

Description

This class represents binary fingerprints, usually generated by a variety of cheminformatics software, but not restricted to such

Arguments

Objects from the Class

Objects can be created by calls of the form new("fingerprint", ...). Fingerprints can traditionally thought of as a vector of 1's and 0's. However for large fingerprints this is inefficient and instead we simply store the positions of the bits that are on. Certain operations also need to know the length of the original bit string and this length is stored in the object at construction. Even though we store extra information along with the bit positions, conceptually we still consider the objects as simple bit strings. Thus the usual bitwise logical operations (&, |, !, xor) can be applied to objects of this class.

Slots

bits:

Object of class "numeric" ~~ A vector indicating the bit positions that are on.

nbit:

Object of class "numeric" ~~ Indicates the length of the original bit string.

folded:

Object of class "logical" ~~ Indicates whether the fingerprint has been folded.

provider:

Object of class "character" ~~ Indicates the source of the fingerprint. Can be useful to keep track of what software generated the fingerprint.

name:

Object of class "character" ~~ The name associated with the fingerprint. If not name is available this gets set to an empty string

misc:

Object of class "list" ~~ A holder for arbitrary items that may have been stored along with the fingerprint. Only certain formats allow extra items to be stored with the fingerprint, so in many cases this field is just an empty list

Methods

distance

signature(fp1 = "fingerprint", fp2 = "fingerprint", method = "missing", a = "missing", b = "missing"): ...

distance

signature(fp1 = "fingerprint", fp2 = "fingerprint", method = "character", a = "missing", b = "missing"): ...

euc.vector

signature(fp = "fingerprint"): ...

fold

signature(fp = "fingerprint"): ...

random.fingerprint

signature(nbit = "numeric", on = "numeric"): ...

See Also

fp.read, fp.read.to.matrix fp.sim.matrix, fp.to.matrix, fp.factor.matrix random.fingerprint

Examples

Run this code
# NOT RUN {
## make fingerprints
x <- new("fingerprint", nbit=128, bits=sample(1:128, 100))
y <- x
distance(x,y) # should be 1
x <- new("fingerprint", nbit=128, bits=sample(1:128, 100))
distance(x,y)
folded <- fold(x)

## binary operations on fingerprints
x <- new("fingerprint", nbit=8, bits=c(1,2,3,6,8))
y <- new("fingerprint", nbit=8, bits=c(1,2,4,5,7,8))
x & y
x | y
!x
# }

Run the code above in your browser using DataLab