phy_betaPlotTaxon: Fancy MDS Plots

View source: R/phy_betaPlotTaxon.R

phy_betaPlotTaxonR Documentation

Fancy MDS Plots

Description

The function wraps the phyloseq functions "distance", "ordinate", and "plot_ordination". This function is useful to see the gradient of abundance of a taxon in the 2D ordinated dataset

Usage

phy_betaPlotTaxon(physeq, dist = "bray", method = "PCoA", axes = 1:2, taxon)

Arguments

physeq

A phyloseq object, **CAREFUL**: the function doesn't transform internally, so if you choose to calculate the distance matrix internally with "ordinate", make sure you transform the counts prior to function call (usually relative abundance is accepted)

dist

distance object or character vector saying the distance metric to apply

method

one of the methods allowed by "ordinate" in the phyloseq object

axes

The axes to be plotted, default are the first 2, which should discriminate samples better

taxon

the taxon name to color the samples by. The palette is "viridis_c"

Value

a ggplot2 object

Examples

data("enterotype")

phy_betaPlotTaxon(physeq = enterotype,
dist = "bray",
method = "PCoA",
axes = 1:2,
taxon = "Bacteroides")

g-antonello/gautils2 documentation built on Nov. 28, 2022, 9:39 a.m.