slitflow.trj.wtramway module

Caution

This module consists of brief wrapper classes of TRamWAy package.

Wrapper classes do not cover all functionality of TRamWAy functions. Please create your custom class to use TRamWAy functions that are not provided in this module.

Do not ask the TRamWAy developers any questions about the wrapper part that is not directly related to the TRamWAy package.

Please cite the following publication of the original package if you use this module.

Laurent F, Verdier H, Duval M, Serov A, Vestergaard CL, Masson JB.
TRamWAy: mapping physical properties of individual biomolecule random
motion in large-scale single-particle tracking experiments.
Bioinformatics. 2022 May 26;38(11):3149-3150.
class Tessellation(info_path=None)[source]

Bases: Pickle

Brief wrapper of tessellation of the TRamWay helper module.

See also the documentation of tramway.helper.tessellation.tessellate.

Caution

Trajectories should be split into groups that you want to calculate as one map. e.g. single cell nucleus and single cell surface.

Parameters:
  • reqs[0] (Table) – X,Y-coordinate of trajectory. Required param; length_unit, interval. Required columns; trj_no, frm_no, x_(length_unit), y_(length_unit).

  • param["method"] (str) – Tessellation method. See also the TRamWay documentation. This should be “grid”, “hexagon”, “kdtree”, “kmeans”, “gwr”.

  • param["param"] (dict, optional) – Additional parameters to the tessellation function.

  • param["split_depth"] (int) – File split depth number.

Returns:

Partition object containing tramway.tessellation.base.Partition

Return type:

Pickle

set_info(param)[source]

Copy info from reqs[0] and set parameters.

static process(reqs, param)[source]

Brief wrapper of tessellation of the TRamWay helper module.

Parameters:
  • reqs[0] (Table) – X,Y-coordinate of trajectory. Required param; length_unit and interval. Required columns; trj_no, frm_no, x_(length_unit) and y_(length_unit).

  • param["method"] (str) – Tessellation method. See also the TRamWay documentation. This should be “grid”, “hexagon”, “kdtree”, “kmeans” or “gwr”.

  • param["param"] (dict, optional) – Additional parameters to the tessellation function.

  • param["calc_cols"] (list of str) – Column names of X,Y-coordinate.

  • param["interval"] (float) – Time interval in second.

Returns:

Partition object of TRamWay

Return type:

tramway.tessellation.base.Partition

class Inference(info_path=None)[source]

Bases: Pickle

Brief wrapper of inference of the TRamWay helper module.

See also the documentation of tramway.helper.inference.infer.

Caution

This class uses multi processing. Do not use run mode 1 and 3.

Parameters:
  • reqs[0] (Tessellation) – Wrapped class object of the TRamWay tessellation.

  • param["mode"] (str) – Inference mode string. This should be d, dd, df or dv.

  • param["param"] (dict, optional) – Additional parameters to the inference function.

Returns:

Map object containing tramway.inference.base.Maps of TRamWay

Return type:

Pickle

set_info(param)[source]

Copy info from reqs[0] and set parameters.

static process(reqs, param)[source]

Brief wrapper of inference of the TRamWay helper module.

Parameters:
  • reqs[0] (tramway.tessellation.base.Partition) – TRamWay tessellation object.

  • param["mode"] (str) – Inference mode string. This should be d, dd, df or dv.

  • param["param"] (dict, optional) – Additional parameters to the inference function.

Returns:

Map object of TRamWay

Return type:

tramway.inference.base.Maps

class MapPlot(info_path=None)[source]

Bases: Figure

Brief wrapper of map_plot of the TRamWay helper module.

See also the documentation of tramway.helper.inference.map_plot.

Parameters:
  • reqs[0] (Tessellation) – Wrapped class object of the TRamWay tessellation.

  • reqs[1] (Inference) – Wrapped class object of the TRamWay inference.

  • param["feature"] (str) – Feature name for plotting. This should be diffusivity , force, potential, drift depended on mode parameter of inference.

  • param["param"] (dict, optional) – Additional parameters to the map_plot function.

Returns:

Feature Figure object

Return type:

Figure

set_info(param)[source]

Copy info from reqs[0] and set parameters.

static process(reqs, param)[source]

Brief wrapper of map_plot of the TRamWay helper module.

See also the documentation of tramway.helper.inference.map_plot.

Parameters:
  • reqs[0] (tramway.tessellation.base.Partition) – TRamWay tessellation object.

  • reqs[1] (tramway.inference.base.Maps) – Wrapped class object of the TRamWay inference.

  • param["feature"] (str) – Feature name for plotting. This should be diffusivity , force, potential or drift.

  • param["param"] (dict, optional) – Additional parameters to the map_plot function.

Returns:

matplotlib Figure object

Return type:

matplotlib.figure.Figure

post_run()[source]

Save the color bar label of the figure as parameter.