bulk_mcs_distance#

skfp.distances.bulk_mcs_distance(X: list[Mol], Y: list[Mol] | None = None, timeout: int = 3600) ndarray#

Bulk MCS distance.

Computes the pairwise Maximum Common Substructure (MCS) 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 mcs_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.

  • timeout (int, default=3600) – MCS computation timeout.

Returns:

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

Return type:

ndarray

See also

mcs_distance()

MCS distance function for two molecules.

Examples

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