Skip to main content
Fig. 9 | Algorithms for Molecular Biology

Fig. 9

From: Relative timing information and orthology in evolutionary scenarios

Fig. 9

Illustration of Algorithm 1 with a valid input \(\mathcal {G}= (G_{_{<}}, G_{_{=}}, G_{_{>}}, \sigma )\). We have \(\sigma (a) = \sigma (a'){=:}A\) and \(\sigma (b) = \sigma (b'){=:}B\). Line 1 constructs species tree S that agrees with \((\mathcal {R}_S(\mathcal {G}), \mathcal {F}_S(\mathcal {G}))\). Here, \(\mathcal {R}_S(\mathcal {G}) = \mathcal {F}_S(\mathcal {G}) = \emptyset \) and S is unique. In Line 2, a time map \(\tau _{S}\) for S such that \(\tau _{S}(x)=0\) for all \(x\in L(S)\) is initialized. We choose \(\tau _{S}(0_S)=6\) and \(\tau _{S}(\rho _S)=3\), see panel (a). Hence, \(\epsilon =1\) (Line 3). Line 25 then calls BuildGeneTree\((\{a,a',b,b'\},\rho _S)\) for the first time, hence \(u_S = \rho _S\). In Line 6 a vertex \(\rho '\) is created. Its time map is set to \(\tau _{T}(\rho ') = \tau _{S}(\rho _{S}) + \epsilon = 3+1=4\) and the reconciliation is set to \(\mu (\rho ') = 0_S \rho _S\) in Line 7. Since \(u_S=\rho _S\) is not a leaf, we proceed with computing \(H_1\), \(H_2\), and \(H_3\) for \(L= \{a,a',b,b'\}\) and \(\rho _S\) in Line 13, illustrated in the top row. Since \(H_1\) has only one connected component C, the for-loop in Line 14 runs only once. In Line 15, we thus create a single vertex \(u_1\) as a child of \(\rho '\). We then consider the two connected components \(C_1\) and \(C_2\) of \(H_2\) as both satisfy \(C_j\subseteq C\), \(j\in \{1,2\}\). Here, we start with considering the component \(C_1\) that is induced by the vertices a and b and create a vertex \(v_1\) as a child of \(u_1\) in Line 18. We choose \(v^*_S = A\) in Line 19 (note that we also could have chosen \(v^*_S = B\)) and set \(\tau _{T}(v_1) = \tau _{S}(\rho _{S}) - \epsilon = 2\) and \(\mu (v_1) = \rho _S A\) in Line 20. These steps are illustrated in panel (b). Line 21 then considers the connected components \(C_k\) of \(H_3\) that satisfy \(C_k\subseteq C_1 = \{a,b\}\); both of these connected components are the single vertex graphs induced by a and b, respectively. Starting with \(C'=\{a\}\), Line 22 identifies \(v_S\in {{\,\textrm{child}\,}}_S(\rho _{S})\) such that \(\sigma (C')=\{A\}\subseteq L(S(v_S))\), i.e., \(v_S = A\) and calls BuildGeneTree\((\{a\}, A)\); the subtree returned by this call is attached as a child of \(v_1\) in Line 23. Hence, we are now back in Line 6 where \(u_S = A\). In Line 6, a further (new) vertex \(\rho '\) is created. Line 7 computes \(\tau _{T}(\rho ') = \tau _{S}(A) + \epsilon = 0+1=1\) and \(\mu (\rho ') = \rho _S A\). Now \(u_S=A\) is a leaf of S, hence we proceed in Line 8 and connect each \(x\in L' = \{a\}\) as a child of \(\rho '\) in Line 10. In Line 11, we put \(\tau _{T}(a) = 0\) and \(\mu (a)= \sigma (a)=A\). These steps are illustrated in panel (c). Then BuildGeneTree\((\{b\}, B)\) is executed and we obtain the “partial” gene tree and reconciliation shown in panel (d). The algorithm proceeds on component \(C_2\) of \(H_2\), which is induced by the vertices \(a'\) and \(b'\) and creates a vertex \(v_2\) as a child of \(u_1\) in Line 18. Again, we chose \(v^*_S = A\) in Line 19. By similar arguments as in the previous part, we obtain the “partial” gene tree and reconciliation shown in panel (e). The tree \(T'\) returned in Line 25 is the gene tree shown in panel (e) except for the planted root \(0_T\), which is added in Line 26. In addition, all resulting inner degree-2 vertices (highlighted as black circuits) are suppressed in Line 26. The resulting gene tree (without specified time map) and the resulting relaxed scenario is shown in panel (f). Note, if we choose \(v^*_S = B\) in Line 19 when proceeding on the connected component \(C_2\) of \(H_2\) induced by \(a'\) and \(b'\), we would obtain the restricted scenario \(\mathcal {S}_2\) as shown in Fig. 11

Back to article page