--- title: "Getting Started with scSimEval: Benchmarking Single-Cell Simulations in Bioconductor" output: rmarkdown::html_vignette: toc: true toc_depth: 3 number_sections: false self_contained: false vignette: > %\VignetteIndexEntry{Getting Started with scSimEval: Benchmarking Single-Cell Simulations in Bioconductor} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 9, fig.height = 5.5, warning = FALSE, message = FALSE ) ``` # Overview & Bioconductor Ecosystem Integration **`scSimEval`** provides a unified, standardized benchmarking suite to evaluate how closely synthetic single-cell datasets reproduce empirical biological references across **scRNA-seq**, **scATAC-seq**, and **paired/unpaired single-cell multiomics**. ## Integration with Existing Bioconductor Infrastructure `scSimEval` is built directly on Bioconductor core data structures and statistical infrastructure: * **Data representation**: Accepts `SingleCellExperiment` (and multi-modal `SingleCellExperiment` objects with `altExp()`), reading cell-type (`cell_type`) and replicate/batch (`batch`) annotations directly from `SummarizedExperiment::colData()`. Users starting from Seurat objects can convert in one line via `Seurat::as.SingleCellExperiment()`. * **Parallel & sparse execution**: Uses `BiocParallel` and `Matrix` sparse S4 methods for scalable memory-efficient evaluation. * **Downstream statistical engines**: Integrates with `edgeR` (pseudobulk quasi-likelihood differential expression/accessibility), `CDI` (Clustering Deviation Index), `scater` and `scuttle` (QC and normalization utilities), and `CellMixS` (cell-specific batch mixing). ## Comparison with Related Bioconductor Packages * **`splatter`**: Primarily focuses on simulating scRNA-seq count matrices (e.g., Splat, Lun, Simple models) and provides basic property comparisons via `compareSCEs()`. `scSimEval` complements `splatter` by serving as a **simulator-agnostic evaluator** that benchmarks any simulator output across **56 metrics** in **8 categories**—spanning distributional distances, dropout/sparsity curves, clustering concordance, batch mixing, pseudobulk differential fidelity, trajectory topology, cross-modal integration, and hardware-normalized scalability. * **`countsimQC`**: Generates visual comparisons of distributional summaries between synthetic and real count matrices (primarily bulk or unimodal RNA-seq). `scSimEval` extends beyond marginal count QC to assess **single-cell downstream structure** (clustering ARI/NMI/CDI, batch PCR/CMS/ISI, pseudobulk DEG/DA ROC-AUC, scATAC-seq TF-IDF accessibility, paired/unpaired RNA+ATAC integration, and `core_seconds` / `memory_per_core_mib` efficiency). --- # Installation Install the package from Bioconductor with: ```{r install, eval=FALSE} if (!requireNamespace("BiocManager", quietly = TRUE)) { install.packages("BiocManager") } BiocManager::install("scSimEval") ``` --- # Input Data Format All top-level `scSimEval` evaluation entry points center on **`SingleCellExperiment`** objects containing raw counts (`assays(sce)$counts`) and cell metadata columns (`cell_type` and `batch` in `colData(sce)`): ```r # Optional conversion if starting from Seurat: # ref_sce <- Seurat::as.SingleCellExperiment(ref_seurat) # sim_sce <- Seurat::as.SingleCellExperiment(sim_seurat) ``` For multiomics studies, pass either a named list `list(RNA = rna_sce, ATAC = atac_sce)` or a single `SingleCellExperiment` containing the secondary assay in `altExp(sce, "ATAC")`. --- # Quick-Start Tutorial (Unimodal scRNA-seq) First, load `scSimEval` and the bundled `example_scrna` dataset (`ref` and `sim` are `SingleCellExperiment` objects with `cell_type` and `batch` already stored in `colData`): ```{r load-scrna} library(scSimEval) library(SingleCellExperiment) data("example_scrna", package = "scSimEval") example_scrna$ref head(colData(example_scrna$ref), 3) ``` Run `evaluate_simulation_accuracy()` on `ref_sce` and `sim_sce`. Here we include timing and memory metadata to compute Category VIII scalability metrics (`compute_bivariate = FALSE` and `include_trajectory = FALSE` keep this quick-start vignette fast): ```{r eval-scrna} scrna_res <- evaluate_simulation_accuracy( ref_sce = example_scrna$ref, sim_sce = example_scrna$sim, cell_type_col = "cell_type", batch_col = "batch", modality = "scRNA-seq", compute_bivariate = FALSE, include_trajectory = FALSE, elapsed_time = 12.4, memory_mb = 420, sim_cores = 2L, threads = 1L, verbose = FALSE ) head(scrna_res$metrics_summary_table, 10) ``` ## Visualizing Results We can summarize overall category scores or inspect distributional Q-Q / density concordance directly from the returned evaluation object: ```{r plot-scrna, fig.height = 4.5} plot_evaluation_summary(scrna_res) ``` ```{r plot-qc, fig.height = 5} plot_distribution_qc( ref_data = example_scrna$ref, sim_data = example_scrna$sim, layout = "qq", properties = c("library_size", "zero_fraction_cell", "mean_expression") ) ``` --- # Quick-Start Tutorial (Paired Multiomics: scRNA-seq + scATAC-seq) For simultaneous co-assay simulations, `evaluate_multiomics_accuracy()` jointly evaluates both unimodal layers plus Category VI cross-modal alignment: ```{r eval-multiomics} data("example_multiomics", package = "scSimEval") multi_res <- evaluate_multiomics_accuracy( ref_multi = example_multiomics$ref_multi, sim_multi = example_multiomics$sim_multi, pairing = "paired", elapsed_time = 28.5, memory_mb = 1024, sim_cores = 2L, threads = 1L, verbose = FALSE ) table(multi_res$benchmark_summary_table$Category) ``` We can also compute normalized scores (`[0, 1]`, where `1` is best) via `normalize_bubble_scores()` and summarize multiple simulators with `plot_benchmark_bubble_matrix()`. --- # Further Reading & Interactive GUI * **Complete 56-Metric Reference**: See `vignette("metrics-catalog", package = "scSimEval")` for definitions, formulas, and optimization directions for every measure across Categories I--VIII. * **Domain Case Studies**: See the scRNA-seq, scATAC-seq, paired multiomics, unpaired multiomics, and `.rds` aggregation vignettes. * **Interactive Shiny Interface**: Point-and-click dataset exploration, dynamic filtering, and high-resolution report exports are available in the companion package **`scSimEvalStudio`** (`scSimEvalStudio::launch_scSimEval_app()`). --- # Session Information ```{r session-info} sessionInfo() ```