plot_taxa_boxplot: Taxonomic Composition Plot boxplot

View source: R/plot_taxa_boxplot.R

plot_taxa_boxplotR Documentation

Taxonomic Composition Plot boxplot

Description

Plot taxon abundance for samples.

Usage

plot_taxa_boxplot(
  x,
  taxonomic.level,
  top.otu,
  keep.other = FALSE,
  group,
  title,
  group.colors = NULL,
  group.order = NULL,
  add.violin = TRUE,
  violin.opacity = 0.25,
  box.opacity = 0.25,
  dot.opacity = 0.25,
  dot.size = 2
)

Arguments

x

phyloseq-class object

taxonomic.level

Merge the OTUs (for phyloseq object) into a higher taxonomic level. This has to be one from colnames(tax_table(x)).

top.otu

Top number of taxa to plot.

keep.other

TRUE or FALSE. Default is FALSE. This will not plot taxa group as Other

group

Specify main variable of interest. This should be one of the variables in sample_variables(x).

title

title for the plot

group.colors

Colors for plotting groups

group.order

Default is NULL. a list specifing order of x-axis. E.g. c("H","CRC","nonCRC")

add.violin

Loical. If half violoin to the added. Default=TRUE

violin.opacity

If add.violin=TRUE, opacity for violin.

box.opacity

For ggplot alpha to determine opacity for box

dot.opacity

For ggplot alpha to determine opacity for points

dot.size

For ggplot alpha to determine size for points

Value

A ggplot plot object.

Examples

## Not run: 
# Example data
library(microbiomeutilities)
library(RColorBrewer)
data("zackular2014")
ps0 <- zackular2014
mycols <- c("brown3", "steelblue", "grey50")
pn <- plot_taxa_boxplot(ps0,
  taxonomic.level = "Phylum",
  top.otu = 6,
  group = "DiseaseState",
  title = "Relative abudance plot",
  keep.other = FALSE,
  group.order = c("H", "CRC", "nonCRC"),
  group.colors = mycols
)
print(pn + theme_biome_utils())

## End(Not run)


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