API#

Core#

DataOptions(*[, group_by, layer, ...])

Options for the data.

ModelOptions(*[, n_factors, weight_prior, ...])

Options for the model.

TrainingOptions(*[, device, batch_size, ...])

Options for training.

SmoothOptions(*[, n_inducing, kernel, ...])

Options for Gaussian processes.

MOFAFLEX(data, *args)

Fit the model using the provided data.

FeatureSet(features, name[, description])

Class for storing a single set of features (genes).

FeatureSets(feature_sets[, name, remove_empty])

Class for storing a collection of feature sets (see FeatureSet).

Presets#

Presets corresponding to different previously published factor analysis models.

These can be used by passing them to the MOFAFLEX constructor: MOFAFLEX(*preset).

mofaflex.presets.MOFA

Options used to reproduce MOFA results in the MOFA-FLEX paper.

mofaflex.presets.MEFISTO

Options used to reproduce MEFISTO results in the MOFA-FLEX paper.

mofaflex.presets.NSF

Options used to reproduce NSF results in the MOFA-FLEX paper.

Settings#

An instance of the _core.settings.Settings class is available as mofaflex.settings and allows configuring MOFA-FLEX.

_core.settings.Settings(*[, use_dask, ...])

Global settings.

Tools#

tl.DataGenerator(n_features[, n_samples, ...])

Generator class for creating synthetic multi-view data with latent factors.

tl.factor_correlation(model)

Calculate the correlation between factors.

tl.get_free_gpu_idx()

Get the index of the GPU with current lowest memory usage.

tl.match(reference, permutable, axis)

Find optimal permutation and signs to match two tensors along specified axis.

tl.msigdb_get_features([category, dbver, entrez])

Get gene sets from the MSIGDB molecular signatures database.

tl.msigdb_list_categories([dbver])

List available MSIGDB categories for the given database version.

tl.msigdb_list_versions()

List available versions of the MSIGDB molecular signature database.

tl.test_annotation_significance(model, annotations)

Test feature sets for significant associations with model factors.

Plotting#

pl.all_weights(model[, views, clip, ...])

Plot the weight matrices.

pl.covariates_factor_scatter(model, factor[, ...])

Plot a factor against one or two covariate dimensions.

pl.factor(model[, factor, show_featurenames, ...])

Plot factor values (y-axis) for each sample (x-axis).

pl.factor_correlation(model[, figsize])

Plot the correlation between factors.

pl.factor_significance(model[, n_factors, ...])

Plot an overview of the factors summarizing the PCGSE results along with the variance explained per factor.

pl.factor_sparsity_histogram(model[, bins, ...])

Plot a histogram of probabilities that factors are non-zero for views with SnS prior.

pl.factors_covariate(model, covariate1[, ...])

Plot every factor against one or two covariates.

pl.factors_scatter(model, x, y[, groups, ...])

Plot two factors against each other and color by covariates.

pl.gp_covariate(model[, ci_opacity, group, ...])

Plot the fitted GP mean for each factor in each group at the data covariate locations.

pl.overview(data[, group_by, missingcolor, ...])

Generate an overview plot of missing data across different views and groups.

pl.smoothness(model[, figsize])

Plot the smoothness of the GP for each factor.

pl.top_weights(model[, n_features, views, ...])

Plot the top weights for a given factor and view.

pl.training_curve(model[, linecolor, ...])

Plot the training curve: -ELBO vs epoch.

pl.variance_explained(model[, group_by, figsize])

Plot the variance explained per factor in each group and view.

pl.weight_sparsity_histogram(model[, bins, ...])

Plot a histogram of probabilities that weights are non-zero for views with SnS prior.

pl.weights(model[, n_features, views, factors, ...])

Plot the weights for a given factor and view.