phylo.discrete_trait_OTU: Highlight taxa in a phylogeny using a discrete variable

View source: R/treetools.R

phylo.discrete_trait_OTUR Documentation

Highlight taxa in a phylogeny using a discrete variable

Description

This function highlights taxa in a phylogeny using the groupOTU function in tidytree/ggtree.

Usage

phylo.discrete_trait_OTU(
  phylo,
  trait_list = NULL,
  color_palette = viridis(n = length(trait_list)),
  phylo_layout = "circular",
  ladderize = F,
  ladderize_right = F,
  tip_label_size = 2,
  show_legend = T,
  legend_position = "left"
)

Arguments

phylo

A phylo object

trait_list

Named list, where names corresponds to traits and vectors under each name correspond to taxa associated with that trait. Defaults to NULL (no list is supplied).

color_palette

Vector of trait color(s). Defaults to one color per trait using the viridis color scale, i.e., viridis(n = length(trait_list)).

phylo_layout

Any ggtree phylogeny layout. Defaults to "circular".

ladderize

Re-order tree to have a "ladder" aspect (True or False). Defaults to False.

ladderize_right

If ladderize = TRUE, show the smallest clade on the right-hand side (True or False). Defaults to False.

tip_label_size

Size of tip labels. Defaults to 2.

show_legend

Display legend (True or False). Defaults to True.

legend_position

Position of legend. Defaults to "left".

Value

A ggplot2 object


lmc297/bactaxR documentation built on Feb. 6, 2024, 7:41 p.m.