Author: bugman Date: Thu Aug 7 19:21:09 2008 New Revision: 7088 URL: http://svn.gna.org/viewcvs/relax?rev=7088&view=rev Log: Created the interfaces for the PCS user functions. Added: branches/rdc_analysis/prompt/pcs.py - copied, changed from r7075, branches/rdc_analysis/prompt/rdc.py Copied: branches/rdc_analysis/prompt/pcs.py (from r7075, branches/rdc_analysis/prompt/rdc.py) URL: http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/prompt/pcs.py?p2=branches/rdc_analysis/prompt/pcs.py&p1=branches/rdc_analysis/prompt/rdc.py&r1=7075&r2=7088&rev=7088&view=diff ============================================================================== --- branches/rdc_analysis/prompt/rdc.py (original) +++ branches/rdc_analysis/prompt/pcs.py Thu Aug 7 19:21:09 2008 @@ -21,18 +21,18 @@ ############################################################################### # Module docstring. -"""User functions involved with RDCs.""" +"""User functions involved with pseudocontact shifts.""" # Python module imports. import sys # relax module imports. import help -from generic_fns import rdc +from generic_fns import pcs from relax_errors import RelaxError, RelaxBoolError, RelaxBinError, RelaxFloatError, RelaxIntError, RelaxNoneIntError, RelaxNoneStrError, RelaxStrError -class RDC: +class PCS: def __init__(self, relax): # Help. self.__relax_help__ = \ @@ -46,17 +46,17 @@ def back_calc(self, id=None): - """Back calculate RDCs. - - Keyword Arguments - ~~~~~~~~~~~~~~~~~ - - id: The RDC identification string. - """ - - # Function intro text. - if self.__relax__.interpreter.intro: - text = sys.ps3 + "rdc.back_calc(" + """Back calculate the pseudocontact shifts. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + id: The alignment identification string. + """ + + # Function intro text. + if self.__relax__.interpreter.intro: + text = sys.ps3 + "pcs.back_calc(" text = text + "id=" + `id` + ")" print text @@ -65,48 +65,48 @@ raise RelaxStrError, ('identification string', id) # Execute the functional code. - rdc.back_calc(id=id) + pcs.back_calc(id=id) def copy(self, pipe_from=None, pipe_to=None, id=None): - """Copy RDC data from pipe_from to pipe_to. - - Keyword Arguments - ~~~~~~~~~~~~~~~~~ - - pipe_from: The name of the pipe to copy the RDC data from. - - pipe_to: The name of the pipe to copy the RDC data to. - - id: The RDC identification string. + """Copy PCS data from pipe_from to pipe_to. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + pipe_from: The name of the pipe to copy the PCS data from. + + pipe_to: The name of the pipe to copy the PCS data to. + + id: The alignment identification string. Description ~~~~~~~~~~~ - This function will copy RDC data from 'pipe_from' to 'pipe_to'. If id is not given then all - RDC data will be copied, otherwise only a specific data set will be. + This function will copy PCS data from 'pipe_from' to 'pipe_to'. If id is not given then all + PCS data will be copied, otherwise only a specific data set will be. Examples ~~~~~~~~ - To copy all RDC data from pipe 'm1' to pipe 'm9', type one of: - - relax> rdc.copy('m1', 'm9') - relax> rdc.copy(pipe_from='m1', pipe_to='m9') - relax> rdc.copy('m1', 'm9', None) - relax> rdc.copy(pipe_from='m1', pipe_to='m9', id=None) - - To copy only the 'Th' RDC data from 'm3' to 'm6', type one of: - - relax> rdc.copy('m3', 'm6', 'Th') - relax> rdc.copy(pipe_from='m3', pipe_to='m6', id='Th') - """ - - # Function intro text. - if self.__relax__.interpreter.intro: - text = sys.ps3 + "rdc.copy(" + To copy all PCS data from pipe 'm1' to pipe 'm9', type one of: + + relax> pcs.copy('m1', 'm9') + relax> pcs.copy(pipe_from='m1', pipe_to='m9') + relax> pcs.copy('m1', 'm9', None) + relax> pcs.copy(pipe_from='m1', pipe_to='m9', id=None) + + To copy only the 'Th' PCS data from 'm3' to 'm6', type one of: + + relax> pcs.copy('m3', 'm6', 'Th') + relax> pcs.copy(pipe_from='m3', pipe_to='m6', id='Th') + """ + + # Function intro text. + if self.__relax__.interpreter.intro: + text = sys.ps3 + "pcs.copy(" text = text + "pipe_from=" + `pipe_from` text = text + ", pipe_to=" + `pipe_to` text = text + ", id=" + `id` + ")" @@ -126,63 +126,63 @@ # Id string. if id != None and type(id) != str: - raise RelaxNoneStrError, ('identification string', id) - - # Execute the functional code. - rdc.copy(pipe_from=pipe_from, pipe_to=pipe_to, id=id) + raise RelaxNoneStrError, ('alignment identification string', id) + + # Execute the functional code. + pcs.copy(pipe_from=pipe_from, pipe_to=pipe_to, id=id) def delete(self, id=None): - """Delete the RDC data corresponding to id. - - Keyword Arguments - ~~~~~~~~~~~~~~~~~ - - id: The RDC identification string. + """Delete the PCS data corresponding to the alignment id. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + id: The alignment identification string. Examples ~~~~~~~~ - To delete the RDC data corresponding to id='PH_gel', type: - - relax> rdc.delete('PH_gel') - """ - - # Function intro text. - if self.__relax__.interpreter.intro: - text = sys.ps3 + "rdc.delete(" + To delete the PCS data corresponding to id='PH_gel', type: + + relax> pcs.delete('PH_gel') + """ + + # Function intro text. + if self.__relax__.interpreter.intro: + text = sys.ps3 + "pcs.delete(" text = text + "id=" + `id` + ")" print text # Id string. if type(id) != str: - raise RelaxStrError, ('identification string', id) - - # Execute the functional code. - rdc.delete(id=id) + raise RelaxStrError, ('alignment identification string', id) + + # Execute the functional code. + pcs.delete(id=id) def display(self, id=None): - """Display the RDC data corresponding to id. - - Keyword Arguments - ~~~~~~~~~~~~~~~~~ - - id: The RDC identification string. + """Display the PCS data corresponding to the alignment id. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + id: The alignment identification string. Examples ~~~~~~~~ - To display the 'phage' RDC data, type: - - relax> rdc.display('phage') - """ - - # Function intro text. - if self.__relax__.interpreter.intro: - text = sys.ps3 + "rdc.display(" + To display the 'phage' PCS data, type: + + relax> pcs.display('phage') + """ + + # Function intro text. + if self.__relax__.interpreter.intro: + text = sys.ps3 + "pcs.display(" text = text + "id=" + `id` + ")" print text @@ -191,18 +191,18 @@ raise RelaxStrError, ('identification string', id) # Execute the functional code. - rdc.display(id=id) + pcs.display(id=id) def read(self, id=None, file=None, dir=None, mol_name_col=None, res_num_col=0, res_name_col=1, spin_num_col=None, spin_name_col=None, data_col=2, error_col=3, sep=None): - """Read the RDC data from file. - - Keyword Arguments - ~~~~~~~~~~~~~~~~~ - - id: The RDC identification string. - - file: The name of the file containing the RDC data. + """Read the PCS data from file. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + id: The PCS identification string. + + file: The name of the file containing the PCS data. dir: The directory where the file is located. @@ -216,7 +216,7 @@ spin_name_col: The spin name column (this defaults to no column). - data_col: The RDC data column (the default is 2). + data_col: The PCS data column (the default is 2). error_col: The experimental error column (the default is 3). @@ -226,15 +226,15 @@ Examples ~~~~~~~~ - The following commands will read the RDC data out of the file 'Tb.txt' where the columns are - separated by the symbol ',', and store the RDCs under the identifier 'Tb'. - - relax> rdc.read('Tb', 'Tb.txt', sep=',') - """ - - # Function intro text. - if self.__relax__.interpreter.intro: - text = sys.ps3 + "rdc.read(" + The following commands will read the PCS data out of the file 'Tb.txt' where the columns are + separated by the symbol ',', and store the PCSs under the identifier 'Tb'. + + relax> pcs.read('Tb', 'Tb.txt', sep=',') + """ + + # Function intro text. + if self.__relax__.interpreter.intro: + text = sys.ps3 + "pcs.read(" text = text + "id=" + `id` text = text + ", file=" + `file` text = text + ", dir=" + `dir` @@ -293,16 +293,16 @@ raise RelaxNoneStrError, ('column separator', sep) # Execute the functional code. - rdc.read(id=id, file=file, dir=dir, mol_name_col=mol_name_col, res_num_col=res_num_col, res_name_col=res_name_col, spin_num_col=spin_num_col, spin_name_col=spin_name_col, data_col=data_col, error_col=error_col, sep=sep) + pcs.read(id=id, file=file, dir=dir, mol_name_col=mol_name_col, res_num_col=res_num_col, res_name_col=res_name_col, spin_num_col=spin_num_col, spin_name_col=spin_name_col, data_col=data_col, error_col=error_col, sep=sep) def write(self, id=None, file=None, dir=None, force=False): - """Write the RDC data to file. - - Keyword Arguments - ~~~~~~~~~~~~~~~~~ - - id: The RDC identification string. + """Write the PCS data to file. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + id: The PCS identification string. file: The name of the file. @@ -315,12 +315,12 @@ ~~~~~~~~~~~ If no directory name is given, the file will be placed in the current working directory. - The 'id' argument are required for selecting which RDC data set will be written to file. - """ - - # Function intro text. - if self.__relax__.interpreter.intro: - text = sys.ps3 + "rdc.write(" + The 'id' argument are required for selecting which PCS data set will be written to file. + """ + + # Function intro text. + if self.__relax__.interpreter.intro: + text = sys.ps3 + "pcs.write(" text = text + "id=" + `id` text = text + ", file=" + `file` text = text + ", dir=" + `dir` @@ -344,4 +344,4 @@ raise RelaxBoolError, ('force flag', force) # Execute the functional code. - rdc.write(id=id, file=file, dir=dir, force=force) + pcs.write(id=id, file=file, dir=dir, force=force)