create_mofa_from_df: create a MOFA object from a data.frame object

View source: R/create_mofa.R

create_mofa_from_dfR Documentation

create a MOFA object from a data.frame object

Description

Method to create a MOFA object from a data.frame object

Usage

create_mofa_from_df(df, extract_metadata = TRUE)

Arguments

df

data.frame object with at most 5 columns: sample, group, feature, view, value. The group column (optional) indicates the group of each sample when using the multi-group framework. The view column (optional) indicates the view of each feature when having multi-view data.

extract_metadata

logical indicating whether to incorporate the extra columns as sample metadata into the MOFA object

Value

Returns an untrained MOFA object

Examples

# Using an existing simulated data with two groups and two views
file <- system.file("extdata", "test_data.RData", package = "MOFA2")

# Load data (in long data.frame format)
load(file) 
MOFAmodel <- create_mofa_from_df(dt)

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