Tutorials › Statistical Genetics › Calibration Diagnostics for Cell-Type QTL Results

Single-Cell and Cell-Type Genetics · Tutorial 965 of 989

Calibration Diagnostics for Cell-Type QTL Results

Use complementary diagnostics to identify model fit problems, influential donors, and unreliable cell-type QTL test statistics.

Advanced 10 min read

What You'll Learn

  • Check whether genotype groups and covariates provide adequate overlap for the fitted association model
  • Summarize cell counts by genotype and cell type to spot sparse or unevenly measured groups
  • Use residual patterns to investigate misspecified mean or variance assumptions
  • Calculate leverage and Cook’s distance to assess whether a donor strongly influences a fit
  • Read null p-value and test-statistic plots for evidence of anti-conservative inference
  • Distinguish calibration problems from genuine association signals and from one influential result

Why Calibration Diagnostics Matter

A small p-value from a cell-type QTL analysis is useful only if the fitted model produces trustworthy uncertainty estimates under its assumptions. A donor-level pseudobulk regression can still be miscalibrated if the mean model is wrong, the residual variance is poorly represented, genotype groups have inadequate overlap with covariates, or a small number of donors dominate the fit. These problems may make test statistics too dispersed and p-values too small, creating more apparent discoveries than the analysis warrants.

Calibration diagnostics do not establish that an association is causal, nor do they replace a model appropriate to the outcome and study design. They ask a narrower question: does the analysis behave as expected when its assumptions should apply? The most informative assessment combines diagnostics at the donor level with checks across a collection of null or control association tests.

The Model and Its Assumptions

For a donor-level pseudobulk expression outcome, a common starting point is a linear regression. Let \(Y_i\) be the expression summary for donor \(i\) in one cell type, \(G_i\) the donor’s genotype dosage, and \(C_i\) a vector of included covariates. The fitted model is

$$ Y_i=\beta_0+\beta_G G_i+C_i^\mathsf{T}\gamma+\varepsilon_i. $$

Here \(\beta_G\) is the expected change in the modeled expression outcome per additional effect allele, conditional on the covariates. The regression is an association model: its coefficient alone does not show that genotype caused the expression difference. For the usual linear-model standard errors and tests to be valid, the conditional mean must be correctly specified, donors must contribute independent errors conditional on the model, and the variance assumptions behind the chosen standard error must be reasonable. Exact small-sample \(t\)-tests additionally rely on normally distributed errors; large-sample procedures may use robust standard errors, but those do not fix a misspecified mean or dependent donors.

The observational unit for these diagnostics is the donor, not each cell. A donor with many cells may yield a more precise pseudobulk summary, but those cells do not become independent donors. For a cell-level mixed model, residual and influence checks must respect its fitted conditional structure; the same diagnostic question applies, but the residual definition and reference distribution depend on that model.

Definition: A result is calibrated under the null when, for tests whose null hypotheses are true and under the stated analysis design, the reported test statistics and p-values follow their intended null distributions. For example, valid continuous null p-values are uniformly distributed on 0 to 1: \(P(p\leq u)=u\) for \(0\leq u\leq1\). Anti-conservative tests produce more small p-values than that reference predicts.

Check Genotype Groups and Cell-Count Support

Start by tabulating donor counts at each genotype dosage and checking how those donors are distributed across important covariates, such as ancestry components, batch, sex, or collection site when relevant to the design. The purpose is not to demand a particular genotype ratio. Allele frequencies, ancestry, sampling, and study design all affect observed counts, so a departure from a simple expected ratio is not by itself proof of a problem. Instead, look for sparse dosage groups, coding errors, or near-separation: for example, if nearly all donors with one dosage are from a single batch, genotype and batch effects may be difficult to distinguish.

For each cell type, summarize the number of contributing cells per donor, including the number of donors with no usable cells, and examine these summaries across genotype groups and relevant technical covariates. Unequal cell counts can mean unequal precision in pseudobulk expression and may be associated with dropout or selection into the analyzed sample. A cell-count pattern is a diagnostic signal, not an instruction to adjust automatically: the right response depends on how the cells were sampled and on the intended estimand.

Worked Example: Sparse Genotype and Cell-Count Groups

Suppose a hypothetical cell-type QTL dataset has 12 donors. The genotype dosage counts are 0 for 3 donors, 1 for 6 donors, and 2 for 3 donors. The corresponding numbers of cells contributing to each donor’s pseudobulk profile are: dosage 0, 180, 220, and 260; dosage 1, 160, 200, 240, 280, 320, and 360; dosage 2, 25, 40, and 55. Calculate the genotype proportions and mean cell count in each group.

The dosage proportions are \(3/12=0.25\), \(6/12=0.50\), and \(3/12=0.25\). The group mean cell counts are \( (180+220+260)/3=660/3=220\) for dosage 0, \( (160+200+240+280+320+360)/6=1560/6=260\) for dosage 1, and \( (25+40+55)/3=120/3=40\) for dosage 2.

The small dosage-2 group and its much lower mean cell count warrant investigation. The counts do not, by themselves, show why the pattern occurred or prove that the QTL result is invalid. The analyst should check sample and cell-type filtering, technical factors, and covariate overlap, and report how many donors support each estimate. In particular, the three dosage-2 donors provide limited protection against an unusual donor driving the result.

Residual Patterns and Donor Influence

For each donor, the fitted value \(\hat{Y}_i\) is the outcome predicted by the regression, and the residual \(e_i=Y_i-\hat{Y}_i\) is the observed-minus-predicted difference. Plot residuals against fitted values, genotype dosage, and key covariates. A roughly patternless cloud centered around zero is compatible with a suitable mean model. Curvature can signal a nonlinear relationship; a widening or narrowing spread can signal nonconstant variance; and clusters by batch or other covariate can reveal structure the model has not captured. A residual Q–Q plot can help assess whether unusually heavy tails or skewness make normal-theory small-sample inference questionable. No single plot proves that assumptions hold.

A donor may be influential because its covariate pattern gives it high leverage, because its residual is large, or both. In ordinary least squares, let \(h_i\) be the donor’s diagonal leverage, \(p\) the number of fitted regression coefficients including the intercept, and \(\mathrm{MSE}=\sum_i e_i^2/(n-p)\). Cook’s distance summarizes the change in fitted values that would result from deleting that donor:

$$ D_i=\frac{e_i^2}{p\,\mathrm{MSE}}\frac{h_i}{(1-h_i)^2}. $$

Large values flag donors for closer examination, not automatic removal. Rules of thumb such as comparing Cook’s distance with \(4/n\) are screening guides, not decision rules. Check the underlying sample, genotype, cell count, covariates, and measurement quality. Then assess whether conclusions are sensitive to the donor, while retaining the prespecified analysis and explaining any justified data correction or sensitivity analysis.

Worked Example: One Donor With Strong Influence

Consider six hypothetical donors with dosage \(G=(0,0,1,1,2,2)\) and log-expression outcome \(Y=(4,5,5,6,6,12)\), in arbitrary log-expression units. Fit a regression with an intercept and genotype dosage only. This small dataset is for illustrating diagnostics, not for making a reliable QTL claim.

The means are \(\bar{G}=1\) and \(\bar{Y}=38/6=6.333\). The slope is \( \hat{\beta}_G=\sum_i(G_i-\bar{G})(Y_i-\bar{Y})/\sum_i(G_i-\bar{G})^2=9/4=2.25\), and the intercept is \(6.333-2.25(1)=4.083\). Thus the fitted values are 4.083, 4.083, 6.333, 6.333, 8.583, and 8.583. The residual for the last donor is \(12-8.583=3.417\) log-expression units.

The residual sum of squares is approximately 21.083, so \(\mathrm{MSE}=21.083/(6-2)=5.271\). For a donor with dosage 2, leverage is \(h_i=1/6+(2-1)^2/4=0.4167\). The last donor’s Cook’s distance is therefore \(D_i=(3.417^2/(2\times5.271))\{0.4167/(1-0.4167)^2\}\approx1.356\). This is a substantial influence flag in this toy fit. It calls for checking that donor and examining sensitivity; it does not justify deleting the donor merely because the result changes.

Null Association Plots

Residual checks concern individual fitted models; null association plots assess whether a collection of tests behaves as expected. Useful inputs include known null or negative-control tests and permutations that preserve the study’s relevant structure. A permutation scheme must be valid for the design: freely shuffling genotypes across donors, for example, may be inappropriate when ancestry or other structure makes donors nonexchangeable. A plot made from an invalid null construction cannot establish calibration.

A p-value histogram should be approximately flat under a collection of true nulls with valid continuous tests. A quantile–quantile (Q–Q) plot compares observed test-statistic or p-value quantiles with their null expectations. A departure in the extreme tail can reflect genuine associations as well as miscalibration; broad excess over much of the distribution is more concerning, especially in null controls. The familiar genomic inflation factor for one-degree-of-freedom chi-square tests is

$$ \lambda=\frac{\operatorname{median}(\chi^2_{\mathrm{observed}})}{0.4549}, $$

because 0.4549 is the median of a chi-square distribution with one degree of freedom. A value above 1 indicates that the observed median statistic exceeds this reference, but it is not a stand-alone diagnosis: widespread real effects, dependence among tests, or an inappropriate reference set can also shift the distribution. Interpret it alongside the Q–Q plot, the analysis design, and known-null checks. Correcting or rescaling statistics without finding the source of a discrepancy may conceal rather than resolve a modeling problem.

Worked Example: Excess Small P-Values in Null Controls

Suppose a hypothetical set of 1,000 validated null genotype–gene tests has 92 p-values below 0.05, and its median one-degree-of-freedom chi-square statistic is 0.90. Under uniform null p-values, the expected number below 0.05 is \(1000(0.05)=50\). If these tests were independent, the count would have standard deviation \(\sqrt{1000(0.05)(0.95)}=\sqrt{47.5}=6.892\). The observed excess is \((92-50)/6.892=6.094\) standard deviations under that approximation.

The median-based inflation estimate is \(0.90/0.4549=1.978\). Together, these summaries show a substantial excess relative to the stated null reference and warrant investigation of the model, standard errors, sample structure, and null-generation method. The independence calculation is only an approximation because tests may be correlated; it is not a definitive p-value for the diagnostic. Nor does this example identify which assumption failed. That requires checking the data and the analysis process.

A Practical Diagnostic Sequence

A useful sequence keeps each diagnostic tied to a question and avoids treating one statistic as a pass–fail test.

1
Confirm the analysis units and model.
Verify that donors, genotype coding, outcome construction, covariates, and standard-error method match the intended analysis.
2
Inspect support and counts.
Tabulate donors by genotype and relevant covariates, then summarize cell counts and missingness by genotype and cell type.
3
Examine residuals and influence.
Look for systematic residual patterns and identify donors whose leverage or residuals may substantially change the fit.
4
Assess null behavior.
Use appropriate null controls or design-preserving permutations, and compare the observed statistic and p-value distributions with their intended references.
5
Investigate and report.
Trace discrepancies to plausible causes, document justified corrections, and show sensitivity analyses without silently discarding inconvenient observations.

Common Mistakes

  • Calling every excess small p-value a true discovery. A tail excess can reflect association, but null controls and broader distributional patterns help distinguish it from systematic miscalibration.
  • Treating a genotype ratio as a universal pass–fail criterion. Genotype frequencies vary with population and sampling. Check coding, group support, and covariate overlap rather than assuming one ratio must hold.
  • Interpreting low cell counts as a reason to delete donors automatically. Counts inform precision and possible selection or technical problems. Filtering or adjustment must be justified by the design and analysis target.
  • Removing an influential donor because the p-value becomes less favorable. Influence is a prompt to investigate data quality and sensitivity, not a license for outcome-driven exclusion.
  • Using a single inflation factor as proof of calibration. It summarizes one feature of the test-statistic distribution and can be shifted by real effects, dependence, or a poor null reference.
Key takeaway: Calibration is supported by converging evidence: adequate genotype and cell-count support, plausible residual behavior, no unexplained donor dominance, and null test statistics that match an appropriate reference. Diagnostics flag questions to resolve; they do not substitute for a defensible model.

Check Your Understanding

Answer each question using the diagnostic principles above.

  1. Why is a genotype count that differs from a simple expected ratio not, by itself, proof of model misspecification?
  2. What pattern in a residual-versus-fitted plot might suggest nonconstant variance?
  3. In the Cook’s distance formula, what two features can make a donor influential?
  4. Why must a permutation scheme respect relevant structure in the study?
  5. What does an inflation factor above 1 indicate, and why is it not a stand-alone diagnosis?
Clinical Biostats