Skip to content

Commit 47c9c72

Browse files
authored
Merge pull request #70 from aivant/match-common-residues
Improve `_match_common_residues()`
2 parents 585d8d2 + a5958ec commit 47c9c72

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/peppr/match.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,8 +852,14 @@ def _match_common_residues(
852852
ref_order, pose_order, ref_common_mask, pose_common_mask = _find_atom_intersection(
853853
reference[ref_aligned_mask], pose[pose_aligned_mask]
854854
)
855-
reference[ref_aligned_mask] = reference[ref_aligned_mask][ref_order]
856-
pose[pose_aligned_mask] = pose[pose_aligned_mask][pose_order]
855+
global_ref_order = np.arange(reference.array_length())
856+
global_pose_order = np.arange(pose.array_length())
857+
global_ref_order[ref_aligned_mask] = global_ref_order[ref_aligned_mask][ref_order]
858+
global_pose_order[pose_aligned_mask] = global_pose_order[pose_aligned_mask][
859+
pose_order
860+
]
861+
reference = reference[global_ref_order]
862+
pose = pose[global_pose_order]
857863
reference.matched[ref_aligned_mask] = ref_common_mask
858864
pose.matched[pose_aligned_mask] = pose_common_mask
859865

0 commit comments

Comments
 (0)