Package prompt :: Module value :: Class Value
[hide private]
[frames] | no frames]

Class Value

source code


Class for setting data values.

Instance Methods [hide private]
 
copy(self, pipe_from=None, pipe_to=None, param=None)
Copy spin specific data values from one data pipe to another.
source code
 
display(self, param=None)
Display spin specific data values.
source code
 
read(self, param=None, scaling=1.0, 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)
Read spin specific data values from a file.
source code
 
set(self, val=None, param=None, spin_id=None)
Set spin specific data values.
source code
 
write(self, param=None, file=None, dir=None, bc=False, force=False)
Write spin specific data values to a file.
source code

Inherited from base_class.User_fn_class: __init__

Method Details [hide private]

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

source code 
Copy spin specific data values from one data pipe to another.

Keyword Arguments
~~~~~~~~~~~~~~~~~

pipe_from:  The name of the pipe to copy from.

pipe_to:  The name of the pipe to copy to.

param:  The parameter to copy.  Only one parameter may be selected.


Description
~~~~~~~~~~~

If this is used to change values of previously minimised parameters, then the minimisation
statistics (chi-squared value, iteration count, function count, gradient count, and Hessian count)
will be reset.


Examples
~~~~~~~~

To copy the CSA values from the data pipe 'm1' to 'm2', type:

relax> value.copy('m1', 'm2', 'csa')


Regular expression
~~~~~~~~~~~~~~~~~~

The python function 'match', which uses regular expression, is used to determine which data type to
set values to, therefore various data_type strings can be used to select the same data type.
Patterns used for matching for specific data types are listed below.

This is a short description of python regular expression, for more information see the regular
expression syntax section of the Python Library Reference.  Some of the regular expression syntax
used in this function is:

    '[]':  A sequence or set of characters to match to a single character.  For example, '[sS]2'
WILL match both 'S2' and 's2'.

    '^':  Match the start of the string.

    '$':  Match the end of the string.  For example, '^[Ss]2$' will match 's2' but not 'S2f' or
's2s'.

    '.':  Match any character.

    'x*':  Match the character 'x' any number of times, for example 'x' will match, as will 'xxxxx'.

    '.*':  Match any sequence of characters of any length.

Importantly, do not supply a string for the data type containing regular expression.  The regular
expression is implemented so that various strings can be supplied which all match the same data
type.


Model-free set details
~~~~~~~~~~~~~~~~~~~~~~

Setting a parameter value may have no effect depending on which model-free model is chosen, for
example if S2f values and S2s values are set but the run corresponds to model-free model 'm4' then,
because these data values are not parameters of the model, they will have no effect.

Note that the Rex values are scaled quadratically with field strength and should be supplied as a
field strength independent value.  Use the following formula to get the correct value:

    value = rex / (2.0 * pi * frequency) ** 2

where:
    rex is the chemical exchange value for the current frequency.
    pi is in the namespace of relax, ie just type 'pi'.
    frequency is the proton frequency corresponding to the data.


Model-free data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_____________________________________________
|                        |                  |
| Data type              | Object name      |
|________________________|__________________|
|                        |                  |
| Local tm               | 'local_tm'       |
|                        |                  |
| Order parameter S2     | 's2'             |
|                        |                  |
| Order parameter S2f    | 's2f'            |
|                        |                  |
| Order parameter S2s    | 's2s'            |
|                        |                  |
| Correlation time te    | 'te'             |
|                        |                  |
| Correlation time tf    | 'tf'             |
|                        |                  |
| Correlation time ts    | 'ts'             |
|                        |                  |
| Chemical exchange      | 'rex'            |
|                        |                  |
| Bond length            | 'r'              |
|                        |                  |
| CSA                    | 'csa'            |
|                        |                  |
| Heteronucleus type     | 'heteronuc_type' |
|                        |                  |
| Proton type            | 'proton_type'    |
|________________________|__________________|


Reduced spectral density mapping set details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In reduced spectral density mapping, three values must be set prior to the calculation of spectral
density values:  the bond length, CSA, and heteronucleus type.


Reduced spectral density mapping data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_____________________________________________
|                        |                  |
| Data type              | Object name      |
|________________________|__________________|
|                        |                  |
| J(0)                   | 'j0'             |
|                        |                  |
| J(wX)                  | 'jwx'            |
|                        |                  |
| J(wH)                  | 'jwh'            |
|                        |                  |
| Bond length            | 'r'              |
|                        |                  |
| CSA                    | 'csa'            |
|                        |                  |
| Heteronucleus type     | 'heteronuc_type' |
|                        |                  |
| Proton type            | 'proton_type'    |
|________________________|__________________|


Relaxation curve fitting set details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Only three parameters can be set, the relaxation rate (Rx), the initial intensity (I0), and the
intensity at infinity (Iinf).  Setting the parameter Iinf has no effect if the chosen model is that
of the exponential curve which decays to zero.


Relaxation curve fitting data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________
|                                   |                      |
| Data type                         | Object name          |
|___________________________________|______________________|
|                                   |                      |
| Relaxation rate                   | 'rx'                 |
|                                   |                      |
| Peak intensities (series)         | 'intensities'        |
|                                   |                      |
| Initial intensity                 | 'i0'                 |
|                                   |                      |
| Intensity at infinity             | 'iinf'               |
|                                   |                      |
| Relaxation period times (series)  | 'relax_times'        |
|___________________________________|______________________|


N-state model set details
~~~~~~~~~~~~~~~~~~~~~~~~~

Setting parameters for the N-state model is a little different from the other type of analyses as
each state has a set of parameters with the same names as the other states. To set the parameters
for a specific state c (ranging from 0 for the first to N-1 for the last, the number c should be
added to the end of the parameter name.  So the Euler angle gamma of the third state is specified
using the string 'gamma2'.


N-state model data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________________________________________
|                        |                             |                                   |
| Data type              | Object name                 | Patterns                          |
|________________________|_____________________________|___________________________________|
|                        |                             |                                   |
| Probabilities          | 'probs'                     | 'p0', 'p1', 'p2', ..., 'pN'       |
|                        |                             |                                   |
| Euler angle alpha      | 'alpha'                     | 'alpha0', 'alpha1', ...           |
|                        |                             |                                   |
| Euler angle beta       | 'beta'                      | 'beta0', 'beta1', ...             |
|                        |                             |                                   |
| Euler angle gamma      | 'gamma'                     | 'gamma0', 'gamma1', ...           |
|                        |                             |                                   |
| Bond length            | 'r'                         | '^r$' or '[Bb]ond[ -_][Ll]ength'  |
|                        |                             |                                   |
| Heteronucleus type     | 'heteronuc_type'            | '^[Hh]eteronucleus$'              |
|                        |                             |                                   |
| Proton type            | 'proton_type'               | '^[Pp]roton$'                     |
|________________________|_____________________________|___________________________________|

The objects corresponding to the object names are lists (or arrays) with each element corrsponding
to each state.

display(self, param=None)

source code 
Display spin specific data values.

Keyword Arguments
~~~~~~~~~~~~~~~~~

param:  The parameter to display.  Only one parameter may be selected.



Examples
~~~~~~~~

To show all CSA values, type:

relax> value.display('csa')


Regular expression
~~~~~~~~~~~~~~~~~~

The python function 'match', which uses regular expression, is used to determine which data type to
set values to, therefore various data_type strings can be used to select the same data type.
Patterns used for matching for specific data types are listed below.

This is a short description of python regular expression, for more information see the regular
expression syntax section of the Python Library Reference.  Some of the regular expression syntax
used in this function is:

    '[]':  A sequence or set of characters to match to a single character.  For example, '[sS]2'
WILL match both 'S2' and 's2'.

    '^':  Match the start of the string.

    '$':  Match the end of the string.  For example, '^[Ss]2$' will match 's2' but not 'S2f' or
's2s'.

    '.':  Match any character.

    'x*':  Match the character 'x' any number of times, for example 'x' will match, as will 'xxxxx'.

    '.*':  Match any sequence of characters of any length.

Importantly, do not supply a string for the data type containing regular expression.  The regular
expression is implemented so that various strings can be supplied which all match the same data
type.


Model-free data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_____________________________________________
|                        |                  |
| Data type              | Object name      |
|________________________|__________________|
|                        |                  |
| Local tm               | 'local_tm'       |
|                        |                  |
| Order parameter S2     | 's2'             |
|                        |                  |
| Order parameter S2f    | 's2f'            |
|                        |                  |
| Order parameter S2s    | 's2s'            |
|                        |                  |
| Correlation time te    | 'te'             |
|                        |                  |
| Correlation time tf    | 'tf'             |
|                        |                  |
| Correlation time ts    | 'ts'             |
|                        |                  |
| Chemical exchange      | 'rex'            |
|                        |                  |
| Bond length            | 'r'              |
|                        |                  |
| CSA                    | 'csa'            |
|                        |                  |
| Heteronucleus type     | 'heteronuc_type' |
|                        |                  |
| Proton type            | 'proton_type'    |
|________________________|__________________|


Reduced spectral density mapping data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_____________________________________________
|                        |                  |
| Data type              | Object name      |
|________________________|__________________|
|                        |                  |
| J(0)                   | 'j0'             |
|                        |                  |
| J(wX)                  | 'jwx'            |
|                        |                  |
| J(wH)                  | 'jwh'            |
|                        |                  |
| Bond length            | 'r'              |
|                        |                  |
| CSA                    | 'csa'            |
|                        |                  |
| Heteronucleus type     | 'heteronuc_type' |
|                        |                  |
| Proton type            | 'proton_type'    |
|________________________|__________________|


NOE calculation data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_________________________________________
|                        |              |
| Data type              | Object name  |
|________________________|______________|
|                        |              |
| Reference intensity    | 'ref'        |
|                        |              |
| Saturated intensity    | 'sat'        |
|                        |              |
| NOE                    | 'noe'        |
|________________________|______________|


Relaxation curve fitting data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________
|                                   |                      |
| Data type                         | Object name          |
|___________________________________|______________________|
|                                   |                      |
| Relaxation rate                   | 'rx'                 |
|                                   |                      |
| Peak intensities (series)         | 'intensities'        |
|                                   |                      |
| Initial intensity                 | 'i0'                 |
|                                   |                      |
| Intensity at infinity             | 'iinf'               |
|                                   |                      |
| Relaxation period times (series)  | 'relax_times'        |
|___________________________________|______________________|


N-state model data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________________________________________
|                        |                             |                                   |
| Data type              | Object name                 | Patterns                          |
|________________________|_____________________________|___________________________________|
|                        |                             |                                   |
| Probabilities          | 'probs'                     | 'p0', 'p1', 'p2', ..., 'pN'       |
|                        |                             |                                   |
| Euler angle alpha      | 'alpha'                     | 'alpha0', 'alpha1', ...           |
|                        |                             |                                   |
| Euler angle beta       | 'beta'                      | 'beta0', 'beta1', ...             |
|                        |                             |                                   |
| Euler angle gamma      | 'gamma'                     | 'gamma0', 'gamma1', ...           |
|                        |                             |                                   |
| Bond length            | 'r'                         | '^r$' or '[Bb]ond[ -_][Ll]ength'  |
|                        |                             |                                   |
| Heteronucleus type     | 'heteronuc_type'            | '^[Hh]eteronucleus$'              |
|                        |                             |                                   |
| Proton type            | 'proton_type'               | '^[Pp]roton$'                     |
|________________________|_____________________________|___________________________________|

The objects corresponding to the object names are lists (or arrays) with each element corrsponding
to each state.

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

source code 
Read spin specific data values from a file.

Keyword Arguments
~~~~~~~~~~~~~~~~~

param:  The parameter.  Only one parameter may be selected.

scaling:  The factor to scale parameters by.

file:  The name of the file containing the values.

dir:  The directory where the file is located.

spin_id_col:  The spin ID string column (an alternative to the mol, res, and spin name and number
columns).

mol_name_col:  The molecule name column (alternative to the spin_id_col).

res_num_col:  The residue number column (alternative to the spin_id_col).

res_name_col:  The residue name column (alternative to the spin_id_col).

spin_num_col:  The spin number column (alternative to the spin_id_col).

spin_name_col:  The spin name column (alternative to the spin_id_col).

data_col:  The RDC data column.

error_col:  The experimental error column.

sep:  The column separator (the default is white space).

spin_id:  The spin ID string to restrict the loading of data to certain spin subsets.


Description
~~~~~~~~~~~

The spin system can be identified in the file using two different formats.  The first is the spin ID
string column which can include the molecule name, the residue name and number, and the spin name
and number.  Alternatively the molecule name, residue number, residue name, spin number and/or spin
name columns can be supplied allowing this information to be in separate columns.  Note that the
numbering of columns starts at one.  The spin ID string can be used to restrict the reading to
certain spin types, for example only 15N spins when only residue information is in the file.

If this is used to change values of previously minimised parameters, then the minimisation
statistics (chi-squared value, iteration count, function count, gradient count, and Hessian count)
will be reset.


Examples
~~~~~~~~

To load 15N CSA values from the file 'csa_values' in the directory 'data', where spins are
only identified by residue name and number, type one of the following:

relax> value.read('csa', 'data/csa_value', spin_id='@N')
relax> value.read('csa', 'csa_value', dir='data', spin_id='@N')
relax> value.read(param='csa', file='csa_value', dir='data', res_num_col=1, res_name_col=2,
                  data_col=3, error_col=4, spin_id='@N')


Regular expression
~~~~~~~~~~~~~~~~~~

The python function 'match', which uses regular expression, is used to determine which data type to
set values to, therefore various data_type strings can be used to select the same data type.
Patterns used for matching for specific data types are listed below.

This is a short description of python regular expression, for more information see the regular
expression syntax section of the Python Library Reference.  Some of the regular expression syntax
used in this function is:

    '[]':  A sequence or set of characters to match to a single character.  For example, '[sS]2'
WILL match both 'S2' and 's2'.

    '^':  Match the start of the string.

    '$':  Match the end of the string.  For example, '^[Ss]2$' will match 's2' but not 'S2f' or
's2s'.

    '.':  Match any character.

    'x*':  Match the character 'x' any number of times, for example 'x' will match, as will 'xxxxx'.

    '.*':  Match any sequence of characters of any length.

Importantly, do not supply a string for the data type containing regular expression.  The regular
expression is implemented so that various strings can be supplied which all match the same data
type.


Model-free set details
~~~~~~~~~~~~~~~~~~~~~~

Setting a parameter value may have no effect depending on which model-free model is chosen, for
example if S2f values and S2s values are set but the run corresponds to model-free model 'm4' then,
because these data values are not parameters of the model, they will have no effect.

Note that the Rex values are scaled quadratically with field strength and should be supplied as a
field strength independent value.  Use the following formula to get the correct value:

    value = rex / (2.0 * pi * frequency) ** 2

where:
    rex is the chemical exchange value for the current frequency.
    pi is in the namespace of relax, ie just type 'pi'.
    frequency is the proton frequency corresponding to the data.


Model-free data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_____________________________________________
|                        |                  |
| Data type              | Object name      |
|________________________|__________________|
|                        |                  |
| Local tm               | 'local_tm'       |
|                        |                  |
| Order parameter S2     | 's2'             |
|                        |                  |
| Order parameter S2f    | 's2f'            |
|                        |                  |
| Order parameter S2s    | 's2s'            |
|                        |                  |
| Correlation time te    | 'te'             |
|                        |                  |
| Correlation time tf    | 'tf'             |
|                        |                  |
| Correlation time ts    | 'ts'             |
|                        |                  |
| Chemical exchange      | 'rex'            |
|                        |                  |
| Bond length            | 'r'              |
|                        |                  |
| CSA                    | 'csa'            |
|                        |                  |
| Heteronucleus type     | 'heteronuc_type' |
|                        |                  |
| Proton type            | 'proton_type'    |
|________________________|__________________|


Reduced spectral density mapping set details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In reduced spectral density mapping, three values must be set prior to the calculation of spectral
density values:  the bond length, CSA, and heteronucleus type.


Reduced spectral density mapping data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_____________________________________________
|                        |                  |
| Data type              | Object name      |
|________________________|__________________|
|                        |                  |
| J(0)                   | 'j0'             |
|                        |                  |
| J(wX)                  | 'jwx'            |
|                        |                  |
| J(wH)                  | 'jwh'            |
|                        |                  |
| Bond length            | 'r'              |
|                        |                  |
| CSA                    | 'csa'            |
|                        |                  |
| Heteronucleus type     | 'heteronuc_type' |
|                        |                  |
| Proton type            | 'proton_type'    |
|________________________|__________________|


Relaxation curve fitting set details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Only three parameters can be set, the relaxation rate (Rx), the initial intensity (I0), and the
intensity at infinity (Iinf).  Setting the parameter Iinf has no effect if the chosen model is that
of the exponential curve which decays to zero.


Relaxation curve fitting data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________
|                                   |                      |
| Data type                         | Object name          |
|___________________________________|______________________|
|                                   |                      |
| Relaxation rate                   | 'rx'                 |
|                                   |                      |
| Peak intensities (series)         | 'intensities'        |
|                                   |                      |
| Initial intensity                 | 'i0'                 |
|                                   |                      |
| Intensity at infinity             | 'iinf'               |
|                                   |                      |
| Relaxation period times (series)  | 'relax_times'        |
|___________________________________|______________________|


N-state model set details
~~~~~~~~~~~~~~~~~~~~~~~~~

Setting parameters for the N-state model is a little different from the other type of analyses as
each state has a set of parameters with the same names as the other states. To set the parameters
for a specific state c (ranging from 0 for the first to N-1 for the last, the number c should be
added to the end of the parameter name.  So the Euler angle gamma of the third state is specified
using the string 'gamma2'.


N-state model data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________________________________________
|                        |                             |                                   |
| Data type              | Object name                 | Patterns                          |
|________________________|_____________________________|___________________________________|
|                        |                             |                                   |
| Probabilities          | 'probs'                     | 'p0', 'p1', 'p2', ..., 'pN'       |
|                        |                             |                                   |
| Euler angle alpha      | 'alpha'                     | 'alpha0', 'alpha1', ...           |
|                        |                             |                                   |
| Euler angle beta       | 'beta'                      | 'beta0', 'beta1', ...             |
|                        |                             |                                   |
| Euler angle gamma      | 'gamma'                     | 'gamma0', 'gamma1', ...           |
|                        |                             |                                   |
| Bond length            | 'r'                         | '^r$' or '[Bb]ond[ -_][Ll]ength'  |
|                        |                             |                                   |
| Heteronucleus type     | 'heteronuc_type'            | '^[Hh]eteronucleus$'              |
|                        |                             |                                   |
| Proton type            | 'proton_type'               | '^[Pp]roton$'                     |
|________________________|_____________________________|___________________________________|

The objects corresponding to the object names are lists (or arrays) with each element corrsponding
to each state.

set(self, val=None, param=None, spin_id=None)

source code 
Set spin specific data values.

Keyword Arguments
~~~~~~~~~~~~~~~~~

val:  The value(s).

param:  The parameter(s).

spin_id:  The spin identifier.


Description
~~~~~~~~~~~

If this function is used to change values of previously minimised results, then the minimisation
statistics (chi-squared value, iteration count, function count, gradient count, and Hessian count)
will be reset to None.


The val argument can be None, a single value, or an array of values while the parameter argument can
be None, a string, or array of strings.  The choice of which combination determines the behaviour of
this function.  The following table describes what occurs in each instance.  The Value column refers
to the 'val' argument while the Param column refers to the 'param' argument.  In these columns,
'None' corresponds to None, '1' corresponds to either a single value or single string, and 'n'
corresponds to either an array of values or an array of strings.

____________________________________________________________________________________________
|       |       |                                                                          |
| Value | Param | Description                                                              |
|_______|_______|__________________________________________________________________________|
|       |       |                                                                          |
| None  | None  | This case is used to set the model parameters prior to minimisation or   |
|       |       | calculation.  The model parameters are set to the default values.        |
|       |       |                                                                          |
|   1   | None  | Invalid combination.                                                     |
|       |       |                                                                          |
|   n   | None  | This case is used to set the model parameters prior to minimisation or   |
|       |       | calculation.  The length of the val array must be equal to the number    |
|       |       | of model parameters.  The parameters will be set to the corresponding    |
|       |       | number.                                                                  |
|       |       |                                                                          |
| None  |   1   | The parameter matching the string will be set to the default value.      |
|       |       |                                                                          |
|   1   |   1   | The parameter matching the string will be set to the supplied number.    |
|       |       |                                                                          |
|   n   |   1   | Invalid combination.                                                     |
|       |       |                                                                          |
| None  |   n   | Each parameter matching the strings will be set to the default values.   |
|       |       |                                                                          |
|   1   |   n   | Each parameter matching the strings will be set to the supplied number.  |
|       |       |                                                                          |
|   n   |   n   | Each parameter matching the strings will be set to the corresponding     |
|       |       | number.  Both arrays must be of equal length.                            |
|_______|_______|__________________________________________________________________________|


Examples
~~~~~~~~

To set the parameter values for the current data pipe to the default values, for all spins,
type:

relax> value.set()


To set the parameter values of residue 10, which is in the current model-free data pipe 'm4'
and has the parameters {S2, te, Rex}, the following can be used.  Rex term is the value for
the first given field strength.

relax> value.set([0.97, 2.048*1e-9, 0.149], spin_id=':10')
relax> value.set(val=[0.97, 2.048*1e-9, 0.149], spin_id=':10')


To set the CSA value of all spins to the default value, type:

relax> value.set(param='csa')


To set the CSA value of all spins to -172 ppm, type:

relax> value.set(-172 * 1e-6, 'csa')
relax> value.set(val=-172 * 1e-6, param='csa')


To set the NH bond length of all spins to 1.02 Angstroms, type:

relax> value.set(1.02 * 1e-10, 'r')
relax> value.set(val=1.02 * 1e-10, param='r')


To set both the bond length and the CSA value to the default values, type:

relax> value.set(param=['r', 'csa'])


To set both tf and ts to 100 ps, type:

relax> value.set(100e-12, ['tf', 'ts'])
relax> value.set(val=100e-12, param=['tf', 'ts'])


To set the S2 and te parameter values of residue 126, Ca spins to 0.56 and 13 ps, type:

relax> value.set([0.56, 13e-12], ['s2', 'te'], ':126@Ca')
relax> value.set(val=[0.56, 13e-12], param=['s2', 'te'], spin_id=':126@Ca')
relax> value.set(val=[0.56, 13e-12], param=['s2', 'te'], spin_id=':126@Ca')


Spin identification
~~~~~~~~~~~~~~~~~~~

If the spin ID is left unset, then this will be applied to all spins.  If the data is global non-
spin specific data, such as diffusion tensor parameters, supplying the spin identifier will
terminate the program with an error.


Regular expression
~~~~~~~~~~~~~~~~~~

The python function 'match', which uses regular expression, is used to determine which data type to
set values to, therefore various data_type strings can be used to select the same data type.
Patterns used for matching for specific data types are listed below.

This is a short description of python regular expression, for more information see the regular
expression syntax section of the Python Library Reference.  Some of the regular expression syntax
used in this function is:

    '[]':  A sequence or set of characters to match to a single character.  For example, '[sS]2'
WILL match both 'S2' and 's2'.

    '^':  Match the start of the string.

    '$':  Match the end of the string.  For example, '^[Ss]2$' will match 's2' but not 'S2f' or
's2s'.

    '.':  Match any character.

    'x*':  Match the character 'x' any number of times, for example 'x' will match, as will 'xxxxx'.

    '.*':  Match any sequence of characters of any length.

Importantly, do not supply a string for the data type containing regular expression.  The regular
expression is implemented so that various strings can be supplied which all match the same data
type.


Model-free set details
~~~~~~~~~~~~~~~~~~~~~~

Setting a parameter value may have no effect depending on which model-free model is chosen, for
example if S2f values and S2s values are set but the run corresponds to model-free model 'm4' then,
because these data values are not parameters of the model, they will have no effect.

Note that the Rex values are scaled quadratically with field strength and should be supplied as a
field strength independent value.  Use the following formula to get the correct value:

    value = rex / (2.0 * pi * frequency) ** 2

where:
    rex is the chemical exchange value for the current frequency.
    pi is in the namespace of relax, ie just type 'pi'.
    frequency is the proton frequency corresponding to the data.


Model-free data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_____________________________________________
|                        |                  |
| Data type              | Object name      |
|________________________|__________________|
|                        |                  |
| Local tm               | 'local_tm'       |
|                        |                  |
| Order parameter S2     | 's2'             |
|                        |                  |
| Order parameter S2f    | 's2f'            |
|                        |                  |
| Order parameter S2s    | 's2s'            |
|                        |                  |
| Correlation time te    | 'te'             |
|                        |                  |
| Correlation time tf    | 'tf'             |
|                        |                  |
| Correlation time ts    | 'ts'             |
|                        |                  |
| Chemical exchange      | 'rex'            |
|                        |                  |
| Bond length            | 'r'              |
|                        |                  |
| CSA                    | 'csa'            |
|                        |                  |
| Heteronucleus type     | 'heteronuc_type' |
|                        |                  |
| Proton type            | 'proton_type'    |
|________________________|__________________|


Model-free default values
~~~~~~~~~~~~~~~~~~~~~~~~~

_______________________________________________________________________________________
|                                       |                    |                        |
| Data type                             | Object name        | Value                  |
|_______________________________________|____________________|________________________|
|                                       |                    |                        |
| Local tm                              | 'local_tm'         | 10 * 1e-9              |
|                                       |                    |                        |
| Order parameters S2, S2f, and S2s     | 's2', 's2f', 's2s' | 0.8                    |
|                                       |                    |                        |
| Correlation time te                   | 'te'               | 100 * 1e-12            |
|                                       |                    |                        |
| Correlation time tf                   | 'tf'               | 10 * 1e-12             |
|                                       |                    |                        |
| Correlation time ts                   | 'ts'               | 1000 * 1e-12           |
|                                       |                    |                        |
| Chemical exchange relaxation          | 'rex'              | 0.0                    |
|                                       |                    |                        |
| Bond length                           | 'r'                | 1.02 * 1e-10           |
|                                       |                    |                        |
| CSA                                   | 'csa'              | -172 * 1e-6            |
|                                       |                    |                        |
| Heteronucleus type                    | 'heteronuc_type'   | '15N'                  |
|                                       |                    |                        |
| Proton type                           | 'proton_type'      | '1H'                   |
|_______________________________________|____________________|________________________|


Reduced spectral density mapping set details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In reduced spectral density mapping, three values must be set prior to the calculation of spectral
density values:  the bond length, CSA, and heteronucleus type.


Reduced spectral density mapping data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_____________________________________________
|                        |                  |
| Data type              | Object name      |
|________________________|__________________|
|                        |                  |
| J(0)                   | 'j0'             |
|                        |                  |
| J(wX)                  | 'jwx'            |
|                        |                  |
| J(wH)                  | 'jwh'            |
|                        |                  |
| Bond length            | 'r'              |
|                        |                  |
| CSA                    | 'csa'            |
|                        |                  |
| Heteronucleus type     | 'heteronuc_type' |
|                        |                  |
| Proton type            | 'proton_type'    |
|________________________|__________________|


Reduced spectral density mapping default values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These default values are found in the file 'physical_constants.py'.

_______________________________________________________________________________________
|                                       |                    |                        |
| Data type                             | Object name        | Value                  |
|_______________________________________|____________________|________________________|
|                                       |                    |                        |
| Bond length                           | 'r'                | 1.02 * 1e-10           |
|                                       |                    |                        |
| CSA                                   | 'csa'              | -172 * 1e-6            |
|                                       |                    |                        |
| Heteronucleus type                    | 'heteronuc_type'   | '15N'                  |
|                                       |                    |                        |
| Proton type                           | 'proton_type'      | '1H'                   |
|_______________________________________|____________________|________________________|


Diffusion tensor set details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If the diffusion tensor has not been setup, use the more powerful function 'diffusion_tensor.init'
to initialise the tensor parameters.  This function cannot be used to initialise a diffusion tensor.

The units of the parameters are:

    Inverse seconds for tm.
    Seconds for Diso, Da, Dx, Dy, Dz, Dpar, Dper.
    Unitless for Dratio and Dr.
    Radians for all angles (alpha, beta, gamma, theta, phi).

When setting a diffusion tensor parameter, the residue number has no effect.  As the internal
parameters of spherical diffusion are {tm}, spheroidal diffusion are {tm, Da, theta, phi}, and
ellipsoidal diffusion are {tm, Da, Dr, alpha, beta, gamma}, supplying geometric parameters must be
done in the following way.  If a single geometric parameter is supplied, it must be one of tm, Diso,
Da, Dr, or Dratio.  For the parameters Dpar, Dper, Dx, Dy, and Dx, it is not possible to determine
how to use the currently set values together with the supplied value to calculate the new internal
parameters.  For spheroidal diffusion, when supplying multiple geometric parameters, the set must
belong to one of

    {tm, Da},
    {Diso, Da},
    {tm, Dratio},
    {Dpar, Dper},
    {Diso, Dratio},

where either theta, phi, or both orientational parameters can be additionally supplied.  For
ellipsoidal diffusion, again when supplying multiple geometric parameters, the set must belong to
one of

    {tm, Da, Dr},
    {Diso, Da, Dr},
    {Dx, Dy, Dz},

where any number of the orientational parameters, alpha, beta, or gamma can be additionally
supplied.


Diffusion tensor parameter string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________________________________________
|                                                        |              |                  |
| Data type                                              | Object name  | Patterns         |
|________________________________________________________|______________|__________________|
|                                                        |              |                  |
| Global correlation time - tm                           | 'tm'         | '^tm$'           |
|                                                        |              |                  |
| Isotropic component of the diffusion tensor - Diso     | 'Diso'       | '[Dd]iso'        |
|                                                        |              |                  |
| Anisotropic component of the diffusion tensor - Da     | 'Da'         | '[Dd]a'          |
|                                                        |              |                  |
| Rhombic component of the diffusion tensor - Dr         | 'Dr'         | '[Dd]r$'         |
|                                                        |              |                  |
| Eigenvalue associated with the x-axis of the diffusion | 'Dx'         | '[Dd]x'          |
| diffusion tensor - Dx                                  |              |                  |
|                                                        |              |                  |
| Eigenvalue associated with the y-axis of the diffusion | 'Dy'         | '[Dd]y'          |
| diffusion tensor - Dy                                  |              |                  |
|                                                        |              |                  |
| Eigenvalue associated with the z-axis of the diffusion | 'Dz'         | '[Dd]z'          |
| diffusion tensor - Dz                                  |              |                  |
|                                                        |              |                  |
| Diffusion coefficient parallel to the major axis of    | 'Dpar'       | '[Dd]par'        |
| the spheroid diffusion tensor - Dpar                   |              |                  |
|                                                        |              |                  |
| Diffusion coefficient perpendicular to the major axis  | 'Dper'       | '[Dd]per'        |
| of the spheroid diffusion tensor - Dper                |              |                  |
|                                                        |              |                  |
| Ratio of the parallel and perpendicular components of  | 'Dratio'     | '[Dd]ratio'      |
| the spheroid diffusion tensor - Dratio                 |              |                  |
|                                                        |              |                  |
| The first Euler angle of the ellipsoid diffusion       | 'alpha'      | '^a$' or 'alpha' |
| tensor - alpha                                         |              |                  |
|                                                        |              |                  |
| The second Euler angle of the ellipsoid diffusion      | 'beta'       | '^b$' or 'beta'  |
| tensor - beta                                          |              |                  |
|                                                        |              |                  |
| The third Euler angle of the ellipsoid diffusion       | 'gamma'      | '^g$' or 'gamma' |
| tensor - gamma                                         |              |                  |
|                                                        |              |                  |
| The polar angle defining the major axis of the         | 'theta'      | 'theta'          |
| spheroid diffusion tensor - theta                      |              |                  |
|                                                        |              |                  |
| The azimuthal angle defining the major axis of the     | 'phi'        | 'phi'            |
| spheroid diffusion tensor - phi                        |              |                  |
|________________________________________________________|______________|__________________|


Diffusion tensor parameter default values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

________________________________________________________________________
|                        |                    |                        |
| Data type              | Object name        | Value                  |
|________________________|____________________|________________________|
|                        |                    |                        |
| tm                     | 'tm'               | 10 * 1e-9              |
|                        |                    |                        |
| Diso                   | 'Diso'             | 1.666 * 1e7            |
|                        |                    |                        |
| Da                     | 'Da'               | 0.0                    |
|                        |                    |                        |
| Dr                     | 'Dr'               | 0.0                    |
|                        |                    |                        |
| Dx                     | 'Dx'               | 1.666 * 1e7            |
|                        |                    |                        |
| Dy                     | 'Dy'               | 1.666 * 1e7            |
|                        |                    |                        |
| Dz                     | 'Dz'               | 1.666 * 1e7            |
|                        |                    |                        |
| Dpar                   | 'Dpar'             | 1.666 * 1e7            |
|                        |                    |                        |
| Dper                   | 'Dper'             | 1.666 * 1e7            |
|                        |                    |                        |
| Dratio                 | 'Dratio'           | 1.0                    |
|                        |                    |                        |
| alpha                  | 'alpha'            | 0.0                    |
|                        |                    |                        |
| beta                   | 'beta'             | 0.0                    |
|                        |                    |                        |
| gamma                  | 'gamma'            | 0.0                    |
|                        |                    |                        |
| theta                  | 'theta'            | 0.0                    |
|                        |                    |                        |
| phi                    | 'phi'              | 0.0                    |
|________________________|____________________|________________________|


Relaxation curve fitting set details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Only three parameters can be set, the relaxation rate (Rx), the initial intensity (I0), and the
intensity at infinity (Iinf).  Setting the parameter Iinf has no effect if the chosen model is that
of the exponential curve which decays to zero.


Relaxation curve fitting data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________
|                                   |                      |
| Data type                         | Object name          |
|___________________________________|______________________|
|                                   |                      |
| Relaxation rate                   | 'rx'                 |
|                                   |                      |
| Peak intensities (series)         | 'intensities'        |
|                                   |                      |
| Initial intensity                 | 'i0'                 |
|                                   |                      |
| Intensity at infinity             | 'iinf'               |
|                                   |                      |
| Relaxation period times (series)  | 'relax_times'        |
|___________________________________|______________________|


Relaxation curve fitting default values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These values are completely arbitrary as peak heights (or volumes) are extremely variable and the Rx
value is a compensation for both the R1 and R2 values.
___________________________________________________________________
|                        |               |                        |
| Data type              | Object name   | Value                  |
|________________________|_______________|________________________|
|                        |               |                        |
| Relaxation rate        | 'rx'          | 8.0                    |
|                        |               |                        |
| Initial intensity      | 'i0'          | 10000.0                |
|                        |               |                        |
| Intensity at infinity  | 'iinf'        | 0.0                    |
|                        |               |                        |
|________________________|_______________|________________________|


N-state model set details
~~~~~~~~~~~~~~~~~~~~~~~~~

Setting parameters for the N-state model is a little different from the other type of analyses as
each state has a set of parameters with the same names as the other states. To set the parameters
for a specific state c (ranging from 0 for the first to N-1 for the last, the number c should be
added to the end of the parameter name.  So the Euler angle gamma of the third state is specified
using the string 'gamma2'.


N-state model data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________________________________________
|                        |                             |                                   |
| Data type              | Object name                 | Patterns                          |
|________________________|_____________________________|___________________________________|
|                        |                             |                                   |
| Probabilities          | 'probs'                     | 'p0', 'p1', 'p2', ..., 'pN'       |
|                        |                             |                                   |
| Euler angle alpha      | 'alpha'                     | 'alpha0', 'alpha1', ...           |
|                        |                             |                                   |
| Euler angle beta       | 'beta'                      | 'beta0', 'beta1', ...             |
|                        |                             |                                   |
| Euler angle gamma      | 'gamma'                     | 'gamma0', 'gamma1', ...           |
|                        |                             |                                   |
| Bond length            | 'r'                         | '^r$' or '[Bb]ond[ -_][Ll]ength'  |
|                        |                             |                                   |
| Heteronucleus type     | 'heteronuc_type'            | '^[Hh]eteronucleus$'              |
|                        |                             |                                   |
| Proton type            | 'proton_type'               | '^[Pp]roton$'                     |
|________________________|_____________________________|___________________________________|

The objects corresponding to the object names are lists (or arrays) with each element corrsponding
to each state.


N-state model default values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

______________________________________________________________________________________
|                             |                             |                        |
| Data type                   | Object name                 | Value                  |
|_____________________________|_____________________________|________________________|
|                             |                             |                        |
| Probabilities               | 'p0', 'p1', 'p2', ..., 'pN' | 1/N                    |
|                             |                             |                        |
| Euler angle alpha           | 'alpha0', 'alpha1', ...     | (c+1) * pi / (N+1)     |
|                             |                             |                        |
| Euler angle beta            | 'beta0', 'beta1', ...       | (c+1) * pi / (N+1)     |
|                             |                             |                        |
| Euler angle gamma           | 'gamma0', 'gamma1', ...     | (c+1) * pi / (N+1)     |
|_____________________________|_____________________________|________________________|

In this table, N is the total number of states and c is the index of a given state ranging from 0 to
N-1.  The default probabilities are all set to be equal whereas the angles are given a range of
values so that no 2 states are equal at the start of optimisation.

Note that setting the probability for state N will do nothing as it is equal to one minus all the
other probabilities.

write(self, param=None, file=None, dir=None, bc=False, force=False)

source code 
Write spin specific data values to a file.

Keyword Arguments
~~~~~~~~~~~~~~~~~

param:  The parameter.

file:  The name of the file.

dir:  The directory name.

bc:  A flag which if True will cause the back calculated values to be written to file rather than
the actual data.

force:  A flag which, if set to True, will cause the file to be overwritten.


Description
~~~~~~~~~~~

The values corresponding to the given parameter will be written to file.


Examples
~~~~~~~~

To write the CSA values to the file 'csa.txt', type one of:

relax> value.write('csa', 'csa.txt')
relax> value.write(param='csa', file='csa.txt')


To write the NOE values to the file 'noe', type one of:

relax> value.write('noe', 'noe.out')
relax> value.write(param='noe', file='noe.out')
relax> value.write(param='noe', file='noe.out')
relax> value.write(param='noe', file='noe.out', force=True)


Regular expression
~~~~~~~~~~~~~~~~~~

The python function 'match', which uses regular expression, is used to determine which data type to
set values to, therefore various data_type strings can be used to select the same data type.
Patterns used for matching for specific data types are listed below.

This is a short description of python regular expression, for more information see the regular
expression syntax section of the Python Library Reference.  Some of the regular expression syntax
used in this function is:

    '[]':  A sequence or set of characters to match to a single character.  For example, '[sS]2'
WILL match both 'S2' and 's2'.

    '^':  Match the start of the string.

    '$':  Match the end of the string.  For example, '^[Ss]2$' will match 's2' but not 'S2f' or
's2s'.

    '.':  Match any character.

    'x*':  Match the character 'x' any number of times, for example 'x' will match, as will 'xxxxx'.

    '.*':  Match any sequence of characters of any length.

Importantly, do not supply a string for the data type containing regular expression.  The regular
expression is implemented so that various strings can be supplied which all match the same data
type.


Model-free data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_____________________________________________
|                        |                  |
| Data type              | Object name      |
|________________________|__________________|
|                        |                  |
| Local tm               | 'local_tm'       |
|                        |                  |
| Order parameter S2     | 's2'             |
|                        |                  |
| Order parameter S2f    | 's2f'            |
|                        |                  |
| Order parameter S2s    | 's2s'            |
|                        |                  |
| Correlation time te    | 'te'             |
|                        |                  |
| Correlation time tf    | 'tf'             |
|                        |                  |
| Correlation time ts    | 'ts'             |
|                        |                  |
| Chemical exchange      | 'rex'            |
|                        |                  |
| Bond length            | 'r'              |
|                        |                  |
| CSA                    | 'csa'            |
|                        |                  |
| Heteronucleus type     | 'heteronuc_type' |
|                        |                  |
| Proton type            | 'proton_type'    |
|________________________|__________________|


Reduced spectral density mapping data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_____________________________________________
|                        |                  |
| Data type              | Object name      |
|________________________|__________________|
|                        |                  |
| J(0)                   | 'j0'             |
|                        |                  |
| J(wX)                  | 'jwx'            |
|                        |                  |
| J(wH)                  | 'jwh'            |
|                        |                  |
| Bond length            | 'r'              |
|                        |                  |
| CSA                    | 'csa'            |
|                        |                  |
| Heteronucleus type     | 'heteronuc_type' |
|                        |                  |
| Proton type            | 'proton_type'    |
|________________________|__________________|


NOE calculation data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_________________________________________
|                        |              |
| Data type              | Object name  |
|________________________|______________|
|                        |              |
| Reference intensity    | 'ref'        |
|                        |              |
| Saturated intensity    | 'sat'        |
|                        |              |
| NOE                    | 'noe'        |
|________________________|______________|


Relaxation curve fitting data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________
|                                   |                      |
| Data type                         | Object name          |
|___________________________________|______________________|
|                                   |                      |
| Relaxation rate                   | 'rx'                 |
|                                   |                      |
| Peak intensities (series)         | 'intensities'        |
|                                   |                      |
| Initial intensity                 | 'i0'                 |
|                                   |                      |
| Intensity at infinity             | 'iinf'               |
|                                   |                      |
| Relaxation period times (series)  | 'relax_times'        |
|___________________________________|______________________|


N-state model data type string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________________________________________
|                        |                             |                                   |
| Data type              | Object name                 | Patterns                          |
|________________________|_____________________________|___________________________________|
|                        |                             |                                   |
| Probabilities          | 'probs'                     | 'p0', 'p1', 'p2', ..., 'pN'       |
|                        |                             |                                   |
| Euler angle alpha      | 'alpha'                     | 'alpha0', 'alpha1', ...           |
|                        |                             |                                   |
| Euler angle beta       | 'beta'                      | 'beta0', 'beta1', ...             |
|                        |                             |                                   |
| Euler angle gamma      | 'gamma'                     | 'gamma0', 'gamma1', ...           |
|                        |                             |                                   |
| Bond length            | 'r'                         | '^r$' or '[Bb]ond[ -_][Ll]ength'  |
|                        |                             |                                   |
| Heteronucleus type     | 'heteronuc_type'            | '^[Hh]eteronucleus$'              |
|                        |                             |                                   |
| Proton type            | 'proton_type'               | '^[Pp]roton$'                     |
|________________________|_____________________________|___________________________________|

The objects corresponding to the object names are lists (or arrays) with each element corrsponding
to each state.