cophen.vector: Computes the cophenetic vector of a phylogenetic tree

Description Usage Arguments Details Value Author(s) References Examples

View source: R/cophen.vector.R

Description

Given a phylogenetic tree, computes the cophenetic vector of that phylogenetic tree.

Usage

1
cophen.vector(tree, set.of.labels = NULL)

Arguments

tree

a single phylogenetic tree. It can be entered as a string the Newick format, as a 'phylo' object (ape package) or as an 'igraph' object (igraph package).

set.of.labels

a list containing the set of labels of the tree (in the order of appearance from its newicks form). By default is NULL due to if tree is a phylo object or a newick string it is no necessary to specify it.

Details

The cophenetic vector is formed by all the cophenetic values between each pair of leaves. The cophenetic value of two different leaves i and j is the depth of the lowest common ancestor of the nodes in the tree labeled with i and j. If i=j, then the cophenetic value is the depth of that leaf.

Value

A numeric array.

Author(s)

Lucia Rotger

References

A. Mir, F. Rossello, L.Rotger, A new balance index for phylogenetic trees. Mathematical Biosciences 241 (2013), 125-136.

G. Cardona, A. Mir, F. Rossello, L. Rotger, D. Sanchez, Cophenetic metrics for phylogenetic trees, after Sokal and Rohlf. BMC Bioinformatics 14 (2013), 3.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Computation of the cophenetic vector of trees 
# entered in newick format:
cophen.vector("(1,2,3,4,5);")
cophen.vector("(1,(2,(3,(4,5))));")

# Computation of the cophenetic vector of trees 
# entered as a phylo object:
require(ape)
random.tree = rtree(5,rooted=TRUE)
cophen.vector(random.tree) 

LuciaRG/CollessLike documentation built on Oct. 12, 2019, 11:19 a.m.