Skip to contents

Multivariate random forests for multi-omics integration

multiRF is an R package for integrating matched multi-omics datasets with multivariate random forests (MRF). It fits directed forest models across omics blocks, learns sample-by-sample similarity from shared terminal-node structure, and decomposes the result into shared and omics-specific components for clustering, variable selection, and visualization.

multiRF directly supports multivariate regression and unsupervised random forests, including forest weights, proximity matrices, enhanced proximity with sibling-leaf corrections, and forest IMD. The standard workflow does not require randomForestSRC, which remains available as an optional fallback. Parts of the implementation, including sampling and random-number-generation routines, are adapted from randomForestSRC under GPL (>= 3).

Project website: https://novawz.github.io/multiRF/

Installation

remotes::install_github("novawz/multiRF")

The package compiles from source and requires a C++17 toolchain:

  • macOS: Xcode Command Line Tools
  • Windows: Rtools
  • Linux: g++ or clang++

OpenMP is recommended for parallel tree construction. randomForestSRC is not required for the default workflow.

Quick start

library(multiRF)
data("tcga_brca_data")

names(tcga_brca)
#> [1] "gene"  "methy" "mirna"

fit <- mrf3(
  tcga_brca,
  k = 4,
  ntree = 100,
  filter_mode = "none",
  run_imd = TRUE,
  seed = 529
)

summary(fit)
table(get_clusters(fit))
get_top_vars(fit, n = 10)

mrf3() is the main user-facing entry point. It wraps the staged workflow in mrf3_fit() and forwards advanced arguments through .... Both entry points use automatic feature filtering by default; set filter_mode = "none" when working with an already curated feature set, as in the example above.

The default similarity workflow retains all directed forests. It removes their diagonal weights, row-normalizes after model top-v truncation, normalizes modularity scores within each response block, and uniformly averages the per-response matrices. A top-v value at least 80% of the sample size is treated as no truncation. Shared and omics-specific similarities use S = W W^T with a zero diagonal and spectral clustering by default.

What it provides

Clustering modes

fit_sim <- mrf3(
  tcga_brca,
  k = 4,
  ntree = 100,
  main_clustering = "similarity", # default
  seed = 529
)

fit_prox <- mrf3(
  tcga_brca,
  k = 4,
  ntree = 100,
  main_clustering = "proximity",
  seed = 529
)

fit_enh <- mrf3(
  tcga_brca,
  k = 4,
  ntree = 100,
  main_clustering = "enhanced_proximity",
  seed = 529
)

Full workflow example

fit_full <- mrf3(
  tcga_brca,
  k = 4,
  ntree = 200,
  run_imd = TRUE,
  run_variable_selection = TRUE,
  run_robust_clustering = TRUE,
  variable_selection_args = list(method = "mixture"),
  model_top_v = 50,
  fused_top_v = 30,
  seed = 529
)

Variable selection uses raw forest IMD values on [0, 1]:

  • filter uses OOB normalized MSE to tune the shared-IMD cutoff and a permutation-null cutoff for residual-specific IMD.
  • mixture models the IMD distribution with a point mass at zero and retains features assigned to the nonzero signal component.
  • transformation standardizes each feature’s IMD relative to the overall forest IMD distribution and retains features in the upper tail at the chosen level.

Connection selection is independent of these feature-selection rules.

Bundled data

  • tcga_brca: TCGA BRCA example with gene, methy, and mirna blocks
  • tcga_brca_clinical: matched clinical annotations including subtype and survival information

Citation

If you use multiRF in your research, please cite:

Zhang, W., Wang, L., Franzmann, E. J., and Chen, X. S. (2026). Multivariate Random Forests for Cross-Modal Multi-Omics Integration. bioRxiv. doi:10.64898/2026.06.17.732933

Zhang, W. et al. (2025). An integrative multi-omics random forest framework for robust biomarker discovery. GigaScience, 14, giaf148. doi:10.1093/gigascience/giaf148

multiRF adapts parts of randomForestSRC and also supports it as an optional fallback; please also cite:

Ishwaran, H., and Kogalur, U. B. (2026). randomForestSRC: Fast Unified Random Forests for Survival, Regression, and Classification (RF-SRC). R package version 3.6.2. doi:10.32614/CRAN.package.randomForestSRC

Ishwaran, H., and Kogalur, U. B. (2007). Random survival forests for R. R News, 7(2), 25–31. Article

License

multiRF is distributed under GPL version 3 or later. Portions adapted from randomForestSRC retain their original copyright; see inst/COPYRIGHTS for details.