Author: bugman Date: Thu Feb 21 09:49:27 2008 New Revision: 5074 URL: http://svn.gna.org/viewcvs/relax?rev=5074&view=rev Log: Created the generic_fns.structure.terminate() function for adding a TER record. Modified: 1.3/generic_fns/structure.py Modified: 1.3/generic_fns/structure.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure.py?rev=5074&r1=5073&r2=5074&view=diff ============================================================================== --- 1.3/generic_fns/structure.py (original) +++ 1.3/generic_fns/structure.py Thu Feb 21 09:49:27 2008 @@ -563,13 +563,7 @@ # Terminate the chain (the TER record). ####################################### - # The name of the last residue. - atomic_arrays = atomic_data.values() - atomic_arrays.sort() - last_res = atomic_arrays[-1][3] - - # Add the TER 'atom'. - atom_add(atomic_data=atomic_data, atom_id='TER' + atom_id_ext, record_name='TER', res_name=last_res, res_num=res_num) + terminate(atomic_data=atomic_data, atom_id_ext=atom_id_ext, res_num=res_num) # Create the PDB file. @@ -1031,6 +1025,26 @@ relax_data_store.res[run][res].xh_vect = xh_vect +def terminate(atomic_data=None, atom_id_ext='', res_num=None): + """Function for terminating the chain by adding a TER record to the atomic_data object. + + @param atomic_data: The dictionary to place the atomic data into. + @type atomic_data: dict + @param atom_id_ext: The atom identifier extension. + @type atom_id_ext: str + @param res_num: The residue number. + @type res_num: int + """ + + # The name of the last residue. + atomic_arrays = atomic_data.values() + atomic_arrays.sort() + last_res = atomic_arrays[-1][3] + + # Add the TER 'atom'. + atom_add(atomic_data=atomic_data, atom_id='TER' + atom_id_ext, record_name='TER', res_name=last_res, res_num=res_num) + + def vectors(heteronuc=None, proton=None, spin_id=None, verbosity=1): """Function for calculating/extracting the XH unit vector from the loaded structure.