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.

Aligning studies

Activities from networks completed the analysis of one study: its genes, cell types, pathways and regulators. A finding counts for more when other studies of the same question reproduce it, and the chapters of this part compare and combine studies. Studies can be compared only once their samples, genes and cell types are aligned, and CubeCollection aligns them, keeping each study’s cube as it was given. Align and combine studies aligns six simulated cohorts and analyses each.

Why findings fail to replicate

Results of one study often do not hold in others: of the genes called differentially expressed in Alzheimer’s disease in one dataset, over 85% were not reproduced in any of 16 others Nakatsuka et al., 2025. Some of these are changes that the other studies were too small to find; others belong to one study, to its donors, its protocol or a confounder of its own. Telling the two apart takes several studies analysed alike.

Aligned by hand, studies go wrong in two ways: donor ids repeat across studies, so that donor D1 of one study is taken for donor D1 of another, and genes that a study did not measure are read as zeros. Each study also names its cell types in its own words.

Samples and donors

A sample id means something only inside its study, so CubeCollection names every sample study::sample_id, and does the same for the columns named in within_study, such as donor ids: donor D1 of two studies is then two people, not one, in any design built on the collection. The collection’s sample table (CubeCollection.samples) joins the studies’ sample tables, with missing values where a study lacks a column; the class’s documentation says how the types of a column are combined, and a column of text in one study and of numbers in another is refused.

Genes

Genes are matched by feature_id exactly as written, so every study must use ids of one kind, such as Ensembl gene ids, without versions: ENSG00000141510.17 and ENSG00000141510 differ. Some tools give every study the same genes and fill the genes that a study lacks with zeros, so a cube can mark such genes False in a feature column measured: a study measured the genes that its cube has and does not mark so. The collection keeps every gene that some study measured, and CubeCollection.measured records which study measured which, so that an unmeasured gene is missing for that study rather than zero.

A missing gene changes nothing for the other genes. A gene without counts changes no library size, expression filter or normalization factor, so each study’s results on the genes it measured are those of its cube as given.

Cell types

Cell types are aligned by their Cell Ontology ids Diehl et al., 2016, the column cell_ontology_id of the group tables, when every study’s cube has it, and by group_id otherwise; align_groups_by names another column. group_mapping gives some groups of a study an aligned id of their own, or None to leave a group out, and group_names names the aligned groups for the tables and figures that follow, such as CD14 monocytes for CL:0001054. Two groups of one study that receive the same aligned id are summed into one, exactly, since every layer of a cube is a sum (Exact regrouping): naive and memory CD4 T cells of one study, mapped to CL:0000624, become the CD4 T cells of the others. CubeCollection.group_members shows which of a study’s groups went into each aligned group.

One analysis per study

Each study is analysed on its own. CubeCollection.aligned_cube returns a study’s cube in the collection’s terms, with its cell types renamed and merged as aligned and only the genes it measured, but with the study’s own samples and sample ids, so that a design built from the study’s sample table fits it. analyse_each_study builds that design for every study, with one formula, its levels and contrasts, and runs limma_voom, limma_trend or dream_voom on each aligned cube. Each study keeps its own design, normalization, expression filter and variances.

The StudyResults it returns keeps the results with their collection. StudyResults.table lines up the results of one cell type and contrast gene by gene, with a row for every study and gene, and a status that gives the reason when a study lacks a result for a gene: it did not measure the gene (not_measured), measured it and left it out, as its expression filter does (not_tested), or did not analyse the cell type or the contrast (not_analysed). These are different findings, and a missing result is never read as a zero. StudyResults.matrix puts one column of every study, such as the p-values, into a studies x genes matrix. The meta-analysis and the replication of the next chapters take these results.

A joint model of stacked studies

CubeCollection.stack builds one cube of all the studies’ samples for a joint model, whose sample table names each sample’s study. A cube holds no missing values, so the stacked cube keeps the genes that every study measured and the cell types that every study has, and refuses the others rather than fill them with zeros. Each study keeps its own counts and library sizes, and a normalized layer is stacked only from studies normalized alike. The design ~ study + condition gives every gene a baseline in each study and one difference between the conditions, shared by all; with several samples per donor, within_study keeps the donors of different studies apart.

A joint model suits studies made alike, with one protocol and platform, that are too small to estimate their variances alone. It estimates one difference for every study, so a change in one study enters the estimate for all, and it tests only the genes that every study measured.

Defaults and choices

Limits and differences

Checks and further reading

The alignment of three simulated studies, with repeated donor ids, merged cell types, genes filled with zeros and marked as not measured, is compared with anndata 0.13.4’s concat and pandas 3.1.0, and limma-voom on each aligned study and on the stack with limma 3.62.1 and edgeR 4.4.0 run on the studies’ own counts: exact, with identical samples, genes and layers, and limma’s tables within 3.8e-13 (Validation). A control shows why donor ids are written with their study: taken for one person, donor D1 of two studies changes the fit of every gene.

Further reading:

Meta-analysis, the next chapter, combines the results of the studies.

References
  1. Nakatsuka, N., Adler, D., Jiang, L., Hartman, A., Cheng, E., Klann, E., & Satija, R. (2025). Improving reproducibility of differentially expressed genes in single-cell transcriptomic studies of neurodegenerative diseases through meta-analysis. Nature Communications, 16(1), 7436. 10.1038/s41467-025-62579-z
  2. Diehl, A. D., Meehan, T. F., Bradford, Y. M., Brush, M. H., Dahdul, W. M., Dougall, D. S., He, Y., Osumi-Sutherland, D., Ruttenberg, A., Sarntivijai, S., Van Slyke, C. E., Vasilevsky, N. A., Haendel, M. A., Blake, J. A., & Mungall, C. J. (2016). The Cell Ontology 2016: enhanced content, modularization, and ontology interoperability. Journal of Biomedical Semantics, 7(1), 44. 10.1186/s13326-016-0088-7
  3. CZI Cell Science Program, Abdulla, S., Aevermann, B., Assis, P., Badajoz, S., Bell, S. M., Bezzi, E., Cakir, B., Chaffer, J., Chambers, S., Cherry, J. M., Chi, T., Chien, J., Dorman, L., Garcia-Nieto, P., Gloria, N., Hastie, M., Hegeman, D., Hilton, J., … Carr, A. (2025). CZ CELLxGENE Discover: a single-cell data platform for scalable exploration, analysis and modeling of aggregated data. Nucleic Acids Research, 53(D1), D886–D900. 10.1093/nar/gkae1142
  4. Sikkema, L., Ramírez-Suástegui, C., Strobl, D. C., Gillett, T. E., Zappia, L., Madissoon, E., Markov, N. S., Zaragosi, L.-E., Ji, Y., Ansari, M., Arguel, M.-J., Apperloo, L., Banchero, M., Bécavin, C., Berg, M., Chichelnitskiy, E., Chung, M., Collin, A., Gay, A. C. A., … Theis, F. J. (2023). An integrated cell atlas of the lung in health and disease. Nature Medicine, 29(6), 1563–1577. 10.1038/s41591-023-02327-2