This function compares phylogenies to identify topological similarities. Let’s start by loading required libraries, and then visualize a set of example phylogenies.
library(ape)
library(phytools)
library(dplyr)
phy.set <- readRDS("phy.list.RDS")
par(mfrow=c(1,3))
plot(phy.set[[1]], cex=2)
plot(phy.set[[2]], cex=2)
plot(phy.set[[3]], cex=2)
We want to compare how the topology of the phylogenies on the center and right compare against the topology on the left. This function always assumes that the target topology of interest is the first entry in the list of trees. The function itself only takes a few arguments:
phy.list
: Alist
ormultiPhylo
containing the phylogenies of interestpie.cols
: Acharacter
vector the same length as the number of phylogenies being compared against the target phylogeny (in this example n = 2)cex
:numeric
vectorlength
1 corresponding to the size of the pies being plotted...
: Optional arguments to be passed toplot.phylo
Let’s load the function, and define our parameters for plotting
Now we can visualize the plot, and add a legend.