Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Constructing Donor-Level Summaries

Biological Replication and Donor-Level Inference · Tutorial 438 of 700

Constructing Donor-Level Summaries

Construct a mean or proportion for each donor, interpret what it represents, and identify when the summary is undefined or potentially misleading.

Advanced 10 min read

What You'll Learn

  • Define the eligible cells and measurement used in each donor-level summary.
  • Calculate a donor’s mean expression from cell-level measurements.
  • Calculate a donor’s proportion from indicator values and an explicit denominator.
  • Distinguish a proportion within a lineage from a lineage’s share of a broader cell set.
  • Check for empty denominators, sparse cell counts, and measurement or classification problems.
  • Explain why donor summaries give one observation per donor without making cells independent replicates.

From Cell Measurements to Donor-Level Observations

A single-cell data set may contain thousands of measurements but only a modest number of donors. When the scientific question concerns variation across donors, a basic construction is to calculate a summary of the relevant cells separately for each donor. A donor’s average expression in a defined cell population, for example, is one value describing that donor; it is not a separate biological replicate for every cell contributing to the average.

The calculation is simple only after its ingredients are specified. Which cells count as eligible? What exactly is measured for each cell? For a proportion, which cells belong in the numerator and which in the denominator? These choices determine the interpretation of the resulting value. The summaries can then be arranged with one row per independent donor, while keeping the number of cells used to calculate each row’s value as information about how that value was obtained.

Definition: Let \(d\) index donors, and let \(C_d\) be the set of cells from donor \(d\) that meet a prespecified eligibility rule. Write \(n_d=|C_d|\) for the number of eligible cells. If \(x_{di}\) is a numerical measurement for eligible cell \(i\), the donor-level mean is $$ \bar{x}_d=\frac{1}{n_d}\sum_{i\in C_d}x_{di},\qquad n_d>0. $$ If \(z_{di}\) is an indicator equal to 1 when cell \(i\) has a specified property and 0 otherwise, the donor-level proportion is $$ \hat{p}_d=\frac{1}{n_d}\sum_{i\in C_d}z_{di} =\frac{\text{number of eligible cells with the property}}{\text{number of eligible cells}}. $$ Each defined summary supplies one value for that donor and that specified cell population or measurement.

Specify the Target Before Calculating

The eligible set \(C_d\) should follow the biological question and the analysis plan, rather than being chosen after looking for a desired result. It might include all quality-controlled cells from donor \(d\), or only cells assigned to a particular lineage. The measurement \(x_{di}\) must also be defined: for example, normalized expression of a named gene on a stated scale. A mean of raw counts and a mean of log-transformed normalized expression are different quantities and need not have the same interpretation.

A donor-level mean describes the average measured value among that donor’s eligible cells. Extending this description to all cells of a biological population in that donor requires that the observed eligible cells reasonably represent that population for the intended purpose. Cell capture, quality control, and cell-type assignment can affect which cells are observed. A donor summary is therefore not automatically a direct measurement of every cell in the donor.

For a proportion, state the event and denominator in words. If the event is “cell is marker-positive” and the eligible set is all cells assigned to lineage A, the result is the marker-positive proportion within lineage A. If the event is “cell belongs to lineage A” and the eligible set is all cells in a broader parent population, the result is lineage A’s share of that parent population. The numerator may look similar, but the estimands differ because the denominator differs.

For donor-level inference, donors must be independent units in the relevant design. The cell measurements within a donor are used to construct that donor’s value; they do not create additional independent donors. If a donor contributes repeated conditions or samples, those observations remain linked to that donor. A table with one row per donor-condition does not, by itself, make those rows independent.

Worked Example: Mean Expression Within One Donor

Suppose a hypothetical donor has four eligible cells assigned to lineage A. Their normalized, log-scale expression measurements for a specified gene are 1, 2, 3, and 6. The reported value is the average across these four cells.

Check the construction. The eligibility rule is “cell from this donor assigned to lineage A and passing the stated quality-control criteria.” There are \(n_d=4\) such cells, and each \(x_{di}\) is on the same normalized log-expression scale.

Calculate. $$ \bar{x}_d=\frac{1+2+3+6}{4}=\frac{12}{4}=3. $$

The donor-level summary is 3 normalized log-expression units for this gene among the eligible lineage-A cells. It is not a value of 3 raw transcripts per cell, and the four contributing cells do not constitute four independent donor observations. The summary’s precision as a description of the donor’s cell population can also depend on how representative those four observed cells are.

Proportions as Averages of Indicators

A proportion can be constructed by converting each cell’s classification into an indicator. For an event such as marker positivity, set \(z_{di}=1\) for a positive cell and \(z_{di}=0\) otherwise. The sum of these indicators counts positive eligible cells; dividing by \(n_d\) gives the fraction of eligible cells that are positive. This also shows why a proportion is defined only when the eligible set is nonempty.

Justification: If \(k_d\) of the \(n_d\) eligible cells satisfy the event, then exactly \(k_d\) indicators equal 1 and the remaining \(n_d-k_d\) equal 0. Therefore $$ \sum_{i\in C_d}z_{di}=k_d(1)+(n_d-k_d)(0)=k_d, \qquad \hat{p}_d=\frac{k_d}{n_d}. $$ Thus the indicator average equals the observed within-donor proportion. It lies between 0 and 1 because \(0\leq k_d\leq n_d\), provided \(n_d>0\).

Worked Example: Marker-Positive Proportion

In a hypothetical donor, 18 of 60 eligible lineage-B cells are classified as marker-positive. The target is the positive fraction within lineage B, so the denominator is all 60 eligible lineage-B cells, not all cells from the donor.

Let \(z_{di}=1\) for marker-positive cells and 0 for marker-negative cells. Then 18 indicators are 1 and 42 are 0: $$ \hat{p}_d=\frac{\sum_{i\in C_d}z_{di}}{n_d} =\frac{18}{60}=0.30. $$

The donor’s observed marker-positive proportion within lineage B is 0.30, or 30%. This is a within-donor descriptive summary. It does not assert that exactly 30% of every cell in the donor is positive, nor does it establish a population-level rate without accounting for how donors and cells were sampled.

Denominators Define the Biological Question

A useful check is to write a proportion as “number meeting the event divided by number eligible for the event.” This makes it harder to accidentally substitute a convenient count for the intended denominator. The denominator may be a lineage-specific set, a set of all cells in a tissue sample, or another prespecified parent population. These are not interchangeable.

Worked Example: Lineage Share Versus Within-Lineage Positivity

Consider a hypothetical donor with 80 eligible cells in a parent population. Twelve are assigned to lineage C, and 9 of those 12 are marker-positive. Two distinct summaries can be calculated.

Lineage C’s share of the parent population. The event is “belongs to lineage C,” and the denominator is all 80 eligible parent-population cells: $$ \hat{p}_{C,d}=\frac{12}{80}=0.15. $$ Lineage C accounts for 15% of the eligible parent-population cells observed for this donor.

Marker-positive proportion within lineage C. The event is “marker-positive,” and the denominator is the 12 lineage-C cells: $$ \hat{p}_{+,d\mid C}=\frac{9}{12}=0.75. $$ The observed marker-positive proportion within lineage C is 75%.

Using 80 as the denominator for the second calculation would instead give \(9/80=0.1125\), the share of parent-population cells that are both lineage C and marker-positive. That is a different quantity, not the marker-positive proportion within lineage C.

Building the Donor-Level Data Set

Once the rule is fixed, apply the same construction to every donor with eligible cells. For example, a mean-expression data set could contain a donor identifier, the number of eligible cells \(n_d\), and \(\bar{x}_d\). A proportion data set could contain the donor identifier, the number meeting the event, the denominator, and \(\hat{p}_d\). Retaining the counts makes it possible to audit the calculation and identify summaries based on very few cells.

The number of rows in a donor-level data set is the number of donors represented by defined summaries, not the sum of the cell counts. For example, if three independent donors contribute 40, 60, and 100 eligible cells, calculating one proportion per donor produces three donor-level observations. The 200 cells were inputs to those observations; they do not turn the data set into 200 independent donor observations.

This construction does not itself dictate how donors should be weighted in a later group comparison, which summary across donors should be reported, or which inferential procedure should be used. Those are separate decisions. Here the essential step is to construct each donor’s value using a clearly specified cell set and measurement, then preserve the donor as the observation unit.

1
Define the cell set.
State the donor, sample or condition, cell population, and any eligibility or quality-control rules. Count the resulting cells as \(n_d\).
2
Define the cell-level quantity.
For a mean, specify the measurement and scale. For a proportion, specify the event and use an indicator for each eligible cell.
3
Calculate and retain the components.
Compute the mean or proportion for the donor. Keep the numerator and denominator for proportions, and record cell counts for quality checks.
4
Check whether the summary is defined and interpretable.
If \(n_d=0\), the within-donor mean and proportion are undefined. Do not replace an undefined value with zero.

Diagnostics, Failure Modes, and Alternatives

Before using the summaries, inspect the per-donor cell counts and verify that the same eligibility and measurement rules were applied consistently. For proportions, check that the numerator cannot exceed its denominator and that \(0\leq\hat{p}_d\leq1\). For means, check the scale, units, missing values, and any unexpected extreme measurements. These checks do not prove that the data are unbiased, but they can reveal calculation and data-processing errors.

  • Empty denominator: If no eligible cells are observed for a donor, the mean or proportion is undefined. A value of zero would claim that the measured quantity was zero or that no cells met the event, neither of which follows from observing no eligible cells.
  • Wrong denominator: Dividing by all cells when the question is conditional on a lineage changes the estimand. Write the event and eligible set explicitly before calculating.
  • Inconsistent cell labels: If cell-type classification or marker-positive thresholds differ across donors, apparent donor differences may partly reflect inconsistent definitions.
  • Very few eligible cells: A mean or proportion can be calculated from a small positive \(n_d\), but it may be a weakly supported description of the donor’s broader cell population. Report the count and interpret cautiously.
  • Selection and measurement effects: Capture, quality filtering, and batch-related measurement differences can affect the cells or values included. A donor-level summary does not remove such biases.

An alternative is to analyze cell-level observations using a method that explicitly accounts for dependence among cells from the same donor. That is a different modeling strategy and requires its own assumptions and diagnostics. Simply treating every cell as independent is not a valid substitute for constructing donor summaries when the intended independent units are donors. Conversely, summaries can discard cell-level detail, so they are not automatically preferable for every scientific question.

Common mistake: “There are 5,000 cells, so the analysis has 5,000 independent observations.” This confuses the number of measurements with the number of independent donors. When the target is a donor-level quantity, calculate a defined summary for each donor and use the donors as the observations; the cell counts describe how each summary was formed.

Check Your Understanding

For each question, identify the required calculation or interpretation. Solutions follow each item.

  1. A hypothetical donor has expression values 2, 2, 5, and 7 in four eligible cells. What is the donor-level mean? Solution: \(\bar{x}_d=(2+2+5+7)/4=16/4=4\) expression units on the stated measurement scale.
  2. In a donor, 7 of 28 eligible cells meet an event. What is the donor-level proportion? Solution: \(\hat{p}_d=7/28=0.25\), or 25% of the eligible cells.
  3. There are 100 parent-population cells, 20 assigned to lineage D, and 5 of those 20 are marker-positive. What are lineage D’s share of the parent population and the positive proportion within lineage D? Solution: \(20/100=0.20\), or 20%, for lineage D’s share; \(5/20=0.25\), or 25%, for positivity within lineage D.
  4. A donor has no observed eligible cells in the target lineage. Should the donor’s mean expression be recorded as zero? Solution: No. With \(n_d=0\), the mean is undefined because there are no eligible measurements to average. Record the summary as unavailable or undefined and retain the reason.
  5. Four independent donors contribute 30, 50, 70, and 90 eligible cells. How many donor-level observations result from calculating one summary per donor? Solution: Four. The 240 cells contribute to those four summaries but do not constitute 240 independent donor observations.
Clinical Biostats