Learn R Programming

orthGS (version 0.1.6)

madRoot: Find The Root of a Phylogenetic Tree Using MAD Method

Description

Finds the root of an unrooted phylogenetic tree by minimizing the relative deviation from the molecular clock.

Usage

madRoot(tree, output_mode = 'phylo')

Value

a rooted tree and supplementary information if required.

Arguments

tree

unrooted tree string in newick format or a tree object of class 'phylo'.

output_mode

amount of information to return. If 'phylo' (default) only the rooted tree is returned. If 'stats' also a structure with the ambiguity index, clock cv, the minimum ancestor deviation and the number of roots. If 'full' also an unrooted tree object, the index of the root branch, the branch ancestor deviations and a rooted tree object.

Author

Tria, F. D. K., Landan, G. and Dagan, T.

Details

This function is a slight modification of the code provided by Tria et al at https://www.mikrobio.uni-kiel.de/de/ag-dagan/ressourcen.

References

Tria, F. D. K., Landan, G. and Dagan, T. Nat. Ecol. Evol. 1, 0193 (2017).

Examples

Run this code
# Example 1:
madRoot("(c:1.182246599,b:0.4169984702,a:0.1582465793);")
# Example 2:
if (FALSE) {
a <- msa(sequences=c("RAPGT", "KMPGT", "ESGGT"), ids = letters[1:3])$ali
tr <- mltree(a)$tree
rtr <- madRoot(tr) }

Run the code above in your browser using DataLab