Skip to contents

Generates a tidy dataframe of feature weights for factors of interest useful for plotting function and enrichment analysis

Usage

get_geneweights(model, factor)

Arguments

model

A MOFA2 model.

factor

A string character to define the factor to be extracted.

Value

A dataframe in a tidy format containing the factor feature weights

Details

This function simplifies the extraction of factor feature weights from MOFA models.

Examples

inputs_dir <- base::system.file("extdata", package = "MOFAcellulaR")
model <- MOFA2::load_model(file.path(inputs_dir, "testmodel.hdf5"))
#> Warning: Factor(s) 1 are strongly correlated with the total number of expressed features for at least one of your omics. Such factors appear when there are differences in the total 'levels' between your samples, *sometimes* because of poor normalisation in the preprocessing steps.
gene_weights <- get_geneweights(model = model,
                                factor = "Factor1")