| Title: | Unified Benchmarking and Accuracy Evaluation for Single-Cell Multiomics Simulation Methods |
|---|---|
| Description: | A simple and unified evaluation toolkit for benchmarking single-cell and multiomics data simulation methods. Evaluates how realistic simulated data are compared to real biological datasets across three multiomics experimental designs: (i) paired multiomics (simultaneous co-assay from identical cells, e.g. 10x Chromium Multiome, SHARE-seq, SNARE-seq), which unlocks the full Category 7 cross-modal coupling suite including FOSCTTM alignment scores and peak-to-gene regulatory linkage; (ii) unpaired multiomics (independent scRNA-seq and scATAC-seq profiled from separate cells of the same tissue), supported through per-modality unimodal evaluation (Categories 1-6, 8) and population-level cross-modal metrics such as co-expression module fidelity and network Jaccard similarity; and (iii) mosaic multiomics (partial co-measurement where only a subset of cells has both modalities, e.g. DOGMA-seq or mosaic pooling designs), handled by subsetting the paired cell fraction for coupling metrics and evaluating each modality independently otherwise. The toolkit quantifies simulation realism using 62 metrics organized into 8 easy-to-understand categories: (1) Distribution Differences: Statistical distances between real and simulated values (such as KS, Wasserstein, MAD, and RMSE), (2) Summary Properties: Gene correlations, zero counts, and dropout patterns, (3) Cell Structure and Clustering: How well distinct cell types and clusters are preserved (such as Silhouette width, ARI, and NMI), (4) Batch and Confounder Mixing: How well technical batch variations are captured or mixed, (5) Biological Signals and Marker Genes: Preservation of differentially expressed genes (DEGs) across Simpipe, SimBench, and Shaky Foundations frameworks, (6) Cell Lineage and Trajectories: Preservation of continuous developmental pathways (inferred directly from scRNA-seq counts), (7) Multiomics Relationships: Connections between different layers (such as gene expression and chromatin accessibility) — fully active for paired data; population-level metrics available for unpaired and mosaic data, (8) Computational Resources: Speed (runtime in seconds) and memory usage (peak RAM in MiB). Includes non-linear low-dimensional cell embedding projections (UMAP, t-SNE, PCA) with quantitative cluster separability (Silhouette) and fidelity (ARI) metrics, automated score normalization, leaderboards, 600 DPI bubble plots, and an interactive Shiny app studio. |
| Authors: | Kabilan Sakthivel [aut, cre], Dr Dwijesh Chandra Mishra [aut, ths], Dr Shashi Bhushan Lal [aut], Dr Sudhir Srivastava [aut], Dr Krishna Kumar Chaturvedi [aut], Dr Sharanbasappa [ctb] |
| Maintainer: | Kabilan Sakthivel <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.99.7 |
| Built: | 2026-10-12 23:16:01 UTC |
| Source: | https://github.com/BiocStaging/scSimEval |
Times an expression and measures change in memory allocation.
benchmark_resource_usage(expr)benchmark_resource_usage(expr)
expr |
Expression or function to benchmark. |
A list with elapsed seconds and peak memory allocated (MB).
benchmark_resource_usage({ Sys.sleep(0.01); 1 + 1 })benchmark_resource_usage({ Sys.sleep(0.01); 1 + 1 })
A unified, high-performance, and beginner-friendly benchmarking runner designed for multi-dataset and multi-simulator studies (e.g., 16 datasets x 6 simulators). Automatically manages memory allocation with sparse matrix coercions, parallel execution across datasets, progress tracking, and produces both granular and cross-dataset aggregated benchmark tables ready for visualization.
benchmark_simulation_suite( datasets, simulators, compute_bivariate = FALSE, threads = 1, auto_sparse = TRUE, run_gc = TRUE, save_path = NULL, verbose = TRUE )benchmark_simulation_suite( datasets, simulators, compute_bivariate = FALSE, threads = 1, auto_sparse = TRUE, run_gc = TRUE, save_path = NULL, verbose = TRUE )
datasets |
A named list of empirical reference datasets. Each item can be a
single-cell count matrix (features x cells), a path to an RDS/CSV matrix file,
or a list with |
simulators |
A named list of simulation methods. Each element must be a named
list of simulated count matrices (or matrix file paths) corresponding to the
datasets in |
compute_bivariate |
Logical. Whether to compute 2D bivariate tests. Default |
threads |
Number of threads / parallel workers. Default is |
auto_sparse |
Logical. Automatically coerce dense count matrices to |
run_gc |
Logical. Run garbage collection ( |
save_path |
Optional file path (ending in |
verbose |
Logical. Print informative progress logging. Default |
An object of class scSimEval_multidataset_benchmark containing:
granular_benchmark_table: Tidy data.frame containing all evaluated metrics across every dataset and simulator.
benchmark_summary_table: Tidy data.frame containing cross-dataset averaged fidelity scores for each simulator (ready for plot_benchmark_bubble_matrix()).
dataset_summary_table: Summary of reference dataset dimensions, sparsity, and library properties.
methods: Vector of evaluated simulator names.
datasets: Vector of evaluated dataset names.
cross_dataset_stats: Summary statistics (mean, SD, SE) for each metric across datasets.
data(example_scrna, package = "scSimEval") refs <- list("CohortA" = example_scrna$ref) sims <- list("Splatter" = list("CohortA" = example_scrna$sim)) res <- benchmark_simulation_suite(refs, sims, verbose = FALSE) print(res)data(example_scrna, package = "scSimEval") refs <- list("CohortA" = example_scrna$ref) sims <- list("Splatter" = list("CohortA" = example_scrna$sim)) res <- benchmark_simulation_suite(refs, sims, verbose = FALSE) print(res)
Computes global and cell-type-stratified Pearson and Spearman correlations and Kullback-Leibler (KL) divergence between empirical reference and simulated single-cell chromatin accessibility profiles.
calc_accessibility_profile_concordance( ref_data, sim_data, cell_types = NULL, use_tfidf = TRUE )calc_accessibility_profile_concordance( ref_data, sim_data, cell_types = NULL, use_tfidf = TRUE )
ref_data |
Reference count/accessibility matrix (peaks x cells). |
sim_data |
Simulated count/accessibility matrix (peaks x cells). |
cell_types |
Optional factor or vector of cell-type annotations for cells. |
use_tfidf |
Logical, whether to apply TF-IDF transformation prior to mean profile calculation (default TRUE). |
A list containing global PCC, global SCC, per-cell-type mean PCC/SCC, and mean accessibility KL divergence.
data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac calc_accessibility_profile_concordance(r_rna, r_atac)data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac calc_accessibility_profile_concordance(r_rna, r_atac)
Fits a polynomial curve relating peak/bin mean accessibility to non-zero cell proportion (NZP / detection frequency) as modeled in the simATAC framework (Navidi et al., Genome Biology 2021): NZP = c0 + c1 * mean + c2 * mean^2.
calc_accessibility_sparsity_curve(data, poly_degree = 2)calc_accessibility_sparsity_curve(data, poly_degree = 2)
data |
Count matrix (features/peaks x cells) or data.frame with 'mean' and 'nzp'. |
poly_degree |
Degree of polynomial (default: 2 for quadratic curve). |
A list with estimated coefficients (c0, c1, c2), R-squared, Spearman/Pearson correlations, and model fit summary.
data(example_scrna, package = "scSimEval") calc_accessibility_sparsity_curve(example_scrna$ref)data(example_scrna, package = "scSimEval") calc_accessibility_sparsity_curve(example_scrna$ref)
Compute All Bivariate (2D) Distance & Accuracy Metrics for Joint Distributions
calc_all_bivariate_metrics(ref_mat, sim_mat, metric_prefix = "", threads = 1)calc_all_bivariate_metrics(ref_mat, sim_mat, metric_prefix = "", threads = 1)
ref_mat |
2-column matrix for reference. |
sim_mat |
2-column matrix for simulation. |
metric_prefix |
Optional prefix string for metric names. |
threads |
CPU threads. |
Named list of bivariate metrics.
ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_all_bivariate_metrics(ref, sim)ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_all_bivariate_metrics(ref, sim)
Compute All Univariate Distance & Accuracy Metrics for a Feature
calc_all_univariate_metrics(ref, sim, metric_prefix = "")calc_all_univariate_metrics(ref, sim, metric_prefix = "")
ref |
Numeric vector of reference values. |
sim |
Numeric vector of simulated values. |
metric_prefix |
Optional prefix string for metric names. |
Named list of univariate distance metrics.
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_all_univariate_metrics(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_all_univariate_metrics(ref, sim)
Computes the Adjusted Mutual Information (AMI) between two clusterings or cell-type label assignments, correcting for chance expected mutual information under the hypergeometric model with fixed marginals (Vinh et al., JMLR 2010), as used in scMoMtF (Lan et al., PLOS Comput Biol 2024).
calc_ami( pred, truth, average_method = c("arithmetic", "max", "min", "geometric") )calc_ami( pred, truth, average_method = c("arithmetic", "max", "min", "geometric") )
pred |
Vector of predicted cluster labels. |
truth |
Vector of ground truth cell type labels. |
average_method |
Method to normalize mutual information: "arithmetic" (default, scikit-learn standard), "max", "min", or "geometric". |
AMI score in [0, 1] (adjusted for chance).
Vinh, N. X., Epps, J., & Bailey, J. (2010). Information theoretic measures for clusterings comparison: Variants, properties, normalization and correction for chance. Journal of Machine Learning Research, 11, 2837-2854.
Lan, W., Ling, T., Chen, Q. et al. scMoMtF: An interpretable multitask learning framework for single-cell multi-omics data analysis. PLOS Comput Biol 20(12): e1012679 (2024).
pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_ami(pred, truth)pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_ami(pred, truth)
Calculate Adjusted Rand Index (ARI)
calc_ari(pred, truth)calc_ari(pred, truth)
pred |
Predicted cluster labels. |
truth |
Ground truth cell type labels. |
ARI value between -1 and 1.
pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_ari(pred, truth)pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_ari(pred, truth)
Evaluates whether simulated paired scATAC-seq and scRNA-seq profiles capture the true regulatory coupling where regional chromatin opening gates target gene transcription (scMultiSim; Li et al., Nat Methods 2023).
calc_atac_rna_coupling(atac_data, rna_data, linked_pairs = NULL)calc_atac_rna_coupling(atac_data, rna_data, linked_pairs = NULL)
atac_data |
Matrix of chromatin peak accessibilities (peaks x cells). |
rna_data |
Matrix of gene expression counts (genes x cells). |
linked_pairs |
Optional 2-column data.frame of known linked peak-gene pairs. If NULL, assumes 1-to-1 matching by row index. |
A list containing mean coupling correlation, positive coupling ratio, and mean R-squared.
data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac calc_atac_rna_coupling(r_rna, r_atac)data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac calc_atac_rna_coupling(r_rna, r_atac)
Integrated from countsimQC (Soneson & Robinson). Treats dataset identity (reference vs. simulation) as cluster labels to test if the two datasets separate into distinct clusters or remain well-mixed.
calc_between_dataset_silhouette(ref, sim, subsample_size = 300)calc_between_dataset_silhouette(ref, sim, subsample_size = 300)
ref |
Vector or matrix for reference dataset. |
sim |
Vector or matrix for simulated dataset. |
subsample_size |
Number of subsampled points to evaluate (default 300). |
A named list with global and local between-dataset silhouette widths.
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_between_dataset_silhouette(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_between_dataset_silhouette(ref, sim)
Calculate Bhattacharyya Distance (BH)
calc_bhattacharyya(ref, sim, align = TRUE)calc_bhattacharyya(ref, sim, align = TRUE)
ref |
Numeric vector of reference values. |
sim |
Numeric vector of simulated values. |
align |
Logical, whether to align lengths. Default TRUE. |
Statistical divergence between discrete probability measures.
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_bhattacharyya(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_bhattacharyya(ref, sim)
Calculate Calinski-Harabasz Index (CH)
calc_calinski_harabasz(data, cluster_labels)calc_calinski_harabasz(data, cluster_labels)
data |
Matrix with features in rows, cells in columns. |
cluster_labels |
Cluster assignments. |
Calinski-Harabasz index.
data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 5)) dist_mat <- stats::dist(data) calc_calinski_harabasz(data, cl)data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 5)) dist_mat <- stats::dist(data) calc_calinski_harabasz(data, cl)
Evaluates the deviation and goodness-of-fit of single-cell clustering labels directly from raw or normalized count matrices without requiring ground-truth cell-type labels (Fang et al., Genome Biology 2022; benchmarked in scDesign3, Song et al., Nat Biotechnol 2024). CDI calculates the penalized log-likelihood (CDI-AIC and CDI-BIC) of count data under a cluster-specific Poisson or Negative Binomial GLM with cell size factors.
calc_cdi( counts, cluster_labels, size_factors = NULL, model = c("poisson", "nb"), top_features = NULL )calc_cdi( counts, cluster_labels, size_factors = NULL, model = c("poisson", "nb"), top_features = NULL )
counts |
Matrix or data.frame of counts (genes x cells or cells x genes). |
cluster_labels |
Vector of cluster assignments for each cell. |
size_factors |
Optional numeric vector of cell-specific size factors. If NULL, computed as library size scaled by median library size. |
model |
Distribution model to use: "poisson" (fast, default) or "nb" (Negative Binomial). |
top_features |
Optional integer; if set, restricts CDI calculation to the top most variable features to accelerate computation on large matrices. |
A list containing:
cdi_aic |
Normalized CDI score based on AIC penalty (lower indicates better clustering). |
cdi_bic |
Normalized CDI score based on BIC penalty (favors parsimonious main clusters). |
loglik |
Total log-likelihood under the cluster-specific count model. |
deviance |
Model deviance relative to saturated count model. |
n_clusters |
Number of clusters evaluated. |
n_params |
Number of free parameters in the clustering model. |
data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_cdi(data, cl)data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_cdi(data, cl)
Integrated from scCluBench (Xu et al., AAAI 2026). Aligns predicted clusters to ground truth classes using the Hungarian bipartite matching algorithm, then computes the fraction of correctly mapped cells.
calc_clustering_accuracy(pred, truth)calc_clustering_accuracy(pred, truth)
pred |
Vector of predicted cluster labels. |
truth |
Vector of ground truth cell type labels. |
Clustering accuracy between 0 and 1.
pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_clustering_accuracy(pred, truth)pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_clustering_accuracy(pred, truth)
Tests the hypothesis that group-specific distance distributions of k-nearest neighbor cells have the same underlying unspecified distribution. Computes cell-specific p-values via Anderson-Darling tests (if kSamples installed) or two-sample Kolmogorov-Smirnov / Kruskal-Wallis tests, with optional delegation to CellMixS::cms.
calc_cms( data = NULL, batch_info, k = NULL, n_pcs = 30, coords = NULL, cell_min = 4, unbalanced = FALSE )calc_cms( data = NULL, batch_info, k = NULL, n_pcs = 30, coords = NULL, cell_min = 4, unbalanced = FALSE )
data |
Count or log-normalized expression matrix (features x cells) or NULL if coords provided. |
batch_info |
Factor or character vector of batch assignments for each cell. |
k |
Neighborhood size k for k-NN graph. Default is min(table(batch_info))/2 or 30. |
n_pcs |
Number of principal components to compute if coords is NULL. Default is 30. |
coords |
Optional precomputed embedding matrix (cells x dimensions, e.g. PCA or UMAP). |
cell_min |
Minimum number of cells per batch in neighborhood to perform test. Default is 4. |
unbalanced |
Logical, whether to set pure neighborhoods to NA. Default is FALSE. |
A named list:
cms_scores |
Numeric vector of CMS p-values for each cell (higher means better mixed) |
mean_cms |
Mean CMS score across cells |
median_cms |
Median CMS score across cells |
coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_cms(coords, batch)coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_cms(coords, batch)
Automatically discovers or evaluates co-expression modules and measures the preservation of intra-module vs. inter-module correlation structure.
calc_coexpression_module_fidelity( ref_mat, sim_mat, modules = NULL, n_modules = 5, top_genes = 200 )calc_coexpression_module_fidelity( ref_mat, sim_mat, modules = NULL, n_modules = 5, top_genes = 200 )
ref_mat |
Reference gene expression matrix (genes x cells). |
sim_mat |
Simulated gene expression matrix (genes x cells). |
modules |
Optional named list of gene modules. If NULL, auto-detected via hierarchical clustering. |
n_modules |
Number of modules to detect if modules is NULL (default 5). |
top_genes |
Number of top variable genes to consider for clustering (default 200). |
A list summarizing module correlation preservation, RMSE, and modularity ratio fidelity.
data(example_scrna, package = "scSimEval") calc_coexpression_module_fidelity(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") calc_coexpression_module_fidelity(example_scrna$ref, example_scrna$sim)
Calculate Completeness Score
calc_completeness(pred, truth)calc_completeness(pred, truth)
pred |
Vector of predicted cluster labels. |
truth |
Vector of ground truth cell type labels. |
Completeness score between 0 and 1.
pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_completeness(pred, truth)pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_completeness(pred, truth)
Calculate Cluster Connectivity
calc_connectivity(dist_mat, cluster_labels)calc_connectivity(dist_mat, cluster_labels)
dist_mat |
Distance matrix or numeric matrix. |
cluster_labels |
Cluster assignments. |
Connectivity metric.
data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_connectivity(dist_mat, cl)data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_connectivity(dist_mat, cl)
Evaluates the preservation of co-regulated gene/feature modules between reference and simulated multi-omics datasets (Monzo et al., 2025; Arzalluz-Luque et al., 2022).
calc_coregulation_fidelity( ref_data, sim_data, modules, method = c("pearson", "spearman") )calc_coregulation_fidelity( ref_data, sim_data, modules, method = c("pearson", "spearman") )
ref_data |
Reference feature-by-cell matrix or data frame. |
sim_data |
Simulated feature-by-cell matrix or data frame. |
modules |
A list of character vectors representing feature clusters/modules, or a named vector/factor of module assignments per feature. |
method |
Correlation method: "pearson" (default) or "spearman". |
A list containing module correlation r, RMSE, MAE, and modularity fidelity.
data(example_scrna, package = "scSimEval") modules <- list(Module_1 = rownames(example_scrna$ref)[seq_len(30)], Module_2 = rownames(example_scrna$ref)[31:60]) calc_coregulation_fidelity(example_scrna$ref, example_scrna$sim, modules)data(example_scrna, package = "scSimEval") modules <- list(Module_1 = rownames(example_scrna$ref)[seq_len(30)], Module_2 = rownames(example_scrna$ref)[31:60]) calc_coregulation_fidelity(example_scrna$ref, example_scrna$sim, modules)
Evaluates the biological accuracy and reconstruction fidelity of cross-modality generation (e.g. predicting scATAC from scRNA or vice versa; Zhai et al., Genome Biology 2024). Computes cell-wise and feature-wise Pearson and Spearman correlations, cosine similarity, RMSE, and MAE between predicted and measured multi-omics profiles.
calc_cross_modal_generation(true_data, pred_data)calc_cross_modal_generation(true_data, pred_data)
true_data |
Matrix or data.frame of measured features across cells (features x cells). |
pred_data |
Matrix or data.frame of in-silico generated / predicted features (features x cells). |
A list containing cell-wise and feature-wise correlation, cosine similarity, RMSE, and MAE.
data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac calc_cross_modal_generation(r_rna, r_atac)data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac calc_cross_modal_generation(r_rna, r_atac)
Evaluates whether cross-modality feature relationships (e.g. peak-to-gene links, promoter accessibility vs. gene expression, or mRNA vs. surface protein) are accurately captured by the simulation method compared to the empirical reference.
calc_cross_modality_correlation( ref_mod1, ref_mod2, sim_mod1, sim_mod2, feature_pairs = NULL, method = c("spearman", "pearson") )calc_cross_modality_correlation( ref_mod1, ref_mod2, sim_mod1, sim_mod2, feature_pairs = NULL, method = c("spearman", "pearson") )
ref_mod1 |
Reference matrix for Modality 1 (features x cells). |
ref_mod2 |
Reference matrix for Modality 2 (features x cells). |
sim_mod1 |
Simulated matrix for Modality 1. |
sim_mod2 |
Simulated matrix for Modality 2. |
feature_pairs |
Optional 2-column data.frame/matrix of paired feature names/indices. |
method |
Correlation method: "spearman" (default) or "pearson". |
A named list of the 7 univariate accuracy metrics comparing the reference vs. simulated cross-modality correlation distributions.
data(example_multiomics, package = "scSimEval") m <- example_multiomics calc_cross_modality_correlation(m$ref_multi$rna, m$ref_multi$atac, m$sim_multi$rna, m$sim_multi$atac)data(example_multiomics, package = "scSimEval") m <- example_multiomics calc_cross_modality_correlation(m$ref_multi$rna, m$ref_multi$atac, m$sim_multi$rna, m$sim_multi$atac)
Calculate Davies-Bouldin Index (DB)
calc_davies_bouldin(data, cluster_labels)calc_davies_bouldin(data, cluster_labels)
data |
Matrix with features in rows, cells in columns. |
cluster_labels |
Cluster assignments. |
Davies-Bouldin index (lower is better).
data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 5)) dist_mat <- stats::dist(data) calc_davies_bouldin(data, cl)data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 5)) dist_mat <- stats::dist(data) calc_davies_bouldin(data, cl)
Evaluates the accuracy of cell-type mixture proportion estimation / deconvolution methods between empirical reference and simulated cell populations (Chen et al., Bioinformatics 2021). Can accept precomputed proportion matrices OR cell-type vectors (and optional batch labels) to calculate proportion preservation across batches.
calc_deconvolution_accuracy( true_proportions, estimated_proportions, batch_ref = NULL, batch_sim = NULL )calc_deconvolution_accuracy( true_proportions, estimated_proportions, batch_ref = NULL, batch_sim = NULL )
true_proportions |
Vector, matrix, or data.frame of reference cell-type proportions, or factor/vector of reference cell types. |
estimated_proportions |
Vector, matrix, or data.frame of estimated / simulated cell-type proportions, or factor/vector of simulated cell types. |
batch_ref |
Optional batch labels for reference cells (if true_proportions is a cell-type vector). |
batch_sim |
Optional batch labels for simulated cells (if estimated_proportions is a cell-type vector). |
A list containing RMSE, MAE, Pearson correlation (r), Spearman correlation (rho), Jensen-Shannon Divergence (JSD), and Total Variation Distance (TVD).
data(example_scrna, package = "scSimEval") calc_deconvolution_accuracy(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") calc_deconvolution_accuracy(example_scrna$ref, example_scrna$sim)
Measures the difference in gene expression variance between true biological replicates and cell-shuffled pseudoreplicates (Squair et al., Nature Communications 2021). Positive delta variance indicates that biological replicates have higher inter-individual variability than randomly pooled pseudoreplicates.
calc_delta_variance( counts, replicates, conditions, cell_types = NULL, n_perm = 3 )calc_delta_variance( counts, replicates, conditions, cell_types = NULL, n_perm = 3 )
counts |
Count matrix (features x cells). |
replicates |
Factor of biological replicate / batch assignments for each cell. |
conditions |
Factor of condition or cell-type labels. |
cell_types |
Optional cell type vector to evaluate per cell type or overall. |
n_perm |
Number of permutation shuffles to compute mean pseudoreplicate variance. Default is 3. |
A named list:
delta_variance |
Numeric vector of gene-level delta variance values |
mean_delta_variance |
Mean delta variance across all genes |
median_delta_variance |
Median delta variance across all genes |
data(example_scrna, package = "scSimEval") calc_delta_variance(example_scrna$ref, replicates = example_scrna$batch_info, conditions = example_scrna$cell_types)data(example_scrna, package = "scSimEval") calc_delta_variance(example_scrna$ref, replicates = example_scrna$batch_info, conditions = example_scrna$cell_types)
Calculate Dunn Index
calc_dunn(dist_mat, cluster_labels)calc_dunn(dist_mat, cluster_labels)
dist_mat |
Distance matrix or numeric matrix. |
cluster_labels |
Cluster assignments. |
Dunn index (ratio of smallest inter-cluster to largest intra-cluster distance).
data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_dunn(dist_mat, cl)data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_dunn(dist_mat, cl)
Integrated from countsimQC (Soneson & Robinson). Measures the normalized area between the eCDFs of reference and simulation across the shared support.
calc_ecdf_diffarea(ref, sim)calc_ecdf_diffarea(ref, sim)
ref |
Numeric vector of reference values. |
sim |
Numeric vector of simulated values. |
Normalized area between the two eCDFs.
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_ecdf_diffarea(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_ecdf_diffarea(ref, sim)
Integrated from HelenaLC/simulation-comparison.
Computes 2D bivariate density via MASS::kde2d over a shared bounding box, then measures optimal transport distance via emdist::emd2d.
calc_emd_2d(ref_mat, sim_mat, n = 25)calc_emd_2d(ref_mat, sim_mat, n = 25)
ref_mat |
2-column numeric matrix for reference. |
sim_mat |
2-column numeric matrix for simulation. |
n |
Grid resolution for 2D density estimation. Default is 25. |
Normalized 2D Earth Mover's Distance.
ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_emd_2d(ref, sim)ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_emd_2d(ref, sim)
Calculates the posterior probability of zero counts being technical dropouts (excess zeros) versus biological sampling zeros under a Negative Binomial model.
calc_excess_zero_weights(counts)calc_excess_zero_weights(counts)
counts |
Count matrix (genes x cells). |
A list with mean excess zero weight, gene-level weights, and estimated zero-inflation rate.
data(example_scrna, package = "scSimEval") calc_excess_zero_weights(example_scrna$ref)data(example_scrna, package = "scSimEval") calc_excess_zero_weights(example_scrna$ref)
Integrated from simpipe.
calc_fasano_franceschini(ref_mat, sim_mat, threads = 1)calc_fasano_franceschini(ref_mat, sim_mat, threads = 1)
ref_mat |
2-column numeric matrix for reference. |
sim_mat |
2-column numeric matrix for simulation. |
threads |
CPU threads. Default 1. |
Estimated 2D KS statistic.
ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_fasano_franceschini(ref, sim)ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_fasano_franceschini(ref, sim)
Integrated from scCluBench (Xu et al., AAAI 2026). Computes the geometric mean of pairwise cluster precision and recall.
calc_fmi(pred, truth)calc_fmi(pred, truth)
pred |
Vector of predicted cluster labels. |
truth |
Vector of ground truth cell type labels. |
FMI score between 0 and 1.
pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_fmi(pred, truth)pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_fmi(pred, truth)
Computes the Fraction of Samples Closer Than The True Match (FOSCTTM) to quantify cell alignment error across single-cell multi-omics modalities in a shared latent or integrated space (Zhai et al., Genome Biology 2024; Liu et al., Nat Biotechnol 2023). A score of 0 represents perfect alignment (where the true paired cell is the nearest neighbor), while 0.5 corresponds to random chance.
calc_foscttm(x, y, metric = c("euclidean", "cosine"))calc_foscttm(x, y, metric = c("euclidean", "cosine"))
x |
Coordinates matrix for Modality 1 (cells x dimensions). |
y |
Coordinates matrix for Modality 2 (cells x dimensions), where row i of y corresponds to the true match of row i of x. |
metric |
Distance metric to evaluate: "euclidean" (default) or "cosine". |
A list containing:
foscttm |
Bidirectional mean FOSCTTM score across all cells (lower is better, 0 to 0.5). |
foscttm_xy |
Directional FOSCTTM from Modality 1 to Modality 2. |
foscttm_yx |
Directional FOSCTTM from Modality 2 to Modality 1. |
match_at_1 |
Top-1 match rate (proportion of cells where the true match is rank 1). |
match_at_5 |
Top-5 match rate (proportion of cells where the true match is in top 5). |
cell_foscttm |
Vector of bidirectional FOSCTTM scores for individual cells. |
data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac calc_foscttm(r_rna, r_atac)data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac calc_foscttm(r_rna, r_atac)
Computes the single-cell analogue of Frechet Inception Distance (FID) on low-dimensional PCA embeddings between reference and simulated cell populations.
calc_frechet_singlecell_distance( ref_mat, sim_mat, cells_as_cols = TRUE, n_pcs = 15, max_features = 2000 )calc_frechet_singlecell_distance( ref_mat, sim_mat, cells_as_cols = TRUE, n_pcs = 15, max_features = 2000 )
ref_mat |
Matrix of reference cells (cells x features or features x cells). |
sim_mat |
Matrix of simulated cells (cells x features or features x cells). |
cells_as_cols |
Logical, whether cells are columns (default TRUE). |
n_pcs |
Number of principal components to evaluate (default 15). |
max_features |
Number of top variable features to retain (default 2000). |
A list with Frechet distance (FSD), mean discrepancy, and covariance trace discrepancy.
ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_frechet_singlecell_distance(ref, sim)ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_frechet_singlecell_distance(ref, sim)
Evaluates the realism (Precision) and coverage/diversity (Recall) of generated single-cell distributions relative to empirical reference data using k-NN hyperspheres.
calc_generative_precision_recall( ref_mat, sim_mat, cells_as_cols = TRUE, k = 5, max_cells = 500, max_features = 1000 )calc_generative_precision_recall( ref_mat, sim_mat, cells_as_cols = TRUE, k = 5, max_cells = 500, max_features = 1000 )
ref_mat |
Matrix of reference cells (cells x features or features x cells). |
sim_mat |
Matrix of simulated cells (cells x features or features x cells). |
cells_as_cols |
Logical, whether cells are columns (default TRUE). |
k |
Number of nearest neighbors to define the local manifold radius (default 5). |
max_cells |
Maximum number of cells to subsample (default 500). |
max_features |
Maximum number of features to retain for speed (default 1000). |
A list containing Generative Precision, Generative Recall, and Generative F1.
data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_generative_precision_recall(data, cl)data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_generative_precision_recall(data, cl)
Calculate Homogeneity Score
calc_homogeneity(pred, truth)calc_homogeneity(pred, truth)
pred |
Vector of predicted cluster labels. |
truth |
Vector of ground truth cell type labels. |
Homogeneity score between 0 and 1.
pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_homogeneity(pred, truth)pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_homogeneity(pred, truth)
Integrated from scCluBench (Xu et al., AAAI 2026).
calc_homogeneity_completeness_v_measure(pred, truth, beta = 1)calc_homogeneity_completeness_v_measure(pred, truth, beta = 1)
pred |
Vector of predicted cluster labels. |
truth |
Vector of ground truth cell type labels. |
beta |
Weight of completeness vs. homogeneity (default 1). |
A named list containing homogeneity, completeness, and v_measure.
pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_homogeneity_completeness_v_measure(pred, truth)pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_homogeneity_completeness_v_measure(pred, truth)
Computes the one-way random effects Intraclass Correlation Coefficient (ICC) per gene across donors or biological replicates to quantify hierarchical clustering.
calc_intraclass_correlation(counts, donor_labels, n_genes = 200)calc_intraclass_correlation(counts, donor_labels, n_genes = 200)
counts |
Matrix (genes x cells) or SingleCellExperiment. |
donor_labels |
Vector or factor of donor / subject IDs. |
n_genes |
Number of top variable genes to evaluate (default 200). |
A list with median ICC, mean ICC, and vector of per-gene ICC values.
data(example_scrna, package = "scSimEval") calc_intraclass_correlation(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") calc_intraclass_correlation(example_scrna$ref, example_scrna$sim)
Evaluates the diversity of batch labels within each cell's k-nearest neighborhood using the Inverse Simpson Index (1 / sum(p_b^2)). Implements a pure-R, lightweight formulation of LISI with optional distance weighting.
calc_isi(coords, batch_info, k = 30, weighted = TRUE)calc_isi(coords, batch_info, k = 30, weighted = TRUE)
coords |
Matrix of cell coordinates (cells x dimensions). |
batch_info |
Factor or character vector of batch assignments. |
k |
Number of nearest neighbors. Default is 30. |
weighted |
Logical, whether to weight neighbor contributions by inverse distance. Default is TRUE. |
A named list:
isi_scores |
Numeric vector of cell-level ISI values |
mean_isi |
Mean ISI score (ranges from 1 to number of batches; higher indicates better mixing) |
median_isi |
Median ISI score |
coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_isi(coords, batch)coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_isi(coords, batch)
Integrated from simpipe & SimBench.
calc_kde_test(ref_mat, sim_mat)calc_kde_test(ref_mat, sim_mat)
ref_mat |
2-column numeric matrix for reference. |
sim_mat |
2-column numeric matrix for simulation. |
z-statistic testing discrepancy between bivariate kernel density estimates.
ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_kde_test(ref, sim)ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_kde_test(ref, sim)
Decomposes gene expression variance / squared coefficient of variation (CV^2) into intrinsic transcriptional bursting noise and extrinsic cell-state noise.
calc_kinetic_noise_decomposition(counts, cell_states = NULL)calc_kinetic_noise_decomposition(counts, cell_states = NULL)
counts |
Matrix of expression counts (genes x cells) or SingleCellExperiment. |
cell_states |
Optional factor or vector of cell states / subpopulation clusters. If provided, noise is partitioned into within-state (intrinsic) and between-state (extrinsic) components. If NULL, intrinsic noise is estimated via Poisson shot-noise expectation (1 / mean). |
A list containing mean intrinsic noise, mean extrinsic noise, noise ratio, and gene-level vectors.
data(example_scrna, package = "scSimEval") calc_kinetic_noise_decomposition(example_scrna$ref)data(example_scrna, package = "scSimEval") calc_kinetic_noise_decomposition(example_scrna$ref)
Calculate Kolmogorov-Smirnov Distance (1D KS)
calc_ks(ref, sim)calc_ks(ref, sim)
ref |
Numeric vector of reference values. |
sim |
Numeric vector of simulated values. |
Maximum vertical distance between empirical CDFs (between 0 and 1).
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_ks(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_ks(ref, sim)
Computes the Local Density Estimate (LDE) and Local Density Factor (LDF) using a Gaussian kernel over reachability distances in the k-NN neighborhood, adapted from Latecki et al. and CellMixS.
calc_ldf(coords, k = 15, h = 1, c = 1)calc_ldf(coords, k = 15, h = 1, c = 1)
coords |
Matrix of coordinates / embeddings (cells x dimensions). |
k |
Number of nearest neighbors. Default is 15. |
h |
Bandwidth parameter for Gaussian kernel. Default is 1. |
c |
Scaling constant for comparison of LDE to neighboring observations. Default is 1. |
A named list:
lde |
Local density estimate for each cell |
ldf |
Local density factor for each cell |
coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_ldf(coords)coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_ldf(coords)
Quantifies cell-specific changes in the Local Density Factor (LDF) before and after data integration or between reference and simulated datasets.
calc_ldf_diff(coords_pre, coords_post, k = 15, h = 1, c = 1)calc_ldf_diff(coords_pre, coords_post, k = 15, h = 1, c = 1)
coords_pre |
Matrix of coordinates before integration / reference (cells x dimensions). |
coords_post |
Matrix of coordinates after integration / simulated (cells x dimensions). |
k |
Number of nearest neighbors. Default is 15. |
h |
Bandwidth parameter for Gaussian kernel. Default is 1. |
c |
Scaling constant. Default is 1. |
A named list:
diff |
Numeric vector of absolute LDF differences per cell |
mean_ldf_diff |
Mean absolute LDF difference (lower indicates better structure preservation) |
median_ldf_diff |
Median absolute LDF difference |
ldf_pre |
LDF in pre-integration / reference space |
ldf_post |
LDF in post-integration / simulated space |
coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_ldf_diff(coords, coords)coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_ldf_diff(coords, coords)
Direct port and generalization of scDesign3::perform_lrt (Song et al., Nat Biotechnol 2024).
Performs the likelihood ratio test to compare two nested simulation models (e.g., cell-type/covariate
model vs intercept-only null model, or spline trajectory vs linear model).
calc_likelihood_ratio_test( alter_model, null_model, df_alter = NULL, df_null = NULL )calc_likelihood_ratio_test( alter_model, null_model, df_alter = NULL, df_null = NULL )
alter_model |
Alternative model (more complex) or list of alternative models per gene, or numeric log-likelihoods. |
null_model |
Null model (simpler, strictly nested) or list of null models per gene, or numeric log-likelihoods. |
df_alter |
Degrees of freedom for alternative model (used if models are numeric log-likelihoods). |
df_null |
Degrees of freedom for null model (used if models are numeric log-likelihoods). |
A data.frame containing:
LogLik_alter |
Log-likelihood under alternative model. |
LogLik_null |
Log-likelihood under null model. |
df_alter |
Degrees of freedom of alternative model. |
df_null |
Degrees of freedom of null model. |
LR_statistic |
Likelihood ratio statistic (-2 * (LL_null - LL_alter)). |
delta_df |
Difference in degrees of freedom (df_alter - df_null). |
p_value |
P-value from chi-squared test with delta_df degrees of freedom. |
calc_likelihood_ratio_test(stats::rnorm(50), stats::rnorm(50))calc_likelihood_ratio_test(stats::rnorm(50), stats::rnorm(50))
Calculates the proportion of overlapping k-nearest neighbors between an original/reference embedding and an integrated/simulated embedding (adapted from Seurat LocalStruct and CellMixS locStructure).
calc_local_structure_metric(coords_pre, coords_post, k = 30)calc_local_structure_metric(coords_pre, coords_post, k = 30)
coords_pre |
Matrix of coordinates before integration / reference (cells x dimensions). |
coords_post |
Matrix of coordinates after integration / simulated (cells x dimensions). |
k |
Number of nearest neighbors. Default is 30. |
A named list:
cell_overlaps |
Numeric vector of overlap fractions per cell |
mean_local_structure |
Mean overlap fraction across cells (higher indicates better preservation) |
median_local_structure |
Median overlap fraction |
coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_local_structure_metric(coords, coords)coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_local_structure_metric(coords, coords)
Calculate Median Absolute Deviation (MAD)
calc_mad(ref, sim, align = TRUE)calc_mad(ref, sim, align = TRUE)
ref |
Numeric vector of reference distribution. |
sim |
Numeric vector of simulated distribution. |
align |
Logical, whether to sort and quantile-align vectors. Default TRUE. |
Numeric MAD value.
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_mad(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_mad(ref, sim)
Calculate Mean Absolute Error (MAE)
calc_mae(ref, sim, align = TRUE)calc_mae(ref, sim, align = TRUE)
ref |
Numeric vector of reference values. |
sim |
Numeric vector of simulated values. |
align |
Logical, whether to sort and quantile-align vectors. Default TRUE. |
Mean absolute difference.
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_mae(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_mae(ref, sim)
Evaluates gene-wise and aggregate marginal goodness-of-fit (Poisson, Negative Binomial, or Gaussian) for simulated or fitted single-cell count matrices, computing total and mean AIC and BIC across genes (scDesign3; Song et al., 2024).
calc_marginal_aic_bic( counts, fitted_means, dispersions = NULL, distribution = c("poisson", "nb", "gaussian"), n_params_per_gene = NULL )calc_marginal_aic_bic( counts, fitted_means, dispersions = NULL, distribution = c("poisson", "nb", "gaussian"), n_params_per_gene = NULL )
counts |
Matrix or data.frame of observed or simulated counts (genes x cells). |
fitted_means |
Matrix or data.frame of model fitted means or expectations (genes x cells). |
dispersions |
Optional vector of gene-level dispersion parameters for Negative Binomial model. If NULL, estimated via method-of-moments. |
distribution |
Parametric distribution: "poisson", "nb" (Negative Binomial), or "gaussian". |
n_params_per_gene |
Number of estimated parameters per gene. If NULL, defaults to 1 for Poisson, 2 for NB, and 2 for Gaussian. |
A list containing:
total_loglik |
Sum of marginal log-likelihoods across all genes and cells. |
total_aic |
Aggregate AIC across all genes. |
total_bic |
Aggregate BIC across all genes. |
mean_gene_aic |
Mean AIC per gene. |
mean_gene_bic |
Mean BIC per gene. |
gene_loglik |
Vector of log-likelihoods per gene. |
gene_aic |
Vector of AIC per gene. |
gene_bic |
Vector of BIC per gene. |
calc_marginal_aic_bic(stats::rnorm(50), stats::rnorm(50))calc_marginal_aic_bic(stats::rnorm(50), stats::rnorm(50))
Evaluates the distributional discrepancy between empirical reference and generated/simulated single-cell high-dimensional profiles or latent embeddings.
calc_mmd( ref_mat, sim_mat, cells_as_cols = TRUE, sigma = NULL, max_cells = 500, max_features = 1000 )calc_mmd( ref_mat, sim_mat, cells_as_cols = TRUE, sigma = NULL, max_cells = 500, max_features = 1000 )
ref_mat |
Matrix of reference cells (cells x features or features x cells). |
sim_mat |
Matrix of simulated cells (cells x features or features x cells). |
cells_as_cols |
Logical, whether cells are columns. If TRUE (default for scRNA-seq), the matrix is transposed so rows represent cells. |
sigma |
Optional kernel bandwidth. If NULL, uses the median pairwise distance heuristic. |
max_cells |
Maximum number of cells to subsample for speed (default 500). |
max_features |
Maximum number of features to retain for speed (default 1000). |
A list with MMD, squared MMD, and the kernel bandwidth sigma used.
ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_mmd(ref, sim)ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_mmd(ref, sim)
Quantifies how well different single-cell omics layers mix in a unified latent embedding space without sacrificing biological clustering (Zhai et al., Genome Biology 2024; Luecken et al., Nat Methods 2022).
calc_modality_alignment(embedding, modalities, cell_types = NULL, k = 15)calc_modality_alignment(embedding, modalities, cell_types = NULL, k = 15)
embedding |
Joint coordinates matrix (cells x latent_dimensions). |
modalities |
Factor or character vector indicating the modality of each cell (e.g. "RNA" vs "ATAC"). |
cell_types |
Optional factor or character vector of cell type labels. |
k |
Number of nearest neighbors for neighborhood connectivity calculation (default 15). |
A list containing modality_asw, modality_mixing_score, and mean_cross_modality_neighbor_frac.
data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac calc_modality_alignment(rbind(t(r_rna[seq_len(10),]), t(r_atac[seq_len(10),])), rep(c("RNA","ATAC"), each=ncol(r_rna)))data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac calc_modality_alignment(rbind(t(r_rna[seq_len(10),]), t(r_atac[seq_len(10),])), rep(c("RNA","ATAC"), each=ncol(r_rna)))
Evaluates the statistical trade-off between model fit and parameter complexity for single-cell generative models as benchmarked in scDesign3 (Song et al., Nat Biotechnol 2024).
calc_model_aic_bic(loglik, n_params, n_obs)calc_model_aic_bic(loglik, n_params, n_obs)
loglik |
Numeric vector or scalar of log-likelihood values. |
n_params |
Numeric vector or scalar of number of estimated parameters (degrees of freedom). |
n_obs |
Total number of independent observations (cells or cell-gene pairs). |
A named vector or data.frame containing loglik, n_params, n_obs, AIC, and BIC.
calc_model_aic_bic(-100, 5, 100)calc_model_aic_bic(-100, 5, 100)
Integrated from simPIC (Chugh et al., 2024; bluster::neighborPurity). For each cell, evaluates the proportion of its k-nearest neighbors that share the same cluster or cell-type identity.
calc_neighborhood_purity(data, cluster_labels, k = NULL, is_distance = FALSE)calc_neighborhood_purity(data, cluster_labels, k = NULL, is_distance = FALSE)
data |
Matrix of coordinates (cells x dimensions) or expression matrix (features x cells) or dist matrix. |
cluster_labels |
Vector of cluster or cell-type labels. |
k |
Number of nearest neighbors (default 5% of cells). |
is_distance |
Logical, whether data is already a distance matrix. Default FALSE. |
A numeric vector of neighborhood purity scores (values from 0 to 1), with an attribute "mean_purity" containing the overall average.
data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_neighborhood_purity(data, cl)data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_neighborhood_purity(data, cl)
Computes the Jaccard similarity index of top-k edge predictions between two networks or top correlated feature pairs between reference and simulated datasets.
calc_network_jaccard(edges1, edges2, k = NULL, directed = TRUE)calc_network_jaccard(edges1, edges2, k = NULL, directed = TRUE)
edges1 |
Data frame or character vector representing the first network. |
edges2 |
Data frame or character vector representing the second network. |
k |
Integer cutoff for top edge selection (optional). |
directed |
Logical, whether edges are directed (default TRUE) or undirected (FALSE). |
Jaccard similarity index in [0, 1] (|E1 cap E2| / |E1 cup E2|).
calc_network_jaccard(data.frame(from = c("g1", "g2"), to = c("g2", "g3")), data.frame(from = c("g1", "g2"), to = c("g2", "g3")))calc_network_jaccard(data.frame(from = c("g1", "g2"), to = c("g2", "g3")), data.frame(from = c("g1", "g2"), to = c("g2", "g3")))
Calculate Normalized Mutual Information (NMI)
calc_nmi(pred, truth)calc_nmi(pred, truth)
pred |
Predicted cluster labels. |
truth |
Ground truth cell type labels. |
NMI value between 0 and 1.
pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_nmi(pred, truth)pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_nmi(pred, truth)
Integrated from countsimQC (Soneson & Robinson). Evaluates whether the dataset label composition in k-NN neighborhoods departs significantly from the overall global dataset proportion using Chi-squared tests. Works for both 1D numeric vectors and 2D matrices.
calc_nn_mismatch(ref, sim, k = NULL, subsample_size = 300)calc_nn_mismatch(ref, sim, k = NULL, subsample_size = 300)
ref |
Vector or matrix for reference dataset. |
sim |
Vector or matrix for simulated dataset. |
k |
Number of nearest neighbors (default max(5, 0.05 * N)). |
subsample_size |
Number of subsampled points to test (default 300). |
Fraction of points with significant neighbor composition mismatch (p <= 0.05).
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_nn_mismatch(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_nn_mismatch(ref, sim)
Uses the standard Tukey 1.5 * IQR criterion on quantiles, as used in simpipe.
calc_outlier_proportion(x)calc_outlier_proportion(x)
x |
Numeric vector. |
Outlier proportion (between 0 and 1).
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_outlier_proportion(ref)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_outlier_proportion(ref)
Calculate Distribution Overlapping Index (OV)
calc_overlap(ref, sim)calc_overlap(ref, sim)
ref |
Numeric vector of reference values. |
sim |
Numeric vector of simulated values. |
Area of overlap under probability densities (0 to 1).
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_overlap(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_overlap(ref, sim)
Integrated from HelenaLC/simulation-comparison.
calc_peacock_2d(ref_mat, sim_mat)calc_peacock_2d(ref_mat, sim_mat)
ref_mat |
2-column numeric matrix for reference. |
sim_mat |
2-column numeric matrix for simulation. |
Peacock test statistic.
ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_peacock_2d(ref, sim)ref <- matrix(stats::rnorm(100), 50, 2) sim <- matrix(stats::rnorm(100), 50, 2) calc_peacock_2d(ref, sim)
Evaluates the preservation of chromatin peak-to-peak co-accessibility correlation matrices (cis-regulatory interactions) between reference and simulated scATAC-seq datasets.
calc_peak_coaccessibility_fidelity( ref_atac, sim_atac, top_n_peaks = 300, method = c("spearman", "pearson") )calc_peak_coaccessibility_fidelity( ref_atac, sim_atac, top_n_peaks = 300, method = c("spearman", "pearson") )
ref_atac |
Reference scATAC-seq matrix (peaks x cells). |
sim_atac |
Simulated scATAC-seq matrix (peaks x cells). |
top_n_peaks |
Number of highest variance peaks to evaluate (default 300). |
method |
Correlation method: "spearman" (default) or "pearson". |
A list containing RV coefficient, matrix correlation, Frobenius distance, and MAE.
data(example_scrna, package = "scSimEval") calc_peak_coaccessibility_fidelity(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") calc_peak_coaccessibility_fidelity(example_scrna$ref, example_scrna$sim)
Evaluates whether the relative cell-to-cell ordering along a differentiation trajectory is preserved between reference and simulated data. Accepts either precomputed pseudotime vectors OR scRNA-seq expression matrices (which will be automatically inferred via PCA trajectory).
calc_pseudotime_correlation( ref_pseudotime, sim_pseudotime, method = c("spearman", "pearson") )calc_pseudotime_correlation( ref_pseudotime, sim_pseudotime, method = c("spearman", "pearson") )
ref_pseudotime |
Numeric vector of reference pseudotimes OR reference count matrix (genes x cells). |
sim_pseudotime |
Numeric vector of simulated pseudotimes OR simulated count matrix (genes x cells). |
method |
Correlation method: "spearman" (default) or "pearson". |
Correlation coefficient between reference and simulated pseudotime trajectories.
data(example_scrna, package = "scSimEval") calc_pseudotime_correlation(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") calc_pseudotime_correlation(example_scrna$ref, example_scrna$sim)
Calculate Root Mean Squared Error (RMSE)
calc_rmse(ref, sim, align = TRUE)calc_rmse(ref, sim, align = TRUE)
ref |
Numeric vector of reference values. |
sim |
Numeric vector of simulated values. |
align |
Logical, whether to sort and quantile-align vectors. Default TRUE. |
Quadratic error penalizing large discrepancies.
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_rmse(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_rmse(ref, sim)
Integrated from countsimQC (Soneson & Robinson). Tests whether values from the two datasets intermingle randomly when sorted. A significant left-sided result indicates that identical values cluster together into fewer runs than expected by chance, signaling distinct distributions.
calc_runs_test(ref, sim, alternative = c("left.sided", "two.sided"))calc_runs_test(ref, sim, alternative = c("left.sided", "two.sided"))
ref |
Numeric vector of reference values. |
sim |
Numeric vector of simulated values. |
alternative |
Alternative hypothesis: "left.sided" (default in countsimQC) or "two.sided". |
A named list with the runs test statistic and p-value.
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_runs_test(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_runs_test(ref, sim)
Calculates the mixing metric originally proposed in Seurat (Stuart et al., Cell 2019) and adapted by CellMixS. For each cell, finds the rank of the k_pos-th neighbor from each batch in the sorted neighborhood, and computes the median rank across batches.
calc_seurat_mixing_metric(coords, batch_info, k = 300, k_pos = 5)calc_seurat_mixing_metric(coords, batch_info, k = 300, k_pos = 5)
coords |
Matrix of cell coordinates (cells x dimensions). |
batch_info |
Factor or character vector of batch assignments. |
k |
Maximum neighborhood size to search. Default is 300. |
k_pos |
The rank position to extract per batch. Default is 5. |
A named list:
mixing_metrics |
Numeric vector of median ranks per cell |
mean_mixing_metric |
Mean mixing rank (lower indicates better mixing) |
median_mixing_metric |
Median mixing rank |
coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_seurat_mixing_metric(coords, batch)coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) calc_seurat_mixing_metric(coords, batch)
Detect Bimodal Distribution (BD) Genes (Bimodal Separation Index)
calc_signal_bd(exprs_mat, cell_types)calc_signal_bd(exprs_mat, cell_types)
exprs_mat |
Matrix (genes x cells). |
cell_types |
Factor of 2 cell types. |
Numeric vector of Bimodality Index values.
data(example_scrna, package = "scSimEval") calc_signal_bd(example_scrna$ref, example_scrna$cell_types)data(example_scrna, package = "scSimEval") calc_signal_bd(example_scrna$ref, example_scrna$cell_types)
Detect Differential Distribution (DD) Genes (Kolmogorov-Smirnov Test)
calc_signal_dd(exprs_mat, cell_types)calc_signal_dd(exprs_mat, cell_types)
exprs_mat |
Log-normalized matrix (genes x cells). |
cell_types |
Factor of 2 cell types. |
Vector of adjusted p-values.
data(example_scrna, package = "scSimEval") calc_signal_dd(example_scrna$ref, example_scrna$cell_types)data(example_scrna, package = "scSimEval") calc_signal_dd(example_scrna$ref, example_scrna$cell_types)
Detect Differential Expression (DE) Genes (Mean Shift via Limma or T-Test)
calc_signal_de(exprs_mat, cell_types, p_sig = 0.05)calc_signal_de(exprs_mat, cell_types, p_sig = 0.05)
exprs_mat |
Log-normalized matrix (genes x cells). |
cell_types |
Factor or binary vector of 2 cell types. |
p_sig |
Significance threshold (default 0.05). |
Vector of adjusted p-values.
data(example_scrna, package = "scSimEval") calc_signal_de(example_scrna$ref, example_scrna$cell_types)data(example_scrna, package = "scSimEval") calc_signal_de(example_scrna$ref, example_scrna$cell_types)
Detect Differential Proportion / Zero-Inflation (DP) Genes (Chisq Test)
calc_signal_dp(exprs_mat, cell_types, threshold = 0)calc_signal_dp(exprs_mat, cell_types, threshold = 0)
exprs_mat |
Count or expression matrix (genes x cells). |
cell_types |
Factor of 2 cell types. |
threshold |
Value threshold for zero/detection status (default 0). |
Vector of adjusted p-values.
data(example_scrna, package = "scSimEval") calc_signal_dp(example_scrna$ref, example_scrna$cell_types)data(example_scrna, package = "scSimEval") calc_signal_dp(example_scrna$ref, example_scrna$cell_types)
Detect Differential Variability (DV) Genes (Bartlett Test)
calc_signal_dv(exprs_mat, cell_types)calc_signal_dv(exprs_mat, cell_types)
exprs_mat |
Log-normalized matrix (genes x cells). |
cell_types |
Factor of 2 cell types. |
Vector of adjusted p-values.
data(example_scrna, package = "scSimEval") calc_signal_dv(example_scrna$ref, example_scrna$cell_types)data(example_scrna, package = "scSimEval") calc_signal_dv(example_scrna$ref, example_scrna$cell_types)
Calculate Average Silhouette Width (ASW)
calc_silhouette(dist_mat, cluster_labels)calc_silhouette(dist_mat, cluster_labels)
dist_mat |
Distance matrix among cells or numeric matrix (features x cells). |
cluster_labels |
Vector of cluster or cell-type labels. |
Mean silhouette width.
data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_silhouette(dist_mat, cl)data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 10)) dist_mat <- stats::dist(data) calc_silhouette(dist_mat, cl)
Computes the Root Mean Squared Error (RMSE) between sorted branch heights of
hierarchical lineage trees. Accepts either precomputed hclust objects
OR scRNA-seq count matrices + cell_types (which will be automatically inferred).
calc_tree_height_discrepancy( ref_tree, sim_tree, cell_types_ref = NULL, cell_types_sim = NULL )calc_tree_height_discrepancy( ref_tree, sim_tree, cell_types_ref = NULL, cell_types_sim = NULL )
ref_tree |
Hierarchical clustering ( |
sim_tree |
Hierarchical clustering ( |
cell_types_ref |
Optional cell type labels for reference (if count matrix provided). |
cell_types_sim |
Optional cell type labels for simulation (if count matrix provided). |
Root mean squared error between branch heights.
data(example_scrna, package = "scSimEval") calc_tree_height_discrepancy(example_scrna$ref, example_scrna$sim, cell_types_ref = example_scrna$cell_types, cell_types_sim = example_scrna$cell_types)data(example_scrna, package = "scSimEval") calc_tree_height_discrepancy(example_scrna$ref, example_scrna$sim, cell_types_ref = example_scrna$cell_types, cell_types_sim = example_scrna$cell_types)
Calculate V-Measure
calc_v_measure(pred, truth, beta = 1)calc_v_measure(pred, truth, beta = 1)
pred |
Vector of predicted cluster labels. |
truth |
Vector of ground truth cell type labels. |
beta |
Weight parameter (default 1). |
V-measure score between 0 and 1.
pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_v_measure(pred, truth)pred <- factor(rep(c("A", "B"), each = 20)) truth <- factor(rep(c("A", "B"), each = 20)) calc_v_measure(pred, truth)
Decomposes gene expression variance into biological cell-type heterogeneity, donor / biological replicate variation, and residual technical noise.
calc_variance_decomposition( counts, cell_metadata, donor_col = "donor", celltype_col = "cell_type", n_genes = 200 )calc_variance_decomposition( counts, cell_metadata, donor_col = "donor", celltype_col = "cell_type", n_genes = 200 )
counts |
Matrix or data.frame (genes x cells) or SingleCellExperiment. |
cell_metadata |
Data.frame containing donor and cell-type columns. |
donor_col |
Character, column name for donor/replicate (default "donor"). |
celltype_col |
Character, column name for cell identity (default "cell_type"). |
n_genes |
Number of top variable genes to analyze (default 200). |
A list of mean percentage of variance explained by cell-type, donor, and residual noise.
data(example_scrna, package = "scSimEval") md <- data.frame(donor = example_scrna$batch_info, cell_type = example_scrna$cell_types) calc_variance_decomposition(example_scrna$ref, md)data(example_scrna, package = "scSimEval") md <- data.frame(donor = example_scrna$batch_info, cell_type = example_scrna$cell_types) calc_variance_decomposition(example_scrna$ref, md)
Integrated from HelenaLC/simulation-comparison.
calc_wasserstein_1d(ref, sim, p = 1)calc_wasserstein_1d(ref, sim, p = 1)
ref |
Numeric vector of reference values. |
sim |
Numeric vector of simulated values. |
p |
Power of the Wasserstein metric (default 1 for standard earth mover's distance). |
The 1D Wasserstein distance between the two empirical distributions.
ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_wasserstein_1d(ref, sim)ref <- stats::rnorm(50) sim <- stats::rnorm(50) calc_wasserstein_1d(ref, sim)
Fits an empirical logistic dropout curve: logit(P(Y=0)) = beta_0 + beta_1 * log(mu) to model the dropout relationship with mean expression.
calc_zero_probability_curve(counts)calc_zero_probability_curve(counts)
counts |
Count matrix (genes x cells) or SingleCellExperiment. |
A list containing intercept, slope, midpoint (inflection point), and R-squared.
data(example_scrna, package = "scSimEval") calc_zero_probability_curve(example_scrna$ref)data(example_scrna, package = "scSimEval") calc_zero_probability_curve(example_scrna$ref)
Projects empirical biological reference and simulated count matrices into low-dimensional representations (UMAP, t-SNE, or PCA) for side-by-side and multi-method topological benchmarking. Automatically performs library-size normalization, variance-based feature selection, principal component analysis, and optional unsupervised clustering.
compute_dataset_embeddings( reference, simulated, reduction = c("umap", "tsne", "pca"), n_pcs = 30, perplexity = 30, n_neighbors = 15, min_dist = 0.3, seed = 42, cell_types = NULL, batch = NULL )compute_dataset_embeddings( reference, simulated, reduction = c("umap", "tsne", "pca"), n_pcs = 30, perplexity = 30, n_neighbors = 15, min_dist = 0.3, seed = 42, cell_types = NULL, batch = NULL )
reference |
Biological reference count matrix (features x cells), dgCMatrix, SingleCellExperiment, or Seurat object. |
simulated |
A single simulated count matrix or a named list of simulated count matrices (e.g. |
reduction |
Character string specifying the dimensionality reduction method: |
n_pcs |
Integer specifying the number of principal components to calculate (default: 30). |
perplexity |
Numeric perplexity for t-SNE (default: 30; automatically adapted for small sample sizes). |
n_neighbors |
Integer number of nearest neighbors for UMAP (default: 15). |
min_dist |
Numeric minimum distance parameter for UMAP (default: 0.3). |
seed |
Random seed for reproducibility (default: 42). |
cell_types |
Optional factor or character vector of cell type annotations for reference cells (or named list if per-dataset). |
batch |
Optional factor or character vector of batch annotations. |
A tidy data.frame containing cell coordinates (Dim1, Dim2),
Dataset name, Dataset_Type ("Reference" vs "Simulated"), Cell_Type,
Cluster, Library_Size, Detected_Features, and Batch.
data(example_scrna, package = "scSimEval") emb <- compute_dataset_embeddings( reference = example_scrna$ref, simulated = list("Splatter" = example_scrna$sim), reduction = "umap", cell_types = example_scrna$cell_types ) head(emb)data(example_scrna, package = "scSimEval") emb <- compute_dataset_embeddings( reference = example_scrna$ref, simulated = list("Splatter" = example_scrna$sim), reduction = "umap", cell_types = example_scrna$cell_types ) head(emb)
Computes quantitative cluster separability (Silhouette width), unsupervised cluster recovery (Adjusted Rand Index), and distribution preservation metrics (Mean UMI, Mean detected features, sparsity percentage, and relative percentage error) between reference and simulated datasets.
compute_embedding_quality_metrics( embedding_data, metric_coords = c("Dim1", "Dim2") )compute_embedding_quality_metrics( embedding_data, metric_coords = c("Dim1", "Dim2") )
embedding_data |
A |
metric_coords |
Character vector of the 2 coordinate columns used to compute distances (default: |
A data.frame summarizing quantitative embedding quality metrics for each dataset.
data(example_scrna, package = "scSimEval") emb <- compute_dataset_embeddings( reference = example_scrna$ref, simulated = list("Splatter" = example_scrna$sim), reduction = "umap", cell_types = example_scrna$cell_types ) compute_embedding_quality_metrics(emb)data(example_scrna, package = "scSimEval") emb <- compute_dataset_embeddings( reference = example_scrna$ref, simulated = list("Splatter" = example_scrna$sim), reduction = "umap", cell_types = example_scrna$cell_types ) compute_embedding_quality_metrics(emb)
Computes the overall performance leaderboard ranking simulation methods across all benchmark evaluation metrics. Metrics are first direction-inverted and min-max standardized into fidelity scores in [0, 1] (where 1.0 represents best observed performance). Simulators are then rank-ordered by mean overall fidelity score.
compute_method_leaderboard(benchmark_data)compute_method_leaderboard(benchmark_data)
benchmark_data |
A benchmark data.frame (such as |
A data.frame with columns:
Overall_Rank: Integer rank (1 = top-performing simulator).
Method: Simulator method name.
Average_Fidelity: Formatted percentage string (e.g., "58.5%").
Fidelity_Score: Numeric composite fidelity score in [0, 1] rounded to 4 decimals.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim) lb <- compute_method_leaderboard(res)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim) lb <- compute_method_leaderboard(res)
Compares the non-linear relationship between peak mean accessibility and non-zero proportion (NZP) between reference and simulated scATAC-seq datasets.
evaluate_accessibility_sparsity_curve(ref_data, sim_data, poly_degree = 2)evaluate_accessibility_sparsity_curve(ref_data, sim_data, poly_degree = 2)
ref_data |
Reference count matrix (peaks x cells). |
sim_data |
Simulated count matrix (peaks x cells). |
poly_degree |
Degree of polynomial (default: 2). |
A list of reference and simulated curve parameters, absolute discrepancies, and curve prediction RMSE.
data(example_scrna, package = "scSimEval") evaluate_accessibility_sparsity_curve(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") evaluate_accessibility_sparsity_curve(example_scrna$ref, example_scrna$sim)
Evaluates how realistically simulated technical batches mix or separate, computing kBET, LISI, Batch Silhouette, Shannon Entropy, PC Regression, CMS (Cell-Specific Mixing Score), Inverse Simpson Index (ISI), Seurat Mixing Metric, and optionally Local Density Differences (ldfDiff) and Local Structure Preservation.
evaluate_batch_metrics( data, batch_info, k = NULL, n_pcs = 30, pre_data = NULL, cell_types = NULL, verbose = FALSE )evaluate_batch_metrics( data, batch_info, k = NULL, n_pcs = 30, pre_data = NULL, cell_types = NULL, verbose = FALSE )
data |
Count or log-normalized expression matrix (features x cells). |
batch_info |
Factor or character vector of batch assignments for each cell. |
k |
Neighborhood size k for k-NN graph and mixing metrics. Default is min(table(batch_info))/2. |
n_pcs |
Number of principal components for embedding evaluation. Default is 30. |
pre_data |
Optional matrix of pre-integration / reference expression data (for ldfDiff and local structure). |
cell_types |
Optional factor or character vector of cell types for cross-batch evaluation. |
verbose |
Logical, whether to print progress. |
A named list of batch metrics:
batch_silhouette |
Average silhouette width using batch labels (lower is better mixed) |
shannon_entropy |
Entropy of batch frequencies in local neighborhoods |
pcr_r2 |
Total variance explained by batch in principal components (PCR) |
cms |
Mean Cell-specific mixing score (CellMixS) |
isi |
Mean Inverse Simpson Index for batch mixing (CellMixS) |
seurat_mixing_metric |
Mean Seurat mixing metric (Stuart et al. / CellMixS) |
ldf_diff |
Mean Local Density Factor difference (if pre_data supplied) |
local_structure |
Mean Local structure preservation overlap (if pre_data supplied) |
kbet_rejection |
kBET rejection rate (if kBET installed) |
lisi_batch |
Average batch LISI (if lisi installed) |
cross_batch_accuracy |
Mean cross-batch cell type transfer accuracy (if cell_types supplied) |
cross_batch_F1 |
Mean cross-batch cell type transfer macro F1 (if cell_types supplied) |
data(example_scrna, package = "scSimEval") evaluate_batch_metrics(example_scrna$ref, example_scrna$batch_info, cell_types = example_scrna$cell_types)data(example_scrna, package = "scSimEval") evaluate_batch_metrics(example_scrna$ref, example_scrna$batch_info, cell_types = example_scrna$cell_types)
Evaluates both unsupervised cluster separation (ASW, Dunn, Connectivity, DB, CH, Neighborhood Purity, CDI) and supervised concordance against ground truth labels (Clustering Accuracy ACC, Hungarian F1/Precision/Recall, ARI, NMI, AMI, FMI, Homogeneity, Completeness, V-measure).
evaluate_clustering_metrics( data, cluster_info = NULL, pred_clusters = NULL, dist_mat = NULL, cell_types = NULL, ref_data = NULL )evaluate_clustering_metrics( data, cluster_info = NULL, pred_clusters = NULL, dist_mat = NULL, cell_types = NULL, ref_data = NULL )
data |
Count or normalized matrix (features x cells). |
cluster_info |
Cluster or cell type labels. |
pred_clusters |
Optional predicted cluster labels (if different from ground truth). If NULL, k-means is automatically run. |
dist_mat |
Optional precomputed distance matrix. |
cell_types |
Optional alias for cluster_info. |
ref_data |
Optional reference data to compute reference clustering quality. |
A named list of all clustering metrics.
data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 5)) dist_mat <- stats::dist(data) evaluate_clustering_metrics(data, cl)data <- matrix(stats::rnorm(200), 20, 10) cl <- factor(rep(c("A", "B"), each = 5)) dist_mat <- stats::dist(data) evaluate_clustering_metrics(data, cl)
Evaluates whether simulated or integrated multi-batch single-cell data preserve cell-type identity across distinct experimental batches or donors. Trains a k-NN classifier on each individual batch and tests prediction accuracy and macro F1 score on all other remaining batches.
evaluate_cross_batch_prediction(coords, cell_types, batch_info, k = 5)evaluate_cross_batch_prediction(coords, cell_types, batch_info, k = 5)
coords |
Embedding coordinates (cells x dimensions). |
cell_types |
Factor or character vector of ground-truth cell type labels. |
batch_info |
Factor or character vector of batch assignments. |
k |
Integer number of nearest neighbors for the k-NN classifier (default 5). |
A list containing:
mean_cross_batch_accuracy |
Overall mean classification accuracy across all directed batch pairs |
mean_cross_batch_F1 |
Overall mean macro-averaged F1 score across all directed batch pairs |
coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) ct <- factor(rep(c("TypeA", "TypeB"), length.out = 50)) evaluate_cross_batch_prediction(coords, ct, batch)coords <- matrix(stats::rnorm(100), 50, 2) batch <- factor(rep(c("B1", "B2"), length.out = 50)) ct <- factor(rep(c("TypeA", "TypeB"), length.out = 50)) evaluate_cross_batch_prediction(coords, ct, batch)
Trains a model using ONLY Modality 1 (e.g., scATAC-seq) and predicts cell-type identities defined in Modality 2 (e.g., scRNA-seq) to test cross-modal biological coherence.
evaluate_cross_modal_prediction(mod1_data, cell_types)evaluate_cross_modal_prediction(mod1_data, cell_types)
mod1_data |
Matrix for Modality 1 (features x cells). |
cell_types |
Ground truth cell-type vector from Modality 2. |
A list with cross-modal classification accuracy and macro F1 score.
data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac evaluate_cross_modal_prediction(r_rna, example_multiomics$cell_types)data(example_multiomics, package = "scSimEval") r_rna <- example_multiomics$ref_multi$rna r_atac <- example_multiomics$ref_multi$atac evaluate_cross_modal_prediction(r_rna, example_multiomics$cell_types)
Evaluates the preservation of differentially expressed genes (DEGs) and biological signal between empirical reference and simulated datasets across three landmark single-cell benchmarking frameworks:
Simpipe (Duo et al., 2024): True DEG ratio, Distribution score (p-value uniformity via Pearson Chi-Square goodness-of-fit test on remaining genes after DEG removal), and supervised machine learning classification (Accuracy, Precision, Recall, F1) using simulated DEGs to predict cell identity.
SimBench (Cao et al., 2021): Symmetric Mean Absolute Percentage Error (SMAPE) on DEG proportions, SimBench DE fidelity score, log2 fold-change effect size Pearson and Spearman correlation, and top-N DEG Jaccard overlap.
Shaky Foundations (Crowell et al., 2023): Group silhouette separation width, silhouette discrepancy, and Percent Variance Explained (PVE) by group assignment.
evaluate_deg_fidelity( ref_data, sim_data, ref_celltypes, sim_celltypes, group1 = NULL, group2 = NULL, fdr_cutoff = 0.05, logfc_cutoff = 0.5, top_n_de = 100, classifier = c("knn", "svm", "rf"), run_pvalue_uniformity = TRUE )evaluate_deg_fidelity( ref_data, sim_data, ref_celltypes, sim_celltypes, group1 = NULL, group2 = NULL, fdr_cutoff = 0.05, logfc_cutoff = 0.5, top_n_de = 100, classifier = c("knn", "svm", "rf"), run_pvalue_uniformity = TRUE )
ref_data |
Reference single-cell expression or count matrix (features x cells). |
sim_data |
Simulated single-cell expression or count matrix (features x cells). |
ref_celltypes |
Factor or character vector of cell types for reference cells. |
sim_celltypes |
Factor or character vector of cell types for simulated cells. |
group1 |
Optional character string specifying group 1 name. Default NULL (auto-selects top abundant type). |
group2 |
Optional character string specifying group 2 name. Default NULL (auto-selects second most abundant type). |
fdr_cutoff |
Adjusted p-value significance threshold. Default is 0.05. |
logfc_cutoff |
Absolute log2 fold-change cutoff. Default is 0.5. |
top_n_de |
Number of top ranked DEGs to evaluate for Jaccard overlap and classification. Default is 100. |
classifier |
Supervised classifier: "knn" (default), "svm", or "rf". |
run_pvalue_uniformity |
Logical, whether to run Simpipe's Chi-square p-value uniformity test. Default is TRUE. |
A list containing:
deg_summary_table: Comprehensive data.frame uniting all 15 metrics across Simpipe, SimBench, and Shaky Foundations.
deg_genes_ref: Character vector of significant DEGs in reference.
deg_genes_sim: Character vector of significant DEGs in simulation.
contrast: String describing the evaluated group contrast.
logfc_ref: Named numeric vector of reference log2 fold-changes.
logfc_sim: Named numeric vector of simulated log2 fold-changes.
ml_classification: Detailed classifier performance metrics.
pvalue_uniformity: Chi-square goodness-of-fit test results.
data(example_scrna, package = "scSimEval") evaluate_deg_fidelity(example_scrna$ref, example_scrna$sim, ref_celltypes = example_scrna$cell_types, sim_celltypes = example_scrna$cell_types)data(example_scrna, package = "scSimEval") evaluate_deg_fidelity(example_scrna$ref, example_scrna$sim, ref_celltypes = example_scrna$cell_types, sim_celltypes = example_scrna$cell_types)
Trains a supervised classification model on reference single-cell chromatin accessibility profiles (scATAC-seq / scCAS) and evaluates cell-type prediction / projection accuracy on simulated cells against ground-truth cell-type labels (Chen et al., Nat Mach Intell 2022).
evaluate_epigenomic_annotation( ref_data, sim_data, ref_celltypes, sim_celltypes, method = c("knn", "centroid"), n_pcs = 20, k = 5 )evaluate_epigenomic_annotation( ref_data, sim_data, ref_celltypes, sim_celltypes, method = c("knn", "centroid"), n_pcs = 20, k = 5 )
ref_data |
Reference count/accessibility matrix (features x cells). |
sim_data |
Simulated count/accessibility matrix (features x cells). |
ref_celltypes |
Factor or character vector of cell types for reference cells. |
sim_celltypes |
Factor or character vector of true cell types for simulated cells. |
method |
Classification method: "knn" (k-nearest neighbors on PCA, default) or "centroid" (nearest centroid classifier). |
n_pcs |
Number of principal components for dimensionality reduction (default 20). |
k |
Number of nearest neighbors for k-NN (default 5). |
A list containing overall accuracy, balanced accuracy, macro F1, macro precision, macro recall, Cohen's kappa, and per-class performance metrics.
data(example_multiomics, package = "scSimEval") evaluate_epigenomic_annotation( example_multiomics$ref_multi$atac, example_multiomics$sim_multi$atac, ref_celltypes = example_multiomics$cell_types, sim_celltypes = example_multiomics$cell_types )data(example_multiomics, package = "scSimEval") evaluate_epigenomic_annotation( example_multiomics$ref_multi$atac, example_multiomics$sim_multi$atac, ref_celltypes = example_multiomics$cell_types, sim_celltypes = example_multiomics$cell_types )
Orchestrates comprehensive benchmarking across all 7 evaluation categories using strictly the user's provided inputs:
ref_multi: List of reference omics matrices (e.g. list(rna = ..., atac = ...)).
sim_multi: List of simulated omics matrices (e.g. list(rna = ..., atac = ...)).
cell_types: Vector/factor of cell-type identities.
batch_info: Vector/factor of batch or donor annotations.
Computational resource usage: cpu_time, memory_mb, system_time.
Trajectory features inferred directly from scRNA-seq counts.
evaluate_multiomics_accuracy( ref_multi, sim_multi, cell_types = NULL, batch_info = NULL, pairing = c("paired", "unpaired"), is_paired = NULL, memory_mb = NULL, elapsed_time = NULL, peak_memory_mb = NULL, feature_pairs = NULL, compute_bivariate = FALSE, threads = 1, verbose = TRUE )evaluate_multiomics_accuracy( ref_multi, sim_multi, cell_types = NULL, batch_info = NULL, pairing = c("paired", "unpaired"), is_paired = NULL, memory_mb = NULL, elapsed_time = NULL, peak_memory_mb = NULL, feature_pairs = NULL, compute_bivariate = FALSE, threads = 1, verbose = TRUE )
ref_multi |
Named list of reference matrices for Modality 1 and 2. |
sim_multi |
Named list of simulated matrices for Modality 1 and 2. |
cell_types |
Optional factor or vector of cell type labels for cells. |
batch_info |
Optional factor or vector of batch labels for cells. |
pairing |
Character string specifying whether the multiomics dataset is
|
is_paired |
Optional logical alias for |
memory_mb |
Optional numeric value of peak memory allocation in MB (or peak_memory_mb). |
elapsed_time |
Optional numeric value of wall-clock elapsed time in seconds. |
peak_memory_mb |
Optional alias for |
feature_pairs |
Optional 2-column data.frame of linked feature pairs. |
compute_bivariate |
Logical, whether to compute 2D bivariate tests. Default FALSE for speed. |
threads |
Number of CPU threads. Default is 1. |
verbose |
Logical, whether to print execution progress. Default is TRUE. |

Multiomics Metric Measurement Capacity by Experimental Design & Metadata:
Paired Multiomics (e.g. 10x Chromium Multiome, SHARE-seq, SNARE-seq):
Count Matrices Alone (RNA + ATAC): Measures approximately 48 metrics spanning both unimodal distribution layers (Categories I, II, VI, VIII across both modalities) plus Category VII Cross-Modal Coupling (FOSCTTM alignment score, Match@1 nearest neighbor accuracy, cross-modal generative prediction accuracy/F1, RV coefficient, and peak-to-gene regulatory correlation).
+ Cell Types: Unlocks 15–20 additional metrics for cross-modal cell-type concordance and cell-type specific epigenetic promoter/enhancer activity.
+ Batch Info: Unlocks 10–14 additional metrics evaluating technical confounder integration across both RNA and ATAC modalities.
+ Both (Full Metadata): Unlocks the complete multiomics suite of all 62 metrics across all 8 categories.
Unpaired Multiomics (independent scRNA and scATAC from separate cells):
Count Matrices Alone (RNA + ATAC): Measures approximately 38–42 metrics spanning unimodal distributions for both layers plus population-level cross-modal metrics (co-expression module fidelity, Network Jaccard similarity, cross-modality correlation).
+ Cell Types (Crucial for Unpaired): Unlocks 15–20 additional metrics for cluster-matched label transfer concordance and cell-type matched regulatory linkage.
+ Batch Info: Unlocks 7–12 additional metrics evaluating batch integration.
A list containing detailed results and a unified tidy master summary table.
data(example_multiomics, package = "scSimEval") evaluate_multiomics_accuracy(example_multiomics$ref_multi, example_multiomics$sim_multi)data(example_multiomics, package = "scSimEval") evaluate_multiomics_accuracy(example_multiomics$ref_multi, example_multiomics$sim_multi)
Orchestrates simultaneous benchmarking across a collection of single-cell datasets, including paired multiomics (e.g., scRNA-seq and scATAC-seq from the same biological experiment) and unimodal datasets (e.g., standalone scRNA-seq or scATAC-seq). Produces a unified, consolidated summary table, comparative ranking matrix, and dataset overview.
evaluate_multiple_datasets( datasets, pair_by_prefix = TRUE, compute_bivariate = FALSE, threads = 1, verbose = TRUE )evaluate_multiple_datasets( datasets, pair_by_prefix = TRUE, compute_bivariate = FALSE, threads = 1, verbose = TRUE )
datasets |
A named list of datasets to evaluate. Can be provided in two formats:
|
pair_by_prefix |
Logical; if |
compute_bivariate |
Logical; whether to compute 2D bivariate tests (default FALSE for speed). |
threads |
Number of CPU threads for parallel metric computation. Default is 1. |
verbose |
Logical; whether to print progress messages. Default is TRUE. |
An S3 object of class scSimEval_consolidated containing:
consolidated_summary_table: Master tidy data.frame with columns Dataset, Data_Name, Modality, Category, Property, Metric, and Value.
consolidated_score_matrix: Wide comparison matrix comparing all datasets across metrics.
dataset_overview: Aggregate summary table with total metrics and mean scores per dataset.
dataset_results: Named list containing detailed evaluation results for each individual dataset.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)
Trains a classifier on simulated features (80% train / 20% test) to verify
whether the simulated biological signals are sufficiently predictive of cell identities.
If de_features is NULL, the top variable features are automatically selected.
evaluate_predictive_de_model( data, group, de_features = NULL, n_top = 50, method = c("knn", "rf", "svm") )evaluate_predictive_de_model( data, group, de_features = NULL, n_top = 50, method = c("knn", "rf", "svm") )
data |
Matrix (features x cells). |
group |
Cell type labels. |
de_features |
Optional character vector of selected DE feature names. |
n_top |
Number of top features to auto-select if |
method |
Classifier: "knn" (default), "rf", or "svm". |
A list containing Accuracy, Macro Precision, Macro Recall, and Macro F1 score.
data(example_scrna, package = "scSimEval") evaluate_predictive_de_model(example_scrna$ref, group = example_scrna$cell_types)data(example_scrna, package = "scSimEval") evaluate_predictive_de_model(example_scrna$ref, group = example_scrna$cell_types)
Compares proportions of genes exhibiting DE, DV, DD, DP, and BD between empirical reference and simulated datasets.
evaluate_simbench_signals( ref_mat, sim_mat, ref_celltypes, sim_celltypes, p_sig = 0.05, bi_cutoff = 0.3 )evaluate_simbench_signals( ref_mat, sim_mat, ref_celltypes, sim_celltypes, p_sig = 0.05, bi_cutoff = 0.3 )
ref_mat |
Reference matrix. |
sim_mat |
Simulated matrix. |
ref_celltypes |
Reference cell type labels (subsets to top 2 abundant types). |
sim_celltypes |
Simulated cell type labels. |
p_sig |
Significance cutoff (default 0.05). |
bi_cutoff |
Bimodal index cutoff (default 0.3). |
A tidy data.frame comparing biological signal proportions.
data(example_scrna, package = "scSimEval") evaluate_simbench_signals(example_scrna$ref, example_scrna$sim, ref_celltypes = example_scrna$cell_types, sim_celltypes = example_scrna$cell_types)data(example_scrna, package = "scSimEval") evaluate_simbench_signals(example_scrna$ref, example_scrna$sim, ref_celltypes = example_scrna$cell_types, sim_celltypes = example_scrna$cell_types)
Computes distribution distances, cellular and feature-level properties, zero-inflation curves, and manifold distances between reference and simulated datasets.
evaluate_simulation_accuracy( ref_data, sim_data, compute_bivariate = TRUE, threads = 1, memory_mb = NULL, elapsed_time = NULL, peak_memory_mb = NULL, verbose = TRUE )evaluate_simulation_accuracy( ref_data, sim_data, compute_bivariate = TRUE, threads = 1, memory_mb = NULL, elapsed_time = NULL, peak_memory_mb = NULL, verbose = TRUE )
ref_data |
Reference count matrix (features x cells). |
sim_data |
Simulated count matrix (features x cells). |
compute_bivariate |
Logical, whether to compute 2D bivariate tests. Default is TRUE. |
threads |
Number of threads for parallel computation. Default is 1. |
memory_mb |
Optional numeric value of peak memory allocation in MB (or peak_memory_mb). |
elapsed_time |
Optional numeric value of wall-clock elapsed time in seconds. |
peak_memory_mb |
Optional alias for |
verbose |
Logical, whether to print execution messages. Default is TRUE. |

Metric Measurement Capacity by Data & Metadata Mode:
Count Matrix Alone (No Metadata): Measures approximately 23 baseline metrics spanning Category I (Distributional Properties: KS, Wasserstein, MAD, MAE, RMSE, OV, Bhattacharyya, ECDF difference, Runs test, 2D Fasano-Franceschini, 2D Peacock, KDE test, MMD, Fréchet distance), Category II (Correlations & Zero-Inflation: BCV discrepancy, dropout curve midpoint/slope, mean-variance R², cell/gene Pearson correlations), and Category VI (Trajectory & Lineage Dynamics: pseudotime correlation, tree height RMSE).
+ Cell Types (Optional): Unlocks 12–15 additional metrics spanning Category III (Cellular Structure & Concordance: ARI, NMI, AMI, Silhouette width, Dunn, Davies-Bouldin, Calinski-Harabasz, V-measure, Neighborhood Purity, Generative Precision/Recall) and Category V (Biological Signal & Downstream Fidelity: SimBench DE/DP/DM/DB/DV signal fidelity, top DEG Jaccard overlap, Log2FC correlation, classifier accuracy and Macro-F1).
+ Batch Annotations (Optional): Unlocks 7 additional metrics spanning Category IV (Batch Effects & Confounder Mixing: Batch Silhouette width, local neighborhood Shannon Entropy, PCR R², CMS CellMixS, Inverse Simpson Index ISI, Seurat Mixing Metric, LDF difference).
Full Metadata (Count Matrix + Cell Types + Batch): Unlocks the complete unimodal benchmarking suite of up to 55 metrics.
A list containing tidy summary tables and detailed metric lists.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)
Evaluates trajectory preservation using pseudotime correlation, branch height discrepancy, and univariate distribution distance metrics on pseudotime. If raw count matrices are provided, pseudotime and lineage trees are automatically inferred directly from the scRNA-seq data.
evaluate_trajectory_metrics( ref_data, sim_data, cell_types_ref = NULL, cell_types_sim = NULL )evaluate_trajectory_metrics( ref_data, sim_data, cell_types_ref = NULL, cell_types_sim = NULL )
ref_data |
Reference count matrix (genes x cells) OR numeric vector of pseudotimes. |
sim_data |
Simulated count matrix (genes x cells) OR numeric vector of pseudotimes. |
cell_types_ref |
Optional vector of reference cell types (for lineage tree inference). |
cell_types_sim |
Optional vector of simulated cell types (for lineage tree inference). |
A named list of trajectory accuracy metrics.
data(example_scrna, package = "scSimEval") evaluate_trajectory_metrics(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") evaluate_trajectory_metrics(example_scrna$ref, example_scrna$sim)
Compares empirical dropout trends between reference and simulated datasets.
evaluate_zero_probability_curve(ref_counts, sim_counts)evaluate_zero_probability_curve(ref_counts, sim_counts)
ref_counts |
Reference count matrix. |
sim_counts |
Simulated count matrix. |
Named numeric vector of curve parameter differences.
data(example_scrna, package = "scSimEval") evaluate_zero_probability_curve(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") evaluate_zero_probability_curve(example_scrna$ref, example_scrna$sim)
A named factor vector containing technical batch annotations ("Batch1", "Batch2")
for 80 single cells, matching the column names of example_scrna and
example_scatac. Useful as a reference template for formatting batch
metadata inputs in scSimEval.
data(example_batch_info)data(example_batch_info)
A named factor with 80 elements across 2 levels: "Batch1" (40 cells) and "Batch2" (40 cells).
Names correspond to individual cell barcodes ("Cell_01" to "Cell_80").
Derived from example_scrna$batch_info.
data(example_batch_info) head(example_batch_info) table(example_batch_info)data(example_batch_info) head(example_batch_info) table(example_batch_info)
A named factor vector containing discrete cell-type labels ("TypeA", "TypeB")
for 80 single cells, matching the column names of example_scrna and
example_scatac. Useful as a reference template for formatting cell-type
metadata inputs in scSimEval.
data(example_cell_types)data(example_cell_types)
A named factor with 80 elements across 2 levels: "TypeA" (40 cells) and "TypeB" (40 cells).
Names correspond to individual cell barcodes ("Cell_01" to "Cell_80").
Derived from example_scrna$cell_types.
data(example_cell_types) head(example_cell_types) table(example_cell_types)data(example_cell_types) head(example_cell_types) table(example_cell_types)
A unified single-cell multiomics dataset pairing scRNA-seq and scATAC-seq profiles across the same 80 cells, accompanied by cell-type labels, batch annotations, and logged computational scalability metrics.
data(example_multiomics)data(example_multiomics)
A list with 5 elements:
Named list of reference matrices: rna (60 x 80) and atac (60 x 80).
Named list of simulated matrices: rna (60 x 80) and atac (60 x 80).
A factor of cell-type identities ("TypeA", "TypeB") for the 80 cells.
A factor of batch annotations ("Batch1", "Batch2") for the 80 cells.
A list of computational scalability metrics: cpu_time, memory_mb, system_time, elapsed_time.
Synthetic multiomics benchmark data generated for testing scSimEval.
data(example_multiomics) names(example_multiomics$ref_multi) names(example_multiomics$sim_multi)data(example_multiomics) names(example_multiomics$ref_multi) names(example_multiomics$sim_multi)
A synthetic single-cell ATAC sequencing peak accessibility dataset designed for testing,
benchmarking, and demonstrating evaluation metrics in scSimEval. Contains paired
empirical reference accessibility counts and simulated accessibility counts across 60 peaks
and 80 cells matching the cells in example_scrna.
data(example_scatac)data(example_scatac)
A list with 4 elements:
A numeric matrix of reference peak accessibility counts (60 peaks x 80 cells).
A numeric matrix of simulated peak accessibility counts (60 peaks x 80 cells).
A factor of cell-type identities ("TypeA", "TypeB") for the 80 cells.
A factor of batch annotations ("Batch1", "Batch2") for the 80 cells.
Synthetic benchmark data generated via binomial sampling with cell-type specific accessibility shifts.
data(example_scatac) dim(example_scatac$ref) dim(example_scatac$sim) table(example_scatac$batch_info)data(example_scatac) dim(example_scatac$ref) dim(example_scatac$sim) table(example_scatac$batch_info)
A synthetic single-cell RNA sequencing dataset designed for testing, benchmarking,
and demonstrating evaluation metrics in scSimEval. Contains paired
empirical reference counts and simulated counts across 60 genes and 80 cells
from two cell types and two batches.
data(example_scrna)data(example_scrna)
A list with 4 elements:
A numeric matrix of reference count data (60 genes x 80 cells).
A numeric matrix of simulated count data (60 genes x 80 cells).
A factor of cell-type identities ("TypeA", "TypeB") for the 80 cells.
A factor of batch annotations ("Batch1", "Batch2") for the 80 cells.
Synthetic benchmark data generated via negative binomial sampling with cell-type specific expression shifts.
data(example_scrna) dim(example_scrna$ref) dim(example_scrna$sim) table(example_scrna$cell_types)data(example_scrna) dim(example_scrna$ref) dim(example_scrna$sim) table(example_scrna$cell_types)
Computes library size, log-library size, zero fraction / detection frequency, pairwise cell correlation (on top HVGs), cell k-NN hubness, pairwise PCA distance, and outlier proportions.
extract_cell_properties( data, max_cells_cor = 1000, n_top_hvgs = 500, verbose = FALSE )extract_cell_properties( data, max_cells_cor = 1000, n_top_hvgs = 500, verbose = FALSE )
data |
Count matrix (features x cells). |
max_cells_cor |
Maximum number of cells for computing pairwise correlation (default 1000). |
n_top_hvgs |
Number of highly variable genes to use for correlation and PCA (default 500). |
verbose |
Logical, whether to print progress messages. |
A named list of cell-level summary vectors.
data(example_scrna, package = "scSimEval") extract_cell_properties(example_scrna$ref)data(example_scrna, package = "scSimEval") extract_cell_properties(example_scrna$ref)
Computes key dimensional and biological properties from single-cell or multiomics count matrices, including cell counts, feature counts, sparsity percentage, biological group/cell type counts, batch counts, median library size, median detected features per cell, and mean expression level.
extract_dataset_summary( mat, role = "Reference", method_name = "Dataset", modality = "scRNA-seq", cell_types = NULL, batch_info = NULL )extract_dataset_summary( mat, role = "Reference", method_name = "Dataset", modality = "scRNA-seq", cell_types = NULL, batch_info = NULL )
mat |
A count matrix (genes/features x cells), dgCMatrix, SingleCellExperiment, or Seurat object. |
role |
Character string describing the role of the dataset (e.g. |
method_name |
Character string indicating the method or dataset name (e.g. |
modality |
Character string describing the molecular modality (e.g. |
cell_types |
Optional factor or character vector of cell type annotations. |
batch_info |
Optional factor or character vector of batch annotations. |
A data.frame with 1 row summarizing the dataset properties.
data(example_scrna, package = "scSimEval") extract_dataset_summary(example_scrna$ref, role = "Reference", method_name = "Empirical")data(example_scrna, package = "scSimEval") extract_dataset_summary(example_scrna$ref, role = "Reference", method_name = "Empirical")
Computes mean abundance, standard deviation, variance, coefficient of variation (CV), feature dropout (zero fraction), dispersion, Biological Coefficient of Variation (BCV), gene-gene correlations, and outlier proportions.
extract_feature_properties(data, n_top_cor = 400, verbose = FALSE)extract_feature_properties(data, n_top_cor = 400, verbose = FALSE)
data |
Count matrix (features x cells). |
n_top_cor |
Number of top HVGs to use for gene-gene correlation matrix (default 400). |
verbose |
Logical, whether to print progress messages. |
A named list of feature-level summary vectors.
data(example_scrna, package = "scSimEval") extract_feature_properties(example_scrna$ref)data(example_scrna, package = "scSimEval") extract_feature_properties(example_scrna$ref)
Fast Column-Wise Variances for Dense or Sparse Single-Cell Matrices
fast_col_vars(mat)fast_col_vars(mat)
mat |
Matrix or dgCMatrix (features x cells). |
Numeric vector of column variances.
Computes ||X_i - Y_j||^2 using BLAS matrix product: ||x||^2 + ||y||^2 - 2 <x, y>.
fast_cross_distance_sq(X, Y)fast_cross_distance_sq(X, Y)
X |
Matrix (m x p). |
Y |
Matrix (n x p). |
Matrix of squared Euclidean distances (m x n).
Fast Truncated PCA on Top Highly Variable Features
fast_pca(mat, n_pcs = 20, n_hvg = 2000, scale = FALSE)fast_pca(mat, n_pcs = 20, n_hvg = 2000, scale = FALSE)
mat |
Matrix or dgCMatrix (cells x features). |
n_pcs |
Number of principal components. Default 20. |
n_hvg |
Number of top highly variable genes to retain. Default 2000. |
scale |
Logical, whether to scale features. Default FALSE. |
Matrix of cell principal component embeddings (cells x n_pcs).
Fast Row-Wise Variances for Dense or Sparse Single-Cell Matrices
fast_row_vars(mat)fast_row_vars(mat)
mat |
Matrix or dgCMatrix (features x cells). |
Numeric vector of row variances.
Fast Zero Fraction per Cell (Column-wise)
fast_sparse_zero_fraction_cell(mat)fast_sparse_zero_fraction_cell(mat)
mat |
Matrix or dgCMatrix (features x cells). |
Numeric vector of zero fraction per cell.
Fast Zero Fraction per Feature (Row-wise)
fast_sparse_zero_fraction_feature(mat)fast_sparse_zero_fraction_feature(mat)
mat |
Matrix or dgCMatrix (features x cells). |
Numeric vector of zero fraction per feature.
Builds a hierarchical clustering lineage tree between cell-type centroids from scRNA-seq expression data.
infer_scrna_lineage_tree(data, cell_types, method = "ward.D2")infer_scrna_lineage_tree(data, cell_types, method = "ward.D2")
data |
Expression or count matrix (genes x cells). |
cell_types |
Factor or vector of cell-type annotations for each cell. |
method |
Linkage method for hierarchical clustering (default "ward.D2"). |
An hclust tree object representing the cell-type lineage tree.
data(example_scrna, package = "scSimEval") infer_scrna_lineage_tree(example_scrna$ref, example_scrna$cell_types)data(example_scrna, package = "scSimEval") infer_scrna_lineage_tree(example_scrna$ref, example_scrna$cell_types)
Estimates cell differentiation pseudotime directly from single-cell expression counts using diffusion/principal curve projection along the first principal component of top highly variable genes.
infer_scrna_pseudotime(data, n_top = 500)infer_scrna_pseudotime(data, n_top = 500)
data |
Expression or count matrix (genes x cells). |
n_top |
Number of top variable genes to use (default 500). |
Numeric vector of pseudotime values in [0, 1] for each cell.
data(example_scrna, package = "scSimEval") infer_scrna_pseudotime(example_scrna$ref)data(example_scrna, package = "scSimEval") infer_scrna_pseudotime(example_scrna$ref)
Launches the Shiny web application embedded in the scSimEval package. Provides an intuitive graphical interface to upload biological reference and simulated datasets (single-cell scRNA-seq, scATAC-seq, or paired multiomics), specify computational scalability metrics (elapsed time and peak memory), interactively inspect the flagship 62-measure comparative bubble matrix, explore diagnostic figures, and export high-resolution figures (600 DPI publication quality), multi-page PDF reports, Excel (.xlsx) workbooks, and complete results ZIP packages.
launch_scSimEval_app( port = NULL, host = "127.0.0.1", launch.browser = interactive(), maxRequestSize = 10 * 1024^3 )launch_scSimEval_app( port = NULL, host = "127.0.0.1", launch.browser = interactive(), maxRequestSize = 10 * 1024^3 )
port |
Optional port number for the local web server. Default is |
host |
Character string specifying the IP address to listen on. Defaults to |
launch.browser |
Logical, whether to automatically launch the default web browser.
Defaults to |
maxRequestSize |
Numeric value specifying the maximum allowable upload file size in bytes.
Defaults to |
Invisibly returns the Shiny app process object.
# Locate the embedded Shiny app directory bundled with the package system.file("shiny", "scSimEvalApp", package = "scSimEval") # Launch the interactive studio (interactive sessions only) if (interactive()) { launch_scSimEval_app() }# Locate the embedded Shiny app directory bundled with the package system.file("shiny", "scSimEvalApp", package = "scSimEval") # Launch the interactive studio (interactive sessions only) if (interactive()) { launch_scSimEval_app() }
Produces a multi-dimensional benchmarking bubble matrix comparing simulation methods. Methods appear as rows; evaluation metrics appear as columns grouped under the eight canonical evaluation categories (I-VIII) displayed as colored header strips at the top.
plot_benchmark_bubble_matrix( data, method_classes = NULL, category_colors = NULL, metrics_order = NULL, methods_order = NULL, rank_methods = TRUE, compact_strips = TRUE, normalize_scores = TRUE, show_missing_dots = TRUE, bubble_size_range = c(2, 7.8), title = NULL, subtitle = NULL, base_size = 11, show_score_labels = FALSE ) plot_bubble_matrix( data, method_classes = NULL, category_colors = NULL, metrics_order = NULL, methods_order = NULL, rank_methods = TRUE, compact_strips = TRUE, normalize_scores = TRUE, show_missing_dots = TRUE, bubble_size_range = c(2, 7.8), title = NULL, subtitle = NULL, base_size = 11, show_score_labels = FALSE )plot_benchmark_bubble_matrix( data, method_classes = NULL, category_colors = NULL, metrics_order = NULL, methods_order = NULL, rank_methods = TRUE, compact_strips = TRUE, normalize_scores = TRUE, show_missing_dots = TRUE, bubble_size_range = c(2, 7.8), title = NULL, subtitle = NULL, base_size = 11, show_score_labels = FALSE ) plot_bubble_matrix( data, method_classes = NULL, category_colors = NULL, metrics_order = NULL, methods_order = NULL, rank_methods = TRUE, compact_strips = TRUE, normalize_scores = TRUE, show_missing_dots = TRUE, bubble_size_range = c(2, 7.8), title = NULL, subtitle = NULL, base_size = 11, show_score_labels = FALSE )
data |
Input data. One of:
|
method_classes |
Optional named list mapping method names to row group labels.
E.g. |
category_colors |
Optional named character vector to override the canonical palette. |
metrics_order |
Optional character vector for explicit metric ordering (left to right). |
methods_order |
Optional character vector for explicit method ordering (top to bottom). |
rank_methods |
Logical. Automatically rank methods along the vertical axis by mean overall fidelity score. Default |
compact_strips |
Logical. Use compact two-line facet strip titles for clean horizontal layout. Default |
normalize_scores |
Logical. Normalize raw distances into [0, 1] fidelity scores. Default |
show_missing_dots |
Logical. Show grey dots for missing metric combinations. Default |
bubble_size_range |
Numeric vector of length 2: min and max bubble size. Default |
title |
Character. Main plot title. If |
subtitle |
Character. Plot subtitle. |
base_size |
Numeric. Base font size. Default |
show_score_labels |
Logical. Annotate bubbles with numeric score. Default |

Bubble encoding:
Size: Normalized fidelity score [0, 1] – larger = better performance.
Fill color: Evaluation category (one of the eight canonical groups).
Circle (shape 21): Regular performance (score < 0.96).
Square (shape 22): Top performer (score >= 0.96).
Small grey dot: Metric not available/computed for that method.
Score normalization is direction-aware: distance/error metrics are inverted so that 1 always means best performance, while concordance/correlation metrics are used directly (higher = better).
A ggplot object rendering the multi-dimensional bubble matrix.
# Tidy benchmark data frame of standardized scores bm_df <- data.frame( Method = rep(c("Splat", "scDesign3", "SymSim", "dyngen"), each = 4), Category = rep(c("Accuracy", "Accuracy", "Cellular Structure", "Scalability"), 4), Metric = rep(c("KS Distance", "Wasserstein", "Silhouette ASW", "CPU Time"), 4), Score = c(0.8, 0.7, 0.9, 0.6, 0.5, 0.8, 0.6, 0.5, 0.8, 0.7, 0.6, 0.5, 0.7, 0.6, 0.9, 0.5) ) p <- plot_benchmark_bubble_matrix(bm_df) p # Load benchmark summary across simulators demo_file <- system.file("shiny/scSimEvalApp/data/demo_benchmark_data.rds", package = "scSimEval") if (file.exists(demo_file)) { demo <- readRDS(demo_file) p <- plot_benchmark_bubble_matrix( data = demo$benchmark_summary_table, title = "Single-Cell Multiomics Simulation Benchmark", method_classes = list( "scRNA-seq" = c("Splatter", "SymSim"), "scATAC-seq" = c("simATAC", "SCRIP"), "Multiomics" = c("scDesign3", "dyngen") ) ) print(p) }# Tidy benchmark data frame of standardized scores bm_df <- data.frame( Method = rep(c("Splat", "scDesign3", "SymSim", "dyngen"), each = 4), Category = rep(c("Accuracy", "Accuracy", "Cellular Structure", "Scalability"), 4), Metric = rep(c("KS Distance", "Wasserstein", "Silhouette ASW", "CPU Time"), 4), Score = c(0.8, 0.7, 0.9, 0.6, 0.5, 0.8, 0.6, 0.5, 0.8, 0.7, 0.6, 0.5, 0.7, 0.6, 0.9, 0.5) ) p <- plot_benchmark_bubble_matrix(bm_df) p # Load benchmark summary across simulators demo_file <- system.file("shiny/scSimEvalApp/data/demo_benchmark_data.rds", package = "scSimEval") if (file.exists(demo_file)) { demo <- readRDS(demo_file) p <- plot_benchmark_bubble_matrix( data = demo$benchmark_summary_table, title = "Single-Cell Multiomics Simulation Benchmark", method_classes = list( "scRNA-seq" = c("Splatter", "SymSim"), "scATAC-seq" = c("simATAC", "SCRIP"), "Multiomics" = c("scDesign3", "dyngen") ) ) print(p) }
Generates publication-ready faceted barplots comparing simulator methods across all individual evaluation metrics belonging to a specified benchmark category. Each metric is presented in its own sub-panel with exact numeric score labels, direction-awareness indicators (indicating whether higher or lower values are optimal), and standardized or original raw score formulation.
plot_category_metric_bars( benchmark_data, category, score_type = c("normalized", "raw"), palette = NULL, ncol = NULL, base_size = 11 )plot_category_metric_bars( benchmark_data, category, score_type = c("normalized", "raw"), palette = NULL, ncol = NULL, base_size = 11 )
benchmark_data |
A benchmark data.frame (e.g. |
category |
Character. The benchmark category to visualize (e.g., |
score_type |
Character. Either |
palette |
Optional named character vector of simulator colors. |
ncol |
Integer. Optional number of columns in facet layout. Defaults to dynamic layout based on metric count. |
base_size |
Numeric. Base font size. Default |
A ggplot object.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)
Generates publication-ready comparative visualizations of empirical reference and simulated single-cell datasets across UMAP, t-SNE, or PCA coordinate spaces. Supports side-by-side comparison, comprehensive multi-method facet grids, and co-embedded overlays, with customizable color mappings and themes.
plot_dataset_embeddings( embedding_data, reduction = c("umap", "tsne", "pca"), layout = c("facet", "side_by_side", "overlay"), color_by = c("cell_type", "cluster", "library_size", "dataset", "batch"), selected_methods = NULL, pt_size = 0.8, alpha = 0.75, palette = "Set1", title = NULL, base_size = 12 )plot_dataset_embeddings( embedding_data, reduction = c("umap", "tsne", "pca"), layout = c("facet", "side_by_side", "overlay"), color_by = c("cell_type", "cluster", "library_size", "dataset", "batch"), selected_methods = NULL, pt_size = 0.8, alpha = 0.75, palette = "Set1", title = NULL, base_size = 12 )
embedding_data |
A |
reduction |
Character string specifying reduction used: |
layout |
Character string specifying the comparison layout:
|
color_by |
Feature used for coloring cells: |
selected_methods |
Optional character vector of simulator names to display. If |
pt_size |
Numeric point size (default: 0.8). |
alpha |
Numeric transparency in [0, 1] (default: 0.75). |
palette |
Character string specifying discrete color palette from RColorBrewer (default: |
title |
Optional title character string. If |
base_size |
Base font size for ggplot2 rendering (default: 12). |
A ggplot2 object.
data(example_scrna, package = "scSimEval") emb <- compute_dataset_embeddings( reference = example_scrna$ref, simulated = list("Splatter" = example_scrna$sim), reduction = "umap", cell_types = example_scrna$cell_types ) plot_dataset_embeddings(emb, reduction = "umap", layout = "facet")data(example_scrna, package = "scSimEval") emb <- compute_dataset_embeddings( reference = example_scrna$ref, simulated = list("Splatter" = example_scrna$sim), reduction = "umap", cell_types = example_scrna$cell_types ) plot_dataset_embeddings(emb, reduction = "umap", layout = "facet")
Compares empirical reference and simulated datasets across canonical single-cell summary properties: library size, TMM, effective library size, mean expression, feature variance, scaled variance, fraction zero per cell, fraction zero per gene, cell-cell correlation, gene-gene correlation, and bivariate relationships (mean vs. variance, mean vs. zero fraction, library size vs. zero fraction, and biological signals). Designed after landmark benchmarking studies (countsimQC / Duo et al.) with a clean, human-crafted scientific layout featuring solid visible contour lines, semi-transparent color-filled density curves, and simple understated titles.
plot_distribution_qc( ref_data, sim_data, layout = c("comprehensive", "density"), properties = NULL, title = "Data properties", ref_name = "Original", sim_name = "Simulation", palette = NULL, cell_types = NULL, base_size = 9 )plot_distribution_qc( ref_data, sim_data, layout = c("comprehensive", "density"), properties = NULL, title = "Data properties", ref_name = "Original", sim_name = "Simulation", palette = NULL, cell_types = NULL, base_size = 9 )
ref_data |
Numeric count matrix for empirical reference (features x cells). |
sim_data |
Numeric count matrix for simulated data (features x cells), or a named list
of simulated count matrices representing multiple simulators (e.g. |
layout |
Character. Visualization layout: |
properties |
Optional character vector of specific properties to include if custom selection is desired. |
title |
Character. Main plot title. Default |
ref_name |
Character. Label for the empirical reference in the legend. Default |
sim_name |
Character. Label for the simulation if a single matrix is provided. Default |
palette |
Optional named character vector of colors. Default uses warm red for reference and classic steel blue for simulation. |
cell_types |
Optional factor or character vector of cell identities for computing biological signal proportions. |
base_size |
Numeric. Base font size. Default |

A ggplot or patchwork composite object containing the comparative panels.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim) data(example_scrna) p <- plot_distribution_qc(example_scrna$ref, example_scrna$sim) if (requireNamespace("ggplot2", quietly = TRUE)) print(p)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim) data(example_scrna) p <- plot_distribution_qc(example_scrna$ref, example_scrna$sim) if (requireNamespace("ggplot2", quietly = TRUE)) print(p)
Produces a 600 DPI horizontal bar matrix ranking single-cell simulators across the 8 canonical evaluation categories and overall composite performance.
plot_evaluation_summary( data, method_classes = NULL, category_colors = NULL, normalize_scores = TRUE, simulators_order = NULL, show_labels = TRUE, title = "Single-Cell Simulator Evaluation Summary", subtitle = "Average fidelity scores across 8 canonical evaluation categories and overall benchmark performance", base_size = 11 ) plot_benchmark_summary_bars( data, method_classes = NULL, category_colors = NULL, normalize_scores = TRUE, simulators_order = NULL, show_labels = TRUE, title = "Single-Cell Simulator Evaluation Summary", subtitle = "Average fidelity scores across 8 canonical evaluation categories and overall benchmark performance", base_size = 11 ) plot_summary_bars( data, method_classes = NULL, category_colors = NULL, normalize_scores = TRUE, simulators_order = NULL, show_labels = TRUE, title = "Single-Cell Simulator Evaluation Summary", subtitle = "Average fidelity scores across 8 canonical evaluation categories and overall benchmark performance", base_size = 11 )plot_evaluation_summary( data, method_classes = NULL, category_colors = NULL, normalize_scores = TRUE, simulators_order = NULL, show_labels = TRUE, title = "Single-Cell Simulator Evaluation Summary", subtitle = "Average fidelity scores across 8 canonical evaluation categories and overall benchmark performance", base_size = 11 ) plot_benchmark_summary_bars( data, method_classes = NULL, category_colors = NULL, normalize_scores = TRUE, simulators_order = NULL, show_labels = TRUE, title = "Single-Cell Simulator Evaluation Summary", subtitle = "Average fidelity scores across 8 canonical evaluation categories and overall benchmark performance", base_size = 11 ) plot_summary_bars( data, method_classes = NULL, category_colors = NULL, normalize_scores = TRUE, simulators_order = NULL, show_labels = TRUE, title = "Single-Cell Simulator Evaluation Summary", subtitle = "Average fidelity scores across 8 canonical evaluation categories and overall benchmark performance", base_size = 11 )
data |
A benchmark summary data frame, a list containing |
method_classes |
Optional named vector mapping method names to class/category labels
(e.g., |
category_colors |
Optional named vector specifying custom colors for category panels and overall score. |
normalize_scores |
Logical indicating whether to normalize scores to [0, 1] (direction-aware where larger is better). Default is |
simulators_order |
Optional vector specifying a custom ordering of simulators. Default is ranking by descending Overall Score. |
show_labels |
Logical indicating whether to display numerical score labels on/beside each bar. Default is |
title |
Character plot title. Default is |
subtitle |
Character plot subtitle. |
base_size |
Numeric base font size (default 11). |

A ggplot object representing the multi-panel evaluation summary.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim) demo <- readRDS(system.file("shiny/scSimEvalApp/data/demo_benchmark_data.rds", package = "scSimEval")) p <- plot_evaluation_summary(demo$benchmark_summary_table) print(p) data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim) data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim) demo <- readRDS(system.file("shiny/scSimEvalApp/data/demo_benchmark_data.rds", package = "scSimEval")) p <- plot_evaluation_summary(demo$benchmark_summary_table) print(p) data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim) data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)
Generates a publication-quality barplot comparing simulator methods on a single evaluation metric, with exact score labels, direction awareness, and performance ranking.
plot_individual_metric_bar( benchmark_data, metric, score_type = c("normalized", "raw"), palette = NULL, base_size = 12 )plot_individual_metric_bar( benchmark_data, metric, score_type = c("normalized", "raw"), palette = NULL, base_size = 12 )
benchmark_data |
A benchmark data.frame or named list containing benchmark tables. |
metric |
Character. The name of the metric to plot (e.g. |
score_type |
Character. Either |
palette |
Optional named character vector of simulator colors. |
base_size |
Numeric. Base font size. Default |
A ggplot object.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)
Generates 600 DPI boxplots with jittered points showing the distribution of evaluation metric scores across simulated single-cell and multiomics datasets. Supports standardized direction-aligned fidelity scores (where higher is universally superior, resolving metric polarity differences across distance and correlation measures) or original unnormalized raw values with optional direction separation or per-metric faceting.
plot_metric_boxplots( benchmark_data, categories = NULL, metrics = NULL, score_type = c("normalized", "raw"), separate_direction = FALSE, facet_by = c("category", "metric"), palette = NULL, ncol = 4, base_size = 11 )plot_metric_boxplots( benchmark_data, categories = NULL, metrics = NULL, score_type = c("normalized", "raw"), separate_direction = FALSE, facet_by = c("category", "metric"), palette = NULL, ncol = 4, base_size = 11 )
benchmark_data |
A data frame (such as |
categories |
Optional character vector of categories to include. Default |
metrics |
Optional character vector of specific metrics to include. Default |
score_type |
Character. Score formulation: |
separate_direction |
Logical. When |
facet_by |
Character. Facet layout: |
palette |
Optional named character vector of simulator colors. |
ncol |
Integer. Number of columns in facet wrap. Default |
base_size |
Numeric. Base font size. Default |

A ggplot object.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)
Produces a 600 DPI comparative heatmap displaying simulators on the x-axis and evaluated biological/computational measures on the y-axis, grouped by the 8 canonical evaluation categories. Displays the exact original raw evaluation score in text inside every cell, with cell fill colors scaled by relative fidelity (direction-aware, ensuring balanced visual contrast across all 62 measures without scale distortion from high-magnitude metrics like RAM or runtime).
plot_metric_heatmap( benchmark_data, category = NULL, metrics = NULL, scale_fill = c("relative", "raw"), top_n_properties = NULL, facet_by_category = TRUE, cluster_rows = FALSE, cluster_cols = FALSE, base_size = 10, metric_name = NULL )plot_metric_heatmap( benchmark_data, category = NULL, metrics = NULL, scale_fill = c("relative", "raw"), top_n_properties = NULL, facet_by_category = TRUE, cluster_rows = FALSE, cluster_cols = FALSE, base_size = 10, metric_name = NULL )
benchmark_data |
A tidy benchmark summary table or a named list of benchmark tables. |
category |
Optional character vector to filter by canonical evaluation category. Default |
metrics |
Optional character vector of specific metrics to include. Default |
scale_fill |
Character. Cell color fill scaling: |
top_n_properties |
Optional integer. If specified, restricts to top N most variable metrics. Default |
facet_by_category |
Logical. Whether to group rows into vertical category banner panels across all 8 categories. Default |
cluster_rows |
Logical. Hierarchically cluster measures along y-axis. Default |
cluster_cols |
Logical. Hierarchically cluster simulators along x-axis. Default |
base_size |
Numeric. Base font size. Default |
metric_name |
Optional legacy alias for |

A ggplot object.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)
Projects evaluation metric profiles or simulator performances into a 2D MDS space for benchmarking single-cell simulation methods.
plot_metric_mds( benchmark_data, ordination_by = c("simulators", "summaries"), by_category = FALSE, as_list = FALSE, category = NULL, exclude_categories = c("(VI) Trajectory & Lineage Dynamics", "(VIII) Computational Scalability"), metrics = NULL, normalize_scores = TRUE, palette = NULL, title = NULL, base_size = 11, ncol = 2 )plot_metric_mds( benchmark_data, ordination_by = c("simulators", "summaries"), by_category = FALSE, as_list = FALSE, category = NULL, exclude_categories = c("(VI) Trajectory & Lineage Dynamics", "(VIII) Computational Scalability"), metrics = NULL, normalize_scores = TRUE, palette = NULL, title = NULL, base_size = 11, ncol = 2 )
benchmark_data |
Benchmark summary data.frame, matrix, or list. |
ordination_by |
Character. Either |
by_category |
Logical. If |
as_list |
Logical. If |
category |
Optional character vector to filter by evaluation category (e.g. |
exclude_categories |
Character vector of categories to exclude from the ordination.
Default is |
metrics |
Optional character vector of specific metrics to include. |
normalize_scores |
Logical. If |
palette |
Optional named character vector of colors. For |
title |
Optional plot title. |
base_size |
Numeric. Base font size. Default |
ncol |
Integer. Number of columns when |
When ordination_by = "summaries", each point represents an evaluated property/metric,
colored by its biological level: "gene" (red), "cell" (blue), or "global" (green).
If by_category = TRUE, a multi-panel dashboard is produced showing one MDS ordination per
category (by default across the 6 canonical categories with >= 3 measures, excluding Trajectory and
Scalability which each contain only 2 measures).
A ggplot or patchwork object.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)
Generates a dual-panel PCA dashboard for evaluating single-cell simulation benchmark metrics and methods.
plot_metric_pca( benchmark_data, panel = c("both", "methods", "loadings"), by_category = FALSE, as_list = FALSE, category = NULL, exclude_categories = NULL, metrics = NULL, palette = NULL, top_n_loadings = 14, base_size = 11 )plot_metric_pca( benchmark_data, panel = c("both", "methods", "loadings"), by_category = FALSE, as_list = FALSE, category = NULL, exclude_categories = NULL, metrics = NULL, palette = NULL, top_n_loadings = 14, base_size = 11 )
benchmark_data |
Benchmark summary data.frame, matrix, or list. |
panel |
Character. Which panel(s) to render: |
by_category |
Logical. If |
as_list |
Logical. If |
category |
Optional character vector to filter by evaluation category. |
exclude_categories |
Optional character vector of categories to exclude (e.g. scalability). |
metrics |
Optional character vector of specific metrics to include. |
palette |
Optional named character vector of colors for simulators. |
top_n_loadings |
Integer or |
base_size |
Numeric. Base font size. Default |
All metrics present in benchmark_data (e.g. all 62 canonical metrics across categories)
are mathematically considered in the PCA decomposition. Panel "both" displays:
Panel a (Methods Ordination): Simulators mapped into PC1 vs PC2 coordinates with solid black crosshairs, centroid markers, and white rounded badge labels with colored borders.
Panel b (PC Loadings Vectors): Directional loading vectors (arrows) radiating from
the origin (0, 0) to loading coordinates (w1, w2), colored by summary type
("gene" = red, "cell" = blue, "global" = green) with rounded badge labels.
Pass top_n_loadings = NULL or 62 to render all metric loading vectors.
A ggplot or patchwork object representing the ordination figure.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)
Evaluates computational resource efficiency across single-cell simulators using raw benchmarking measurements (elapsed real wall-clock time, total CPU time, peak resident Plot Multi-Dimensional Computational Scalability Benchmark
plot_scalability_benchmark( benchmark_data, type = c("composite", "runtime", "memory", "tradeoff", "cost", "throughput", "efficiency"), layout = c("4panel", "6panel"), cell_count = 1000, palette = NULL, base_size = 11 )plot_scalability_benchmark( benchmark_data, type = c("composite", "runtime", "memory", "tradeoff", "cost", "throughput", "efficiency"), layout = c("4panel", "6panel"), cell_count = 1000, palette = NULL, base_size = 11 )
benchmark_data |
Benchmark summary table or named list containing Category VIII metrics. |
type |
Character. Visualization type: |
layout |
Character. For composite dashboards: |
cell_count |
Integer. Number of cells processed in the benchmark, used to calculate
simulation throughput ( |
palette |
Optional named character vector of simulator colors. |
base_size |
Numeric. Base font size. Default |
Evaluates computational resource efficiency across single-cell simulators using raw benchmarking measurements (elapsed real wall-clock time in seconds and peak resident memory consumption in MiB).

A ggplot or patchwork object.
data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)data(example_scrna, package = "scSimEval") res <- evaluate_simulation_accuracy(example_scrna$ref, example_scrna$sim)
Subsample Large Vectors for Accelerated Distributional Distance Estimation
subsample_dist_vector(x, max_n = 3000)subsample_dist_vector(x, max_n = 3000)
x |
Numeric vector. |
max_n |
Maximum sample size (default 3000). |
Subsampled numeric vector if length(x) > max_n, else x.