Skip to main content


Fig. 5 | Algorithms for Molecular Biology

Fig. 5

From: An average-case sublinear forward algorithm for the haploid Li and Stephens model

Fig. 5

Key steps involved in calculating \({{\varvec{p}}}_{{{\varvec{i}}}}[{{\varvec{j}}}]\) by delayed evaluation. An illustration of the manipulation of the tuple \(T_2 = (E_{\ell \rightarrow i-1}, F_{\ell \rightarrow m}, m)\) by the lazy evaluation algorithm, and how it is used to calculate \(p_i[j]\) from \(p_{\ell -1}[j]\) just-in-time. In this case, we wish to calculate \(p_{6}[2]\). This is a member of the equivalence class \(E_{2 \rightarrow 5}\), since it hasn’t needed to be calculated since time 1. In step 4 of the algorithm, we therefore must update the whole tuple \(T_2\) by post-composing the partially completed prefix \(F_{2\rightarrow 4}\) of the map \(F_{2 \rightarrow 5}\) which we need using our already-calculated suffix map \(F_{5}\). In step 5, we use \(F_{2 \rightarrow 5}\) to compute \(p_{6}[2] = f_6 \circ F_{2 \rightarrow 5}(p_{1}[j])\). In step 6, we update the tuple \(T_2\) to reflect its loss of \(h_2\), which is now a member of \(E_{6 \rightarrow 6}\)

Back to article page