- Proceedings
- Open access
- Published:
Assembling contigs in draft genomes using reversals and block-interchanges
BMC Bioinformatics volume 14, Article number: S9 (2013)
Abstract
The techniques of next generation sequencing allow an increasing number of draft genomes to be produced rapidly in a decreasing cost. However, these draft genomes usually are just partially sequenced as collections of unassembled contigs, which cannot be used directly by currently existing algorithms for studying their genome rearrangements and phylogeny reconstruction. In this work, we study the one-sided block (or contig) ordering problem with weighted reversal and block-interchange distance. Given a partially assembled genome π and a completely assembled genome σ, the problem is to find an optimal ordering to assemble (i.e., order and orient) the contigs of π such that the rearrangement distance measured by reversals and block-interchanges (also called generalized transpositions) with the weight ratio 1:2 between the assembled contigs of π and σ is minimized. In addition to genome rearrangements and phylogeny reconstruction, the one-sided block ordering problem particularly has a useful application in genome resequencing, because its algorithms can be used to assemble the contigs of a draft genome π based on a reference genome σ. By using permutation groups, we design an efficient algorithm to solve this one-sided block ordering problem in time, where n is the number of genes or markers and δ is the number of used reversals and block-interchanges. We also show that the assembly of the partially assembled genome can be done in time and its weighted rearrangement distance from the completely assembled genome can be calculated in advance in time. Finally, we have implemented our algorithm into a program and used some simulated datasets to compare its accuracy performance to a currently existing similar tool, called SIS that was implemented by a heuristic algorithm that considers only reversals, on assembling the contigs in draft genomes based on their reference genomes. Our experimental results have shown that the accuracy performance of our program is better than that of SIS, when the number of reversals and transpositions involved in the rearrangement events between the complete genomes of π and σ is increased. In particular, if there are more transpositions involved in the rearrangement events, then the gap of accuracy performance between our program and SIS is increasing.
Background
The techniques of next generation sequencing have greatly advanced in the past decade [1–3], which allows an increasing number of draft genomes to be produced rapidly in a decreasing cost. Usually, these draft genomes are partially sequenced, leading to their published genomes as collections of unassembled contigs (short for contiguous fragments). These draft genomes in contig form, however, can not be used immediately in some bioinformatics applications, such as the study of genome rearrangements, which requires the completely assembled genomes to calculate their rearrangement distances [4]. To adequately address this issue, Gaul and Blanchette [5] introduced and studied the so-called block ordering problem defined as follows. Given two partially assembled genomes, with each representing as an unordered set of blocks, the block ordering problem is to assemble (i.e., order and orient) the blocks of the two genomes such that the distance of genome rearrangements between the two assembled genomes is minimized. The blocks mentioned above are the contigs, each of which can be represented by an ordered list of genes or markers. In their work [5], Gaul and Blanchette proposed a linear-time algorithm to solve the block ordering problem if the problem is further simplified to maximize the number of cycles in the breakpoint graph corresponding to the assembled genomes. The rationale behind this modification is totally based on a result obtained by Bourque and Pevzner [6], showing that the reversal distance between two assembled genomes can be approximated well by maximizing the number of cycles in their corresponding breakpoint graph. Actually, in addition to the number of cycles, the number of hurdles, as well as the presence of a fortress or not, is also important and needed for determining the actual reversal distance [7]. Therefore, it is still a challenge to efficiently solve the block ordering problem by optimizing the true rearrangement distance.
In the literature, many different kinds of genome rearrangements have been extensively studied [4], such as reversal (also called inversion), transposition and block-interchange (also called generalized transposition), translocation, fusion and fission. Reversal affects a segment on a chromosome by reversing this segment as well as exchanging its strands. Transposition rearranges a chromosome by interchanging its two adjacent and nonoverlapping segments. Block-interchange is a generalized transposition that exchanges two nonoverlapping but not necessarily adjacent segments on a chromosome. Translocation acts on two chromosomes by exchanging their the end fragments. Fusion is a special translocation that joins two chromosomes into one and fission is also a special translocation that splits a chromosome into two. In this study, we consider a variant of the block ordering problem, in which one of the two input genomes is still partially assembled but the other is completely assembled, with optimizing the genome rearrangement distance measured by weighted reversals and block-interchanges, whose weights are 1 and 2, respectively. For distinguishing this special block ordering problem from the original one, we call it as one-sided block (or contig) ordering problem. In fact, an efficient algorithm to solve the one-sided block ordering problem has a useful application in genome resequencing [8, 9], because the reference genome for resequencing organisms can serve as the completely assembled genome in the one-sided block ordering problem and the contigs of partially assembled resequencing genome can then be assembled together into one or several scaffolds based on the reference genome. From this respect, the one-sided block ordering problem can be considered as a kind of contig scaffolding (or assembly) problem that aims to use genome rearrangements to create contig scaffolds for a draft genome based on a reference genome.
Currently, several contig scaffolding tools based on the reference genomes have been developed, such as Projector 2 [10], OSLay [11], ABACAS [12], Mauve Aligner [13], fillScaffolds [14], r2cat [15] and SIS [16]. Among these contig scaffolding tools, both SIS and fillScaffolds use the concept of genome rearrangements to generate contig scaffolds for a draft genome. SIS deals with only reversals, while in addition to reversals, fillScaffolds considers other rearrangements, such as transpositions and translocations (including fissions and fusions). Basically, SIS was dedicated to creating the contig scaffolds for prokaryotic draft genomes by heuristically searching for their inversion signatures, where an inversion signature is a pair of adjacent genes or markers appearing along a contig such that they form a breakpoint and are also located in different transcriptional strands. As for fillScaffolds, it used the traditional technique of breakpoint graphs to assemble the contigs of draft genomes. In the study by Dias and colleagues [16], they have used real prokaryotic draft genomes to demonstrate that SIS had the best overall accuracy performance when compared to the other tools we mentioned above.
In this study, we utilize permutation groups in algebra, instead of the breakpoint graphs used by Gaul and Blanchette [5], to design an efficient algorithm, whose time complexity is , for solving the one-sided block ordering problem with weighted reversal and block-interchange distance, where n is the number of genes or markers and δ is the number of reversals and block-interchanges used to transform the assembly of the partially assembled genome (i.e., draft genome) into the completely assembled genome (i.e., reference genome). In particular, we also show that the assembly of the partially assembled genome can be done in time and its weighted reversal and block-interchange distance from the completely assembled genome can be calculated in advance in time. In addition, we have implemented our algorithm into a program and used some simulated datasets to compare its accuracy performance to SIS on assembling the contigs in the draft genomes based on their reference genomes. Our experimental results have shown that the averaged normalized contig mis-join errors of our program are lower than those of SIS, when the number of reversals and transpositions involved in the rearrangement events between the complete genomes of the partially and completely assembled organisms is increased. In particular, if there are more transpositions involved in the rearrangement events, then the gap of accuracy performance between our program and SIS is increasing.
Preliminaries
One-sided block ordering problem
In the following, we dedicate ourselves to linear, uni-chromosomal genomes. With a slight modification, however, our algorithmic result can still apply to circular, uni-chromosomal genomes, or to multi-chromosomal genomes with linear or circular chromosomes in a chromosome-by-chromosome manner. Once completely assembled, a uni-chromosomal genome can be represented by a signed permutation of n integers between 1 and n, with each integer representing a gene or marker and its associated sign indicating the strandedness of the corresponding gene or marker. If the genome is partially assembled, then it will be represented by an unordered set of blocks, where a block B of size k, denoted by B = [b1, b2, ..., b k ], is an ordered list of k signed integers. Let denote the reverse of B. Given an unordered set of m blocks, say , corresponding to a partially assembled genome, an ordering (or assembly) of is an ordered list of m blocks in which each block B i or its reverse appears exactly once, where 1 ≤ i ≤ m. For instance, suppose that . Then (B1, B3, B2) = ([1, 4], [-5, 6], [3, 2]) and (B1, -B3, B2) = ([1, 4], [-6, 5], [3, 2]) are two orderings of . Basically, each ordering of induces (or defines) a signed permutation of size n, which is obtained by concatenating the blocks in this ordered list. For instance, the ordering (B1, B3, B2) in the above exemplified induces the signed permutation (1, 4, -5, 6, 3, 2), which simply is denoted by B1 ⊙ B3 ⊙ B2. Clearly, the permutation induced by an ordering of corresponds to an assembly of the blocks in . Now, the one-sided block ordering problem we study in this paper is formally defined as follows:
One-sided block ordering problem with reversal and block-interchange distance
Input: A partially assembled genome π and a completely assembled genome σ.
Output: Find an ordering of π such that the rearrangement distance measured by reversals and block-interchanges with the weight ratio 1:2 between the permutation induced by the ordering of π and σ is minimized.
As discussed in our previous study [17], it is biologically meaningful to assign twice the weight to block-interchanges than to reversals, due to the observation from the biological data that transpositions occur with about half the frequency of reversals [18].
Permutation groups
Permutation groups have been proven to be a very useful tool in the studies of genome rearrangements [17]. Below, we recall some useful definitions, notations and properties borrowed form our previous work [17]. Basically, given a set E = {1, 2, ..., n}, a permutation is defined to be a one-to-one function from E into itself and usually expressed as a product of cycles in the study of genome rearrangements. For instance, π = (1)(3, 2) is a product of two cycles to represent a permutation of E = {1, 2, 3} and means that π(1) = 1, π(2) = 3 and π(3) = 2. The elements in a cycle can be arranged in any cyclic order and hence the cycle (3, 2) in the permutation π exemplified above can be rewritten as (2, 3). Moreover, if the cycles in a permutation are all disjoint (i.e., no common element in any two cycles), then the product of these cycles is called the cycle decomposition of the permutation. In fact, a permutation in the cycle decomposition can be used to model a genome containing several circular chromosomes, with each disjoint cycle representing a circular chromosome. Notice that in the rest of this article, we say "cycle in a permutation" to mean "cycle in the cycle decomposition of this permutation" for simplicity, unless otherwise specified. A cycle with k elements is further called a k-cycle. In convention, the 1-cycles in a permutation are not written explicitly since their elements are fixed in the permutation. For instance, the above exemplified permutation π can be written as π = (2, 3). If the cycles in a permutation are all 1-cycles, then this permutation is called an identify permutation and denoted by 1. Suppose that α and β are two permutations of E. Then their product αβ, also called their composition, defines a permutation of E satisfying αβ(x) = α(β(x)) for all . If both α and β are disjoint, then αβ = βα. If αβ = 1, then α is called the inverse of β, denoted by β-1, and vice versa. Moreover, the conjugation of β by α, denoted by α · β, is defined to be the permutation . It can be verified that if y = β(x), then α(y) = αβ(x) = αβα-1α(x) = α · β(α(x)). Hence, α · β can be obtained from β by just changing its element x with α(x). In other words, if β = (b1, b2, ..., b k ), then α · β = (α(b1), α(b2), ..., α(b k )).
It is a fact that every permutation can be expressed into a product of 2-cycles, in which 1-cycles are still written implicitly. Given a permutation α of E, its norm, denoted by ||α||, is defined to be the minimum number, say k, such that α can be expressed as a product of k 2-cycles. In the cycle decomposition of α, let n c (α) denote the number of its disjoint cycles, notably including the 1-cycles not written explicitly. Given two permutations α and β of E, α is said to divide β, denoted by α|β, if and only if ||βα-1|| = ||β|| - ||α||. In our previous work [17], it has been shown that ||α|| = |E| - n c (α) and for any k elements in E, say a1, a2, ..., a k , they all appear in a cycle of α in the ordering of a1, a2, ..., a k if and only if (a1, a2, ..., a k ) | α.
Let α = (a1, a2) be a 2-cycle and β be an arbitrary permutation of E. If α|β, that is, both a1 and a2 appear in the same cycle of β, then the composition αβ, as well as βα, has the effect of fission by breaking this cycle into two smaller cycles. For instance, let α = (1, 3) and β = (1, 2, 3, 4). Then α|β, since both 1 and 3 are in the cycle (1, 2, 3, 4), and αβ = (1, 2)(3, 4) and βα = (4, 1)(2, 3). On the other hand, if , that is, a1 and a2 appear in different cycles of β, then αβ, as well as βα, has the effect of fusion by joining the two cycles into a bigger cycle. For example, if α = (1, 3) and β = (1, 2)(3, 4), then and, as a result, αβ = (1, 2, 3, 4) and βα = (2, 1, 4, 3).
A model for representing DNA molecules
As mentioned before, a permutation in the form of the cycle decomposition can be used to model a genome containing multiple chromosomes (or a chromosome with multiple contigs), with each cycle representing a chromosome (or contig). To facilitate modelling the rearrangement of reversals using the permutation groups, however, we need to use two cycles to represent a chromosome, with one cycle representing a strand of the chromosome and the other representing the complementary strand. For this purpose, we first let E = {-1, 1, -2, 2, ..., -n, -n} and Γ = (1, -1)(2, -2) ... (n, -n). We then use an admissible cycle, which is a cycle containing no i and its opposite -i simultaneously for some , to represent a chromosomal strand, say π+, and use π- = Γ · (π+)-1, which is the reverse complement of π+, to represent the opposite strand of π+. As demonstrated in our previous work [17], it is useful to represent a double stranded chromosome π by the product of its two strands π+ and π-, that is, , because a reversal (respectively, block-interchange) acting on this DNA molecule can be mimicked by multiplying two (respectively, four) 2-cycles with π, as described in the following lemmas.
Lemma 1 ([17]) Let π = π+π- denote a double stranded DNA and let x and y be two elements in E. If , that is, x and y are in the different strands of π, then the effect of (π Γ(y), π Γ(x))(x, y)π is a reversal acting on π.
Lemma 2 ([17]) Let π = π+π- denote a double stranded DNA and let u, v, x and y be four elements in E. If (x, u, y, v)|π, that is, x, u, y and v appear in the same strand of π in this order, then the effect of (π Γ(v), π Γ(u)) (π Γ(y), π Γ(x)) (u, v)(x, y)π is a block-interchange acting on π.
Moreover, as described in the following lemma, we have shown in [17] that given two different DNA molecules π and σ, every cycle α in (the cycle decomposition of) σπ-1 always has a mate cycle (π Γ) · α-1 that also appears in σπ-1. In fact, α and (π Γ) · α-1 in σπ-1 are each other's mate cycle.
Lemma 3 ([17]) Let π and σ be two different double-stranded DNA molecules. If α is a cycle in σπ-1, then (π Γ) · α-1 is also a cycle in σπ-1.
An efficient algorithm for the one-sided block ordering problem
To clarify our algorithm, we start with defining some notations. Let α denote an arbitrary linear DNA molecule (or contig). As mentioned previously, it is represented by the product of its two strands α+ and α-, that is, α = α+α-. If α contains k genes (or markers), we also denote its α+ by (α+[1], α+[2], ..., α+[k]), where α+[i] is the i-th gene in α, and its α- by (α- [1], α-[2], ..., α-[k]). By convention, α+[1] and α-[1] are called as tails of α. Let π = π1π2 ... π m be a linear, uni-chromosomal genome that is partially assembled into m contigs π1, π2, ..., π m , each with n i genes, and σ = (1, 2, ..., n) be a linear, uni-chromosomal genome that is assembled completely. Let C = {c k = n + k + 1: 0 ≤ k ≤ 2m - 1} ∪ {-c k = -n - k - 1: 0 ≤ k ≤ 2m - 1} be a set of 4m distinct integers, called caps, which are different from those genes in E. Let and . For the purpose of designing our algorithm later, we add four caps and -c2(i- 1)+1to the ends of each contig π i , where 1 ≤ i ≤ m, leading to a capping contig with , for for 2 ≤ j ≤ n i + 1, and . Moreover, we insert m-1 dummy contigs without any genes (i.e., null contigs) σ2, σ3, ..., σ m into σ, where the original contig in σ becomes σ1 now, and add four caps c2(i- 1), c2(i- 1)+1, -c2(i- 1)and -c2(i- 1)+1to the ends of each contig σ i to obtain a capping contig , where for for 2 ≤ j ≤ n i + 1, and . Notice that the purpose of adding caps to the ends of the contigs is to serve as delimiters when we use permutation groups to model translocations of multiple contigs later. We denote the capping π and σ by and , respectively. To distinguish the four caps in a capping contig, say , we call the left caps and as 5' caps and the right caps and as 3' caps.
Given an integer x in that is contained in a contig α = α+α- with k genes (or markers), we define a function char(x, ) below to represent the character of x in the capping contig that is obtained by adding four caps from C to the ends of α.
In addition, we define 5cap to be the 5' cap in the strand of that contains x. For convenience, we extend the definitions above from the capping contig to the capping genome. For instance, given a capping genome, say , char denotes the character of x in a capping contig of that contains x, and 5cap denotes the 5' cap of the strand in containing x, that is, and 5cap = 5cap. In our previous work [17], we have shown the following lemma.
Lemma 4 ([17]) For a capping genome and , if char (respectively, T), then is T (respectively, C3) and if (respectively, N3 and C5), then is O (respectively, N3 and C5).
Basically, we design our algorithm to solve the one-sided block ordering problem by dealing with the contigs of the capping genome as if they were linear chromosomes. Let and be two 2-cycles with character pairs of (non-C5, non-C5) and (C5, C5), respectively, and let and . Notice that the character pair of is (C5, C5) by Lemma 4. In our previous study [17], we have proven that performing a translocation on can be mimicked by the composition of , if and (i.e., x and u, as well as y and v, lie in the same contig stand in , but x and y appear in the different contigs in ). Moreover, if the character pair of is in , then acts on by exchanging the two caps of some contig in with the two caps of another contig and, as a result, leaves the original genome unaffected. Notice that the character pair of also belongs to CEpair and that of is (C5, C5) according to Lemma 4. Furthermore, if is a 2-cycle of character pair (T, C3) (respectively, (O, N3)), then performing τ on becomes a fusion (respectively, fission) to act on π. Hence, we have the following lemma, where it can be verified that and and .
Lemma 5 ([17]) Let c1 = (x, y) denote a 2-cycle with charand char, and let , and , . If and , then the effect of is a fusion that acts on π by concatenating the contig containing y with the contig containing x.
It is not hard to see that the permutation induced by an ordering of the uncapped genome π can be considered as the result of applying consecutive m - 1 fusions to the m contigs in π. Based on the above discussion, it can be realized that our purpose is to find m - 1 translocations to act on such that their rearrangement effects on the original π are m - 1 fusions and the genome rearrangement distance measured by weighted reversals and block-interchanges between the resulting assembly of the contigs in π and σ is minimum. In Algorithm 1 below, we describe our algorithm for efficiently solving the one-sided block ordering problem, where reversals are weighted one and block-interchanges are weighted two. Basically, we try to derive m - 1 fusions from to act on π in Algorithm 1.
Algorithm 1
Input: A partially assembled, linear, uni-chromosomal genome π = π1π2 ... π m and a completely assembled, linear, uni-chromosomal genome σ = σ1.
Output: An optimally assembled genome of π, denoted by assembly(π), and the weighted reversal and block-interchange distance Δ(π, σ) between assembly(π) and σ.
1: Add m - 1 null contigs into σ such that .
Obtain and by capping π and σ.
2: Compute and .
3: /* To perform cap exchanges */
Let i = 0.
while there are x and y in a cycle of such that ∈ CEpair do
Let i = i + 1.
Find x and y in a cycle of with ∈ CEpair.
Let , , , .
Calculate new , new and new .
end while
4: /* To find consecutive m - 1 fusions */
Let i = 0.
while there are two adjacent elements x and y in a cycle of such that and do
Let i = i + 1.
Find two adjacent elements x and y in a cycle of such that and .
Let , , , .
Calculate new , new and new .
end while
while i < m - 1 do
Let i = i + 1.
Find two adjacent elements x and y in a cycle of such that and .
Find the strand of a different contig in with at least a non-cap integer and its 3' cap, say z, different from y.
Let , , .
Calculate new , new and new .
end while
Let assembly(π) denote the assembled contig in current whose caps are removed.
5: /* To find reversals */
Let .
while there are two adjacent elements x and y in a cycle of such that do
Let .
Find two adjacent elements x and y in a cycle of such that .
Let , .
Calculate new , new and new .
end while
6: /* To find block-interchanges */
Let .
while do
Let .
Choose any two adjacent elements x and y in a cycle of .
Find two adjacent integers u and v in a cycle of such that .
Let , , .
Calculate new , new and new .
end while
7: Output assembly(π) and .
Below, we consider an example to clarify Algorithm 1. Let π = {[1, 4], [-5, 6], [3, 2]} and σ = {[1, 2, ..., 6]} be the input linear, uni-chromosomal genomes of Algorithm 1. In our algorithm, these two genomes will be further represented by π = (1, 4)(-4, -1)(-5, 6)(-6, 5)(3, 2)(-2, -3) and σ = (1, 2, ..., 6)(-6, - 5, ..., -1). First of all, we add two null contigs into σ and cap all the contigs in π and σ in a way such that and . Next, we compute . It can be found that 10 and 8 are in a cycle of current with . We perform a cap exchange on by multiplying , , , with , resulting in new . In addition, we have new . It can be observed that -5 and 10 are in the same cycle of with satisfying that , and (since -5 and 10 are in different contigs in current ). Therefore, we perform a fusion on , by multiplying , , , with , to obtain new . Moreover, we have new , in which 3 and 12 form a (T, C3) pair but they belong to the same contig strand in , that is, . In this case, has a contig strand (7, 1, 4, -5, 6, 8) whose 3' cap is 8 that is different from 12. Hence, we multiply , , with to obtain new and new . Notice that -4 and 6 are adjacent in a cycle of current and they are in different strands in current since . Thus, we can find a reversal, which is , from to transform into (7, 1, 4, 5, 6, 3, 2, 8) (-8, -2, -3, -6, -5, -4, -1, -7) (9, 10) (-10, -9) (11, 12) (-12, -11). After that, we have new , which can serve as a block-interchange to further transform into (7, 1, 2, 3, 4, 5, 6, 8)(-8, -6, -5, -4, -3, -2, -1, -7) (9, 10) (-10, -9) (11, 12) (-12, -11), which is equal to . As a result, we obtain an ordering ([1, 4], [-5, 6], [3, 2]) of π whose induced permutation [1, 4] ⊙ [-5, 6] ⊙ [3, 2] = (1, 4, -5, 6, 3, 2) can be transformed into the permutation (1, 2, ..., 6) of σ using a reversal and a block-interchange (i.e., Δ(π, σ) = 3).
Actually, after running the step 3 of Algorithm 1, it can be verified according to the capping of π and σ and Lemma 3 that for any two adjacent elements x and y in a cycle of with , , if , then . Moreover, the operation used in the step 4 of Algorithm 1 acts on still as a fusion of π, as explained as follows. Notice that , meaning that x and y are in the same cycle of and hence . It can be verified that , , . Since , we have and hence , , . It is not hard to see that . Thus, τ i can be rewritten as , where , , and , , . It can be verified that , , . By Lemma 5, as well as the previous discussion, it can be realized that a1 acts on as a fusion of π and α2 continues to act on as a cap exchange. As a result, the rearrangement effect of acting τ i on is still equivalent to a fusion acting on π. The above discussion indicates that a fusion to π can be mimicked by a translocation τ, which acts on as a fusion of π, followed by zero or more translocations acting on as cap exchanges.
In the following, we prove the correctness of Algorithm 1. Initially, it is not hard to see that all the 5' caps are fixed in and for all . For any element with , where and , that is, the 5' cap of is not equal to that of , then the character of in must be C3. If any cycle in contains any two elements x and y with the same character (either T or C3) in , then we can extract two 2-cycles c1 = (x, y) and from two mate cycles in and multiply with to exchange the caps of the contigs containing x and y, respectively, in , where and . This is the job to be performed in the step 3 in Algorithm 1. Moreover, after finishing the cap exchanges in the step 3, each cycle in the remaining has at most one element with T character and at most one element with C3 character. In other words, after running the step 3, there are at least 2(m- 1) cycles in the resulting such that each such a cycle contains exactly one element, say x, with and exactly one element, say y, with , and . In this case, we can further derive 2(m - 1) 2-cycles from these cycles in with each 2-cycle having a character pair of (T, C3). Intriguingly, we shall show below that these 2(m- 1) 2-cycles with character pair (T, C3), denoted by , can be used to obtain an optimal ordering of π such that the weighted reversal and block-interchange distance between the permutation induced by this ordering of π and σ is minimum. In fact, f k and , where 1 ≤ k ≤ m - 1, are derived from two mate cycles in and hence we call them as mate 2-cycles below. Moreover, if , then .
For 1 ≤ k ≤ m - 1, we simply let , where and . Then . As mentioned previously, the permutation induced by an ordering of π can be mimicked by performing m - 1 consecutive fusions on π that has m contigs initially. According to Lemma 5 and our previous discussion, if , where 1 ≤ k ≤ m - 1, then can be applied to to function as a fusion of two contigs in π, where and . Notice that g k and are mate 2-cycles. However, not all cannot divide . Suppose that only the first λ 2-cycles cannot divide , where 0 ≤ λ ≤ m - 1, that is, for 1 ≤ k ≤ λ, but for λ + 1 ≤ k ≤ m - 1. In this situation, we shall show below that we still can use , as well as their mate 2-cycles, to derive an optimal ordering of π, as we did in the step 4 in Algorithm 1.
Recall that the 5' caps are all fixed in the beginning (before the step 3 in Algorithm 1). As mentioned before, for any translocation used to perform on , it can be expressed as four 2-cycles, two with (non-C5, non-C5) character pair and the others with (C5, C5). It can be verified that during the process of the step 3, no two elements x and y with char = C5 but char can be found in a cycle of the [17], that is, C5 and non-C5 elements are not mixed together in the same cycle of . Actually, this property still continues to be asserted when we later perform any translocation on to function as a fusion of π. Let us now pay attention on those cycles in with only non-C5 elements and temporarily denote the composition of these cycles by . If we still can find any two elements x and y from a cycle in such that , , is an exchange of caps when applying it to , then we apply this cap exchange to until we cannot find any one from . Finally, we denote such a without any cap exchange by . Basically, can be considered as a permutation of and hence its norm is equal to according to the formula we mentioned before.
Lemma 6 Let , , be a fusion to act on π, where charand char. Then .
Proof. For simplicity, it is assumed that we cannot find any cap exchange from to perform on . We then consider the following two cases.
Case 1: Suppose that , that is, both x and y lie in the same cycle, say α, in . Without loss of generality, let . Then α can be expressed as α = α1α2(x, y), where α1 = (a1, ..., a i }) and α2 = (ai+1, ..., a j ). Let denote the mate cycle of α in , that is, . Then it can be expressed as , where and . Clearly, after applying τ to , the cycle α becomes two disjoint cycles α1 and α2 in and becomes two disjoint and . It means that and hence .
Case 2: Suppose that , that is, x and y lie in two different cycles, say α1 and α2, in . In this case, and also are in two different cycles, say and , that are the mate cycles of α1 and α2, respectively, in . By Lemma 4, char and char . Then performing τ on leads α1 and α2 to be joined together into a cycle, say α, in and and to be joined into another cycle, say . If α1 and α2, as well as and , does not contain both T and C3 elements simultaneously, then and hence . If exactly one of α1 and α2, as well as exactly one of and , contains both T and C3 elements simultaneously, then joining α1 and α2 will also change char from T to O and char from C3 to N3, and joining and will change char from C3 to N3 and char from T to O. Therefore, the cycle α, as well as , contains a C3 (or T) element and an N3 element. In this case, we can use these four elements, along with their corresponding 5' caps in , as a cap exchange to perform on , resulting in that each of the cycles α and is divided into two smaller ones in new . As a result, and hence . Suppose that both α1 and α2, as well as both and , contain T and C3 elements at the same time. Then, after applying τ to , one of the above two T elements becomes an O element in new , leading to α, as well as , containing only a T element, along with a C3 element and an N3 element. Next, we can use the T and N3 elements (or the C3 and N3 elements) in α and and their corresponding 5' caps in to exchange the caps of . After that, α, as well as , is divided into two cycles in the new and, consequently, and hence .
Notice that if , then . According to Lemmas 5 and 6, any translocation τ that acts on as a fusion of π decreases the norm at most by two. Hence, we call τ as a good fusion of π if . By the discussion in the proof of Lemma 6, we have the following corollary.
Corollary 1 Let , , , be a fusion to act on π, where char and char . If , then τ is a good fusion to perform on π.
According to Corollary 1, it can be realized that f k , as well as its mate 2-cycle , can derive a good fusion to act on π, where 1 ≤ k ≤ λ. If λ = m - 1, then performing the m - 1 fusions on π, as we did in Algorithm 1, corresponds to an optimal ordering of π such that the weighted reversal and block-interchange distance between the assembly of π and σ is minimum. For simplifying our discussion below, we assume that the λ good fusions derived from f1, f2, ..., fλ and their mate 2-cycles can assemble λ + 1 contigs of π into several super-contigs. If λ <m - 1, then we show below that the fusions of m - 1 contigs in π performed by our algorithm utilizing f1, f2, ..., fm-1is still optimal.
Lemma 7 Let be any sequence of m - 1 translocations that act on as fusions to assemble m - 1 contigs in π. Let be the genome obtained by performing τ k and zero or more following cap exchanges on such that no more cap exchange can be derived from , where and 1 ≤ k ≤ m - 1. Then .
Proof. For simplicity, we assume that in the beginning, no cap exchange can be derived from to act on . Let denote the genome obtained from by removing its caps, where 1 ≤ k ≤ m - 1. By Lemma 6, and by Corollary 1, if is a good fusion to . In fact, there are at most λ translocations from that are good fusions. The reason is as follows. As mentioned before, we can obtain 2λ 2-cycles from that can derive λ good fusions to act on π, say , as well as 2(m - λ - 1) other 2-cycles that cannot derive any good fusions to act on π since their T and C3 elements lie in the same contig strand in . If we can further extract two 2-cycles, say f and its mate 2-cycle f', from that can derive a good fusion, say τ, to act on π, then the C3 elements in both f and f' must locate at a contig whose T elements are in some f k and , respectively, where 1 ≤ k ≤ λ. This implies that the good fusion τ cannot act on together with at the same time, since they will assemble a circular contig that is not allowed. Now, we suppose that are the fusions obtained by the step 4 of Algorithm 1. Clearly, for , since τ k is a good fusion to . Moreover, for , due to the following reason. According to Algorithm 1, we have , , , which actually equals to , , . Moreover, we have , in which the composition of equals to and the composition of , , , equals to . Recall that and , both of which are extracted from two mate cycles in . According to the above discussion, both y k and will be fixed in , thus increasing the number of cycles by two. However, the 2-cycle will further join other two cycles respectively containing x k and z k together into one cycle and will join another two cycles respectively containing and together into one cycle, thus decreasing the number of cycles by two. As a result, . Therefore, we have for the (m -1) fusions obtained by the step 4 of Algorithm 1. In fact, to let happen, there must be a translocation τ i that acts on as a fusion of satisfying either (1) , the number of good fusions newly created by τ i and its following cap exchanges minus that of good fusions currently destroyed by τ i and the following cap exchanges is greater than or equal to one, and the total available good fusions can assemble more contigs than before, or (2) , the number of good fusions created by τ i and its following cap exchanges minus that of the currently destroyed good fusions is greater than or equal to two, and the total good fusions can assemble more contigs than before. However, we show below that no such a translocation τ i exits. Let , , be a fusion (but not a good one) to , where char and char . According to Corollary 1, we have , that is, x and y are in different cycles of . Moreover, char and char after applying τ i to . Below, we consider two cases.
Case 1: Suppose that there is a 2-cycle such that , where 1 , char and char . For simplifying our discussion, we assume that f j is disjoint from the other cycles in and y is in the cycle of . Then in , the cycles f j and α are joined into a cycle , which can be expressed as , where , char and char . According to Lemma 3, there is a cycle . that is the mate cycle of β in . In other words, we can extract c1 = (y, y j ) from β and , from , and then apply to as a cap exchange, where and , , since the character pair (C3, N3) of (y j , y) belongs to CEpair. After that, y j , as well as , will be fixed in the resulting and char will become C3. As a result, and hence . According to the above discussion, if j ≤ λ, that is, f j cannot be used to derive a good fusion to , then acting on still serves as a fusion of and after that, it can be verified that no existing good fusion is destroyed and no new good fusion is created. If j ≤ λ, that is, f j can be used to derive a good fusion to , then this good fusion will be destroyed when we perform on . Suppose that char. Then after further performing the cap exchange on , we still can extract a 2-cycle (ah-1, y) from γ with character pair of (T, C3) in the resulting . Clearly, if (ah-1, y) = f k with k < λ, that is, f k cannot derive a good fusion to ωi-1 (ah-1and y are in the same cycle of ), then after performing the cap exchange on , it can be used to derive a good fusion to , since a h-1 and y will be separated by into two different cycles in the resulting . If k ≤ λ, that is, f k can derive a good fusion to ωi-1, then after performing the cap exchange on , f k can or cannot derive a good fusion to . Based on the above discussion, the number of good fusions newly created by τ i and minus that of good fusions currently destroyed by τ i and must be less than or equal to zero.
Case 2: Suppose that there is no such that x j = x, where , char and char . Let α1 denote the cycle containing x and α2 denote the cycle containing y in . Also let and be the mate cycles of α1 and α2, respectively, in . Note that after applying τ i to , the cycles α1 and α2 will be merged into a single cycle, say α, in and and will be merged into a single cycle, say . Moreover, the characters of x and y in will become O and N3, respectively. As discussed in the proof of Lemma 6, if both α1 and α2, as well as both and , do not contain T and C3 elements simultaneously, then . In this case, it can be verified that no existing good fusion is destroyed by τ i and no new good fusion is created by τ i . In other words, the number of the increased good fusions minus that of the destroyed good fusions is zero. If at least one of α1 and α2, as well as at least one of and , has both T and C3 elements at the same time, then according to the discussion in the proof of Lemma 6. Now suppose that α1 has no C3 element. Then T and C3 elements in α2 can form a 2-cycle that equals to some , where and . After applying τ i to , the T element x from α1 becomes an O element in α and the C3 element y from α2 becomes an N3 element in α. We can continue to extract , which is now a 2-cycle of (T, N3), from α and act on as a cap exchange, where , , ,