Learn R Programming

MOFA (version 1.3.1)

plotFactorScatters: Pairwise scatterplots of multiple latent factors

Description

Scatterplots of the sample values for pair-wise combinations of multiple latent factors.

Usage

plotFactorScatters(object, factors = "all", showMissing = TRUE,
  color_by = NULL, name_color = "", shape_by = NULL,
  name_shape = "")

Arguments

object

a MOFAmodel object.

factors

character vector with the factor name(s), or numeric vector with the index of the factor(s) to use. Default is 'all'

showMissing

logical indicating whether to include samples for which shape_by or color_by is missing

color_by

specifies groups or values used to color the samples. This can be either: a character giving the name of a feature present in the training data, a character giving the same of a covariate (only if using MultiAssayExperiment as input), or a vector of the same length as the number of samples specifying discrete groups or continuous numeric values.

name_color

name for color legend (usually only used if color_by is not a character itself)

shape_by

specifies groups or values used to shape the samples. This can be either: a character giving the name of a feature present in the training data, a character giving the same of a covariate (only if using MultiAssayExperiment as input), or a vector of the same length as the number of samples specifying discrete groups.

name_shape

name for shape legend (usually only used if shape_by is not a character itself)

Value

ggplot2 object

Details

One of the first steps for the annotation of factors is to visualise and overlap them with known covariates such as phenotypic or clinical data. This method generates multiple scatterplots for pairwise combinations of several latent factors. Similar functions are plotFactorScatter for doing single scatter plots and plotFactorBeeswarm for doing Beeswarm plots for single factors.

Examples

Run this code
# NOT RUN {
# Example on the CLL data
filepath <- system.file("extdata", "CLL_model.hdf5", package = "MOFAdata")
MOFA_CLL <- loadModel(filepath)
plotFactorScatters(MOFA_CLL, factors=1:3)
plotFactorScatters(MOFA_CLL, factors=1:3, color_by= "IGHV")

# Example on the scMT data
filepath <- system.file("extdata", "scMT_model.hdf5", package = "MOFAdata")
MOFA_scMT <- loadModel(filepath)
plotFactorScatters(MOFA_scMT)
# }

Run the code above in your browser using DataLab