Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Comparing Doublet Detection Methods

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

Comparing Doublet Detection Methods

You will learn to quantify agreement between doublet-detection methods and use the pattern of discordant calls to guide careful, assumption-aware interpretation.

Intermediate 13 min read

What You'll Learn

  • Build a matched-cell overlap table for two doublet-detection methods.
  • Calculate observed, positive, and negative agreement and Cohen’s kappa.
  • Interpret kappa without treating its normalization as the maximum attainable agreement for fixed margins.
  • Compare pooled and stratum-specific agreement to reveal differences hidden by cell composition.
  • Diagnose discordance in light of score thresholds and method-specific assumptions.
  • Distinguish agreement between methods from validation against a perfect reference.

Why Compare Doublet-Detection Methods?

A doublet call depends on the evidence a method uses, the assumptions built into its model, and the threshold used to turn a score into a label. A score-based method and an orthogonal method can therefore disagree even when both are behaving as designed. Comparing them is useful not because one call must automatically be correct, but because the pattern of agreement and disagreement can show where the evidence is consistent and where it needs investigation.

The comparison is meaningful only when both methods refer to the same set of cell barcodes and the same definition of a positive call. A score must be converted to a call using a stated threshold before it can enter a binary overlap table. If a method has no result for a barcode, that missing result is not a negative call. Exclude such barcodes from a paired table or report their missingness separately, and make the resulting comparison set explicit.

Definition: For \(n\) barcodes with a call from each method, let \(a\) be the number called doublets by both methods, \(b\) the number called by method A only, \(c\) the number called by method B only, and \(d\) the number called negative by both. The paired overlap table is
$$ \begin{array}{c|cc|c} & \text{B positive} & \text{B negative} & \text{Total}\\ \hline \text{A positive} & a & b & a+b\\ \text{A negative} & c & d & c+d\\ \hline \text{Total} & a+c & b+d & n \end{array} \qquad n=a+b+c+d. $$

This table preserves the pairing: each barcode contributes to exactly one cell. The row and column totals describe the methods’ positive and negative call proportions. The off-diagonal cells, \(b\) and \(c\), identify the discordant calls; their sizes and biological or technical context are often more informative than a single overall agreement number.

Agreement Measures and Their Interpretation

The simplest measure is the observed proportion of agreement, \(P_o\). It counts both shared positive calls and shared negative calls. When doublet calls are uncommon, the many shared negatives can make \(P_o\) look high even if the methods disagree substantially about which barcodes are positive. It is therefore useful to report positive and negative agreement as well.

Definition: Observed agreement is \(P_o=(a+d)/n\). Positive agreement is \(2a/(2a+b+c)\), the fraction of positive calls that are shared when positive calls from both methods are counted symmetrically. Negative agreement is \(2d/(2d+b+c)\), defined analogously for negative calls. These are descriptive measures; neither method is designated as truth.

A chance-adjusted measure sometimes reported is Cohen’s kappa. Let \(p_A=(a+b)/n\) and \(p_B=(a+c)/n\) be the observed positive-call proportions for methods A and B. If two independent sets of labels were assigned with these same marginal proportions, their expected agreement would be \(P_e=p_Ap_B+(1-p_A)(1-p_B)\). Kappa compares observed agreement with this reference value.

$$ \kappa=\frac{P_o-P_e}{1-P_e}, \qquad P_e=p_Ap_B+(1-p_A)(1-p_B). $$

The reference calculation treats the methods’ labels as independent while preserving their marginal positive-call proportions. It is a mathematical baseline, not a claim that the methods actually assign labels by chance. The denominator \(1-P_e\) is the normalization used by Cohen’s kappa, corresponding to the hypothetical case \(P_o=1\). It is not generally the maximum excess agreement attainable while holding the observed margins fixed. If the methods have different positive-call proportions, perfect agreement is impossible with those margins. Kappa is consequently a useful descriptive summary, but it should not replace the overlap table or the separate positive- and negative-agreement measures. If \(P_e=1\), kappa is undefined; if \(P_e\) is close to 1, its denominator is small and the statistic can be unstable.

Worked Example: Calculating Agreement and Checking the Margins

Suppose two methods make calls on the same 100 hypothetical barcodes. Their overlap table has \(a=18\), \(b=7\), \(c=5\), and \(d=70\). The margins are consistent: there are \(18+7=25\) A-positive calls, \(18+5=23\) B-positive calls, and \(18+7+5+70=100\) total calls.

Observed agreement: \(P_o=(18+70)/100=0.88\), or 88%. The methods give the same call to 88 of the 100 barcodes.

Positive agreement: \(2a/(2a+b+c)=36/(36+7+5)=36/48=0.75\). Their positive calls agree at a rate of 75% by this symmetric measure.

Negative agreement: \(2d/(2d+b+c)=140/(140+7+5)=140/152\approx0.9211\), or 92.1%.

For kappa, \(p_A=25/100=0.25\) and \(p_B=23/100=0.23\). Thus \(P_e=(0.25)(0.23)+(0.75)(0.77)=0.0575+0.5775=0.635\), and \(\kappa=(0.88-0.635)/(1-0.635)=0.245/0.365\approx0.6712\).

The unequal margins also show why the kappa denominator must not be described as the maximum attainable excess agreement at fixed margins. With these margins, the largest possible agreement is \(\min(0.25,0.23)+\min(0.75,0.77)=0.23+0.75=0.98\), not 1. The corresponding maximum excess over \(P_e\) is \(0.98-0.635=0.345\), whereas kappa’s conventional denominator is \(1-P_e=0.365\). Report kappa as defined, and describe its normalization accurately.

Stratified Diagnostics Reveal What the Pooled Table Hides

A pooled table can summarize agreement across a sample, but its result depends on which cells are included and how they are distributed across samples or cell groups. A large stratum with many easy-to-classify negatives can dominate the total, obscuring weaker agreement among higher-risk cells. It is therefore useful to construct overlap tables within relevant strata, such as sample, sequencing run, cluster, or a defined risk group. These comparisons are descriptive: they show where agreement differs, but do not by themselves explain why.

Worked Example: Agreement Differs by Risk Stratum

Consider two hypothetical strata in a set of 100 matched barcodes. In the high-risk stratum, \(a=12\), \(b=3\), \(c=2\), and \(d=3\), giving \(n=20\). In the low-risk stratum, \(a=4\), \(b=6\), \(c=5\), and \(d=65\), giving \(n=80\).

For the high-risk stratum, observed agreement is \((12+3)/20=0.75\). Positive agreement is \(24/(24+3+2)=24/29\approx0.8276\), while negative agreement is \(6/(6+3+2)=6/11\approx0.5455\).

For the low-risk stratum, observed agreement is \((4+65)/80=0.8625\). Positive agreement is \(8/(8+6+5)=8/19\approx0.4211\), while negative agreement is \(130/(130+6+5)=130/141\approx0.9220\).

Combining the strata gives \(a=16\), \(b=9\), \(c=7\), and \(d=68\). Pooled observed agreement is \(84/100=0.84\), positive agreement is \(32/(32+9+7)=32/48\approx0.6667\), and negative agreement is \(136/(136+9+7)=136/152\approx0.8947\). The pooled result conceals the low positive agreement in the larger low-risk stratum and the low negative agreement in the high-risk stratum. A useful report would show both stratum-specific tables and the pooled table, with the stratum definitions and sizes.

Stratification should be chosen for a reason, not repeatedly searched until a favorable result appears. If the purpose is to compare performance across samples, show each sample’s denominators and call proportions. If the purpose is to inspect biological patterns, define the groups in advance where possible and state how cells were assigned. When samples differ substantially in size, a pooled summary weights large samples more heavily; a simple average of sample-specific summaries instead gives each sample equal weight. These answer different descriptive questions and should not be presented as interchangeable.

Interpreting Disagreement in Light of Method Assumptions

Agreement is not the same as accuracy. Two methods can agree because they detect the same evidence, share a limitation, or use related assumptions. Conversely, disagreement may arise because methods detect different subsets of doublets or because one call is sensitive to a threshold or data-quality issue. The earlier material on score calibration and genotype evidence provides the relevant context for understanding those call types; here, the comparison asks how their calls align on the same barcodes.

For a score-based method, inspect the underlying score distribution and the threshold used to create the binary call. Calls close to a threshold are more likely to change under modest recalibration. Compare the positive-call proportions as well as the overlap: one method calling far more barcodes positive can have a large A-only or B-only cell even when most barcodes agree. Do not change thresholds after seeing the overlap merely to improve agreement unless that recalibration is a planned part of the analysis and is reported transparently.

An orthogonal method may rely on evidence that the score-based method does not use, but orthogonal evidence is not automatically a perfect reference. Its applicability may depend on data availability, sample composition, or assumptions about the source of the signal. Likewise, score-based detection may be less informative for some doublet types, including cases whose profiles resemble a single cell. Interpret discordances using the plausible failure modes of both methods rather than automatically treating one column as the correct answer.

Worked Example: High Overall Agreement but Modest Positive Agreement

Suppose two hypothetical methods are compared on 200 barcodes with complete calls. Method A calls 30 positive and method B calls 20 positive; 12 barcodes are positive by both. Therefore \(a=12\), \(b=30-12=18\), \(c=20-12=8\), and \(d=200-12-18-8=162\). The table accounts for all 200 barcodes.

Observed agreement is \((12+162)/200=174/200=0.87\), or 87%. Positive agreement is \(24/(24+18+8)=24/50=0.48\), or 48%. Negative agreement is \(324/(324+18+8)=324/350\approx0.9257\), or 92.6%. The high observed agreement is largely compatible with many shared negatives; it does not mean the methods agree well on positive calls.

The marginal positive proportions are \(p_A=30/200=0.15\) and \(p_B=20/200=0.10\). Thus \(P_e=(0.15)(0.10)+(0.85)(0.90)=0.015+0.765=0.78\), and \(\kappa=(0.87-0.78)/(1-0.78)=0.09/0.22\approx0.4091\). Method A has 10 more positive calls than method B, a difference of \(10/200=0.05\), or 5 percentage points. That difference describes the margins; it does not establish which method is more accurate. A next diagnostic would examine the 18 A-only and 8 B-only barcodes by sample, score distance from threshold, and the evidence each method uses.

Assumptions, Failure Modes, and Alternatives

Before interpreting an overlap table, check that the comparison set is valid. The barcodes must be matched correctly; both methods must use a consistent positive-call definition; and missing or inapplicable results must not be silently coded as negatives. If one method was applied only to a selected subset, the comparison describes that subset, not necessarily all retained cells. Report the denominator and call rates so that selection and prevalence are visible.

The main alternatives answer different questions. Observed agreement is easy to understand but can be dominated by shared negatives. Positive and negative agreement separate performance on the two call categories without requiring a gold standard. Kappa adjusts observed agreement using the methods’ marginal call proportions, but its value depends on those margins and it does not identify which method is correct. If a genuinely valid reference classification is available, comparison to that reference can support sensitivity and specificity calculations; without such a reference and its assumptions, those quantities should not be inferred from agreement alone.

Several practical failure modes deserve attention:

  • Comparing different barcode sets. Unequal or selected sets can make the overlap misleading. Use matched barcodes or explain the restriction and report missingness.
  • Reporting only overall agreement. Shared negatives can inflate \(P_o\). Include the full table and category-specific agreement.
  • Ignoring sample or group structure. Cells from the same sample are not independent biological replicates. Do not treat a large cell count as equivalent to many independent samples when making uncertainty claims.
  • Calling one method a gold standard without justification. Agreement is symmetric; validation claims require a defensible reference and suitable assumptions.
  • Over-interpreting a single summary. Threshold choice, method-specific limitations, and stratum composition can all change the apparent agreement.

If uncertainty estimates are needed, their design must respect the sampling structure. For example, when the target is variation across biological samples, resampling individual cells as though they were independent can produce unjustifiably narrow intervals. A sample-level analysis or resampling scheme may be more appropriate when enough independent samples are available. In many quality-control comparisons, transparent descriptive tables and stratified diagnostics are more informative than a formal test of whether two sets of calls differ.

A Practical Comparison Workflow

A disciplined comparison keeps the table, the methods’ assumptions, and the intended interpretation connected. Use the following sequence before drawing conclusions.

1
Define the paired comparison.
Specify the shared barcode set, the methods, the positive-call rules, and how missing results are handled.
2
Construct and verify the overlap table.
Record \(a,b,c,d\), check that the counts sum to \(n\), and confirm that the margins match each method’s reported call totals.
3
Report complementary summaries.
Show observed, positive, and negative agreement; report kappa only as an additional chance-adjusted descriptive measure when it is defined and useful.
4
Inspect strata and discordant barcodes.
Compare patterns by relevant sample or cell group, then examine method-specific evidence, score thresholds, and plausible failure modes.
5
State the scope of the conclusion.
Distinguish agreement from accuracy, describe the analyzed cells, and avoid claims that exceed the evidence or the methods’ assumptions.
Key takeaway: A doublet-method comparison is strongest when it presents the full paired table, separates positive from negative agreement, and investigates discordance across relevant strata. Agreement can support consistency, but it cannot alone establish that either method is correct.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. In an overlap table, what do \(b\) and \(c\) count, and why should they not be combined without explanation?
  2. Two methods agree on 95% of barcodes, but most calls are negative. Which additional agreement measure is especially important to inspect, and why?
  3. Why is \(1-P_e\) in Cohen’s kappa not necessarily the maximum attainable excess agreement when observed margins are fixed?
  4. A method returns no result for some barcodes. Why is coding those barcodes as negative problematic?
  5. What can a stratified overlap table reveal that a single pooled agreement value may conceal?

Solutions. (1) \(b\) counts A-positive/B-negative barcodes and \(c\) counts A-negative/B-positive barcodes. They show the direction of disagreement, which can matter if one method calls more positives or if discordance is associated with a particular evidence type. (2) Positive agreement is especially important because high overall agreement may be driven by shared negatives. (3) Kappa uses \(1-P_e\) as its conventional normalization for the hypothetical case \(P_o=1\). With unequal positive-call margins, perfect agreement is impossible while preserving those margins, so the maximum attainable agreement can be below 1. (4) A missing result is not evidence for a negative call; coding it as negative changes the margins and creates apparent agreement or disagreement that was not observed. (5) Stratification can show that agreement differs by sample or cell group, and can reveal whether pooled results are dominated by a large group with many shared negatives.

Clinical Biostats