From bf7e672fdab89f9f4f99e18c304629b9e7745035 Mon Sep 17 00:00:00 2001 From: "c.faber" <c.faber@fz-juelich.de> Date: Tue, 22 Oct 2024 10:54:10 +0200 Subject: [PATCH] fix rmsd function --- setup.py | 2 +- src/BioHelpers_FABER/rmsd.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index a04d15b..d0296a1 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r") as f: setup( name="BioHelpers_FABER", - version="0.2.9", + version="0.2.10", description="Small collection of useful scripts for the computational work with RNA Data.", url="https://gitlab.jsc.fz-juelich.de/faber1/biohelpers", package_dir={"": "src"}, diff --git a/src/BioHelpers_FABER/rmsd.py b/src/BioHelpers_FABER/rmsd.py index c20ad6d..84ed055 100644 --- a/src/BioHelpers_FABER/rmsd.py +++ b/src/BioHelpers_FABER/rmsd.py @@ -194,8 +194,16 @@ def rmsd_pdb(file1: str, file2: str, exclude_residues: Optional[list] = None) -> p2.detach_child((" ", i, " ")) # p1_AA = [list(a.get_vector()) for a in p1.get_atoms()] # p2_AA = [list(a.get_vector()) for a in p2.get_atoms()] - p1_AA = [list(a.get_vector()) for a in p1.get_atoms() if a.id != "OP3"] - p2_AA = [list(a.get_vector()) for a in p2.get_atoms() if a.id != "OP3"] + p1_AA = [ + list(a.get_vector()) + for a in p1.get_atoms() + if a.id != "OP3" and a.element != "H" + ] + p2_AA = [ + list(a.get_vector()) + for a in p2.get_atoms() + if a.id != "OP3" and a.element != "H" + ] p1_AA = np.transpose(np.array(p1_AA)) p2_AA = np.transpose(np.array(p2_AA)) return rmsd(p1_AA, p2_AA) -- GitLab