Email updates

Keep up to date with the latest news and content from BMC Bioinformatics and BioMed Central.

This article is part of the supplement: Proceedings of the Third Annual RECOMB Satellite Workshop on Massively Parallel Sequencing (RECOMB-seq 2013)

Open Access Proceedings

Assembling contigs in draft genomes using reversals and block-interchanges

Chi-Long Li, Kun-Tze Chen and Chin Lung Lu*

Author Affiliations

Department of Computer Science, National Tsing Hua University, Hsinchu 30013, Taiwan

For all author emails, please log on.

BMC Bioinformatics 2013, 14(Suppl 5):S9  doi:10.1186/1471-2105-14-S5-S9

The electronic version of this article is the complete one and can be found online at: http://www.biomedcentral.com/1471-2105/14/S5/S9


Published:10 April 2013

© 2013 Li et al.; licensee BioMed Central Ltd.

This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

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 O δ n 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 O n time and its weighted rearrangement distance from the completely assembled genome can be calculated in advance in O n 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 O δ n , 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 O n time and its weighted reversal and block-interchange distance from the completely assembled genome can be calculated in advance in O n 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, ..., bk], is an ordered list of k signed integers. Let B ¯ = [ - b k , - b k - 1 , , - b 1 ] denote the reverse of B. Given an unordered set of m blocks, say B = { B 1 , B 2 , , B m } , corresponding to a partially assembled genome, an ordering (or assembly) of   B is an ordered list of m blocks in which each block Bi or its reverse B i ¯ appears exactly once, where 1 ≤ i m. For instance, suppose that B = B 1 , B 2 , B 3 = 1 , 4 , 3 , 2 , - 5 , 6 . Then (B1, B3, B2) = ([1, 4], [-5, 6], [3, 2]) and (B1, -B3, B2) = ([1, 4], [-6, 5], [3, 2]) are two orderings of   B . Basically, each ordering of   B 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   B 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   B corresponds to an assembly of the blocks in   B . 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 x E . 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 α β α - 1 . 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, ..., bk), then α · β = (α(b1), α(b2), ..., α(bk)).

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 nc(α) 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| - nc(α) and for any k elements in E, say a1, a2, ..., ak, they all appear in a cycle of α in the ordering of a1, a2, ..., ak if and only if (a1, a2, ..., ak) | α.

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 i E , 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 ( x , y ) π , 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 ni genes, and σ = (1, 2, ..., n) be a linear, uni-chromosomal genome that is assembled completely. Let C = {ck = n + k + 1: 0 ≤ k ≤ 2m - 1} ∪ {-ck = -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 E ^ = E C and Γ ^ = ( 1 , - 1 ) ( 2 , - 2 ) ( n + 2 m , - n - 2 m ) . For the purpose of designing our algorithm later, we add four caps c 2 ( i - 1 ) , c 2 ( i - 1 ) + 1 , - c 2 ( i - 1 ) and -c2(i-1)+1 to the ends of each contig πi, where 1 ≤ i m, leading to a capping contig π ^ i with π ^ i + [ 1 ] = c 2 ( i - 1 ) , π ^ i + [ j ] = π i + [ j - 1 ] , for 2 j n i + 1 , π ^ i + [ n i + 2 ] = c 2 ( i - 1 ) + 1 , π ^ i - [ 1 ] = Γ ^ ( c 2 ( i - 1 ) + 1 ) , π ^ i - [ j ] = π i - [ j - 1 ] for 2 ≤ j ni + 1, and π ^ i - [ n i + 2 ] = Γ ^ ( c 2 ( i - 1 ) ) . 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)+1 to the ends of each contig σi to obtain a capping contig σ ^ i , where σ ^ i + [ 1 ] = c 2 ( i - 1 ) , σ ^ i + [ j ] = σ i + [ j - 1 ] for 2 j n i + 1 , σ ^ i + [ n i + 2 ] = c 2 ( i - 1 ) + 1 , σ ^ i - [ 1 ] = Γ ^ ( c 2 ( i - 1 ) + 1 ) , σ ^ i - [ j ] = σ i - [ j - 1 ] for 2 ≤ j ni + 1, and σ ^ i - [ n i + 2 ] = Γ ^ ( c 2 ( i - 1 ) ) . 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 π ^ i , we call the left caps π ^ i + [ 1 ] and π ^ i - [ 1 ] as 5' caps and the right caps π ^ i + [ n i + 2 ] and π ^ i - [ n i + 2 ] as 3' caps.

Given an integer x in E ^ 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 α.

char x , α ^ = C 5 , if x = α ^ + [ 1 ] or x = α ^ - [ 1 ] ( that is , x is a 5 cap in α ^ ) . C 3 , if k 0 and ( x = α ^ + [ k + 2 ] or x = α ^ - [ k + 2 ] ) ( that is , α is not null and x is a 3 cap in α ^ ) . N3 , if k = 0 and ( x = α ^ + [ k + 2 ] or x = α ^ - [ k + 2 ] ) ( that is , α is null and x is the 3 cap in α ^ ) . T , if k 0 and ( x = α ^ + [ 2 ] or x = α ^ - [ 2 ] ) ( that is , α is not null and x is a tail in α ) . O , otherwise .

In addition, we define 5cap ( x , α ^ ) 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 ( x , π ^ ) denotes the character of x in a capping contig π ^ i of π ^ that contains x, and 5cap ( x , π ^ ) denotes the 5' cap of the strand in π ^ i containing x, that is, char ( x , π ^ ) = char ( x , π ^ i ) and 5cap ( x , π ^ ) = 5cap ( x , π ^ i ) . In our previous work [17], we have shown the following lemma.

Lemma 4 ([17]) For a capping genome π ^ and x Ê , if char ( x , π ^ ) = C 3 (respectively, T), then char ( π ^ Γ ^ ( x ) , π ^ ) is T (respectively, C3) and if char ( x , π ^ ) = O (respectively, N3 and C5), then char ( π ^ Γ ^ ( x ) , π ^ ) 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 c 1 = ( x , y ) and c 2 = ( u , v ) be two 2-cycles with character pairs of (non-C5, non-C5) and (C5, C5), respectively, and let c 1 = ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) and c 2 = ( π ^ Γ ^ ( v ) , π ^ Γ ^ ( u ) ) . Notice that the character pair of c 2 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 c 2 c 1 c 2 c 1 π ^ ( i . e . , τ = c 2 c 1 c 2 c 1 ) , if ( x , u ) | π ^ , ( y , v ) | π ^ , ( x , y ) π ^ and ( x , Γ ^ ( y ) ) π ^ (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 c 1 is in CEpair  =  { ( C 3 , C 3 ) , ( C 3 , N 3 ) , ( T , T ) , ( T , N 3 ) , ( N 3 , N 3 ) } , 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 c 1 also belongs to CEpair and that of c 2 is (C5, C5) according to Lemma 4. Furthermore, if c 1 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 π ^ Γ ^ ( 5 cap ( x , π ^ ) ) = 5 cap ( π ^ Γ ^ ( x ) , π ^ ) and and π ^ Γ ^ ( 5 cap ( y , π ^ ) ) = 5 cap ( π ^ Γ ^ ( y ) , π ^ ) .

Lemma 5 ([17]) Let c1 = (x, y) denote a 2-cycle with char ( x , π ^ ) = T and char ( y , π ^ ) = C 3 , and let c 2 = 5 cap x , π ^ , 5 cap y , π ^ , c 1 = π ^ Γ ^ y , π ^ Γ ^ x and c 2 = ( π ^ Γ ^ ( 5 cap ( y , π ^ ) ) , π ^ Γ ^ ( 5 cap ( x , π ^ ) ) ) . If ( x , y ) π ^ and ( x , Γ ^ ( y ) ) π ^ , then the effect of c 2 c 1 c 2 c 1 π ^ 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 σ ^ π ^ - 1 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 σ 2 , σ 3 , , σ m into σ such that σ = σ 1 σ 2 σ m .

Obtain π ^ = π ^ 1 π ^ 2 π ^ m and σ ^ = σ ^ 1 σ ^ 2 σ ^ m by capping π and σ.

2: Compute σ ^ π ^ - 1 and π ^ Γ ^ .

3: /* To perform cap exchanges */

Let i = 0.

while there are x and y in a cycle of σ ^ π ^ - 1 such that ( char ( x , π ^ ) , char ( y , π ^ ) ) ∈ CEpair do

Let i = i + 1.

Find x and y in a cycle of σ ^ π ^ - 1 with ( char ( x , π ^ ) , char ( y , π ^ ) ) ∈ CEpair.

Let χ i = ( π ^ Γ ^ ( 5 cap ( y , π ^ ) ) , π ^ Γ ^ ( 5 cap ( x , π ^ ) ) ) ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) ( 5 cap ( x , π ^ ) , 5 cap ( y , π ^ ) ) ( x , y ) .

Calculate new π ^ = χ i π ^ , new π ^ Γ ^ = χ i π ^ Γ ^ and new σ ^ π ^ - 1 = σ ^ π ^ - 1 χ i - 1 .

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 σ ^ π ^ - 1 such that ( char ( x , π ^ ) , char ( y , π ^ ) ) = ( T , C 3 ) and ( x , y ) π ^ do

Let i = i + 1.

Find two adjacent elements x and y in a cycle of σ ^ π ^ - 1 such that ( char ( x , π ^ ) , char ( y , π ^ ) ) = ( T , C 3 ) and ( x , y ) π ^ .

Let τ i = ( π ^ Γ ^ ( 5 cap ( y , π ^ ) ) , π ^ Γ ^ ( 5 cap ( x , π ^ ) ) ) ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) ( 5 cap ( x , π ^ ) , 5 cap ( y , π ^ ) ) ( x , y ) .

Calculate new π ^ = τ i π ^ , new π ^ Γ ^ = τ i π ^ Γ ^ and new σ ^ π ^ - 1 = σ ^ π ^ - 1 τ i - 1 .

end while

while i < m - 1 do

Let i = i + 1.

Find two adjacent elements x and y in a cycle of σ ^ π ^ - 1 such that ( char ( x , π ^ ) , char ( y , π ^ ) ) = ( T , C 3 ) and ( x , y ) | π ^ .

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 τ i = ( π ^ Γ ^ ( z ) , π ^ Γ ^ ( x ) ) ( π ^ Γ ^ ( z ) , π ^ Γ ^ ( y ) ) ( y , z ) ( x , z ) .

Calculate new π ^ = τ i π ^ , new π ^ Γ ^ = τ i π ^ Γ ^ and new σ ^ π ^ - 1 = σ ^ π ^ - 1 τ i - 1 .

end while

Let assembly(π) denote the assembled contig in current π ^ whose caps are removed.

5: /* To find reversals */

Let n γ = 0 .

while there are two adjacent elements x and y in a cycle of σ ^ π ^ - 1 such that ( x , Γ ^ ( y ) ) | π ^ do

Let n γ = n γ + 1 .

Find two adjacent elements x and y in a cycle of σ ^ π ^ - 1 such that ( x , Γ ^ ( y ) ) | π ^ .

Let γ n γ = ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) ( x , y ) .

Calculate new π ^ = γ n γ π ^ , new π ^ Γ ^ = γ n γ π ^ Γ ^ and new σ ^ π ^ - 1 = σ ^ π ^ - 1 γ n γ - 1 .

end while

6: /* To find block-interchanges */

Let n β = 0 .

while σ ^ π ^ - 1 1 do

Let n β = n β + 1 .

Choose any two adjacent elements x and y in a cycle of σ ^ π ^ - 1 .

Find two adjacent integers u and v in a cycle of σ ^ π ^ - 1 ( x , y ) such that ( u , v ) ( x , y ) π ^ .

Let β δ = ( π ^ Γ ^ ( v ) , π ^ Γ ^ ( u ) ) ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) ( u , v ) ( x , y ) .

Calculate new π ^ = β n β π ^ , new π ^ Γ ^ = γ n β π ^ Γ ^ and new σ ^ π ^ - 1 = σ ^ π ^ - 1 β n β - 1 .

end while

7: Output assembly(π) and Δ ( π , σ ) = n γ + 2 n β .

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 π ^ = ( 7 , 1 , 4 , 8 ) ( - 8 , - 4 , - 1 , - 7 ) ( 9 , - 5 , 6 , 10 ) ( - 10 , - 6 , 5 , - 9 ) ( 11 , 3 , 2 , 12 ) ( - 12 , - 2 , - 3 , - 11 ) and σ ^ = ( 7 , 1 , 2 , . . . , 6 , 8 ) ( - 8 , - 6 , - 5 , . . . , - 1 , - 7 ) ( 9 , 10 ) ( - 10 , - 9 ) ( 11 , 12 ) ( - 12 , - 11 ) . Next, we compute σ ^ π ^ - 1 = ( 2 , 4 ) ( - 1 , - 3 ) ( 3 , 12 ) ( - 2 , - 11 ) ( 5 , - 5 , 10 , 8 ) ( - 4 , - 6 , - 9 , 6 ) . It can be found that 10 and 8 are in a cycle of current σ ^ π ^ - 1 with ( char ( 10 , π ^ ) , char ( 8 , π ^ ) ) = ( C 3 , C 3 ) CEpair . We perform a cap exchange on π ^ by multiplying ( π ^ Γ ^ ( 5 cap ( 8 , π ^ ) ) , ( π ^ Γ ^ ( 5 cap ( 8 , π ^ ) ) , π ^ Γ ^ ( 5 cap ( 10 , π ^ ) ) ) ( π ^ Γ ^ ( 8 ) , π ^ Γ ^ ( 10 ) ) ( 5 cap ( 10 , π ^ ) 5 cap ( 8 , π ^ ) ) ( 10 , 8 ) = ( - 8 , - 10 ) ( - 4 , - 6 ) ( 9 , 7 ) ( 10 , 8 ) with π ^ , resulting in new π ^ = ( 7 , 1 , 4 , 10 ) ( - 10 , - 4 , - 1 , - 7 ) ( 9 , - 5 , 6 , 8 ) ( - 8 , - 6 , 5 , - 9 ) ( 11 , 3 , 2 , 12 ) ( - 12 , - 2 , - 3 , - 11 ) . In addition, we have new σ ^ π ^ - 1 = ( 2 , 4 ) ( - 1 , - 3 ) ( 3 , 12 ) ( - 2 , - 11 ) ( 5 , - 5 , 10 ) ( - 4 , - 9 , 6 ) ( 9 , 7 ) ( - 10 , - 8 ) . It can be observed that -5 and 10 are in the same cycle of σ ^ π ^ - 1 with satisfying that char ( - - 5 , π ^ ) = T , char ( 10 , π ^ ) = C 3 and ( - 5 , 10 ) π ^ (since -5 and 10 are in different contigs in current π ^ ). Therefore, we perform a fusion on π ^ , by multiplying ρ 1 = ( π ^ Γ ^ ( 5 cap ( 10 , π ^ ) ) , π ^ Γ ^ ( 5 cap ( - 5 , π ^ ) ) ) ( π ^ Γ ^ ( 10 ) , π ^ Γ ^ ( - 5 ) ) ( 5 cap ( - 5 , π ^ ) , 5 cap ( 10 , π ^ ) ) ( - 5 , 10 ) = ( - 10 , - 8 ) ( - 4 , - 9 ) ( 9 , 7 ) ( - 5 , 10 ) with π ^ , to obtain new π ^ = ( 7 , 1 , 4 , - 5 , 6 , 8 ) ( - 8 , - 6 , 5 , - 4 , - 1 , - 7 ) ( 9 , 10 ) ( - 10 , - 9 ) ( 11 , 3 , 2 , 12 ) ( - 12 , - 2 , - 3 - 11 ) . Moreover, we have new σ ^ π ^ - 1 = ( 2 , 4 ) ( - 1 , - 3 ) ( 3 , 12 ) ( - 2 , - 11 ) ( 5 , - 5 ) ( - 4 , 6 ) , in which 3 and 12 form a (T, C3) pair but they belong to the same contig strand in π ^ , that is, ( 3 , 12 ) | π ^ . 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 ( π ^ Γ ^ ( 8 ) , π ^ Γ ^ ( 3 ) ) ( π ^ Γ ^ ( 8 ) , π ^ Γ ^ ( 12 ) ) ( 12 , 8 ) ( 3 , 8 ) = ( - 6 , - 11 ) ( - 6 , - 2 ) ( 12 , 8 ) ( 3 , 8 ) with π ^ to obtain new π ^ = ( 7 , 1 , 4 , - 5 , 6 , 3 , 2 , 8 ) ( - 8 , - 2 , - 3 , - 6 , 5 , - 4 , - 1 , - 7 ) ( 9 , 10 ) ( - 10 , - 9 ) ( 11 , 12 ) ( - 12 , - 11 ) and new σ ^ π ^ - 1 = ( 2 , 4 ) ( - 1 , - 3 ) ( 5 , - 5 ) ( - 4 , 6 ) ( 3 , 8 ) ( - 2 , - 6 ) . Notice that -4 and 6 are adjacent in a cycle of current σ ^ π ^ - 1 and they are in different strands in current π ^ since ( - 4 , Γ ^ ( 6 ) ) | π ^ . Thus, we can find a reversal, which is ( π ^ Γ ^ ( 6 ) , π ^ Γ ^ ( - 4 ) ) ( - 4 , 6 ) = ( 5 , - 5 ) ( - 4 , 6 ) , from σ ^ π ^ - 1 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 σ ^ π ^ - 1 = ( 2 , 4 ) ( - 1 , - 3 ) ( 3 , 8 ) ( - 2 , - 6 ) , 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 π ^ σ ^ - 1 with ( char ( x , π ^ ) , char ( y , π ^ ) ) = ( T , C 3 ) , if ( x , y ) π ^ , then ( x , Γ ^ ( y ) ) π ^ . Moreover, the operation τ i = ( π ^ Γ ^ ( z ) , π ^ Γ ^ ( x ) ) ( π ^ Γ ^ ( z ) , π ^ Γ ^ ( y ) ) ( y , z ) ( x , z ) used in the step 4 of Algorithm 1 acts on π ^ still as a fusion of π, as explained as follows. Notice that ( x , y ) | π ^ , meaning that x and y are in the same cycle of π ^ and hence 5 cap ( x , π ^ ) = 5 cap ( y , π ^ ) . It can be verified that ( 5 cap ( y , π ^ ) , 5 cap ( z , π ^ ) ) ( 5 cap ( x , π ^ ) , 5 cap ( z , π ^ ) ) = 1 . Since ( x , y ) | π ^ , we have ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) | π ^ and hence ( 5 cap ( π ^ Γ ^ ( z ) , π ^ ) , 5 cap ( π ^ Γ ^ ( y ) , π ^ ) ) ( 5 cap ( π ^ Γ ^ ( z ) , π ^ ) , 5 cap ( π ^ Γ ^ ( x ) , π ^ ) ) = 1 . It is not hard to see that ( π ^ Γ ^ ( z ) , π ^ Γ ^ ( x ) ) ( π ^ Γ ^ ( z ) , π ^ Γ ^ ( y ) ) = ( π ^ Γ ^ ( x ) , π ^ Γ ^ ( y ) ) ( π ^ Γ ^ ( z ) , π ^ Γ ^ ( x ) ) . Thus, τi can be rewritten as τ i = α 2 α 1 , where α 1 = ( 5 cap ( π ^ Γ ^ ( z ) , π ^ ) , 5 cap ( π ^ Γ ^ ( x ) , π ^ ) ) ( π ^ Γ ^ ( z ) , π ^ Γ ^ ( x ) ) ( 5 cap ( x , π ^ ) , 5 cap ( z , π ^ ) ) ( x , z ) and α 2 = ( 5 cap ( π ^ Γ ^ ( z ) , π ^ ) , 5 cap ( π ^ Γ ^ ( y ) , π ^ ) ) ( π ^ Γ ^ ( x ) , π ^ Γ ^ ( y ) ) ( 5 cap ( y , π ^ ) , 5 cap ( z , π ^ ) ) ( y , z ) . It can be verified that α 2 = ( 5 cap ( α 1 π ^ Γ ^ ( z ) , α 1 π ^ ) , 5 cap ( α 1 π ^ Γ ^ ( y ) , α 1 π ^ ) ) ( α 1 π ^ Γ ^ ( z ) , α 1 π ^ Γ ^ ( y ) ) ( 5 cap ( z , α 1 π ^ ) , 5 cap ( y , α 1 π ^ ) ) ( y , z ) . 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 α 1 π ^ 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 σ ^ π ^ - 1 and char ( x , π ^ ) N 3 for all x E ^ . For any element x E ^ with char ( x , π ^ i ) = T , where 1 i m , if π ^ - 1 ( x ) σ ^ 1 + [ 1 ] and π ^ - 1 ( x ) σ ^ 1 - [ 1 ] , that is, the 5' cap of π ^ i is not equal to that of σ ^ 1 , then the character of σ ^ π ^ - 1 ( x ) in π ^ must be C3. If any cycle in σ ^ π ^ - 1 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 c 1 = ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) from two mate cycles in σ ^ π ^ - 1 and multiply c 2 c 1 c 2 c 1 with π ^ to exchange the caps of the contigs containing x and y, respectively, in π ^ , where c 2 = ( 5 cap ( x , π ^ ) , 5 cap ( y , π ^ ) ) and c 2 = ( π ^ Γ ^ ( 5 cap ( y , π ^ ) ) , π ^ Γ ^ ( 5 cap ( x , π ^ ) ) ) . 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 σ ^ π ^ - 1 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 σ ^ π ^ - 1 such that each such a cycle contains exactly one element, say x, with ( x , π ^ ) = T and exactly one element, say y, with char ( y , π ^ ) = C 3 , and σ ^ π ^ - 1 ( x ) = y . In this case, we can further derive 2(m - 1) 2-cycles from these cycles in σ ^ π ^ - 1 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 f 1 , f 1 , . . . , f m - 1 , f m - 1 , 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, fk and f k , where 1 ≤ k m - 1, are derived from two mate cycles in σ ^ π ^ - 1 and hence we call them as mate 2-cycles below. Moreover, if f k = ( x , y ) , then f k = ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) .

For 1 ≤ k m - 1, we simply let f k = ( x k , y k ) , where char ( x k , π ^ ) = T and char ( y k , π ^ ) = C 3 . Then f k = ( π ^ Γ ^ ( y k ) , π ^ Γ ^ ( x k ) ) . 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 f k π ^ , where 1 ≤ k m - 1, then g k f k g k f k can be applied to π ^ to function as a fusion of two contigs in π, where g k = ( 5 cap ( x k , π ^ ) , 5 cap ( y k , π ^ ) ) and g k = ( π ^ Γ ^ ( 5 cap ( y , π ^ ) ) , π ^ Γ ^ ( 5 cap ( x , π ^ ) ) ) . Notice that gk and g k are mate 2-cycles. However, not all f 1 , f 2 , , f m - 1 cannot divide π ^ . Suppose that only the first λ 2-cycles f 1 , f 2 , , f λ cannot divide π ^ , where 0 ≤ λ ≤ m - 1, that is, f k π ^ for 1 ≤ k λ, but f k | π ^ for λ + 1 ≤ k m - 1. In this situation, we shall show below that we still can use f 1 , f 2 , , f m - 1 , 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 σ ^ π ^ - 1 (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 ( x , π ^ ) = C5 but char ( y , π ^ ) C 5 can be found in a cycle of the σ ^ π ^ - 1 [17], that is, C5 and non-C5 elements are not mixed together in the same cycle of σ ^ π ^ - 1 . 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 σ ^ π ^ - 1 with only non-C5 elements and temporarily denote the composition of these cycles by ϕ ( σ ^ π ^ - 1 ) . If we still can find any two elements x and y from a cycle in ϕ ( σ ^ π ^ - 1 ) such that ( π ^ Γ ^ ( 5 cap ( y , π ^ ) ) , π ^ Γ ^ ( 5 cap ( x , π ^ ) ) ) ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) ( 5 cap ( x , π ^ ) , 5 cap ( y , π ^ ) ) ( x , y ) is an exchange of caps when applying it to π ^ , then we apply this cap exchange to π ^ until we cannot find any one from ϕ ( σ ^ π ^ - 1 ) . Finally, we denote such a ϕ ( σ ^ π ^ - 1 ) without any cap exchange by ψ ( σ ^ π ^ - 1 ) . Basically, ψ ( σ ^ π ^ - 1 ) can be considered as a permutation of E = E { - c 2 i , c 2 i + 1 : 0 i m - 1 } and hence its norm | | ψ ( σ ^ π ^ - 1 ) | | is equal to | E | - n c ( ψ ( σ ^ π ^ - 1 ) ) according to the formula we mentioned before.

Lemma 6 Let τ = ( π ^ Γ ^ ( 5 cap ( y , π ^ ) ) , π ^ Γ ^ ( 5 cap ( x , π ^ ) ) ) ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) ( 5 cap ( x , π ^ ) , 5 cap ( y , π ^ ) ) ( x , y ) be a fusion to act on π, where char ( x , π ^ ) = T and char ( y , π ^ ) = C 3 . Then | | ψ ( σ ^ π ^ - 1 ) | | - | | ψ ( σ ^ π ^ - 1 τ - 1 ) | | { - 2 , 0 , 2 } .

Proof. For simplicity, it is assumed that we cannot find any cap exchange from σ ^ π ^ - 1 to perform on π ^ . We then consider the following two cases.

Case 1: Suppose that ( x , y ) | σ ^ π ^ - 1 , that is, both x and y lie in the same cycle, say α, in σ ^ π ^ - 1 . Without loss of generality, let α = ( a 1 , a 2 , , a i x , , a j y ) . Then α can be expressed as α = α1α2(x, y), where α1 = (a1, ..., ai}) and α2 = (ai+1, ..., aj). Let α denote the mate cycle of α in σ ^ π ^ - 1 , that is, α = ( π ^ Γ ^ ( a j ) , , π ^ Γ ^ ( a i ) , , π ^ Γ ^ ( a 2 ) , π ^ Γ ^ ( a 1 ) ) . Then it can be expressed as α = α 1 α 2 ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) , where α 1 = ( π ^ Γ ^ ( a i - 1 ) , , π ^ Γ ^ ( a 1 ) , π ^ Γ ^ ( a j ) ) and α 2 = ( π ^ Γ ^ ( a j - 1 ) , π ^ Γ ^ ( a j - 2 ) , , π ^ Γ ^ ( a i ) ) . Clearly, after applying τ to π ^ , the cycle α becomes two disjoint cycles α1 and α2 in σ ^ π ^ - 1 τ - 1 and α becomes two disjoint α 1 and α 2 . It means that n c ( ψ ( σ ^ π ^ - 1 τ - 1 ) ) = n c ( ψ ( σ ^ π ^ - 1 ) ) + 2 and hence | | ψ ( σ ^ π ^ - 1 ) | | - | | ψ ( σ ^ π ^ - 1 τ - 1 ) | | = 2 .

Case 2: Suppose that ( x , y ) σ ^ π ^ - 1 , that is, x and y lie in two different cycles, say α1 and α2, in σ ^ π ^ - 1 . In this case, π ^ Γ ^ ( x ) and π ^ Γ ^ ( y ) also are in two different cycles, say α 1 and α 2 , that are the mate cycles of α1 and α2, respectively, in σ ^ π ^ - 1 . By Lemma 4, char ( π ^ Γ ^ ( x ) , π ^ ) = C 3 and char ( π ^ Γ ^ ( y ) , π ^ ) = T . Then performing τ on π ^ leads α1 and α2 to be joined together into a cycle, say α, in σ ^ π ^ - 1 τ - 1 and α 1 and α 2 to be joined into another cycle, say α . If α1 and α2, as well as α 1 and α 2 , does not contain both T and C3 elements simultaneously, then n c ( ψ ( σ ^ π ^ - 1 τ - 1 ) ) = n c ( ψ ( σ ^ π ^ - 1 ) ) - 2 and hence | | ψ ( σ ^ π ^ - 1 ) | | - | | ψ ( σ ^ π ^ - 1 τ - 1 ) | | = - 2 . If exactly one of α1 and α2, as well as exactly one of α 1 and α 2 , contains both T and C3 elements simultaneously, then joining α1 and α2 will also change char ( x , π ^ ) from T to O and char ( y , π ^ ) from C3 to N3, and joining α 1 and α 2 will change char ( π ^ Γ ^ ( x ) , π ^ ) from C3 to N3 and char ( π ^ Γ ^ ( y ) , π ^ ) 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 σ ^ π ^ - 1 . As a result, n c ( ψ ( σ ^ π ^ - 1 τ - 1 ) ) = n c ( ψ ( σ ^ π ^ - 1 ) ) and hence | | ψ ( σ ^ π ^ - 1 ) | | - | | ψ ( σ ^ π ^ - 1 τ - 1 ) | | = 0 . Suppose that both α1 and α2, as well as both α 1 and α 2 , 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 σ ^ π ^ - 1 and, consequently, n c ( ψ ( σ ^ π ^ - 1 τ - 1 ) ) = n c ( ψ ( σ ^ π ^ - 1 ) ) and hence | | ψ ( σ ^ π ^ - 1 ) | | - | | ψ ( σ ^ π ^ - 1 τ - 1 ) | | = 0 .

Notice that if π ^ = σ ^ , then | | ψ ( σ ^ π ^ - 1 ) | | = 0 . According to Lemmas 5 and 6, any translocation τ that acts on π ^ as a fusion of π decreases the norm | | ψ ( σ ^ π ^ - 1 ) | | at most by two. Hence, we call τ as a good fusion of π if | | ψ ( σ ^ π ^ - 1 ) | | - | | ψ ( σ ^ π ^ - 1 τ - 1 ) | | = 2 . By the discussion in the proof of Lemma 6, we have the following corollary.

Corollary 1 Let τ = ( π ^ Γ ^ ( 5 cap ( y , π ^ ) ) , π ^ Γ ^ ( 5 cap ( x , π ^ ) ) ) ( π ^ Γ ^ ( y ) , π ^ Γ ^ ( x ) ) ( 5 cap ( x , π ^ ) , 5 cap ( y , π ^ ) ) ( x , y ) be a fusion to act on π, where char ( x , π ^ ) = T and char ( y , π ^ ) = C 3 . If ( x , y ) | σ ^ π ^ - 1 , then τ is a good fusion to perform on π.

According to Corollary 1, it can be realized that fk, as well as its mate 2-cycle f k , 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-1 is still optimal.

Lemma 7 Let τ 1 , τ 2 , , τ m - 1 be any sequence of m - 1 translocations that act on π ^ as fusions to assemble m - 1 contigs in π. Let ω ^ k be the genome obtained by performing τk and zero or more following cap exchanges on ω ^ k - 1 such that no more cap exchange can be derived from σ ^ ω ^ k - 1 , where ω ^ 0 = π ^ and 1 ≤ k m - 1. Then | | ψ ( σ ^ ω ^ 0 - 1 ) | | - | | ψ ( σ ^ ω ^ m - 1 - 1 ) | | 2 λ .

Proof. For simplicity, we assume that in the beginning, no cap exchange can be derived from σ ^ ω ^ 0 - 1 to act on ω ^ 0 . Let ω k denote the genome obtained from ω ^ k by removing its caps, where 1 ≤ k m - 1. By Lemma 6, | | ψ ( σ ^ ω ^ k - 1 - 1 ) | | - | | ψ ( σ ^ ω ^ k - 1 ) | | { - 2 , 0 , 2 } and by Corollary 1, | | ψ ( σ ^ ω ^ k - 1 - 1 ) | | - | | ψ ( σ ^ ω ^ k - 1 ) | | = 2 if τ k is a good fusion to ω k - 1 . In fact, there are at most λ translocations from τ 1 , τ 2 , , τ m - 1 that are good fusions. The reason is as follows. As mentioned before, we can obtain 2λ 2-cycles f 1 , f 1 , , f λ , f λ from σ ^ π ^ - 1 that can derive λ good fusions to act on π, say τ 1 , τ 2 , , τ λ , as well as 2(m - λ - 1) other 2-cycles f λ + 1 , f λ + 1 , , f m - 1 , f m - 1 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 σ ^ π ^ - 1 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 fk and f k , respectively, where 1 ≤ k ≤ λ. This implies that the good fusion τ cannot act on π ^ together with τ 1 , τ 2 , , τ λ at the same time, since they will assemble a circular contig that is not allowed. Now, we suppose that τ 1 , τ 2 , , τ m - 1 are the fusions obtained by the step 4 of Algorithm 1. Clearly, for 1 k λ , | | ψ ( σ ^ ω ^ k - 1 - 1 ) | | - | | ψ ( σ ^ ω ^ k - 1 ) | | = 2 since τk is a good fusion to ω k - 1 . Moreover, for λ + 1 k m - 1 , | | ψ ( σ ^ ω ^ k - 1 ) | | - | | ψ ( σ ^ ω ^ k - 1 - 1 ) | | = 0 , due to the following reason. According to Algorithm 1, we have τ k = ( ω ^ k - 1 Γ ^ ( z k ) , ω ^ k - 1 Γ ^ ( x k ) ) ( ω ^ k - 1 Γ ^ ( z k ) , ω ^ k - 1 Γ ^ ( y k ) ) ( y k , z k ) ( x k , z k ) , which actually equals to ( ω ^ k - 1 Γ ^ ( x k ) , ω ^ k - 1 Γ ^ ( z k ) , ω ^ k - 1 Γ ^ ( y k ) ) ( y k , z k , x k ) . Moreover, we have ψ ( σ ^ ω ^ k - 1 ) = ψ ( σ ^ ω ^ k - 1 - 1 ) τ k - 1 , in which the composition of ( x k , y k ) ( y k , z k , x k ) - 1 equals to