bulk_mcs_similarity#

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

Bulk MCS similarity.

Computes the pairwise Maximum Common Substructure (MCS) similarity between lists of molecules. If a single list is passed, similarities are computed between its molecules. For two lists, similarities 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_similarity().

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

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

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

Returns:

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

Return type:

ndarray

See also

mcs_similarity()

MCS similarity function for two molecules.

Examples

>>> from skfp.distances import bulk_mcs_similarity
>>> from rdkit.Chem import MolFromSmiles
>>> mols = [MolFromSmiles("COc1ccccc1"), MolFromSmiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C")]
>>> sim = bulk_mcs_similarity(mols)
>>> sim
array([[1.        , 0.15789474],
       [0.15789474, 1.        ]])