Package prompt :: Module dx :: Class OpenDX
[hide private]
[frames] | no frames]

Class OpenDX

source code

Instance Methods [hide private]
 
__init__(self, relax) source code
 
execute(self, file='map', dir='dx', dx_exe='dx', vp_exec=1)
Function for running OpenDX.
source code
 
map(self, run=None, params=None, map_type='Iso3D', res_num=None, inc=20, lower=None, upper=None, axis_incs=5, file='map', dir='dx', point=None, point_file='point', remap=None)
Function for creating a map of the given space in OpenDX format.
source code
Method Details [hide private]

execute(self, file='map', dir='dx', dx_exe='dx', vp_exec=1)

source code 
Function for running OpenDX.

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

file:  The file name prefix.  For example if file is set to 'temp', then the OpenDX program
temp.net will be loaded.

dir:  The directory to change to for running OpenDX.  If this is set to 'None', OpenDX will
be run in the current directory.

dx_exe:  The OpenDX executable file.

vp_exec:  A flag specifying whether to execute the visual program automatically at
start-up.  The default is 1 which turns execution on.  Setting the value to zero turns
execution off.

map(self, run=None, params=None, map_type='Iso3D', res_num=None, inc=20, lower=None, upper=None, axis_incs=5, file='map', dir='dx', point=None, point_file='point', remap=None)

source code 
Function for creating a map of the given space in OpenDX format.

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

run:  The name of the run.

params:  The parameters to be mapped.  This argument should be an array of strings, values
of which are described below.

map_type:  The type of map to create.  For example the default, a 3D isosurface, the type is
'Iso3D'.  See below for more details.

res_num:  The residue number.

inc:  The number of increments to map in each dimension.  This value controls the resolution
of the map.

lower:  The lower bounds of the space.  If you wish to change the lower bounds of the map
then supply an array of length equal to the number of parameters in the model.  A lower
bound for each parameter must be supplied.  If nothing is supplied then the defaults will
be used.

upper:  The upper bounds of the space.  If you wish to change the upper bounds of the map
then supply an array of length equal to the number of parameters in the model.  A upper
bound for each parameter must be supplied.  If nothing is supplied then the defaults will
be used.

axis_incs:  The number of increments or ticks displaying parameter values along the axes of
the OpenDX plot.

file:  The file name.  All the output files are prefixed with this name.  The main file
containing the data points will be called the value of 'file'.  The OpenDX program will be
called 'file.net' and the OpenDX import file will be called 'file.general'.

dir:  The directory to output files to.  Set this to 'None' if you do not want the files to
be placed in subdirectory.  If the directory does not exist, it will be created.

point:  An array of parameter values where a point in the map, shown as a red sphere, will
be placed.  The length must be equal to the number of parameters.

point_file:  The name of that the point output files will be prefixed with.

remap:  A user supplied remapping function.  This function will receive the parameter array
and must return an array of equal length.


Map type
~~~~~~~~

The map type can be changed by supplying the 'map_type' keyword argument.  Here is a list of
currently supported map types:
_____________________________________________________________________________
|                                           |                               |
| Surface type                              | Pattern                       |
|___________________________________________|_______________________________|
|                                           |                               |
| 3D isosurface                             | '^[Ii]so3[Dd]'                |
|___________________________________________|_______________________________|

Pattern syntax is simply regular expression syntax where square brackets '[]' means any
character within the brackets, '^' means the start of the string, etc.


Examples
~~~~~~~~

The following commands will generate a map of the extended model-free space defined as run
'm5' which consists of the parameters {S2, S2f, ts}.  Files will be output into the
directory 'dx' and will be prefixed by 'map'.  The residue, in this case, is number 6.

relax> dx.map('m5', ['S2', 'S2f', 'ts'], 6)
relax> dx.map('m5', ['S2', 'S2f', 'ts'], 6, 20, 'map', 'dx')
relax> dx.map('m5', ['S2', 'S2f', 'ts'], res_num=6, file='map', dir='dx')
relax> dx.map(run='m5', params=['S2', 'S2f', 'ts'], res_num=6, inc=20, file='map', dir='dx')
relax> dx.map(run='m5', params=['S2', 'S2f', 'ts'], res_num=6, type='Iso3D', inc=20,
              swap=[0, 1, 2], file='map', dir='dx')


To map the model-free space 'm4' defined by the parameters {S2, te, Rex}, name the results
'test', and not place the files in a subdirectory, use the following commands (assuming
residue 2).

relax> dx.map('m4', ['S2', 'te', 'Rex'], res_num=2, file='test', dir=None)
relax> dx.map(run='m4', params=['S2', 'te', 'Rex'], res_num=2, inc=100, file='test',
              dir=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.


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                        |              |                  |
|________________________________________________________|______________|__________________|



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

____________________________________________________________________________________________
|                        |              |                                                  |
| Data type              | Object name  | Patterns                                         |
|________________________|______________|__________________________________________________|
|                        |              |                                                  |
| Local tm               | 'local_tm'   | '[Ll]ocal[ -_]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]$'                                 |
|________________________|______________|__________________________________________________|