RoguePlot | R Documentation |
Plots a consensus of trees with a rogue taxon omitted, with edges coloured according to the proportion of trees in which the taxon attaches to that edge, after \insertCiteKlopfstein2019;textualTreeTools.
RoguePlot(
trees,
tip,
p = 1,
plot = TRUE,
Palette = colorRampPalette(c(par("fg"), "#009E73"), space = "Lab"),
nullCol = rgb(colorRamp(unlist(par(c("fg", "bg"))), space = "Lab")(0.8)/255),
edgeLength = NULL,
thin = par("lwd"),
fat = thin + 1L,
outgroupTips,
sort = FALSE,
legend = "none",
legend.inset = 0,
...
)
trees |
List or |
tip |
Numeric or character identifying rogue leaf, in format accepted
by |
p |
A numeric value between 0.5 and 1 giving the proportion for a clade
to be represented in the consensus tree (see |
plot |
Logical specifying whether to plot the tree. |
Palette |
Function that takes a parameter |
nullCol |
Colour to paint regions of the tree on which the rogue is never found. |
edgeLength |
Numeric specifying edge lengths of consensus tree;
|
thin , fat |
Numeric specifying width to plot edges if the rogue tip never / sometimes does attach to them. |
outgroupTips |
Vector of type character, integer or logical, specifying
the names or indices of the tips to include in the outgroup.
If |
sort |
Logical specifying whether to sort consensus tree using
|
legend |
Character vector specifying position of legend (e.g.
|
legend.inset |
Numeric specifying fraction of plot width / height by which the legend's position should be inset. |
... |
Additional parameters to |
Rogue taxa can be identified using the package Rogue \insertCiteSmithConsTreeTools.
RoguePlot()
invisibly returns a list whose elements are:
cons
: The reduced consensus tree, in preorder;
onEdge
: a vector of integers specifying the number of
trees in trees
in which the rogue leaf is attached to each edge in turn
of the consensus tree;
atNode
: a vector of integers specifying the number of trees in trees
in which the rogue leaf is attached to an edge collapsed into each node
of the consensus tree.
legendLabels
: A character vector suggesting labels for a plot legend;
suitable for PlotTools::SpectrumLegend(legend = x$legendLabels)
.
Martin R. Smith (martin.smith@durham.ac.uk)
Other consensus tree functions:
Consensus()
,
ConsensusWithout()
trees <- list(read.tree(text = "(a, (b, (c, (rogue, (d, (e, f))))));"),
read.tree(text = "(a, (b, (c, (rogue, (d, (e, f))))));"),
read.tree(text = "(a, (b, (c, (rogue, (d, (e, f))))));"),
read.tree(text = "(a, (b, (c, (rogue, (d, (e, f))))));"),
read.tree(text = "(rogue, (a, (b, (c, (d, (e, f))))));"),
read.tree(text = "((rogue, a), (b, (c, (d, (e, f)))));"),
read.tree(text = "(a, (b, ((c, d), (rogue, (e, f)))));"),
read.tree(text = "(a, (b, ((c, (rogue, d)), (e, f))));"),
read.tree(text = "(a, (b, (c, (d, (rogue, (e, f))))));"))
plotted <- RoguePlot(trees, "rogue", legend = "topleft", legend.inset = 0.02)
PlotTools::SpectrumLegend(
"bottomleft",
palette = colorRampPalette(c(par("fg"), "#009E73"), space = "Lab")(100),
legend = plotted$legendLabels,
cex = 0.4
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.