abundance_heatmap: Create a heatmap of the abundance table from a phyloseq...

View source: R/abundance_heatmap.R

abundance_heatmapR Documentation

Create a heatmap of the abundance table from a phyloseq object. Function from the phylosmith-package.

Description

Takes a phyloseq-class object as input and creates a ggplot-heatmap of the abundances across samples. The default color choice is the viridis palette, which is supposed to be both aesthetic for normal and color-blind viewers.

Usage

abundance_heatmap(phyloseq_obj, treatment, subset = NULL,
classification = NULL, transformation = 'none', colors = 'default',
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.

transformation

Transformation to be used on the data. "none", "relative_abundance", "log", "log10", "log1p", "log2", "asn", "atanh", "boxcox", "exp", "identity", "logit", "probability", "probit", "reciprocal", "reverse" and "sqrt"

colors

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

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

abundance_heatmap(soil_column, classification = 'Phylum',
treatment = c('Matrix', 'Treatment'), transformation = 'log')

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