loadModel: loading a trained MOFA model

Description Usage Arguments Value Examples

View source: R/loadModel.R

Description

Method to load a trained MOFA model.
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
loadModel(file, object = NULL, sortFactors = TRUE, minR2 = 0.01)

Arguments

file

an hdf5 file saved by the MOFA python framework.

object

either NULL (default) or an an existing untrained MOFA object. If NULL, the MOFAmodel object is created from the scratch.

sortFactors

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

minR2

minimum R2 threshold to call 'active' factors (default is 0.01).

Value

a MOFAmodel model.

Examples

1
2
3
4
# path to the hdf5 file
filepath <- system.file("extdata", "CLL_model.hdf5", package = "MOFAdata")
# load the model
MOFAobject <- loadModel(filepath)

MOFA documentation built on Feb. 11, 2021, 2:01 a.m.