Why Pruning Requires More Than a Short Edge
A minimum spanning tree (MST) connects cells in a tree using the selected cell-to-cell geometry and edge weights. After compression into a trajectory skeleton, a small number of paths and junctions summarize the tree. Some terminal paths may arise from noise, outlying cells, or local sampling irregularities. Removing such a path can make a trajectory easier to interpret, but a pruning rule can also erase a real, weakly sampled cell state. The decision is therefore about the reliability of a branch under an explicit rule, not proof that the branch is biologically unreal.
The earlier material on compressing cell MSTs into trajectory skeletons supplies the representation used here: a skeleton retains the tree's principal paths and junctions while summarizing the original cell-level MST. This tutorial focuses on assessing terminal branches in that representation. It does not assign developmental time or determine a branch's biological identity.
The definition depends on the representation. If the skeleton stores a compressed edge as a path through multiple original MST edges, its weight must represent the sum of those original edge lengths, not merely the straight-line distance between its endpoints, if the goal is to measure length along the tree. Likewise, count original cells mapped to the branch, not the number of skeleton vertices: compression can represent many cells with a single segment.
A basic length-and-count rule uses two cutoffs, \(L_{\min}\) and \(n_{\min}\). A conservative version flags a branch only if it is both short and sparsely supported:
This is a deterministic screening rule, not a statistical test. \(L_{\min}\) has the units of the edge weights, while \(n_{\min}\) is a number of cells. The rule makes sense only after the geometry, edge-weight definition, cell-assignment procedure, and cutoffs have been specified. If the embedding is rescaled, length cutoffs must be rescaled too.
Why Length and Cell Count Are Complementary
Branch length and cell count describe different features. Length asks how far the path extends in the selected geometry. Cell count asks how many observed cells support its exclusive portion. A short path with many cells might be a compact but well-populated state. A long path with few cells could be an outlying extension, or a genuine but rare state. Neither measure alone resolves that ambiguity.
The AND rule above is cautious: a branch must be short and sparsely populated to be removed. An alternative OR rule removes a branch if either condition is met. The OR rule is more aggressive because every branch meeting either criterion is eligible for pruning. These rules answer different tolerance-for-error questions; neither is universally correct.
Worked Example: A Short, Sparsely Supported Terminal Branch
Suppose a hypothetical compressed skeleton has a terminal branch with three edge weights of 0.08, 0.11, and 0.07 embedding units. Seven distinct original cells are assigned to its branch-exclusive path. Use \(L_{\min}=0.30\) embedding units and \(n_{\min}=8\) cells with the conservative AND rule.
Calculate length. Add the edge weights along the tree path:
The branch is short because \(0.26 \leq 0.30\). It is sparsely supported under this rule because \(7 \leq 8\). Both conditions hold, so the rule flags the branch for pruning. This conclusion describes the output of the specified screen; it does not establish that the cell state is biologically spurious.
Justification and Assumptions
The length calculation follows from the definition of path length in a weighted tree. In a tree there is a unique path between the attachment junction and the leaf. If that path contains edges \(e_1,\ldots,e_k\), and each edge has a nonnegative weight \(w(e_i)\) representing distance along the tree, then its total length is the sum of those edge lengths:
This sum is appropriate because each successive edge contributes another segment to the path. It is not generally appropriate to substitute the direct distance between the branch endpoints: that chord can be shorter than the route along the tree, and it ignores intermediate curvature or detours. Under the AND rule, pruning follows directly from two comparisons. If \(L_b \leq L_{\min}\) and \(n_b \leq n_{\min}\), both screening conditions are met; if either inequality fails, the branch is retained by that rule.
Interpretation requires several assumptions and checks. The inferred structure must be a tree, the skeleton must preserve the intended branch paths, and the edge weights must be comparable along those paths. Cell assignments to branches must be well-defined and count each original cell at most once for a given branch. The chosen embedding and distance measure must be appropriate for the scientific question. If an edge weight is a transformed dissimilarity without a meaningful additive length interpretation, the sum can still be a chosen score, but should not be described as geometric path length.
Worked Example: Why the AND and OR Rules Differ
Consider a hypothetical branch with edge weights 0.13, 0.16, and 0.13 embedding units, and five distinct cells assigned to its exclusive path. Let \(L_{\min}=0.25\) embedding units and \(n_{\min}=10\) cells.
Its length is:
The branch does not meet the shortness condition, because \(0.42 \leq 0.25\) is false. It does meet the low-count condition, because \(5 \leq 10\) is true. Under the AND rule, it is retained: both conditions are required, and one fails. Under the OR rule, it is pruned: either condition is sufficient. This example shows why a report must state the logical rule, not just its two cutoffs.
Retaining the branch under the AND rule does not mean that it is known to be genuine. It means only that this conservative screen does not flag it. A researcher may still investigate whether a few unusual cells, an edge-weight choice, or the embedding geometry drives the extension.
Threshold Sensitivity and Diagnostics
A pruning decision can change when a cutoff changes slightly. Rather than present one threshold pair as uniquely correct, examine a small, scientifically plausible range of values. For each pair, record which branches are flagged and whether the retained skeleton's important junctions and paths change. Report the threshold units, cell-count definition, rule (AND or OR), and the range over which the interpretation remains stable.
Record its attachment junction, leaf, summed edge length, and number of distinct cells on the exclusive path.
Choose length values in the units of the selected geometry and cell-count values relevant to the data's sampling density. State why these ranges are worth checking.
For every threshold pair, evaluate the stated AND or OR condition. Do not change the rule while comparing cutoffs.
Identify branches that are always retained, always flagged, or sensitive to the thresholds. Check that pruning removes only the flagged terminal path and leaves the remaining tree connected.
A useful diagnostic table can show each branch's length and count alongside the decision under several threshold pairs. A branch close to a cutoff deserves particular attention: a small change in the cutoff, cell assignment, or edge weights could reverse its classification. Also inspect whether apparent support comes from a few highly isolated cells or whether the branch is represented across a coherent stretch of the path. Such inspection can inform interpretation, but it should not silently replace the stated rule.
Worked Example: Comparing Decisions Across Thresholds
Three hypothetical terminal branches have the following measurements. Apply the conservative AND rule first with \(L_{\min}=0.20\) embedding units and \(n_{\min}=8\) cells, then with \(L_{\min}=0.36\) embedding units and \(n_{\min}=12\) cells.
| Branch | Length (embedding units) | Distinct cells |
|---|---|---|
| A | 0.18 | 4 |
| B | 0.35 | 6 |
| C | 0.22 | 14 |
At the first threshold pair, branch A meets both conditions: \(0.18 \leq 0.20\) and \(4 \leq 8\), so it is flagged. Branch B is not short because \(0.35 \leq 0.20\) is false, so it is retained despite its low count. Branch C is short, but its count exceeds the cutoff because \(14 \leq 8\) is false, so it is retained.
At the second pair, A still meets both conditions: \(0.18 \leq 0.36\) and \(4 \leq 12\). B now meets both: \(0.35 \leq 0.36\) and \(6 \leq 12\), so its decision changes from retained to flagged. C remains retained because its count exceeds the new count cutoff: \(14 \leq 12\) is false. Thus A is flagged under both pairs, B is threshold-sensitive, and C is retained under both. This small comparison describes sensitivity to these selected thresholds; it does not quantify a probability that any branch is real.
Alternatives, Limitations, and Common Mistakes
Pruning is not the only defensible choice. Keeping all branches avoids deleting a possible rare state, but leaves potentially noisy terminal paths in the skeleton. An AND rule is a conservative screen requiring evidence from both length and cell count; an OR rule is more aggressive and can remove a long but poorly populated path or a short but densely populated one. A researcher can also defer pruning and present a sensitivity analysis, making the unpruned skeleton and the threshold-dependent alternatives visible. If results change substantially across reasonable thresholds, that instability is itself important to report.
No length-and-count rule identifies biological truth. Cell count depends on sample composition, capture, filtering, and the way cells are assigned to the skeleton. Length depends on the chosen representation and geometry. A genuine state may be rare or occupy a short transition, while an artifact can have many cells. Pruning also changes the tree: it removes the branch's path and cells from the retained skeleton, so conclusions that rely on that branch should be revisited rather than assumed unchanged.
- Mistake: treating a low count as proof of an artifact. A small \(n_b\) means limited observed support, not that the state is false. State the rule's screening interpretation and consider whether rare states are scientifically plausible.
- Mistake: using endpoint chord distance as branch length. This can understate the route along a curved or indirect tree path. Sum the weights along the branch edges when the weights represent additive distances.
- Mistake: reporting cutoffs without units or logic. “Pruned below 0.2” is incomplete. Specify the length units, cell-count cutoff, and whether both criteria or either criterion triggers pruning.
- Mistake: assuming a stable result from one threshold pair. Nearby cutoffs can change the topology. Show which branches are sensitive and avoid presenting the selected pair as a universal standard.
Check Your Understanding
Answer each question using the stated definitions and rules.
- A terminal path has edge weights 0.10, 0.15, and 0.20 embedding units, with six distinct cells assigned to it. Under the AND rule with \(L_{\min}=0.40\) embedding units and \(n_{\min}=7\) cells, is it flagged?
- A branch is 0.50 embedding units long and has four cells. With \(L_{\min}=0.30\) and \(n_{\min}=8\), compare its decision under the AND and OR rules.
- Why should the number of skeleton vertices not usually be substituted for the number of original cells supporting a branch?
- A branch is retained under one threshold pair and flagged under a nearby pair. What should be reported, and what conclusion should not be drawn?
Solutions. (1) Its length is \(0.10+0.15+0.20=0.45\) embedding units. It is not short because \(0.45 \leq 0.40\) is false, although \(6 \leq 7\) is true. The AND rule therefore retains it. (2) The branch is not short, since \(0.50 \leq 0.30\) is false, but its count is low, since \(4 \leq 8\) is true. The AND rule retains it; the OR rule flags it. (3) Skeleton vertices summarize a compressed representation and need not correspond one-to-one with original cells. Count the distinct original cells assigned to the branch-exclusive path. (4) Report the threshold pairs, the rule, and that branch's sensitivity. Do not conclude that the branch is definitively real under one pair or definitively spurious under the other.