diff --git a/modules/mol/alg/tests/test_ligand_scoring.py b/modules/mol/alg/tests/test_ligand_scoring.py index 354a41e1f50f68826ec2bfcc78a5c53df9b623e9..0eb5037878a84b921b61415d975c2dbce557ad8b 100644 --- a/modules/mol/alg/tests/test_ligand_scoring.py +++ b/modules/mol/alg/tests/test_ligand_scoring.py @@ -527,7 +527,8 @@ class TestLigandScoring(unittest.TestCase): mdl_ed.UpdateICS() trg_ed.UpdateICS() - sc = LigandScorer(mdl, trg, None, None, unassigned=True) + sc = LigandScorer(mdl, trg, None, None, unassigned=True, + full_bs_search=True) # Check unassigned targets # NA: not in contact with target @@ -585,7 +586,7 @@ class TestLigandScoring(unittest.TestCase): # Should work with rmsd_assignment too sc = LigandScorer(mdl, trg, None, None, unassigned=True, - rmsd_assignment=True) + rmsd_assignment=True, full_bs_search=True) self.assertEqual(sc.unassigned_model_ligands, { 'L_ZN': {1: 'model_representation'}, 'L_NA': {1: 'binding_site'}, @@ -623,6 +624,28 @@ class TestLigandScoring(unittest.TestCase): sc = LigandScorer(mdl.Select("cname=A"), trg.Select("cname=A"), None, None, unassigned=True, rmsd_assignment=True) + # Test with partial bs search (full_bs_search=False) + # Here we expect L_MG_2 to be unassigned because of model_representation + # rather than stoichiometry, as it is so far from the binding site that + # there is no longer a model binding site. + sc = LigandScorer(mdl, trg, None, None, unassigned=True, + rmsd_assignment=True, full_bs_search=False) + self.assertEqual(sc.unassigned_model_ligands, { + 'L_ZN': {1: 'model_representation'}, + 'L_NA': {1: 'binding_site'}, + 'L_OXY': {1: 'identity'}, + 'L_MG_2': {1: 'model_representation'}, + "L_CMO": {1: 'disconnected'} + }) + self.assertEqual(sc.unassigned_target_ligands, { + 'G': {1: 'identity'}, + 'H': {1: 'model_representation'}, + 'J': {1: 'stoichiometry'}, + 'K': {1: 'identity'}, + 'L_NA': {1: 'binding_site'}, + "L_CMO": {1: 'disconnected'} + }) + def test_substructure_match(self): """Test that substructure_match=True works."""