# NOT RUN {
{
tree1 <- ape::read.tree(text='((((a, b), c), d), (e, (f, (g, h))));')
tree2 <- ape::read.tree(text='(((a, b), (c, d)), ((e, f), (g, h)));')
tree3 <- ape::read.tree(text='((((h, b), c), d), (e, (f, (g, a))));')
# Best possible score is obtained by matching a tree with itself
VariationOfArborealInfo(tree1, tree1) # 0, by definition
MutualArborealInfo(tree1, tree1)
# Best possible score is a function of tree shape; the partitions within
# balanced trees are more independent and thus contain less information
MutualArborealInfo(tree2, tree2)
# How similar are two trees?
MutualArborealInfo(tree1, tree2)
VariationOfArborealInfo(tree1, tree2)
VariationOfArborealInfo(tree2, tree1) # Identical, by symmetry
# Maximum possible score for Cluster information is independent
# of tree shape, as every possible pairing is considered
MutualClusterInfo(tree1, tree1)
MutualClusterInfo(tree2, tree2)
# It is thus easier to interpret the value of
MutualClusterInfo(tree1, tree2)
# Although it may not be possible to find a tree pair with zero mutual
# cluster info.
# Every partition in tree1 is contradicted by every partition in tree3
# Non-arboreal matches contain clustering, but not phylogenetic, information
MutualArborealInfo(tree1, tree3) # = 0
MutualClusterInfo(tree1, tree3) # > 0
}
# }
Run the code above in your browser using DataLab