GETTING STARTED
From a pilot study to a study design
- Choose unpaired for independent groups, or paired for matched samples (such as before and after treatment).
- Enter the range of biological sample sizes to compare and the number of cells collected per sample in each group. For a paired study, sample size means the number of matched pairs.
- Use pilot data to estimate the mean and standard deviation of the cell type proportion across samples. Enter proportions as decimals: 0.03 means 3%. Alternatively, enter the beta distribution’s a and b parameters.
- Choose a statistical test and significance level α. Set the false negative threshold βth to highlight designs with sufficiently low false negative rates.
- Read the table: lower β is better. Statistical power is 1 − β. A threshold of 0.2 corresponds to power above 80%; the default 0.1 corresponds to above 90%.
Choose a test
One-sided / two-sided
Use one-sided when prior knowledge supports a direction of change; two-sided tests allow either direction. For ordinary t-tests, this calculator uses the magnitude of the expected difference, as in the original website.
SESOI
The smallest effect size of interest sets a meaningful difference from control. With an offset of 0.05, “verify” tests whether the experimental proportion exceeds control + 0.05; “falsify” tests whether it is below that value. Negative offsets reverse the direction. An offset of 0.05 is five percentage points.
TOST for equivalence
Two one-sided tests assess whether the difference lies between lower and upper offsets. Sensei adds their false negative rates and caps the sum at 1, matching the original implementation. Failure to detect a difference alone does not establish equivalence.
Choose prior parameters
Use estimates from your pilot study or comparable data. These PBMC values from the original guide are illustrative, not universal:
| Cell type | Mean ± SD |
|---|---|
| CD4 T cells | 0.40 ± 0.05 |
| CD8 T cells | 0.20 ± 0.05 |
| B cells | 0.10 ± 0.05 |
| NK cells | 0.20 ± 0.03 |
| Monocytes | 0.08 ± 0.02 |
| Dendritic cells | 0.015 ± 0.002 |
Paired correlation ρ
Estimate correlation between matched samples from pilot data. The original TCGA examples show correlations and their 95% confidence intervals. Positive correlation can improve power; negative correlation can reduce it.
Model & interpretation
Sensei models between-sample cell proportions with beta distributions and cell sampling with a beta-binomial model. It uses the published t-distribution approximation, accounting for the number of cells per sample, unequal group variances in unpaired studies, and correlation in paired studies.
Random cell sampling, adequate approximation to normality, and controlled batch effects are assumptions of the model. The paper recommends unimodal beta distributions (a and b greater than 1). Highly skewed proportions or strong batch effects may require a different approach. Use the plot to check your inputs.
For compatibility, converting mean/SD to a/b rounds to three decimal places; converting a/b to mean/SD rounds to four. Calculations use a/b, so retain those exact values when comparing versions. Table values are rounded to three decimal places; highlighting uses the unrounded rate and the strict rule β < βth.
Research & resources
Johnson et al. · Immune impacts of fire smoke exposure · Nature Medicine (2025) cites Sensei.
Source & Python package · Original website · Original single-size calculator