Why marker genes can reveal ambient RNA
Ambient RNA is RNA outside intact cells that can be captured in cell barcodes. A cell’s observed counts may therefore include molecules from its own expression and from the ambient pool. If a gene is not expressed by a particular cell population but is abundant in the ambient pool, counts of that gene in barcodes from that population provide evidence of ambient contribution.
The crucial phrase is “not expressed by this target population.” A marker is not universally absent just because it is commonly associated with another cell type. It must be a plausible zero-expression gene for the specific population being assessed. Marker-based estimates are consequently conditional on biological knowledge about the target population and on an estimate of the ambient RNA profile.
A model for marker counts
Let \(Y_{ig}\) be the observed count for gene \(g\) in cell barcode \(i\), and let \(N_i=\sum_g Y_{ig}\) be that barcode’s total count. Write \(\rho_i\) for the fraction of captured molecules in barcode \(i\) attributed to ambient RNA, \(q_g\) for the ambient fraction from gene \(g\), and \(\theta_{ig}\) for the fraction of the cell’s endogenous molecules from gene \(g\). A standard mixture representation for the expected gene fraction is
This representation assumes that observed molecules are a mixture of endogenous and ambient molecules, with the same ambient profile \(q_g\) used for the barcode being assessed. For a marker gene set \(M\), the key additional assumption is \(\theta_{ig}=0\) for every \(g\in M\) in the target population. Under that assumption, the marker count \(C_{iM}=\sum_{g\in M}Y_{ig}\) has expected fraction
Thus, a natural estimate of the barcode’s contamination fraction is the observed marker fraction divided by the fraction of the ambient profile represented by those markers. This is an estimate, not a direct label of each counted molecule: individual observed marker molecules are not known with certainty to be ambient solely from their gene identity.
Justification and uncertainty
A simple count model makes the estimator’s logic explicit. Conditional on \(N_i\), suppose each captured molecule independently belongs to the ambient component with probability \(\rho_i\), and, if ambient, has gene \(g\) with probability \(q_g\). With all marker genes absent endogenously, the probability that a captured molecule belongs to \(M\) is \(\rho_i Q_M\). Therefore,
The expected marker count is \(N_i\rho_i Q_M\). Dividing the observed count by \(N_iQ_M\) gives the estimator above, and its expectation under this model is
This derivation also explains why small marker counts make single-cell estimates unstable: the data contain little information about the fraction when few molecules fall in the marker set. Under the same binomial model, the estimator’s conditional variance is
The variance decreases with greater depth \(N_i\) and larger ambient marker fraction \(Q_M\). This calculation assumes independent molecule assignments and a fixed, correctly specified ambient profile. Dependence, variation in the profile, or uncertainty in the estimated \(q_g\) adds uncertainty not represented by this expression.
Worked Example: Choosing Markers From the Ambient Profile
Suppose a hypothetical target population is believed not to express genes A or B. An estimated ambient profile assigns \(q_A=0.07\) and \(q_B=0.05\). Gene C has ambient fraction \(q_C=0.10\), but the target population is known to express C. Which genes can form a marker set, and what is the ambient fraction captured by that set?
A and B meet the two requirements: they are assumed absent from the target population and present in the ambient profile. C is not suitable because endogenous expression is expected in the target cells, even though it is abundant in ambient RNA. Taking \(M=\{A,B\}\),
Under the mixture model, 12% of ambient molecules belong to these markers. If the target population actually expresses either A or B, however, the zero-endogenous-expression assumption fails and the resulting estimate can be biased upward.
Worked Example: Estimating Contamination in One Barcode
In a hypothetical barcode, \(N_i=4{,}000\) molecules are observed. A marker set has \(Q_M=0.10\), and the barcode contains \(C_{iM}=28\) marker molecules. Assume the barcode belongs to the target population and the marker set is truly absent endogenously.
The estimated ambient fraction is
The estimate is 7.0% of the captured molecules. The observed marker fraction is \(28/4{,}000=0.007\), or 0.7%; dividing by the fact that markers account for 10% of the ambient profile yields 7.0%. This point estimate does not mean that exactly 7.0% of this barcode’s molecules have been individually identified as ambient.
For scale, the binomial model gives an approximate plug-in standard error:
where \(\hat{p}=C_{iM}/N_i=0.007\). The sizeable standard error relative to the estimate illustrates why one barcode’s low marker count should not be treated as a precise measurement.
Pooling cells and checking marker sets
When several barcodes belong to the same target population, pooling marker counts can stabilize estimation. If they share a common contamination fraction \(\rho\), the combined marker count has expected value \(\rho Q_M\sum_i N_i\). The corresponding pooled estimate is
If contamination fractions differ across barcodes, this formula estimates a depth-weighted average rather than the contamination fraction of a typical cell. Its weights are proportional to \(N_i\), assuming the same \(Q_M\) applies to all the barcodes. State which summary is intended before interpreting a pooled result.
Worked Example: Pooling Marker Counts Across Barcodes
Consider two hypothetical barcodes from the same target population. The first has \(N_1=3{,}000\) and \(C_{1M}=12\); the second has \(N_2=5{,}000\) and \(C_{2M}=28\). The marker set captures \(Q_M=0.08\) of the ambient profile. Assuming the zero-expression condition holds and the ambient profile is shared, the pooled estimate is
The estimated depth-weighted contamination fraction is 6.25%. For comparison, the separate estimates are \(12/[3{,}000(0.08)]=0.0500\) and \(28/[5{,}000(0.08)]=0.0700\). Pooling gives more weight to the second barcode because it contributes more observed molecules; it does not imply both barcodes have the same contamination fraction.
A useful diagnostic is to estimate contamination from more than one defensible marker set. Large disagreement can point to a marker that is not truly absent, an inaccurate ambient profile, or differences in ambient composition across the sample. This comparison is informative only when the sets’ ambient fractions are estimated on a comparable basis and their biological assumptions are examined. Agreement is reassuring but does not prove that all assumptions are correct.
Worked Example: Endogenous Expression Can Inflate an Estimate
Suppose a marker set captures \(Q_M=0.10\) of ambient molecules, and the true contamination fraction is \(\rho_i=0.05\). In a hypothetical target population, however, the set contributes \(\tau=0.02\) of endogenous molecules. The observed marker fraction under the mixture model is
Applying the zero-expression estimator gives \(0.024/0.10=0.24\), or 24%. The true contamination fraction was 5%. The estimator is badly inflated because it attributes endogenous marker counts to ambient RNA. More counts would reduce sampling noise but would not fix this systematic error.
Assumptions, alternatives, and failure modes
Marker-based estimation is useful because its identifying information is easy to interpret: counts of genes believed absent from a target population are compared with their expected abundance in ambient RNA. Its validity depends on assumptions that must be evaluated rather than inferred from the estimate itself:
- True target-specific absence: marker genes have no endogenous expression in the target population. Low expression is not the same as zero expression; even modest endogenous expression can produce upward bias.
- Relevant ambient profile: the values \(q_g\) describe the ambient molecules available to the barcodes being assessed. If ambient composition varies across samples or conditions, a single profile may be inappropriate.
- Usable marker abundance: \(Q_M\) is positive and estimated with reasonable precision. If \(Q_M\) is very small, dividing by it magnifies count noise and profile error.
- Comparable barcodes: pooled calculations combine barcodes from a population for which the same marker assumptions and ambient profile are defensible.
Several symptoms should prompt investigation. An estimate above 1 is incompatible with a contamination fraction and can arise from sparse counts or a violated assumption. A large fraction of barcodes with zero marker counts may reflect low contamination, but it can also reflect a small \(N_iQ_M\), so zero counts do not establish zero contamination. Estimates that change sharply when one marker gene is removed suggest that the result is fragile. Marker counts concentrated in a few barcodes, or disagreement between independent marker sets, can also indicate heterogeneity, misclassification, or a misspecified ambient profile.
Marker-based estimates complement broader approaches. The earlier material on estimating ambient contamination per cell gives a general per-cell framing; marker genes make the evidence explicit by focusing on genes expected to be absent from a specified population. Compared with using many genes, this can be easier to audit biologically, but it relies more strongly on a small set of zero-expression claims. The introductory material on estimating the ambient RNA profile supplies the \(q_g\) values needed here; errors in those values propagate directly into \(Q_M\) and the estimate. Ambient RNA correction is a separate task: estimating contamination does not itself decide how to alter gene counts.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A marker set has ambient fraction \(Q_M=0.16\). A barcode with \(N_i=2{,}500\) has 20 marker counts. What is the marker-based contamination estimate under the zero-expression assumption?
- Why is a gene unsuitable as a marker for a target population if it is abundant in ambient RNA but also expressed endogenously by that population?
- Two marker sets give estimates of 4% and 17% for the same target population. Name two assumptions or data features to investigate before choosing one estimate.
- Why can a barcode with no observed marker counts still have nonzero ambient contamination?
- A pooled estimate uses barcodes with different total counts and different contamination fractions. How should the pooled estimate be interpreted?
Solutions. (1) \(\hat{\rho}_{i,M}=20/[2{,}500(0.16)]=20/400=0.050\), or 5.0%. (2) Its observed counts can include endogenous molecules; attributing all marker counts to ambient RNA biases the estimate upward. (3) Check whether either set is expressed endogenously, whether the ambient profile is appropriate, and whether the sets have well-estimated ambient fractions; low counts or population heterogeneity may also contribute. (4) Marker molecules are sampled unevenly. Even when the expected marker count \(N_i\rho_iQ_M\) is positive, the realized count can be zero. (5) It is a depth-weighted average, with greater weight given to barcodes contributing more molecules, not the unweighted average contamination fraction across cells.