Why Estimate a Profile?
A droplet-based assay can contain RNA released from damaged or lysed cells, in addition to RNA associated with intact cells. The relative composition of this background is called the ambient RNA profile. Knowing which genes are abundant in the background helps describe the contamination source, but a profile alone does not say how much ambient RNA is present in any particular cell barcode. That is a separate estimation problem.
The introductory material on Ambient RNA Contamination in Cell Barcodes motivates the distinction between cell-associated counts and ambient counts. Here the focus is narrower: estimating the relative abundance of each gene in a chosen pool of barcodes thought to represent ambient RNA. The estimate depends on the pool: barcodes that contain genuine cellular RNA can change the profile, and rare transcripts can remain poorly estimated even when the total number of counts is large.
Pooled Counts and the Multinomial Estimate
Suppose a library has a selected set of \(B\) barcodes used to estimate the ambient profile. Let \(Y_{bg}\) be the observed count assigned to gene \(g\) in barcode \(b\), and let \(N_b=\sum_{g=1}^G Y_{bg}\) be its total count over the selected genes. Pool counts gene by gene:
Under a simple model, each of the \(N\) pooled molecules is an independent draw from the same ambient composition \(\boldsymbol{\pi}\). Conditional on \(N\), the pooled count vector has a multinomial distribution. This assumes that the selected molecules are ambient, the profile is shared across the selected barcodes, and gene assignment is consistently defined. The model describes sampling variation; real data can depart from it through barcode contamination, changing background composition, and technical effects.
Pooling counts weights each barcode according to its count total. A barcode with 100 selected counts contributes ten times as much to the pooled profile as a barcode with 10 counts. This is appropriate when counts are treated as sampled molecules from a common profile. It is not the same as taking an unweighted average of each barcode's gene proportions, which gives a shallow barcode the same influence as a deep one.
Why the Pooled Estimate Has This Form
The multinomial model gives the likelihood of pooled counts \(C_1,\ldots,C_G\), apart from a factor that does not depend on \(\boldsymbol{\pi}\):
To maximize the likelihood subject to the sum-to-one constraint, maximize the log-likelihood \(\ell=\sum_g C_g\log(\pi_g)\). For positive counts, introduce a Lagrange multiplier \(\lambda\) for the constraint. Differentiating with respect to \(\pi_g\) gives \(C_g/\pi_g-\lambda=0\), so \(\pi_g=C_g/\lambda\). Summing over genes implies \(1=\sum_g\pi_g=(\sum_g C_g)/\lambda=N/\lambda\), hence \(\lambda=N\) and \(\hat{\pi}_g=C_g/N\). If \(C_g=0\), the likelihood is maximized at \(\hat{\pi}_g=0\) for that gene. Thus the pooled proportions are the multinomial maximum-likelihood estimates.
Under this model, \(\mathrm{Var}(\hat{\pi}_g)=\pi_g(1-\pi_g)/N\), and for two distinct genes \(g\) and \(h\), \(\mathrm{Cov}(\hat{\pi}_g,\hat{\pi}_h)=-\pi_g\pi_h/N\). The negative covariance follows because the proportions must sum to one: a larger estimated share for one gene leaves less share for the others. These formulas quantify sampling variation under the model; they do not account for uncertainty about which barcodes belong in the pool.
Worked Example: Calculating a Profile From Empty Droplets
Consider hypothetical counts for three genes in four barcodes selected as empty droplets. Assume these counts are ambient-derived and the ambient composition is common across the barcodes.
| Barcode | Gene A | Gene B | Gene C | Total |
|---|---|---|---|---|
| 1 | 8 | 2 | 0 | 10 |
| 2 | 6 | 3 | 1 | 10 |
| 3 | 4 | 2 | 1 | 7 |
| 4 | 2 | 1 | 0 | 3 |
The pooled counts are \(C_A=8+6+4+2=20\), \(C_B=2+3+2+1=8\), and \(C_C=0+1+1+0=2\). The total is \(N=20+8+2=30\). Therefore:
Within this selected gene set, the estimated ambient counts are about 66.67% Gene A, 26.67% Gene B, and 6.667% Gene C. The small total means these proportions may be noisy; the estimate does not establish that the underlying Gene C share is exactly 6.667%.
Barcode-Pool Choice Changes the Target and the Estimate
The central practical decision is which barcodes to pool. Empty droplets are intended to contain ambient RNA without appreciable cell-associated RNA, but an overly restrictive selection can leave very few counts. Including low-count barcodes can increase the available count total while also introducing genuine cell RNA. A profile estimated from such a mixed pool is no longer an estimate of ambient composition alone.
Selection should be guided by the library's barcode-count distribution and by whether the selected pool is plausibly ambient-dominated. A fixed count threshold is not universally appropriate: library depth and sample composition vary. Examine the count range and the number of selected barcodes, and repeat the estimate under defensible nearby pool definitions. Stability across such choices is reassuring, while substantial changes indicate that pool selection matters. This sensitivity analysis does not prove that any one pool is pure ambient RNA.
Worked Example: The Effect of Including Low-Count Barcodes
Suppose a hypothetical set of confidently empty droplets contributes 90 Gene A counts and 10 Gene B counts. A second set of low-count droplets contributes 20 Gene A counts and 80 Gene B counts. For illustration, suppose the second set contains cell-associated RNA relatively rich in Gene B.
Using only the empty-droplet pool gives \(N=90+10=100\), so \(\hat{\pi}_A=90/100=0.90\) and \(\hat{\pi}_B=10/100=0.10\). If the low-count droplets are added, the pooled totals become \(C_A=90+20=110\) and \(C_B=10+80=90\), with \(N=200\). The resulting estimates are:
The expanded pool gives Gene B a much larger estimated share. Under the stated hypothetical setup, this change is evidence that the added droplets materially influence the estimate and may not represent ambient RNA alone. It is not evidence that the true ambient profile changed between those pools: the pools differ in composition by construction. The example also shows why more counts do not automatically mean a better ambient estimate.
Rare Transcripts and Sampling Uncertainty
A rare transcript may receive few counts even when the pooled total is large. Its estimate is then sensitive to individual molecules. Under the multinomial model, a rough standard error for \(\hat{\pi}_g\), using the estimated proportion in place of the unknown proportion, is:
This approximation is most useful when the count is not extremely small. For a rare gene, a normal approximation can give implausible negative lower bounds, and a zero observed count does not imply a true ambient proportion of zero. If the true share is \(\pi_g\), the probability of observing no counts for that gene in \(N\) independent draws is \((1-\pi_g)^N\). When this probability is not small, a zero count is compatible with a nonzero underlying share.
Worked Example: Interpreting a Rare-Gene Count
In a hypothetical pool of \(N=2{,}000\) counts, a rare gene has \(C_g=3\). Its estimated proportion is:
This is an estimated share of 0.15%. The plug-in standard error is approximately:
The standard error is about 0.08654 percentage points, which is large relative to the estimated share. A symmetric normal interval would extend below zero, indicating that this approximation is unsuitable here; it should not be reported as a valid interval for a nonnegative proportion. For comparison, if the true share were 0.001, the probability of observing zero counts in 2,000 draws would be \((1-0.001)^{2000}\approx0.1352\). Thus even a nonzero rare transcript can be absent from a pool of this size by sampling chance.
Practical Checks and Alternatives
A useful analysis keeps the profile tied to its actual target: a particular library, selected barcode pool, gene set, and count-assignment procedure. Before interpreting it, check whether the chosen pool contains enough counts to support the claims being made, whether the estimate changes substantially under reasonable pool variations, and whether a few high-count barcodes dominate the pooled totals. A profile can be numerically precise under a multinomial model yet biased if the pool contains cell-derived RNA or combines barcodes with different ambient compositions.
The pooled-count estimator is not the only summary one could calculate. The table contrasts the main choices. No alternative removes the need to justify which barcodes represent the ambient source.
| Approach | What it calculates | Main consideration |
|---|---|---|
| Pooled counts | Total counts per gene divided by the total across genes | Weights barcodes by their count totals; appropriate for a shared molecule-level profile if the pool is ambient. |
| Unweighted average of barcode proportions | Each barcode's gene proportion averaged equally | Gives shallow and deep barcodes equal influence; may be unstable for barcodes with very few counts. |
| Profile from a different barcode pool | The same pooled calculation applied to a changed selection | Shows sensitivity to pool definition but may trade lower sampling noise for more cell-associated RNA. |
Adding a pseudocount is another possible choice when zero counts are inconvenient. For example, adding one count to every gene before normalization makes all estimated proportions positive, but it changes the estimator and can noticeably inflate very rare genes. Such smoothing should be stated explicitly and should not be mistaken for information supplied by the data. When the scientific question concerns a particular rare gene, report its observed count and total as well as its estimated proportion, and avoid interpreting a zero as biological absence.
State the library, gene set, count definition, and barcode pool for which the ambient profile is being estimated.
Use barcode-count patterns and plausible ambient-dominated selection to avoid treating cell-containing barcodes as pure background.
Sum counts by gene and divide each gene total by the total count across the selected genes.
Compare estimates across defensible pool choices, inspect rare-gene counts, and qualify conclusions where pool or sampling uncertainty is substantial.
Common Mistakes and Limitations
- Calling the profile an amount. The \(\hat{\pi}_g\) values are relative proportions that sum to one. They do not estimate the total ambient RNA in a barcode.
- Assuming every low-count barcode is empty. Low total counts alone do not establish that counts are ambient-only. Cell-associated RNA can distort the gene composition.
- Averaging barcodes without considering depth. An unweighted average targets a different summary from the molecule-weighted pooled profile and can give noisy shallow barcodes disproportionate influence.
- Treating zero as absence. A zero count means the transcript was not observed in the selected counts; it does not prove its true ambient proportion is zero.
- Ignoring profile heterogeneity. If ambient composition differs across droplets, one shared multinomial profile is an approximation. A pooled estimate can conceal this variation.
- Overlooking the gene set. Proportions are normalized over the included features. Changing the gene set or count-assignment rules can change the reported values.
The multinomial model provides a clear baseline and a useful way to describe sampling uncertainty, but it does not account for uncertainty in barcode selection, biological changes in the background, or all technical biases. Therefore, the profile should be reported with its pool definition and interpreted as an estimated composition of the selected counts, not as a universal property of every cell or library.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A selected pool has 40 counts for Gene X and 60 for Gene Y. What are the pooled profile estimates?
- Why can adding low-count barcodes change a pooled ambient profile even if it increases the total number of counts?
- If a rare gene has zero counts in the selected pool, what can and cannot be concluded?
- For a shared ambient profile, why does pooled-count normalization weight a barcode with 100 counts more heavily than one with 10 counts?
Solutions. (1) The total is \(N=40+60=100\), so \(\hat{\pi}_X=40/100=0.40\) and \(\hat{\pi}_Y=60/100=0.60\). (2) The added barcodes contribute counts according to their own gene composition; if that composition differs because of cell-associated RNA or another source, the pooled proportions change and may be biased for ambient RNA. (3) The gene was not observed in this pool, so its maximum-likelihood estimate is zero under the multinomial model. A nonzero true proportion remains possible because finite sampling can miss rare transcripts. (4) Pooled counts represent sampled molecules: the 100-count barcode contributes ten times as many counts to the totals, and therefore ten times the direct count weight, as the 10-count barcode.