Package pipe_control :: Module value
[hide private]
[frames] | no frames]

Module value

source code

Module for the manipulation of parameter and constant values.

Functions [hide private]
 
copy(pipe_from=None, pipe_to=None, param=None, force=False)
Copy spin specific data values from pipe_from to pipe_to.
source code
 
display(param=None, scaling=1.0)
Display spin specific data values.
source code
list of str
get_parameters()
Return a list of the parameters associated with the current data pipe.
source code
tuple of 4 lists
partition_params(val, param)
Function for sorting and partitioning the parameters and their values.
source code
 
read(param=None, scaling=1.0, file=None, dir=None, file_data=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)
Read spin specific data values from a file.
source code
 
set(val=None, param=None, index=None, pipe=None, spin_id=None, verbosity=1, error=False, force=True, reset=True)
Set global or spin specific data values.
source code
 
write(param=None, file=None, dir=None, scaling=1.0, return_value=None, return_data_desc=None, comment=None, bc=False, force=False)
Write data to a file.
source code
 
write_data(param=None, file=None, scaling=1.0, bc=False, return_value=None, return_data_desc=None, comment=None)
The function which actually writes the data.
source code
 
scale(value, scaling)
Scale the given value by the scaling factor, handling all input value types.
source code
Variables [hide private]
  status = Status()
  __package__ = 'pipe_control'

Imports: ndarray, sys, is_num, RelaxError, RelaxNoSequenceError, RelaxParamSetError, RelaxValueError, get_file_path, open_write_file, read_spin_data, write_spin_data, minimise, pipes, exists_mol_res_spin_data, generate_spin_id_unique, spin_loop, check_pipe, add_result_file, return_api, Status


Function Details [hide private]

copy(pipe_from=None, pipe_to=None, param=None, force=False)

source code 

Copy spin specific data values from pipe_from to pipe_to.

Parameters:
  • pipe_from (str) - The data pipe to copy the value from. This defaults to the current data pipe.
  • pipe_to (str) - The data pipe to copy the value to. This defaults to the current data pipe.
  • param (str) - The name of the parameter to copy the values of.
  • force (bool) - A flag forcing the overwriting of current values.

display(param=None, scaling=1.0)

source code 

Display spin specific data values.

Parameters:
  • param (str) - The name of the parameter to display.
  • scaling (float) - The value to scale the parameter by.

get_parameters()

source code 

Return a list of the parameters associated with the current data pipe.

Returns: list of str
The list of parameters.

partition_params(val, param)

source code 

Function for sorting and partitioning the parameters and their values.

The two major partitions are the tensor parameters and the spin specific parameters.

Parameters:
  • val (None, number, or list of numbers) - The parameter values.
  • param (None, str, or list of str) - The parameter names.
Returns: tuple of 4 lists
A tuple, of length 4, of lists. The first and second elements are the lists of spin specific parameters and values respectively. The third and forth elements are the lists of all other parameters and their values.

read(param=None, scaling=1.0, file=None, dir=None, file_data=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)

source code 

Read spin specific data values from a file.

Parameters:
  • param (str) - The name of the parameter to read.
  • scaling (float) - A scaling factor by which all read values are multiplied by.
  • file (str) - The name of the file to open.
  • dir (str or None) - The directory containing the file (defaults to the current directory if None).
  • file_data (list of lists) - An alternative to opening a file, if the data already exists in the correct format. The format is a list of lists where the first index corresponds to the row and the second the column.
  • spin_id_col (int or None) - The column containing the spin ID strings. If supplied, the mol_name_col, res_name_col, res_num_col, spin_name_col, and spin_num_col arguments must be none.
  • mol_name_col (int or None) - The column containing the molecule name information. If supplied, spin_id_col must be None.
  • res_name_col (int or None) - The column containing the residue name information. If supplied, spin_id_col must be None.
  • res_num_col (int or None) - The column containing the residue number information. If supplied, spin_id_col must be None.
  • spin_name_col (int or None) - The column containing the spin name information. If supplied, spin_id_col must be None.
  • spin_num_col (int or None) - The column containing the spin number information. If supplied, spin_id_col must be None.
  • data_col (int or None) - The column containing the RDC data in Hz.
  • error_col (int or None) - The column containing the RDC errors.
  • sep (str or None) - The column separator which, if None, defaults to whitespace.
  • spin_id (None or str) - The spin ID string.

set(val=None, param=None, index=None, pipe=None, spin_id=None, verbosity=1, error=False, force=True, reset=True)

source code 

Set global or spin specific data values.

Parameters:
  • val (None or list) - The parameter values.
  • param (None, str, or list of str) - The parameter names.
  • index (None or int) - The index for parameters which are of the list-type. This is ignored for all other types.
  • pipe (None or str) - The data pipe the values should be placed in.
  • spin_id (str) - The spin identification string.
  • verbosity (int) - The amount of information to print. The higher the value, the greater the verbosity.
  • error (bool) - A flag which if True will allow the parameter errors to be set instead of the values.
  • force (bool) - A flag forcing the overwriting of current values.
  • reset (bool) - A flag which if True will cause all minimisation statistics to be reset.

write(param=None, file=None, dir=None, scaling=1.0, return_value=None, return_data_desc=None, comment=None, bc=False, force=False)

source code 

Write data to a file.

Parameters:
  • param (str) - The name of the parameter to write to file.
  • file (str) - The file to write the data to.
  • dir (str) - The name of the directory to place the file into (defaults to the current directory).
  • scaling (float) - The value to scale the parameter by.
  • return_value (None or func) - An optional function which if supplied will override the default value returning function.
  • return_data_desc (None or func) - An optional function which if supplied will override the default parameter description returning function.
  • comment (str) - Text which will be added to the start of the file as comments. All lines will be prefixed by '# '.
  • bc (bool) - A flag which if True will cause the back calculated values to be written.
  • force (bool) - A flag which if True will cause any pre-existing file to be overwritten.

write_data(param=None, file=None, scaling=1.0, bc=False, return_value=None, return_data_desc=None, comment=None)

source code 

The function which actually writes the data.

Parameters:
  • param (str) - The parameter to write.
  • file (str) - The file to write the data to.
  • scaling (float) - The value to scale the parameter by.
  • bc (bool) - A flag which if True will cause the back calculated values to be written.
  • return_value (None or func) - An optional function which if supplied will override the default value returning function.
  • return_data_desc (None or func) - An optional function which if supplied will override the default parameter description returning function.
  • comment (str) - Text which will be added to the start of the file as comments. All lines will be prefixed by '# '.

scale(value, scaling)

source code 

Scale the given value by the scaling factor, handling all input value types.

Parameters:
  • value (anything) - The value to scale.
  • scaling (float) - The scaling factor.