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

Class Value

source code

Instance Methods [hide private]
 
__init__(self, relax) source code
 
copy(self, run1=None, run2=None, param=None)
Function for copying residue specific data values from run1 to run2.
source code
 
display(self, run=None, param=None)
Function for displaying residue specific data values.
source code
 
read(self, run=None, param=None, scaling=1.0, file=None, num_col=0, name_col=1, data_col=2, error_col=3, sep=None)
Function for reading residue specific data values from a file.
source code
 
set(self, run=None, value=None, param=None, res_num=None, res_name=None)
Function for setting residue specific data values.
source code
 
write(self, run=None, param=None, file=None, dir=None, force=0)
Function for writing residue specific data values to a file.
source code
Method Details [hide private]

copy(self, run1=None, run2=None, param=None)

source code 
Function for copying residue specific data values from run1 to run2.

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

run1:  The name of the run to copy from.

run2:  The name of the run to copy to.

param:  The parameter to copy.


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

Only one parameter may be selected, therefore the 'param' argument should be a string.

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


Examples
~~~~~~~~

To copy the CSA values from the run '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  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Local tm               | 'tm'         | '^tm$'                                           |
|                        |              |                                                  |
| Order parameter S2     | 's2'         | '^[Ss]2$'                                        |
|                        |              |                                                  |
| Order parameter S2f    | 's2f'        | '^[Ss]2f$'                                       |
|                        |              |                                                  |
| Order parameter S2s    | 's2s'        | '^[Ss]2s$'                                       |
|                        |              |                                                  |
| Correlation time te    | 'te'         | '^te$'                                           |
|                        |              |                                                  |
| Correlation time tf    | 'tf'         | '^tf$'                                           |
|                        |              |                                                  |
| Correlation time ts    | 'ts'         | '^ts$'                                           |
|                        |              |                                                  |
| Chemical exchange      | 'rex'        | '^[Rr]ex$' or '[Cc]emical[ -_][Ee]xchange'       |
|                        |              |                                                  |
| Bond length            | 'r'          | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|                        |              |                                                  |
| CSA                    | 'csa'        | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|



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

In reduced spectral density mapping, only two values can be set, the bond length and CSA
value.  These must be set prior to the calculation of spectral density values.



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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| J(0)                   | 'j0'         | '^[Jj]0$' or '[Jj](0)'                           |
|                        |              |                                                  |
| J(wX)                  | 'jwx'        | '^[Jj]w[Xx]$' or '[Jj](w[Xx])'                   |
|                        |              |                                                  |
| J(wH)                  | 'jwh'        | '^[Jj]w[Hh]$' or '[Jj](w[Hh])'                   |
|                        |              |                                                  |
| Bond length            | 'r'          | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|                        |              |                                                  |
| CSA                    | 'csa'        | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|

display(self, run=None, param=None)

source code 
Function for displaying residue specific data values.

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

run:  The name of the run.

param:  The parameter to display.


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

Only one parameter may be selected, therefore the 'param' argument should be a string.


Examples
~~~~~~~~

To show all CSA values for the run 'm1', type:

relax> value.display('m1', '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  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Local tm               | 'tm'         | '^tm$'                                           |
|                        |              |                                                  |
| Order parameter S2     | 's2'         | '^[Ss]2$'                                        |
|                        |              |                                                  |
| Order parameter S2f    | 's2f'        | '^[Ss]2f$'                                       |
|                        |              |                                                  |
| Order parameter S2s    | 's2s'        | '^[Ss]2s$'                                       |
|                        |              |                                                  |
| Correlation time te    | 'te'         | '^te$'                                           |
|                        |              |                                                  |
| Correlation time tf    | 'tf'         | '^tf$'                                           |
|                        |              |                                                  |
| Correlation time ts    | 'ts'         | '^ts$'                                           |
|                        |              |                                                  |
| Chemical exchange      | 'rex'        | '^[Rr]ex$' or '[Cc]emical[ -_][Ee]xchange'       |
|                        |              |                                                  |
| Bond length            | 'r'          | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|                        |              |                                                  |
| CSA                    | 'csa'        | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|




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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| J(0)                   | 'j0'         | '^[Jj]0$' or '[Jj](0)'                           |
|                        |              |                                                  |
| J(wX)                  | 'jwx'        | '^[Jj]w[Xx]$' or '[Jj](w[Xx])'                   |
|                        |              |                                                  |
| J(wH)                  | 'jwh'        | '^[Jj]w[Hh]$' or '[Jj](w[Hh])'                   |
|                        |              |                                                  |
| Bond length            | 'r'          | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|                        |              |                                                  |
| CSA                    | 'csa'        | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|

read(self, run=None, param=None, scaling=1.0, file=None, num_col=0, name_col=1, data_col=2, error_col=3, sep=None)

source code 
Function for reading residue specific data values from a file.

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

run:  The name of the run.

param:  The parameter.

scaling:  The factor to scale parameters by.

file:  The name of the file containing the relaxation data.

num_col:  The residue number column (the default is 0, ie the first column).

name_col:  The residue name column (the default is 1).

data_col:  The relaxation data column (the default is 2).

error_col:  The experimental error column (the default is 3).

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


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

Only one parameter may be selected, therefore the 'param' argument should be a string.  If
the file only contains values and no errors, set the error column argument to None.

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


Examples
~~~~~~~~

To load CSA values for the run 'm1' from the file 'csa_values' in the directory 'data', type
any of the following:

relax> value.read('m1', 'CSA', 'data/csa_value')
relax> value.read('m1', 'CSA', 'data/csa_value', 0, 1, 2, 3, None, 1)
relax> value.read(run='m1', param='CSA', file='data/csa_value', num_col=0, name_col=1,
                  data_col=2, error_col=3, sep=None)




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  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Local tm               | 'tm'         | '^tm$'                                           |
|                        |              |                                                  |
| Order parameter S2     | 's2'         | '^[Ss]2$'                                        |
|                        |              |                                                  |
| Order parameter S2f    | 's2f'        | '^[Ss]2f$'                                       |
|                        |              |                                                  |
| Order parameter S2s    | 's2s'        | '^[Ss]2s$'                                       |
|                        |              |                                                  |
| Correlation time te    | 'te'         | '^te$'                                           |
|                        |              |                                                  |
| Correlation time tf    | 'tf'         | '^tf$'                                           |
|                        |              |                                                  |
| Correlation time ts    | 'ts'         | '^ts$'                                           |
|                        |              |                                                  |
| Chemical exchange      | 'rex'        | '^[Rr]ex$' or '[Cc]emical[ -_][Ee]xchange'       |
|                        |              |                                                  |
| Bond length            | 'r'          | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|                        |              |                                                  |
| CSA                    | 'csa'        | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|



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

In reduced spectral density mapping, only two values can be set, the bond length and CSA
value.  These must be set prior to the calculation of spectral density values.



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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| J(0)                   | 'j0'         | '^[Jj]0$' or '[Jj](0)'                           |
|                        |              |                                                  |
| J(wX)                  | 'jwx'        | '^[Jj]w[Xx]$' or '[Jj](w[Xx])'                   |
|                        |              |                                                  |
| J(wH)                  | 'jwh'        | '^[Jj]w[Hh]$' or '[Jj](w[Hh])'                   |
|                        |              |                                                  |
| Bond length            | 'r'          | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|                        |              |                                                  |
| CSA                    | 'csa'        | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|

set(self, run=None, value=None, param=None, res_num=None, res_name=None)

source code 
Function for setting residue specific data values.

Keyword arguments
~~~~~~~~~~~~~~~~~

run:  The run to assign the values to.

value:  The value(s).

param:  The parameter(s).

res_num:  The residue number.

res_name:  The residue name.


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

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


The value 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 'value' 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 value array must be equal to the number  |
|       |       | of model parameters for an individual residue.  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.                            |
|_______|_______|__________________________________________________________________________|


Residue number and name argument
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If the 'res_num' and 'res_name' arguments are left as the defaults of None, then the
function will be applied to all residues.  Otherwise the residue number can be set to either
an integer for selecting a single residue or a python regular expression string for
selecting multiple residues.  The residue name argument must be a string and can use regular
expression as well.  If the data is global non-residue specific data, such as diffusion
tensor parameters, supplying the residue number and name will terminate the program with an
error.


Examples
~~~~~~~~

To set the parameter values for the run 'test' to the default values, for all residues,
type:

relax> value.set('test')


To set the parameter values of residue 10, which is the model-free run '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('m4', [0.97, 2.048*1e-9, 0.149], res_num=10)
relax> value.set('m4', value=[0.97, 2.048*1e-9, 0.149], res_num=10)


To set the CSA value for the model-free run 'tm3' to the default value, type:

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


To set the CSA value of all residues in the reduced spectral density mapping run '600MHz' to
-170 ppm, type:

relax> value.set('600MHz', -170 * 1e-6, 'csa')
relax> value.set('600MHz', value=-170 * 1e-6, param='csa')


To set the NH bond length of all residues in the model-free run 'm5' to 1.02 Angstroms,
type:

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


To set both the bond length and the CSA value for the run 'new' to the default values, type:

relax> value.set('new', param=['bond length', 'csa'])


To set both tf and ts in the model-free run 'm6' to 100 ps, type:

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


To set the S2 and te parameter values for model-free run 'm4' which has the parameters
{S2, te, Rex} to 0.56 and 13 ps, type:

relax> value.set('m4', [0.56, 13e-12], ['S2', 'te'], 10)
relax> value.set('m4', value=[0.56, 13e-12], param=['S2', 'te'], res_num=10)
relax> value.set(run='m4', value=[0.56, 13e-12], param=['S2', 'te'], res_num=10)




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  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Local tm               | 'tm'         | '^tm$'                                           |
|                        |              |                                                  |
| Order parameter S2     | 's2'         | '^[Ss]2$'                                        |
|                        |              |                                                  |
| Order parameter S2f    | 's2f'        | '^[Ss]2f$'                                       |
|                        |              |                                                  |
| Order parameter S2s    | 's2s'        | '^[Ss]2s$'                                       |
|                        |              |                                                  |
| Correlation time te    | 'te'         | '^te$'                                           |
|                        |              |                                                  |
| Correlation time tf    | 'tf'         | '^tf$'                                           |
|                        |              |                                                  |
| Correlation time ts    | 'ts'         | '^ts$'                                           |
|                        |              |                                                  |
| Chemical exchange      | 'rex'        | '^[Rr]ex$' or '[Cc]emical[ -_][Ee]xchange'       |
|                        |              |                                                  |
| Bond length            | 'r'          | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|                        |              |                                                  |
| CSA                    | 'csa'        | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|



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

_______________________________________________________________________________________
|                                       |                    |                        |
| Data type                             | Object name        | Value                  |
|_______________________________________|____________________|________________________|
|                                       |                    |                        |
| Local tm                              | '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'              | -170 * 1e-6            |
|_______________________________________|____________________|________________________|




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

In reduced spectral density mapping, only two values can be set, the bond length and CSA
value.  These must be set prior to the calculation of spectral density values.



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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| J(0)                   | 'j0'         | '^[Jj]0$' or '[Jj](0)'                           |
|                        |              |                                                  |
| J(wX)                  | 'jwx'        | '^[Jj]w[Xx]$' or '[Jj](w[Xx])'                   |
|                        |              |                                                  |
| J(wH)                  | 'jwh'        | '^[Jj]w[Hh]$' or '[Jj](w[Hh])'                   |
|                        |              |                                                  |
| Bond length            | 'r'          | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|                        |              |                                                  |
| CSA                    | 'csa'        | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|



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

_______________________________________________________________________________________
|                                       |              |                              |
| Data type                             | Object name  | Value                        |
|_______________________________________|______________|______________________________|
|                                       |              |                              |
| Bond length                           | 'r'          | 1.02 * 1e-10                 |
|                                       |              |                              |
| CSA                                   | 'csa'        | -170 * 1e-6                  |
|_______________________________________|______________|______________________________|



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.

The diffusion tensor parameters can only be set when the run corresponds to model-free
analysis.  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                    |
|________________________|____________________|________________________|

write(self, run=None, param=None, file=None, dir=None, force=0)

source code 
Function for writing residue specific data values to a file.

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

run:  The name of the run.

param:  The parameter.

file:  The name of the file.

dir:  The directory name.

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


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

If no directory name is given, the file will be placed in the current working directory.

The parameter argument should be a string.


Examples
~~~~~~~~

To write the CSA values for the run 'm1' to the file 'csa.txt', type:

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


To write the NOE values from the run 'noe' to the file 'noe', type:

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




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  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Local tm               | 'tm'         | '^tm$'                                           |
|                        |              |                                                  |
| Order parameter S2     | 's2'         | '^[Ss]2$'                                        |
|                        |              |                                                  |
| Order parameter S2f    | 's2f'        | '^[Ss]2f$'                                       |
|                        |              |                                                  |
| Order parameter S2s    | 's2s'        | '^[Ss]2s$'                                       |
|                        |              |                                                  |
| Correlation time te    | 'te'         | '^te$'                                           |
|                        |              |                                                  |
| Correlation time tf    | 'tf'         | '^tf$'                                           |
|                        |              |                                                  |
| Correlation time ts    | 'ts'         | '^ts$'                                           |
|                        |              |                                                  |
| Chemical exchange      | 'rex'        | '^[Rr]ex$' or '[Cc]emical[ -_][Ee]xchange'       |
|                        |              |                                                  |
| Bond length            | 'r'          | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|                        |              |                                                  |
| CSA                    | 'csa'        | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|




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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| J(0)                   | 'j0'         | '^[Jj]0$' or '[Jj](0)'                           |
|                        |              |                                                  |
| J(wX)                  | 'jwx'        | '^[Jj]w[Xx]$' or '[Jj](w[Xx])'                   |
|                        |              |                                                  |
| J(wH)                  | 'jwh'        | '^[Jj]w[Hh]$' or '[Jj](w[Hh])'                   |
|                        |              |                                                  |
| Bond length            | 'r'          | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|                        |              |                                                  |
| CSA                    | 'csa'        | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|




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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Reference intensity    | 'ref'        | '^[Rr]ef$' or '[Rr]ef[ -_][Ii]nt'                |
|                        |              |                                                  |
| Saturated intensity    | 'sat'        | '^[Ss]at$' or '[Ss]at[ -_][Ii]nt'                |
|                        |              |                                                  |
| NOE                    | 'noe'        | '^[Nn][Oo][Ee]$'                                 |
|________________________|______________|__________________________________________________|