Learn R Programming

SUMO (version 1.2.3)

demo_multiomics_analysis: Demonstration of SUMO Utility in Multi-Omics Analysis using MOFA2

Description

Run a complete MOFA2 workflow on either SUMO-generated data or the real-world CLL dataset. The function handles preprocessing and model training (preferring MOFA2's basilisk; falling back to a user reticulate env if configured), or loads a bundled pretrained model. It then creates summary visualizations and can export a multi-slide PowerPoint report.

Usage

demo_multiomics_analysis(
  data_type = c("SUMO", "real_world"),
  export_pptx = TRUE,
  verbose = TRUE,
  use_pretrained = c("auto", "always", "never")
)

Value

Invisibly returns the trained (or loaded) MOFA model object.

Arguments

data_type

Character. "SUMO" (synthetic) or "real_world" (CLL).

export_pptx

Logical. If TRUE, write a PowerPoint report (multiple slides). Default TRUE.

verbose

Logical. If TRUE, print progress messages. Default TRUE.

use_pretrained

One of "auto", "always", "never".

  • "auto": train if a backend is available, otherwise load a pretrained model.

  • "always": always load a pretrained model and skip training.

  • "never": always train (requires a working Python backend for MOFA2).

Details

Backend selection. Training prefers MOFA2's basilisk backend when available; otherwise a reticulate/conda environment is used if configured via sumo_setup_mofa(). If neither is available and use_pretrained = "auto", the function loads a pretrained model shipped under inst/extdata/.

PowerPoint contents (when export_pptx = TRUE):

  • Title slide (dataset label and generation date)

  • Data overview: plot_data_overview()

  • Factor correlation: plot_factor_cor()

  • Variance explained:

    • by view x factor, and

    • by group x factor (with totals) via plot_variance_explained()

  • Factor visualizations:

    • beeswarms for factors 1-3 via plot_factor()

    • a customized F1 vs F2 plot

    • scatter plots of factor combinations via plot_factors()

  • Feature weights:

    • plot_weights() and plot_top_weights() (first view, factor 1)

  • Input-data views:

    • heatmap via plot_data_heatmap() and

    • feature-factor scatter via plot_data_scatter() (second view if present)

  • Non-linear embedding (if available): t-SNE via run_tsne() + plot_dimred()

  • Table slides (heads/summaries):

    • sample metadata (head)

    • total R^2 per view/group (head)

    • R^2 per factor x view/group (head)

    • dimensions summary (factors/weights/data)

    • long-format heads from get_factors(), get_weights(), get_data()

Plots are rasterized for portability when embedding in PPT (vector export is used when supported).

See Also

simulate_twoOmicsData(), plot_factor(), plot_weights(), sumo_setup_mofa(), sumo_mofa_backend(), sumo_load_pretrained_mofa()

Examples

Run this code
if (
  interactive() &&
  requireNamespace("MOFA2", quietly = TRUE) &&
  requireNamespace("systemfonts", quietly = TRUE) &&
  utils::packageVersion("systemfonts") >= "1.1.0" &&
  identical(Sys.getenv("NOT_CRAN"), "true")
) {
  # Use pretrained models (no Python needed):
  demo_multiomics_analysis("SUMO",       export_pptx = TRUE, use_pretrained = "always")
  demo_multiomics_analysis("real_world", export_pptx = TRUE, use_pretrained = "always")

  # To train (when basilisk or a reticulate env is available):
  # demo_multiomics_analysis("real_world", export_pptx = TRUE, use_pretrained = "never")
}

Run the code above in your browser using DataLab