Package pipe_control :: Module diffusion_tensor
[hide private]
[frames] | no frames]

Module diffusion_tensor

source code

Module for the support of diffusion tensors.

Functions [hide private]
 
bmrb_read(star)
Read the relaxation data from the NMR-STAR dictionary object.
source code
 
bmrb_write(star)
Generate the diffusion tensor saveframes for the NMR-STAR dictionary object.
source code
 
copy(pipe_from=None, pipe_to=None)
Function for copying diffusion tensor data from one data pipe to another.
source code
 
data_names()
Function for returning a list of names of data structures associated with the sequence.
source code
 
delete()
Function for deleting diffusion tensor data.
source code
bool
diff_data_exists(pipe=None)
Function for determining if diffusion data exists in the current data pipe.
source code
 
display()
Function for displaying the diffusion tensor.
source code
 
ellipsoid(params=None, time_scale=None, d_scale=None, angle_units=None, param_types=None)
Function for setting up a ellipsoidal diffusion tensor.
source code
 
fold_angles(sim_index=None)
Wrap the Euler or spherical angles and remove the glide reflection and translational symmetries.
source code
 
init(params=None, time_scale=1.0, d_scale=1.0, angle_units='deg', param_types=0, spheroid_type=None, fixed=1)
Function for initialising the diffusion tensor.
source code
list of len 2 of floats
map_bounds(param, spin_id=None)
The function for creating bounds for the mapping function.
source code
 
map_labels(index, params, bounds, swap, inc)
Function for creating labels, tick locations, and tick values for an OpenDX map.
source code
 
set(value=None, param=None)
Set the diffusion tensor parameters.
source code
 
sphere(params=None, time_scale=None, param_types=None)
Function for setting up a spherical diffusion tensor.
source code
 
spheroid(params=None, time_scale=None, d_scale=None, angle_units=None, param_types=None, spheroid_type=None)
Function for setting up a spheroidal diffusion tensor.
source code
 
test_params(num_params)
Function for testing the validity of the input parameters.
source code
 
unit_axes()
Function for calculating the unit axes of the diffusion tensor.
source code
Variables [hide private]
  __package__ = 'pipe_control'

Imports: deepcopy, cos, pi, sin, float64, int32, zeros, string, DiffTensorData, tensor_eigen_system, tensor_info_table, RelaxError, RelaxNoTensorError, RelaxTensorError, RelaxUnknownParamCombError, RelaxUnknownParamError, fold_spherical_angles, wrap_angles, element_from_isotope, number_from_isotope, pipes, return_interatom_list, get_molecule_names, return_spin, spin_loop, check_pipe


Function Details [hide private]

bmrb_read(star)

source code 

Read the relaxation data from the NMR-STAR dictionary object.

Parameters:
  • star (NMR_STAR instance) - The NMR-STAR dictionary object.

bmrb_write(star)

source code 

Generate the diffusion tensor saveframes for the NMR-STAR dictionary object.

Parameters:
  • star (NMR_STAR instance) - The NMR-STAR dictionary object.

copy(pipe_from=None, pipe_to=None)

source code 

Function for copying diffusion tensor data from one data pipe to another.

Parameters:
  • pipe_from (str) - The data pipe to copy the diffusion tensor data from. This defaults to the current data pipe.
  • pipe_to (str) - The data pipe to copy the diffusion tensor data to. This defaults to the current data pipe.

diff_data_exists(pipe=None)

source code 

Function for determining if diffusion data exists in the current data pipe.

Parameters:
  • pipe (str) - The data pipe to search for data in.
Returns: bool
The answer to the question.

ellipsoid(params=None, time_scale=None, d_scale=None, angle_units=None, param_types=None)

source code 

Function for setting up a ellipsoidal diffusion tensor.

Parameters:
  • params (float) - The diffusion tensor parameter.
  • time_scale (float) - The correlation time scaling value.
  • d_scale (float) - The diffusion tensor eigenvalue scaling value.
  • angle_units (str) - The units for the angle parameters which can be either 'deg' or 'rad'.
  • param_types (int) - The type of parameters supplied. These correspond to 0: {tm, Da, theta, phi}, 1: {Diso, Da, theta, phi}, 2: {tm, Dratio, theta, phi}, 3: {Dpar, Dper, theta, phi}, 4: {Diso, Dratio, theta, phi}.

fold_angles(sim_index=None)

source code 

Wrap the Euler or spherical angles and remove the glide reflection and translational symmetries.

Wrap the angles such that:

   0 <= theta <= pi,
   0 <= phi <= 2pi,

and:

   0 <= alpha <= 2pi,
   0 <= beta <= pi,
   0 <= gamma <= 2pi.

For the simulated values, the angles are wrapped as:

   theta - pi/2 <= theta_sim <= theta + pi/2
   phi - pi <= phi_sim <= phi + pi

and:

   alpha - pi <= alpha_sim <= alpha + pi
   beta - pi/2 <= beta_sim <= beta + pi/2
   gamma - pi <= gamma_sim <= gamma + pi
Parameters:
  • sim_index (int or None) - The simulation index. If set to None then the actual values will be folded rather than the simulation values.

init(params=None, time_scale=1.0, d_scale=1.0, angle_units='deg', param_types=0, spheroid_type=None, fixed=1)

source code 

Function for initialising the diffusion tensor.

Parameters:
  • params (float) - The diffusion tensor parameters.
  • time_scale (float) - The correlation time scaling value.
  • d_scale (float) - The diffusion tensor eigenvalue scaling value.
  • angle_units (str (either 'deg' or 'rad')) - The units for the angle parameters.
  • param_types (int) - The type of parameters supplied. For spherical diffusion, the flag values correspond to 0: tm, 1: Diso. For spheroidal diffusion, 0: {tm, Da, theta, phi}, 1: {Diso, Da, theta, phi}, 2: {tm, Dratio, theta, phi}, 3: {Dpar, Dper, theta, phi}, 4: {Diso, Dratio, theta, phi}. For ellipsoidal diffusion, 0: {tm, Da, Dr, alpha, beta, gamma}, 1: {Diso, Da, Dr, alpha, beta, gamma}, 2: {Dx, Dy, Dz, alpha, beta, gamma}.
  • spheroid_type (str) - A string which, if supplied together with spheroid parameters, will restrict the tensor to either being 'oblate' or 'prolate'.
  • fixed (bin) - A flag specifying whether the diffusion tensor is fixed or can be optimised.

map_bounds(param, spin_id=None)

source code 

The function for creating bounds for the mapping function.

Parameters:
  • param (str) - The name of the parameter to return the bounds for.
  • spin_id (None or str) - The spin identification string. This arg is unused.
Returns: list of len 2 of floats
The bounds for the parameter.

set(value=None, param=None)

source code 

Set the diffusion tensor parameters.

Parameters:
  • tensor (DiffTensorData instance) - The diffusion tensor object.
  • value (list of float) - The list of values to set the parameters to.
  • param (list of str) - The list of parameter names.

sphere(params=None, time_scale=None, param_types=None)

source code 

Function for setting up a spherical diffusion tensor.

Parameters:
  • params (float) - The diffusion tensor parameter.
  • time_scale (float) - The correlation time scaling value.
  • param_types (int) - The type of parameter supplied. If 0, then the parameter is tm. If 1, then the parameter is Diso.

spheroid(params=None, time_scale=None, d_scale=None, angle_units=None, param_types=None, spheroid_type=None)

source code 

Function for setting up a spheroidal diffusion tensor.

Parameters:
  • params (float) - The diffusion tensor parameter.
  • time_scale (float) - The correlation time scaling value.
  • d_scale (float) - The diffusion tensor eigenvalue scaling value.
  • angle_units (str) - The units for the angle parameters which can be either 'deg' or 'rad'.
  • param_types (int) - The type of parameters supplied. These correspond to 0: {tm, Da, theta, phi}, 1: {Diso, Da, theta, phi}, 2: {tm, Dratio, theta, phi}, 3: {Dpar, Dper, theta, phi}, 4: {Diso, Dratio, theta, phi}.
  • spheroid_type (str) - A string which, if supplied together with spheroid parameters, will restrict the tensor to either being 'oblate' or 'prolate'.

unit_axes()

source code 

Function for calculating the unit axes of the diffusion tensor.

Spheroid

The unit Dpar vector is:

            | sin(theta) * cos(phi) |
   Dpar  =  | sin(theta) * sin(phi) |
            |      cos(theta)       |

Ellipsoid

The unit Dx vector is:

          | -sin(alpha) * sin(gamma) + cos(alpha) * cos(beta) * cos(gamma) |
   Dx  =  | -sin(alpha) * cos(gamma) - cos(alpha) * cos(beta) * sin(gamma) |
          |                    cos(alpha) * sin(beta)                      |

The unit Dy vector is:

          | cos(alpha) * sin(gamma) + sin(alpha) * cos(beta) * cos(gamma) |
   Dy  =  | cos(alpha) * cos(gamma) - sin(alpha) * cos(beta) * sin(gamma) |
          |                   sin(alpha) * sin(beta)                      |

The unit Dz vector is:

          | -sin(beta) * cos(gamma) |
   Dz  =  |  sin(beta) * sin(gamma) |
          |        cos(beta)        |