peppr.find_matching_centroids#

peppr.find_matching_centroids(reference_centroids: ndarray[tuple[Any, ...], dtype[floating]], pose_centroids: ndarray[tuple[Any, ...], dtype[floating]], reference_entity_ids: ndarray[tuple[Any, ...], dtype[int64]] | None = None, pose_entity_ids: ndarray[tuple[Any, ...], dtype[int64]] | None = None) tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[int64]]][source]#

Greedily find pairs of chains (each represented by its centroid) between the reference and the pose that are closest to each other.

This functions iteratively chooses pairs with the smallest centroid distance, i.e. first the pair with the smallest centroid distance is chosen, then the pair with the second smallest centroid distance and so on.

Parameters:
reference_centroids, pose_centroidsnp.ndarray, shape=(n,3)

The centroids of the reference and pose chains.

reference_entity_ids, pose_entity_idsnp.ndarray, shape=(n,), dtype=int, optional

The entity IDs of the chains. Only centroids of chains with the same entity ID can be matched. By default, all can be matched to each other.

Returns:
reference_chain_indices, pose_chain_indicesnp.ndarray, shape=(n,)

Indices to corresponding chains in the reference and pose that gives the pairs with the smallest distance to each other.