Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The rules for this file:
talagayev, NDoering99

### Added
- Addition of two `protein` and `residue` interaction in binding modes (2026-01-19, PR#170)
- Addition of force field version selection for `GAFF` & `SMINROFF` (2025-12-15, PR #169)
- Addition of `CHARM2024` forcefield (2025-11-03, PR #163)

Expand Down
570 changes: 356 additions & 214 deletions openmmdl/openmmdl_analysis/analysis/bindingmodes.py

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions openmmdl/openmmdl_analysis/analysis/rmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def rmsd_dist_frames(self, fig_type, lig, nucleic=False):

return pairwise_rmsd_prot, pairwise_rmsd_lig

def calculate_distance_matrix(self, selection):
def calculate_distance_matrix(self, selection, n_frames=None):
"""
Calculates the pairwise RMSD-based distance matrix for all trajectory frames
for the selected atom selection.
Expand All @@ -137,16 +137,20 @@ def calculate_distance_matrix(self, selection):
np.ndarray
Numpy array containing RMSD values between all pairs of frames.
"""
if n_frames is None:
n_frames = len(self.universe.trajectory)
n_frames = min(int(n_frames), len(self.universe.trajectory))

distances = np.zeros((len(self.universe.trajectory), len(self.universe.trajectory)))
# calculate distance matrix
for i in tqdm(
range(len(self.universe.trajectory)),
range(n_frames),
desc="\033[1mCalculating distance matrix:\033[0m",
):
self.universe.trajectory[i]
frame_i = self.universe.select_atoms(selection).positions
# distances[i] = md.rmsd(traj_aligned, traj_aligned, frame=i)
for j in range(i + 1, len(self.universe.trajectory)):
for j in range(i + 1, n_frames):
self.universe.trajectory[j]
frame_j = self.universe.select_atoms(selection).positions
rmsd = self._calc_rmsd_2frames(frame_i, frame_j)
Expand Down
Loading
Loading