calcDrugFPSim {Rcpi} | R Documentation |
Calculate Drug Molecule Similarity Derived by Molecular Fingerprints
calcDrugFPSim(fp1, fp2, fptype = c("compact", "complete"), metric = c("tanimoto", "euclidean", "cosine", "dice", "hamming"))
fp1 |
The first molecule's fingerprints,
could be extracted by |
fp2 |
The second molecule's fingerprints. |
fptype |
The fingerprint type, must be one of |
metric |
The similarity metric,
one of |
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:
Tanimoto: aka Jaccard - c/a+b+c
Euclidean: √(a + b)
Dice: aka Sorensen, Czekanowski, Hodgkin-Richards - c/0.5[(a+c) + (b+c)]
Cosine: aka Ochiai, Carbo - c/√((a + c)(b + c))
Hamming: aka Manhattan, taxi-cab, city-block distance - (a + b)
The numeric similarity value.
Nan Xiao <https://nanx.me>
Gasteiger, Johann, and Thomas Engel, eds. Chemoinformatics. Wiley.com, 2006.
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')