add_mofa_factors_to_seurat {MOFA2} | R Documentation

## Function to add the MOFA representation onto a Seurat object

### Description

Function to add the MOFA latent representation to a Seurat object

### Usage

    add_mofa_factors_to_seurat(
      mofa_object,
      seurat_object,
      views = "all",
      factors = "all"
    )

### Arguments

`mofa_object` | a trained `MOFA` object.
`seurat_object` | a Seurat object
`views` | character vector with the view names, or numeric vector with view indexes. Default is 'all'
`factors` | character vector with the factor names, or numeric vector with the factor indexes. Default is 'all'

### Details

This function calls the `CreateDimReducObject` function from Seurat to store the MOFA factors.

### Value

Returns a Seurat object with the 'reductions' slot filled with the MOFA factors. Also adds, if calculated, the UMAP/TSNE obtained with the MOFA factors.

### Examples

    # Generate a simulated data set
    MOFAexample <- make_example_data()

[Package MOFA2 version 1.4.0 Index]