Author: bugman Date: Wed Jan 28 13:07:29 2015 New Revision: 27340 URL: http://svn.gna.org/viewcvs/relax?rev=27340&view=rev Log: Created the Structure.test_align_molecules_end_truncation system test.
This is to demonstrate a failure of the common residue detection algorithm using multiple pairwise alignments in the backend of the structure.align and other multiple structure based user functions. Modified: trunk/test_suite/system_tests/structure.py Modified: trunk/test_suite/system_tests/structure.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/structure.py?rev=27340&r1=27339&r2=27340&view=diff ============================================================================== --- trunk/test_suite/system_tests/structure.py (original) +++ trunk/test_suite/system_tests/structure.py Wed Jan 28 13:07:29 2015 @@ -354,6 +354,42 @@ # Add an atom that should not be superimposed. self.interpreter.structure.add_atom(mol_name='CaM A', atom_name='Ti', res_name='TST', res_num=1, pos=[1.0, 2.0, 3.0], element='Ti', pdb_record='HETATM') self.interpreter.structure.add_atom(mol_name='CaM B', atom_name='Ti', res_name='TST', res_num=1, pos=[2.0, 3.0, 4.0], element='Ti', pdb_record='HETATM') + + # Superimpose the backbone heavy atoms. + self.interpreter.structure.align(method='fit to mean', atom_id='@N,C,CA,O', displace_id=':82-5000') + + # Check that the two structures now have the same atomic coordinates. + mol1 = cdp.structure.structural_data[0].mol[0] + mol2 = cdp.structure.structural_data[0].mol[1] + for i in range(len(mol1.atom_name)): + if mol1.res_num[i] == 1: + continue + self.assertAlmostEqual(mol1.x[i], mol2.x[i], 2) + self.assertAlmostEqual(mol1.y[i], mol2.y[i], 2) + self.assertAlmostEqual(mol1.z[i], mol2.z[i], 2) + + # The last atom must be different - it is not displaced. + self.assertAlmostEqual(mol1.x[-1] - mol2.x[-1], -1.0, 2) + self.assertAlmostEqual(mol1.y[-1] - mol2.y[-1], -1.0, 2) + self.assertAlmostEqual(mol1.z[-1] - mol2.z[-1], -1.0, 2) + + + def test_align_molecules_end_truncation(self): + """Test of the structure.align user function, fitting to the mean structure.""" + + # Path of the structure file. + path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' + + # Load the two rotated structures. + self.interpreter.structure.read_pdb('1J7O.pdb', dir=path, read_model=1, set_model_num=1, set_mol_name='CaM A') + self.interpreter.structure.read_pdb('1J7O.pdb', dir=path, read_model=1, set_model_num=1, set_mol_name='CaM B') + self.interpreter.structure.read_pdb('1J7O.pdb', dir=path, read_model=1, set_model_num=1, set_mol_name='CaM C') + + # Delete some end residues. + self.interpreter.structure.delete(atom_id="#CaM A:1-4") + self.interpreter.structure.delete(atom_id="#CaM A:60-100") + self.interpreter.structure.delete(atom_id="#CaM C:1-3") + self.interpreter.structure.delete(atom_id="#CaM C:75-100") # Superimpose the backbone heavy atoms. self.interpreter.structure.align(method='fit to mean', atom_id='@N,C,CA,O', displace_id=':82-5000') _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits