View source: R/delim_autoplot2.R
delim_autoplot2 | R Documentation |
delim_autoplot2()
returns a phylogenetic tree plotted using ggtree
alongside
with a customized tile plot using geom_tile combined by
wrap_plots.
delim_autoplot2(
delim,
tr,
consensus = TRUE,
n_match = NULL,
delim_order = NULL,
tbl_labs,
species,
hexpand = 0.1,
widths = c(0.5, 0.2)
)
delim |
Output from delim_join. |
tr |
A treedata object. Both phylogram and ultrametric trees are supported. |
consensus |
Logical. Should the majority-vote consensus to be estimated? |
n_match |
An Integer. If |
delim_order |
A character vector of species delimitation names ordered by user. Default to NULL. |
tbl_labs |
A tbl_df of customized labels for tree plotting. The
first column must match tip labels of the |
species |
column name in |
hexpand |
Numeric. Expand xlim of tree by a ratio of x axis range. Useful if
tiplabels become truncated when plotting. Default to |
widths |
A numeric vector containing the relative widths of the tree and
species delimitation bars. See wrap_plots for details.
Defaults to |
delim_autoplot2()
is a wrapper for tree plotting with associated data implemented
using ggtree
, ggplot2
, and patchwork
. If consensus = TRUE
, a consensus bar will be plotted next to the species delimitation plot,
summarizing partitions across samples. If no consensus is reached, an "X" will be plotted instead.
This function is a modified version of delim_autoplot which plots
species partitions using a black and grey color scheme.
A patchwork
object.
Pedro S. Bittencourt, Rupert A. Collins.
# create labels
labs <- geophagus_info |> dplyr::select(gbAccession, scientificName)
# view partitions using an ultrametric tree
p <- delim_autoplot2(geophagus_delims,
geophagus_beast,
tbl_labs = labs,
species = "scientificName"
)
p
# view partitions using a phylogram
p1 <- delim_autoplot2(geophagus_delims,
geophagus_raxml,
tbl_labs = labs,
species = "scientificName"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.