The code for this function can be found here.
The arguments to pass to the function are:
multiPhy- An object of classmultiPhylomultiPhy1- An object of classmultiPhyloplot.top- Plot only the terminal taxa that show the most variation in branch length? Can take anumericargument specifying how many tips to plot.show.top- Allows addition of a legend to the plot showing the mean absolute branch length difference for the top n tips. Can take anumericargument.marPar- Anumericvector of length 4 specifying the plotting margins.taxon.label.cex- Anumericvector of length 1 specifying the size of the taxon labelspt.cex- Anumericargument specifying size of the plotted pointsbar.width-numericvalue for the width of the bar lineslabel.horiz-logical: should the taxon names be plotted horizontally?
I will demonstrate thie plotting function using two posterior sets of phylogenies that were constructedd with and without topological constraints respectively. In doing so, we can see which taxa have their branch lengths affected the most through specification of topological constraints.
library(ape)
# The function
source("branch.length.diff.R")
# The data
multiPhy <- read.nexus("set1.nex")
multiPhy1 <- read.nexus("set2.nex")A standard use of the function
branch.length.diff(multiPhy, multiPhy1)Add a legend showing the five highest values
branch.length.diff(multiPhy, multiPhy1, show.top = 5)Alternatively, only plot the five highest values
branch.length.diff(multiPhy, multiPhy1, plot.top = 5,
pt.cex = 2, bar.width = 2, label.horiz = TRUE, taxon.label.cex = 0.7)