Trace statistics

Analysis › Tracking · version 3

Per trace or track: displacement, velocity, the track's axes, the

What it does

Measures every trace (a MINFLUX tid) or track (a linked track_id) at once, as a molecule's path: how far it went from its first localization to its last and how fast, which way, how elongated its cloud of localizations is, how precise its localizations are judged from consecutive ones, and how far it wanders from a straight line. It also finds each trace's start – the first localizations of a still molecule that creep into place in MINFLUX, or the approach of a motor before it settles on its track – and can measure each trace without it.

The numbers are kept as a region table of the id attribute, "per tid: Trace statistics", for Filter regions, the summaries and Write results (to the localizations). On request it also writes onto the localizations each track turned onto its own axes (x_rot_nm, y_rot_nm: the long axis along x, pointing the way the molecule moved) with the track's angle and length (track_angle_deg, track_length_nm: coloured by the angle, the tracks of a motor-PAINT measurement map the directions of the filaments they ran on), and which localizations are its tail (in_tail), to filter or colour by.

Run in an ROI – as one of the per-region steps, say over ROIs of a trace each – it also proposes what the ROI could be: the trace's direction (its long axis, forward in time) as the ROI's angle, and, with a tail rule, the range from its first localization after the tail on, so that what is measured in the ROI leaves the tail out. An ROI that holds several traces takes them from the one with the most localizations. Nothing changes on the ROI until the proposals are applied (Apply proposals in the Regions tab); the range is on time_s where the table has it, else on frame.

Use Id statistics for a quick count, centre, spread and the statistics of other attributes per trace; use this for the trace's path. It reads the localizations, not merged blinks, and those the layer's filter keeps.

How it works

1. Each trace in time order. The localizations of each trace (one value of the id attribute; -1 is none) are put in the order of time_s, or of frame where there is no clock.

2. Path and speed. The displacement is the distance from the trace's first localization to its last; the velocity is that displacement over the time between them. For a molecule that moves steadily, as a motor, it is its speed; for one that diffuses or stays put it is small and mostly noise.

3. The track's axes. The spread of a trace's positions has a long and a short direction (the eigenvectors of its covariance). The standard deviations along them, their ratio (the eccentricity: 1 for a round cloud, large for a line) and the long axis' angle – turned to point the way the molecule went, from its first quarter to its last – are measured. Turned onto these axes, a motor's track runs along x.

A simulated motor track, 0.5 nm per ms at 30° for 200 ms with 3 nm precision, as measured (left) and turned onto its own axes (right): it runs along x, forward in time (colour), its width across the track the precision.

4. Precision from consecutive localizations. The difference between neighbouring localizations of a trace scatters by √2 times their precision, so std(differences) / √2 estimates the precision – for a still molecule exactly, for a moving one blurred by what it moved in between. Across a straight track (the short axis) the motion does not enter: it is the precision.

5. The trend across the track. The spread across the track beyond that scatter – √(std across² − precision across²) – is how far the path bends away from a straight line: 0 for a straight track.

6. The start of a trace (tail). With a tail rule chosen, each trace's start is found:

With numbers without the tail ticked (the default), every number above is measured on the rest of the trace. Per trace it reports the tail's length in localizations, how far its first localization was from the settled position, and how long the tail lasted.

Forty simulated still molecules whose first 5 to 25 localizations creep in from 20-60 nm, localized to 2 nm: the tail the still-molecule rule finds against the simulated one (left), and the pooled distance of each trace's n-th localization from its settled position (right).

The rule stops a few localizations early where the creep's last steps are within the scatter: those localizations are as good as the rest.

7. Cut after a cfr violation. For MINFLUX, cut after cfr above ends each trace at its first localization whose cfr exceeds the limit – a second molecule switched on – and measures it without the rest.

In detail

Covariance and axes. Per trace, from the sums of x, y, x², y² and xy over its rows: the sample variances (ddof 1) and covariance, the eigenvalues λ± = tr/2 ± √(tr²/4 − det); std_long_nm = √λ+, std_short_nm = √λ−, θ = ½ atan2(2 c_xy, v_x − v_y), turned by π where the mean of the trace's last quarter lies behind the mean of its first quarter along θ. angle_deg is θ in degrees, 0-360.

Consecutive precision. The differences between rows k and k+1 of the same trace, both kept; their sample standard deviation over √2. On the rotated coordinates for precision_long_nm and precision_short_nm.

The still rule's spread is a median absolute distance, 1.4826 times its median: a robust standard deviation that one outlier in the settled window does not move. A trace shorter than settled from has no settled position and no tail.

The moving rule's rolling standard deviation is centred on each localization, over rolling window steps of the same trace (fewer at its ends), needing three.

Velocity is in nm per second with time_s, nm per frame without. The median time between consecutive localizations is dt_median_s (or _frames).

Parameters

settingdefaultwhat it does
id attribute
id_column
autoThe traces; auto: tid, else track_id, else cluster_id.
trace start (tail)
   tail rule
   tail.rule
noneStill: until the trace comes within reach of its settled position; moving: until its steps' rolling std settles.

still molecule for immobile emitters – DNA-PAINT sites, labelled structures, beads – where a trace should stay put once settled; moving molecule for motors and tracking, where the trace moves on and only its noise settles. A still rule on moving molecules finds nothing useful: the "settled" position is a moment of the path.

Choices: none; still molecule; moving molecule
   numbers without the tail
   tail.without_tail
onMeasure each trace on its settled part.

Untick it to measure the whole trace, tail included, and see how much the tail changes the numbers.

   settled from
   tail.reference_from
20Still: the localization the settled position starts at.

Later than the longest creep expected: 20 is past most MINFLUX creep (5-30 localizations); traces shorter than this plus a few have no tail.

1 to 10000
   settled over
   tail.reference_window
30Still: localizations whose median is the settled position.

30 localizations give a settled position to about a fifth of the precision.

3 to 10000
   reach
   tail.k
3 sigmaStill: within this many robust sigmas of the settled position.

3 robust sigmas: a settled localization is beyond it about once in a hundred. Smaller finds longer tails and starts cutting into the settled part.

0.5 to 20 sigma
   rolling window
   tail.rolling_window
10Moving: steps the rolling std is taken over.

10 steps, the MFX scripts' choice.

3 to 1000
   settled below
   tail.rolling_limit_nm
7 nmMoving: the rolling std of the steps below which the trace has settled.

About twice the localization precision: a moving molecule's steps scatter by √2 times the precision plus its motion between localizations.

at least 0.1 nm
cut after cfr above
cfr_limit
00: off; else a trace ends at its first cfr above this (MINFLUX).

0.8 as abberior's sequences check during the acquisition; lower to be stricter. Localizations whose cfr was not measured (NaN) never cut.

0 to 10
write the rotated track
write_rotated
offx_rot_nm, y_rot_nm on the localizations (the long axis on x, forward in time), and the track's angle and length.

For step finding by eye, kymographs along the track and motor-PAINT maps of track directions: render coloured by track_angle_deg with a cyclic colour map.

write the tail
write_tail
offin_tail (and after_cfr) on the localizations, to filter or colour by.

Output

A region table of the id attribute with, per trace: n_locs, displacement_nm, duration_s, velocity_nm_per_s, std_long_nm, std_short_nm, eccentricity, angle_deg, precision_x_nm, precision_y_nm, precision_long_nm, precision_short_nm, trend_nm, dt_median_s, photons_sum, and with a tail rule tail_n, tail_reach_nm, tail_duration_s; with a cfr cut cut_n; where the table has a cfr, cfr_mean, the mean of the trace's measured cfr values over the whole trace, tail and cut included, missing ones left out – a 2D sequence measures cfr once, at the trace's start, for what follows, so Filter regions on cfr_mean keeps or drops whole traces. Four panels: the velocity, the precision across the track and the eccentricity over the traces, and the pooled distance of each trace's n-th localization from its settled position, beside 120 nm/√N for the photons collected by then. In an ROI, the text ends with what it proposes for the ROI (angle, range:time_s or range:frame), shown under the ROI's numbers in the Regions tab.

A good still-molecule measurement shows precisions close to xy_err_nm, eccentricities near 1 and short tails; two emitters in one trace show as a large spread and eccentricity. A motor shows a high eccentricity, a steady velocity and a small trend.

References