diff --git a/src/BioHelpers_FABER/rmsd.py b/src/BioHelpers_FABER/rmsd.py index 8dcb43bf45549467d7d39d9f7f2a93f6483a87a6..2a066e356f721825efeba64c7e536f7757a4d5df 100644 --- a/src/BioHelpers_FABER/rmsd.py +++ b/src/BioHelpers_FABER/rmsd.py @@ -102,7 +102,7 @@ def rmsd_from_rot_tran( """Calculate an RMSD like value for a given set of vectors x and y with a given rotation matrix and translation vector Mathematical formula: - .. math:: \tilde{\mathrm{RMSD}} = \\frac{1}{M} \sum_{k=1..M} |\mathscr{U}\mathbf{x}^k + \mathbf{r} - \mathbf{y}^k|^2 + .. math:: \mathrm{E} = \\frac{1}{M} \sum_{k=1..M} |\mathscr{U}\mathbf{x}^k + \mathbf{r} - \mathbf{y}^k|^2 **Important Note:** The translation vector differs from Kabsch algorithm, there you translate befor rotating. In Coutsias paper it is the otherway round. @@ -114,9 +114,12 @@ def rmsd_from_rot_tran( :type rot: np.ndarray :param trans: Translation vector r, see note above :type trans: np.ndarray - :return: RMSD like value + :return: RMSD like value (:math:`\sqrt{E}`) :rtype: float """ + print(trans.shape) + print(np.matmul(rot, x).shape, y.shape) + return 0.0 @@ -217,6 +220,7 @@ def rmsd_per_residue(file1: str, file2: str) -> list[float]: res2_AA = [list(a.get_vector()) for a in res2.get_atoms()] res1_AA = np.transpose(np.array(res1_AA)) res2_AA = np.transpose(np.array(res2_AA)) + rmsd_from_rot_tran(res1_AA, res2_AA, rot, trans) return [0.0]