getImputedData: getImputedData

Description Usage Arguments Value Examples

View source: R/getMethods.R

Description

Function to get the imputed data. It requires the previous use of the impute method.

Usage

1
2
getImputedData(object, views = "all", features = "all",
  as.data.frame = FALSE)

Arguments

object

a trained MOFAmodel object.

views

character vector with the view name(s), or numeric vector with the view index(es). Default is "all".

features

list of character vectors with the feature names or list of numeric vectors with the feature indices. Default is "all"

as.data.frame

logical indicating whether to return a long-formatted data frame instead of a list of matrices. Default is FALSE.

Value

By default returns a list where each element is a matrix with dimensionality (D,N), where D is the number of features in this view and N is the number of samples.
Alternatively, if as.data.frame is TRUE, returns a long-formatted data frame with columns (view,feature,sample,value).

Examples

1
2
3
4
5
6
7
8
# load a trained MOFAmodel object
filepath <- system.file("extdata", "CLL_model.hdf5", package = "MOFAdata")
MOFAobject <- loadModel(filepath)
# impute missing values
MOFAobject <- impute(MOFAobject)
# get imputations for a single view
imputedDrugs <- getImputedData(MOFAobject,view="Drugs")
head(imputedDrugs)

bioFAM/MOFA documentation built on Oct. 3, 2020, 12:53 a.m.