Skip to content
Snippets Groups Projects
Commit e080a990 authored by Christian Faber's avatar Christian Faber
Browse files

added rmsd per residue

parent f15583ba
No related branches found
No related tags found
No related merge requests found
......@@ -117,10 +117,10 @@ def rmsd_from_rot_tran(
:return: RMSD like value (:math:`\sqrt{E}`)
:rtype: float
"""
print(trans.shape)
print(np.matmul(rot, x).shape, y.shape)
return 0.0
num_vec = x.shape[1]
intermediate = np.matmul(rot, x) + trans[:, np.newaxis] + y
squared = np.trace(np.matmul(np.transpose(intermediate), intermediate)) / num_vec
return np.sqrt(squared)
def rmsd(x: np.ndarray, y: np.ndarray) -> float:
......@@ -220,9 +220,9 @@ 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)
values.append(rmsd_from_rot_tran(res1_AA, res2_AA, rot, trans))
return [0.0]
return values
if __name__ == "__main__":
......
......@@ -32,7 +32,6 @@ def main():
rot, tran = sup.get_rotran()
# rmsd per residue
print(rmsd.rmsd_per_residue(file1, file2))
print("Hallo Welt", val, val2)
if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment