load_model: Load a trained MOFA

View source: R/load_model.R

load_modelR Documentation

Load a trained MOFA

Description

Method to load a trained MOFA
The training of mofa is done using a Python framework, and the model output is saved as an .hdf5 file, which has to be loaded in the R package.

Usage

load_model(
  file,
  sort_factors = TRUE,
  on_disk = FALSE,
  load_data = TRUE,
  remove_outliers = FALSE,
  remove_inactive_factors = TRUE,
  verbose = FALSE,
  load_interpol_Z = FALSE
)

Arguments

file

an hdf5 file saved by the mofa Python framework

sort_factors

logical indicating whether factors should be sorted by variance explained (default is TRUE)

on_disk

logical indicating whether to work from memory (FALSE) or disk (TRUE).
This should be set to TRUE when the training data is so big that cannot fit into memory.
On-disk operations are performed using the HDF5Array and DelayedArray framework.

load_data

logical indicating whether to load the training data (default is TRUE, it can be memory expensive)

remove_outliers

logical indicating whether to mask outlier values.

remove_inactive_factors

logical indicating whether to remove inactive factors from the model.

verbose

logical indicating whether to print verbose output (default is FALSE)

load_interpol_Z

(MEFISTO) logical indicating whether to load predictions for factor values based on latent processed (only relevant for models trained with covariates and Gaussian processes, where prediction was enabled)

Value

a MOFA model

Examples

#' # Using an existing trained model on simulated data
file <- system.file("extdata", "model.hdf5", package = "MOFA2")
model <- load_model(file)

bioFAM/MOFA2 documentation built on June 12, 2024, 3:57 p.m.