load_model: Load a trained MOFA

Description Usage Arguments Value Examples

View source: R/load_model.R

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

1
2
3
4
5
6
7
8
9
load_model(
  file,
  sort_factors = TRUE,
  on_disk = FALSE,
  load_data = TRUE,
  remove_outliers = FALSE,
  remove_inactive_factors = TRUE,
  verbose = 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)

Value

a MOFA model

Examples

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

MOFA2 documentation built on Nov. 8, 2020, 7:28 p.m.