Skip to contents

Calculate fingerprint similarity.

Usage

sim(
  fps1 = NULL,
  fps2 = NULL,
  metric = c("tanimoto", "dice", "cosine", "sokal", "russel", "rogotgoldberg", "allbit",
    "kulczynski", "mcconnaughey", "asymmetric", "braunblanquet")
)

Arguments

fps1

A tidyfps object.

fps2

A tidyfps object (optional).

metric

Metric type.

Examples

if (FALSE) { # is_installed_rdkit()
mols1 <- parse_smiles(c("Cc1ccccc1", "CCN(CC)CC"))
mols2 <- parse_smiles(c("Cc1ccccc1", "CCN(CC)CC", "CCC"))
fps1 <- fp_maccs(mols1)
fps2 <- fp_maccs(mols2)

sim(fps1, metric = "tanimoto")
sim(fps1, fps2, metric = "tanimoto")

# or use pipes
mols1 |>
  fp_maccs() |>
  sim("tanimoto")
(mols1 |> fp_maccs()) |> sim(mols2 |> fp_maccs(), "tanimoto")
}