Nested measurements · Choose a method

Organoid size statistics: organoids, wells and batches as n, log-scale sizes and size thresholds

Average log organoid size per well and per differentiation batch, then compare conditions per batch. In simulation, organoids as n gave 23% false positives, and dropping small organoids made a 20% shrinkage look like 15%. Python and R code.

By Licklider · Published · Last reviewed · How this page was made · Markdown

On this page
  1. Which analysis for your question
  2. Worked example: a drug with no real effect
  3. Before you analyse
  4. Check what an AI assistant ran
  5. Report it
  6. References

Quick answer. Organoids from one well, and wells from one differentiation batch, share the same handling and environment, so each organoid is not an independent replicate. Take the log of each organoid’s size (sizes are skewed), average per well, average the wells of each condition within each independent batch (or donor line), and compare conditions as the log ratio per batch, tested across batches (a mixed model is an alternative only with many batches; see below). Measure every organoid that meets rules set in advance (in crowded wells, every organoid in fields chosen by a fixed pattern), and report how many were excluded. In a simulation of 4 batches × 3 wells per condition with no real effect, treating about 240 organoids per condition as n gave false positives in 22.7% of studies; batches as n gave 4.6%. When the drug really made organoids 20% smaller, dropping organoids below a minimum size made the estimated shrinkage look like 15%.

Terms used below. Organoid: a three-dimensional structure grown from stem or tissue cells. Size: here the cross-sectional area from an image, in µm²; diameter or volume behave the same way on the log scale. Log-normal: a skewed distribution whose logarithm is normal. Log scale: taking logarithms so that a halving and a doubling are equally far from no change; the mean on this scale gives the geometric mean. Well: one culture well, treated as a whole. Differentiation batch: organoids started from cells on a separate occasion; with patient or donor lines, each line is the unit. Log ratio: the logarithm of drug ÷ control; results are converted back to a ratio. One-sample t-test: tests whether the mean of the per-batch log ratios differs from 0, the same as a paired t-test. Mixed model: a regression that gives each batch and well its own baseline (random effects) so that organoids are not treated as independent; here it would also need a term letting the drug effect differ between batches, well IDs that are unique within batch and condition, and small-sample degrees of freedom. SuperPlot: a plot showing individual organoids coloured by batch, with batch means on top. Quantile: a cut point of the distribution, such as the median or 90th percentile. Focal plane and edge exclusion: image rules for which plane is measured and how far from the well edge an organoid must lie. p-value: the chance of a result at least this extreme if there were no real effect. Degrees of freedom: how much information is left to estimate uncertainty; with 4 batches there is little. Paired design: both conditions grown in every batch, so each batch is compared with itself. Formation efficiency: organoids formed ÷ cells seeded. Slope per well: the change in mean log area per day, fitted per well. Random seed: the number that fixes the computer’s random draws, so the example can be reproduced. Welch t-test: a two-group t-test that does not assume equal spread. 95% confidence interval (CI): the range of values compatible with the data. Power: the chance of detecting an effect that is really there. False positive: a “significant” result when there is no real effect.

Which analysis for your question

Question Analysis Report
Does a treatment change organoid size? Mean log size per well, mean of wells per condition per batch; log ratio per batch, one-sample t-test Ratio of geometric means with 95% CI, n batches (wells, organoids)
Fewer than 3 batches No test across batches is meaningful: describe each batch and repeat before testing Geometric means per batch
Does a treatment change how many organoids form? Organoid count per well (or per cells seeded), averaged per batch, compared per batch Ratio with 95% CI
Patient- or donor-derived lines Each line is the unit; lines are compared, with batches within lines averaged first Ratio with 95% CI, n lines
Conditions not grown side by side in each batch Mean log size per batch (or line), Welch t-test between conditions on those means; expect less power than the paired design Ratio with 95% CI
Growth over time Log size per well at each time point, slope per well, averaged per batch Ratio of growth rates with 95% CI
Size distribution, not just the average Show the distribution per condition and batch (for example a SuperPlot); compare quantiles per batch Medians and spread per batch

Lazic notes that “cells in the same flask or well of a cell-culture experiment are not independent; they will tend to be more similar than cells in different flasks or wells and will be subject to the same uncontrolled effects” (Lazic 2010). Lord and colleagues ask for “the sample size n used for statistical tests representing biological replicates, independent measurements of the population from separate experiments” (Lord et al. 2020). Velasco and colleagues open by noting that brain organoids “are plagued by high organoid-to-organoid variability”, a concern about cell-type composition that their own protocol largely addressed (Velasco et al. 2019); for comparing conditions, what matters is how much batches differ, which is why batches, not organoids, set n. In the OrganoSeg software, “users can define a minimum size threshold to exclude debris or organoids with poor growth”, and it segmented “the in-focus or near-focused organoids” (Borten et al. 2018), two choices that decide which organoids are counted.

Worked example: a drug with no real effect

Constructed data: control and drug-treated organoids from 4 independent differentiation batches, 3 wells per condition per batch, with every organoid in focus measured (484 organoids, 8 to 30 per well). Sizes are log-normal with a geometric mean near 40,000 µm². In the model, batches differ a lot (standard deviation 0.25 on the log scale, both conditions together; the four batches drawn here happen to be similar), the drug’s apparent effect varies a little between batches (0.08 per condition, about 0.11 for the drug ÷ control difference), wells differ (0.12), and organoids vary widely within a well (0.6). By design, the drug does not change organoid size. The data’s random seed was the first one tried and was not chosen for its result. Stored code and data: organoids.csv, model.py, make_data.py, analysis.py, analysis.R and the analysis output; analysis.py and analysis.R print the same output.

Batch Geometric mean area, control (µm²) Geometric mean area, drug (µm²) Ratio
1 44,405 37,892 0.85
2 40,955 35,587 0.87
3 44,282 50,151 1.13
4 41,585 35,601 0.86
Analysis, drug vs control Result
A. (Not valid: organoids share wells and batches) Organoids as n (239 drug vs 245 control), Welch t-test on log area ratio 0.90, p = 0.054
B. (Not valid: wells share batches) Wells as n (12 vs 12), Welch t-test on mean log area ratio 0.92, p = 0.17
C. Batches as n: one-sample t-test on per-batch log ratios (n = 4) 0.92 (95% CI 0.74 to 1.15), p = 0.32

Treating organoids as n came close to a “significant” 10% shrinkage that does not exist. Across 5,000 simulated studies of this design (simulation.py, the simulation output):

Scenario A. Organoids as n (invalid) B. Wells as n (invalid) C. Batches as n, per-batch log ratios Average ratio estimated by C, all organoids Average ratio by C after dropping organoids below 15,000 µm²
No drug effect (false positives) 22.7% 2.1% 4.6% 1.00 1.00
Drug makes organoids 20% smaller (power) 87.0% 43.3% 36.7% 0.80 0.85
Drug makes organoids 20% smaller, 8 batches (power) 97.3% 73.6% 81.4% 0.80 0.85

These percentages describe this simulated design (4 batches, 3 wells, the variation in model.py), not every organoid study. Organoids as n found effects that were not there in almost a quarter of null studies. Wells as n was too cautious here (2.1%), because the large batch-to-batch differences stayed in the comparison, but it would give false positives if the drug’s effect varied more between batches. Batches as n kept false positives near 5%, but with 4 batches it detected a real 20% shrinkage in only 36.7% of studies, and with 8 batches in 81.4%; plan batches or lines, not organoids. A cut-off at 15,000 µm² removed on average 16.9 control and 30.4 drug-treated organoids per study when the drug was active, and made a 20% shrinkage look like 15%. A mixed model on all organoids was not simulated; with 4 batches its batch-level terms rest on 4 values, so more batches help more than a more complex model.

Measure organoids with your image-analysis tool (for example Fiji or OrganoSeg, with the scale set in µm), export one row per organoid, and add batch, condition and well from the image names. The code expects columns batch, condition (labels exactly control and drug), well and area_um2; check that every batch has both conditions (print the batch table before testing): a batch with one condition missing is dropped by the snippets (dropna() in Python, t.test in R), so check that n equals your number of batches; rename your columns and labels to match, and run the code in the folder that holds the CSV file. Python needs NumPy, pandas and SciPy; the R code uses base R only.

import numpy as np, pandas as pd
from scipy import stats

d = pd.read_csv("organoids.csv"); d["log_area"] = np.log(d.area_um2)
w = d.groupby(["batch", "condition", "well"]).log_area.mean()            # mean log area per well
b = w.groupby(["batch", "condition"]).mean().unstack(); print(b)        # mean of the wells per batch; check no NaN
r = (b.drug - b.control).dropna(); t = stats.ttest_1samp(r, 0); ci = t.confidence_interval()
print(f"drug / control {np.exp(r.mean()):.2f} (95% CI {np.exp(ci.low):.2f} to {np.exp(ci.high):.2f}), p = {t.pvalue:.2g}")
# drug / control 0.92 (95% CI 0.74 to 1.15), p = 0.32
d <- read.csv("organoids.csv"); d$log_area <- log(d$area_um2)
w <- aggregate(log_area ~ batch + condition + well, data = d, FUN = mean)   # mean log area per well
b <- tapply(w$log_area, list(w$batch, w$condition), mean)                   # mean of the wells per batch
t <- t.test(b[, "drug"] - b[, "control"])
round(exp(c(ratio = unname(t$estimate), lower = t$conf.int[1], upper = t$conf.int[2])), 2); round(t$p.value, 2)
# ratio 0.92, lower 0.74, upper 1.15; p 0.32

Before you analyse

  1. Plan the number of independent batches (or donor lines), not the number of organoids; in our simulation 4 batches found a 20% shrinkage in fewer than 4 studies in 10, and 8 batches in about 8 in 10.
  2. Set image-analysis rules in advance and apply them blind to condition: focal plane, minimum size, how touching organoids are split, edge exclusion; report how many organoids each rule removed per condition, and the result without the size cut-off, because even a blind cut-off removes more organoids from the condition that makes them smaller.
  3. Analyse size on the log scale and report geometric means and ratios.
  4. Average organoids within wells and wells within batches; with many batches, a mixed model with batch, well and batch-by-condition terms is an alternative (nested data).
  5. Report formation efficiency too: a drug that stops small organoids forming changes the size distribution of the ones that remain.

Check what an AI assistant ran

  1. The assistant ran a t-test on all organoids. Ask for one value per condition per batch.
  2. The assistant analysed raw areas. Ask for log sizes and geometric means.
  3. The assistant excluded organoids below a size cut-off without saying how many. Ask for counts removed per condition and the result without the cut-off.
  4. The assistant pooled batches. Ask for the per-batch ratios.

Report it

Organoids from [4] independent differentiation batches were grown in [3] wells per condition, and every in-focus organoid was measured blind to condition ([OrganoSeg]); [no size cut-off was applied; [5] control and [15] drug-treated organoids were below 15,000 µm²]. Log areas were averaged per well and per condition within each batch, and the log ratio drug ÷ control was compared with 0 by a one-sample t-test across batches (R [4.3.3]).

In the constructed example, which has no effect built in, the drug did not clearly change organoid size (ratio of geometric means [0.92], 95% CI [0.74] to [1.15]; p = [0.32]; n = [4] batches, [484] organoids).

Replace the bracketed values with your own.

References

  • Lazic SE (2010). The problem of pseudoreplication in neuroscientific studies: is it affecting your analysis? BMC Neuroscience 11:5. doi:10.1186/1471-2202-11-5
  • Lord SJ, Velle KB, Mullins RD, Fritz-Laylin LK (2020). SuperPlots: communicating reproducibility and variability in cell biology. Journal of Cell Biology 219:e202001064. doi:10.1083/jcb.202001064
  • Velasco S, Kedaigle AJ, Simmons SK, et al. (2019). Individual brain organoids reproducibly form cell diversity of the human cerebral cortex. Nature 570:523–527. doi:10.1038/s41586-019-1289-x
  • Borten MA, Bajikar SS, Sasaki N, Clevers H, Janes KA (2018). Automated brightfield morphometry of 3D organoid populations by OrganoSeg. Scientific Reports 8:5319. doi:10.1038/s41598-017-18815-8

How this page was made

  • Written and published by Licklider. Recommendations cite peer-reviewed methods papers listed under References; cited passages were checked against the source text.
  • The worked example uses constructed data. Its numbers were produced by stored code (Python 3.13 with SciPy 1.18.1; R 4.3.3, base R), and the two languages print identical output; the simulation was run in Python.
  • Separate review passes checked the statistics, the citations and readability before publication.