Learn R Programming

phangorn (version 2.4.0)

mast: Maximum agreement subtree

Description

mast computes the maximum agreement subtree (MAST).

Usage

mast(x, y, tree = TRUE, rooted = TRUE)

Arguments

x

a tree, i.e. an object of class phylo.

y

a tree, i.e. an object of class phylo.

tree

a logicical, if TRUE returns a tree other wise the tip labels of the the maximum agreement subtree.

rooted

logical if TRUE treats trees as rooted otherwise unrooted.

Value

mast returns a vector of the tip labels in the MAST.

Details

The code is derived from the code example in Valiente (2009), for the original code see http://www.cs.upc.edu/~valiente/comput-biol/. The version for the unrooted trees is much slower.

References

G. Valiente (2009). Combinatorial Pattern Matching Algorithms in Computational Biology using Perl and R. Taylor & Francis/CRC Press

See Also

SPR.dist

Examples

Run this code
# NOT RUN {
tree1 <- rtree(100)
tree2 <- rSPR(tree1, 5)
tips <- mast(tree1, tree2)

# }

Run the code above in your browser using DataLab