From 087f6bbe0daeb81d12fab2e33fb0d2cfafb2b7eb Mon Sep 17 00:00:00 2001 From: Xavier Robin <xavier.robin@unibas.ch> Date: Tue, 20 Aug 2024 11:25:59 +0200 Subject: [PATCH] fix: report disconnected rather than single_ligand_issue This was a problem in CASP16 models L4004LG020_1F where all the model ligands were disconnected but that was not picked up properly --- modules/mol/alg/pymod/ligand_scoring_base.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/mol/alg/pymod/ligand_scoring_base.py b/modules/mol/alg/pymod/ligand_scoring_base.py index 67ad4b61f..eeb092d45 100644 --- a/modules/mol/alg/pymod/ligand_scoring_base.py +++ b/modules/mol/alg/pymod/ligand_scoring_base.py @@ -626,7 +626,7 @@ class LigandScorer: "Ligand was already assigned to an other " "model ligand (different stoichiometry)") - # maybe its a symmetry issue? + # maybe it's a symmetry issue? if 2 in tmp: return self.state_decoding[2] @@ -634,12 +634,12 @@ class LigandScorer: # target counterpart. if 6 in tmp: mdl_idx = np.where(self.state_matrix[trg_lig_idx,:]==6)[0] - # we're reporting everything except disconnected error... - # don't ask... for i in mdl_idx: if self.model_ligand_states[i] == 0: raise RuntimeError("This should never happen") - if self.model_ligand_states[i] != 4: + if self.model_ligand_states[i] != 4 or len(tmp) == 1: + # Don't report disconnected if only 1 model ligand is + # disconnected, unless that's the only reason return self.state_decoding[self.model_ligand_states[i]] # get rid of remaining single ligand issues (only disconnected error) @@ -720,12 +720,12 @@ class LigandScorer: # target counterpart. if 6 in tmp: trg_idx = np.where(self.state_matrix[:,mdl_lig_idx]==6)[0] - # we're reporting everything except disconnected error... - # don't ask... for i in trg_idx: if self.target_ligand_states[i] == 0: raise RuntimeError("This should never happen") - if self.target_ligand_states[i] != 4: + if self.target_ligand_states[i] != 4 or len(tmp) == 1: + # Don't report disconnected if only 1 target ligand is + # disconnected, unless that's the only reason return self.state_decoding[self.target_ligand_states[i]] # get rid of remaining single ligand issues (only disconnected error) -- GitLab