Weighted Consensus Segmentations

: The problem of segmenting linearly ordered data is frequently encountered in time-series analysis, computational biology, and natural language processing. Segmentations obtained indepen-dently from replicate data sets or from the same data with different methods or parameter settings pose the problem of computing an aggregate or consensus segmentation. This S EGMENTATION A GGREGATION problem amounts to ﬁnding a segmentation that minimizes the sum of distances to the input segmentations. It is again a segmentation problem and can be solved by dynamic programming. The aim of this contribution is (1) to gain a better mathematical understanding of the S EGMENTATION A GGREGATION problem and its solutions and (2) to demonstrate that consensus segmentations have useful applications. Extending previously known results we show that for a large class of distance functions only breakpoints present in at least one input segmentation appear in the consensus segmentation. Furthermore, we derive a bound on the size of consensus segments. As show-case applications, we investigate a yeast transcriptome and show that consensus segments provide a robust means of identifying transcriptomic units. This approach is particularly suited for dense transcriptomes with polycistronic transcripts, operons, or a lack of separation between transcripts. As a second application, we demonstrate that consensus segmentations can be used to robustly identify growth regimes from sets of replicate growth curves.


Introduction
One-dimensional segmentation problems naturally appear in time series analysis across diverse application areas (often referred to as change point or jump point detection in this context). In computational biology, 1D-segmentation problems arise in the analysis of micro-array and high-throughput DNA or RNA sequencing data. Copy number variations in genomes, for example, can be detected by segmenting array-CGH or DNA coverage data into piece-wise constant segments; see Reference [1] for a review. In epigenomics, recurrent patterns of histone modifications define genomic intervals that can be associated with functional units including promoters, enhancers, or gene bodies, see, e.g., Reference [2] and the references therein. The identification of transcriptional units is also a segmentation problem, consisting in the distinction of expressed and non-expressed loci [3,4] or operons [5] or, more generally, in the distinction of adjacent or even overlapping transcripts without the benefit of non-expressed spacers between them. The latter task is particularly relevant in organisms with "compact" genomes, such as bacteria [5] or yeast [6,7], where transcribed loci are rarely separated non-expressed regions. Boundaries between transcriptional units are detectable by differences in RNA levels [6], see, e.g., the SRG1 ncRNA in Figure 1. A plethora of segmentation algorithms for genomic features, as well as time series data, have become available, reviewed and benchmarked, e.g., in Reference [8][9][10].
The boundaries between segments typically are not clearly visible in individual data tracks. Such limitations can often be alleviated by aggregating multiple experiments or measurements. In the yeast RNA-seq data shown in Figure 1, for instance, transcriptome samples at different time points of the respiratory cycle are aggregated to produce a more informative signal than just the RNA expression level at a single time point. Still, any particular choice of parameters (here the choice of the similarity measure for the temporal coverage profiles at adjacent nucleotides), produce both false positive and false negative segment boundaries.  [11] for details on data and segmentations. Below: annotated coding and non-coding yeast genes. The rightmost block of short segments is a candidate for an unannotated ncRNA located anti-sense to the much longer protein-coding gene Utp7p on the minus strand. The data are the same as those in Figure 3 of Reference [11]. Figure 1 suggests that an improvement could be achieved by aggregating the different segmentations to a single consensus. In a similar vein, Reference [4] employed a simple heuristic segmentation to detect candidate loci as intervals that are scored by a statistical model for each RNA-seq experiment, followed by a problem-specific greedy heuristic to determine consensus interval boundaries for expressed ncRNA loci. The segmentation method for bacterial RNA-seq data in Reference [5] computes optimal segmentations with different numbers K of segments and uses a voting procedure to obtain a consensus over different values of K. These examples beg the question whether there is a more principled way to aggregated segmentations in a single consensus segmentation.
This question also appears in a much more general context. Modern *omics studies often report their results in the form of genome browser tracks, i.e., as segmentation of the reference genome into intervals. The comparison and consolidation of such data naturally asks for a consensus or reference. This is particularly the case for annotation based on epigenomic or transcriptomic data. Here, principled, efficient methods, to compare annotations beyond quantifying overlaps would be highly desirable to avoid a complete reanalysis of the underlying raw data. In contrast to genome browser tracks, raw data typically require extensive processing and are by no means straightforward to access in all cases. Despite the obvious potential usefulness of consensus segmentations, the literature on systematic comparisons of segmentations is surprisingly sparse. Two natural ways to approach the problem have been considered: (i) Focusing on the breakpoints between segments, one can treat them as signal. Significant (consensus) breakpoints are then detectable as unexpected accumulations across multiple data sets by the C-KS algorithm [12]. Somewhat more generally, this can be seen as clustering problem for breakpoints [13]. (ii) Segmentations of linearly ordered data form partitions of an interval. (Dis)similarity measures for partitions, such as the Rand [14], Fowlkes-Mallows [15], Jaccard [16], and Hubert-Arabie [17] indices, or the Mirkin [18], and Van Dongen [19] metrics, are also applicable to the special case of segmentations. The MEDIAN PARTITION problem, also known as Consensus Clustering Problem, consists in finding a partition that is as close as possible to a given collection w.r.t. to one of these (dis)similarity measures [20,21]. MEDIAN PARTITION is NP-complete [22,23]. It is this second approach that we pursue further in this contribution.
The SEGMENTATION AGGREGATION problem [24] is the specialization to partitions of a linearly ordered set, such as a time series or genomic sequence: Given a set of m segmentations S 1 , S 2 , . . . , S m on an interval, and a distance function D between segmentations, the task is to find a segmentation C that minimizes the distance sum We assume that D( . , . ) is a dissimilarity, i.e., that (i) D(S, S ) ≥ 0, and (ii) D(S, S ) = 0 if S = S . In most cases, D( . , . ) will be a metric. However, neither symmetry nor the triangle inequality are necessary. It is shown in Reference [24] that SEGMENTATION AGGREGATION, in contrast to MEDIAN PARTITION in the general case, can be solved exactly by dynamic programming for several interesting distance measures, including the disagreement or Mirkin metric and the information distance. Mailȃ [25] showed, using an axiomatic approach based on certain additivity conditions in the lattice of partitions, that the "variation of information" [26], i.e., the information distance [24] serves as the essentially unique natural distance between partitions. Nevertheless we consider here a much broader class of dissimilarity measures. Despite its appealing features, namely the almost complete absence of model assumptions and the fact that no detailed knowledge on the provenance of the input segmentations is required, SEGMENTATION AGGREGATION has rarely been used in practical data analysis. Here, we demonstrate that it can be a useful and efficient approach.
A given set of input data is frequently subject to biases, such as an uneven phylogenetic distribution of taxa in comparative genomics or unbalanced distributions of samples between treatment groups. For the purpose of consensus formation, it is usually desirable to retain all data. As a remedy for sampling biases, a plethora of weighting schemes have been proposed to correct for biases by giving larger weights to underrepresented and smaller weights to over-represented data; see Reference [27] for a comparison of different approaches. In the context of segmentations of genomic features or time series, the confi-dence in individual segmentations S q may be different, e.g., due to different noise levels in individual data tracks. It may also be desirable to treat biological replicates different from technical replicates. Naturally, such differences can be expressed by introducing segmentation-specific weights w q . We shall see below that such weights can be introduced in SEGMENTATION AGGREGATION in a straightforward manner.
In this contribution, we investigate the weighted version of the Segmentation Aggregation problem with the aim of getting insights into the properties of consensus segmentations. In particular, we generalize previous results of the positioning of consensus break points and we derive an upper bound on length of consensus segments for a large class of distance functions. We then consider two very different applications of consensus segmentations: the identification of transcriptional units, using yeast transcriptomes as a show-case example, and the segmentation of microbial growth curves. We close with a brief discussion of several open problems both regarding the theory behind consensus segmentations and their practical applications.

Dynamic Programming Algorithm
The WEIGHTED SEGMENTATION AGGREGATION problem is a moderate generalization of the unweighted version considered in Reference [24]. Given a set {S q |1 ≤ q ≤ m} of input segmentations and corresponding weights w q > 0 that quantify the relative importance of the contributing segmentations S q , the task is to minimize the objective function i.e., the weighted total dissimilarity of the unknown consensus segmentation C. Without loosing generality we may assume that ∑ m q=1 w q = 1. Following Reference [24], we consider a distance measure D that can be expressed in terms of the common refinement S ∧ S := {A ∩ B|A ∈ S , B ∈ S } of two segmentations. S ∧ S consists of all intersections of the segments of S and S . The common refinement is also known as the union segmentation since its set of segment boundaries is exactly the union of the boundaries of S and S . In particular, therefore, S ∧ S = S. Now, define the potential of a segmentation S as where e is a potential function evaluating the individual segments. This gives rise to a class of distances between segmentations defined by Substituting for D in Equation (2) yields where the middle term depends only on the input. It is, therefore, a constant that can be dropped for the purpose of optimization. Making use of the fact that the weights are normalized, we obtain the objective functioñ Now, we explicitly consider C as a sequence of intervals A. Using the additivity of the potential E, we obtaiñ The additive form of Equation (7) as a sum of the contributions ∆(A) for the consensus segments C makes it possible to minimizef (C) by dynamic programming [24]. To this end, consider the subset C |k of segmentations that have a segment boundary at k, i.e. , position k is the endpoint of a segment. For a given segmentation C ∈ C |k , denote byf (C|k) the sum of the contributions ∆(A) with max A ≤ k. Write F k := min C∈C |kf (C|k) for the minimal value off (C|k). Since k is a segment boundary, the last segment A before k is necessarily of the form [j + 1, k], where j < k denotes the segment boundary immediately preceding k. Using this notation, we can compute Thus, we obtain a simple dynamic programming recursion that has the same form for the weighted and unweighted consensus segmentation; also see [24]. The weights appear only in the scoring function ∆. We note, furthermore, that the recursion (8) is the same as for segmentation problems in general [28]. It appears, e.g., in Reference [29] for financial time series, in Reference [30] in context of text segmentation, in Reference [31] for the analysis of array CGH data, and in Reference [5,7,32] for the identification of transcripts in tiling array and RNA-seq data. It is discussed in the setting of very general similarity measures in Reference [11]. As we shall see below, the effort to compute F k is dominated by the effort to compute the score ∆[i, j].
Before we proceed, we briefly consider a general condition on the form of the potential function e( . ). Denote by D the discrete segmentation in which every interval is a single point and by J the indiscrete segmentation consisting of a single interval. A function e is subadditive if e(A) ≤ e(A 1 ) + e(A 2 ) for every A and every subdivision A 1∪ A 2 = A of A. This inequality is strict for at least one interval if and only if e([1, n]) < ∑ n i=1 e([i, i]). Comparing D and J, we observe that, in this case, D(D, J) = e([1, n]) − ∑ n i=1 [i, i] < 0, violating that D is a proper distance function. For the limiting case of an additive potential, e(A) = e(A 1 ) + e(A 2 ) for all intervals and their subdivisions, we obtain D(S, S ) = 0 for any two segmentations S and S . Thus, only potentials that satisfy e(A) > e(A 1 ) + e(A 2 ) for at least some One easily checks that D is a metric whenever e is superadditive. This condition is not necessary, however. For example, the negentropy defined in Equation (17) below, is not superadditive.

Efficient Computation of the Segment Scores ∆[i, j]
The direct evaluation of ∆([i, k]) according to its definition, Equation (8), for given i and k, requires O(n m) operations because this entails the summation over O(n) segments for each of the m input segmentations. This results in an impractical total effort of O(n 3 m) compared to the quadratic cost of the dynamic programming recursion itself. It is of considerable practical interest, therefore, to find a more efficient way of computing the scoring function. The key idea is to consider, for a given position i, two slightly different partial sums: and For a given boundary i in C, the first term sums all intervals in S q that do not extend beyond i, while the second sum also includes those that begin before or at i and extend beyond i. Thus, δ < (k) − δ ≤ (j) captures all segments of the S q that are contained within [j + 1, k] with one important exception: Segments, such as B in Figure 2, that contain [j + 1, k] contribute to δ ≤ (j) but not to δ < (k). Such overlapping segments will be taken care of in a correction term discussed below. Using the notation B ≤i := {b ∈ B|b ≤ i} and B ≥i := {b ∈ B|b ≥ i} we, furthermore, define terms where each sum contains at most a single term, namely the interval B ∈ S q that extends across i. Note that intervals that begin or end in position i do not contribute to δ ∩ > (i) or δ ∩ < (i), respectively. The correction terms correspond to the parts of segments that are non-trivially intersected by [j + 1, k], shown in magenta and cyan, resp., in Figure 2. Thus covers exactly all the intervals contributing to [j + 1, k]with the exception of segments B ∈ S q that begin at minB < j + 1 and end at max B > k as mentioned above. For such segments, instead of the contributions for B ≤k and B ≥j+1 , a single contribution for the interval [j + 1, k] ∩ B = [j + 1, k] has to be used. In addition, the contribution for B that is erroneously subtracted with δ ≤ (j), needs to be restored. Collecting these contributions, we obtain the following correction term for intervals that span across the interval [i , i ] of interest: For the interval [j + 1, k], the correction term δ * (j + 1, k − 1) defined in Equation (11) can be understood as follows: the first term accounts for the correct contribution of B ∩ [j + 1, k] = [j + 1, k], the second term compensates for the error introduced by δ ≤ (j), and the remaining two terms remove the superfluous contributions introduced by δ ∩ < (k) and δ ∩ > (j + 1). We summarize this derivation in the following form: Theorem 1. The potential-dependent segment scores defined in Equation (7) can be expressed as The only term that depends on both j + 1 and k is the correction of long input intervals δ * (j + 1, k). The restricted sum over the B ∈ S q in Equation (11) contains at most one segment for each input segmentation and, thus, can be evaluated in O(m) time for a given interval. Furthermore, the sum is certainly empty whenever [j + 1, k] is larger than the largest segment in any of the S q ; this can be used to speed up the evaluation from O(m) to O(1) if the segment lengths in the input are bounded by a constant, except for the short intervals.
The correction terms δ ∩ > (i ) and δ ∩ < (i ) comprise the cyan and magenta parts, respectively. The correction term δ * (i , i ), finally adds takes care of the interval B.

Lemma 1. The arrays of correction terms
Proof. The values of δ < (i) and δ ≤ (i) can be computed iteratively: we obtain δ < (i) by adding the contribution The sums in Equation (10) comprise at most one segment of S q for every q. All terms can be computed in constant time using auxiliary arrays that return, for each i and q, the values of min B and max B for i ∈ B and B ∈ S q . These auxiliary arrays in turn can obviously be constructed in O(nm) time for the breakpoint list of the input segmentations.
It, therefore, makes sense to precompute the arrays δ < , δ ≤ , δ ∩ < , and δ ∩ < (k). It is worth noting, finally, that there is nothing to be gained by storing the score values ∆[j + 1, k] since each entry is used only once in the recursion.

Boundaries of Consensus Segments
For a function g on Z, we define the local curvature at x as ∂ 2 This condition immediately implies that x is not a local maximum of g since at least one of g(x + 1) or g(x − 1) is larger than g(x). Correspondingly, g is (strictly) concave in x if ∂ 2 x g(x) < 0, whence x is not a local minimum.
For boundedly convex e, the curvature in non-increasing as the intervals become larger. In particular, suppose e([p, q]) depends only on the length z := q − p + 1 of the interval and is a smooth function, then e (z) > 0 and e (z) ≤ 0 for all z > 0 implies e is boundedly convex. Theorem 2. Let {S 1 , S 1 , . . . , S m } be a set of segmentations with union segmentationŜ and suppose e is boundedly convex. Then, the consensus C is refined by the union segmentationŜ.
Proof. Following Reference [24,33], we assume, for contradiction, that the optimal consensus C has a segment boundary that is not contained in the union segmentationŜ. We aim to show that moving to some close-by position x will reduce the cost f (C). We focus on a fixed input segmentation S q and denote byŜ q := S q ∧ C. Denote by p − 1 and q the first boundaries to the left and to the right of in C. Analogously,p andq are the first boundary to the left and to the right of inŜ q , respectively. Thus, C contains the two segments [p,ĵ] and [ + 1, q]. Since every segment ofŜ q ∧ C is a subset of a unique segment of C, we have We proceed by evaluating how D(S q , C) = E(S q ) + E(C) − 2E(S q ∧ C) varies when the boundary is perturbed. Let x be the perturbed boundary position. Since only E(C) and 2E(S q ∧ C) depends on x and all boundaries except are fixed, it suffices to focus on the intervals [p, q] and [p,q], respectively. Collecting all constant terms in D 0 , we obtain Since e is boundedly convex, we have 0 is concave at x for every S q and, thus, also for any non-negative contribution to the linear combination of input segmentations. Thus, f (C) as a function of the moving boundary x cannot have a minimum in the interior of the interval [p,q], contradicting the assumption that is a boundary in the optimal consensus C.
Theorem 2 establishes a very useful property: All segment boundaries of the consensus are contained in the union segmentation. This property was observed for disagreement distance and information distance (see below) in the unweighted setting [24,33]. Here, we show it holds for a broader class of distance functions and arbitrary weighting schemes. The techniques used in the proof of Theorem 2 do not seem to generalize to potentials with increasing curvature. Numerical data, however, indicate that the union segmentation refines the consensus for a much larger class of potential functions.
From an algorithmic point of view, it implies that it suffices to compute the F k for those values of k where segment boundaries are in the union segmentation of the inputŝ S. Correspondingly, we need to store the auxiliary variables only for the intervals of the union segmentation, instead of each i. That is, the recursion (8) reduced to where j i ∈ ∂Ŝ denotes the i-th segment boundary in the union segmentationŜ. Recursion (15) also speeds up the computation of the scoring function ∆, which now is also needed only for the segment boundaries. First, note that we still obtain δ < (i k ) from δ < (i k−1 ) by adding the contributions e(B) for the intervals ending at the boundary i k to δ < (i k−1 ) since by definition i k−1 and i k are consecutive breakpoints. Analogously, δ > (i k ) is obtained by adding e(B) for all blocks beginning at i k−1 to δ > (i k−1 ). The terms δ ∩ > (i k ) and δ ∩ < (i k ) remain the same. The correction term δ * could be stored for all pairs of the boundaries inŜ. Alternatively, it suffices to store the m boundaries at which the intervals crossing i k start and to keep track of the correct correction term directly in recursion (15). Equation (15), thus, can be evaluated in O(s 2 ), where s is the number of breakpoints in the union segmentation.

Length Bounds on Consensus Segments
It is reasonable to expect that a consensus segmentation cannot be a lot coarser than the individual input segmentations. To see that this is indeed the case, we start with a technical observation.

Lemma 2. Consider intervals
Proof. Equation (7) implicitly defined ∆(A) as the term in parentheses, which in turn is the w q -weighted sum of contributions for each S q .

Now, consider an alternative segmentation in which
The terms corresponding to the segments B = B that intersect A are the same as before since either In other words, if A satisfies the condition of Lemma 2, thenf (C) strictly decreases when A is subdivided into A and A . Thus, we conclude: Corollary 2. An interval A satisfying the conditions specified in Lemma 2 cannot appear in a consensus segmentation.
Our goal is now to show that sufficiently long intervals A always satisfy the conditions of Lemma 2 and, thus, can never be part of the consensus segmentation. Here, we need that e is superadditive, i.e., e(A) > e(A 1 ) + e(A 2 ) for all A = A 1∪ A 2 and A 1 , A 2 = ∅. This is the case particularly for the polynomial potentials. It fails for the negentropy potential, Equation (17), however, because this function is not monotonically increasing with the segment length |A|. Proof. If e is superadditive, the l.h.s. of Equation (16) is maximal if |A | = |A | (for even |A|) or |A | = |A | ± 1 for odd |A|, i.e., we assume that x is located in the middle of A. In order to ensure that segments containing x are completely contained in A we need |A| ≥ 2|B|. If this condition is satisfied, Equation (16) applies. We obtain a sufficient condition by replacing the r.h.s. with the maximal possible contribution of the subdivided interval B. By superadditivity, this term monotonically increases with the size of B. The assumption that x equally divides A fixed the l.h.s. of the inequality. Since e is strictly superadditive e(A) − 2e(A ) is strictly monotonically increasing with |A|, thus, there is a unique smallest value * of |A| unless e(A) − 2e(A ) ≤ 2 for all A, in which case no bound * exists.

Corollary 3.
The consensus segmentation C with superadditive potential e for m input segmentations with length bound L * as specified in Theorem 3 can be computed in O(nmL * ) time.
Proof. We observe that for each k, only values of j between k − 2 * and k − 1 appear in Equation (8) since longer segments by Theorem 3 cannot be part of an optimal consensus segmentation. The corollary now follows immediately from Corollary 1.
The length bound on consensus segments, thus, leads to a reduction of the computational efforts. Although * in Theorem 3 may be inconvenient to compute for some choices of the potential e, we shall see below that a simple, uniform bound can be obtained for an interesting class of potentials.

Special Potential Functions
Let us now consider plausible distance functions. The disagreement distance between segmentation was introduced in Reference [24] using the potential e(A) := (|A|/n) 2 /2. A natural generalization is e(A) = (|A|/n) 1+α /(1 + α) for 0 < α ≤ 1. We note that a linear potential e(|A|) = |A|/n, i.e., α = 0, yields a constant value off (C) because the sum of all segment lengths adds up to n; thus, E(S) = 1 is independent of the segmentation S.
Recall that the entropy of a discrete distribution is defined as H = − ∑ i p i ln p i . Given a segmentation S, we consider the probabilities p i of randomly picking a point from a segment, i.e., p i = |A i |/n is the relative length of a segment A i ∈ S, where n denotes the total length of the segmented genome or time series. The information distance is the symmetrized conditional entropy, which can also be computed as D(S , S ) = 2H(S ∧ S ) − H(S ) − H(S ) [24,34]. It corresponds to the potential function e(A) := (|A|/n) ln(|A|/n), given by the negative of the entropy (negentropy) contribution of the interval A. It has been shown in Reference [24,33] that the union segmentationŜ refines the unweighted consensus segmentation for both the disagreement distance and the information distance. This result generalizes to the weighted case and the α-disagreement distances with 0 < α ≤ 1.

Corollary 4.
The consensus segmentation C is refined by the union segmentationŜ for the disagreement distance, its α generalization with 0 < α ≤ 1, as well as the information distance.
Is does not seem possible to generalize the result to potentials that grow faster than quadratically.
Let us finally consider the consequence of Theorem 3. Reusing the convexity results above we can replace 2 min B ,B :B ∪B =B (e(B ) + e(B )) by 4e(B ) where |B | = |B|/2 . A short computation then shows that the inequality in Theorem 3 is satisfied for |A| > 1+α √ 2|B|. Since 1+α √ 2 ≤ 2, we have Corollary 5. The consensus segmentation C of a collection of segmentations S q with respect to the α-disagreement potentials contains no segment longer than twice the length of the longest input segment. This allows us immediately to limit the range of the indices in recursion (8) to j i > j k − 2 max |B|.

Generalization: Symmetrized Boundary Mover's Distance
Equation (7) highlights the fact that the cost functionf (C) measures, for each segment A ∈ C, how well A conforms to the input segmentations. As noted above, the additive structure of Equation (7) is sufficient to enable minimization by dynamic programming for arbitrary choices of ∆. If we retain the idea of weighted contributions for each input segmentation, we may write ∆(A) = ∑ q w q ∆(A|S q ), where ∆(A|S q ) measures how well the segment A "fits" into the segmentation S q . As a minimal requirement, for any given interval A, the score ∆(A|S q ) must attain its minimum value if the interval A is a segment in S q . Since two segmentations in general do not have segments or breakpoints in common, measures are required that are more fine-grained than the distinction between identical and distinct segments or breakpoints. ∆(A|S q ), thus, are similar to a measure of overlap, between A and the segments of S q that are covered by A. Clearly, the potential-based measures can be understood in this manner.
An interesting class of dissimilarities utilizes the distance between break points instead of the lengths of intersections between segments. For a segmentation S with segments S i , i = 1, . . . , n, we define s i = max S i and set s 0 = 0, i.e., the segments are S i = [s i−1 + 1, s i ] =: (s i−1 ..s i ). By slight abuse of notation, we write S = (s 0 , s 1 , . . . , s m ), i.e., we now specify a segmentation in terms of its breakpoints. Moreover, we write s ∈ S to mean that s represents a breakpoint in the segmentation S.
The "boundary movers distance" was introduced in Reference where d( . , . ) is some distance function between the positions s and c on [1, . . . , n]. The dissimilarity measure D B is not symmetric and satisfies D B (S|C) = 0 whenever C is a refinement of S. The segmentation aggregation problem that minimizes ∑ q w q D B (S q |C), therefore, is solved by the union segmentation C =Ŝ, while ∑ q w q D B (C|S q |) is minimized by the indiscrete segmentation {[1, n]}. As noted in Reference [24,33], these measures, thus, are only useful with additional constraints on the number or size of allowed segments. The symmetrized version of D B , however, has attractive properties for our purposes, as we shall see: Clearly, min c∈C d(s, c) = min{d(s, c ), d(s, c )}, where c and c delimit the segment of C within which s resides. If s = c or s = c , the contribution vanishes; hence, we can write This term individually penalizes a segment (c , c ) of C for containing boundary points of S in its interior. On the other hand, we can rewrite D B (C|S) in terms of segments of C by simply splitting the contribution of each boundary between the two adjacent segments: Here, we have used that the lower bounds of the first segments and the upper bounds of the last segments necessarily coincide (they are the boundary of the interval on which our segmentations live); therefore, they do not contribute to the distance. Again, the minima are only taken over two alternative breakpoints of S for each given value of c or c , namely those delimiting the segments of S harboring the breakpoints c and c of the consensus for each of the segments (c , c ) ∈ C and each segment of the input segmentations S q . Clearly, ∆((c ...c )) = ∑ q w q ∆ q ((c ...c )) depends only on the input segmentations S q and the boundary breakpoints c and c , i.e., an individual segment in the consensus C.
The segmentation aggregation problem with the symmetrized boundary movers distance, therefore, can again be solved by dynamic programming recursion Equation (8). A more in-depth analysis of this distance function is the subject of ongoing research.

Implementation
The consensus segmentation algorithm is available as an R package consseg, where the dynamic programing recursion is implemented in C++ via Rcpp (≥0.12.18) and Rcp-pXPtrUtils (≥0.1.1) to allow user-defined potential functions. A CRAN package accompanying this contribution will be made available. The development version is available at https://github.com/Bierinformatik/consseg (accessed on 1 December 2020).
The input segmentations are converted into an index returning for each position k the minimum position min B q and the maximum position max B q of the segment B q containing k. With their help, The terms δ ∩ < (k) and δ ∩ > (k) are evaluated as defined in Equation (10). These computations are interleaved with the evaluation of F k , Equation (8). Since the expensive part in the algorithm is the evaluation of the segment cost ∆[j + 1, k], we avoid their recomputation in the backtracking step by storing instead the values J[k] of the segment boundary j that realizes the minimum in Equation (8)  ]. The segment boundaries of the optimal segmentation are, therefore, obtained as j i+1 = J[j i ], starting from j 0 = n and continuing until j k = 0 is reached. It is worth noting that the fast, incremental Equation (12) is prone to rounding errors for large n and very fast-growing potentials e due to the computation of difference δ < (k) − δ ≤ (j) of two sums.

Consensus Segmentation of Yeast Transcriptome Data
To demonstrate the usefulness of consensus segmentations, we explored the yeast transcriptome time series mentioned in the introduction. We computed the consensus of segmentations obtained with widely different parameter choices [11]. We found that the consensus segmentation appears to produce a robust representation of the transcriptome and seems to fit better to the current annotation of the yeast genome than any particular choice of segmentation parameters. The example in Figure 3 also shows that distinct non-coding components, such as SRG1, are readily detectable. Short segments with very low coverage are likely gaps between transcriptome units without relevant RNA products. Consistently detectable elements, even if lowly expressed, on the other hand, may be of interest for closer inspection.  Figure 1 (here, the coverage time-series is shown as gray-values and the logarithms of the total coverage). Below, we show eight alternative segmentations computed with segmenTier [11] with different parameter settings. The consensus segments, computed for potential e(z) = z 2 /2, match very well with the expectations from visual inspection of the data and from the annotation of yeast the genome (bottom). SRG1 is a non-coding RNA that represses the adjacent SER3 gene by transcriptional interference [35].
In order to evaluate the usefulness of consensus segmentations in a more quantitative manner, we quantify the overlap of segments with annotated coding sequences. To this end, we determine for each CDS C the segment B(C) with the largest Jaccard index and then record the ratio r(C) of segment length and annotation length. In symbols: The cumulative distribution function cdf(r) computed over a large set of known transcripts C quantifies the congruence between segmentation and annotation. As a reference we use here the transcripts harboring coding sequences annotated in Reference [36]. A perfect overlap between a consensus segment and the annotated transcript is indicated by r = 1, r < 1 indicates a segment that is shorter and r > 1 a segment that is longer then the annotated transcript. Figure 4a shows the cumulative distribution function cdf(r) for the 5171 CDSs of S. cerevisae IFO 0233 for five segmentations with widely different parameters computed with segmenTier [11]. The red curve is the consensus over these segmentations. It shows that the consensus segmentation is a robust method: computed from a small sample of distinct segmentations, some of which do not perform particularly well, it performs at least as well as the best individual segmentation obtained from an extensive search of the parameter space in Reference [11]. Discrepancies between annotation and consensus are not only limitations on the segmentation approach but also derive from inaccuracies of the annotation, processing of transcripts, and the complexity of the yeast transcriptome, which harbors abundant overlapping and polycistronic transcripts [37]. The consensus performs as well as the best individual segmentation (according to the benchmark in Reference [11]). Figure 4b shows that the individual segmentations share between about 30% and 70% of the segments with the consensus (corresponding to the height of the vertical jump at r = 1), i.e., the consensus does not simply recapitulate any  Figure 1 (here, the coverage time-series is shown as gray-values and the logarithms of the total coverage). Below, we show eight alternative segmentations computed with segmenTier [11] with different parameter settings. The consensus segments, computed for potential e(z) = z 2 /2, match very well with the expectations from visual inspection of the data and from the annotation of yeast the genome (bottom). SRG1 is a non-coding RNA that represses the adjacent SER3 gene by transcriptional interference [35].
In order to evaluate the usefulness of consensus segmentations in a more quantitative manner, we quantify the overlap of segments with annotated coding sequences. To this end, we determine for each CDS C the segment B(C) with the largest Jaccard index and then record the ratio r(C) of segment length and annotation length. In symbols: The cumulative distribution function cdf(r) computed over a large set of known transcripts C quantifies the congruence between segmentation and annotation. As a reference we use here the transcripts harboring coding sequences annotated in Reference [36]. A perfect overlap between a consensus segment and the annotated transcript is indicated by r = 1, r < 1 indicates a segment that is shorter and r > 1 a segment that is longer then the annotated transcript. Figure 4a shows the cumulative distribution function cdf(r) for the 5171 CDSs of S. cerevisae IFO 0233 for five segmentations with widely different parameters computed with segmenTier [11]. The red curve is the consensus over these segmentations. It shows that the consensus segmentation is a robust method: computed from a small sample of distinct segmentations, some of which do not perform particularly well, it performs at least as well as the best individual segmentation obtained from an extensive search of the parameter space in Reference [11]. Discrepancies between annotation and consensus are not only limitations on the segmentation approach but also derive from inaccuracies of the annotation, processing of transcripts, and the complexity of the yeast transcriptome, which harbors abundant overlapping and polycistronic transcripts [37]. The consensus performs as well as the best individual segmentation (according to the benchmark in Reference [11]). Figure 4b shows that the individual segmentations share between about 30% and 70% of the segments with the consensus (corresponding to the height of the vertical jump at r = 1), i.e., the consensus does not simply recapitulate any individual input segmentation.
We, therefore, advocate to use the consensus segmentation as a robust and essentially parameter insensitive method for transcriptome analysis in compact genomes.  . Quantitative evaluation of the consensus of genome-wide transcriptome segmentations of RNA-seq data from S. cerevisae from ref. [11]. (a) Cumulative distribution function of the length ratios r between overlapping segments and previously annotated ORF transcripts [36]. A ratio of r = 1 indicates a good match. The consensus (black solid line) of five representative segmentations (colored dashed lines) by segmenTier with widely different parameter settings (as indicated in Figure 2d of Reference [11]) is at least on par with the best individual segmentation. (b) Overlap of the consensus with the five different input segmentations. The individual segmentations share between about 30% and 70% of their segments with the consensus (vertical jump at r = 1). The consensus was computed with e(z) = z 2 /2.
The consensus segmentation of the transcriptome of S. cerevisae IFO 0233 comprises 74,091 segments. After filtering for spacers using the input segmentations [11] and very short segments that most likely correspond to small overlaps and noise in the RNA-seq data, we retained 32,480 segments. Figure 5 shows the distribution of median coverage. Not surprisingly, segments overlapping known protein-coding sequences (CDS) show higher expression levels than other segments. Many segments overlap various types of long non-coding RNAs, such as CUTs and SUTs [38,39]. We also observe many segments with substantial expression levels that so far have remained unannotated, providing a large pool of candidates for novel ncRNAs. Transcriptome segmentation is only the first step towards an accurate and reliable genome annotation. The subsequent processing of the segmentation data, however, is beyond the scope of this present contribution and will be addressed in forthcoming work.

Consensus Segmentations of Growth Curves
The usefulness of consensus segmentations is by no means limited to transcriptome data or segmentations of genomes. We, therefore, include here also a very different application. The growth of a population of bacteria over time can be quantified by measuring the apparent absorption, usually referred to as OD (optical density), in a spectrophotometer. Growth curves typically show distinct growth regimes: an initial time lag that precedes a phase of exponential growth, which is followed by a deceleration phase that finally settles into saturation, see, e.g., Reference [40]. These can be separated by approximating the time course of log OD by a sequence of line segments, i.e., as a continuous, piece-wise linear function. The corresponding approximation problem is again a segmentation problem that can be solved by dynamic programming [28]. Empirically, one observes that resulting segmentations are quite sensitive to small difference in the growth curves. We show here that the consensus segmentation is a convenient way to extract a robust estimate for the duration of the different phases. Figure 5. Distribution of RNA expression across the consensus segmentation of S. cerevisae IFO 0233. We distinguish segments that overlap a coding sequence (CDS) or another annotation item (Annotation) present in the current genome annotation taken from SGD (Saccharomyces Genome Database), and unannotated segments (All). An overlap of at least 30% with an annotation item was required. Densities are normalized to 1 for each class. Cumulative distributions are superimposed.
In Figure 6, we compare the growth curves of four Escherichia coli cultures grown in minimal glucose medium at 37 • C. The R package dpseg [41] was used to segment the individual growth curves. This package also uses a dynamic programming approach. Instead of fixing the number of segments as in Reference [28], it uses a penalty parameter to adjust the resolution of the segmentation. Considering the consensus of the individual segmentations and the variation of the breakpoints across the replicates provides a more realistic view of that data compared to the segmentation of an averaged growth curve.

Refinement Conjecture
Theorem 2 states that the union segmentationŜ refines the consensus segmentation C for the class of boundedly convex consensus functions. Numerical simulations strongly suggest that this is true also for many potentials with increasing positive curvature, despite the failure of the proof technique for the general case. We simulated 10 segmentations of length 50 and a maximum of 10 segments, using the base-R sample function to randomly choose breakpoints in a given range. Figure 7 shows consensus segmentations for six potential functions from negentropy to exponential.
We found that the consensus segmentation only contained breakpoints that are present in at least one of the input segmentation. This suggests: Conjecture 1.Ŝ appears to refine C for all superadditive potentials and possibly even for all convex potentials.
This "Refinement Conjecture" is of considerable practical use. If true, (assumed as a heuristic), it reduces the computational effort to O(s 2 ) where s is the number of break points in the input segmentations. We further observed a trend for faster-growing potentials to yield more and, thus, shorter consensus segments. This is consistent with the fact that the bound 1+α √ 2|B| on the length of the consensus intervals in the argument leading up Corollary 5 decreases with the exponent α in polynomial potentials.

Concluding Remarks
In this work, we have extended and generalized previous work [24,33] on the segmentation aggregation problem. We showed that for the class of boundedly convex potential functions, including negentropies and powers z 1+α with 0 < α ≤ 1, all consensus breakpoints are breakpoints in at least one of the contributing segmentations. Furthermore, we showed that for all superadditive potentials, consensus segments cannot be longer than twice the longest input segment. This bound allows a further reduction of the computational effort.
Consensus segmentations as described here pertain to two major application scenarios: (i) Reconciliation of segmentations of multi-dimensional data, comprising, e.g., independent measurements, such as biological or technical replicates, or measurements of different quantities, e.g., different histone modifications. (ii) Reconciliation of segmentations of the same data set produced with different similarity measures. In principle, it is also possible to compute the consensus segmentation of different segmentations produced, e.g., with randomized algorithms or different heuristics using the same similarity measures. A major advantage of consensus segmentations is that they can be computed without specific information about the data underlying the input segmentations. Such knowledge is not needed because the segmentation aggregation problem depends only on the distance function D as a "parameter". Empirically, we found that variations of the distance functions have only very moderate consequence on the consensus segmentation.
In simulations, we found strong support for the Refinement Conjecture. This provides support for approaches that utilize a dynamic programming segmentation method to select be best segmentation from the union of segmentations that are computed with different heuristics. Such a scheme has been proposed in Reference [42]. In this manner, one can potentially achieve a substantial gain in computational efficiency compared to the full dynamic programming segmentation. The C-KS approach [12] also restricts itself to the union segmentation.
We considered two very different application scenarios. In applications to transcriptome data consensus segmentations have the potential to substantially improve annotations. A particular strength of the consensus approach is, by highlighting differences that are consistent between data tracks, the ability to identify processing-related boundaries. This is of particular interest in organisms with operons, poly-cistronic primary transcripts, or no expression-free gaps between genes. In all these cases, it becomes difficult and often impossible to distinguish transcriptional units from patterns of mapped RNA-seq reads alone. Here, we have used data from yeast strain IFO 0233, which has been used previously to illustrate transcriptome segmentation in Reference [11]. We have seen that the consensus segmentation provides a robust prediction of transcriptomic units from a moderate number of individual segmentations with very different parameters. We obtained thousands of segments that may correspond to the non-coding transcripts in S. cerevisae IFO 0233. Since the present contribution is intended to describe the method of consensus segmentation and its mathematical justification, we will report elsewhere on a comprehensive analysis of the IFO 0233 transcriptome.
Consensus formation is also of use to aggregate data from biological replicates. As an example, we showed that consensus segmentations of growth curves can be used to robustly determine distinct growth phases.
The consensus segmentation methods incorporate weights that refer to input segmentations. This feature can be used, for instance, to weight individual transcriptome data by coverage. In the case of growth functions, weights may be chosen to decrease with average measurement error, quantified, e.g., as average deviation from the linear fit. It would also be of interest to associate weights with individual segments. This can certainly be done in the context of the Boundary Mover's distance. Whether this can be also be achieved in the potential-based approach, and to what extent the mathematics results of this contribution will remain intact, however, is a question for future research.
We observed that consensus segmentations are quite robust w.r.t. to the choice of the potential on real data, while we observed a trend towards shorter consensus segments with increasing α for the power potentials e(z) = z α−1 on i.i.d. random data. Conceptually, consensus segmentations based on the comparison of segments are designed to handle essentially arbitrary heterogeneity along the time or genome coordinate, while breakpointcentered approaches, such as C-KS, need to rely on statistical regularities of true breakpoints. In order to assess the utility of different potentials e( . ) and dissimilarity measures D( . , . ), and to compare the segment-centered dynamic programming approach with breakpointcentered alternatives, a principled way of benchmarking consensus segmentation methods will be necessary. This will require, in particular, the development of a simulator for correlated segmentations that mimic characteristics of different types of underlying data. At present, such tools are not available.
Our analysis of consensus segmentations suggests several avenues for future research. From a theoretical point of view, the most immediate open problem is the Refinement Conjecture, and the characterization of the potential function and-more generally-the dissimilarity measures for which the union segmentation refines the consensus segmentation. This is also of practical relevance since the recursions can be restricted to breakpoints of the union segmentation in such cases; see Equation (15). In addition, a more detailed understanding of the consensus segmentation would be useful. For instance, are there potentials or dissimilarities that guarantee a breakpoint in the consensus within every interval that contains a breakpoint in every input segmentation, or in the (weighted) majority of the input segmentations? Such results could immediately be used to limit the scope of j in Equation (8). More generally, one may ask whether the idea of consensus segmentation can give rise to useful ways of measuring the local accuracy or reliability of consensus and/or input break points.
Author Contributions: All authors jointly contributed the conceptualization of the study, the theoretical results, the interpretation of the results, and the writing of the manuscript. All authors have read and agreed to the published version of the manuscript.

Data Availability Statement:
The RNA-seq data for the example in Figures 1 and 3 (SRG1 ncRNA and SER3 protein coding gene) is available via the segmenTier R package (object tsd can be loaded with data(primseg436)) and the bacterial growth curves in Figure 6 via the dpseg package (oddata is available after loading the package). The genome-wide RNA-seq data will be made available at a public repository with a full report on the data (in progress, work by RM, PFS and DBM). The segmentations of the yeast IFO 0233 transcriptomes are available as Supplemental File in csv format.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the scientific content of this work. Interval of from to i to j (inclusive) C Consensus segmentation (of a set of segmentations) S q (Input) segmentation w q

CDS
Weight of an input segmentation S Union segmentation (of a set of segmentations) D( . , . ) Distance (dissimilarity) between segmentations D B ( . | . ) Boundary movers distance F k Score of a partial segmentation on [1, k] e( . ) Potential of an interval Score on a consensus interval δ < (i) Score contribution of segments ending no later than i δ ≤ (i) Score contribution of segments beginning no later than i δ ∩ < (i) Score contribution of r.h.s. part a segment spanning i δ ∩ > (i) Score contribution of l.h.s. part a segment spanning i δ * (i, j) score correction for segments beginning before i and ending after j