This function extends the plot_ordination function of phyloseqto highlight the top taxa loadings on the species ordination.

plot_ordination_utils(
  x,
  ordiObject,
  color.opt = NULL,
  plot.arrow = TRUE,
  scale.arrow = NULL,
  top.taxa = 5
)

Arguments

x

phyloseq-class object

ordiObject

Output of ordinate from package phyloseq. Only NMDS/CCA and Bray supported.

color.opt

Variable of interest from metadata.

plot.arrow

If arrow should be plotted for species either TRUE or FALSE.

scale.arrow

If arrow is plotted a constant to multiply axis values for clearing visualisations.

top.taxa

Top varying taxa to plot, default is 5.

Value

plot

Details

This function is useful for visualizing specifc taxa that could be important in explaining variations in ordinations.

Examples

if (FALSE) {

library(microbiomeutilities)
library(RColorBrewer)
data("zackular2014")
ps1 <- zackular2014
ps2 <- tax_glom(ps1, "Genus")
ps2f <- format_to_besthit(ps2)
orddi <- ordinate(ps2f, method = "CCA", distance = "bray")
p <- plot_ordination_utils(ps2f, orddi,
  color = "DiseaseState", plot.arrow = TRUE,
  scale.arrow = 1.3, top.taxa = 5
)
print(p)
}