bulk_fraggle_distance#

skfp.distances.bulk_fraggle_distance(X: list[Mol], Y: list[Mol] | None = None, tversky_threshold: float = 0.8) ndarray#

Bulk Fraggle distance.

Computes the pairwise Fraggle distance between lists of molecules. If a single list is passed, distances are computed between its molecules. For two lists, distances are between their respective molecules, with i-th row and j-th column in output corresponding to i-th molecule from first list and j-th molecule from second list.

See also fraggle_distance().

Parameters:
  • X (ndarray) – First list of molecules, of length m.

  • Y (ndarray, default=None) – First list of molecules, of length n. If not passed, distances are computed between molecules from X.

  • tversky_threshold (float, default=0.8) – Required minimal Tversky similarity between a fragment and the reference molecule.

Returns:

distances – Array with pairwise Fraggle distance values. Shape is \(m \times n\) if two lists of molecules are passed, or \(m \times m\) otherwise.

Return type:

ndarray

See also

fraggle_distance()

Fraggle distance function for two molecules.

Examples

>>> from skfp.distances import bulk_fraggle_distance
>>> from rdkit.Chem import MolFromSmiles
>>> mols = [MolFromSmiles("COc1ccccc1"), MolFromSmiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C")]
>>> dist = bulk_fraggle_distance(mols)
>>> dist
array([[0.        , 0.76724138],
       [0.76724138, 0.        ]])