Differences Between Phylogenetic Trees

Description

A family of functions for determining and plotting the differences between two trees.

phylo.diff plots two trees side by side, highlighting edges unique to each tree in red.

distinct.edges finds the edges present in the first argument not in the second.

edge.from.split locates the edge id from a given split.

get.bipartition gets the bipartition of tips formed by a single edge.

partition.leaves returns the set of all bipartitions from all edges.

Usage

1
2
3
4
5
6
7
8
9

Arguments

x

The first (or only) tree.

y

The second tree, for the functions that accept two trees.

split

A list of bipartitions, probably from partition.leaves.

e

An edge for a particular tree, given as an id.

...

Additional arguments to pass to the plot.phylo function.

Details

phylo.diff uses the ape tree plotting function. The other functions are mostly meant as support functions.

Value

phylo.diff returns invisible.

distinct.edges returns a numeric vector of edge ids for the first tree.

edge.from.split returns an edge id for a particular tree corresponding to a given bipartition and NA if none such edge exists.

get.bipartition returns a character vector of the tips below that edge in the given tree.

partition.leaves returns a list of partitions (themselves character vectors) of the given tree.

Author(s)

John Chakerian <chakj@stanford.edu>

References

Chakerian, J. and Holmes, S. P. Computational Tools for Evaluating Phylogenetic and Heirarchical Clustering Trees. arXiv:1006.1015v1.

See Also

dist.multiPhylo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(woodmouse)
otree <- root(fastme.ols(dist.dna(woodmouse)), "No305", resolve.root=TRUE)
breps = 10

trees <- boot.phylo(otree, woodmouse, B=breps, function(x)
        root(fastme.ols(dist.dna(x)), "No305", resolve.root=TRUE),trees=TRUE)

combined.trees <- c(list(otree), trees$trees)

binning <- bin.multiPhylo(combined.trees)

phylo.diff(combined.trees[[match(1, binning)]], combined.trees[[match(2, binning)]])