#' # Load data for analysis in R
library("TreeTools")
data("congreveLamsdellMatrices", package = "TreeSearch")
# Small dataset for demonstration purposes
dataset <- congreveLamsdellMatrices[[42]][1:8, ]
bestTree <- MaximizeParsimony(dataset, verbosity = 0)[[1]]
# Calculate tip influence
influence <- TaxonInfluence(dataset, ratchIt = 0, startIt = 0, verbos = 0)
# Colour tip labels according to their influence
upperBound <- 2 * TreeDist::ClusteringEntropy(
PectinateTree(NTip(dataset) - 1))
nBin <- 128
bin <- cut(
influence["max", ],
breaks = seq(0, upperBound, length.out = nBin),
include.lowest = TRUE
)
palette <- hcl.colors(nBin, "inferno")
plot(bestTree, tip.color = palette[bin])
PlotTools::SpectrumLegend(
"bottomleft",
palette = palette,
title = "Tip influence / bits",
legend = signif(seq(upperBound, 0, length.out = 4), 3),
bty = "n"
)
Run the code above in your browser using DataLab