plinder.core.scores.metrics#

Similarity metric definitions shared by scoring and clustering.

plinder.core.scores.metrics.maximum_weight_bipartite_assignment(query_nodes: Iterable[str], target_nodes: Iterable[str], primary_weights: Mapping[tuple[str, str], float], *, secondary_weights: Mapping[tuple[str, str], float] | None = None) → list[tuple[str, str]][source]#

Maximize integer-stepped primary weights, then secondary weights.

Zero-weight dummy nodes allow either side to remain unmatched. Secondary weights are normalized so that their complete assignment can never outweigh one primary-weight unit. Returned pairs are deterministic and ordered by their contribution to the objective.

plinder.core.scores.metrics.is_chemical_cluster_metric(metric: str) → bool[source]#

Return whether a metric is a fingerprint-derived ligand-similarity metric.

Chemical metrics cluster the unique-SMILES node universe and are symmetric, which sets them apart from the pocket/protein score metrics throughout the clustering pipeline.

plinder.core.scores.metrics.is_ligand_level_metric(metric: str) → bool[source]#

Return whether graph nodes for this score are individual ligands.