From b3ddebb89b38dff63b6117f0829376a76c0f6bad Mon Sep 17 00:00:00 2001 From: Gabriel Studer <gabriel.studer@unibas.ch> Date: Tue, 17 Sep 2024 11:21:31 +0200 Subject: [PATCH] lDDT: avoid zero division when computing per-atom lDDT scores --- modules/mol/alg/pymod/lddt.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/mol/alg/pymod/lddt.py b/modules/mol/alg/pymod/lddt.py index 83c1b2d60..7c0a0dfe2 100644 --- a/modules/mol/alg/pymod/lddt.py +++ b/modules/mol/alg/pymod/lddt.py @@ -693,9 +693,10 @@ class lDDTScorer: # the only place where actually need to compute per-atom lDDT # scores for a_idx in range(len(atom_list)): - tmp = summed_per_atom_conserved[a_idx] / per_atom_exp[a_idx] - tmp = tmp / n_thresh - atom_list[a_idx].SetFloatProp(local_lddt_prop, tmp) + if per_atom_exp[a_idx] != 0: + tmp = summed_per_atom_conserved[a_idx] / per_atom_exp[a_idx] + tmp = tmp / n_thresh + atom_list[a_idx].SetFloatProp(local_lddt_prop, tmp) if local_contact_prop: conserved_prop = local_contact_prop + "_cons" -- GitLab