plot_ts_heatmap: Plot taxa summary heatmap

View source: R/taxonomy-based.R

plot_ts_heatmapR Documentation

Plot taxa summary heatmap

Description

A quick way to create a heatmap from a taxa summary dataframe. Samples are grouped by a category that is specified in type_header.

Usage

plot_ts_heatmap(
  tax_table,
  metadata_map,
  min_rel_abund,
  type_header,
  scale_by = "all",
  custom_sample_order,
  rev_taxa = FALSE,
  custom_taxa_order,
  other_label,
  remove_other = FALSE,
  colors = c("blue", "white", "red")
)

Arguments

tax_table

A taxa table dataframe. The output of summarize_taxonomy.

metadata_map

A metadata mapping dataframe. Usually, input$map_loaded

min_rel_abund

The minimum mean relative abundance for a taxon to not be grouped into 'Other'. Between 0 and 1.

type_header

The metadata_map header label used to group samples.

scale_by

[OPTIONAL] Whether to scale colors by (a) 'sample_types', (b) 'taxa', or (c) 'all'. Default = 'all'.

custom_sample_order

[OPTIONAL] A vector with the order of the sample names (top to bottom).

rev_taxa

[OPTIONAL] Set to TRUE if you want to reverse the order of the taxon strings. Useful if using with [ggplot2]{coord_flip} in ggplot2 to rotate the plot 90 degrees.

custom_taxa_order

[OPTIONAL] A vector with the order of the taxa names (top to bottom). Note that these are the names after grouping low abundance taxa into either 'Other' or your custom other_label.

other_label

[OPTIONAL] A string to relabel the 'Other' taxa category which contain all taxa less than min_rel_abund.

remove_other

[OPTIONAL] Set to TRUE if you want to remove the line representing the 'Other' taxa category.

colors

[OPTIONAL] A vector with custom fill colors (low, mid, high).

Examples

ts = summarize_taxonomy(fruits_veggies, 2)
plot_ts_heatmap(ts, fruits_veggies$map_loaded, 0.03, 'Sample_type')

leffj/mctoolsr documentation built on Aug. 5, 2022, 1:27 a.m.