Parametric Sequence Alignment
4.5 Constructing the Parameter Space Decomposition
Constructing the maximization diagram of the optimum score function requires producing all faces of dimensions zero through d of the maximization diagram, along with the inci-dence relationships between faces, and the optimum alignments associated with all faces of dimension d. The construction problem can be solved repeatedly applying the ray-shooting idea used for sensitivity analysis (4.4.6) to generate all regions in some order [31]. For two-parameter problems this method runs in O(t· f + f2) time, where t and f are, respectively, the time to do a single evaluation of Z and the number of faces in the maximization diagram [31]. Another approach is to lift the execution of a dynamic programming optimum align-ment algorithm so that instead of computing an alignalign-ment for a single parameter value, it computes alignments for all values simultaneously [41]. To do so, the lifted algorithm takes advantage of the piecewise linearity of dynamic programming algorithms, operating on linear functions instead of real numbers. In particular, sums of real values become sums of piecewise linear functions and the max operator on numbers is replaced by the upper envelope operator on piecewise linear functions [41].
In the remainder of this section, we present a simple and intuitive algorithm that con-structs Z through a series of evaluations of the optimum solution at various points in the parameter space [16, 21, 20]. In effect, the algorithm generates a sequence of score func-tions whose upper envelope converges to Z. For two parameters, the method has the same running time as above-mentioned procedures, and naturally generalizes to any number of parameters.
4.5.1 The One-Parameter Case
The one-parameter case gives much of the intuition behind the higher-dimensional gen-eralization. The method presented here constructs the maximization diagram of a one-parameter problem within a given intervalI = [λ(r), λ(l)]. Throughout its execution, the algorithm updates a function W , which is an increasingly closer approximation to Z, while maintaining the following invariant:
W is the upper envelope of a subset of{score(A, λ) : A is optimal at some λ ∈ I} (4.18)
4-20 Handbook of Computational Molecular Biology Thus, W is a piecewise linear convex function such that W (λ)≤ Z(λ) for all λ ∈ I; W is represented by its maximization diagram. A breakpoint λ(0) of W is said to be verified if it is known to also be a breakpoint of Z and W (λ(0)) = Z(λ(0)); otherwise, the breakpoint is unverified. At termination, all breakpoints are verified and W = Z.
Algorithm 1ParamConstruct
Input: An intervalI = [λ(l), λ(r)] and an evaluator for Z.
Output: The maximization diagram of Z.
1. Compute optimal alignmentsA(l) andA(r) at λ(l) and λ(r). 2. Let W be the upper envelope of score(A(l), λ) and score(A(r), λ).
3. If W has no breakpoints insideI, then return W and stop.
4. Otherwise, declare the intersection point λ(m)of score(A(l), λ) and score(A(r), λ) to be unverified.
5. Iterate the following steps until W has no unverified breakpoints.
(a) Choose any unverified breakpoint λ(0) of W .
(b) Evaluate Z at λ(0); letA(0) be the alignment returned.
(c) If Z(λ(0)) = W (λ(0)), declare λ(0) to be verified.
(d) Otherwise, the new W is the upper envelope of current W and score(A(0), λ).
Any new breakpoints created in the process are declared to be unverified.
6. Return W
The execution of this algorithm is illustrated in Figure 4.8. At termination, all breakpoints of W are also breakpoints of Z; thus, since invariant (4.18) holds throughout the execution, we must have W (λ) = Z(λ) for all λ∈ I. To count the number of evaluations, observe that there can be at most one evaluation at any λ that is not a breakpoint of Z and at most two evaluations at any λ that is a breakpoint of Z. Each update to W in step (5d) takes O(1) time. We summarize the analysis as follows [16, 26].
THEOREM 4.5 Algorithm 1ParamConstruct correctly computes the maximization diagram of Z within intervalI in time O(t(b + 1)), where b is the number of breakpoints of Z that lie within I and t is the time for an evaluation of Z.
For example, consider the global alignment problem with zero gap penalty. A single e-valuation in this case takes time t = O(nm). By Remark 4.1, 4.3, while there are formally three parameters, α, β, and γ, there is effectively only one, γ. Thus, we can use 1Param-Constructto build the maximization diagram of Z, which in this case has O(n2/3) regions (see 4.3.1), for a total bound of O(n5/3m).
4.5.2 Generalization to Higher Dimensions
Algorithm 1ParamConstruct can be extended to two parameters in a natural way [20].
The two-parameter algorithm constructs the maximization diagram within a rectangular interval I = [λ(0)1 , λ(1)1 ]× [λ(0)2 , λ(1)2 ] by repeatedly invoking an evaluator to obtain optimal alignments at various points within I. Throughout its execution, the algorithm maintains a function W satisfying invariant (4.18). W is represented by its maximization diagram
— in this case a subdivision of the plane into convex polyhedral regions — whose vertices are classified as either verified or unverified, depending on whether or not W (λ) = Z(λ)
Parametric Sequence Alignment 4-21
*
(a) (b) (c)
(d) (e)
*
*
FIGURE 4.8: Executing 1ParamConstruct: (a) Initial configuration. The solid curve is the upper envelope of score(A(l), λ) and score (A(r), λ); the dotted curve is Z(λ). (b–d) A series of evaluations and updates. An asterisk is shown next to the breakpoint being verified; the corresponding score function is shown as a dashed line. (e) The final result. Not shown is the verification of the three intermediate breakpoints of W .
at those points. The two-parameter algorithm is similar to 1ParamConstruct, the main difference being that wherever that procedure refers to a breakpoint, the new procedure deals with a vertex. As in 1ParamConstruct, any new vertices created during an update of W are initialized as unverified. To initialize the procedure, we evaluate Z at the four corners ofI and take the upper envelope of the resulting functions as the original value of W .
Essentially the same arguments used for 1ParamConstruct can be used to justify the correctness of the two-parameter algorithm. There are at most two evaluations of Z for each vertex of the maximization diagram and at most one evaluation for each edge and face. Since the total number of vertices and edges is linearly related to the number f of faces of the maximization diagram, the number of evaluations required is O(f ). The only significant complication in handling two parameters instead of one arises when updating W in the analogue of step (5d): In the two-parameter case, replacing W by the upper envelope of W and score(A(0), λ1, λ2) requires time proportional to the number of faces of the maximization diagram of W , not constant time (see [20]). Indeed, by geometric duality [34], the question is equivalent to updating the lower convex hull of a set of points after adding a new point [11]. We summarize the analysis below.
THEOREM 4.6 For two-parameter problems, the maximization diagram of Z restricted to a rectangular intervalI can be computed in time O(t · f + f2), where f is the number of
4-22 Handbook of Computational Molecular Biology faces of Z that lie within I and t is the time for an evaluation of Z.
For example, consider the global alignment problem with non-zero gap penalties. By Remark 4.1, 4.3, this is effectively a two-parameter problem in γ, the indel penalty, and δ, the gap extension penalty and the number of optimality regions is f = O(n3/2) (see 4.3.1).
Using the standard O(nm) dynamic programming algorithm for evaluating Z, Theorem 4.6 implies a construction time of O(n5/2m).
Going beyond two parameters requires essentially no new concepts. The maximization diagram of Z can again be built by successive evaluations at the vertices of the maximization diagram of a function W that represents the approximation to Z built so far. As a result, the algorithm produces a sequence of hyperplanes, each of which is the score function of an alignment that is optimum at some point in the region of interest. Each new hyperplane is used to incrementally update the current estimate of Z. The technique is reminiscent of the methods used to determine the shape of a convex polyhedron through a series of hyperplane probes [13, 14]. Indeed, these results can be used to prove the following.
THEOREM 4.7 Let d denote the number of parameters, let f and v be, respectively, the number of facets (d-dimensional faces) and vertices (0-dimensional faces) of the maximiza-tion diagram of Z within a hyperrectangle I of interest, and let t be the time needed for a single evaluation. Then, the maximization diagram of Z within I can be computed in O(t· (f + dv)) time, plus the time needed to construct the upper envelope of all the score functions generated during the computation.
The last part of the statement of the above theorem requires elaboration. As for one and two parameters, the problem of incrementally building the upper envelope of a set of d-variate linear functions is dual to constructing the lower convex hull of a set of points in Rd+1, a problem for which an extensive literature exists (see [49]). In particular, this body of research addresses many of the subtle implementation issues encountered in such computations, such as representation and numerical stability [5, 25].
The time needed to construct an upper envelope depends heavily on the complexity of the output produced, as measured by its total number of faces of dimensions 0 through d.
This number increases exponentially with the dimension. The Upper Bound Theorem [35]
states that the total complexity is Θ(N(d+1)/2 ), where N is the number of actual hull vertices. Duality therefore implies an upper bound of Θ(f(d+1)/2 ) for the complexity of the maximization diagram of Z, where f is the number of regions. This limits the number of parameters that can be handled in practice.