
Plot Benchmark Metric Score Distributions Across Simulators
Source:R/10_visualizations.R
plot_metric_boxplots.RdGenerates 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.
Arguments
- benchmark_data
A data frame (such as
demo$benchmark_summary_tableor output fromevaluate_simulation_accuracy()) or a named list of benchmark result tables.- categories
Optional character vector of categories to include. Default
NULL(all 8 categories).- metrics
Optional character vector of specific metrics to include. Default
NULL(all).- score_type
Character. Score formulation:
"normalized"(default; direction-inverted standardized fidelity scores in [0, 1] where higher is universally superior across all measures) or"raw"(unnormalized original metric values).- separate_direction
Logical. When
score_type = "raw", whether to separate metrics by optimization direction (lower vs higher is better) into distinct sub-panels. DefaultFALSE.- facet_by
Character. Facet layout:
"category"(default; 8 canonical category panels) or"metric"(independent panels for each individual metric).- palette
Optional named character vector of simulator colors.
- ncol
Integer. Number of columns in facet wrap. Default
4.- base_size
Numeric. Base font size. Default
11.
Examples
bm_df <- data.frame(
Method = rep(c("scDesign3", "scMultiSim", "Splatter", "SymSim"), each = 6),
Category = rep(c(
"(I) Distributional Properties", "(I) Distributional Properties",
"(I) Distributional Properties",
"(III) Cellular Manifold & Clustering Concordance",
"(III) Cellular Manifold & Clustering Concordance",
"(IV) Technical Variation & Batch Mixing Dynamics"
), 4),
Metric = rep(c("KS", "Wasserstein", "RMSE", "ARI", "Silhouette_ASW", "CMS"), 4),
Value = c(
0.10, 0.16, 0.19, 0.85, 0.81, 0.88,
0.15, 0.22, 0.25, 0.78, 0.75, 0.82,
0.23, 0.34, 0.36, 0.67, 0.64, 0.72,
0.31, 0.44, 0.47, 0.56, 0.54, 0.63
),
stringsAsFactors = FALSE
)
p <- plot_metric_boxplots(bm_df, ncol = 3, base_size = 9.5)
print(p)
