plotTrees - Plot a tree with colored internal node labels using ggtree
Description¶
plotTrees plots a tree or group of trees
Usage¶
plotTrees(
trees,
nodes = FALSE,
tips = NULL,
tipsize = NULL,
scale = 0.01,
palette = "Dark2",
base = FALSE,
show_occupancy = FALSE,
layout = "rectangular",
node_nums = FALSE,
tip_nums = FALSE,
title = TRUE,
labelsize = NULL,
common_scale = FALSE,
ambig = "grey",
bootstrap_scores = FALSE,
tip_palette = NULL,
node_palette = NULL,
guide_title = NULL,
branch_lengths = NULL,
pch = 16,
densitree = FALSE,
alpha = 1
)
Arguments¶
- trees
- A tibble containing
phyloandairrCloneobjects - nodes
- color internal nodes if possible?
- tips
- color tips if possible?
- tipsize
- size of tip shape objects
- scale
- width of branch length scale bar
- palette
- color palette for tips and/or nodes. Can supply a named vector for all tip states, or a palette named passed to ggplot2::scale_color_brewer (e.g. “Dark2”, “Paired”, “Set1”) or ggplot2::scale_color_distiller (e.g. RdYlBu) or
- base
- recursion base case (don’t edit)
- show_occupancy
- if plotting trees from an expectedOccupancy model in TyCHE, will color branch lengths by expected occupancy in the first state if true. Requires palette to be specified as a named vector in order of: c(state1=color1, state2+state1=color2, state2=color3).
- layout
- rectangular or circular tree layout?
- node_nums
- plot internal node numbers?
- tip_nums
- plot tip numbers?
- title
- use clone id as title?
- labelsize
- text size
- common_scale
- stretch plots so branches are on same scale? determined by sequence with highest divergence
- ambig
- How to color ambiguous node reconstructions? (grey or blend)
- bootstrap_scores
- Show bootstrap scores for internal nodes? See getBootstraps.
- tip_palette
- deprecated, use palette
- node_palette
- deprecated, use palette
- guide_title
- Title of color guide. Defaults to tips variable if specified.
- branch_lengths
- Use branch lenghts? Use “none” if not.
- pch
- Numeric tip/node shape. If >20 will use “fill” instead of “color”
- densitree
- Use densitree visualization? Requires trees_with_traits/trees posterior
to be loaded in (see posterior options in
readBEAST). - alpha
- Alpha value for ggtree. Lower makes the tree more transparent.
Value¶
a grob containing a tree plotted by ggtree.
Details¶
Function uses ggtree functions to plot tree topologies estimated by
getTrees, and findSwitches. Object can be further modified with
ggtree functions. Please check out
https://bioconductor.org/packages/devel/bioc/vignettes/ggtree/inst/doc/ggtree.html and
cite ggtree in addition to dowser if you use this function.
Examples¶
data(ExampleClones)
trees <- getTrees(ExampleClones[10,])
plotTrees(trees)[[1]]
Warning:Arguments in ... must be used.
✖ Problematic arguments:
• as.Date = as.Date
• yscale_mapping = yscale_mapping
• hang = hang
• alpha = alpha
ℹ Did you misspell an argument name?