Author: bugman Date: Mon Oct 17 13:59:57 2011 New Revision: 14873 URL: http://svn.gna.org/viewcvs/relax?rev=14873&view=rev Log: Added the bc flag to the RDC and PCS display and write user function front-ends. This This will allow the back-calculated data to be displayed or written rather than the measured values. Modified: 1.3/prompt/pcs.py 1.3/prompt/rdc.py Modified: 1.3/prompt/pcs.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/pcs.py?rev=14873&r1=14872&r2=14873&view=diff ============================================================================== --- 1.3/prompt/pcs.py (original) +++ 1.3/prompt/pcs.py Mon Oct 17 13:59:57 2011 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2003-2005,2007-2010 Edward d'Auvergne # +# Copyright (C) 2003-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -237,7 +237,7 @@ pcs.delete(align_id=align_id) - def display(self, align_id=None): + def display(self, align_id=None, bc=False): """Display the PCS data corresponding to the alignment ID. Keyword Arguments @@ -245,6 +245,8 @@ align_id: The alignment ID string. + bc: A flag which if set will display the back-calculated rather than measured RDCs. + Examples ~~~~~~~~ @@ -257,14 +259,16 @@ # Function intro text. if self._exec_info.intro: text = self._exec_info.ps3 + "pcs.display(" - text = text + "align_id=" + repr(align_id) + ")" - print(text) - - # The argument checks. - arg_check.is_str(align_id, 'alignment ID string') - - # Execute the functional code. - pcs.display(align_id=align_id) + text = text + "align_id=" + repr(align_id) + text = text + ", bc=" + repr(bc) + ")" + print(text) + + # The argument checks. + arg_check.is_str(align_id, 'alignment ID string') + arg_check.is_bool(bc, 'back-calculation flag') + + # Execute the functional code. + pcs.display(align_id=align_id, bc=bc) def read(self, align_id=None, file=None, dir=None, spin_id_col=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None, spin_id=None): @@ -403,7 +407,7 @@ pcs.weight(align_id=align_id, spin_id=spin_id, weight=weight) - def write(self, align_id=None, file=None, dir=None, force=False): + def write(self, align_id=None, file=None, dir=None, bc=False, force=False): """Write the PCS data to file. Keyword Arguments @@ -414,6 +418,8 @@ file: The name of the file. dir: The directory name. + + bc: A flag which if set will write out the back-calculated rather than measured RDCs. force: A flag which if True will cause the file to be overwritten. @@ -431,6 +437,7 @@ text = text + "align_id=" + repr(align_id) text = text + ", file=" + repr(file) text = text + ", dir=" + repr(dir) + text = text + ", bc=" + repr(bc) text = text + ", force=" + repr(force) + ")" print(text) @@ -438,7 +445,8 @@ arg_check.is_str(align_id, 'alignment ID string') arg_check.is_str(file, 'file name') arg_check.is_str(dir, 'directory name', can_be_none=True) + arg_check.is_bool(bc, 'back-calculation flag') arg_check.is_bool(force, 'force flag') # Execute the functional code. - pcs.write(align_id=align_id, file=file, dir=dir, force=force) + pcs.write(align_id=align_id, file=file, dir=dir, bc=bc, force=force) Modified: 1.3/prompt/rdc.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/rdc.py?rev=14873&r1=14872&r2=14873&view=diff ============================================================================== --- 1.3/prompt/rdc.py (original) +++ 1.3/prompt/rdc.py Mon Oct 17 13:59:57 2011 @@ -237,7 +237,7 @@ rdc.delete(align_id=align_id) - def display(self, align_id=None): + def display(self, align_id=None, bc=False): """Display the RDC data corresponding to the alignment ID. Keyword Arguments @@ -245,6 +245,8 @@ align_id: The alignment ID string. + bc: A flag which if set will display the back-calculated rather than measured RDCs. + Examples ~~~~~~~~ @@ -257,14 +259,16 @@ # Function intro text. if self._exec_info.intro: text = self._exec_info.ps3 + "rdc.display(" - text = text + "align_id=" + repr(align_id) + ")" + text = text + "align_id=" + repr(align_id) + text = text + ", bc=" + repr(bc) + ")" print(text) # The argument checks. arg_check.is_str(align_id, 'alignment ID string') - - # Execute the functional code. - rdc.display(align_id=align_id) + arg_check.is_bool(bc, 'back-calculation flag') + + # Execute the functional code. + rdc.display(align_id=align_id, bc=bc) def read(self, align_id=None, file=None, dir=None, data_type='D', spin_id_col=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None, spin_id=None, neg_g_corr=False): @@ -430,7 +434,7 @@ rdc.weight(align_id=align_id, spin_id=spin_id, weight=weight) - def write(self, align_id=None, file=None, dir=None, force=False): + def write(self, align_id=None, file=None, dir=None, bc=False, force=False): """Write the RDC data to file. Keyword Arguments @@ -441,6 +445,8 @@ file: The name of the file. dir: The directory name. + + bc: A flag which if set will write out the back-calculated rather than measured RDCs. force: A flag which if True will cause the file to be overwritten. @@ -458,6 +464,7 @@ text = text + "align_id=" + repr(align_id) text = text + ", file=" + repr(file) text = text + ", dir=" + repr(dir) + text = text + ", bc=" + repr(bc) text = text + ", force=" + repr(force) + ")" print(text) @@ -465,7 +472,8 @@ arg_check.is_str(align_id, 'alignment ID string') arg_check.is_str(file, 'file name') arg_check.is_str(dir, 'directory name', can_be_none=True) + arg_check.is_bool(bc, 'back-calculation flag') arg_check.is_bool(force, 'force flag') # Execute the functional code. - rdc.write(align_id=align_id, file=file, dir=dir, force=force) + rdc.write(align_id=align_id, file=file, dir=dir, bc=bc, force=force)