peppr.PLIFRecovery#

class peppr.PLIFRecovery(ph: float = 7.4, binding_site_cutoff: float = 4.0, include_interactions: list[InteractionType] | None = None)[source]#

Calculates the Protein-Ligand Interaction Fingerprint (PLIF) recovery rate.

This metric quantifies how well a predicted protein-ligand pose structure recapitulates the specific interactions observed in a reference (e.g., crystal) structure [1]:

\[\textrm{PLIF Recovery} = \frac{\sum_{ir} \min(C_{ir}, P_{ir})}{\sum_{ir} C_{ir}},\]

where \(C_ir\) is the count of interaction type \(i\) with receptor residue \(r\) in the reference and \(P_ir\) is the count of interaction type \(i\) with receptor residue \(r\) in the pose.

Parameters:
phfloat, optional

The pH value used for charge estimation if relevant to contact definition.

binding_site_cutofffloat, optional

A cutoff used if contact definition involves focusing on a binding site.

include_interactionsiterable of PLIFRecovery.InteractionType, optional

The types of interactions to include in the PLIF calculations. By default, all of them are included.

References

class InteractionType(value)#

Defines the different contact types that can be evaluated.

  • HBOND_DONOR_RECEPTOR: Hydrogen bond, where the donor atom is in the receptor.

  • HBOND_DONOR_LIGAND: Hydrogen bond, where the donor atom is in the ligand.

  • HALOGEN_BOND: Halogen bond.

  • PI_STACKING: Pi stacking interaction.

  • CATION_PI: Cation-Pi interaction, where the cation is in the receptor.

  • PI_CATION: Cation-Pi interaction, where the cation is in the ligand.

  • IONIC_BOND: Salt bridge.

evaluate(reference: AtomArray, pose: AtomArray) float#

Apply this metric on the given predicted pose with respect to the given reference.

ABSTRACT: Must be overridden by subclasses.

Parameters:
referenceAtomArray, shape=(n,)

The reference structure of the system. Each separate instance/molecule must have a distinct chain_id.

poseAtomArray, shape=(n,)

The predicted pose. Must have the same length and atom order as the reference.

Returns:
float

The metric computed for each pose. NaN, if the structure is not suitable for this metric.

Notes

Missing atoms in either the reference or the pose can be identified with NaN values.

smaller_is_better() bool#

Whether as smaller value of this metric is considered a better prediction.

ABSTRACT: Must be overridden by subclasses.

Returns:
bool

If true, a smaller value of this metric is considered a better prediction. Otherwise, a larger value is considered a better prediction.