make_example_data: Simulate a data set using the generative model of MOFA

View source: R/make_example_data.R

make_example_dataR Documentation

Simulate a data set using the generative model of MOFA

Description

Function to simulate an example multi-view multi-group data set according to the generative model of MOFA2.

Usage

make_example_data(
  n_views = 3,
  n_features = 100,
  n_samples = 50,
  n_groups = 1,
  n_factors = 5,
  likelihood = "gaussian",
  lscales = 1,
  sample_cov = NULL,
  as.data.frame = FALSE
)

Arguments

n_views

number of views

n_features

number of features in each view

n_samples

number of samples in each group

n_groups

number of groups

n_factors

number of factors

likelihood

likelihood for each view, one of "gaussian" (default), "bernoulli", "poisson", or a character vector of length n_views

lscales

vector of lengthscales, needs to be of length n_factors (default is 0 - no smooth factors)

sample_cov

(only for use with MEFISTO) matrix of sample covariates for one group with covariates in rows and samples in columns or "equidistant" for sequential ordering, default is NULL (no smooth factors)

as.data.frame

return data and covariates as long dataframe

Value

Returns a list containing the simulated data and simulation parameters.

Examples

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

bioFAM/MOFA2 documentation built on Feb. 1, 2024, 6:41 a.m.