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, data_type=None)
Function for copying residue specific data values from run1 to run2.
source code
 
display(self, run=None, data_type=None)
Function for displaying residue specific data values.
source code
 
read(self, run=None, data_type=None, 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, data_type=None, res_num=None, res_name=None)
Function for setting residue specific data values.
source code
 
write(self, run=None, data_type=None, file=None, dir=None, force=0)
Function for writing residue specific data values to a file.
source code
Class Variables [hide private]
  __re_doc__ = '\n\n Regular expression\n ~~~~~~~~...
Method Details [hide private]

copy(self, run1=None, run2=None, data_type=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.

data_type:  The data type.


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

Only one data type may be selected, therefore the data type 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.  Regular
expression is also used in residue name and number selections, except this time the user
supplies the regular expression string.

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'.



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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Bond length            | r            | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| CSA                    | csa          | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Chemical exchange      | rex          | '^[Rr]ex$' or '[Cc]emical[ -_][Ee]xchange'       |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| 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$'                                           |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Local tm               | tm           | '^tm$'                                           |
|________________________|______________|__________________________________________________|



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.



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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| 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.

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

source code 
Function for displaying residue specific data values.

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

run:  The name of the run.

data_type:  The data type.


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

Only one data type may be selected, therefore the data type 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.  Regular
expression is also used in residue name and number selections, except this time the user
supplies the regular expression string.

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'.



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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Bond length            | r            | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| CSA                    | csa          | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Chemical exchange      | rex          | '^[Rr]ex$' or '[Cc]emical[ -_][Ee]xchange'       |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| 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$'                                           |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Local tm               | tm           | '^tm$'                                           |
|________________________|______________|__________________________________________________|




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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Bond length            | r            | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| CSA                    | csa          | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|

read(self, run=None, data_type=None, 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.

data_type:  The data type.

frq:  The spectrometer frequency in Hz.

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 data type may be selected, therefore the data type 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', data_type='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.  Regular
expression is also used in residue name and number selections, except this time the user
supplies the regular expression string.

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'.



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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Bond length            | r            | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| CSA                    | csa          | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Chemical exchange      | rex          | '^[Rr]ex$' or '[Cc]emical[ -_][Ee]xchange'       |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| 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$'                                           |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Local tm               | tm           | '^tm$'                                           |
|________________________|______________|__________________________________________________|



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.



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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| 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.

set(self, run=None, value=None, data_type=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).

data_type:  The data type(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 data type
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 Type column refers
to the 'data_type' 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 | Type  | 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 data type matching the string will be set to the default value.      |
|_______|_______|__________________________________________________________________________|
|       |       |                                                                          |
|   1   |   1   | The data type matching the string will be set to the supplied number.    |
|_______|_______|__________________________________________________________________________|
|       |       |                                                                          |
|   n   |   1   | Invalid combination.                                                     |
|_______|_______|__________________________________________________________________________|
|       |       |                                                                          |
| None  |   n   | Each data type matching the strings will be set to the default values.   |
|_______|_______|__________________________________________________________________________|
|       |       |                                                                          |
|   1   |   n   | Each data type matching the strings will be set to the supplied number.  |
|_______|_______|__________________________________________________________________________|
|       |       |                                                                          |
|   n   |   n   | Each data type 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.


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', data_type='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, data_type='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, data_type='r')


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

relax> value.set('new', data_type=['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, data_type=['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], data_type=['S2', 'te'], res_num=10)
relax> value.set(run='m4', value=[0.56, 13e-12], data_type=['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.  Regular
expression is also used in residue name and number selections, except this time the user
supplies the regular expression string.

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'.



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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Bond length            | r            | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| CSA                    | csa          | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Chemical exchange      | rex          | '^[Rr]ex$' or '[Cc]emical[ -_][Ee]xchange'       |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| 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$'                                           |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Local tm               | tm           | '^tm$'                                           |
|________________________|______________|__________________________________________________|



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 default values
~~~~~~~~~~~~~~~~~~~~~~~~~

_______________________________________________________________________________________
|                                       |              |                              |
| Data type                             | Object name  | Value                        |
|_______________________________________|______________|______________________________|
|                                       |              |                              |
| Bond length                           | r            | 1.02 * 1e-10                 |
|_______________________________________|______________|______________________________|
|                                       |              |                              |
| CSA                                   | csa          | -170 * 1e-6                  |
|_______________________________________|______________|______________________________|
|                                       |              |                              |
| Chemical exchange relaxation          | rex          | 0.0                          |
|_______________________________________|______________|______________________________|
|                                       |              |                              |
| 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                 |
|_______________________________________|______________|______________________________|
|                                       |              |                              |
| Local tm                              | tm           | 10 * 1e-9                    |
|_______________________________________|______________|______________________________|




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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| 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 default values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

write(self, run=None, data_type=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.

data_type:  The data type.

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 data type 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', data_type='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', data_type='noe', file='noe.out')
relax> value.write(run='noe', data_type='noe', file='noe.out')
relax> value.write(run='noe', data_type='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.  Regular
expression is also used in residue name and number selections, except this time the user
supplies the regular expression string.

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'.



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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Bond length            | r            | '^r$' or '[Bb]ond[ -_][Ll]ength'                 |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| CSA                    | csa          | '^[Cc][Ss][Aa]$'                                 |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Chemical exchange      | rex          | '^[Rr]ex$' or '[Cc]emical[ -_][Ee]xchange'       |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| 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$'                                           |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Local tm               | tm           | '^tm$'                                           |
|________________________|______________|__________________________________________________|




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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| 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]$'                                 |
|________________________|______________|__________________________________________________|


Class Variable Details [hide private]

__re_doc__

Value:
'''

        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\
...