API Documentation for rmsd
- class RMSDAnalyzer(top_file, traj_file)
A class responsible for the Root-Mean-Square Deviation (RMSD) analysis throughout the molecular dynamics simulation. The class provides functionalities to calculate RMSD over time, compute pairwise RMSD between trajectory frames and identify the representative frames within clusters of the binding modes.
- Parameters:
top_file (str) – Path to the topology file.
traj_file (str) – Path to the trajectory file.
- Variables:
universe (mda.Universe) – MDAnalysis Universe object initialized with the provided topology and trajectory files.
- rmsd_for_atomgroups(fig_type, selection1, selection2=None)
Calculate the RMSD for selected atom groups, and save the CSV file and plot.
- Parameters:
fig_type (str) – Type of the figure to save (e.g., ‘png’, ‘jpg’).
selection1 (str) – Selection string for main atom group, also used during alignment.
selection2 (list of str, optional) – Selection strings for additional atom groups. Defaults to None.
- Returns:
DataFrame containing RMSD of the selected atom groups over time.
- Return type:
pd.DataFrame
- rmsd_dist_frames(fig_type, lig, nucleic=False)
Calculate the RMSD between all frames in a matrix.
- Parameters:
fig_type (str) – Type of the figure to save (e.g., ‘png’, ‘jpg’).
lig (str) – Ligand name saved in the above PDB file. Selection string for the MDAnalysis AtomGroup to be investigated, also used during alignment.
nucleic (bool, optional) – Bool indicating if the receptor to be analyzed contains nucleic acids. Defaults to False.
- Returns:
pairwise_rmsd_prot (np.ndarray): Numpy array of RMSD values for pairwise protein structures.
pairwise_rmsd_lig (np.ndarray): Numpy array of RMSD values for ligand structures.
- Return type:
Tuple[numpy.ndarray, numpy.ndarray]
- calculate_distance_matrix(selection)
Calculates the pairwise RMSD-based distance matrix for all trajectory frames for the selected atom selection.
- Parameters:
selection (str) – Selection string for the atoms (e.g., ‘protein’, ‘resname LIG’) used to compute the RMSD between frames.
- Returns:
Numpy array containing RMSD values between all pairs of frames.
- Return type:
np.ndarray
- calculate_representative_frame(bmode_frames, DM)
Calculates the most representative frame for a bindingmode. This is based uppon the averagwe RMSD of a frame to all other frames in the binding mode.
- Parameters:
bmode_frames (list of int) – List of frames belonging to a binding mode.
DM (np.ndarray) – Distance matrix of trajectory.
- Returns:
Number of the most representative frame.
- Return type:
int
- _calc_rmsd_2frames(ref, frame)
Calculates the RMSD between a reference and a target frame.
This method serves as a wrapper for the calc_rmsd_2frames_jit function, which dpes the actual RMSD calculation between two sets of coordinates.
- Parameters:
ref (np.ndarray) – Numpy array representing the reference atom positions, shape (N, 3).
frame (np.ndarray) – Numpy array representing the atom positions of the target frame, shape (N, 3).
- Returns:
The RMSD value between the reference and target frame.
- Return type:
float
- calc_rmsd_2frames_jit(ref, frame)
Calculates the RMSD between two frames of atomic coordinates.
- Parameters:
ref (np.ndarray) – Numpy array containing the reference atomic coordinates.
frame (np.ndarray) – Numpy array containing the atomic coordinates of the target frame.
- Returns:
The RMSD value between the reference and target frame.
- Return type:
float