taxa_abundance_bars: Create a ggplot object of the abundance barplots from a...

View source: R/taxa_abundance_bars.R

taxa_abundance_barsR Documentation

Create a ggplot object of the abundance barplots from a phyloseq object. Function from the phylosmith-package.

Description

Inputs a phyloseq-class object and creates barplots of taxa by treatment.

Usage

taxa_abundance_bars(phyloseq_obj, treatment = NULL, subset = NULL,
classification = NULL, transformation = "none", colors = "default",
wrap_by = NULL, treatment_labels = NULL, sample_labels = NULL,
classification_labels = NULL)

Arguments

phyloseq_obj

A phyloseq-class object. It must contain sample_data()) with information about each sample, and it must contain tax_table()) with information about each taxa/gene.

treatment

Column name as a string or number in the sample_data. This can be a vector of multiple columns and they will be combined into a new column.

subset

A factor within the treatment. This will remove any samples that to not contain this factor. This can be a vector of multiple factors to subset on.

classification

Column name as a string or number in the tax_table for the factor to use for node colors.

transformation

Transformation to be used on the data. "none", "mean", "median", "sd", "log", "log10"

colors

Name of a color set from the RColorBrewer package or a vector palette of R-accepted colors.

wrap_by

Column name as a string or number in the phyloseq sample_data to facet the ggplot figure by.

treatment_labels

a vector of names to be used as labels for treatments/facets.

sample_labels

a vector of names to be used as labels for Samples.

classification_labels

a vector of names to be used as labels for the taxonomic classifications.

Value

ggplot-object

Examples

taxa_abundance_bars(
taxa_filter(soil_column, frequency = 0.8),
classification = 'Phylum', treatment = c('Matrix', 'Treatment'),
subset = 'Unamended', transformation = 'mean')

schuyler-smith/phyloschuyler documentation built on March 27, 2024, 4:29 p.m.