Why Label Granularity Is a Statistical Decision
A cell-type annotation can be biologically plausible yet more specific than the evidence warrants. If the candidate labels include two closely related subtypes, uncertainty between them need not make their broader parent class uncertain. Conversely, calling a cell only by its broad class discards distinctions that may matter for the scientific question. Choosing a label therefore requires balancing the risk of an incorrect specific claim against the cost of reporting less detail.
A cell ontology makes this choice explicit by arranging labels in a hierarchy. Broad classes sit above more specific subtypes. This tutorial considers how to select a node in that hierarchy when uncertainty about the underlying cell type is available, and how that choice changes the interpretation of an annotation. It does not treat a more detailed label as automatically better: the appropriate level depends on both the evidence and the consequences of being wrong.
For example, a hierarchy might place CD4 T cell and CD8 T cell under T cell, with T cell itself under lymphocyte. Assigning the label T cell asserts membership in the set of its descendant types, but does not assert which descendant is present. It is thus a valid, less specific claim—not the same claim as assigning one of its subtype labels.
In some ontologies, a label may have multiple parents, or distinctions may depend on tissue, developmental stage, or activation state. The tree formulation below assumes that the analysis has selected a consistent single-parent hierarchy for the labels under consideration. If the source ontology is a graph rather than a tree, define each label's descendant set carefully and avoid counting a leaf more than once when aggregating probabilities. The ontology version and the biological context must also be recorded, since changes to either can alter what a label includes.
Support for a Broad Ontology Node
Suppose an annotation decision provides probabilities over the possible fine cell types, conditional on the observed cell data \(D\). Write \(q_i=P(Y=i\mid D)\) for the probability assigned to leaf \(i\). These probabilities are inputs to the granularity decision here; the key operation is to aggregate them according to the ontology. For a node \(v\), define its support as the sum of the probabilities for its descendant leaves:
The sum is appropriate because the descendant leaves are mutually exclusive possibilities in this tree representation. If their probabilities sum to one across all leaves, then the support of the root is one. A parent node's support is at least as large as the support of any one of its children. This increase in support does not mean that the data have become more informative: the broader label simply combines several possibilities into one reported category.
A useful way to choose a node is to specify the relative costs of an overly broad annotation and an incorrect annotation. Let \(c(v)\) be the cost of reporting node \(v\) when the true type is one of its descendants, and let \(M(v)\) be the cost when the true type lies outside its descendant set. These costs are nonnegative and must be chosen for the analysis question. For a fine leaf, it is often reasonable to set \(c(v)=0\), since it reports the finest available distinction. A broad node may have positive \(c(v)\), representing the loss of detail. An incorrect label may have cost \(M(v)\), representing the consequences of claiming membership in the wrong branch.
This rule is not a universal biological standard. It is a transparent way to express a trade-off. If confusing two subtypes has very different consequences from confusing two broad classes, a single common value of \(M(v)\) will be inadequate. In that case, specify a loss for each possible reported node and true leaf, and compute the expected loss by summing over leaves. The principle remains the same: a more specific label must earn its extra detail by reducing expected loss enough to justify its risk.
Why the Broad-versus-Specific Threshold Has This Form
Consider a broad parent \(p\) and one candidate child leaf \(i\). For simplicity, suppose the cost of a wrong label is the same value \(M\) for both choices, and the parent has broadness cost \(c\), while the leaf has broadness cost zero. The expected losses are
The parent is preferred when \(R(p)<R(i)\). Subtracting the terms for incorrect labels gives
The quantity \(q(p)-q_i\) is the probability mass on the parent's other descendants. It measures how much probability the broad label captures beyond the proposed child. The broad label is worthwhile when the expected benefit of including those alternatives, weighted by the cost of a wrong claim, exceeds the cost of losing specificity. If equality holds, the two choices have equal expected loss under this model. The result is a decision threshold, not a test of whether a subtype is biologically real.
Worked Example: Choosing Between T Cell and a T-Cell Subtype
Suppose a hypothetical cell has probabilities \(0.46\) for CD4 T cell, \(0.34\) for CD8 T cell, \(0.12\) for B cell, and \(0.08\) for NK cell. The ontology places the first two leaves under T cell and all four under lymphocyte. Use a wrong-label cost \(M=1\), a T-cell broadness cost \(c=0.25\), and a lymphocyte broadness cost of \(0.55\). These illustrative costs are chosen for this example, not supplied by the ontology.
The support for T cell is \(q(\mathrm{T})=0.46+0.34=0.80\). The support for lymphocyte is \(q(\mathrm{lymphocyte})=0.46+0.34+0.12+0.08=1.00\). The expected losses are:
Among these candidates, T cell has the smallest expected loss, \(0.40\), so it is selected under the stated costs. The fine CD4 T-cell label has only \(0.46\) support, while the broader T-cell label covers \(0.80\) of the probability. The lymphocyte label covers all candidates but incurs too much loss of detail under the specified cost. A different scientific goal could assign different costs and produce a different choice.
Worked Example: When a Subtype Is Worth Reporting
Consider a hypothetical cell with probabilities \(0.82\) for classical monocyte, \(0.10\) for intermediate monocyte, and \(0.08\) for nonclassical monocyte. All three are descendants of the ontology node monocyte. Let the cost of reporting monocyte be \(c=0.15\), and let a wrong label cost \(M=1\).
The broad node has support \(q(\mathrm{monocyte})=0.82+0.10+0.08=1.00\), so its expected loss is \(R(\mathrm{monocyte})=0.15(1.00)+1(0)=0.15\). The classical monocyte leaf has expected loss \(R(\mathrm{classical})=1(1-0.82)=0.18\). The two remaining leaves have losses \(1-0.10=0.90\) and \(1-0.08=0.92\), respectively. Thus, among these options, monocyte has the smallest expected loss, although the leading subtype has fairly high support.
Now suppose the scientific question makes subtype detail more important, and the broadness cost is set to \(c=0.05\), with all other assumptions unchanged. Then \(R(\mathrm{monocyte})=0.05\), while \(R(\mathrm{classical})=0.18\). The broad label still wins: under this two-cost rule, reducing the broadness cost alone makes the parent more attractive, not less. To illustrate when a subtype becomes preferable, instead set the broadness cost to \(c=0.25\). The monocyte loss becomes \(0.25\), while the classical monocyte loss remains \(0.18\), so classical monocyte is selected. This calculation makes the trade-off explicit: a larger cost for losing subtype detail can justify a specific label even when it carries some probability of error.
Comparing Granularity Strategies
The expected-loss calculation helps explain the main alternatives. None is automatically correct; each encodes a different reporting goal.
| Strategy | What it does | Main limitation |
|---|---|---|
| Always report the finest available type | Selects a leaf even when probability is spread across its siblings. | Can present uncertain subtype distinctions as definite claims. |
| Always report labels at one fixed depth | Gives every cell a label at the same ontology level. | Ignores that evidence may support different levels for different cells or branches. |
| Select the node with minimum expected loss | Balances support for a node against the cost of lost detail and errors. | Requires defensible costs and candidate labels; results can change when costs change. |
A maximum-probability leaf rule, for example, selects the most probable subtype even if its probability is modest. That rule answers “which leaf has the largest probability?” It does not answer “is the evidence sufficient to report that leaf rather than its parent?” The decision rule above addresses the second question by comparing the expected losses of reporting different nodes.
Granularity also changes what uncertainty statement is meaningful. In the monocyte example, the classical subtype has probability \(0.82\), while the parent monocyte has probability \(1.00\) among the listed candidates. Reporting the parent avoids choosing among its descendants, but the annotation is less informative. It would be misleading to say that uncertainty disappeared: uncertainty among the three subtypes remains, even though the broader class is supported. Probability aggregation changes the resolution of the reported claim, not the underlying evidence.
Assumptions, Diagnostics, and Limitations
The calculation relies on several assumptions that should be checked before using it. First, the candidate leaves must represent mutually exclusive possibilities for the cell in the context being analyzed. Second, the probabilities over those leaves must refer to the same cell and sum to one, or the missing probability mass must be handled explicitly rather than silently discarded. Third, the ontology's descendant relations must match the biological meaning of the labels in the analysis. Finally, the costs should reflect the purpose of the annotation: the cost of losing subtype detail may differ between a descriptive atlas and a study whose main question concerns that subtype.
Several practical diagnostics can reveal problems. Check that each reported broad label actually contains every leaf being aggregated beneath it. Recalculate node support from the leaf probabilities and verify that a parent never has less support than one of its children. Inspect cells with nearly tied expected losses: small changes to the cost values may switch their chosen node, so a single categorical label can conceal decision sensitivity. Compare decisions across plausible cost choices and report the chosen policy. Also look for branches where labels have inconsistent depths or where ontology terms do not match the biological context; those cases may require revising the candidate hierarchy before calculating losses.
The method has important limits. The ontology organizes terms; it does not establish that the underlying biology is discrete, nor does it guarantee that every relevant state appears as a leaf. A broad label may also combine biologically distinct cells that should not be treated as interchangeable for the scientific question. Conversely, a fine distinction may be unstable or irrelevant even if it appears in the ontology. Expected loss makes the consequences of a chosen label explicit, but it cannot determine the correct scientific costs by itself. Report the ontology version, the label level, the decision costs or rule, and any uncertainty that remains within a broad label.
Common Mistakes
- Calling the most probable leaf the certain answer. The largest leaf probability may still leave substantial probability on sibling types. Compare its expected loss with that of the parent before claiming the subtype.
- Treating a broad label as proof of low uncertainty. A parent can have high support because it combines uncertain descendants. State what remains unresolved within that parent when it matters.
- Assuming ontology depth is a measure of evidence. A deeper term is more specific by definition, not necessarily better supported by the data.
- Changing granularity without stating a rule. Different cells can appropriately receive labels at different levels, but the rule and its costs should be documented so the choices are interpretable.
Check Your Understanding
Use the stated assumptions to answer each question. Solutions follow the questions.
- A parent node has two descendant leaves with probabilities \(0.60\) and \(0.25\). What is the parent's support?
- A broad node has support \(0.90\), broadness cost \(0.20\), and wrong-label cost \(1\). Find its expected loss.
- A parent has support \(0.80\), and its leading child has probability \(0.65\). With parent cost \(c=0.10\) and wrong-label cost \(M=1\), which has lower expected loss: the parent or that child?
- Why does a broad label with support \(1.00\) not imply that the fine cell type is known without uncertainty?
Solutions. (1) The support is \(0.60+0.25=0.85\). (2) The expected loss is \(0.20(0.90)+1(1-0.90)=0.18+0.10=0.28\). (3) The parent loss is \(0.10(0.80)+1(0.20)=0.08+0.20=0.28\); the child loss is \(1(1-0.65)=0.35\). The parent has lower expected loss. (4) The broad node may contain several fine types whose probabilities sum to one. The aggregate supports the parent membership, but does not identify which descendant leaf is true.