Author: bugman Date: Thu Feb 21 09:50:40 2008 New Revision: 5075 URL: http://svn.gna.org/viewcvs/relax?rev=5075&view=rev Log: Merged revisions 5074 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r5074 | bugman | 2008-02-21 09:49:27 +0100 (Thu, 21 Feb 2008) | 3 lines Created the generic_fns.structure.terminate() function for adding a TER record. ........ Modified: branches/N_state_model/ (props changed) branches/N_state_model/generic_fns/structure.py Propchange: branches/N_state_model/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: branches/N_state_model/generic_fns/structure.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/generic_fns/structure.py?rev=5075&r1=5074&r2=5075&view=diff ============================================================================== --- branches/N_state_model/generic_fns/structure.py (original) +++ branches/N_state_model/generic_fns/structure.py Thu Feb 21 09:50:40 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.