Author: bugman Date: Wed Oct 26 12:26:53 2011 New Revision: 14927 URL: http://svn.gna.org/viewcvs/relax?rev=14927&view=rev Log: Created the Structure.test_superimpose_fit_to_mean system test. This is to test the 'fit to mean' algorithm of the structure.superimpose user function. Modified: 1.3/test_suite/system_tests/structure.py Modified: 1.3/test_suite/system_tests/structure.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/structure.py?rev=14927&r1=14926&r2=14927&view=diff ============================================================================== --- 1.3/test_suite/system_tests/structure.py (original) +++ 1.3/test_suite/system_tests/structure.py Wed Oct 26 12:26:53 2011 @@ -807,3 +807,25 @@ self.assertAlmostEqual(model1.x[i], model3.x[i], 2) self.assertAlmostEqual(model1.y[i], model3.y[i], 2) self.assertAlmostEqual(model1.z[i], model3.z[i], 2) + + + def test_superimpose_fit_to_mean(self): + """Test of the structure.superimpose user function, fitting to the mean structure.""" + + # Path of the structure file. + path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'frame_order' + + # Load the two rotated structures. + self.interpreter.structure.read_pdb('1J7P_1st_NH.pdb', dir=path, set_model_num=1, set_mol_name='CaM') + self.interpreter.structure.read_pdb('1J7P_1st_NH_rot.pdb', dir=path, set_model_num=2, set_mol_name='CaM') + + # Superimpose the backbone heavy atoms. + self.interpreter.structure.superimpose(method='fit to mean', atom_id='@N,C,CA,O') + + # Check that the two structures now have the same atomic coordinates. + model1 = cdp.structure.structural_data[0].mol[0] + model2 = cdp.structure.structural_data[1].mol[0] + for i in range(len(model1.atom_name)): + self.assertAlmostEqual(model1.x[i], model2.x[i], 2) + self.assertAlmostEqual(model1.y[i], model2.y[i], 2) + self.assertAlmostEqual(model1.z[i], model2.z[i], 2)