Why Cell-Type Labels Form a Hierarchy
Cell types are often organized at several levels: a broad lineage, a more specific type within that lineage, and sometimes a subtype within that type. A prediction at a fine level therefore depends on decisions or probabilities at broader levels. If a cell is only weakly supported as belonging to a lineage, a confident-looking subtype prediction within that lineage should not be interpreted as certainty about the cell’s overall identity.
Hierarchical classification makes this dependence explicit. It represents labels as a tree and uses conditional probabilities at each branch. The introductory material on cell-type annotation as a statistical decision establishes why labels and the costs of errors matter; here the focus is how a hierarchy structures the probabilities and how uncertainty propagates through it.
For the basic calculations below, assume the leaves are mutually exclusive and collectively exhaustive for the labels being modeled: each cell belongs to one of the represented leaf classes. Each parent’s children must likewise account for all modeled possibilities within that parent. If a plausible label is missing, an “other” or “unknown” child may be needed; otherwise the probabilities at that branch do not describe all possibilities.
From Conditional Probabilities to Node Probabilities
Let \(u\) be a parent node and \(v\) one of its children. A hierarchical classifier can provide the conditional probability \(q_{v\mid u}(x)\): the probability of child \(v\), given that the cell belongs to the parent \(u\), for a cell with features \(x\). The child probabilities at a parent sum to one when its children form a complete set of alternatives. Starting with probability one at the root, multiply the conditional probabilities along a path to obtain the probability of a descendant.
This multiplication is the probability chain rule applied to the nested label events. It does not require an independence assumption between classification stages: each factor is conditional on the preceding parent event. It does require the conditional probabilities to refer to the same cell and the same label hierarchy, and to be coherent across branches.
Worked Example: Propagating Probabilities to a Subtype
Suppose a hypothetical classifier assigns a cell probability of \(0.70\) to the immune-cell parent. Conditional on being an immune cell, its probabilities for B cell, T cell, and another immune type are \(0.60\), \(0.30\), and \(0.10\). Conditional on being a B cell, the probabilities for plasma cell, naive B cell, and memory B cell are \(0.25\), \(0.50\), and \(0.25\). Find the overall probability of the plasma-cell label.
The conditional probabilities at each stated parent sum to one: \(0.60+0.30+0.10=1\) and \(0.25+0.50+0.25=1\). The branches are therefore complete as specified. The path to plasma cell passes through immune cell and B cell, so
The model assigns \(10.5\%\) probability to the plasma-cell label overall. The \(25\%\) conditional probability within B cells is not the overall probability: it must be multiplied by the probabilities of reaching B cell and its immune-cell parent. The cell’s probability of being within the immune-cell branch is \(0.70\), so no descendant of that branch can have probability above \(0.70\).
Why Parent Uncertainty Limits Subtype Probability
For any descendant, its path probability is the parent probability multiplied by conditional probabilities between zero and one. Consequently, a descendant’s probability cannot exceed the probability of any ancestor. This is the formal sense in which uncertainty at an early parent decision propagates to subtype predictions.
For a descendant \(v\) of \(u\), let \(c\) be the product of the conditional probabilities on the path from \(u\) to \(v\). Then \(0\leq c\leq 1\), and \(p(v\mid x)=p(u\mid x)c\). If \(p(u\mid x)>0\), the descendant has the same probability as the ancestor only when every conditional probability along that path equals one. If \(p(u\mid x)=0\), every descendant also has probability zero, regardless of the intervening conditional probabilities. In particular, equality in this zero-probability case does not imply that the conditional probabilities on the path equal one.
Probabilities of sibling children also provide a useful consistency check. If the children \(v_1,\ldots,v_m\) exhaust parent \(u\), then
The child probabilities partition the parent probability; they do not each inherit the full parent probability. Recursively applying this identity shows that the probabilities of all leaves below a node sum to the probability of that node, provided each set of children is complete.
Worked Example: A Zero-Probability Parent
In a hypothetical prediction, a cell has probability \(0\) of belonging to a particular lineage. Conditional on that lineage, the classifier gives one subtype a probability of \(0.50\) and the other subtype a probability of \(0.50\). What are the overall subtype probabilities?
The conditional probabilities sum to one and are valid for describing a cell given membership in the lineage. The path multiplication gives
Both subtypes have the same overall probability as their parent, namely zero, even though neither conditional probability along the parent-to-child step equals one. The conditional values describe how probability would be divided within the parent; they cannot create overall probability when the parent itself has probability zero.
Top-Down Decisions and the Most Probable Leaf
A top-down classifier makes a sequence of local decisions: at each parent, select the child with the largest conditional probability, then continue down that child’s branch until reaching a leaf. This procedure is easy to interpret because each choice answers a local question, such as which cell type is most plausible conditional on the selected lineage.
A different rule is to compute the overall probability of every leaf by multiplying along its path, then select the leaf with the largest overall probability. This is the maximum-probability leaf rule. The two rules need not agree: a branch with a larger probability at the first decision may have relatively weak conditional support deeper in the tree.
Worked Example: Greedy Choice Versus Maximum-Probability Leaf
Consider a hypothetical tree with two children at the root, A and B. Their probabilities are \(0.55\) and \(0.45\). Within A, the conditional probabilities of leaves A1 and A2 are \(0.51\) and \(0.49\). Within B, the conditional probabilities of leaves B1 and B2 are \(0.99\) and \(0.01\). Each pair of conditional probabilities sums to one. Compare the two decision rules.
The greedy top-down rule first selects A because \(0.55>0.45\), then selects A1 because \(0.51>0.49\). Its prediction is A1. The overall leaf probabilities are
These four probabilities sum to \(1.0000\). The largest is \(0.4455\), so the maximum-probability leaf is B1, not A1. The discrepancy arises because the strong conditional support for B1 more than compensates for B’s lower root probability. A chosen decision rule should therefore be stated explicitly; “top-down classification” does not by itself determine whether one means greedy local choices or global maximization over leaves.
Implementation, Diagnostics, and Alternatives
A practical implementation stores the hierarchy and the conditional predictions at each parent. For each cell, initialize the root probability to one, multiply by the appropriate child probability at each step, and retain the resulting probabilities for every node or leaf of interest. If the intended output is a greedy label, record the selected child at each step. If the intended output is the most probable leaf, calculate and compare all leaf path products; do not assume a greedy path produces the maximum.
Confirm that every modeled leaf has a unique path from the root, that child labels are defined consistently, and that every parent’s children cover the possibilities being modeled.
For each cell and parent, verify that child conditional probabilities lie between zero and one and sum to one, apart from small rounding error.
Multiply along paths, then check that sibling probabilities sum to their parent probability and that the leaf probabilities sum to one at the root.
Use sequential local maxima for a greedy label, or compare all leaf probabilities for a maximum-probability leaf. Report uncertainty separately from the selected label.
These checks can expose several failure modes. If a parent’s children sum to less than one, the hierarchy may omit a plausible label; if they sum to more than one, categories may overlap or the outputs may not be normalized. Renormalizing incomplete children to sum to one can conceal the missing class and inflate the apparent probabilities of represented labels. Small discrepancies from rounding are different from systematic failures of the sum-to-one check.
A very small parent probability forces all descendants to have small overall probabilities, even if one conditional subtype probability is high. This is not an arithmetic defect; it is the intended consequence of uncertainty at the parent. Conversely, multiplication cannot repair poorly estimated conditional probabilities. Sparse training examples within a parent, inconsistent label definitions, or differences between the reference data and the cells being annotated can make conditional predictions unreliable. Probability propagation preserves those errors as well as valid information.
Hierarchical prediction can be compared with a flat classifier that predicts directly among all leaf labels. A flat classifier avoids sequential branch decisions, while a hierarchy makes broad-to-specific structure explicit and can provide interpretable probabilities at intermediate levels. Their outputs are not automatically comparable: a hierarchical model’s leaf probabilities depend on all conditional stages, whereas a flat model estimates leaf probabilities directly. A useful comparison asks whether the label structure is meaningful for the task and whether the chosen model’s predictions are supported by validation—not whether one method is universally superior. Neither hierarchy alone nor a high conditional probability guarantees that probabilities are calibrated or that the reference includes every relevant cell type.
Common Mistakes and Practical Interpretation
- Reporting a conditional subtype probability as an overall probability. A value such as \(0.80\) for a subtype conditional on its parent must be multiplied by the probability of that parent and every intervening ancestor.
- Treating the greedy path as the most probable leaf. Local maxima need not maximize the product over complete paths; calculate leaf probabilities when global maximization is the intended rule.
- Reading a conditional probability as evidence that the parent is certain. A conditional value describes a division within the parent. It does not remove uncertainty about whether the cell belongs to the parent at all.
- Interpreting a zero parent probability as a failed conditional prediction. Descendant probabilities are then zero by multiplication, even if the conditional probabilities within the parent are well-defined and sum to one.
- Assuming a hierarchy makes predictions correct or calibrated. It organizes probabilities, but the quality of the conditional predictions and the completeness of the labels still require assessment.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- A parent node has probability \(0.40\). A child has conditional probability \(0.75\) within that parent. What is the child’s overall probability?
- A parent has probability zero, and a child’s conditional probability is \(0.30\). What is the child’s overall probability? Does equality with the parent probability imply a conditional probability of one?
- At the root, A has probability \(0.60\) and B has probability \(0.40\). A has one leaf with conditional probability \(0.50\); B has one leaf with conditional probability \(0.90\). Which leaf does the greedy rule choose, and which leaf has the larger overall probability?
- At a parent with probability \(0.25\), its three children have conditional probabilities \(0.20\), \(0.30\), and \(0.50\). What is the sum of the three overall child probabilities, and what check does this illustrate?
Solutions. (1) The child probability is \(0.40(0.75)=0.30\). (2) It is \(0(0.30)=0\). It equals the parent probability, but that does not imply a conditional probability of one: the parent probability is zero. (3) Greedy classification chooses A at the root and then its only leaf. The overall probabilities are \(0.60(0.50)=0.30\) for A’s leaf and \(0.40(0.90)=0.36\) for B’s leaf, so B’s leaf has the larger overall probability. (4) The child probabilities sum to \(0.25(0.20+0.30+0.50)=0.25\), equal to the parent probability. This checks that exhaustive child labels partition their parent’s probability.