Skip to main content
  • Methodology article
  • Open access
  • Published:

Cophenetic metrics for phylogenetic trees, after Sokal and Rohlf

Abstract

Background

Phylogenetic tree comparison metrics are an important tool in the study of evolution, and hence the definition of such metrics is an interesting problem in phylogenetics. In a paper in Taxon fifty years ago, Sokal and Rohlf proposed to measure quantitatively the difference between a pair of phylogenetic trees by first encoding them by means of their half-matrices of cophenetic values, and then comparing these matrices. This idea has been used several times since then to define dissimilarity measures between phylogenetic trees but, to our knowledge, no proper metric on weighted phylogenetic trees with nested taxa based on this idea has been formally defined and studied yet. Actually, the cophenetic values of pairs of different taxa alone are not enough to single out phylogenetic trees with weighted arcs or nested taxa.

Results

For every (rooted) phylogenetic tree T, let its cophenetic vector φ(T) consist of all pairs of cophenetic values between pairs of taxa in T and all depths of taxa in T. It turns out that these cophenetic vectors single out weighted phylogenetic trees with nested taxa. We then define a family of cophenetic metrics dφ,p by comparing these cophenetic vectors by means of Lp norms, and we study, either analytically or numerically, some of their basic properties: neighbors, diameter, distribution, and their rank correlation with each other and with other metrics.

Conclusions

The cophenetic metrics can be safely used on weighted phylogenetic trees with nested taxa and no restriction on degrees, and they can be computed in O(n2) time, where n stands for the number of taxa. The metrics dφ,1 and dφ,2 have positive skewed distributions, and they show a low rank correlation with the Robinson-Foulds metric and the nodal metrics, and a very high correlation with each other and with the splitted nodal metrics. The diameter of dφ,p, for p1, is in O(n(p+2)/p), and thus for low p they are more discriminative, having a wider range of values.

Background

Many phylogenetic trees published in the literature or included in phylogenetic databases are actually alternative phylogenies for the same sets of organisms, obtained from different datasets or using different evolutionary models or different phylogenetic reconstruction algorithms [1]. This variety of phylogenetic trees makes it necessary to develop methods for measuring their differences [2, Chapter 30]. The comparison of phylogenetic trees is also used to compare phylogenetic trees obtained through numerical algorithms with other types of hierarchical classifications [3, 4], to assess the stability of reconstruction methods [5], and in the comparative analysis of dendrograms and other hierarchical cluster structures [6, 7]. Hence, and since the safest way to quantify the differences between a pair of trees is through a metric, “tree comparison metrics are an important tool in the study of evolution” [8].

Many metrics for the comparison of phylogenetic trees have been proposed so far [2, Chapter 30]. Some of these metrics are edit distances that count how many operations of a given type are necessary to transform one tree into the other. These metrics include the nearest-neighbor interchange metric [9] and the subtree prune-and-regrafting distance [10]. Other metrics compare a pair of phylogenetic trees through some consensus subtree. This is the case for instance of the MAST distances defined in [11-13]. Finally, many metrics for phylogenetic trees are based on the comparison of encodings of the phylogenetic trees, like for instance the Robinson-Foulds metric [14, 15] (which can also be understood as an edit distance), the triples metric [16], the classical nodal metrics for binary phylogenetic trees [5, 8, 17-19], and the splitted nodal metrics for arbitrary phylogenetic trees [20]. The advantage of this last kind of metrics is that, unlike the edit and the consensus distances, they are usually computed in low polynomial time.

In an already fifty years old paper [4], Sokal and Rohlf proposed a technique to compare dendrograms (which, in their paper, were equivalent to weighted phylogenetic trees without nested taxa) on the same set of taxa, by encoding them by means of their half-matrices of cophenetic values, and then comparing these structures. Their method runs as follows. To begin with, they divide the range of depths of internal nodes in the tree into a suitable number of equal intervals and number increasingly these intervals. Then, for each pair of taxa i,j in the tree, they compute their cophenetic value as the class mark of the interval where the depth of their lowest common ancestor lies. Then, to compare two phylogenetic trees, they compare their corresponding half-matrices of cophenetic values. In that paper, they do it specifically by calculating a correlation coefficient between their entries. Sokal and Rohlf’s paper [4] is quite cited (612 cites according to Google Scholar on July 1, 2012) and their method has been often used to compare hierarchical classifications (see, for instance, [21-23]).

Since Sokal and Rohlf’s paper, other papers have compared the half-matrices of cophenetic values to define dissimilarity measures between phylogenetic trees (see, for instance, [3, 24]), and such half-matrices have also been used in the so-called “comparative method”, the statistical methods used to make inferences on the evolution of a trait among species from the distribution of other traits: see [25, 26] and [2, Chapter 25]. But, to our knowledge, no proper metric for phylogenetic trees based on cophenetic values has been formally defined and studied in the literature. In this paper we define a new family of metrics for weighted phylogenetic trees with nested taxa based on Sokal and Rohlf’s idea and we study some of their basic properties: neighbors, diameter, distribution, and their rank correlation with each other and with other metrics.

Our approach differs in some minor points with Sokal and Rohlf’s. For instance, we use as the cophenetic value φ(i,j) of a pair of taxa i,j the actual depth of the lowest common ancestor of i and j, instead of class marks, which was done by Sokal and Rohlf because of practical limitations. Moreover, instead of using a correlation coefficient, we define metrics by using Lp norms. Finally, we do not restrict ourselves to dendrograms, without internal labeled nodes, but we also allow nested taxa.

There is, however, a main difference between our approach and Sokal and Rohlf’s. We do not only consider the cophenetic values of pairs of taxa, but also the depths of the taxa. We must do so because we want to define a metric, where zero distance means isomorphism, and the cophenetic values of pairs of different taxa alone do not single out even the dendrograms considered by Sokal and Rohlf. That is, two non isomorphic weighted phylogenetic trees without nested taxa on the same set of taxa can have the same vectors of cophenetic values; see Figure 1.

Figure 1
figure 1

An unweighted phylogenetic tree on 7 taxa.

It turns out that the cophenetic vector consisting of all cophenetic values of pairs of taxa and the depths of all taxa characterizes a weighted phylogenetic tree with nested taxa. This fact comes from the well known relationship between cophenetic values and patristic distances. If we denote by δ(i) the depth of a taxon i, by φ(i,j) the cophenetic value of a pair of taxa i,j and by d(i,j) the distance between i and j, then [27]

d ( i , j ) = δ ( i ) + δ ( j ) - 2 φ ( i , j ) .

So, if the depths of the taxa are known, the knowledge of the cophenetic values of pairs of taxa is equivalent to the knowledge of the additive distance defined by the tree. On their turn, the depths and the additive distance single out the unrooted semi-labelled weighted tree associated to the phylogenetic tree with the former root labeled with a specific label “root”, and hence the phylogenetic tree itself: cf. Theorem 1.

The fact that cophenetic vectors single out weighted phylogenetic trees with nested taxa can also be deduced from their relationship with splitted path lengths [20]. Recall that the splitted path length (i, j) is the distance from the lowest common ancestor of i and j to i. It is known [20, Thm. 10] that the matrix ((i, j))i,j characterizes a weighted phylogenetic tree with nested taxa. Since, obviously,

( i , j ) = δ ( i ) - φ ( i , j ) ,

the cophenetic vector uniquely determines the matrix of splitted path lengths, and hence the tree.a

The vector of cophenetic values of pairs of different taxa is also related to the notion of ultrametric [28, 29]. Indeed, notice that -φ satisfies the three-point condition of ultrametrics: for every taxa i, j, k,

- φ ( i , j ) min { - φ ( i , k ) , - φ ( j , k ) } .

But -φ is not an ultrametric, as φ(i, i) = δ(i) ≠ 0. Actually, φ can only be used to define an ultrametric precisely on ultrametric trees, where the depths of all leaves are the same, say Δ. In this case, Δ - φ is the ultrametric defined by the tree. In particular, ultrametric trees can be compared by comparing their vectors of cophenetic values of pairs of different taxa. A similar idea is used in [30] to induce an average genetic distance between populations from the average coancestry coefficient.

We would like to dedicate this paper to the memory of Robert R. Sokal, father of the field of numerical taxonomy and who passed away last April. His ideas permeate biostatistics and computational phylogenetics.

Notations

A rooted tree is a directed finite graph that contains a distinguished node, called the root, from which every node can be reached through exactly one path. A weighted rooted tree is a pair (T, ω) consisting of a rooted tree T = (V, E) and a weight functionω:E R > 0 that associates to every arc eE a non-negative real number ω(e) > 0. We identify every unweighted (that is, where no weight function has been explicitly defined) rooted tree T with the weighted rooted tree (T, ω) with ω the weight 1 constant function.

Let T = (V, E) be a rooted tree. Whenever (u, v) E, we say that v is a child of u and that u is the parent of v. Two nodes with the same parent are siblings. The nodes without children are the leaves of the tree, and the other nodes (including the root) are called internal. A pendant arc is an arc ending in a leaf. The nodes with exactly one child are called elementary. A tree is binary, or fully resolved, when every internal node has exactly two children.

Whenever there exists a path from a node u to a node v, we shall say that v is a descendant of u and also that u is an ancestor of v, and we shall denote it by vu; if, moreover, u ≠ v, we shall write vu. The lowest common ancestor (LCA) of a pair of nodes u, v of a rooted tree T, in symbols [u, v] T , is the unique common ancestor of them that is a descendant of every other common ancestor of them. Given a node v of a rooted tree T, the subtree of T rooted at v is the subgraph of T induced on the set of descendants of v (including v itself). A rooted subtree is a cherry when it has 2 leaves, a triplet, when it has 3 leaves, and a quartet, when it has 4 leaves.

The distance from a node u to a descendant v of it in a weighted rooted tree T is the sum of the weights of the arcs in the unique path from u to v. In an unweighted rooted tree, this distance is simply the number of arcs in this path. The depth of a node v, in symbols δ T (v), is the distance from the root to v.

Let S be a non-empty finite set of labels, or taxa. A (weighted) phylogenetic tree on S is a (weighted) rooted tree with some of its nodes bijectively labeled in the set S, including all its leaves and all its elementary nodes except possibly the root (which can be elementary but unlabeled). The reasons why we allow unlabeled elementary roots are that our results are still valid for phylogenetic trees containing them, and that even if we forbid them, we would need in some proofs to use that Theorem 1 below is true for phylogenetic trees containing them. Moreover, it is not uncommon to add an unlabeled elementary root to a phylogenetic tree in some contexts: see, for instance, the phylogenetic trees depicted in Wikipedia’s entry “Phylogenetic tree”.b

In a phylogenetic tree, we shall always identify a labeled node with its taxon. The internal labeled nodes of a phylogenetic tree are called nested taxa. Notice in particular that a phylogenetic tree without nested taxa cannot have elementary nodes other than the root. Although in practice S may be any set of taxa, to fix ideas we shall usually take S = {1, …, n}, with n the number of labeled nodes of the tree, and we shall use the term phylogenetic tree with n taxa to refer to a phylogenetic tree on this set.

Given a set Sof taxa, we shall consider the following spaces of phylogenetic trees:

  • WT(S), of all weighted phylogenetic trees on S

  • UT(S), of all unweighted phylogenetic trees on S

  • T(S), of all unweighted phylogenetic trees on S without nested taxa

  • BT(S), of all binary unweighted phylogenetic trees on S without nested taxa

When S = {1, …, n}, we shall simply write W T n , U T n , T n , and B T n , respectively.

Two phylogenetic trees T and T on the same set S of taxa are isomorphic when they are isomorphic as directed graphs and the isomorphism sends each labeled node of T to the labeled node with the same label in T. An isomorphism of weighted phylogenetic trees is also required to preserve arc weights. We shall make the abuse of notation of saying that two isomorphic trees are actually the same, and hence of denoting that two trees T, T are isomorphic by simply writing T = T.

Methods

Cophenetic vectors

Let S be henceforth a non-empty set of taxa with |S| = n, which without any loss of generality we identify with {1, …, n}. Let T W T n be a weighted phylogenetic tree on S. For every pair of different taxa i, j in T, their cophenetic value is the depth of their LCA:

φ T ( i , j ) = δ T ( [ i , j ] T ) .

To simplify the notations, we shall often write φ T (i, i) to denote the depth δ T (i) of a taxon i.

The cophenetic vector of T is

φ ( T ) = φ T ( i , j ) 1 i j n R n ( n + 1 ) / 2 ,

with its elements lexicographically ordered in (i, j).

Example 1

If T is the unweighted phylogenetic tree in Figure 2, then φ(T) is the vector obtained by lexicographically ordering in (i, j) the elements of Table 1.

Figure 2
figure 2

Three non-isomorphic trees with the same vector φ ~ ( T ) .

Table 1 Cophenetic values of the pairs of taxa in the phylogenetic tree T in Figure 2

The cophenetic vectors single out weighted phylogenetic trees with nested taxa.

Theorem 1

For every T, T WT(S), if φ(T) = φ(T), then T = T.

Proof

Let r be a symbol not belonging to S and let X = S {r}. Recall that a weighted X-tree is an undirected weighted tree T with set of nodes V endowed with a (non necessarily injective) node-labeling mapping f : X → V such that f(X) contains all the leaves and all the degree-2 nodes in T[31].

For every TWT(S), let T be the weighted X-tree obtained by considering T as undirected and adding to its former root the label r. Then, the distance d T on T between pairs of labels in X is uniquely determined by φ(T) in the following way:

d T ( i , r ) = δ T ( i ) for every i S d T ( i , j ) = δ T ( i ) + δ T ( j ) - 2 φ T ( i , j ) for every i , j S

Now, T is singled out by d T [31, Thm. 7.1.8]. Since T is uniquely determined from T and the knowledge of the root (that is the node labeled with r), we deduce that φ(T) singles out T. □

This result implies that the vectors of cophenetic values of pairs of different taxa single out unweighted phylogenetic trees without nested taxa.

Corollary 1

For every T T n , let φ ~ (T)= φ T ( i , j ) 1 i < j n R n ( n - 1 ) / 2 , with its elements lexicographically ordered in (i, j). Then, for every T, T T n , if φ ~ (T)= φ ~ ( T ), then T=T.

Proof

If T is unweighted and without nested taxa, then, for every taxon i,

δ T ( i ) = 1 + max { φ T ( i , j ) 1 j n , j i }

and therefore, in this case, φ(T) is uniquely determined by φ ~ (T). □

But in order to single out phylogenetic trees with non constant weights in the arcs or with nested taxa, it is necessary to take into account also the depths of the leaves. Actually, for example, there is no way to reconstruct from φ ~ (T) the weights of the pendant arcs: the depths of the leaves are needed. Or, without being able to compare depths with cophenetic values, there is no way to say whether a taxon is nested or not. More specifically, for instance, the three trees in Figure 1 have the same value of φ(1, 2), and hence the same vector φ ~ (T), but they are not isomorphic as weighted phylogenetic trees.

The cophenetic vector φ(T) of a weighted phylogenetic tree T W T n can be computed in optimal O(n2) time (assuming a constant cost for the addition of real numbers) by computing for each internal node v, its depth δ T (v) through a preorder traversal of T, and the pairs of taxa of which v is the LCA through a postorder traversal of the tree. Both preorder and postorder traversals are performed in linear time on the usual tree data structures.

Cophenetic metrics

As we have seen in Theorem 1, the mapping

φ : W T n R n ( n + 1 ) / 2

that sends each T W T n to its cophenetic vector φ(T), is injective up to isomorphism. As it is well known, this allows to induce metrics on W T n from metrics defined on powers of R. In particular, every Lp norm  ·  p on R n ( n + 1 ) / 2 , p1, induces a cophenetic metric dφ, p on W T n by means of

d φ , p ( T 1 , T 2 ) = φ ( T 1 ) - φ ( T 2 ) p , T 1 , T 2 W T n .

Recall that

( x 1 , , x m ) p = | x 1 | p + + | x m | p p ,

and so, for instance,

d φ , 1 ( T 1 , T 2 ) = 1 i j n | φ T 1 ( i , j ) - φ T 2 ( i , j ) | d φ , 2 ( T 1 , T 2 ) = 1 i j n ( φ T 1 ( i , j ) - φ T 2 ( i , j ) ) 2

are the cophenetic metrics on W T n induced by the Manhattan L1 and the euclidean L2 norms. One can also use Donoho’s L0 “norm” (which, actually, is not a proper norm)

( x 1 , , x m ) 0 = number of entries x i that are 0

to induce a metric dφ,0(T1,T2) on W T n , which turns out to be simply the Hamming distance between φ(T1) and φ(T2).

As we have seen in the previous subsection, the cophenetic vector of a phylogenetic tree in W T n can be computed in O(n2) time. For every T 1 , T 2 W T n , and assuming a constant cost for the addition and product of real numbers, the cost of computing dφ,0(T1, T2) (as the number of non-zero entries of φ(T1)-φ(T2)) is O(n2), and the cost of computing dφ,p(T1, T2)p, for p1 (as the sum of the p-th powers of the entries of the difference φ(T1) - φ(T2)) is O(n2 + log2(p)n2), which is again O(n2) if we understand log(p) as part of the constant factor. Finally, the cost of computing dφ,p(T1, T2), p1, as the p-th root of dφ,p(T1, T2)p will depend on p and on the accuracy with which this root is computed. Assuming a constant cost for the computation of p-th roots with a given accuracy (notice that, in practice, for low p and accuracy, this step will be dominated by the computation of dφ,p(T1, T2)p), the total cost of computing dφ,p(T1, T2) is O(n2).

Next examples show some features of these cophenetic metrics.

Example 2

Let T U T n , let (u, v) be an arc of T with u or v unlabeled, and let T be the phylogenetic tree in U T n obtained by contracting (u, v): that is, by removing the node v and the arc (u, v), labeling u with the label of v if it was labeled, and replacing every arc (v, x) in T by an arc (u, x). Notice that, in the passage from T to T, for every i, jS:

  • If both i,j are descendants of v in T, then φ T (i,j)= φ T (i,j)-1.

  • In any other case, φ T (i,j)= φ T (i,j).

As a consequence,

φ T ( i , j ) - φ T ( i , j ) = 1 if i , j v 0 otherwise

and therefore, if n v is the number of descendant taxa of v,

d φ , 0 ( T , T ) = n v + 1 2 , d φ , p ( T , T ) = n v + 1 2 p if p 1 .

So the contraction of an arc in an tree T (which is Robinson-Foulds’ α-operation [15]) yields a new tree T at a cophenetic distance from T that depends increasingly on the number of descendant taxa of the head of the contracted arc.

Example 3

Let T 0 , T 0 W T m , for some m < n, let T W T n be such that its subtree rooted at some node z is T0, and let T W T n be the tree obtained by replacing in T this subtree T0 by T 0 .

Notice that, for every i, j {1, …, n}, φ T (i,j)= δ T (z)+ φ T 0 (i,j) if i, jm, and φ T (i, j) = φ T (z, j) if im and j > m, and the same holds in T, replacing T and T0 by T and T 0 , respectively. Since, moreover, δ T (z)= δ T (z), φ T (z,j)= φ T (z,j) for every j > m, and φ T (i,j)= φ T (i,j) for every i,j > m, we conclude that

φ ( T ) - φ ( T ) = φ ( T 0 ) - φ ( T 0 )

and hence

d φ , p ( T , T ) = d φ , p ( T 0 , T 0 ) .

So, the cophenetic metrics are local, as other popular metrics like the Robinson Foulds or the triples metrics, but unlike other popular metrics, like for instance the nodal metrics.

Results and discussion

Minimum and maximum values for cophenetic metrics

Our first goal is to find the smallest non-negative value of dφ,p on several spaces of phylogenetic trees, and the pairs of trees at which it is reached. These pairs of trees at minimum distance can be understood as ‘adjacent’ in the corresponding metric space, and their characterization yields a first step towards understanding how cophenetic metrics measure the difference between two trees.

Notice that this problem makes no sense for weighted phylogenetic trees. For instance, if we add or subtract an ϵ > 0 to the weight of a pendant arc in a tree T, without changing its topology, the distance between T and the resulting tree will be ϵ, which can be as small as desired. So, we only consider this problem on U T n , T n , and B T n .

In order to simplify the statements, set

D p ( T 1 , T 2 ) = d φ , 0 ( T 1 , T 2 ) if p = 0 d φ , p ( T 1 , T 2 ) p if p 1

The following easy result, which is a direct consequence of the fact that D p ( T 1 , T 2 ) D 0 ( T 1 , T 2 ) for every p1 and T 1 , T 2 U T n , will be used in the proof of the next propositions.

Lemma 1

Assume that, for every pair of different trees T1, T2 in U T n , T n or B T n such that D0(T1, T2) is minimum on this space, we have that D p (T1, T2) = D0(T1,T2). Then, the minimum non-zero value of D p on this space of trees is equal to the minimum non-zero value of D0 on it, and it is reached at exactly the same pairs of trees.

The least non-negative values of D p , for p {0}[1, [, on U T n , T n , and B T n , together with an explicit description of the pairs of trees where these minimum values are reached, are given by the next three propositions. We give their proofs in the Additional file 1.

Proposition 1

The minimum non-negative value of D p on U T n , for p {0}[1, [ and n2, is 1. And for every T, T U T n , D p (T, T) = 1 if, and only if, one of them is obtained from the other by contracting a pendant arc.

So, not every tree in U T n has neighbors at cophenetic distance 1: only those trees with some leaf whose parent is unlabeled. Now, it is not difficult to check that a tree T U T n such that all its leaves have labeled parents has some tree T such that D p (T, T) = 2, which is the minimum value of D p on U T n greater than 1. One such T is obtained by choosing a pendant arc in T and interchanging the labels of its source and its target nodes.

Proposition 2

The minimum non-negative value of D p on T n , for p {0}[1, [ and n3, is 3. And for every T, T T n , D p (T, T) = 3 if, and only if, one of them is obtained from the other by means of one of the following two operations:

  1. (a)

    Contracting an arc ending in the parent of a cherry (see Figure 3)

  2. (b)

    Pruning and regrafting a leaf that is a sibling of the root of a cherry, to make it a sibling of the leaves in the cherry (see Figure 4)

Figure 3
figure 3

Contraction of an arc ending in the parent of a cherry.

Figure 4
figure 4

Pruning and regrafting an uncle of a cherry to make it a sibling of them.

So, every tree T T n has neighbors T such that D p (T, T) = 3. Indeed, take an internal node v in T of largest depth, so that all its children are leaves. If v has exactly two children, one such neighbor of T is obtained by contracting the arc ending in v. If v has more than two children, one such neighbor of T is obtained by replacing any two children of v by a cherry (that is, taking two children i, j of v, removing the arcs (v, i) and (v, j), and then adding a new node v0 and arcs (v, v0), (v0, i), and (v0, j)).

Proposition 3

The minimum non-negative value of D p on B T n , for p {0} [1, [ and n3, is 4. And for every T, T B T n , D p (T, T) = 4 if, and only if, one of them is obtained from the other by means of one of the following operations:

  1. (a)

    Reorganizing a triplet (see Figure 5)

  2. (b)

    Reorganizing a completely branched quartet (see Figure 6)

Figure 5
figure 5

Reorganizing a triplet.

Figure 6
figure 6

Reorganizing a completely branched quartet.

So again, every tree T B T n has neighbors T such that D p (T, T) = 4. Indeed, take an internal node v in T of largest depth, so that its two children are leaves. Let w be the parent of v. Then, either the other child of w is a leaf, in which case w is the root of a triple and reorganizing its taxa we obtain a neighbor of T, or the other child of w is the parent of a cherry (it will have the same, maximum, depth as v), in which case w is the root of a completely branched quartet and reorganizing its taxa we obtain a neighbor of T.

We focus now on the diameter, that is, the largest value of dφ,p on the spaces of unweighted phylogenetic trees (as in the case of the minimum non-zero value, and for the same reasons, the problem of finding the diameter makes no sense for weighted trees). Unfortunately, we have not been able to find exact formulas for it, but we have obtained its order, which we give in the next proposition. We also give its proof in the Additional file 1.

Proposition 4

The diameter of dφ,p on U T n , T n , and B T n is in Λ(n2) if p = 0 and in Λ(n(p + 2) / p) if p1.

In particular, the diameter of dφ,1 on these spaces is in Λ(n3), and the diameter of dφ,2 is in Λ(n2).

Numerical experiments

We have performed several numerical experiments concerning the distributions of dφ,1 and dφ,2, and the correlation of these metrics with other phylogenetic tree comparison metrics. The results of all these experiments can be found in the web page http://bioinfo.uib.es/∼recerca/phylotrees/cophidist/. In this section we report only on some significant results obtained through these experiments.

As a first experiment, we have generated all trees in B T n and T n , for n = 3, 4, 5, 6, and for all pairs of them we have computed:

  • The cophenetic distances dφ,1 and dφ,2 on B T n and T n .

  • The Robinson-Foulds distance dRF on B T n and T n [15].

  • The classical nodal distances dnodal,1 and dnodal,2 on B T n , which compare the vectors of distances between pairs of taxa by means of the Manhattan and the Euclidean norms, respectively; see [5] and [18], respectively, as well as [20].

  • The splitted nodal distances d nodal , 1 sp and d nodal , 2 sp on T n , which compare the matrices of splitted path lengths between pairs of taxa by means of the Manhattan and the Euclidean norms, respectively; see [20].

In order to analyze this data, we have plotted 2D-histograms for all pairs of metrics and we have computed their Spearman’s rank correlation coefficient. On the one hand, the 2D-histograms for B T 6 and T 6 (the most significative case) are given in Figures 7 and 8, respectively. For each pair of distances, we have divided the range of values that each of the distances gets into 25 subranges, and computed how many pairs of trees fall into each of the 25 × 25 different possibilities. Each of these possibilities is represented by a rectangle in a grid, whose darkness level is proportional of the number of trees. On the other hand, the Spearman’s rank correlation coefficient between the aforementioned distances in the most significative case of n = 6 are given in Tables 2 and 3.

Figure 7
figure 7

2D-histograms showing the relationship between different distances on B T 6 .

Figure 8
figure 8

2D-histograms showing the relationship between different distances on T 6 .

Table 2 Spearman’s rank correlation coefficient between different distances on B T 6
Table 3 Spearman’s rank correlation coefficient between different distances on T 6

These histograms and tables show that dφ,1 and dφ,2 are highly correlated, and that each dφ,i, i = 1, 2, is highly correlated with the corresponding d nodal , i sp on T 6 . This is not a surprise, because both types of metrics are based on encodings of phylogenetic trees related to the position in the tree of the LCA of every pair of leaves: remember the relationship between depths, cophenetic values and splitted path lengths recalled in the Background section. More surprising to us is the low correlation between each dφ,i, and the corresponding dnodal,i on B T 6 , because of the relationship between depths, cophenetic values and patristic distances also recalled in the Background section. The very low correlation between the cophenetic metrics and the Robinson-Foulds metric simply shows that these metrics measure different notions of similarity.

Our second experiment is for values of n greater than 6. The numbers of trees in each of the spaces T n and B T n make it unfeasible to compute the distances between all pairs of trees. Hence, we have randomly and uniformly generated pairs of trees in each of these spaces for n=10,20,,100 until the approximated value of the Spearman’s rank correlations of all pairs of distances converge up to 3 significant digits. The corresponding 2D-histograms and Spearman’s rank correlation coefficient tables for the most significative case of n = 100 are shown in Figures 9 and 10 and Tables 4 and 5. These diagrams and tables confirm the very high correlation between dφ,1 and dφ,2, and very low correlation of these metrics and the nodal and Robinson-Foulds metrics. The correlation between each dφ,i, i = 1, 2, and the corresponding d nodal , i sp is still significant, but it decreases as n increases.

Figure 9
figure 9

2D-histograms showing the relationship between different distances on B T 100 .

Figure 10
figure 10

2D-histograms showing the relationship between different distances on T 100 .

Table 4 Spearman’s rank correlation coefficient between different distances on B T 100
Table 5 Spearman’s rank correlation coefficient between different distances on T 100

Finally, in Figure 11 we have plotted the histograms of the distributions of dφ,1 and dφ,2 on B T n and T n for n=10,20,,100. As it can be seen, they are positive skewed, like the splitted nodal metrics [20], Figure 5], but unlike other metrics like the Robinson-Foulds [32] or the transposition distance [33], Figure 2], which are negative skewed, or the triples metric [16], which is approximately normal.

Figure 11
figure 11

Histograms of the distributions of d φ,1 and d φ,2 on T n and B T n for n = 10 , 20 , , 100 .

Conclusions

Following a fifty years old idea of Sokal and Rohlf [4], we have encoded a weighted phylogenetic tree with nested taxa by means of its vector of cophenetic values of pairs of taxa, adding moreover to this vector the depths of single taxa. These positive real-valued vectors single out weighted phylogenetic trees with nested taxa, and therefore they can be used to define metrics to compare such trees. We have defined a family of metrics dφ,p, for p {0}[1, [, by comparing these vectors through the Lp norm.

We cannot advocate the use of any cophenetic metric dφ,p over the other ones except, perhaps, warning against the use of the Hamming distance dφ,0 because it is too uninformative. Since the most popular norms on R m are the Manhattan L1 and the Euclidean L2, it seems natural to use dφ,1 or dφ,2. And since these two metrics are very highly correlated, the comparison of trees using one or the other will not differ greatly. Each one of these metrics has its own advantages.

On the one hand, the computation of dφ,1 does not involve roots, and therefore it can be computed exactly. Moreover, it takes integer values on unweighted trees and in this case its range of values is greater, thus being more discriminative. Actually, since x p x1 for every x R m and p1, we have that

d φ , p ( T 1 , T 2 ) d φ , 1 ( T 1 , T 2 ) for every T 1 , T 2 W T n .

On the other hand, the comparison of cophenetic vectors by means of the Euclidean norm enables the use of many geometric and clustering methods that are not available otherwise. In particular, it is possible to compute the mean value of the square of dφ,2 under different evolutionary models. We shall report on this elsewhere.

As a rule of thumb, and as we already advised in the context of splitted nodal metrics [20], we suggest using dφ,1 when the trees are unweighted, because these trees can be seen as discrete objects and thus their comparison through a discrete tool as the Manhattan norm seems appropriate. When the trees have arbitrary positive real weights, they should be understood as belonging to a continuous space [34], and then the Euclidean norm is more appropriate.

Future work will include a deeper study of the distribution of dφ,1 and dφ,2 on different spaces of unweighted phylogenetic trees.

Endnotes

aThere are some details to be filled here, because for technical reasons we shall allow the root of our phylogenetic trees to have out-degree 1 without being labeled, and this case is not covered by [20, Thm. 10], but it is not difficult to modify the argument given above to cover also this case.bhttp://en.wikipedia.org/wiki/Phylogenetic_tree

References

  1. Hoef-Emden K: Molecular phylogenetic analyses and real-life data. Comput Sci Eng. 2005, 7: 86-91. 10.1109/MCSE.2005.55.

    Article  CAS  Google Scholar 

  2. Felsenstein J: Inferring Phylogenies. 2004, USA: Sinauer Associates Inc.

    Google Scholar 

  3. Rohlf F, Sokal R: Comparing numerical taxonomic studies. Syst Zool. 1981, 30: 459-490. 10.2307/2413054.

    Article  Google Scholar 

  4. Sokal R, Rohlf F: The Comparison of Dendrograms by Objective Methods. Taxon. 1962, 11: 33-40. 10.2307/1217208.

    Article  Google Scholar 

  5. Williams WT, Clifford HT: On the comparison of two classifications of the same set of elements. Taxon. 1971, 20: 519-522. 10.2307/1218253.

    Article  Google Scholar 

  6. Handl J, Knowles J, Kell DB: Computational cluster validation in post-genomic data analysis. Bioinformatics. 2005, 21: 3201-3212. 10.1093/bioinformatics/bti517.

    Article  CAS  PubMed  Google Scholar 

  7. Restrepo G, Mesa H, Llanos E: Three Dissimilarity Measures to Contrast Dendrograms. J Chem Inf Model. 2007, 47: 761-770. 10.1021/ci6005189.

    Article  CAS  PubMed  Google Scholar 

  8. Steel MA, Penny D: Distributions of tree comparison metrics—some new results. Syst Biol. 1993, 42: 126-141.

    Google Scholar 

  9. Waterman MS, Smith TF: On the similarity of dendrograms. J Theor Biol. 1978, 73: 789-800. 10.1016/0022-5193(78)90137-6.

    Article  CAS  PubMed  Google Scholar 

  10. Allen BL, Steel MA: Subtree transfer operations and their induced metrics on evolutionary trees. Ann Combinatorics. 2001, 5: 1-13. 10.1007/s00026-001-8006-8.

    Article  Google Scholar 

  11. Finden C, Gordon A: Obtaining common pruned trees. J Classification. 1985, 2: 255-276. 10.1007/BF01908078.

    Article  Google Scholar 

  12. Goddard W, Kubicka E, Kubicki G, McMorris F: The agreement metric for labeled binary trees. Math Biosci. 1994, 123: 215-226. 10.1016/0025-5564(94)90012-4.

    Article  CAS  PubMed  Google Scholar 

  13. Zhong Y, Meacham C, Pramanik S: A general method for tree-comparison based on subtree similarity and its use in a taxonomic database. Biosystems. 1997, 42: 1-8. 10.1016/S0303-2647(97)01684-5.

    Article  CAS  PubMed  Google Scholar 

  14. Robinson DF, Foulds LR: Comparisonof weighted labelled trees. Proc 6th Australian Conf Combinatorial Mathematics, Lecture Notes in Mathematics. 1979, Berlin Heidelberg: Springer, 119-126.

    Google Scholar 

  15. Robinson DF, Foulds LR: Comparison of phylogenetic trees. Math Bioscie. 1981, 53: 131-147. 10.1016/0025-5564(81)90043-2.

    Article  Google Scholar 

  16. Critchlow DE, Pearl DK, Qian C: The triples distance for rooted bifurcating phylogenetic trees. Syst Biol. 1996, 45: 323-334. 10.1093/sysbio/45.3.323.

    Article  Google Scholar 

  17. Farris JS: A successive approximations approach to character weighting. Syst Zool. 1969, 18: 374-385. 10.2307/2412182.

    Article  Google Scholar 

  18. Farris JS: On comparing the shapes of taxonomic trees. Syst Zool. 1973, 22: 50-54. 10.2307/2412378.

    Article  Google Scholar 

  19. Phipps JB: Dendrogram topology. Syst Zool. 1971, 20: 306-308. 10.2307/2412343.

    Article  Google Scholar 

  20. Cardona G, Llabrés M, Rosselló F, Valiente G: Nodal distances for rooted phylogenetic trees. J Math Biol. 2010, 61: 253-276. 10.1007/s00285-009-0295-2.

    Article  PubMed  Google Scholar 

  21. Basford N, Butler J, Leone C, Rohlf F: Immunologic Comparisons of Selected Coleoptera With Analyses of Relationships Using Numerical Taxonomic Methods. Syst Biol. 1968, 17: 388-406. 10.1093/sysbio/17.4.388.

    Article  Google Scholar 

  22. Chui V, Thornton I: A Numerical Taxonomic Study of the Endemic Ptycta Species of the Hawaiian Islands (Psocoptera: Psocidae). Syst Biol. 1972, 21: 7-22. 10.1093/sysbio/21.1.7.

    Article  Google Scholar 

  23. Leelambikaa M, Sathyanarayanaa N: Genetic characterization of Indian Mucuna (Leguminoceae) species using morphometric and random amplification of polymorphic DNA (RAPD) approaches. Plant Biosystems. 2011, 145: 786-797. 10.1080/11263504.2011.610924.

    Article  Google Scholar 

  24. Hartigan J: Representation of similarity matrices by trees. J Am Stat Assoc. 1967, 62: 1140-1158. 10.1080/01621459.1967.10500922.

    Article  Google Scholar 

  25. Harvey PH, Pagel M: The comparative method in evolutionary biology. 1991, USA: Oxford university press

    Google Scholar 

  26. Pagel MD: Inferring the Historical Patterns of Biological Evolution. Nature. 1999, 401: 877-884. 10.1038/44766.

    Article  CAS  PubMed  Google Scholar 

  27. Farris JS, Kluge AG, Eckardt MJ: A numerical approach to phylogenetic systematics. Syst Zool. 1970, 19: 172-189. 10.2307/2412452.

    Article  Google Scholar 

  28. Johnson SC: Hierarchical clustering schemes. Psychometrika. 1967, 32: 241-254. 10.1007/BF02289588.

    Article  CAS  PubMed  Google Scholar 

  29. Sneath P, Sokal R: Numerical Taxonomy. 1973, USA: Freeman and Co

    Google Scholar 

  30. Xu S, Atchley WR, Fitch WM: Phylogenetic Iinference under the pure drift model. Mol Biol Evol. 1994, 11: 949-960.

    CAS  PubMed  Google Scholar 

  31. Semple C, Steel M: Phylogenetics. 2003, USA: Oxford University Press

    Google Scholar 

  32. Steel M: Distribution of the symmetric difference metric on phylogenetic trees. SIAM J Discrete Mathematics. 1988, 1: 541-551. 10.1137/0401050.

    Article  Google Scholar 

  33. Alberich R, Cardona G, Rosselló F, Valiente G: An algebraic metric for phylogenetic trees. Appl Mathematics Lett. 2009, 22: 1320-1324. 10.1016/j.aml.2009.03.003.

    Article  Google Scholar 

  34. Billera LJ, Holmes SP, Vogtmann K: Geometry of the space of phylogenetic trees. Adv Appl Mathematics. 2001, 27: 733-767. 10.1006/aama.2001.0759.

    Article  Google Scholar 

Download references

Acknowledgements

The research reported in this paper has been partially supported by the Spanish government and the UE FEDER program, through project MTM2009-07165. We thank the comments and suggestions of the reviewers, which have led to a substantial improvement of this paper.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Francesc Rosselló.

Additional information

Competing interests

The authors declare that they have no competing interests.

Authors’ contributions

AM and FR developed the theoretical part of the paper. GC, LR and DS implemented the algorithms and performed the numerical experiments. GC and DS prepared the Additional file 1 web page. FR prepared the first version of the manuscript. All authors revised, discussed, and amended the manuscript and approved its final version. All authors read and approved the final manuscript.

Electronic supplementary material

Authors’ original submitted files for images

Rights and permissions

Open Access This article is published under license to BioMed Central Ltd. This is an Open Access article is distributed under the terms of the Creative Commons Attribution License ( https://creativecommons.org/licenses/by/2.0 ), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Reprints and permissions

About this article

Cite this article

Cardona, G., Mir, A., Rosselló, F. et al. Cophenetic metrics for phylogenetic trees, after Sokal and Rohlf. BMC Bioinformatics 14, 3 (2013). https://doi.org/10.1186/1471-2105-14-3

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/1471-2105-14-3

Keywords