Learn R Programming

SUMO (version 1.2.3)

plot_simData: Visualize simulated multi-omics data as a heatmap

Description

Quick visualization of simulated omics data as a base R heatmap. You can plot the merged/concatenated matrix across all omics or a single omic layer. Optionally permute sample and/or feature order (with a seed) to conceal block structure for sanity checks.

Usage

plot_simData(
  sim_object,
  data = "merged",
  type = "heatmap",
  permute = FALSE,
  permute_seed = NULL,
  permute_samples = TRUE,
  permute_features = TRUE
)

Value

Invisibly returns the numeric matrix that was plotted (after any permutations).

Arguments

sim_object

List-like simulation result. Must contain omics, a named list of numeric matrices (samples in rows, features in columns).

data

Character. Which matrix to visualize:

  • "merged" or "concatenated": column-bind all omics (default: "merged").

  • a single omic name present in names(sim_object$omics).

type

Character. Plot type. Currently only "heatmap" is supported.

permute

Logical. If TRUE, apply permutations according to permute_samples and permute_features. Default: FALSE.

permute_seed

Integer or NULL. If not NULL, sets RNG seed once for reproducible permutations. Default: NULL.

permute_samples

Logical. If TRUE and permute = TRUE, permute sample order (rows). Default: TRUE.

permute_features

Logical. If TRUE and permute = TRUE, permute feature order (columns). Default: TRUE.

Details

The function expects sim_object$omics to be a named list of numeric matrices with the same number of rows (samples). For data = "merged" (or "concatenated"), all omic matrices are column-bound in their current order (subject to optional permutation) and plotted together.

See Also

simulateMultiOmics

Examples

Run this code
set.seed(123)
sim_object <- simulate_twoOmicsData(
  vector_features = c(4000, 3000),
  n_samples = 100,
  n_factors = 2,
  snr = 2.5,
  num.factor = "multiple",
  advanced_dist = "mixed"
)
output_obj = as_multiomics(sim_object)

# Merged (concatenated) heatmap
plot_simData(output_obj, data = "merged", type = "heatmap")

# Single omic with reproducible permutation
plot_simData(output_obj, data = "omic2", permute = TRUE, permute_seed = 123)

Run the code above in your browser using DataLab