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 onesided block (or contig) ordering problem with weighted reversal and blockinterchange 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 blockinterchanges (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 onesided 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 onesided block ordering problem in time, where n is the number of genes or markers and δ is the number of used reversals and blockinterchanges. 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 [13], 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 socalled 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 lineartime 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 blockinterchange (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. Blockinterchange 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 blockinterchanges, whose weights are 1 and 2, respectively. For distinguishing this special block ordering problem from the original one, we call it as onesided block (or contig) ordering problem. In fact, an efficient algorithm to solve the onesided 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 onesided 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 onesided 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 onesided block ordering problem with weighted reversal and blockinterchange distance, where n is the number of genes or markers and δ is the number of reversals and blockinterchanges 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 blockinterchange 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 misjoin 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
Onesided block ordering problem
In the following, we dedicate ourselves to linear, unichromosomal genomes. With a slight modification, however, our algorithmic result can still apply to circular, unichromosomal genomes, or to multichromosomal genomes with linear or circular chromosomes in a chromosomebychromosome manner. Once completely assembled, a unichromosomal 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 = [b_{1}, b_{2}, ..., 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 (B_{1}, B_{3}, B_{2}) = ([1, 4], [5, 6], [3, 2]) and (B_{1}, B_{3}, B_{2}) = ([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 (B_{1}, B_{3}, B_{2}) in the above exemplified induces the signed permutation (1, 4, 5, 6, 3, 2), which simply is denoted by B_{1 }⊙ B_{3 }⊙ B_{2}. Clearly, the permutation induced by an ordering of corresponds to an assembly of the blocks in . Now, the onesided block ordering problem we study in this paper is formally defined as follows:
Onesided block ordering problem with reversal and blockinterchange 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 blockinterchanges 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 blockinterchanges 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 onetoone 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 kcycle. In convention, the 1cycles 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 1cycles, 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 β = (b_{1}, b_{2}, ..., b_{k}), then α · β = (α(b_{1}), α(b_{2}), ..., α(b_{k})).
It is a fact that every permutation can be expressed into a product of 2cycles, in which 1cycles 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 2cycles. In the cycle decomposition of α, let n_{c}(α) denote the number of its disjoint cycles, notably including the 1cycles 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 a_{1}, a_{2}, ..., a_{k}, they all appear in a cycle of α in the ordering of a_{1}, a_{2}, ..., a_{k }if and only if (a_{1}, a_{2}, ..., a_{k})  α.
Let α = (a_{1}, a_{2}) be a 2cycle and β be an arbitrary permutation of E. If αβ, that is, both a_{1 }and a_{2 }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, a_{1 }and a_{2 }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, blockinterchange) acting on this DNA molecule can be mimicked by multiplying two (respectively, four) 2cycles 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 blockinterchange 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 doublestranded DNA molecules. If α is a cycle in σπ^{1}, then (πΓ) · α^{1 }is also a cycle in σπ^{1}.
An efficient algorithm for the onesided 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 ith 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, unichromosomal genome that is partially assembled into m contigs π_{1}, π_{2}, ..., π_{m}, each with n_{i }genes, and σ = (1, 2, ..., n) be a linear, unichromosomal 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 c_{2(i1)+1 }to 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 m1 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 c_{2(i1)}, c_{2(i1)+1}, c_{2(i1) }and c_{2(i1)+1 }to 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 onesided block ordering problem by dealing with the contigs of the capping genome as if they were linear chromosomes. Let and be two 2cycles with character pairs of (nonC5, nonC5) 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 2cycle 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 c_{1 }= (x, y) denote a 2cycle 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 blockinterchanges between the resulting assembly of the contigs in π and σ is minimum. In Algorithm 1 below, we describe our algorithm for efficiently solving the onesided block ordering problem, where reversals are weighted one and blockinterchanges 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, unichromosomal genome π = π_{1}π_{2 }... π_{m }and a completely assembled, linear, unichromosomal genome σ = σ_{1}.
Output: An optimally assembled genome of π, denoted by assembly(π), and the weighted reversal and blockinterchange distance Δ(π, σ) between assembly(π) and σ.
1: Add m  1 null contigs into σ such that .
Obtain and by capping π 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.
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 .
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 noncap integer and its 3' cap, say z, different from y.
end while
Let assembly(π) denote the assembled contig in current whose caps are removed.
5: /* To find reversals */
while there are two adjacent elements x and y in a cycle of such that do
Find two adjacent elements x and y in a cycle of such that .
end while
6: /* To find blockinterchanges */
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 .
end while
Below, we consider an example to clarify Algorithm 1. Let π = {[1, 4], [5, 6], [3, 2]} and σ = {[1, 2, ..., 6]} be the input linear, unichromosomal 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 blockinterchange 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 blockinterchange (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 a_{1 }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 2cycles c_{1 }= (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(m1) 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) 2cycles from these cycles in with each 2cycle having a character pair of (T, C3). Intriguingly, we shall show below that these 2(m1) 2cycles with character pair (T, C3), denoted by , can be used to obtain an optimal ordering of π such that the weighted reversal and blockinterchange 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 2cycles 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 2cycles. However, not all cannot divide . Suppose that only the first λ 2cycles 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 2cycles, 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 2cycles, two with (nonC5, nonC5) 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 nonC5 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 nonC5 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 }= (a_{1}, ..., a_{i}}) and α_{2 }= (a_{i+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 2cycle , 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 blockinterchange distance between the assembly of π and σ is minimum. For simplifying our discussion below, we assume that the λ good fusions derived from f_{1}, f_{2}, ..., f_{λ }and their mate 2cycles can assemble λ + 1 contigs of π into several supercontigs. If λ <m  1, then we show below that the fusions of m  1 contigs in π performed by our algorithm utilizing f_{1}, f_{2}, ..., f_{m1 }is 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λ 2cycles from that can derive λ good fusions to act on π, say , as well as 2(m  λ  1) other 2cycles 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 2cycles, say f and its mate 2cycle 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 2cycle 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 2cycle 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 c_{1 }= (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 2cycle (a_{h1}, y) from γ with character pair of (T, C3) in the resulting . Clearly, if (a_{h1}, y) = f_{k }with k < λ, that is, f_{k }cannot derive a good fusion to ω_{i1} (a_{h1 }and 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_{h1 }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 ω_{i1}, 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 2cycle 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 2cycle of (T, N3), from α and act on as a cap exchange, where , , , and , . Clearly, no new good fusion is created in this case and one existing good fusion derived by f_{k }will be destroyed if . Therefore, the number of the increased good fusions minus that of the destroyed good fusions is less than or equal to zero. Suppose that α_{1 }contains both T and C3 elements, where we denote the C3 element by z for convenience. Then x and z can form a 2cycle of (T, C3) pair, which can derive a good fusion to if , where , , , and , . If , then, as mentioned previously, τ cannot work together with λ other good fusions derived by at the same time, since they will assemble a circular contig that is not allowed. For the case in which α_{2 }contains no T element, it is not hard to see that no new good fusion will be created and no existing good fusion will be destroyed when performing and its following cap exchange on , resulting in that the number of the created good fusions minus that of the destroyed good fusions is zero. We now assume that contains a T element, say w, and a C3 element y. Then w and y are adjacent in and (w, y) equals to some f_{k}, where . After applying to has a C3 element z, a T element w and an N3 element y. Then a 2cycle (w, y) can be extracted from α such that can further perform on as a cap exchange, where , , , and , . Hence, if , then the good fusion derived by f_{k }will be destroyed by τ_{i }and . However, the remaining α still contains a C3 element z and a T element w, which can derive a good fusion, say . Hence, the number of the increased good fusions minus that of the destroyed good fusions is zero. On the other hand, if k > λ, then no exiting good fusion is destroyed by τ_{i }and . In this case, the number of the increased good fusions minus that of the destroyed good fusions is equal to one. However, it can be verified that cannot work with λ other good fusions derived by , because they will produce a circular contig that is not allowed. In other words, no more contigs can be assembled after performing and on .
According to the above discussion, we can conclude that . □
Based on Lemma 7, as well as the discussion in its proof, the m  1 fusions derived by Algorithm 1 correspond to an optimal ordering of π with an induced permutation assembly (π) such that the weighted rearrangement distance between assembly (π) and σ is minimized. The obtained rearrangement distance is calculated based on the algorithm in our previous study [17], and is equal to , where is the genome obtained by performing the cap exchanges and m  1 fusions on the initial capping of π, as done in the steps 3 and 4 in Algorithm 1, respectively. The total time complexity of Algorithm 1 is , where δ is the number of reversals and blockinterchanges used to transform assembly (π) into σ. The reason is as follows. Since , the cost of the step 1 for capping the input genomes is . The computation of in the step 2 still can be done in time. Recall that after running the step 3, each cycle in has at most a element and at most a C3 element. Totally, there are elements and 2m C3 elements in the cycles of . Moreover, deriving two 2cycles to serve as a cap exchange from two long mate cycles in will divide these two long cycles into four smaller cycles. Hence, there are cap exchanges to be performed in the step 3, which totally cost time since each cap exchange needs only constant time. The step 4 assembles m contigs by utilizing 2(m  1) 2cycle , which can be derived in advance from in time. Since each fusion requires only constant time, the cost of the step 4 is , which is equal to . As to the steps 5 and 6, they can be done in time in total, since there are totally δ iterations to find the reversals and blockinterchanges and the time complexity of each iteration is dominated by the cost of finding a reversal or blockinterchange that is time. Notice that although Algorithm 1 we described above is dedicated to linear, unichromosomal genomes, it can still be applied to circular, unichromosomal genomes, or to multichromosomal genomes with linear or circular chromosomes in a way of chromosome by chromosome.
Theorem 1 Given a partially assembled genome π and a completely assembled genome σ, the onesided block ordering problem can be solved in O(δn) time and the weighted rearrangement distance between the permutation assembly(π) induced by the optimal ordering of π and σ is that can be computed in O(n) time, where is the capping genome of π with the cap exchanges and m  1 fusions being done, is the capping genome of σ, n is the number of genes or markers, and δ is the number of reversals and blockinterchanges used to transform assembly(π) into σ.
As mentioned in the introduction, any algorithm to solve the onesided block ordering problem can be used to assemble (i.e., order and orient) the contigs in a draft genome based on a reference genome, if we denote this draft genome as π and use the reference genome as σ. For this application, our Algorithm 1 can finish its job just in time, because it does not need to do the steps 5 and 6 in this situation.
Experimental results
We have implemented Algorithm 1 as mentioned in the previous section into a program and also compared its accuracy performance to SIS on assembling the contigs of partially assembled genomes using some simulated datasets of linear, unichromosomal genomes. For this purpose, we compared the permutation induced by an assembly algorithm for a partially assembled genome with its actual permutation by counting the number of breakpoints between them, where each breakpoint corresponds to an error of incorrectly joining two contigs (i.e., a misjoin error) caused by the assembly algorithm. This breakpoint number is then normalized by the number of contigs minus ρ to represent a fraction of incorrect contig joins, where ρ = 1 if the chromosome is linear; otherwise, ρ = 0. Each of partially assembled genomes with single linear chromosome in our simulated datasets was prepared and tested as follows. First, we generated the reference genome σ = (1, 2, ..., n) with a linear chromosome of n genes, where n varies from 50 to 1000 with in the step of 50, and performed δ random rearrangement events (reversals and/or transpositions) on s to obtain a permutation of a linear, unichromosomal genome π', where δ varies from zero to 100 in the step of 1. Among the δ rearrangement events in our simulations, we used four different occurrence ratios to randomly generate reversals and transpositions: (1) 1:0, (2) 2:1, (3) 1:1 and (4) 0:1. Next, the genome is randomly fragmented into m contigs of various sizes to simulate the partially assembled genome π, where m varies from 50 to 500 with step 50. Finally, for each choice of n, m, δ and reversal/transposition ratio, we repeated the experiments 10 times and compared our program with SIS using their averaged normalized misjoin errors. As shown in Figure 1, the averaged normalized contig misjoin errors of our program are lower than those of SIS for all simulated datasets when the number of the involved reversals and transpositions 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. The main reason may be due to the fact that our program can deal with both reversals and blockinterchanges (including transpositions as a special case), while SIS considers only reversals without taking into account transpositions.
Figure 1. Comparison of accuracy performance between our program and SIS on simulated datasets with different ratios of the involved reversals and transpositions.
Conclusions
In this study, we introduced and studied the onesided block/contig problem with optimizing the weighted reversal and blockinterchange distance, which particularly has a useful application in genome resequencing. We finally designed an efficient algorithm to solve this problem in time, where n is the number of genes or markers and d is the number of used reversals and blockinterchanges. In addition, we showed 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, our simulation results showed that the accuracy performance of our program is better than that of the currently existing tool SIS when the number of the involved reversals and transpositions is increased. Moreover, the gap of this accuracy performance between our program and SIS is increasing, if there are more transpositions involved in the rearrangement events.
Competing interests
The authors declare that they have no competing interests.
Authors' contributions
Corresponding author CLL conceived of the study, designed and analyzed the algorithm, and drafted the manuscript. The other authors CLL and KTC participated in the development of the program, as well as in the simulated experiments and their result discussion. The authors wish it to be known that the first two authors CLL and KTC contributed equally to this work and should be considered cofirst authors. All authors read and approved the final manuscript.
Acknowledgements
This work was supported in part by National Science Council of Republic of China under grant NSC1002221E007129MY3.
Declarations
The publication costs for this article were funded by National Science Council of Republic of China under grant NSC1002221E007129MY3.
This article has been published as part of BMC Bioinformatics Volume 14 Supplement 5, 2013: Proceedings of the Third Annual RECOMB Satellite Workshop on Massively Parallel Sequencing (RECOMBseq 2013). The full contents of the supplement are available online at http://www.biomedcentral.com/bmcbioinformatics/supplements/14/S5.
References

Shendure J, Ji HL: Nextgeneration DNA sequencing.
Nature Biotechnology 2008, 26:11351145. PubMed Abstract  Publisher Full Text

Mardis ER: The impact of nextgeneration sequencing technology on genetics.
Trends in Genetics 2008, 24:133141. PubMed Abstract  Publisher Full Text

Metzker ML: Sequencing technologies  the next generation.
Nature Reviews Genetics 2010, 11:3146. PubMed Abstract  Publisher Full Text

Fertin G, Labarre A, Rusu I, Tannier E, Vialette S: Combinatorics of Genome Rearrangements. Cambridge, Massachusetts: The MIT Press; 2009.

Gaul E, Blanchette M: Ordering partially assembled genomes using gene arrangements.
Lecture Notes in Computer Science 2006, 4205:113128. Publisher Full Text

Bourque G, Pevzner PA: Genomescale evolution: reconstructing gene orders in the ancestral species.
Genome Research 2002, 12:2636. PubMed Abstract  Publisher Full Text  PubMed Central Full Text

Hannenhalli S, Pevzner PA: Transforming cabbage into turnip: polynomial algorithm for sorting signed permutations by reversals.
Journal of the ACM 1999, 46:127. Publisher Full Text

Bentley DR: Wholegenome resequencing.
Current Opinion in Genetics and Development 2006, 16:545552. PubMed Abstract  Publisher Full Text

Koboldt DC, Ding L, Mardis ER, Wilson RK: Challenges of sequencing human genomes.
Briefings in Bioinformatics 2010, 11:484498. PubMed Abstract  Publisher Full Text  PubMed Central Full Text

van Hijum SAFT, Zomer AL, Kuipers OP, Kok J: Projector 2: contig mapping for efficient gapclosure of prokaryotic genome sequence assemblies.
Nucleic Acids Research 2005, 33:W560W566. PubMed Abstract  Publisher Full Text  PubMed Central Full Text

Richter DC, Schuster SC, Huson DH: OSLay: optimal syntenic layout of unfinished assemblies.
Bioinformatics 2007, 23:15731579. PubMed Abstract  Publisher Full Text

Assefa S, Keane TM, Otto TD, Newbold C, Berriman M: ABACAS: algorithmbased automatic contiguation of assembled sequences.
Bioinformatics 2009, 25:19681969. PubMed Abstract  Publisher Full Text  PubMed Central Full Text

Rissman AI, Mau B, Biehl BS, Darling AE, Glasner JD, Perna NT: Reordering contigs of draft genomes using the Mauve Aligner.
Bioinformatics 2009, 25:20712073. PubMed Abstract  Publisher Full Text  PubMed Central Full Text

Muñoz A, Zheng CF, Zhu QA, Albert VA, Rounsley S, Sankoff D: Scaffold filling, contig fusion and comparative gene order inference.
BMC Bioinformatics 2010, 11:304. PubMed Abstract  BioMed Central Full Text  PubMed Central Full Text

Husemann P, Stoye J: r2cat: synteny plots and comparative assembly.
Bioinformatics 2010, 26:570571. PubMed Abstract  Publisher Full Text  PubMed Central Full Text

Dias Z, Dias U, Setubal JC: SIS: a program to generate draft genome sequence scaffolds for prokaryotes.
BMC Bioinformatics 2012, 13:96. PubMed Abstract  BioMed Central Full Text

Huang YL, Lu CL: Sorting by reversals, generalized transpositions, and translocations using permutation groups.
Journal of Computational Biology 2010, 17:685705. PubMed Abstract  Publisher Full Text

Blanchette M, Kunisawa T, Sankoff D: Parametric genome rearrangement.
Gene 1996, 172:GC11GC17. PubMed Abstract  Publisher Full Text