peppr.filter_matched#

peppr.filter_matched(reference: AtomArray | AtomArrayStack, pose: AtomArray | AtomArrayStack, prefilter: Callable[[AtomArray], ndarray[tuple[Any, ...], dtype[bool]]] | None = None) tuple[AtomArray | AtomArrayStack, AtomArray | AtomArrayStack][source]#

Filter the matched atoms from the reference and pose, i.e. where their matched annotation is True.

Parameters:
reference, poseAtomArray

The structures to filter. If they have a matched annotation, the atoms where matched is True are kept. Otherwise, all atoms are kept.

prefilterCallable[AtomArray -> ndarray, dtype=bool], optional

For convenience, an additional filter function can be applied to both, the reference and pose, before additionally filtering the matched atoms.

Returns:
matched_reference, matched_poseAtomArray or AtomArrayStack

The filtered reference and pose.

Raises:
StructureMismatchError

If the matched structures do not have corresponding atoms, indicating an issue in the prior matching process.