Simulating tracks - vanTeeffelenLab/ExTrack GitHub Wiki

We allow the user to simulate tracks to test our model capabilities using the following function:

Function extrack.simulate_tracks.sim_FOV

This function allows to simulate tracks with N states in a finite field of view where tracks can leave from any dimensions. Tracks leaving the field of view and coming back will be considered as multiple independent shorter tracks. Random standard deviation of localization error can be added.

Arguments:

  • nb_tracks: Number of tracks simulated.
  • dt: time in between frames,
  • max_track_len: Maximum number of time positions allowed by the simulation.
  • min_track_len: Minimum number of time positions for a track to be considered.
  • LocErr: float or 1D array of localization error values in x, y and z (even if not used), (default value: np.array([0.02, 0.02, 0.04]))
  • Ds: 1D array of diffusion coefficient for each state from state 0 to N-1 (default value: np.array([0,0.25])), initial_fractions: 1D array of diffusion coefficient for each state from state 0 to N-1 (default value: np.array([0,0.25])),
  • TrMat: Squared matrix (array) of transition rates per steps elements with TrMat[i,j] = transition rate for state i to j, k_{ij}. TrMat[i,i] are not used. (default value: np.array([ [0.9,0.1], [0.1,0.9] ])),
  • nb_dims: Simulations are performed in 3D but nb_dims specified the number of dimensions for the outputs. (default value: 2, it will keep the 2 first dims x and y),
  • LocErr_std: Normalized standard deviation of localization error (coef of variation).
  • pBL: probability of bleaching per step.
  • cell_dims: list of dimension limits in x, y and z respectively (default value: [100,None,None]), #

Outputs:

  • all_tracks: dictionary describing the tracks with track length as keys (number of time positions, e.g. '23') of 3D arrays: dim 0 = track, dim 1 = time position, dim 2 = x, y position.
  • all_Bs: dictionary descibing the true states of tracks with track length as keys (number of time positions, e.g. '23') of 3D arrays: dim 0 = track, dim 1 = time position, dim 2 = x, y position.
  • all_sigmas: dictionary describing the localization errors of each peak with the same format as all_tracks, track length as keys (number of time positions, e.g. '23') of 3D arrays: dim 0 = track, dim 1 = time position, dim 2 = spatial dimensions.