From b99216b6f523d9d38808c29cc2ddbc3b66a7045e Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Wed, 6 Jul 2022 16:40:12 +0200
Subject: [PATCH] lDDT: bugfix

---
 modules/mol/alg/pymod/lddt.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/mol/alg/pymod/lddt.py b/modules/mol/alg/pymod/lddt.py
index 38ef1fd39..95a9a5af0 100644
--- a/modules/mol/alg/pymod/lddt.py
+++ b/modules/mol/alg/pymod/lddt.py
@@ -597,11 +597,12 @@ class lDDTScorer:
             residues = model.residues
             exp_prop = local_contact_prop + "_exp"
             conserved_prop = local_contact_prop + "_cons"
-            for idx in res_indices:
-                residues[idx].SetIntProp(exp_prop,
-                                         n_thresh * int(per_res_exp[idx]))
-                residues[idx].SetIntProp(conserved_prop,
-                                         int(np.sum(per_res_conserved[idx,:])))
+
+            for i, r_idx in enumerate(res_indices):
+                residues[r_idx].SetIntProp(exp_prop,
+                                           n_thresh * int(per_res_exp[i]))
+                residues[r_idx].SetIntProp(conserved_prop,
+                                           int(np.sum(per_res_conserved[i,:])))
 
         if return_dist_test:
             return lDDT, per_res_lDDT, lDDT_tot, lDDT_cons, res_indices, \
-- 
GitLab