Skip to content

The TRamWAy library for random walk analysis

Introduction

TRamWAy is a Python library to analyse random walks and infer parameters of their dynamics (or their environment), including diffusivity, drift and potential energy. Typical random walks TRamWAy was designed for are biomolecule trajectories such as observed using localization microscopy (e.g. PALM, STORM) together with single-particle tracking (SPT).

In TRamWAy, the flagship approach for characterizing the dynamics of biomolecules (or random walkers) and their environment relies on the mapping hypothesis and merely considers random walkers as probes of their environment. This is suitable in situations where consistencies in the dynamics may be resolved as a function of space and time, rather than within each random walker.

As a consequence, the library is organised around the following processing steps:

  • tracking the biomolecules in localization microscopy data ; this is described in a section that covers the following modules:

    • tramway.analyzer.images
    • tramway.analyzer.tracker
  • segmenting in space (and - optionally - time), and assigning individual displacements (or trajectories) to the different segments (also referred to as bins or cells or microdomains) ; the dedicated section covers the following modules:

    • tramway.analyzer.tesseller
    • tramway.analyzer.time
    • tramway.analyzer.sampler
  • inferring dynamics parameters in each bin or segment, thus yielding a spatial (or spatio-temporal) map for each parameter; this is demonstrated together with the following modules:

    • tramway.analyzer.mapper
    • tramway.analyzer.browser
  • identifying patterns in (or features of) the parameter maps, including Bayes factor calculation for distinguishing between interactions and spurious forces.

In addition, TRamWAy also features a range of widely-used measurements for individual trajectories. Several analysis procedures based on models that rely on consistencies within each random walker are planned and should be available in future releases.

TRamWAy also includes adapted visualisation routines.

Example data illustrated

from src.quick_example import example_trajectory_movie_file, example_dv_maps

TRamWAy can track readily localized particles.

from IPython.display import Video
Video(example_trajectory_movie_file())
playback rate is 0.2

TRamWAy can also resolve in space and time the local diffusivity (left) and effective potential (right).

%%capture
movie = example_dv_maps(overlay_particle_locations=True)
from IPython.display import HTML
HTML(movie.to_jshtml())