Activity Cliffs¶
molfp.cliffs
¶
Activity cliff detection: find molecule pairs with high structural similarity but large activity differences.
activity_cliffs(smiles_list, activities, fp_type='ecfp4', sim_threshold=0.8, activity_threshold=2.0, metric='tanimoto')
¶
Find activity cliff pairs in a dataset.
An activity cliff is a pair of molecules with high structural similarity (Tanimoto >= sim_threshold) but large activity difference (|activity_a - activity_b| >= activity_threshold).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
smiles_list
|
list[str]
|
list of SMILES strings |
required |
activities
|
list[float] | ndarray
|
list/array of activity values (e.g., pIC50) |
required |
fp_type
|
str
|
fingerprint to use for similarity |
'ecfp4'
|
sim_threshold
|
float
|
minimum similarity to be considered structurally similar |
0.8
|
activity_threshold
|
float
|
minimum activity difference for a cliff |
2.0
|
metric
|
str
|
similarity metric ("tanimoto" or "dice") |
'tanimoto'
|
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
list of dicts, each with: idx_a, idx_b, smiles_a, smiles_b, similarity, activity_a, activity_b, delta_activity |
list[dict[str, Any]]
|
Sorted by delta_activity descending. |
cliff_summary(smiles_list, activities, fp_types=None, sim_threshold=0.8, activity_threshold=2.0)
¶
Compare activity cliff counts across fingerprint types.
Returns list of {fp_type, n_cliffs, max_delta, mean_delta}.