This R package faciliates Exploratory COmpositional Data Analysis (ECODA) and visualization for single-cell omics sample embeddings at the population level
It enables intuitive exploration of multi-sample datasets –such as large patient cohorts– and supports the unsupervised identification of samples with similar cell type compositional profiles, e.g. patient clustering. In addition, scECODA provides metrics to quantify the degree of separation between groups of samples, e.g. biological conditions, and to pinpoint the cell types or states whose change in abundance drives these differences.
The following example uses 868 scRNA-seq samples from the blood of healthy donors (data from Gong & Sharma et al.) with previously annotated cell types. It illustrates how samples naturally separate in an unsupervised manner by donor age and CMV infection status, and highlights the top cell types whose changes in abundance drive inter-sample variation.
ecoda_object <- create_ecoda_object(
seurat_object, # or SCE_object or count data (see create_ecoda_object_helper)
sample_col = "sample_id", # sample column
celltype_col = "seurat_annotations" # cell type annotations
)
ecoda_object <- create_ecoda_object(Seurat_Object) # or SCE_object or count data
plot_pca(ecoda_object)
To install scECODA directly from the GitHub repository, run the following code from within R or RStudio:
install.packages("remotes")
library(remotes)
remotes::install_github("carmonalab/scECODA")Check out our step-by-step scECODA tutorial (RMD)
Case Study 1: Granularity Matters - See how fine-grained cell type annotation can be crucial to uncover inter-sample biological variation missed by broad, low-resolution annotation or pseudobulk gene expression in these ECODA anlayses of i) blood samples from healthy individuals and ii) lung samples from patients with different pulmonary diseases. (RMD)
Case Study 2: Cell type composition vs. Pseudo-bulk gene expression - See how scECODA's compositional analysis compares to pseudobulk analysis and outperforms it when differences are driven by low-abundance cell types in a semi-synthetic dataset. (RMD)
Halter C, et al. 2025
