Analysis › Tracking · version 8 · can run once per region
The steps of every trace (AutoStepFinder or BNP-Step, split and merge): step
Finds the steps a molecule takes along its path – a kinesin or dynein walking 8 nm at a time, measured with MINFLUX at a few hundred localizations per second – in every trace or track at once, and gathers what they say about the motor: the step size, how long it waits between steps (the dwell time), how many hidden sub-steps those waits suggest, and its velocity.
Each trace's positions are turned onto the direction it walks in where it moves – the parts where it is stuck left out – forward in time, and the steps are found along it with AutoStepFinder (Loeff, Kerssemakers et al. 2021, doi:10.1016/j.patter.2021.100256), SMAP's StepsMINFLUX's method, or with BNP-Step (Rojewski et al. 2024, doi:10.1016/j.bpj.2024.01.008), which learns the number of steps by Bayesian sampling – slower, and better where the steps are small against the noise. Where the expected step size is known, steps smaller than it are merged and larger ones split. The per-trace numbers are a region table of the id attribute; the pooled step sizes and dwell times are drawn and fitted. On request the plateaus go onto the localizations, or into a file of one localization per plateau.
1. One coordinate per trace. The localizations of each trace (at least at least of them, those the layer's filter keeps) in time order, turned onto the direction the trace walks in. That direction is found where the motor moves: the trace's mean position over windows of moving window (0.1 s), and between neighbouring windows how far it went; the windows it moved in faster than moving from (100 nm/s) are summed into one direction. A motor that sits still for half its trace, wandering a little across its track, is turned along where it walked, where the long axis of all its localizations is pulled across by the wander. A trace that never moves faster gets its long axis (track axis from: all its localizations takes that always).
2. A greedy fit. Starting from one level, the plateau whose best split removes the most squared error is split, again and again. A plateau of fewer than four points is not split.
3. How many steps: the S-score. The splits each plateau would make next form a step function of their own, the counter-fit. While the fit has not yet found all real steps, the counter-fit holds some of them and fits nearly as well; once it has, the counter-fit only splits noise and fits much worse. The ratio of their squared errors, the S-score, peaks at the number of real steps. The curve is taken minus one, and minus a line from zero to its end, before its peak is read.
![]()
A simulated motor track, 8 nm steps after waits of 30 ms on average, 3 nm precision: the S-score against the number of steps fitted peaks near the number of steps there are (left); the fit at that number (right).
4. Two rounds. The steps the first round missed are looked for in what is left of the trace after it, the residual. A round counts only where its S-score peaks above threshold. The steps of both rounds, overshoot times as many, make the fit.
Or BNP-Step. With method on BNP-Step, a trace is a level plus up to M possible steps, each switched on or off, with a height and a time of its own, and Gaussian noise. A sampler draws, again and again, each switch given the rest, the heights, the times and the noise, starting from AutoStepFinder's steps; a step is kept where it explains the data better than its cost in the prior, so the number of steps is learned rather than chosen by a threshold. The answer is the sample the data make most probable. Every trace of the table is sampled at once.
![]()
BNP-Step on the same track, without the expected step size: the steps it keeps (red) against the true number (title).
5. Split and merge. With split/merge to set to the expected step size s: two steps in a row that add up to less than 1.4 s, the first under 0.7 s, become one; a step over 1.4 s gets a plateau inserted halfway. Ten rounds, each followed by refining the boundaries: every boundary moves by up to two points to where the points lie closer to their own level. Without it the boundaries are refined once.
6. Per step, per trace, pooled. Each plateau's level is its points' mean (or median, levels); a step is the difference between two levels, a dwell the time from a plateau's first point to the next plateau's (the first and last plateaus, cut by the trace's ends, left out). Pooled over all traces: the step size (mean and standard deviation of |size|, and the fraction of forward steps), the mean dwell, and the dwell distribution's Erlang shape – mean² / variance: 1 when one event sets the pace (exponential dwells), n when n events in a row do. The velocity is the mean step times its net direction over the mean dwell.
Dwell models. The dwells are fitted by maximum likelihood with three models, as MINFLUXStepsAnalyze compared them: one rate (an exponential: one event sets the pace), a gamma of free shape (n equal events in a row; its shape is n), and two different rates in a row (a hypoexponential). They are compared by the Akaike information criterion, AIC = 2 x parameters
difference of a few units is no evidence either way.
7. Two colours. On a two-colour MINFLUX measurement, two colours on auto: the traces MINFLUX dual colour joined into molecules (pair_id, taken when no other id is chosen) are turned into one frame – the direction the molecule walks in, about the centre of its colour-0 localizations – so both colours lie along the same line, on one clock, and each colour's localizations get their own steps. The colour is the laser, channel (0 the longer wavelength), where the reader knew it, else the thread, thi. A motor and its cargo, or the two heads of one motor in two colours, then step side by side in one plot (SMAP's StepsMINFLUX_dc), and the region table holds the median step of each colour (step_median_channel0_nm, step_median_channel1_nm; ..._thi0_nm where the colour is the thread). The step count, dwell and velocity in the table are colour 0's. as one trace fits both colours' localizations as one, which is only right for one label in two colours.
8. Moving together. A molecule in two colours should move as one: the same way, at the same speed, close together. Two molecules that met by chance can pass the pairing's distance test for a moment and then part. Over the time both colours are seen, cut into windows of window (0.5 s; 0, one window over the whole overlap – the two lines of a linear stepper compared), a straight line x(t), y(t) is fitted to each colour. A window where the molecule moves (the faster colour at moving from or more) matches when the two directions are within directions within (30°), the speeds within speeds within (a factor 1.5) and the two lines within lines within (50 nm) at the window's centre. The share of the moving windows that match is comove_share. A molecule that never moves, or whose colours are seen too briefly to fit a line through more than a step or two, is not judged (NaN): that says nothing either way.
9. In an ROI. Run as a per-region step in the ROI manager, it measures the ROI's molecule and proposes the direction it walks in as the ROI's angle – set only by Apply proposals – which the ROI then shows its molecule turned by, and the steps of anything else measured in it are along. A two-colour molecule that was judged is proposed a keyword in the colours list too: dual when at least together from (half) of its moving windows match, apart when fewer do – in both colours, but not moving as one. Segment regions names the ROIs single or dual when it makes them; Apply proposals turns the dual ones that do not move together into apart.
The split. For a plateau [a, e) the best split k maximises the squared error removed, SS(a, e) − SS(a, k) − SS(k, e), over 2 ≤ k − a ≤ e − a − 2 (any k for plateaus of two or three points); the plateau with the largest such gain is split next (Kerssemakers et al. 2006). SMAP ranked by (level difference)² × width instead, which favours a split at a plateau's end; the gain does not.
The S-score with n steps is SS(counter-fit) / SS(fit), the counter-fit's plateaus running between all current plateaus' next best splits. Up to ⌈n_points / 4⌉ steps are tried.
Overshoot multiplies the number of steps taken from the two rounds' lists in their order (the first round's, then the second's new ones), as SMAP's coarseness did.
BNP-Step's model (Rojewski et al. 2024): x_n = F + Σ_m b_m h_m [n ≤ k_m] + noise of precision η, with b_m ~ Bernoulli(γ/M) (γ = 1), h_m ~ N(0, *step prior*²), k_m uniform over the points, F normal about the trace's end and η Gamma about the noise estimated from consecutive differences (1.4826 MAD / √2). M is twice the most steps AutoStepFinder finds in the batch, at least 20. Each sweep draws every b_m (a logistic draw on the change of the squared error), every k_m (Metropolis, proposed uniformly), F and the heights jointly (their Gaussian conditional) and η (its Gamma conditional); the kept sample is the one of highest posterior. The code departs from the authors' in computing every squared error from prefix sums of the trace instead of points × steps matrices, in sampling all traces as one batch, in starting from AutoStepFinder (they start from the prior and run 50 000 sweeps) and in priors scaled to the data; on simulated staircases it finds the same number of steps as their sampler. The boundaries are not refined afterwards: the sampler's times already are where the data put them.
Moving together (co_movement). Each window's lines are least squares in x and y against time, centred on the window; the angle is between the two velocity vectors, the speed ratio the faster over the slower (≥ 1), the distance between the two lines' positions at the window's centre. The windows are the overlap divided into whole windows nearest window long. A window is judged only when each colour has at least 5 localizations in it and, at the faster colour's speed, is seen over judged from (30 nm) or more: a line through 40 ms of a stepping motor is one plateau or one step, and on the kinesin data a colour seen that briefly came out five times slower and 136° off. The medians over the judged windows are comove_angle_deg, comove_speed_ratio and comove_distance_nm; comove_windows counts them.
Not done from AutoStepFinder: its merging of steps by their error and its bootstrap errors; from StepsMINFLUX: the running-window smoothing, the "bad step" flag near gaps in time, manual editing and the movie.
| setting | default | what it does |
|---|---|---|
id attributeid_column | auto | The traces; auto: tid, else track_id, else cluster_id. |
at leastmin_locs | 20 localizations | Shorter traces are passed over. A trace must hold several steps for the S-score to peak: 20 localizations at least, more for small steps in large noise. at least 4 localizations |
methodmethod | AutoStepFinder | AutoStepFinder: greedy fit and S-score, fast; BNP-Step: the number of steps learned by Bayesian sampling, slower. AutoStepFinder takes a second for a hundred traces; BNP-Step tens of seconds, and is the better choice for small steps in noisy traces, or when the number of steps should not hang on a threshold. Choices: AutoStepFinder; BNP-Step (Bayesian) |
| AutoStepFinder | ||
thresholdautostepfinder.threshold | 0.15 | A round is accepted when its S-score peaks above this; lower finds more steps. In the AutoStepFinder part, shown while it is the method. 0.15 is AutoStepFinder's. Lower finds steps in noisier traces and starts finding noise. 0 to 10 |
overshootautostepfinder.overshoot | 1 | Takes this many times the steps the S-score finds (SMAP's coarseness). Below 1 takes fewer, more certain steps; above 1 more, splitting dwells. 0.1 to 3 |
| BNP-Step | ||
sweepsbnp.sweeps | 400 | Gibbs sampling sweeps, started from AutoStepFinder's steps; more is slower and settles better. In the BNP-Step part, shown while it is the method. A few hundred from AutoStepFinder's start is usually enough; more where the traces are long and the steps many. The run time grows with it linearly. 20 to 100000 |
step priorbnp.height_nm | 0 nm | The prior width of a step; 0: three times each trace's noise. Steps much smaller than it cost more prior than they gain in fit, so they are dropped; on auto three times the noise. Set it near the expected step (8 nm for kinesin) when the noise is small. |
levelsstat | mean | A plateau's level: its points' mean or median. The median is robust to a few outliers within a plateau; the mean is AutoStepFinder's own. Choices: mean; median |
split/merge tostep_nm | 0 nm | 0: off; else merge steps smaller and split steps larger than this expected size. 8 for kinesin and dynein along microtubules, 36 for myosin V. Leave it at 0 to see what the data find without a prior. |
two colourscolours | auto | Auto: in a two-colour table each colour of a molecule its own steps, both in colour 0's frame and on one clock. Each colour of a molecule has only its own localizations, about half of the molecule's: dwells shorter than a few localizations per colour merge. Choices: auto; each its own steps; as one trace |
| moving together | ||
windowcomove.window_s | 0.5 s | The two colours' lines fitted in windows this long; 0: one line over the whole time both are seen (frames where there is no time_s). 0.3-1 s for a kinesin: several steps per window, so the lines are not one step's. 0 compares one line per colour over everything, right for a motor that walks straight and steadily; windows also follow a curved microtubule and a motor that pauses. |
directions within (more)comove.max_angle_deg | 30 ° | The angle between the colours' directions in a window. 0 to 180 ° |
speeds within (more)comove.max_ratio | 1.5 × | The faster colour's speed over the slower one's. at least 1 × |
lines within (more)comove.max_distance_nm | 50 nm | The distance between the lines at the window's centre. |
judged from (more)comove.min_travel_nm | 30 nm | A window is judged when each colour is seen for as long as the motor takes to travel this: a few steps. |
together fromcomove.min_share | 0.5 | A molecule moves together when this share of its moving windows match; else its ROI is proposed 'apart'. 0.5 calls a molecule apart when most of its moving windows disagree. Raise it to keep only molecules that move together throughout. 0 to 1 |
only ROIs' tracesin_rois | off | Only the ids the ROI manager's used ROIs hold (an ROI of its id alone): the kinesins Segment regions found. For the motors chosen by hand or by Segment regions' from an id attribute: only the ids of the used ROIs are fitted, so the pooled steps and dwells are theirs. A region filter would not do it: the per-trace numbers never see one. |
track axis from (more)axis | its moving parts | The direction it walks in where it moves, or the long axis of all its localizations, stuck parts included. its moving parts for a motor that pauses; all its localizations when it walks the whole time, or moves too little for windows to tell. Choices: its moving parts; all its localizations |
moving window (more)window_s | 0.1 s | Where it moves is judged from its mean position over windows this long (frames where there is no time_s). A few tens of localizations per window: at a few hundred localizations a second, 0.1 s. Shorter windows see a kinesin's single steps and its pauses between them as moving and stuck. at least 0.0001 s |
moving from (more)min_speed | 100 nm/s | Two windows in a row this much faster than standing still count as moving (nm per frame where there is no time_s). Above the windows' noise (a few nm over 0.1 s, some tens of nm/s) and below the motor's: 100 nm/s for kinesin at saturating ATP; lower it for a slow motor. |
output (more)output | region table | A region table only; plateau and step_level on the localizations; or a file of one localization per plateau. plateaus on the localizations writes |
localizations as a line (more)line | on | The traces' localizations joined in time order in the figure; off, as dots. Off, each localization is a dot: for sparse traces, where a line between far-apart points draws a path nobody saw. |
guide lines every (more)guide_nm | 16 nm | Thin grey lines behind the traces this far apart, from the first plateau: a ruler for the steps; 0: none. 16 nm for a kinesin whose one head is labelled (it moves 16 nm a step), 8 for a label on the stalk, 36 for myosin V. The lines start at the first plateau, so a motor walking in whole steps follows them. |
smoothing (more)smooth_stat | running median | The figure's smoothed line (its 'smoothed' tick): a running median or mean. The smoothed line is the figure's: its smoothed tick shows it, for the eye. A running median follows the trace through a step without rounding it, which a mean cannot, so a step the fit missed or made up shows where the smoothed line and the steps part. Nothing measured changes. Choices: running median; running mean |
smooth over (more)smooth_n | 9 localizations | The running window of the smoothed line. Shorter than the shortest dwell, or the smoothed line rounds the steps away: 9 localizations at a few hundred a second is a few tens of milliseconds. 2 to 1000 localizations |
A region table of the id attribute, "per tid: Find steps": n_steps, step_median_nm, step_mean_nm, dwell_mean_s, velocity_nm_per_s, erlang_shape, the direction of the track (angle_deg) and, from the moving parts, the share of windows it moved in (moving_share); with two colours the median step of each, and how the colours move together: comove_share, comove_angle_deg, comove_speed_ratio, comove_distance_nm, comove_windows – NaN where it could not be judged, and the values Filter regions keeps molecules by (comove_share >= 0.5). The text counts the two-colour molecules that move and those of them that do not move together. The text adds the dwell models, the best first with each one's parameters and its AIC above the best. The figure: the upper half, the longest traces (in an ROI, its molecule) side by side, the localizations joined in time by a line (dots with localizations as a line off), the steps over them in a thin line and grey lines every guide lines every behind; the figure's own ticks show or hide the steps and the smoothed trace (the localizations then faint behind it) without running again – a two-colour molecule's colours in magenta (colour 0) and green on one clock from its first localization in either and from colour 0's first plateau; below, the step sizes, and the dwell times with the three models (the best drawn thicker), the mean dwell and the velocity in its title. The histograms' bins grow with the number of steps. Steps clustered at the expected size, mostly forward, and an Erlang shape near the number of events per step (about 2 for kinesin's alternating heads) look like a motor; a broad size distribution with many backward steps, like steps fitted to noise.
Ported from SMAP's StepsMINFLUX and MINFLUXStepsAnalyze (Ries 2020).