plot_ordiplot_core: Plotting core microbiota on ordinations

View source: R/plot_ordiplot_core.R

plot_ordiplot_coreR Documentation

Plotting core microbiota on ordinations

Description

This function will plot the ordaination along with highligthing the core microbes on the species ordination.

Usage

plot_ordiplot_core(
  x,
  ordiObject,
  prevalences,
  detections,
  min.prevalence,
  color.opt,
  shape,
  Samples = c(TRUE, FALSE)
)

Arguments

x

phyloseq-class object

ordiObject

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

prevalences

Prevalences as supported by microbiome package.

detections

Detections as supported by microbiome package.

min.prevalence

Minimum prevalence value to plot.

color.opt

Variable of interest from metadata.

shape

Variable of interest from metadata.

Samples

c("TRUE" or "FALSE")

Details

This function is useful for visualizing core taxa in a 2D ordination plot.

Value

plot

Examples

## Not run: 

library(microbiomeutilities)
library(RColorBrewer)
data("zackular2014")
p0 <- zackular2014
ps1 <- format_to_besthit(p0)
ps1 <- subset_samples(ps1, DiseaseState == "H")
ps1 <- prune_taxa(taxa_sums(ps1) > 0, ps1)
prev.thres <- seq(.05, 1, .05)
det.thres <- 10^seq(log10(1e-4), log10(.2), length = 10)
pseq.rel <- microbiome::transform(ps1, "compositional")
ord.bray <- ordinate(pseq.rel, "NMDS", "bray")

p <- plot_ordiplot_core(pseq.rel, ord.bray,
  prev.thres, det.thres,
  min.prevalence = 0.9,
  color.opt = "DiseaseState", shape = NULL, Sample = TRUE
)
p

## End(Not run)

microsud/microbiomeutilities documentation built on Nov. 29, 2022, 12:18 a.m.