Author: bugman Date: Wed Oct 26 10:49:27 2011 New Revision: 14920 URL: http://svn.gna.org/viewcvs/relax?rev=14920&view=rev Log: Created the Structure.test_superimpose_fit_to_first system test. The structure.superimpose user function doesn't exist yet, but all the necessary algorithms are already in relax. 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=14920&r1=14919&r2=14920&view=diff ============================================================================== --- 1.3/test_suite/system_tests/structure.py (original) +++ 1.3/test_suite/system_tests/structure.py Wed Oct 26 10:49:27 2011 @@ -777,3 +777,25 @@ self.assertAlmostEqual(a.bond_vect[0], -0.4102707) self.assertAlmostEqual(a.bond_vect[1], 0.62128879) self.assertAlmostEqual(a.bond_vect[2], -0.6675913) + + + def test_superimpose_fit_to_first(self): + """Test of the structure.superimpose user function, fitting to the first 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. + self.interpreter.structure.superimpose(models=[1, 2], method='fit to first') + + # 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]) + self.assertAlmostEqual(model1.y[i], model2.y[i]) + self.assertAlmostEqual(model1.z[i], model2.z[i])