Analysis › Process · version 2
Replace the table with one row per id – a blink, a track, a cluster --
Replaces the table with one row per value of an id attribute: a row per merged blink (group_id), per track (track_id, from Link tracks), per cluster (cluster_id, from Find clusters), or per value of any other whole-number attribute. Each attribute is combined as merging blinks combines it: positions averaged, weighted by their precision, photons added up.
Its use is a smaller table – a file of tracks or clusters rather than of their localizations, to save or hand on. The localizations are gone from the table; the undo brings them back. To look at merged blinks, merge them on a layer instead: that keeps the localizations.
1. The groups. One group per id, separately per file and per channel: an id numbered per file meets the same number in the next file, and a cluster that spans both channels of a two-colour table becomes a row per channel rather than one whose channel is 1.5.
2. The rows without an id. An id of -1 means "in none" – DBSCAN's noise, a localization in no track. With rows without an id on keep each is a row of its own, its values as they were; on remove they are not in the new table.
3. Each attribute combined, by the rule merging blinks uses for it: a weighted mean for positions and most attributes, the sum for photons and background, the first frame for frame, the combined precision for xy_err_nm and the other errors. The id attribute keeps its ids exactly.
4. The count. n_merged says how many rows each one was made from.

Simulated nuclear pores (grey), found as clusters by DBSCAN and collapsed by cluster_id: one row per pore, at the weighted mean of its localizations, the circle's size the number it was made from.
What is lost. What one row cannot hold: logl, which has no value for a group; the frames of the members but the first; and every attribute's spread within the group. The table's own group_id and n_in_group are not kept: they described localizations that are gone, and merging the blinks of the collapsed table writes its own. Collapsed by group_id, the id attribute goes too, for the same reason.
Derived attributes. An attribute Math Parser defines is combined by its recipe's rule, or computed again from its expression. One whose expression reads n_in_group or group_id – an on-time in milliseconds, say – is computed on the groups and then kept as values: its expression would read attributes that are not kept.
Merging again. A layer that merges blinks merges the rows of the new table as it would localizations: rows in consecutive frames close together become one. Collapsed by group_id, a row starts where its blink started, so two blinks of one molecule are merged only when the first frame of the second follows within dark frames of the first frame of the first.
The table remembers that it was collapsed, by which attribute and from how many rows, in its metadata (collapsed).
| setting | default | what it does |
|---|---|---|
one row percolumn | group_id | An id attribute: merged blinks (group_id), tracks, clusters, or any whole-number attribute. The ids offered are the whole-number attributes the table has, the usual ids first. |
rows without an idunassigned | keep, one row each | A row whose id is 0 or below: noise, a localization in no track. keep when the noise matters to what comes next (a density, a picture); remove for a table of clusters or tracks only. Choices: keep, one row each; remove |
The table, one row per id, and a line saying how many rows became how many, and what was not kept.
Based on SMAP's GroupAny and the compact form of Connect2Unconnect (Ries 2020). The main changes:
group_id this does it for every channel at once. Its other direction (unconnect->connect) was never written in SMAP.