calcDrugFPSim: Calculate Drug Molecule Similarity Derived by Molecular...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/701-calcDrugFPSim.R

Description

Calculate Drug Molecule Similarity Derived by Molecular Fingerprints

Usage

1
2
calcDrugFPSim(fp1, fp2, fptype = c("compact", "complete"),
  metric = c("tanimoto", "euclidean", "cosine", "dice", "hamming"))

Arguments

fp1

The first molecule's fingerprints, could be extracted by extractDrugMACCS(), extractDrugMACCSComplete() etc.

fp2

The second molecule's fingerprints.

fptype

The fingerprint type, must be one of "compact" or "complete".

metric

The similarity metric, one of "tanimoto", "euclidean", "cosine", "dice" and "hamming".

Details

This function calculate drug molecule fingerprints similarity. Define a as the features of object A, b is the features of object B, c is the number of common features to A and B:

Value

The numeric similarity value.

Author(s)

Nan Xiao <https://nanx.me>

References

Gasteiger, Johann, and Thomas Engel, eds. Chemoinformatics. Wiley.com, 2006.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
mols = readMolFromSDF(system.file('compseq/tyrphostin.sdf', package = 'Rcpi'))


fp1 = extractDrugEstate(mols[[1]])
fp2 = extractDrugEstate(mols[[2]])
calcDrugFPSim(fp1, fp2, fptype = 'compact', metric = 'tanimoto')
calcDrugFPSim(fp1, fp2, fptype = 'compact', metric = 'euclidean')
calcDrugFPSim(fp1, fp2, fptype = 'compact', metric = 'cosine')
calcDrugFPSim(fp1, fp2, fptype = 'compact', metric = 'dice')
calcDrugFPSim(fp1, fp2, fptype = 'compact', metric = 'hamming')

fp3 = extractDrugEstateComplete(mols[[1]])
fp4 = extractDrugEstateComplete(mols[[2]])
calcDrugFPSim(fp3, fp4, fptype = 'complete', metric = 'tanimoto')
calcDrugFPSim(fp3, fp4, fptype = 'complete', metric = 'euclidean')
calcDrugFPSim(fp3, fp4, fptype = 'complete', metric = 'cosine')
calcDrugFPSim(fp3, fp4, fptype = 'complete', metric = 'dice')
calcDrugFPSim(fp3, fp4, fptype = 'complete', metric = 'hamming')

Example output

OpenJDK 64-Bit Server VM warning: Insufficient space for shared memory file:
   4048890
Try using the -Djava.io.tmpdir= option to select an alternate temp location.

[1] 0.5
[1] 0.9678372
[1] 0.6804138
[1] 0.6666667
[1] 0.06329114
[1] 0.5
[1] 0.9678372
[1] 0.6804138
[1] 0.6666667
[1] 0.06329114

Rcpi documentation built on Nov. 8, 2020, 8:23 p.m.