diff --git a/modules/mol/alg/tests/test_qsscore.py b/modules/mol/alg/tests/test_qsscore.py index 61d27b5c42abd1f1e61231749638249f0c07e5a2..bf2ac40916ea9d1b09db9ddd8144a755466ec1b3 100644 --- a/modules/mol/alg/tests/test_qsscore.py +++ b/modules/mol/alg/tests/test_qsscore.py @@ -144,6 +144,17 @@ class TestQSScore(unittest.TestCase): qs_score = qs_scorer.GetQSScore(res.mapping) self.assertAlmostEqual(qs_score, 0.323, 2) + def test_hetero_model_switched_order(self): + # same as above but with switched order to test for symmetric behaviour + # of QS score + target = _LoadFile('1eud_mdl_partial-dimer.pdb') # BA, no symmetry + model = _LoadFile('1eud_ref.pdb') # AB, no symmetry + mapper = ChainMapper(target) + res = mapper.GetRigidMapping(model, strategy="greedy_iterative_rmsd") + qs_scorer = QSScorer.FromMappingResult(res) + qs_score = qs_scorer.GetQSScore(res.mapping) + self.assertAlmostEqual(qs_score, 0.323, 2) + def test_homo_1(self): # different stoichiometry SOD ent_1 = _LoadFile('4dvh.1.pdb') # A2, symmetry: C2 @@ -167,6 +178,17 @@ class TestQSScore(unittest.TestCase): qs_score = qs_scorer.GetQSScore(res.mapping) self.assertAlmostEqual(qs_score, 1/6, 2) + def test_homo_2_switched_order(self): + # same as above but with switched order to test for symmetric behaviour + # of QS score + ent_2 = _LoadFile('4r7y.1.pdb') # A6, symmetry: C6 + ent_1 = ent_2.Select('cname=A,B') # A2, no symmetry + mapper = ChainMapper(ent_1) + res = mapper.GetRigidMapping(ent_2, strategy="greedy_iterative_rmsd") + qs_scorer = QSScorer.FromMappingResult(res) + qs_score = qs_scorer.GetQSScore(res.mapping) + self.assertAlmostEqual(qs_score, 1/6, 2) + if __name__ == "__main__": from ost import testutils if testutils.SetDefaultCompoundLib():