mdlearn.data.preprocess.align.iterative_means_align
- mdlearn.data.preprocess.align.iterative_means_align(coords: numpy.ndarray, eps: float = 0.001, max_iter: int = 10, inplace: bool = False, verbose: bool = False, num_workers: int = 1) tuple[int, list[numpy.ndarray], list[numpy.ndarray], numpy.ndarray]
Run iterative means alignment.
Run iterative means alignment which aligns
coordsto the mean coordinate structure using the kabsch alignment algorithm implemented here:mdlearn.data.preprocess.align.kabsch_align. Algorithm converges if either the difference of means coordinates computed from consecutive iterations is less thanepsor ifmax_iteriterations have finished.- Parameters:
coords (np.ndarray) – Array of atomic coordinates with dimension (n_frames, 3, n_atoms)
eps (float, default=0.001) – Error tolerance of the difference between mean coordinates computed from consecutive iterations, used to define convergence.
max_iter (int, default=10) – Number of iterations before convergence.
inplace (bool, default=False) – If True, modifies
coordsinplace. Inplace operations may offer the ability to fit larger systems into memory.verbose (bool, default=False) – If True, prints verbose output
num_workers (int, 1) – Number of workers for parallel processing of the trajectory, each worker will take a single core.
- Returns:
itr (int) – The iteration reached before convergence.
avg_coords (List[np.ndarray]) – The average taken over all coords each iteration of the alignment.
e_rmsd (List[np.ndarray]) – The root mean squared deviation (RMSD) of each structure with respect to the
avg_coordsfor each iteration of the alignment.coords_ (np.ndarray) – The newly aligned trajectory of coordinates with the same shape as the input
coordsarray.