Learn R Programming

MOFA (version 1.3.1)

plotVarianceExplained: Plot variance explained by the model

Description

Method to plot variance explained (R-squared) by the MOFA model for each view and latent factor. As a measure of variance explained for gaussian data we adopt the coefficient of determination (R2). For details on the computation see the help of the calculateVarianceExplained function

Usage

plotVarianceExplained(object, cluster = TRUE, ...)

Arguments

object

a MOFAmodel object.

cluster

logical indicating whether to do hierarchical clustering on the plot

...

extra arguments to be passed to calculateVarianceExplained

Value

ggplot object

Examples

Run this code
# NOT RUN {
# Using an existing trained model on the CLL data
filepath <- system.file("extdata", "CLL_model.hdf5", package = "MOFAdata")
MOFA_CLL <- loadModel(filepath)
plotVarianceExplained(MOFA_CLL)

# Using an existing trained model on the scMT data
filepath <- system.file("extdata", "scMT_model.hdf5", package = "MOFAdata")
MOFA_scMT <- loadModel(filepath)
plotVarianceExplained(MOFA_scMT)
# }

Run the code above in your browser using DataLab