diff --git a/opencadd/structure/superposition/engines/mmligner.py b/opencadd/structure/superposition/engines/mmligner.py index 648d1301..36a4a01c 100644 --- a/opencadd/structure/superposition/engines/mmligner.py +++ b/opencadd/structure/superposition/engines/mmligner.py @@ -160,14 +160,16 @@ def _parse_metadata(self, output): coverage = float(line.split()[2]) elif line.startswith("I(A & )"): ivalue = float(line.split()[4]) - elif "Print Centers of Mass of moving set:" in line: - moving_com = np.array([float(x) for x in next(lines).split()]) - elif "Print Centers of Mass of fixed set:" in line: - fixed_com = np.array([float(x) for x in next(lines).split()]) - elif "Print Rotation matrix" in line: - rotation = [[float(x) for x in next(lines).split()] for _ in range(3)] - elif "Print Quaternion matrix" in line: - quaternion = [[float(x) for x in next(lines).split()] for _ in range(4)] + # elif "Print Centers of Mass of moving set:" in line: + # moving_com = np.array([float(x) for x in next(lines).split()]) + # elif "Print Centers of Mass of fixed set:" in line: + # fixed_com = np.array([float(x) for x in next(lines).split()]) + # elif "Print Rotation matrix" in line: + # rotation = [[float(x) for x in next(lines).split()] for _ in range(3)] + # elif "Print Quaternion matrix" in line: + # quaternion = [[float(x) for x in next(lines).split()] for _ in range(4)] + elif line.startswith("Compression"): + break # checks if there is a signifcant alignment if rmsd == 0 and coverage == 0: @@ -179,7 +181,7 @@ def _parse_metadata(self, output): # fixed_com, moving_com, rotation and quaternion can only be obtained # if the patched mmligner is used (check /devtools/conda-recipes/mmligner) # -- this will fail in CI for now -- - translation = fixed_com - moving_com + #translation = fixed_com - moving_com alignment = fasta.FastaFile() alignment.read("temp__1.afasta") @@ -188,9 +190,9 @@ def _parse_metadata(self, output): "scores": {"rmsd": rmsd, "score": ivalue, "coverage": coverage}, "metadata": { "alignment": alignment, - "rotation": rotation, - "translation": translation, - "quaternion": quaternion, + #"rotation": rotation, + #"translation": translation, + #"quaternion": quaternion, }, } @@ -225,6 +227,7 @@ def _parse_scoring(self, output): "scores": {"rmsd": rmsd, "score": ivalue, "coverage": coverage}, } + # TODO: Rotation is not working correctly -> commented out for now def _calculate_transformed(self, structures, selections, metadata): """ Parse back output PDBs and construct updated Structure objects. @@ -243,8 +246,8 @@ def _calculate_transformed(self, structures, selections, metadata): """ ref, mobile, *_ = structures ref_selection, mob_selection, *_ = selections - translation = metadata["translation"] # not used - rotation = metadata["rotation"] + #translation = metadata["translation"] # not used + #rotation = metadata["rotation"] # calculation on selections mob_com = mob_selection.atoms.center_of_geometry() @@ -252,7 +255,7 @@ def _calculate_transformed(self, structures, selections, metadata): # transformation on structure mobile.atoms.translate(-mob_com) - mobile.atoms.rotate(rotation) + #mobile.atoms.rotate(rotation) mobile.atoms.translate(ref_com) return ref, mobile