peppr.PocketDistance#
- class peppr.PocketDistance(use_pose_centroids: bool = True)[source]#
Calculates the distance between the centroid of the reference ligand (i.e. the pocket center) and the pose in the ligand. [1]
If multiple pockets are present, the average distance is calculated.
- Parameters:
- use_pose_centroidsbool, optional
If
True
, the metric quantifies the distance between the pocket center and the pose ligand centroid (also called DCC [2]). Otherwise, the metric is more permissive and takes the minimum distance of any pose ligand atom to the pocket center (also called DCA).
Notes
Note that for
use_pose_centroids=False
even a perfect match might not have a distance of zero, as centroid may not lie directly on some ligand atom directly.References
- 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.