draw_taxa_heatmap: Draw a heatmap of the OTU abundances in a phyloseq object.

Description Usage Arguments Value Examples

Description

Draw a heatmap of the OTU abundances in a phyloseq object.

Usage

1
2
3
4
5
draw_taxa_heatmap(physeq, taxa_data, group, compare = NULL, block = NULL,
  max_abundance_for_color = NULL, log_transform = FALSE,
  border_color = "grey60", filename = NA, show_rownames = TRUE,
  gradient_steps = c(0.01, 0.1, 0.5, 1), cellwidth = NA, cellheight = NA,
  gaps_col = NULL, custom_palette = NULL)

Arguments

physeq

Phyloseq object

taxa_data

Taxa annotation to show.

group

Name of column in sample metadata to group samples on (1st layer).

compare

Vector of values in group column to compare (e.g., HFD vs Control).

block

Name of column in sample metadata to subgroup samples on (2nd layer).

max_abundance_for_color

Maximum abundance to use in the color scale.

log_transform

boolean specifying if data should be log-transformed.

border_color

Border color for the heatmap cells.

filename

Name of file to save the heatmap figure.

show_rownames

boolean specifying if column names are be shown.

cellwidth

cellwidth argument to pheatmap().

cellheight

cellheight argument to pheatmap().

gaps_col

gaps_col argument to pheatmap().

custom_palette

Custom palette list to use (see example).

Value

ggplot object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# Assuming that the 'physeq' variable has the genera for taxa, this will draw a heatmap of
# only the 4 genera listed in 'taxa_data' with samples first grouped by Diet and
# then by Enterotype. It will annotate the taxa based on their Phylum. Heatmap cells will have
# "grey60" borders.
pal = list(Diet = "Set2", Enterotype = "Pastel1", Significance = "PuRd")
taxa_data = list(Bacteroides = "Bacteroidetes", Prevotella = "Bacteroidetes", Roseburia = "Firmicutes", Blautia = "Firmicutes")
names(taxa_data) = c("Phylum")
draw_taxa_heatmap(physeq, taxa_data, group = "Diet", block = "Enterotype", custom_palette = pal, filename = "heatmap.pdf")

# Heatmap without borders
draw_taxa_heatmap(physeq, taxa_data, ..., border_color = NULL)

# Heatmap with black borders
draw_taxa_heatmap(physeq, taxa_data, ..., border_color = "black")

## End(Not run)

TBrach/MicrobiomeX documentation built on May 14, 2019, 2:28 p.m.