Tutorials › Statistical Genetics › Constructing Donor-Level Pseudobulk Profiles

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

Constructing Donor-Level Pseudobulk Profiles

Build pseudobulk profiles by aggregating raw counts within donor and cell type while keeping sample structure, quality information, and donor covariates intact.

Advanced 10 min read

What You'll Learn

  • Define a pseudobulk profile and its donor-by-cell-type indexing.
  • Aggregate raw gene counts without averaging or summing across donors.
  • Distinguish a valid zero-count profile from a group with too few cells.
  • Apply and document cell-group and gene-filtering rules.
  • Retain sample identifiers, cell counts, library totals, and donor-level covariates.

Why Construct Donor-Level Pseudobulk Profiles?

Single-cell assays produce many cell-level count records, but a genetic analysis often needs a measurement for each independent donor within a cell type. A pseudobulk profile is made by summing raw gene counts across the cells belonging to the same donor and cell type. The result is one gene-count profile per eligible donor–cell-type group, rather than one putative replicate per cell.

This construction is a data-preparation step, not a regression model. It does not estimate a genetic effect or turn cells into independent donors. Its purpose is to preserve the donor as the unit of analysis while retaining gene-level count information within each cell type. The earlier material on experimental units and pseudoreplication motivates this donor-level organization.

Definition: Let \(y_{icg}\) be the raw count for gene \(g\) in cell \(i\), where cell \(i\) belongs to donor \(d(i)\) and cell type \(c(i)\). The pseudobulk count for donor \(d\), cell type \(c\), and gene \(g\) is $$ Y_{dcg}=\sum_{i:\,d(i)=d,\ c(i)=c} y_{icg}. $$ The collection of \(Y_{dcg}\) over genes \(g\) is the donor-level pseudobulk profile for donor \(d\) in cell type \(c\).

In typical UMI-based data, \(y_{icg}\) is a nonnegative integer count. Pseudobulk construction sums these raw counts; it does not average them, sum normalized expression values, or combine different donors. Each cell included in a sum must have an unambiguous donor identifier and cell-type assignment, and the gene identifiers must refer to a consistent feature set.

Aggregation and the Shape of the Result

The input can be viewed as a cell-by-gene count matrix plus a cell-level metadata table. Each row in that metadata table identifies the cell's donor and assigned cell type, and may also record the biological sample, collection time, or other relevant labels. Group the cells by the intended biological sample and cell type, then add each gene's raw counts within each group.

The basic key is donor by cell type when there is one sample per donor and condition. If a donor contributes samples from different conditions, visits, or tissues, those samples must not be silently merged: include the relevant sample or condition in the grouping key. Whether those repeated samples are later modeled together is a separate analysis decision. In particular, the construction step should not erase a design distinction that could matter downstream.

Worked Example: Summing Raw Counts Within a Donor and Cell Type

Suppose three hypothetical cells from donor D01 are assigned to cell type T. Their raw counts for genes G1 and G2 are as follows.

CellDonorCell typeG1 raw countG2 raw count
c1D01T30
c2D01T12
c3D01T01

For G1, the pseudobulk count is \(3+1+0=4\). For G2, it is \(0+2+1=3\). Thus the D01–T profile is \((4,3)\), in the order G1, G2. These are summed counts, not average counts per cell: the arithmetic mean for G1 would be \(4/3\), which is not the pseudobulk count.

If D02 also has cells assigned to T, they form a separate D02–T profile. Their counts are not added to D01's counts. The table's grouping key, not the number of cells observed, determines which records belong in each sum.

Summation retains the total observed counts for the group. For illustration, if cell-level counts for one gene were conditionally independent Poisson variables with means \(\lambda_i\), their sum would have a Poisson distribution with mean \(\sum_i\lambda_i\). This simple fact follows from multiplication of probability-generating functions: the cell-level function is \(\exp\{\lambda_i(t-1)\}\), so the product across cells is \(\exp\{(\sum_i\lambda_i)(t-1)\}\), the generating function of a Poisson variable with mean \(\sum_i\lambda_i\). Real single-cell data may depart from this illustrative model; the aggregation definition itself requires only that the recorded counts be added correctly.

Low-Cell Groups: No Profile Is Not the Same as Zero

Some donor–cell-type groups contain very few cells. A profile built from one or two cells may be dominated by sampling variability and may not be comparable in quality to profiles with many cells. Investigators therefore commonly specify a minimum number of cells required for a group to be retained. The threshold is a design and quality-control choice, not a universal constant. It should be chosen before interpreting genetic results, justified for the study, and reported.

A group below the threshold is ineligible or missing for that cell type; it is not a pseudobulk profile with all gene counts equal to zero. By contrast, a group that passes the threshold can legitimately have a count of zero for a particular gene. These cases have different meanings: the first means there were too few cells to construct the intended profile, while the second means the profile was constructed and no counts for that gene were observed in it.

Worked Example: Applying a Minimum-Cell Rule

Consider four hypothetical donors in cell type T. A study specifies in advance that a donor–cell-type group must contain at least three eligible cells. The observed cell counts are D01: 4, D02: 2, D03: 0, and D04: 5.

D01 passes because \(4\geq3\), and D04 passes because \(5\geq3\). D02 fails because \(2<3\); D03 has no observed T cells and also fails. Only D01 and D04 receive T-cell pseudobulk profiles under this rule. D02 and D03 should be marked as not retained for T, not represented by profiles of zero counts for every gene.

Suppose the summed G1 counts for D01 and D04 are 12 and 0, respectively. D04's zero is a valid observed gene count in an eligible profile. It does not mean D04 had no T cells: D04 passed the cell threshold with five cells. The distinction must remain visible in both the profile data and the accompanying metadata.

Cell eligibility should generally be assessed after applying the study's specified cell-level quality checks and cell-type assignment rules. Record the number of cells contributing to each profile. This allows later users to understand how a profile was constructed and to identify groups near the chosen threshold. If a donor has adequate cell numbers for one cell type but not another, eligibility is determined separately for each donor–cell-type group.

Gene Filtering After Aggregation

A feature set may include genes with no or very sparse observed counts in the pseudobulk profiles. Such genes can be uninformative for many downstream analyses and may create computational burden. A simple filtering rule can require a gene to meet a minimum count in a specified number of eligible donor–cell-type profiles. For example, a rule might retain a gene if its pseudobulk count is at least 10 in at least two eligible profiles. The numerical rule is illustrative: it should reflect the study design and be stated explicitly.

Filtering should be applied to the intended analysis set, often separately within each cell type because expression and the number of eligible donors can differ by cell type. Do not count profiles that failed the minimum-cell rule as evidence that a gene was expressed at zero. Keep a record of the rule and the set of eligible profiles to which it was applied. A gene that fails a filter is excluded from that specified analysis; this does not establish that the gene is biologically absent.

Worked Example: Filtering Genes Across Eligible Profiles

Suppose four hypothetical donor profiles for one cell type have passed the cell-count rule. A prespecified filter retains a gene if its count is at least 10 in at least two of these four profiles. The pseudobulk counts are:

GeneD01D02D03D04Profiles with count at least 10Decision
G11801142Retain
G267020Filter out
G300000Filter out
G41210902Retain

G1 meets the threshold in D01 and D03, so it is retained. G2 never reaches 10, so it is filtered out. G3 has zero counts in all four eligible profiles and is filtered out. G4 reaches 10 in D01 and D02, so it is retained; the count of 9 in D03 does not meet the threshold. Each decision follows directly from the stated rule, applied to the four eligible profiles.

Preserving Donor-Level Metadata

Aggregation must reduce cell-level records without discarding the information needed to identify and describe each resulting profile. At minimum, maintain the donor identifier, cell type, and sample or condition identifiers used to define the group. Also retain the number of cells contributing to the profile and the total summed library size, computed as the sum of counts over the included genes. These quantities describe the constructed profile; they are not substitutes for the gene-level counts.

Genotype and donor-level covariates must remain linked to the correct donor. Examples include age, sex, ancestry variables, or other study-specific covariates. A donor-level value should not be copied from one arbitrarily selected cell if cell metadata disagree; resolve the discrepancy using the study's data definitions. Sample-level information such as collection batch or visit should be retained at the corresponding sample level. If a donor has more than one sample, preserve the identifiers that distinguish them.

A practical output has one row per eligible donor–cell-type–sample group and one count column per gene, accompanied by metadata columns. A separate eligibility table can also be useful: it records groups with no cells or too few cells, which cannot appear as ordinary count profiles. Keep the mapping from cell records to groups and the gene-filtering decisions reproducible so that the resulting matrix can be audited.

1
Establish identifiers and features.
Check that each cell has a donor, cell type, and any necessary sample or condition label, and that gene identifiers are consistent.
2
Determine eligible groups.
Apply the stated cell-level quality rules, count cells per group, and mark groups below the prespecified minimum as not retained.
3
Sum raw counts.
For every eligible group and gene, add the raw counts of its assigned cells; do not average counts or combine donors.
4
Filter genes and attach metadata.
Apply the documented gene rule to eligible profiles, then attach donor and sample identifiers, covariates, cell counts, and library totals.

Common Pitfall and Key Takeaway

A common mistake is to normalize each cell first and then average those values, while calling the result a pseudobulk count. That quantity is a cell-level average on a transformed or normalized scale; it is not the sum of raw counts defined here. Another mistake is to replace a donor–cell-type group that failed its cell threshold with a row of zeros. That confuses unavailable profiles with observed gene-level zeros and can change the meaning of later analyses.

Construct profiles from raw counts, keep the grouping key aligned with the biological sample structure, and make the eligibility and filtering rules explicit. Preserve donor-level covariates and profile-quality metadata alongside the count matrix. The resulting data are then organized at the donor level for subsequent genetic analysis; the choice and interpretation of a regression model are separate questions.

Key takeaway: A pseudobulk count \(Y_{dcg}\) is the sum of raw counts for gene \(g\) across eligible cells from donor \(d\) in cell type \(c\). A group below the cell threshold is not an all-zero profile, and donor identities and covariates must remain attached to every retained profile.

Check Your Understanding

Answer each question using the definitions and rules in this tutorial.

  1. Three cells from one donor and cell type have counts 2, 0, and 5 for a gene. What is the pseudobulk count, and why is it not the average of those values?
  2. A donor has one cell in a cell type when the minimum is four. Should this group be represented as an all-zero profile, a valid zero for every gene, or a group not retained? Explain.
  3. Why must profiles from two different donors remain separate even when both donors have the same cell type?
  4. Under a rule requiring a count of at least 8 in at least two eligible profiles, would counts of 8, 7, 0, and 10 retain a gene? Show how many profiles meet the threshold.
  5. Name two profile-level or donor-level metadata items that should be preserved alongside the pseudobulk counts, and explain what each describes.
Clinical Biostats