loadModel {MOFA} | R Documentation

## loading a trained MOFA model

### 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

    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

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

[Package MOFA version 1.2.0 Index]