Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Composition tests

A condition can change which cells are present as well as what they express. A cube records how many cells of each type every sample holds (Cube.n_cells), and propeller tests whether the share of each cell type differs between conditions, as speckle’s propeller does Phipson et al., 2022. Proportions estimated from single-cell data are variable, so the test compares samples, the biological replicates, not cells.

The steps

  1. Proportions. Sample jj, with xijx_{ij} cells of type ii and NjN_j cells in all, has the proportion pij=xij/Njp_{ij} = x_{ij} / N_j of type ii.

  2. Transform. The logit, log⁡(qij/(1−qij))\log(q_{ij} / (1 - q_{ij})), of the proportions after half a cell is added to every count, qij=(xij+0.5)/∑i(xij+0.5)q_{ij} = (x_{ij} + 0.5) / \sum_i (x_{ij} + 0.5), so that a type absent from a sample has a finite value; or the arcsine square root, arcsin⁡pij\arcsin\sqrt{p_{ij}}.

  3. Linear model. The transformed proportions of every cell type are fitted with the design (Designs, linear models and contrasts).

  4. Moderation. The residual variances of the cell types are moderated by empirical Bayes, robustly by default, as speckle does (Empirical Bayes moderation; Phipson et al. (2016)).

  5. Tests. Each contrast is tested by its moderated t-statistic; f_test names a factor whose levels are tested together by a moderated F-statistic. p-values are adjusted by the method of Benjamini and Hochberg over the cell types.

The result, a CompositionResult, holds a table for every contrast (CompositionResult.table) and one for the F-test, with speckle’s descriptive columns: the baseline proportion of every cell type, the mean proportion in each level of the factor a contrast compares, and their ratio. Its summary says which cell types and samples were left out, and why.

Choices

Limits

propeller fits fixed effects only: a design with random effects is refused, so a donor sampled in every condition enters the formula as a fixed effect, as in ~ donor + condition. Precision-weighted mixed models of composition (crumblr; Hoffman & Roussos (2026)) and Bayesian count models, such as scCODA Büttner et al., 2021 and sccomp Mangiola et al., 2023, are not implemented.

References
  1. Phipson, B., Sim, C. B., Porrello, E. R., Hewitt, A. W., Powell, J., & Oshlack, A. (2022). propeller: testing for differences in cell type proportions in single cell data. Bioinformatics, 38(20), 4720–4726. 10.1093/bioinformatics/btac582
  2. Phipson, B., Lee, S., Majewski, I. J., Alexander, W. S., & Smyth, G. K. (2016). Robust hyperparameter estimation protects against hypervariable genes and improves power to detect differential expression. The Annals of Applied Statistics, 10(2), 946–963. 10.1214/16-AOAS920
  3. Hoffman, G. E., & Roussos, P. (2026). Fast, flexible analysis of differences in cellular composition with crumblr. Nature Communications, 17(1), 9598. 10.1038/s41467-026-75681-7
  4. Büttner, M., Ostner, J., Müller, C. L., Theis, F. J., & Schubert, B. (2021). scCODA is a Bayesian model for compositional single-cell data analysis. Nature Communications, 12(1), 6876. 10.1038/s41467-021-27150-6
  5. Mangiola, S., Roth-Schulze, A. J., Trussart, M., Zozaya-Valdés, E., Ma, M., Gao, Z., Rubin, A. F., Speed, T. P., Shim, H., & Papenfuss, A. T. (2023). sccomp: Robust differential composition and variability analysis for single-cell data. Proceedings of the National Academy of Sciences, 120(33), e2203828120. 10.1073/pnas.2203828120