Advertisement

BMC Genomics

, 16:S6 | Cite as

Efficient algorithms for reconciling gene trees and species networks via duplication and loss events

  • Thu-Hien To
  • Celine Scornavacca
Open Access
Research

Abstract

Reconciliation methods explain topology differences between a species tree and a gene tree by evolutionary events other than speciations. However, not all phylogenies are trees: hybridization can occur and create new species and this results into reticulate phylogenies. Here, we consider the problem of reconciling a gene tree with a species network via duplication and loss events. Two variants are proposed and solved with effcient algorithms: the first one finds the best tree in the network with which to reconcile the gene tree, and the second one finds the best reconciliation between the gene tree and the whole network.

Keywords

tree reconciliation gene evolution phylogenetic parsimony phylogenetic networks 

Background

Reconciliations explain topology incompatibilities between a species tree and a gene tree by evolutionary events - other than speciation - affecting genes [[1], for a review]. However, not all phylogenies are trees: indeed, hybridization can occur and create new species [2] and this results into reticulate phylogenies, i.e. species (phylogenetic) networks [3]. In [4], the authors presented a first contribution toward solving a problem similar to the reconciliation problem, namely the cophylogeny problem [5, 6, 7, 8], on networks. In their article, they first propose a polynomial algorithm to solve this problem on dated host trees taking into account codivergence, duplication, host switching, and loss events. This model is similar to the DTL model in gene tree reconciliation - that takes into account speciation, duplication, transfer, and loss events [[9], among others]. However, when extending the cophylogeny problem to species networks, their model may not be the more pertinent one for the DTL problem. Indeed, in [4] the parasite tree that is "reconciled" with the host network can take any path in the latter, modeling the fact that some hybridization species can receive the parasites of both parents. In the problem of gene tree reconciliation, their model is more adapted to novel hybridizations, where the genes still keep trace of the polyploidy due to the hybridization. But, for ancient hybridizations, the polyploidy of the extant species being reduced, a model where each gene of an hybridization species can be inherited from at most one of its two parents is more pertinent. In other words, for solving the latter problem, we are interested in finding a tree that is "displayed" by the species network such that its reconciliation with a given gene tree is optimum. We propose an efficient algorithm that takes into account duplication and loss events whose complexity does not depend on the number of hybridization events in the species network but only on the level of the network, where the level is a measure of how much the network is "tangled". Moreover, we propose a faster algorithm solving the problem described in [4] when restricting to duplication and loss events (that is, host switching is not taken into account).

Basic notions

We start by giving some basic definitions that will be useful in the paper.

Definition 1 (Rooted phylogenetic network) A rooted phylogenetic network N on a label set  X Open image in new window is a rooted directed acyclic graph with a single root where each outdegree-0 node (the leaves) is labelled by an element of  X Open image in new window. The root of N, denoted by r(N), has indegree 0 and outdegree 2. All other internal nodes have either indegree 1 and outdegree 2 (speciation node), or indegree 2 and outdegree 1 (hybridization node).

Denote by V(N), I(N), E(N), L(N) and L ( N ) Open image in new window respectively the set of nodes, internal nodes (nodes with outdegree greater than 0), edges, leaves and leaf labels of N. The size of N, denoted by |N|, is equal to |V(N)| + |E(N)|. Given x in V(N), we denote by N x the subnetwork of N rooted at x, i.e. the subgraph of N consisting of all edges and nodes reachable from x. If x is a leaf of N, we denote by s(x) the label of x in L ( N ) Open image in new window. If x is a speciation node, we denote by p(x) the only parent of x.

Given two nodes x and y of N, we say that x is lower or equal to y in N, denoted by x N y (resp. lower, denoted by x < N y), if and only if there exists a path (possible reduced to a single node) in N from y to x (resp. and xy). If x N y, then, for every path p from y to x, denote by length(p) the number of speciation nodes in N such that x < N z N y. If N is a tree, then, for every two nodes u, v of N, LCA N (u, v) [10] is the lowest node of N that is above or equal to both u, v.

Given a speciation node x in N, two paths of N starting from x are said to be separated if each path contains a different child of x. Let x, y be two nodes of N. Denote by M N ( x , y ) Open image in new window the set of nodes z of N such that there exist two separated paths in N from z to x and y. For example, in Figure 1(d), M N ' ( x , y ) = { m 1 , m 2 , m 3 } Open image in new window. Note that all nodes in M N ( x , y ) Open image in new window are speciation nodes and, when N is a tree and x, y are not comparable, M N (x, y) contains exactly one node, which coincides with LCA N (x, y).
Figure 1

( a ) An example of a level-2 network N , ( b ) the tree bc ( N ), (c) a switching of N where the switched-off edges are dotted, (d) a network N' such that M N x , y = { m 1 , m 2 , m 3 } Open image in new window, (e) another switching of a network. Note that the edge (a; b) will also be switched off since all out-going edges of b are off.

If every biconnected component of N has at most k hybridization nodes, we say that N is of level-k [11]. A rooted phylogenetic tree is a rooted phylogenetic network with no hybridization nodes, i.e. a level-0 network. In the following, we will refer to rooted phylogenetic networks and rooted phylogenetic trees simply as networks and trees, respectively. In this paper, we allow trees to contain artificial nodes, i.e. nodes with indegree and outdegree 1.

Let B be a biconnected component of a network N. Then B contains exactly one node r(B) without ancestors in B [[12], Lemma 5.3]; we call r(B) the root of B. If B is not trivial, i.e. B consists of more than one node, we can contract it by removing all nodes of B other than r(B), then connect r(B) to every node with indegree 0 created by this removal. Then the following definitions are well-posed.

Definition 2 (Tree bc(N)) Given a network N, the tree bc(N) is obtained from N by contracting all its biconnected components.

For example, Figure 1(a, b) shows respectively a level-2 network N and its associated tree bc(N).

Let denote by B Open image in new window the node in bc(N) that corresponds to a biconnected component B in N. Given two biconnected component B i , B j , we say that B i N B j (resp. B i < N B j ) if and only if B i b c ( N ) B j Open image in new window (resp. B i < b c ( N ) B j Open image in new window). We say that B i is the parent (resp. a child) of B j if B i Open image in new window is the parent (resp. a child) of B j Open image in new window in bc(N). We also denote by LCA N (B i , B j ) the biconnected component corresponding to L C A b c ( N ) ( B i , B j ) Open image in new window in N.

Definition 3 (Elementary network) Given a network N, each biconnected component B that is not a leaf of N defines an elementary network, denoted by N(B), consisting of B and all cut-edges coming out from B.

Definition 4 (Switchings of a network [13]) Given a network N, a switching S of N is obtained from N by choosing, for each hybridization node, an incoming edge to switch on and the other to switch off. Once this is done, we also switch off all switched-on edges with the target node having only switched-off outgoing edges (see Figure 1(e) for an example). For each bi-connected component B of N, we also denote by S(B) the subgraph of S restricted to N(B).

Switchings will be used in the next section to model gene histories for genes evolving in a species network. For example, Figure 1 presents in (c) a switching of the level-2 network in (a). We denote by V on (S) the set of nodes of S that are not an endpoint of any switched-off edge. A path of S is a path of N that uses only switched-on edges.

Hereafter, G will denote a tree and N a network such that there is a bijection between L(N) and L ( N ) Open image in new window and L ( G ) L ( N ) Open image in new window. In the gene tree reconciliation problem, G represents a gene tree such that each leaf corresponds to a contemporary gene and is labeled by the species containing this gene, while N is a species network such that each leaf represents an extant species. In the cophylogeny problem, G represents a parasite tree such that each leaf corresponds to a parasite species that is labeled by the species that hosts it, while N is a host network such that each leaf represents an extant species.

Reconciliations

We will now extend the definition of D L Open image in new window reconciliation in [14] to networks. In a D L Open image in new window reconciliation, each node of G is associated to a node of S and an event - a speciation ( S ) Open image in new window, a duplication ( D ) Open image in new window or a contemporary event ( ) Open image in new window - under some constraints. A contemporary event  ℂ Open image in new window associates a leaf u of G with a leaf x of S such that s(u) = s(x). A speciation in a node u of G is constrained to the existence of two separated paths from the mapping of u to the mappings of its two children, while the only constraint given by a duplication event is that evolution of G cannot go back in time. More formally:

Definition 5 (Reconciliation) Given a tree G and a network N such that L ( G ) L ( N ) Open image in new window, a reconciliation between G and N is a function α that maps each node u of G to a pair (α r (u), α e (u)) where α r (u) is a node of V(N) and α e (u) is an event of type  S Open image in new window or  D Open image in new window or  ℂ Open image in new window, such that:

Note that, if N is a tree, this definition coincides with the one given in [14].

The number of duplications of α, denoted by d(α) is the number of nodes u of G such that α e ( u ) = D Open image in new window. Since in a network there can be several paths between two nodes, we count the number of losses on shortest paths, as done in [4]. In more details, given two nodes x, y of N, the distance between x and y, denoted by dist(x, y), is defined as follows:

  • If y N x, then dist(x, y) = min p length(p) over all possible paths p from x to y;

  • otherwise, dist(x, y) = +∞.

Then, for every uI(G) with child nodes {u1, u2}, the number of losses associated with u in a reconciliation α, denoted by l α (u), is defined as follows:

  • if α e ( u ) = S Open image in new window, then l α (u) = min{dist(x1, α r (u1)) + dist(x2, α r (u2)), dist(x1, α r (u2))+dist(x2, α r (u1))} where x1, x2 are the two children of α r (u);

  • if α e ( u ) = D Open image in new window, then l α (u) = dist(α r (u), α r (u1)) + dist(α r (u), α r (u2)).

The number of losses of a reconciliation α, denoted by l(α), is the sum of l α (·) for all internal nodes of G. Thus, the cost of α, denoted by cost(α), is d(αδ + l(αλ, where δ and λ are respectively the cost of a duplication and a loss event. We use cost(G,N) to denote the cost of the minimum reconciliations between G and N. A reconciliation having the minimum cost is called a most parsimonious reconciliation.

Let S be a switching of N, then a reconciliation between G and S is defined similarly to Definition 5 except that only switched-on edges are considered when defining paths, and only nodes in V on (S) are counted for calculating the length of the shortest path in the definition of dist. This is done to model the fact that, since each gene of an hybridization species is inherited from one of its two parents, we should not count as a loss the fact that the other parent does not contribute. Moreover, note that, for every two nodes x, y of S such that x ≤ S y, there is a unique path from y to x in S.

When N is a tree, there is a unique reconciliation (the LCA reconciliation) between G and N which has minimum cost and this reconciliation can be found in O(|G|) time [15, 16, 17, 18] as follows:

  • for each node u in L(G), α r (u) is defined as the only node x of S such that s(u) = s(x), and α e ( u ) = Open image in new window;

  • for each node u in I(G) with child nodes {u1, u2}, α r (u) = LCA N (α r (u1), α r (u2)); if α r (u1) N α r (u2) or α r (u2) N α r (u1) then α e ( u ) = D Open image in new window; otherwise α e ( u ) = S Open image in new window.

In the LCA reconciliation, the mapping α e is totally defined by α r , hence it can be omitted, and we will use α to refer to α r . Note that the algorithms used on trees to find the LCA reconciliation can also be used on switchings, which - when only switched-on edges are considered - are actually trees. Hereafter, when we refer to the reconciliation between a tree and a switching, we refer to the LCA reconciliation between them. The problems in which we are interested in here are defined as follows:

Problem 1 BEST SWITCHING FOR THE D L Open image in new window MODEL

Input A tree G, a network N such that L ( G ) L ( N ) Open image in new window, and positive costs δ and λ for respectively  D Open image in new window and  L Open image in new window events.

Output A switching S of N such that the cost(G, S) is minimum over all switchings of N.

Problem 2 MINIMUM D L Open image in new window RECONCILIATION ON NETWORKS

Input A tree G, a network N such that L ( G ) L ( N ) Open image in new window, and positive costs δ and λ for respectively  D Open image in new window and  L Open image in new window events.

Output A minimum reconciliation between G and N.

Remark 1 For the sake of simplicity, we suppose that G does not contain any internal node u such that | L G u | = 1 Open image in new window (i.e. all nodes of G u are mapped to a leaf of N). If it is not the case, we can simplify the instance by replacing in G each such subtree G u by a leaf labeled by the unique label in L G u Open image in new window and compute a reconciliation for the simplified tree G'. A parsimonious reconciliation for G can be easily obtained from a parsimonious one for G'.

Method

Best switching

We start by proving that finding the best switching for the D L Open image in new window model is NP-hard:

Theorem 1 Problem 1 is NP-hard.

Proof: To prove the theorem, we reduce Problem 1 to the TREE CONTAINMENT problem, which is NP-hard [19]. The TREE CONTAINMENT problem asks the following "Given a network N and a tree T, both with their leaf sets bijectively labeled by a label set  X Open image in new window, is there a switching S of N such that T can be obtained by S deleting all switched-off edges and nodes with indegree and outdegree 1?". Now, assume there is an algorithm  A Open image in new window to solve Problem 1 in polynomial time. Then, it is easy to see that, since λ, δ > 0, there is a solution of Problem 1 with cost 0 if and only if G is contained in N. Therefore, this method would provide a polynomial-time algorithm to solve the TREE CONTAINMENT problem, which is impossible.

In the following, we present a fixed-parameter tractable algorithm [20] in the level of the network to solve Problem 1. To do so, we need to introduce some notations.

Definition 6 (Mapping B ) For every uV(G), B(u) is defined as the lowest biconnected component B of N such that ℒ(Nr(B)) contains ℒ(G u ).

Then the following remark holds:

Remark 2 If uL(G), then B(u) is the only leaf of N such that s(u) = s(B(u)). If uL(G), then B(u) = LCA N (B(u1), B(u2)) where u1, u2 are child nodes of u in G.

We define by G N the tree obtained from G by adding some artificial nodes on the edges of G and label each node of G N by a biconnected component of N via an extension of the labeling function B(·) as follows:

Definition 7 (Tree G N ) The tree G N is obtained from G as follows: for each internal node u in G with child nodes u1, u2 such that there exist k biconnected components B i 1 > N . . . > N B i k Open image in new windowstrictly below B(u) and strictly above B(u1), we add k artificial nodes v1 > ... >v k on the edge (u, u1), and B(v j ) is fixed to B i j Open image in new window. We do the same for u2.

See Figure 2 for an example of G N . We have the following lemma:
Figure 2

(a) A gene tree G and (b) the tree G N along with the labeling B (·) of its nodes ( N here is the network in Figure 1(a)).

Lemma 1 Let u be a node of I(G N ), and u' be one of the children of u. If u is an artificial node, then B(u) is the parent of B(u') and a child of B(p(u)); otherwise, B(u') is either equal to B(u) or one of its children.

Proof: Suppose that u is an artificial node. Then, by Definition 7, B(p(u)), B(u), B(u') are three consecutive nodes of G N , thus B(u) is the parent of B(u') and a child of B(p(u)). Suppose now that u is not an artificial node, and let u" be the child of u in G such that u" Gn u' Gn u. If B(u") = B(u'), then by definition, u" = u' because no artificial node is added between u and u", and thus the claim holds. If B(u') ≠ B(u"), then by Definition 7, B(u') is the highest biconnected component of N that is below B(u) and above B(u"), which is then a child of B(u).

Definition 8 (G B ) Let B be a biconnected component of N different from a leaf, then G B is the set of all maximal connected subgraph H of G N such that B(u) = B for every uI(H).

For example, in Figure 3, G B 1 Open image in new window consists of one binary tree, G B 2 Open image in new window consists of one edge, and G B 3 Open image in new window contains 1 tree and 1 edge.
Figure 3

An example of execution of Algorithm 1 on the tree G in Figure 2(a) and the network N in Figure 1(a). (a) G B 1 Open image in new window and a switching of N(B1) on which its reconciliation with G B 1 Open image in new window contains 1 duplication and 2 losses. (b) G B 2 Open image in new window and a switching of N(B2) on which the reconciliation with G B 2 Open image in new window contains one loss. (c) G B 3 Open image in new window and a switching of N(B3) on which the reconciliation with G B 3 Open image in new window contains 2 losses.

Lemma 2 Let B be a biconnected component of N different from a leaf, then we have the following:

(i) for every HG B , H is either a binary tree or an edge whose upper extremity is an artificial node. Moreover, for every leaf u of H, B(u) is a child of B.

(ii) if B = B(r(G)), then G B consists of one binary tree.

Proof: (i) First, suppose that I(H) contains an artificial node u. Then this artificial node is the only internal node of H; indeed, by Lemma 1, the value of B(·) for the parent and the child of u are both different from B. Thus, H consists of only one edge whose upper extremity is u. If I(H) does not contain any artificial node, it follows that H is a binary tree. Moreover, by Lemma 1 and Definition 8, B(u) is a child of B for every leaf u of H.

(ii) Suppose now that B = B(r(G)), and G B contains at least two components H1, H2, rooted at two different nodes r1, r2 where B(r1) = B(r2) = B. Let r = L C A G N ( r 1 , r 2 ) Open image in new window, then, by Definition 6, B(v) = B for every node v on the two paths from r to r1 and to r2, because B(r(G)) = B(r1) = B(r2) = B and r 1 , r 2 G N r G N r G Open image in new window. But this contradicts the maximality of H1 and H2 since they can both be extended. Hence G B contains only one component. Suppose that this component is an edge; thus, its upper extremity is an artificial node that has been added on the path from a node u to a node v of G where u is strictly higher than r(G). But this is not possible, because r(G) is the highest node of G. Therefore, G B contains one binary tree.

Given a biconnected component B i different from a leaf, denote by G B i t Open image in new window the set of binary trees of G B i Open image in new window, and G B i e Open image in new window the set of edges of G B i Open image in new window. Let S i be a switching of N(B i ), and let H be a tree in G B i t Open image in new window. By Lemma 2, for every uL(H), B(u) is a child of B i and thus r(B(u)) is a leaf of N(B i ), which is also a leaf of S i . Hence, we can define a reconciliation between H and S i , denoted by β S i H Open image in new window, such that each leaf u of H is mapped to the leaf r(B(u)) of S i .

Lemma 3 Let S be a switching of N, and let α be the reconciliation between G and S. For every uI(G), there exists H G B ( u ) t Open image in new windowsuch that uI(H), and α ( u ) = β S ( B ( u ) ) H ( u ) Open image in new window.

The proof of this lemma is deferred to the appendix. The following definition will be useful later on.

Definition 9 ( cost(H,S i )) Let B i be a biconnected component of N different from a leaf, and S i a switching of N(B i ); then cost(H,S i ) is defined as follows:

As we will see later, this cost corresponds to the contribution of H to a reconciliation between G and any switching of N that contains S i . For example, in Figure 3(b), H is the edge (B2, a) and, if S i is the switching on the left, then cost(H,S i ) = λ.

The next lemma is a central one, and it permits to solve Problem 1 independently per each biconnected component of N :

Lemma 4 Let {B1,..., B p } be the biconnected components of N that are not leaf nodes, and let S be a switching of N where each elementary network N(B i ) has S i as switching. Then c o s t G , S = i = 1 p H G B i c o s t ( H , S i ) . Open image in new window

Proof: Let α be the reconciliation between G and S. Denote by d α (S i ) the number of nodes in I(S i ) associated to a duplication by α. By Remark 1, no duplication happens at leaves of S. Additionally, B i H G B i t I H = I G Open image in new window and the sets of internal nodes of G B i t Open image in new window are disjoint. Hence, we have d ( α ) = i = 1 i d α ( s i ) = i = 1 p H G B i t d ( β S i H ) Open image in new window because β S i H ( u ) = α ( u ) Open image in new window for every internal node u of H (Lemma 3).

Let us now consider the loss count. Note that a node/edge is on (resp. off) in S i if and only if it is also on (resp. off) in S. Let x, y be two nodes of S such that y ≤ S x. Then we define d i s t S i ( x , y ) Open image in new window as the number of nodes z in V on (S i ) \ L(S i ) such that y < S z ≤ S x. Then, for each internal node u of G, we define the number of losses associated with u in S i , denoted by l α (u, S i ), similarly to l α (u) but using the function d i s t S i Open image in new window instead of dist. Then, l α ( u ) = i = 1 p l α ( u , S i ) Open image in new window. Now, let u1, u2 be two children of u in G, then l α (u, S i ) >0 only if the path from α(u) to either α(u1) or α(u2) in S contains at least a node of B i . Therefore, we have three possible cases: (1) α(u) is in is in B i , (3) α(u) is above r(B i ) while either α(u1) or α(u2) is in a biconnected component below B i . In case (1), by Lemma 3, there exists a binary tree H of G B i t Open image in new window such that uI(H), and α v = β S i H ( v ) Open image in new window for every vI(S i ), thus l α u , S i = l β s i H u Open image in new window. Now, let suppose S i that case (2) holds for u1, then u1 must be the root of a binary tree H1 of G t , and the contribution of u1 to l α (u, S i ) is d i s t r S i , β S i H 1 r H 1 Open image in new window. Note that in this case, u1r(G). Finally, let suppose that case (3) holds for u1 and let u a , u b be the artificial nodes added on the edge (u, u1) of G such that B(u a ) = B i and B(u b ) is a child of B i . Hence, u a , u b G B i e Open image in new window, and the contribution of u1 to l α (u, S i ) is dist(r(S i ), r(B(u b ))). Let call V i 1 , V i 2 , V i 3 Open image in new window the set of nodes u in the first, second, and third case. By construction, V1 is disjoint from V i 2 Open image in new window and V i 3 Open image in new window. Moreover, V i 2 Open image in new window and V i 3 Open image in new window are disjoint because if a node u has two children u1, u2 such that u1 is in B i , and u2 is below B i , then u must be in B i , i.e. cannot be above r(B i ). Thus,
l ( α ) = u I ( G ) l α ( u ) = u I ( G ) i = 1 p l α ( u , S i ) = i = 1 p u V i 1 V i 2 V i 3 l α ( u , S i ) . Open image in new window
Therefore,
c o s t ( G , S ) = δ d ( α ) + λ l ( α ) = i = 1 p ( δ d α ( S i ) + λ u I ( G ) l α ( u , S i ) ) = i = 1 p ( δ H G B i t d ( β i H ) + λ u V i 1 V i 2 V i 3 l α ( u , S i ) = i = 1 p ( [ λ u V i 3 ( u , S i ) ] + + [ δ H G B i t d ( β S i H ) + λ u V i 1 l α ( u , S i ) + λ u V i 2 l α ( u , S i ) ] ) . Open image in new window

As proved above (in case (3)), the first term between squared brackets is equal to H G B i t c o s t ( H , S I ) Open image in new window by Definition 9. In the second term between squared brackets, the sum of the two first factors is exactly H G B i t c o s t ( β S i H ) Open image in new window (as proved in case (1)), while the last factor is equal to λ · H G B i t d i s t ( r ( S i ) , β S i H ( r ( H ) ) Open image in new window (as proved in case (2)). Note that as mentioned in case (2), only nodes that are not the root of G are considered. Hence, the second term between squared brackets corresponds to H G B i t c o s t ( H , S i ) Open image in new window by Definition 9.

Therefore, c o s t G , S = i = 1 p H G B i c o s t ( H , S i ) Open image in new window and this concludes the proof.

Algorithm 1 computes the switching of N for which its reconciliation with G has the smallest cost, by analyzing each biconnected component of N independently. See Figure 3 for an example of application of this algorithm to the species network in Figure 1(a) and the gene tree in Figure 2(a).

Algorithm 1 Solving Problem 1

1: Input: A species network N and a gene tree G such that L ( G ) L ( N ) Open image in new window, and positive costs δ, λ for duplication and loss events, respectively.

2: Output: A switching S of N that is optimal in the sense of Problem 1.

3: Compute the tree G N and its labeling function B(·);

4: Compute G B i Open image in new window for each biconnected component B i of N that is not a leaf;

5: for each biconnected component B i of N do

6:      for each switching S i j Open image in new window of N(B i ) do

7:          c o s t j = H G B i c o s t H , S i j Open image in new window;

8:      S i m Open image in new window the switching of N(B i ) with the lowest value of cost j over all j;

9: Return the switching S of N in which each elementary network N(B i ) has S i m Open image in new window as switching.

Theorem 2 Let N be a level-k network with p biconnected components. Algorithm 1 runs in O(|N| + 2 k ·p·|G|) time and returns a switching S of N such that cost(G,S) is minimum.

Proof: Complexity: It is well-known that all biconnected components of N can be computed in linear time, i.e. O(|N|), by using depth-first-search [10]. After a linear preprocessing, LCA operations on a tree can be performed in constant time [21, 22]. Thus, from Remark 2, the mapping B(·) can be computed in O(|G N |). Hence, the tree G N can be constructed in times O(|G N | + |N|).

By a simple traversal of G N which takes time O(|G N |), we can compute G B i Open image in new window for all B i . Each biconnected component B i of N has at most k hybridization nodes, then N(B i ) has at most 2 k switchings. For each switching S i j Open image in new window of N(B i ), it takes O(|G B |) to compute cost j [23, 24]. The overall size of all G Bi is the size of G N . Therefore, the total complexity of the loop at lines 5 - 8 is O(2 k ·|G N |). Each edge of G can have at most p artificial nodes added to it. Hence in the worst case O(|G N |) = O(|Gp), i.e. the total complexity of Algorithm 1 is O(|N| + 2 k ·p·|G|).

Correctness: Let S be a switching of N where each elementary network N(B i ) has S i as the switching. By Lemma 4, cost(G,S) = i = 1 p H G B i c o s t ( H , S i ) Open image in new window. Hence cost(G,S) is minimum if and only if H G B i c o s t ( H , S i ) Open image in new window is minimum for every S i . Lines 5-8 in Algorithm 1 search, for each network N(B i ), the tree S i m Open image in new window such that H G B i c o s t ( H , S i ) Open image in new window is minimum, which implies the correctness of the algorithm.

Minimum Reconciliation on Networks

Given a tree G and a network N, in [4] the authors prove that reconciling G on N can be solved in polynomial time, when host switchings (or transfer events, in the DTL reconciliation terminology) are also accounted for. In their model, each node of N is dated by a single date while each node of G is dated by a set of dates, and they search for a parsimonious reconciliation between G and N, i.e. one that has minimum cost, under the constraint that an event associated to a node u of G can only happen at a node/edge of N whose date is contained in the set of possible dates of u. Although the algorithm complexity stays polynomial, it is very high: O(τ3·|G|·|N|5) for a binary tree and a binary network, where τ is the number of possible dates of the nodes of G and N, which is at most O(|G| + |N|). A drawback of this model is that it requires information on the dates that is often not available. Moreover, transfers are not always possible in all parts of Tree of Life. Here, we take into account only speciation, duplication and loss events, and consider G and N as undated (see Problem 2 and Definition 5 for more details). Using a similar dynamic algorithm on this simpler model, and by some further analyses, we provide an algorithm that is a generalization of the LCA algorithm to networks that has a much smaller complexity than the algorithm in [4], namely O(h2·|G|·|N|), where h is the number of hybridization nodes of N.

Let x, y be two nodes of N. Denote by M i n N x , y Open image in new window the subset of M N x , y Open image in new window such that, for every z M i n N x , y Open image in new window, there does not exist any z M i n N x , y Open image in new window such that every path from z to x and to y passes through z'. For example, in Figure 1(d), m1, m2, m3 are in M N x , y Open image in new window but only m1 and m2 are in M N x , y Open image in new window because every path from m3 to x, y must pass m2.

For the sake of simplicity, we consider only reconciliations without duplications on hybridization nodes: indeed, since losses are not counted at hybridization nodes, a duplication on such nodes can be moved to its only child without changing the total cost of the reconciliation.

Lemma 5 Let α be a reconciliation of minimum cost between G and N, then for every node u of G that has two children u1, u2, we have:

(i) if α e u = S Open image in new window, then α r u M i n N ( α r u 1 , α r u 2 ) Open image in new window;

(ii) if α e u = D Open image in new window, then either α r (u1) ≤ N α r (u2) and α r (u) = α r (u2), or α r (u2) ≤ N α r (u1) and α r (u) = α r (u1).

Proof: (i) Suppose that α e ( u ) = S Open image in new window, then by definition α r (u) must be a node of M N ( α r u 1 , α r u 2 ) Open image in new window. Let x1, x2 be two children of α r (u) such that l α (u) = dist(x1, α r (u1))+dist(x2, α r (u2)). Suppose that α r u M i n N ( α r u 1 , α r u 2 ) Open image in new window, then there exists a node y in M i n N ( α r u 1 , α r u 2 ) Open image in new window such that every path from α r (u) to α r (u1) (resp. to α r (u2)) passes for y. Let y1, y2 be the two children of y.

First, we suppose that the shortest path from x1 to α r (u1) passes through y, y1, while the one from x2 to α r (u2) passes y, y2. Consider the reconciliation α' such that α r v = α r v Open image in new window and α r e = α r e Open image in new window for every vu, while α r u = y Open image in new window and α e u = S Open image in new window. It is easy to see that α' respects Definition 5, and that d(α) = d(α'). Denote by f = dist(α r (u), y), then f >0. The numbers of losses in α and α' are different on those associated with u and p(u) (if u is not the root of G). We thus have l α (p(u)) ≥ l α' (p(u)) - f if ur(G). Moreover, l α (u) = dist(x1, α r (u1)) + dist(x2, α r (u2)) = dist(x1, y) + 1 + dist(y1, α r (u1)) + dist(x2, y) + 1 +dist(y2, α r (u2)) ≥ dist(α r (u), y) + dist(y1, α' (u1) + dist(α r (u), y)+dist(y2, α' (u2))) ≥ 2·f +l α' (u). Hence, whether u coincides with r(G) or not, l(α) > l(α'), i.e. cost(α) > cost(α'), a contradiction.

Suppose now that both the shortest paths from x1 to α r (u1) and to α r (u2) pass through y, and then pass through y1 (or y2). This means that y1 is above both α r (u1) and α r (u2). Let y' be one of the lowest nodes below or equal to y1 that is above both α r (u1) and α r (u2). Let y 1 Open image in new window, y 2 Open image in new window be the two children of y', and sup-1 2 pose, without loss of generality, that y 1 Open image in new window is above or equal to α r (u1) and y 2 Open image in new window is above or equal to α r (u2). Hence, the shortest path from x1 to α r (u1) must pass, in the order, through y, y1, y', and y', while the shortest path from x2 to α r (u2) must pass through y, y1, y', and y 1 Open image in new window. By defining the reconciliation α'as done above apart for α'(u), which is fixed to y', we arrive at a contradiction by a similar argument.

(ii) Suppose that α e ( u ) = D Open image in new window, and α r (u1), α r (u2) are not comparable. Hence, M i n N ( α r u 1 , α r u 2 ) Open image in new window is not empty. If α r u M i n N ( α r u 1 , α r u 2 ) Open image in new window, then there exists a node y M i n N ( α r u 1 , α r u 2 ) Open image in new window such that every path from α r (u) to α r (u1) and to α r (u2) must pass through y. Similarly to case (i), we have that the reconciliation α' that coincides with α apart for the fact that α r u = y Open image in new window and α e u = S Open image in new window has smaller cost than α, a contradiction. Hence, α r (u) 2 ℳin N (α r (u1), α r (u2)). Considering now the reconciliation α' that coincides with α but for α' (u), which is fixed to  S Open image in new window. Hence d(α) = d(α')+1, and l α p u = l α p u Open image in new window if u ≠ r(G). Let x1, x2 be the two children of α r (u). If the shortest path from α r (u) to α r (u1) passes through x1 while the shortest path from α r (u) to α r (u2) passes through x2, then l α u = 2 + l α ( u ) Open image in new window. Therefore, cost(α) > cost(α'), a contradiction. Thus, both the two shortest paths from α r (u) to α r (u1) and α r (u2) must pass through x1 (or x2). Let y be one of the lowest nodes located on both of these paths. Then, yℳin N (α r (u1), α r (u2)). By the same argument as in the previous case, the reconciliation α" coinciding with α but for α r u = y Open image in new window and α e u = S Open image in new window must have smaller cost than α, a contradiction.

Hence, either α r (u1) N α r (u2) or α r (u2) N α r (u1). Suppose that the first case holds (the second case is similar), but α r (u) ≠ α r (u2), i.e. α r (u2) < N α r (u). Let x1, x2 be two children of α r (u). If the shortest path from α r (u) to α r (u1) passes through x1 while the shortest path from α r (u) to α r (u2) passes through x2, then by replacing α e (u) by an  S Open image in new window event, we obtain a reconciliation with a smaller cost. Thus, both shortest paths from α r (u) to α r (u1) and α r (u2) must pass through x1 (or x2). Let y be a node that is located on both paths such that there is no other node below y on these two paths. Then, yℳin N (α r (u1), α r (u2)). By the same argument as in the case (i), the reconciliation α' such that α r v = α r v Open image in new window, α e v = α e v Open image in new window for every vu, α r u = y Open image in new window, α e u = S Open image in new window must have smaller cost than α, a contradiction.

Now, we are ready to describe a dynamic algorithm to compute a reconciliation of minimum cost between G and N. Let α be a reconciliation between G and N. For every uV(G), denote by cost α (u) the cost of the reconciliation of α restricted to G u . Hence, if α is a most parsimonious reconciliation, then cost α (u) is the minimum cost among all reconciliations between G u and N that maps u to α r (u). Algorithm 2 aims at computing, for each u, the set  C Open image in new window(u) containing all pairs (x,c) such that c is the minimum cost among all reconciliations between G u and N mapping u to x. It is straightforward to see that the cost of a most parsimonious reconciliation between G and N is the minimum cost involved in a pair in  C Open image in new window(r(G)).

The function merge(L1, L2) used in Algorithm 2 takes as input two lists of pairs (x,c) - where x is a node of N and c is a real number - and merges them keeping, for each x, the pair (x,c) with the smallest value of c. The method computeMin(y, z) used in Algorithm 2 is detailed in Algorithm 3. This method computes, for two nodes y, z of N, the set M i n N y , z Open image in new window by using two breath-first-searches (BFS) starting respectively from y and z up to the root of N (note that, to perform the breath-first-searches, the edges are considered as directed in the inverse order). For this, it labels each node v in such a way that, if v is not strictly above y and z, then label (v) = ∅. Otherwise, label(v) is the lowest node such that every path from v to y and z passes through it. This method also computes the value of the function dist between y (resp. z) and each node visited in the corresponding breath-first-search.

Algorithm 2 Solving Problem 2

1: Input: A network N and a tree G such that L ( G ) L ( N ) Open image in new window, and positive costs δ, λ for duplication and loss events, respectively.

2: Output: The set  C Open image in new window(u) of pairs (x,c) for every u V G Open image in new window.

3: for each node u of G in post-order do

4:     C Open image in new window(u) ← ∅;

5:   if u is a leaf then

6:      Let x be the leaf of S such that s(x) = s(u);

7:        C Open image in new window(u) ← {(x, 0)};

8:   else

9:      Let u1, u2 be the two children of u;

10:      for each (y, c1) ∈  C Open image in new window(u1) and each (z, c2) ∈  C Open image in new window(u2) do

11:         computeMin(y, z);

12:         C ← ∅;

13:         for each x M i n N y , z Open image in new windowdo

14:            Let x1, x2 be the two children of x in N ;

15:            c = c1 + c2 + λ·min{dist(x1, y) + dist(x2, z), dist(x2, z) + dist(x1, y)};

16:            CC ∪ {(x, c)};

17:         if y ≤ N z then

18:            c = δ + λ·dist(z, y)+ c1 + c2;

19:            CC ∪ {(z, c)};

20:         else if z ≤ N y then

21:            c = δ + λ·dist(y, z) + c1 + c2;

22:            CC ∪ {(y, c)};

23:         C Open image in new window(u) = merge ( C ( u ) , C ) Open image in new window;

24: Return  C Open image in new window.

The following theorem proves the correctness of Algorithm 2:

Theorem 3 Algorithm 2 returns a matrix  C Open image in new window such that, for every uV(G), (x,c) is contained in  C Open image in new window(u) if and only if there exists a most parsimonious reconciliation between G u and N mapping u to x with cost c.

Algorithm 3 computeMin(y, z)

1: Proceed a BFS from y, store the ordered list of visited nodes in BFS(y) and compute, for each u in BFS(y), dist(y,v);

2: Do the same from z;

3: for each node vBFS(y) do

4:   if v = y or v = z or v is not in BFS(z) then label(v) = ∅

5:   else if v has only one child v1 that is in BFS(z) or BFS(y) then

6:      label(v) = label(v1);

7:   else

8:      Let v1, v2 be the two children of v;

9:      if label(v1) = label(v2) ≠ ∅ then

10:         label(v) = label(v1);

11:      else

12:         label(v) = {v}; Add v into M i n N y , z Open image in new window;

Proof: For each uV(G), we need to prove that, if α' is a reconciliation of minimum cost between G u on N, then (α'(u), cost α' ) is contained in  C Open image in new window(u). This is obviously true for every leaf of G (by lines 5-7). Let now u be an internal node having two children u1, u2. Then, following Lemma 5,  C Open image in new window(u) can be computed from  C Open image in new window(u1) and  C Open image in new window(u2) by using the information contained in M i n N Open image in new window and dist. Lines 10-23 in Algorithm 2 computes  C Open image in new window(u) following this lemma.

It remains now to prove that Algorithm 3 correctly computes M i n N y , z Open image in new window. For every node v that is above y, z, denote by low(v) the lowest node such that every path from v to y, z must pass through this node. There is only one such node. Indeed, suppose that there are two such nodes m, m', then every path from v to y must pass through both m, m', i.e. either m < N m' or m' < N m, contradicting the lowest property of m, m'. To prove the claim, we need to show that if v is a node of BFS(y), then:

(i) if v is not strictly above y and z, then label(v) = ∅;

(ii) otherwise, label(v) = low(v) and line 12 of Algorithm 3 is performed if and only if v is actually in M i n N y , z Open image in new window.

Let v be a node of BFS(y), then (i) holds by line 4. Now consider the case where v is strictly above y and z. We will prove (ii) by recursion on v following the order of the nodes in BFS(y). The recursion begins from the set of lowest nodes that are strictly above y and z, i.e. the set of nodes of v in M i n N y , z Open image in new window such that there is not any node in M i n N y , z Open image in new window that is below v. Let v1, v2 be two children of v, then by hypothesis v1, v2 are not strictly above y, z, i.e. label(v1) = label(v2) ≠ ∅; and low(v) = v. Thus, due to line 12, label(v) = v = low(v). Now let v be a node strictly above y, z such that (ii) is correct for each node below v which is strictly above or equal to y, z. If v is a hybridization node, then it is evident that low(v) = low(v1) where v1 is the only child of v. Moreover, since label(v1) = low(v1) (by the hypothesis of recurrence), then label(v) = label(v1) = low(v1) = low(v). If v is a speciation node having two children v1, v2 such that v2 is not in either BFS(y) or BFS(z), then we also have low(v) = low(v1). Hence, due to lines 5 - 6, we have label(v) = label(v1) = low(v1) = low(v). Now consider the last case, i.e. v is a speciation node having two children v1, v2 that are both in BFS(y) and BFS(z). If there exists a node q = low(v1) = low(v2), then low(v) = q because every from v to y, z must pass either through v1 or v2, i.e. always pass through q. Following line 10, we fix label(v) = label(v1) = q = low(v). Moreover, in this case v can not be in M i n N y , z Open image in new window because every path from v to y, z passes through a node q below v. In the last case, we have l a b e l v 1 l a b e l v 2 Open image in new window. Since both v1, v2 are above y, z, then there exists a node q1 = label(v1), and a different node q2 = label(v2). We will prove that v M i n N y , z Open image in new window. Indeed, suppose otherwise, then there is a node q such that every path from v to y, z must pass through q. Hence, every path from v1 (resp. v2) to y, z must also pass through q, so q1 N q (resp. q2 N q). It means that there is a path from v1 to q to q2 and then to y, z that does not pass through q1, a contradiction. Hence v is in M i n N y , z Open image in new window, and thus by definition the only node that every path from v to y, z must pass through is v itself (line 12).

We now present some intermediate results that will be useful to prove the complexity of Algorithm 2.

We extend the definition of M N Open image in new window to a subset of leaves. Let L be a subset of L(N ). If |L| = 1, then M N L = L Open image in new window. Otherwise, M N L Open image in new window is the set of nodes m of N such that m is above all leaves in L and there exist at least two separated paths from m to two distinct leaves of L.

Given a node u of G, L N (u) is defined as the set of leaves of N to which α maps the leaf set of G u , i.e. L N u = { x L N | u L G u Open image in new window and s(u) = s(x)}.

Lemma 6 Let α be a most parsimonious reconciliation between G and N, then, for every node u of G , α r u M N L N u Open image in new window.

Proof: It is true for every leaf u of G. Let u now be an internal node having two children u1, u2.

If u1, u2L(G), then following Remark 1, L N (u) consists of two distinct nodes α r (u1), α r (u2). By Lemma 5, α e ( u ) = S Open image in new window and α r u M i n N ( α r u 1 , α r u 2 ) Open image in new window, i.e. there exist two separated paths from α r (u) to α r (u1) and α r (u2). It means that α r u M N L N u Open image in new window.

Let u1L(G), then following Remark 1, |L N (u1)| ≥ 2, then there always exist two distinct leaves x, y of L N (u) such that xL N (u1), yL N (u2), i.e. x is below α r (u1) and y is below α r (u2). If α e ( u ) = S Open image in new window, then following Lemma 5, α r u M i n N ( α r u 1 , α r u 2 ) Open image in new window, i.e. there exist two separated paths from α r (u) to α r (u1), α r (u2). By extending these two paths from α r (u1) to x, and from α r (u2) to y, we have to two separated paths from α r (u) to x, y. In other words, α r (u) ∈ N (L N (u)). If α e (u) =  D Open image in new window and suppose that α r (u2) N α r (u1), then α r (u) = α r (u1) following Lemma 5, and α r (u) is not a leaf of N following Remark 1. Let u' be the highest node such that u' G u1 and α e ( u ) = S Open image in new window. Then following Lemma 5, α r ( u ) = α r u Open image in new window, and there exists two separated paths from α r (u'), i.e. from α r (u), to two distinct leaves of L N (u'), i.e. two distinct leaves of L N (u). We can prove the claim similarly for the case when α r (u1) N α r (u2).

Lemma 7 If N is a network that contains h hybridization nodes, then for every subset L of L N , | M N L | h + 1 Open image in new window holds.

The proof of this lemma is deferred to the appendix. We are now ready to state the complexity of Algorithm 2.

Theorem 4 The time complexity of Algorithm 2 is O(h2·|G|·|N|) where h is the number of hybridization nodes of N.

Proof: For every uV(G), | C ( u ) | Open image in new window is equal to the possible nodes of N that u can be mapped to, which is bounded by | M N L N u | Open image in new window by Lemma 6, and so by O(h) following Lemma 7.

The for loop at lines 3 - 23 is performed |G| times, and, at each iteration, the for loop at lines 10-23 is performed O(h2) times. In each iteration of the second loop, the operation computeMin, as detailed in Algorithm 3, requires two breath-first-search traversals, which can be performed in time O(|N|). Moreover, for every node x of M i n N y , z Open image in new window, by definition there exists two separated paths from x to y, z, which can be extended to be two separated paths from x to two distinct leaves l1, l2 of L N (u) where l1 is a leaf below y of and l2 is a leaf below z. This is always possible because, by Remark 1, |L N (u)| > 1. Hence, x must be in M N L N u Open image in new window by definition, i.e. M i n N y , z M N L N u Open image in new window, and thus | M i n N y , z | | M N L N u | h +  1 Open image in new window. Therefore, the loop at lines 13 - 16 can be performed in time O(h). The operation merge(L1, L2) at lines 23 for two lists of size O(h) can be implemented in times O(h), if we know that the resulting list is also of size O(h). Hence, it takes O(|N| + h) = O(|N|) times for each iteration of the loop 10 - 23. Therefore, the total complexity is O(h2· |G|·|N|).

Finally, a reconciliation of minimum cost between G and N can be then obtained by a standard back-tracking of the matrix  C Open image in new window, starting from any pair (x,c) of  C Open image in new window(r(G)) such that c is the minimum value over all pairs in  C Open image in new window(r(G)).

Conclusions

In this paper, we have studied two variants of the reconciliation problem between a gene tree and a species network. In particular, for the problem of finding the "most parsimonious" switching of the network, even though the number of switchings can be exponential with respect to the number of hybridization nodes, we proposed an algorithm that is exponential only with respect to the level of the network, which is often low for biological data. Moreover, the problem of finding a reconciliation between a gene tree and a network, which was solved in [4] for a more general model but with a very high complexity, was re-studied here for a simpler model, which is more pertinent for same parts of the Tree of Life, and an algorithm with a much smaller complexity was provided. In a further work, we intend to implement the algorithms presented in this paper and apply them to biological data.

Appendix

Proof of lemma 3

By Definition 8, for every uI(G), there must exist HGB(u) such that uI(H). If H is an edge, then u is the only internal node of H, which must be an artificial node by Lemma 2. But this is not possible because nodes of G cannot be artificial. Hence, H must be a binary tree. Let denote B i = B(u), and S i = S(B(u)). We will prove now that α u = β S i H u Open image in new window by recursion on the height of u.

Let u be an internal node of G that has two children u1, u2 in G, and let H be the binary tree of G B i Open image in new window such that uI(H). Denote B i 1 = B u 1 Open image in new window, B i 2 = B u 2 Open image in new window, and S i 1 = S B u 1 Open image in new window, S i 2 = S B u 2 Open image in new window. For j = 1, 2, if u j is a leaf, let H j be equal to u j , otherwise H j is the binary tree of G B i j Open image in new window such that u j I(H j ). For the sake of convenience, if u j is a leaf, we also denote by β S i j H j Open image in new window the reconciliation that maps the only leaf u j to the only leaf x of N such that s(x) = s(u j ). Note that s(x) = α(u j ).

We now suppose that α u j = β S i j H j u j Open image in new window for j = 1, 2 (which is evidently true if u j is a leaf), and we will show that this implies that the claim is true for u.

Let u 1 Open image in new window(resp. u 2 Open image in new window) be the child of u in G N such that u 1 G N u 1 < G N u ( resp . u 2 G N u 2 ) < G N u ) Open image in new window. We respectively denote B i 1 = B ( u 1 ) Open image in new window and B i 2 = B ( u 2 ) Open image in new window. By definition of the LCA reconciliation, we have β S i H ( u ) = L C A S i ( β S i H ( u 1 ) , β ( u 2 ) ) Open image in new window.
  1. (i)

    If B i 1 = B i 2 Open image in new window, then B i = B i 1 = B i 1 = B i 2 = B i 2 Open image in new window, and H = H1 = H2. This implies that u 1 = u 1 Open image in new window, because otherwise H will contain an artificial node. The same holds for u 2 Open image in new window and u2. Thus, α u = L C A S ( α u 1 , α u 2 ) = L C A S ( β S i 1 H 1 u 1 , β S i 2 H 2 u 2 ) = L C A S ( β S i H u 1 , β S i H u 2 ) = L C A S i ( β S i H u 1 , β S i H u 2 ) = L C A S i ( β S i H u 1 , β S i H u 2 ) = β S i H u . Open image in new window

     
  2. (ii)

    If B i 1 < N B i 2 Open image in new window, then B i = B i 2 Open image in new window, and H = H2. As in point (i), this implies u 2 = u 2 Open image in new window and thus α ( u ) = L C A S ( α ( u 1 ) , α ( u 2 ) ) = L C A S ( β S i 1 H 1 ( u 1 ) , β S i H ( u 2 ) ) Open image in new window. If u 1 = u 1 Open image in new window, then we have L C A S ( β S i 1 H 1 ( u 1 ) , β S i H ( u 2 ) = L C A S ( β S i H ( u 1 ) , β S i H ( u 2 ) = β S i H ( u ) Open image in new window. Otherwise, u 1 Open image in new window is an artificial node which is a leaf of H that is mapped to r ( B i 1 ) Open image in new window by β S i H Open image in new window. By Lemma 1, B i 1 N B i 1 < N B i Open image in new window, so all nodes of B i are above all nodes of B i 1 Open image in new window and above r ( B i 1 ) Open image in new window. This implies that L C A S ( β S i 1 H 1 u 1 , β S i H ( u 2 ) ) = L C A S ( r B i 1 , β S i H ( u 2 ) ) = L C A S i ( β S i H ( u 1 ) , β S i H ( u 2 ) ) = β S i H u Open image in new window. Similarly for the case where B i 2 < N B i 1 Open image in new window.

     
  3. (iii)

    Suppose now that B i 1 Open image in new window, B i 2 Open image in new window are not comparable and that u 1 u 1 Open image in new window and u 2 u 2 Open image in new window (the other cases can be shown reusing the arguments of point (ii)). Then, similarly as in point (ii), B i 1 N B i 1 < N B i , B i 2 N B i 2 < N B i Open image in new window, and u 1 Open image in new window, u 2 Open image in new window are leaves of H mapped respectively to r ( B i 1 ) Open image in new window and r ( B i 2 ) Open image in new window by β S i H Open image in new window. Since β S i 1 H 1 u 1 Open image in new window is a node of B i 1 Open image in new window, β S i 2 H 2 u 2 Open image in new window is a node of B i 2 Open image in new window, then L C A S ( β S i 1 H 1 u 1 , β S i 2 H 2 u 2 ) = L C A S r B i 1 , r B i 2 = L C A S i ( β S i H u 1 , β S i H u 2 ) = β S i H u . Open image in new window

     

Therefore, in all cases we always have α u = β S H u Open image in new window, and thus the same is true for every uI(G) by recursion.

Proof of lemma 7

We will prove this lemma by recursion on the number of hybridization nodes. See the figure 4 for an example.
Figure 4

An illustration for the proof of Lemma 7. In this example: L = {l1, l2, l3, l4}, Q = {q1, q2, q3}, L * = {l1, l3, l4}, L3 = {l4}, L2 = {l3}, and L1 = ∅. For i = 1, let l(q1) = l3; thus, we have c(1) = 2 and the path p1 starts from q1, passes through q 1 Open image in new window, b1 to l3, while the path p 1 Open image in new window starts from q2, passes through q 2 Open image in new window, b1 to l3. In this case, we have h1 = b1. For i = 2, let l(q2) = l3; thus we have c(2) = 3 and the path p2 starts from q2, passes through q 2 Open image in new window, b1, b2, h2 to l4, while the path p 2 Open image in new window starts from q3 passes through q 3 Open image in new window to l4. Let x be a node in M N ( L ) Open image in new window, then x is also in M N ( L ) Open image in new window where N" is obtained from N' by removing all edges (a i , b i ).

If there is no hybridization node, then N is a tree, and it is evident that M N L Open image in new window contains exactly one node.

Suppose that the claim is correct for every network having h hybridization nodes. Let N now be a network that has h + 1 hybridization nodes. Let (a, b) be an edge of N having as target a hybridization node (namely, b) such that it does not exist any hybridization node above a (such a node always exists because N is a directed acyclic graph). Let N' be the network obtained by removing (a, b) from N (and also removing all nodes of indegree 1 and outdegree 1 created by this removal), then N' has exactly h hybridization nodes. Let Q = M N L \ M N L Open image in new window, then every node q in Q must be above a. Indeed, if q is not above a, then every path from q to every node of L does not contains (a, b), thus q is in M N L Open image in new window, a contradiction. Moreover, by hypothesis, there is no hybridization node above a, hence all nodes of Q must be contained in a path leading a, and this path does not contain any hybridization to node. Let enumerate the nodes in Q as q1,... q m from the lowest to the highest one.

If Q 1 , then | M N L = | M N L | + Q h + 1 + 1 = h + 2 Open image in new window, we are done.

Suppose now that |Q| = m >1. In the following, we will define m - 1 edges of N having as target a hybridization node such that if N" is the network obtained from N' by removing these edges, then M N L = M N L Open image in new window.

Denote by L * the set of nodes in L that are below q m in N'. Hence L \ L * is not empty since otherwise q m would be in M N L Open image in new window, a contradiction. For every q i , i = 1,..., m, let q i Open image in new window, q i Open image in new window be the two children of q i such that q i Open image in new window is above or equal to a. Hence, q i Open image in new window, is not above or equal to a since there is no hybridization node above a, thus every path from q i to L \ L * must pass through q i Open image in new window and a, b. By definition, there must exist at least two separated paths from q i to two leaves of L. Hence, for every i, there exists always a path from q i to a node of L * that passes through q i Open image in new window. Denoted this node by l(q i ).

Denote by L m the set of nodes in L * such that, for every lL m , there is a path from q to l that passes through q m Open image in new window. As explained above, L m is not empty. Recursively, for every i< m, let L i be the set of nodes in L* \ L m \... Li+1 such that, for every lL i , there is a path from q i to l that passes q i Open image in new window. Note that this set may be empty if i< m, and for every ij, L i L j = ∅.

We will define, for each i < m, an index c(i) that is strictly greater than i such that Lc(i) ≠ ∅, together with two paths p i (resp. p i Open image in new window) from q i (resp. qc(i)) to a node of Lc(i) as follows: if l(q i ) is not in L i , then by the definition, there exists a unique j such that L j contains l(q i ), and j > i. We fix c(i) = j. Next, we define p i (resp. p i Open image in new window) as a path from q i (resp. qc(i)) to l(q i ) that passes q i Open image in new window (resp. q c i Open image in new window). If l(q i ) is in L i , then let c(i) be the smallest number that is greater than i and Lc(i) ≠ ∅ (such an index always exists because L m ≠ ∅). Let l' be a node of Lc(i). Since q i is in M N (L), then there must exist a path from q i to l', and we define p i as this path. The path p i Open image in new window is defined as the one from qc(i) to l' that passes through q c ( i ) Open image in new window. Note that p i , p i Open image in new window must contain at least one common hybridization node since they start from different nodes and end at a same leaf of L. Denote by h i the highest common hybridization node of p i and p i Open image in new window. Hence, all h i s are distinct since each p i starts at a different node q i , and each p i Open image in new window starts at a node qc(i) that is strictly greater than q i . We define (a i , b i ) recursively in increasing order of i from 1 to m - 1 as follows. If i = 1, then b i is the highest hybridizatition node on p i . If i >1, then b i is the highest hybridization node on p i and different from all b k for every k < i. There exists always such a node b i , for example h i . Therefore, all b i s are distinct. Denote by a i the parent of b i on the path p i .

Denote by N" the network obtained from N' by removing all edges (a i , b i ). For every node x in M N L Open image in new window, we will prove that x is also in M N L Open image in new window. Denote by x', x" the two children of x. By definition, for every lL, there exists a path, denoted by f'(l), in N' from x to l such that at least one path among them passes through x' and one other passes through x". To prove that x is in M N L Open image in new window, we will now construct another set of paths in N" (i.e. in N' and does not contain any (a i , b i )) from x to each leaf l of L, denoted by f"(l), such that at least one path among them passes through x'and one other passes through x".

Consider first the case that x is above q m (as shown in the figure 4). Without loss of generality, suppose that x' is above or equal to q m while x" is not. Suppose that f'(l) contains q m , then lL* and f'(l) must pass through x' because there is no hybridization node above q m . Suppose that l L 1 . . . L m Open image in new window. Let k be the index such that lL k , then we can choose a path f"(l) in N' from x to l that does not contain any (a i , b i ) as follows. This path starts from x, passes through x', goes down to q k , then takes the path from q k to l that contains q". Note that this path does not include any p i since, by construction, every path p i starts from q i and goes to a node in Lc(i) that is different from L i , while this path passes through q k and goes to a node in L k . Moreover, this path and p i can not have any common hybridization node above a i because b i is the highest hybridization node on p i . Hence, it can not pass through (a i , b i ) for any i. If l is not in L 1 . . . L m Open image in new window, it means that every path from q m to l must pass through q 1 Open image in new window, then we take the path starting from x, going down to q i Open image in new window, then continuing to l. It is evident that this path does not include any p i , and it cannot have with p i any common hybridization node above a i because b i is the highest hybridization node on p i . Hence it does not pass through any (a i , b i ). If f'(l) does not contain q m , then we fix f"(l) = f'(l). It is easy to see that f'(l) does not contain any edge (a i , b i ) because otherwise f'(l) and p i must have at least a common hybridization node above a i (since there is no hybridization node above q i ). But this is not possible because b i is the highest hybridization node on p i . Remark that at least one of the paths f'(l) in this case must pass through x" since all paths in the first case must pass through x'. Hence at least two of the paths f"(l) are separated, thus x is in M N L Open image in new window by definition.

Consider now the case that x is not above q m , then similarly as in the previous case where f'(l) does not contain q m , we deduce that f'(l) does not contain any (a i , b i ) for every l. Hence, by choosing f"(l) = f'(l) for every l, we are done.

Therefore, we have M N L = M N L Open image in new window.

The network N" contains h - |Q| + 1 hybridization nodes, then following the hypothesis of recurrence, | M N L h - | Q | +  2 Open image in new window. This implies that | M N L | = | M N L h - Q | +  2 Open image in new window, thus | M N L | = | M N L | + Q h - | Q | + 2 + | Q | = h +  2 Open image in new window.

Notes

Acknowledgements

This work was partially funded by the French Agence Nationale de la Recherche Investissements d'Avenir/ Bioinformatique (ANR-10-BINF-01-02, Ancestrome). The publication charges of this article were funded by the French Grant Agence Nationale de la Recherche: Investissements d'Avenir/Bioinformatique (ANR-10-BINF-01-02, Ancestrome).

This article has been published as part of BMC Genomics Volume 16 Supplement 10, 2015: Proceedings of the 13th Annual Research in Computational Molecular Biology (RECOMB) Satellite Workshop on Comparative Genomics: Genomics. The full contents of the supplement are available online at http://www.biomedcentral.com/bmcgenomics/supplements/16/S10.

References

  1. 1.
    Doyon J-p, Ranwez V, Daubin V, Berry V: Models, algorithms and programs for phylogeny reconciliation. Briefings in bioinformatics. 2011, 12 (5): 392-400. doi:10.1093/bib/bbr045CrossRefGoogle Scholar
  2. 2.
    Maddison WP: Gene trees in species trees. Systematic Biology. 1997, 46 (3): 523-536. doi:10.1093/sysbio/46.3.523, [http://sysbio.oxfordjournals.org/content/46/3/523.full.pdf+html]CrossRefGoogle Scholar
  3. 3.
    Huson D, Rupp R, Scornavacca C: Phylogenetic Networks. 2010, Cambridge University PressCrossRefGoogle Scholar
  4. 4.
    Libeskind-Hadas R, Charleston MA: On the computational complexity of the reticulate cophylogeny reconstruction problem. JCB. 2009, 16 (1): 105-117.Google Scholar
  5. 5.
    Page RDM: Parallel phylogenies: reconstructing the history of host-parasite assemblages. Cladistics. 1994, 10 (2): 155-173.CrossRefGoogle Scholar
  6. 6.
    Ronquist F: Reconstructing the history of host-parasite associations using generalized parsimony. Cladistics. 1995, 11 (1): 73-89.CrossRefGoogle Scholar
  7. 7.
    Charleston M: Jungles: a new solution to the hostparasite phylogeny reconciliation problem. Math Biosci. 1998, 149 (2): 191-223.CrossRefGoogle Scholar
  8. 8.
    Merkle D, Middendort M: Reconstruction of the cophylogenetic history of related phylogenetic trees with divergence timing information. Theory Biosci. 2005, 123 (4): 277-299.CrossRefGoogle Scholar
  9. 9.
    Doyon JP, Scornavacca C, Gorbunov KY, Szöllősi GJ, Ranwez V, Berry V: An effcient algorithm for gene/species trees parsimonious reconciliation with losses duplications and transfers. Research in Computational Molecular Biology: Proceedings of the 14th International Conference on Research in Computational Molecular Biology (RECOMB). 2010, LNCS, Springer, Berlin/Heidelberg, Germany, 6398: 93-108. Software downloadable at http://www.atgc-montpellier.fr/Mowgli/Google Scholar
  10. 10.
    Cormen TH, Stein C, Rivest RL, Leiserson CE: Introduction to Algorithms. 2001, McGraw-Hill Higher Education, 2Google Scholar
  11. 11.
    Choy C, Jansson J, Sadakane K, Sung W-K: Computing the maximum agreement of phylogenetic networks. Theoretical Computer Science. 2005, 335 (1): 93-107.CrossRefGoogle Scholar
  12. 12.
    Fischier M, van Iersel L, Kelk S, Scornavacca C: On Computing the Maximum Parsimony Score of a Phylogenetic Network. SIAM Journal on Discrete Mathematics - SIDMA. 2015.Google Scholar
  13. 13.
    Kelk S, Scornavacca C, Van Iersel L: On the elusiveness of clusters. IEEE/ACM Transactions on Computational Biology and Bioinformatics (TCBB). 2012, 9 (2): 517-534.CrossRefGoogle Scholar
  14. 14.
    Doyon J, Chauve C, Hamel S: Space of gene/species trees reconciliations and parsimonious models. Journal of Computational Biology. 2009, 16 (10): 1399-1418.CrossRefGoogle Scholar
  15. 15.
    Zmasek CM, Eddy SR: A simple algorithm to infer gene duplication and speciation events on a gene tree. Bioinformatics. 2001, 17 (9): 821-828.CrossRefGoogle Scholar
  16. 16.
    Goodman M, Czelusniak J, Moore GW, Romero-Herrera AE, Matsuda G: Fitting the gene lineage into its species lineage, a parsimony strategy illustrated by cladograms constructed from globin sequences. Systematic Biology. 1979, 28 (2): 132-163.CrossRefGoogle Scholar
  17. 17.
    Page RDM: Maps between trees and cladistic analysis of historical associations among genes, organisms, and areas. Systematic Biology. 1994, 43 (1): 58-77.Google Scholar
  18. 18.
    Chauve C, El-Mabrouk N: New perspectives on gene family evolution: Losses in reconciliation and a link with supertrees. Research in Computational Molecular Biology, 13th Annual International Conference, RECOMB 2009, Tucson, AZ, USA, May 18-21, 2009. Proceedings. 2009, 46-58.Google Scholar
  19. 19.
    Kanj Ia, Nakhleh L, Than C, Xia G: Seeing the trees and their branches in the network is hard. Theoretical Computer Science. 2008, 401: 153-164. doi:10.1016/j.tcs.2008.04.019CrossRefGoogle Scholar
  20. 20.
    Downey RG, Fellows MR: Fundamentals of Parameterized Complexity. Springer. 2013, 4:Google Scholar
  21. 21.
    Gabow HN, Tarjan RE: A linear-time algorithm for a special case of disjoint set union. Proceedings of the Fifteenth Annual ACM Symposium on Theory of Computing. 1983, 246-251.Google Scholar
  22. 22.
    Harel D, Tarjan RE: Fast algorithms for finding nearest common ancestors. SIAM Journal on Computing. 1984, 13 (2): 338-355.CrossRefGoogle Scholar
  23. 23.
    Zhang L: On a mirkin-muchnik-smith conjecture for comparing molecular phylogenies. Journal of Computational Biology. 1997, 4: 177-187.CrossRefGoogle Scholar
  24. 24.
    Bender M, Farach-Colton M: The lca problem revisited. LATIN 2000: Theoretical Informatics. Lecture Notes in Computer Science Springer. 2000, 1776: 88-94.Google Scholar

Copyright information

© To and Scornavacca et al. 2015

This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. The Creative Commons Public Domain Dedication waiver (http://creativecommons.org/publicdomain/zero/1.0/) applies to the data made available in this article, unless otherwise stated.

Authors and Affiliations

  1. 1.CNRS, IRD, EPHEISEM - Université de MontpellierMontpellierFrance
  2. 2.Institut de Biologie Computationnelle (IBC)MontpellierFrance

Personalised recommendations