plotBeta: Plot beta diversity

Description Usage Arguments Value Examples

View source: R/inter_functions.R

Description

This functions plots the beta diversity as a PCoA plot.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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

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

microbiomeExplorer documentation built on Nov. 8, 2020, 8:16 p.m.