Package generic_fns :: 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)
Copy spin specific data values from pipe_from to pipe_to.
source code
 
display(param=None)
Display spin specific data values.
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, error=None, pipe=None, spin_id=None, force=True, reset=True)
Set global or spin specific data values.
source code
 
write(param=None, file=None, dir=None, bc=False, force=False, return_value=None)
Write data to a file.
source code
 
write_data(param=None, file=None, bc=False, return_value=None)
The function which actually writes the data.
source code
Variables [hide private]
  status = Status()
  __package__ = 'generic_fns'

Imports: ndarray, sys, minimise, pipes, exists_mol_res_spin_data, generate_spin_id_data_array, return_spin, spin_loop, RelaxError, RelaxNoSequenceError, RelaxNoSpinError, RelaxParamSetError, RelaxValueError, get_file_path, open_write_file, read_spin_data, write_spin_data, specific_fns, Status


Function Details [hide private]

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

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.

display(param=None)

source code 

Display spin specific data values.

Parameters:
  • param (str) - The name of the parameter to display.

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, error=None, pipe=None, spin_id=None, 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.
  • error (None, number, or list of numbers) - The parameter errors.
  • pipe (None or str) - The data pipe the values should be placed in.
  • spin_id (str) - The spin identification string.
  • 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, bc=False, force=False, return_value=None)

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).
  • 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.
  • return_value (None or func) - An optional function which if supplied will override the default value returning function.

write_data(param=None, file=None, bc=False, return_value=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.
  • 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.