plotFactorBeeswarm: Beeswarm plot of latent factors

Description Usage Arguments Details Value Examples

View source: R/plotFactors.R

Description

Beeswarm plot of the latent factor values.

Usage

1
2
3
plotFactorBeeswarm(object, factors = "all", color_by = NULL,
  shape_by = NULL, name_color = "", name_shape = "",
  showMissing = FALSE)

Arguments

object

a trained 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'

color_by

specifies groups or values used to color the samples. This can be either: a character giving the name of a feature, 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.

shape_by

specifies groups or values used for the shape of samples. See color_by for how this can be specified. A maximum of 6 different values can be specified.

name_color

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

name_shape

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

showMissing

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

Details

One of the main steps for the annotation of factors is to visualise and color them using known covariates or phenotypic data.
This function generates a Beeswarm plot of the sample values in a given latent factor.
Similar functions are plotFactorScatter for doing scatter plots and plotFactorHist for doing histogram plots

Value

Returns a 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)
plotFactorBeeswarm(MOFA_CLL, factors=1:3)
plotFactorBeeswarm(MOFA_CLL, factors=1:2, color_by= "IGHV")

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

MOFA documentation built on Feb. 11, 2021, 2:01 a.m.