plotBeta: Plot beta diversity

View source: R/inter_functions.R

plotBetaR Documentation

Plot beta diversity

Description

This functions plots the beta diversity as a PCoA plot.

Usage

plotBeta(
  aggdat,
  dim = c(1, 2),
  log = TRUE,
  dist_method = "bray",
  pcas = NULL,
  nfeatures = nrow(aggdat),
  col_by = NULL,
  shape_by = NULL,
  plotTitle = "",
  xlab = NULL,
  ylab = NULL,
  pt_size = 8,
  plotText = NULL,
  confInterval = NULL,
  allowWebGL = TRUE,
  pwidth = 550,
  pheight = 550
)

Arguments

aggdat

aggregated MRExperiment

dim

Vector of length 2 specifying which dimensions to plot.

log

Log2 transform data. Default is TRUE.

dist_method

Which distance method to use. See ?vegan::vegdist for more vegdist() for options. Default is "bray".

pcas

precalculated pcas to avoid recalculation via CalcPCs

nfeatures

Number of top features in terms of standard deviation. Default is all.

col_by

Phenotype for coloring.

shape_by

Phenotype for shape.

plotTitle

Plot title. By default, becomes PCoA (codedist.method).

xlab

X-axis label. By default, shows dimension and percent variance explained.

ylab

Y-axis label. By default, shows dimension and percent variance explained.

pt_size

the size of the markers

plotText

adonis text to be added to plot

confInterval

numeric value indicating confidence level for ellipses

allowWebGL

boolean indicating if WebGL should be used

pwidth

overall plot width; default is 550 (125 are added for legend)

pheight

overall plot height; default is 550

Value

plotly plot object

Examples

data("mouseData", package = "metagenomeSeq")
aggdat <- aggFeatures(mouseData, level = "genus")
plotBeta(aggdat)


zoecastillo/microbiomeExplorer documentation built on Sept. 11, 2022, 7:40 a.m.