Description Usage Arguments Details Value Author(s) References Examples
Given an input tree or trees creates an MRP matrix.
1 |
Trees |
An object of class 'phylo' or 'multi.phylo'. |
AddAllZero |
Whether (TRUE; default) to add an allzero outgroup taxon or not (FALSE). |
The Metatree function requires samples of tree(s) as input, but these must already be represented using Matrix Representtaion with Parsimony (MRP; Baum 1992; Ragan 1992). This encoding works by taking each bipartition (clade, or internal node, excluding the root) and coding taxa present inside the clade as 1 ("derived" state) and those outside the clade as 0 "primitive" state). Thus the tree:
1 2 3 4 5 6 7 |
Would be encoded as the matrix:
1 2 3 4 5 |
Or, if using AddAllZero = TRUE
the root (R) can also be encoded:
1 2 3 4 5 6 |
Note that the function will remove any duplicate characters automatically, meaning if nodes reappear across a sample of trees these will be collapsed to a single MRP character (see example below), as suggested by Lloyd et al. (2016).
Currently an option to perform Purvis MRP (Purvis 1995) is not available.
An MRP matrix in Claddis::read_nexus_matrix
format.
Graeme T. Lloyd graemetlloyd@gmail.com
Baum, B. R., 1992. Combining trees as a way of combining data sets for phylogenetic inference, and the desirability of combining gene trees. Taxon, 41, 3-10.
Lloyd, G. T., Bapst, D. W., Friedman, M. and Davis, K. E., 2016. Probabilistic divergence time estimation without branch lengths: dating the origins of dinosaurs, avian flight, and crown birds. Biology Letters, 12, 20160609.
Purvis, A., 1995. A modification to Baum and Ragan's method for combining phylogenetic trees. Systematic Biology, 44, 251-255.
Ragan, M., 1992. Phylogenetic inference based on matrix representation of trees. Molecular Phylogenetics and Evolution, 1, 113-126.
1 2 3 4 5 6 7 8 9 | # Generate a set of two example trees:
ExampleTrees <- ape::read.tree(text = c("(A,(B,(C,D)));", "(A,(C,(B,D)));"))
# Convert to MRP and show just matrix:
Tree2MRP(ExampleTrees)$matrix_1$matrix
# To confirm this collapses duplicate nodes show individual tree results:
Tree2MRP(ExampleTrees[[1]])$matrix_1$matrix
Tree2MRP(ExampleTrees[[2]])$matrix_1$matrix
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.