add_mofa_factors_to_seurat: Function to add the MOFA representation onto a Seurat object

View source: R/utils.R

add_mofa_factors_to_seuratR 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()

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