Why Branch Assignments Can Be Uncertain
A cell observed near a branching point may resemble more than one branch. Even farther along a trajectory, noisy counts, overlapping expression patterns, or an imperfect observation model can leave uncertainty about which branch generated the cell’s measurements. A single label hides that uncertainty. A probability for each possible branch records it directly.
The calculations below concern a latent branch-membership variable and observed cell-level features. They do not make a branch label directly observable, nor do they guarantee that the model’s branch interpretation is biologically correct. The result is conditional on the branch definitions, observation model, and prior probabilities used.
The prior probabilities describe branch membership before using this cell’s observed features; they satisfy \(\pi_{ib}\geq 0\) and \(\sum_{b=1}^K \pi_{ib}=1\). Each \(f_{ib}\) is a probability mass function for discrete observations or a probability density for continuous observations. The denominator is the marginal probability mass or density of the observed features under the mixture of branch models. It normalizes the branch-specific contributions, so \(r_{ib}\geq 0\) and \(\sum_b r_{ib}=1\), provided that the denominator is positive.
Bayes’ Rule and Its Assumptions
The posterior formula follows by writing the joint probability or density of the branch and the observation as \(p(B_i=b,Y_i=y_i)=\pi_{ib}f_{ib}(y_i)\), then dividing by the marginal probability or density of the observation. This requires a well-defined set of possible branches, prior probabilities on those branches, and a valid observation model for each branch. It also requires that the observed cell features fall within the support of at least one branch model with positive prior probability. If every weighted branch density is zero, the model assigns zero probability to the observation and the posterior is undefined; that is a model-support problem, not a reason to normalize by an arbitrary number.
The formula uses the observation model and priors as given. If these are estimated from data, the resulting probabilities are conditional on the fitted values unless uncertainty in those values is explicitly incorporated. A probability such as \(r_{ib}=0.8\) therefore means that, under the specified model and prior, the posterior probability of branch \(b\) for this cell is 0.8. It is not a statement that the branch is known with certainty or that the model is correct.
Cell-level and joint-data conditioning must be kept distinct. The \(r_{ib}\) above conditions on cell \(i\)’s observation alone. In a model where cells’ observations or branch labels are dependent, other cells’ observations can change that cell’s posterior. To make a claim conditional on the complete data \(Y_1=y_1,\ldots,Y_n=y_n\), define instead $$ r_{ib}^{\mathrm{all}}=P(B_i=b\mid Y_1=y_1,\ldots,Y_n=y_n). $$ When the joint model factorizes across cells with fixed model parameters and independent branch labels, the other cells’ data do not alter cell \(i\)’s branch posterior, and \(r_{ib}^{\mathrm{all}}=r_{ib}\). Without that condition, the two quantities need not agree.
Worked Example: Two Overlapping Gaussian Branch Models
Suppose a scalar expression feature \(Y_i\), measured in normalized expression units, has distribution \(N(0,1)\) on branch A and \(N(2,1)\) on branch B. The prior probabilities are 0.6 for A and 0.4 for B, and a hypothetical cell has observed value \(y_i=1.2\). These Gaussian densities are positive for this observation, the two branch labels are exhaustive, and the stated priors sum to one, so the posterior calculation is defined.
For a normal density with standard deviation 1, the common factor \(1/\sqrt{2\pi}\) cancels in the posterior ratio. The branch-specific densities are approximately \(f_A(1.2)=0.1942\) and \(f_B(1.2)=0.2897\). Thus,
The observed feature gives nearly equal posterior support to the two branches, despite the higher prior probability of A. A hard label would choose A by a narrow margin, but that label would conceal the substantial ambiguity. This calculation is about one feature under the specified Gaussian models; it does not establish that either model describes real cells adequately.
Soft Assignments and Expected Branch Counts
A soft assignment retains every cell’s posterior probability vector \((r_{i1},\ldots,r_{iK})\). A hard maximum-posterior assignment instead chooses one branch with the largest \(r_{ib}\). Hard labels can be useful when a downstream task requires a single category, but they discard uncertainty, can make nearly tied alternatives look definitive, and can produce unstable labels when small changes in the data or model reverse a tie.
Soft probabilities also have a direct counting interpretation. Define \(I_{ib}=1\) when \(B_i=b\) and \(I_{ib}=0\) otherwise. The actual number of cells on branch \(b\) is \(N_b=\sum_{i=1}^n I_{ib}\). Conditional on all observations, the expected number is $$ E(N_b\mid Y_1=y_1,\ldots,Y_n=y_n) =\sum_{i=1}^n E(I_{ib}\mid Y_1=y_1,\ldots,Y_n) =\sum_{i=1}^n r_{ib}^{\mathrm{all}}. $$
This follows from linearity of conditional expectation; it does not require independent branch assignments. The conditioning information must match the posterior probabilities being summed. If only cell-level \(r_{ib}\) values are available, their sum is not automatically the expected branch count conditional on all cells’ observations in a dependent model. Under the factorization condition described above, the cell-level and full-data posteriors coincide, and \(\sum_i r_{ib}\) is the conditional expected count. Otherwise, the unconditional identity \(E(N_b)=\sum_i E(I_{ib})\) still holds, with \(E(I_{ib})=E\{P(B_i=b\mid Y_i)\}\) by the law of total expectation.
Worked Example: Soft Probabilities and Expected Counts
Consider four hypothetical cells with a binary branch label, A or B. Suppose each cell has one observed categorical marker, the prior probability of each branch is 0.5, and the marker probabilities are as follows. These probabilities define valid distributions: the values in each branch column sum to one.
| Marker category | Probability under A | Probability under B |
|---|---|---|
| U | 0.36 | 0.04 |
| V | 0.28 | 0.12 |
| W | 0.20 | 0.30 |
| Z | 0.06 | 0.54 |
| R | 0.10 | 0.10 |
Suppose the four observed categories, in cell order, are U, V, W, and Z. For a cell with category U, for example, Bayes’ rule gives \(P(A\mid U)=0.5(0.36)/[0.5(0.36)+0.5(0.04)]=0.90\). Likewise, the posterior probabilities of A for V, W, and Z are \(0.28/(0.28+0.12)=0.70\), \(0.20/(0.20+0.30)=0.40\), and \(0.06/(0.06+0.54)=0.10\). The corresponding probabilities of B are 0.10, 0.30, 0.60, and 0.90. Assume the model factorizes across these cells, with fixed priors and observation probabilities, so these posteriors are also the probabilities conditional on all four observations.
The soft expected count on A is \(0.90+0.70+0.40+0.10=2.10\) cells; on B it is \(0.10+0.30+0.60+0.90=1.90\) cells. These are posterior expected counts, not observed fractional cells. The maximum-posterior hard labels are A, A, B, B, giving counts of 2 and 2. The soft and hard summaries differ because the soft calculation retains uncertainty in each cell’s membership.
Uncertainty, Diagnostics, and Limitations
A posterior probability vector is a compact summary, but the values should be checked against the model that produced them. In particular, a probability near one can reflect strong evidence, an influential prior, or a branch model that is too narrow. Diagnostics should therefore include checks on both the inputs and the resulting assignments.
- Check normalization and support. For every cell, verify that posterior probabilities are nonnegative and sum to one, and confirm that the observed feature has positive probability under at least one branch with positive prior weight.
- Inspect ambiguity. Cells with several similar branch probabilities are weakly distinguished by the supplied observations. Report this uncertainty rather than presenting a single label as unambiguous.
- Check sensitivity. Recalculate assignments under plausible alternative priors or observation-model parameters. Large changes indicate that the assignments depend strongly on those choices.
- Look for implausible certainty or systematic mismatch. Near-zero or near-one posteriors for nearly every cell may be reasonable in some settings, but can also signal overly separated branch models or poor calibration. Patterns of observations that fit none of the branches point to model misspecification or inadequate support.
- Respect dependence. If cells share uncertain parameters or are otherwise dependent, cellwise posteriors may not be the same as posteriors conditioned on all observations. Do not use a cellwise sum as a full-data conditional expected count without justification.
Soft assignment is not a cure for misspecification: a normalized set of probabilities can still be misleading if the branch priors or observation distributions are wrong. Nor does summing posterior probabilities make the observed branch count known exactly. It gives an expectation; uncertainty about the count depends on the joint posterior distribution of the branch labels. Under conditionally independent branch labels given the observations, the count variance can be obtained by summing the individual Bernoulli variances. With dependent labels, covariance terms also contribute.
Worked Example: Quantifying Count Uncertainty Under Independence
Use the four posterior probabilities for branch A from the preceding example: 0.90, 0.70, 0.40, and 0.10. Suppose the branch labels are conditionally independent given the observed categories and fixed model parameters. Each indicator \(I_{iA}\) is then Bernoulli with success probability \(r_{iA}\). The conditional expected count is 2.10 cells, as calculated above. Independence gives the conditional variance
The conditional standard deviation is \(\sqrt{0.63}\approx 0.7937\) cells. This describes uncertainty in the number of cells on A under the stated posterior model; it is not an additional uncertainty measure for each individual cell. If the labels are dependent, the variance also includes \(2\sum_{i<j}\operatorname{Cov}(I_{iA},I_{jA}\mid y_1,\ldots,y_4)\), so the independence calculation would not apply.
Choosing Between Soft and Hard Labels
A hard label is the most probable branch for a cell, but that decision rule is not automatically best for every purpose. If all errors have equal cost and a single label is required, choosing the branch with the largest posterior probability minimizes the cell’s posterior probability of misclassification. If errors have unequal consequences, a different decision rule may be appropriate. Soft probabilities are preferable when the goal is to preserve uncertainty, describe an expected branch composition, or avoid treating borderline cells as certain assignments. Neither representation removes the need to examine model fit, priors, and the meaning of the branch labels.
Check Your Understanding
Answer each question, then compare with the solutions below.
- A cell has prior branch probabilities 0.7 for A and 0.3 for B. Its observation has density 0.2 under A and 0.6 under B. Calculate both posterior probabilities and state which branch receives the larger posterior probability.
- Why must the posterior probabilities across branches sum to one? What does a zero denominator in the posterior formula indicate?
- Four cells have posterior probabilities for branch A of 0.8, 0.5, 0.3, and 0.1. What is the expected number on A when these are full-data posterior probabilities? How many receive A under maximum-posterior assignment, assuming ties are assigned to A?
- In a dependent model, why is it unsafe to sum probabilities defined as \(P(B_i=b\mid Y_i=y_i)\) and call the result the expected count conditional on all cells’ observations?
Solutions. (1) The denominator is \(0.7(0.2)+0.3(0.6)=0.32\). Thus \(P(A\mid y)=0.14/0.32=0.4375\), and \(P(B\mid y)=0.18/0.32=0.5625\); B has the larger posterior probability. (2) The branches are mutually exclusive and exhaustive, so their conditional probabilities must sum to one. A zero denominator means every branch with positive prior assigns zero probability density or mass to the observation, making the posterior undefined under this model. (3) The expected count is \(0.8+0.5+0.3+0.1=1.7\) cells. Maximum-posterior assignment gives A to the first two cells, including the tie under the stated rule, so the hard count is 2. (4) The full-data conditional expected count is the sum of \(P(B_i=b\mid Y_1,\ldots,Y_n)\). In a dependent model, conditioning on other cells’ observations can change each branch probability, so the own-observation probabilities need not equal those full-data probabilities.