Skip to content

PlotComparisonResults

Comparison plotting helpers for the multi-method cross-sectional report. These functions generate side-by-side diagnostic figures so the same metric can be compared across several harmonisation methods at once.

plot_compare_pca_r2_heatmaps(results, max_pcs=7, fontsize=10, max_cols_in_plotting_grid=3)

Grid of omnibus R^2 heatmaps (metadata variable x PC) per method, built from each method's pc_associations (see DiagnosticFunctions.calculate_pc_associations).

Unlike a Pearson correlation matrix, R^2 is invariant to arbitrary batch/ categorical label encoding, so this replaces the old PCA correlation heatmap. max_pcs is hard-capped at 5 to keep the heatmap readable when many low-variance PCs are retained.

plot_compare_long_subject_order(results, significance=0.05)

Compare longitudinal subject-order consistency across methods.

plot_compare_long_zscore_distributions(datasets, batch, features, covariates=None, draw_pdf=True, max_cols_in_plotting_grid=3)

Compare pooled robust z-score histograms by batch across methods.

plot_compare_long_within_subject_variability(results, max_cols_in_plotting_grid=3)

Compare within-subject variability summaries across methods.

plot_compare_long_additive_multiplicative(results, p_thr=0.05, max_cols_in_plotting_grid=3)

Compare additive and multiplicative residual batch effects across methods.

plot_compare_long_mixed_effects(results, max_cols_in_plotting_grid=3)

Compare mixed-effects outputs for pairwise batch signal and ICC.

plot_compare_long_biological_effects(results, p_thr=0.05, max_cols_in_plotting_grid=3)

Compare per-IDP biological effect estimates across methods.

plot_compare_long_multivariate_batch_difference(results, max_cols_in_plotting_grid=3)

Compare multivariate Mahalanobis batch differences across methods.