Tutorials › Statistical Methods for Single-Cell RNA Sequencing › A Generative Model for Doublets

Quality Control, Doublets and Ambient RNA · Tutorial 28 of 700

A Generative Model for Doublets

Learn how a doublet’s observed gene counts arise by adding two cell profiles, and why the resulting barcode can look mixed, high-count, or difficult to distinguish from a singlet.

Intermediate 10 min read

What You'll Learn

  • Define a doublet at the level of a barcoded count matrix.
  • Write the summed-count model for two captured cell profiles.
  • Derive the doublet’s total count and normalized gene proportions.
  • Calculate how different source profiles can produce a mixed observed profile.
  • Explain why similar source profiles may yield a high-count barcode without an obvious mixture.
  • Recognize assumptions and diagnostics that limit interpretation of the model.

Why Model a Doublet?

A barcode is usually interpreted as representing one cell, but a capture partition can contain two cells. RNA from both cells may then be assigned to the same barcode. The resulting row of the count matrix records one barcode, even though its RNA came from two sources. A generative model makes this distinction explicit: the observed counts are formed by combining two cell-specific count profiles.

This model explains two broad patterns. When the two cells have different expression profiles, their combined profile can contain signal from both. When their profiles are similar, the combined profile can retain an ordinary-looking composition while having more total counts than either source alone. Neither pattern uniquely establishes that a barcode is a doublet; singlets can also vary in total RNA and expression.

Definition: In the basic two-cell doublet model, a barcode contains captured RNA from two cells. For each gene, its observed count is the sum of the counts contributed by the two cells. The model describes the origin of the barcode’s counts; it does not by itself determine whether a particular observed barcode is a doublet.

A Count-Level Generative Model

Suppose there are \(G\) genes. Let \(X_{kg}\) be the captured count for gene \(g\) from source cell \(k\), for \(k=1,2\). The observed count \(Y_g\) for gene \(g\) in the shared barcode is

$$ Y_g=X_{1g}+X_{2g}, \qquad g=1,\ldots,G. $$

Writing each cell’s gene counts as a vector gives \(\mathbf{Y}=\mathbf{X}_1+\mathbf{X}_2\). The total observed count is therefore the sum of the two source totals. Define \(N_k=\sum_{g=1}^{G}X_{kg}\) and \(N=\sum_{g=1}^{G}Y_g\). Then

$$ N=N_1+N_2. $$

A useful model for the shape of each profile conditions on its total count. Let \(\boldsymbol{\theta}_k=(\theta_{k1},\ldots,\theta_{kG})\) be the source cell’s gene-proportion vector, where \(\theta_{kg}\geq 0\) and \(\sum_g\theta_{kg}=1\). Conditional on \(N_k\) and \(\boldsymbol{\theta}_k\), model the source counts as

$$ \mathbf{X}_k\mid N_k,\boldsymbol{\theta}_k \sim \operatorname{Multinomial}(N_k,\boldsymbol{\theta}_k). $$

This is a simplified conditional model: the total \(N_k\) is treated as given, and the gene counts are allocated according to the cell’s proportions. It does not claim that all cells have the same total or the same gene proportions. Once two realized source profiles are combined, the normalized doublet profile is their total-count-weighted average:

$$ \frac{Y_g}{N} = \frac{N_1}{N_1+N_2}\frac{X_{1g}}{N_1} + \frac{N_2}{N_1+N_2}\frac{X_{2g}}{N_2}, \qquad N_1,N_2>0. $$

Thus the profile is not generally the unweighted average of the two source profiles. The source contributing more captured counts has greater influence on the combined proportions. This is a statement about the realized counts; it does not mean that a doublet’s normalized proportions must look distinct from those of every singlet.

Assumptions and a Short Derivation

The additive model is useful when several conditions are reasonable. Both source profiles must use the same gene definitions and counting units; counts from the two sources must be assigned to the shared barcode; and the observed counts must represent molecules in a way that can be added across sources. The basic model also assumes that the barcode contains exactly two contributing cells and sets aside complications such as molecule-tag collisions, barcode errors, and ambient RNA. These are modeling simplifications, not guarantees about every experiment.

The weighted-profile result follows directly from the count model. Sum the gene-level equation \(Y_g=X_{1g}+X_{2g}\) over all genes to obtain \(N=N_1+N_2\). Divide the gene-level equation by \(N\), and multiply and divide each source term by its total:

$$ \frac{Y_g}{N} = \frac{X_{1g}+X_{2g}}{N_1+N_2} = \frac{N_1}{N_1+N_2}\frac{X_{1g}}{N_1} + \frac{N_2}{N_1+N_2}\frac{X_{2g}}{N_2}. $$

The weights are nonnegative and sum to one, so the combined proportion for a gene lies between the two source proportions for that gene. This derivation concerns a profile normalized by its total; it does not imply that the total count is itself a reliable doublet label.

Worked Example: Two Different Profiles Create a Mixed Count Row

Consider two hypothetical source cells with counts for three genes. Cell 1 has counts \((40,10,0)\), and cell 2 has counts \((0,10,40)\). Assume these counts are captured and assigned to one shared barcode without collisions.

Adding gene by gene gives

$$ \mathbf{Y}=(40+0,\;10+10,\;0+40)=(40,20,40). $$

The source totals are both 50, so the combined total is \(N=50+50=100\). The normalized barcode profile is \((40/100,\;20/100,\;40/100)=(0.40,0.20,0.40)\). The source proportions were \((0.80,0.20,0)\) and \((0,0.20,0.80)\); with equal totals, their weighted average is \((0.40,0.20,0.40)\). The shared barcode therefore has counts for genes prominent in both source profiles. This is one way a doublet can appear mixed.

Worked Example: Similar Profiles Can Look High-Count

Suppose each of two hypothetical cells has the same proportions across three genes, \((0.60,0.30,0.10)\), and each contributes 80 captured counts. A possible count vector for each is \((48,24,8)\). Assume the two contributions are added without collisions.

The shared barcode has counts \((48+48,\;24+24,\;8+8)=(96,48,16)\), for a total of \(96+48+16=160\) counts. Its proportions are \((96/160,\;48/160,\;16/160)=(0.60,0.30,0.10)\), exactly the same as either source’s proportions.

The doubled total is consistent with the additive model, but the unchanged proportions provide no visible evidence of mixing. A singlet with an unusually large total could also have 160 counts. Therefore, a high total can motivate closer inspection, but this calculation alone cannot distinguish a doublet from a high-count singlet.

Worked Example: Unequal Source Totals Change the Mixture Weights

In another hypothetical case, cell 1 contributes \((30,24,6)\), totaling 60, and cell 2 contributes \((3,6,21)\), totaling 30. Assume both are assigned to the same barcode and their counts add directly.

The combined counts are \((33,30,27)\), with total \(33+30+27=90\). The source proportions are \((0.50,0.40,0.10)\) and \((0.10,0.20,0.70)\). The total-count weights are \(60/90=2/3\) and \(30/90=1/3\). For gene 1, the weighted proportion is \((2/3)(0.50)+(1/3)(0.10)=0.3667\). For gene 2 it is \((2/3)(0.40)+(1/3)(0.20)=0.3333\), and for gene 3 it is \((2/3)(0.10)+(1/3)(0.70)=0.3000\).

These values match the proportions from the summed counts: \(33/90=0.3667\), \(30/90=0.3333\), and \(27/90=0.3000\), to four significant figures. An unweighted average would give \((0.30,0.30,0.40)\), which does not match: cell 1 contributes twice as many counts and therefore has twice the weight in the observed profile.

What the Model Implies for QC

A doublet can have more total counts than either source because the observed total is additive. It can also have more detected genes, but the increase depends on how much the source profiles overlap. If \(S_1\) and \(S_2\) are the sets of genes with positive counts in the two source profiles, then the detected genes in their sum are in \(S_1\cup S_2\). The number detected is

$$ |S_1\cup S_2|=|S_1|+|S_2|-|S_1\cap S_2|. $$

Genes detected in both cells are counted once in the combined barcode’s number of detected genes. Consequently, two source cells with many shared detected genes may produce a smaller increase in detected-gene count than two cells with little overlap. Neither total counts nor detected genes are guaranteed to increase by a fixed factor.

In practice, compare a barcode’s counts and detected genes with appropriate singlet expectations in its sample and cell context, rather than treating a single threshold as definitive. Inspect whether its gene profile contains a plausible combination of signals, while remembering that genuine biological variation can also produce broad or unusual expression. The earlier material on per-cell counts and detected genes provides the basic QC summaries; here, the generative model clarifies why elevated values can arise from two sources.

Key takeaway: Under the simple two-cell model, gene counts add and normalized proportions form a total-count-weighted average of the source profiles. A mixed profile or elevated total is compatible with a doublet, but neither pattern alone proves that a barcode contains two cells.

Diagnostics, Alternatives, and Limitations

The model is a description of how counts can be generated, not a complete detection procedure. Its simplifying assumptions can fail or be incomplete. For example, the two source cells may have different capture efficiencies, and repeated molecule tags within one barcode can prevent exact additivity in the observed deduplicated counts. A barcode may also contain RNA not adequately represented by the two-cell model. In those cases, the summed profile is an approximation to the recorded data rather than an exact physical accounting of every molecule.

A useful diagnostic question is whether several observations agree with the model: a barcode may have elevated total counts, additional detected genes, and a combination of expression signals that is plausible given the surrounding data. Agreement increases the plausibility of a doublet explanation, but it is not conclusive. Conversely, failure to see an obvious mixed profile does not rule out a doublet when the source profiles are similar or one source contributes much less captured RNA.

One alternative is to focus only on normalized proportions. This makes composition easier to compare across totals, but it discards the total-count information that can be a consequence of adding two profiles. Another is to treat every barcode as a single-cell profile and ignore the possibility of multiple sources; that is simpler, but can misrepresent the origin of the counts. The additive model keeps both composition and total in view, while remaining deliberately simpler than a full model of capture, sequencing, and technical errors.

A common mistake is to reason, “This barcode has twice the usual counts, so it must be a doublet.” The correction is that the model predicts a sum when two cells share a barcode, but a large count can also occur for a singlet; moreover, doublets need not have exactly twice a typical count. Source totals vary, capture is imperfect, and the two profiles can overlap. Counts are evidence to interpret in context, not a deterministic label.

Check Your Understanding

Answer each question using the two-source additive model. Solutions follow the questions.

  1. Two source cells contribute counts \((12,8)\) and \((3,17)\) for two genes. What is the shared barcode’s count vector and total?
  2. Cell A has total 40 and gene-1 proportion 0.70; cell B has total 20 and gene-1 proportion 0.10. What is the combined gene-1 proportion?
  3. Why can a doublet have the same normalized proportions as either source cell?
  4. If the two source profiles detect 25 and 30 genes, with 10 genes detected in both, how many genes are detected in their summed profile?
  5. Does an elevated total count establish that a barcode is a doublet? Explain one alternative and one limitation of the count-level model.

Solutions. 1. Add by gene: \((12+3,\;8+17)=(15,25)\); the total is \(15+25=40\). 2. The total is \(40+20=60\), so the gene-1 proportion is \((40/60)(0.70)+(20/60)(0.10)=0.50\). 3. If the source profiles have the same proportions, their total-count-weighted average has those same proportions, even though the summed total is larger. 4. The union contains \(25+30-10=45\) detected genes. 5. No. A high-count singlet is one alternative. The simplified model assumes direct addition and does not fully represent complications such as capture variation or molecule-tag collisions.

Clinical Biostats