Single-cell and spatial evidence with biological replication

Practical 31: Genomics, systems biology and multi-omics

Learning objectives

Distinguish cell resolution from independent treatment allocation; compare naive and animal-level uncertainty; critique spatial and AI claims using stated evidence.

Biological question and data

Does observing many cells from eight animals provide the same intervention information as observing that many independent animals?

The worked measurements are fictional continuous cell-level values, not an RNA-seq analysis. Treatment is assigned to animals. A supplied animal-specific effect induces within-animal dependence. Animal-mean analysis is used to illustrate that unit; actual single-cell pipelines need count/assay-specific models and sample-level design.

No biological download is required. Numerical inputs are hypothetical, not observed animal data. The runnable examples use base R. Count and abundance units are specified where used.

1. Generate nested measurements

Twenty cells belong to each animal. The animal-specific effects are supplied, not independently assigned to cells.

Show R code
set.seed(3101)
animal <- rep(paste0("a",1:8),each=20)
treatment_animal <- rep(c(0,1),each=4)
animal_effect <- c(-1,.5,1,-.5,.8,-.2,1.2,-.8)
dat <- data.frame(animal,treatment=rep(treatment_animal,each=20))
dat$value <- 1+dat$treatment+rep(animal_effect,each=20)+rnorm(160,sd=.2)
c(cells=nrow(dat),animals=length(unique(dat$animal)))
  cells animals 
    160       8 

The dataset has 160 measurements but eight independently treated animals.

2. Compare uncertainty at different units

Fit the intentionally naive independent-cell model and a model of animal means. Label the naive fit as unsuitable for the allocation.

Show R code
naive <- lm(value~treatment,dat)
means <- aggregate(value~animal+treatment,dat,mean)
animal_fit <- lm(value~treatment,means)
result <- data.frame(analysis=c("naive independent cells","animal means"),
 estimate=c(coef(naive)["treatment"],coef(animal_fit)["treatment"]),
 SE=c(coef(summary(naive))["treatment","Std. Error"],
 coef(summary(animal_fit))["treatment","Std. Error"]),
 residual_df=c(df.residual(naive),df.residual(animal_fit)))
result
                 analysis estimate        SE residual_df
1 naive independent cells 1.152614 0.1286135         158
2            animal means 1.152614 0.6397319           6
Show R code
stopifnot(nrow(means)==8,result$SE[1]<result$SE[2])

Equal cell counts make the mean contrasts agree, while the independent-cell assumption understates uncertainty. More measurement resolution did not create independent animals.

3. Critique additional advanced claims

For each claim identify the measurement, dependence and missing evidence.

Show R code
review <- data.frame(claim=c("adjacent spatial spots interact","AI cell split predicts new animals",
 "chromatin contact proves regulatory direction"),
 question=c("resolution, cell mixtures, spatial dependence and mechanistic evidence?",
 "were animals separated and all preprocessing learned in training?",
 "what perturbation/temporal evidence establishes the causal relationship?"))
review
                                          claim
1               adjacent spatial spots interact
2            AI cell split predicts new animals
3 chromatin contact proves regulatory direction
                                                                  question
1  resolution, cell mixtures, spatial dependence and mechanistic evidence?
2        were animals separated and all preprocessing learned in training?
3 what perturbation/temporal evidence establishes the causal relationship?

These are hypothetical critique prompts. Co-location, prediction and molecular contact describe different kinds of evidence.

4. Unequal cell recovery changes a pooled comparison

Animal means give each animal equal weight; pooling cells gives more weight to animals with more recovered cells. Demonstrate the difference using supplied animal means and recovery counts.

Show R code
animal_summary <- data.frame(animal=c('a1','a2','a3'),
 mean=c(2,5,8),cells=c(10,20,100))
c(equal_animal_mean=mean(animal_summary$mean),
 cell_weighted_mean=weighted.mean(animal_summary$mean,animal_summary$cells))
 equal_animal_mean cell_weighted_mean 
          5.000000           7.076923 

5. Review a method at its resolution and unit

Single-cell clusters, spatial spots and inferred trajectories answer different questions. A cluster depends on features and algorithm choices; a spot can mix cells; a snapshot trajectory does not directly observe longitudinal movement.

For an animal-level contrast, preserve specimen identity and replication through cell-type analysis or an appropriate hierarchical approach. For new-animal AI prediction, keep animals separated and fit the full preprocessing/selection procedure inside training. Review recovery, QC and annotation before interpreting a missing or shifted cell type.

Interpretation challenge

If treated animals yield more cells of a type, is the recovered cell fraction necessarily the true tissue fraction?

No. Recovery and processing can differ by group or cell state. The measured fraction needs assay and sampling context, and independent biological replication remains necessary.

Interpretation and limits

The example is not a single-cell/spatial software pipeline. Pseudobulk or hierarchical methods must reflect the assay and animal/specimen design. Advanced technology and AI do not remove the need for independent replication, provenance and appropriate validation.

Exercises

  1. Why do the point estimates agree here?
  2. Would splitting cells from every animal produce a new-animal prediction test?
  3. What should a critical paper review report?
  1. Every animal has equal cell counts, so the treatment contrast averages the same animal-level values.
  2. No; animal-specific information appears in both training and test.
  3. Question, measured unit/resolution, replication, processing, model assumptions, evidence strength, alternative explanations and a justified follow-up.

Continue learning

B16 Advanced methods, B11 Phenomics and B17 Integrity.

Continue with research reporting. Return to the practical index or the unified map.