get_covariates: Get sample covariates

View source: R/mefisto.R

get_covariatesR Documentation

Get sample covariates

Description

Function to extract the covariates from a MOFA object using MEFISTO.

Usage

get_covariates(
  object,
  covariates = "all",
  as.data.frame = FALSE,
  warped = FALSE
)

Arguments

object

a MOFA object.

covariates

character vector with the covariate name(s), or numeric vector with the covariate index(es).

as.data.frame

logical indicating whether to output the result as a long data frame, default is FALSE.

warped

logical indicating whether to extract the aligned covariates

Value

a matrix with dimensions (samples,covariates). If as.data.frame is TRUE, a long-formatted data frame with columns (sample,factor,value)

Examples

# Using an existing trained model
file <- system.file("extdata", "MEFISTO_model.hdf5", package = "MOFA2")
model <- load_model(file)
covariates <- get_covariates(model)

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