plotFactorScatters: Pairwise scatterplots of multiple latent factors

Description Usage Arguments Details Value Examples

View source: R/plotFactors.R

Description

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

Usage

1
2
3
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)

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.

Value

ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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)

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