Skip to main content
  • Research article
  • Open access
  • Published:

The number of reduced alignments between two DNA sequences

Abstract

Background

In this study we consider DNA sequences as mathematical strings. Total and reduced alignments between two DNA sequences have been considered in the literature to measure their similarity. Results for explicit representations of some alignments have been already obtained.

Results

We present exact, explicit and computable formulas for the number of different possible alignments between two DNA sequences and a new formula for a class of reduced alignments.

Conclusions

A unified approach for a wide class of alignments between two DNA sequences has been provided. The formula is computable and, if complemented by software development, will provide a deeper insight into the theory of sequence alignment and give rise to new comparison methods.

AMS Subject Classification

Primary 92B05, 33C20, secondary 39A14, 65Q30

Background

Let us consider a DNA sequence as a mathematical string

x = x 1 , x 2 , , x n ,

where x i {A,G,C,T} is one of the four nucleotides, i=1,2,…,n, i.e. A denotes adenine, C cytosine, G guanine and T thymine. In these conditions, the sequence x is of length n.

Our main goal is to compare the sequence x with another DNA sequence

y = y 1 , y 2 , , y m ,

to measure the similarity between both strings and also to determine their residue-residue correspondences.

Sequence comparison and alignment is a central and crucial tool in molecular biology. For example, Pairwise Sequence Alignment is used to identify regions of similarity that may indicate functional, structural and/or evolutionary relationships between two biological sequences (protein or nucleic acid) [1].

For some recent developments and directions we refer the reader to [27] and [8] for a general review of different alignments methods.

To align the sequences CGT and ACTT, one can use EMBOSS Needle for nucleotide sequence [9] that creates an optimal global alignment of the two sequences using the Needleman-Wunsch algorithm to get

EMBOSS-001 1 - C G T 3 | · | EMBOSS-001 1 A C T T 4

Following Lesk [10], in order to compare the amino acids appearing at their corresponding positions in two sequences, theirs correspondences must be assigned and a sequence alignment is the identification of residue-residue correspondence. For some references on sequence alignment we refer the reader to [1016].

To compare two sequences, there exist mainly three different possibilities leading to three different numbers of total alignments [10, 11, 13]:

  1. 1.

    The total number of alignments denoted by f(n,m) that was solved in [13].

  2. 2.

    A gap in a sequence is followed by another gap in the other sequence as in Alignments 1 and 2 for the sequences x=C G T and y=A C T T (see Tables 1 and 2 below) Considering the two alignments as equivalents to the Alignment 3 (see Table 3) without gap in those positions, we have the number of reduced alignments denoted by h(n,m), and obviously h(n,m)<f(n,m). This case has been solved in [11], and we give here another representation in terms of hypergeometric series.

  3. 3.

    In the interesting case that the alignments 1 and 2 are equivalent, but different from alignment 3 we have a number or reduced alignments g(n,m) where h(n,m)<g(n,m)<f(n,m). This last case is new and we present an explicit formula for g.

Table 1 Alignment 1
Table 2 Alignment 2
Table 3 Alignment 3

Results and discussion

Number of f(x,y)alignments

The total number of alignments f(x,y) satisfies the following recurrence relation [13]

f ( n , m ) = f ( n 1 , m ) + f ( n , m 1 ) + f ( n 1 , m 1 ) ,

with initial conditions f(n,0)=f(0,m)=1 for n,m=1,2,3,…. The solution of the above partial difference equation is given by

f ( n , m ) = k = 0 min { n , m } 2 k m k n k ,

(see formula (10) in [13]) and the generating function [17, 18] is

F ( x , y ) = 1 xy + x + y 1 .

Therefore the coefficients f(n,m) in the expansion

F ( x , y ) = n = 0 m = 0 f ( n , m ) x n y m

are given in terms of a hypergeometric series by

f ( n , m ) = 2 F 1 ( m , n ; 1 ; 2 ) .

This relation seems to be new in this form. Here, the generalized hypergeometric series is defined as (see e.g. [19, Chapter 16])

p F q a 1 , , a p ; b 1 , , b q ; d = i = 0 a 1 k a 2 k a p k k ! b 1 k b 2 k b q k d k ,

and (A) k =A(A+1)(A+n−1), with (A)0=1, denotes the Pochhammer’s symbol. It is assumed that b j ≠−k in order to avoid singularities in the denominators. If one of the parameters a j equals to a negative integer, then the sum becomes a terminating series.

Number of h(x,y)alignments

In this case, the recurrence relation for the h(n,m) coefficients is [11]

h ( n , m ) = h ( n 1 , m ) + h ( n , m 1 ) h ( n 2 , m 2 ) , n , m 2 ,

with initial conditions h(n,0)=h(0,m)=1. Therefore, the generating function [17, 18] is

H ( x , y ) = 1 xy x 2 y 2 x y + 1 ,

and the coefficients in the expansion

H ( x , y ) = n = 0 m = 0 h ( n , m ) x n y m

are given by

h ( n , m ) = i = 0 A ( 1 ) i ( 3 i + m + n ) ! i ! ( m 2 i ) ! ( n 2 i ) ! i = 0 B ( 1 ) i ( 3 i + m + n 2 ) ! i ! ( 2 i + m 1 ) ! ( 2 i + n 1 ) ! ,

where

A = min n 2 , m 2 , B = min n 1 2 , m 1 2 .

The above coefficients can be written in terms of (terminating) hypergeometric series as

( m + n ) ! m ! n ! 4 F 3 1 m 2 , m 2 , 1 n 2 , n 2 m n 3 , m n + 1 3 , m n + 2 3 16 27 ( m + n 2 ) ! ( m 1 ) ! ( n 1 ) ! 4 F 3 1 m 2 , 1 m 2 , 1 n 2 , 1 n 2 m n + 2 3 , m n + 3 3 , m n + 4 3 16 27 .

Number of g(x,y)alignments

As indicated before, the main aim of this paper is to give an explicit representation in this case. The recurrence relation for the g(n,m) coefficients is [11]

g ( n , m ) = g ( n 1 , m 1 ) + g ( n 1 , m ) + g ( n , m 1 ) 2 g ( n 2 , m 2 ) , n , m 2 ,

with initial conditions g(n,0)=g(m,0)=1. Thus, the generating function [17, 18] is

G(x,y)= 1 xy 2 x 2 y 2 xy x y + 1 .
(1)

Theorem 1

The coefficients α n,m in the expansion

G(x,y)= 1 xy 2 x 2 y 2 xy x y + 1 = n = 0 m = 0 α n , m x n y m
(2)

are explicitly given by

α n , m = i = U ( n , m ) n + m j = A ( i , n , m ) B ( i , n , m ) β i , j , n , m i = U ( n , m ) 1 n + m 2 j = C ( i , n , m ) D ( i , n , m ) γ i , j , n , m ,
(3)

where

β i , j , n , m = ( 1 ) i j 2 i j i ! ( i j ) ! ( 2 i j m ) ! ( 2 i j n ) ! ( 3 j 4 i + m + n ) ! ,
(4)
γ i , j , n , m = ( 1 ) i j 2 i j i ! ( i j ) ! ( 2 i j m + 1 ) ! ( 2 i j n + 1 ) ! ( 3 j 4 i + m + n 2 ) ! ,
(5)
A(i,n,m)=max 0 , 4 i m n 3 ,
(6)
B(i,n,m)=min i , 2 i m , 2 i n , 4 i n m 2 ,
(7)
C(i,n,m)=max 0 , 4 i m n 2 3 ,
(8)
D ( i , n , m ) = min i , 2 i m + 1 , 2 i n + 1 , 4 i n m + 2 2 ,
(9)
U(n,m)= m n / 2 , n m , ( m + 1 ) / 2 + n m , n m ,
(10)

and [ x] denotes the integer part of x.

Proof

If we expand,

G ( x , y ) = ( 1 xy ) i = 0 x + y + xy 2 x 2 y 2 i = ( 1 xy ) × i = 0 j = 0 i k = 0 j s = 0 k ( 1 ) i j 2 i j i j j k k s y 2 i j s x 2 i j k + s ,
(11)

we have two summands to be computed, namely

i = 0 j = 0 i k = 0 j s = 0 k ( 1 ) i j 2 i j i j j k k s y 2 i j s x 2 i j k + s
(12)
xy i = 0 j = 0 i k = 0 j s = 0 k ( 1 ) i j 2 i j i j j k k s y 2 i j s x 2 i j k + s .
(13)

In order to compute the first sum (12) let us introduce

m=2ijs,n=2ijk+s.
(14)

Therefore, the summation to be done reads as

n = 0 m = 0 i = U V j = A B ( 1 ) i j 2 i j i j j 4 i 2 j m n 4 i 2 j m n 2 i j m x n y m

where U, V, A and B must be computed in terms of the initial indices.

The product of binomials can be simplified to

i ! ( i j ) ! ( 2 i j m ) ! ( 2 i j n ) ! ( 3 j 4 i + m + n ) ! .

Thus,

i 0 , j 0 , 4 i 2 j m n 0 , 4 i 2 j m n 0 , 2 i j m 0 , i j 0 , 2 i j m 0 , 2 i j n 0 , 3 j 4 i + m + n 0 ,

and then

A ( i , n , m ) = A = max 0 , 4 i m n 3 j min i , 2 i m , 2 i n , 4 i n m 2 = B ( i , n , m ) = B.

Finally, the summation reads as

n = 0 m = 0 i = U ( n , m ) n + m j = A B ( 1 ) i j 2 i j i ! ( i j ) ! ( 2 i j m ) ! ( 2 i j n ) ! ( 3 j 4 i + m + n ) ! x n y m ,

where

U ( n , m ) = m n / 2 , n m , ( m + 1 ) / 2 + n m , n m.

A similar work with the second summand (13) leads to the final result.

Some numerical values are g(10,10)=2003204, g(50,50)=2.71972×1034, g(100,100)=7.55997×1069, and we note that g(n,n)>1080 for n≥115. This last inequality is relevant since 1080 is an estimation of the number of protons of our universe [13].

Conclusions

A unified approach for a wide class of alignments between two DNA sequences has been provided. We conclude also that our approach gives an explicit formula filling a gap in the theory of sequence alignment. The formula is computable and, if complemented by software development, will provide a deeper insight into the theory of sequence alignment and give rise to new comparison methods. It may be used also, in the future, to get explicit formulas and compute the number of total, reduced, and effective alignments for multiple sequences.

Methods

We have performed a number of numerical computations to compare our formulae and Mathematica®; [20] command Coefficient for the series expansion of (1), on a MacBook Pro featuring a 45 nm “Penryn” 2.66 GHz Intel “Core 2 Duo” processor (P8800), with two independent processor “cores” on a single silicon chip, 8 GB of 1066 MHz DDR3 SDRAM (PC3-8500). We would like to mention that our approach is amazingly fast, since e.g. g(100,100) is computed by using Mathematica®; in 0.125165 seconds by using the new formulas presented in this paper, while the use of Mathematica®; command Coefficient needs 99.167659 seconds.

References

  1. The European Bioinformatics Institute: Pairwise Sequence Alignment. http://www.ebi.ac.uk/Tools/psa/,

  2. Orobitg M, Lladós J, Guirado F, Cores F, Notredame C: Scalability and accuracy improvements of consistency-based multiple sequence alignment tools. EuroMPI. Edited by: Dongarra J, Blas JG, Carretero J. 2013, New York, USA: ACM International Conference Proceeding Series, 259-264.

    Chapter  Google Scholar 

  3. Orobitg M, Cores F, Guirado F, Roig C, Notredame C: Improving multiple sequence alignment biological accuracy through genetic algorithms. J Supercomput. 2013, 65 (3): 1076-1088. 10.1007/s11227-012-0856-9.

    Article  Google Scholar 

  4. Montañola A, Roig C, Guirado F, Hernández P, Notredame C: Performance analysis of computational approaches to solve multiple sequence alignment. J Supercomput. 2013, 64 (1): 69-78. 10.1007/s11227-012-0751-4.

    Article  Google Scholar 

  5. Zhong C, Zhang S: Efficient alignment of rna secondary structures using sparse dynamic programming. BMC Bioinformatics. 2013, 14: 269-10.1186/1471-2105-14-269.

    Article  PubMed Central  PubMed  Google Scholar 

  6. Veeneman BA, Iyer MK, Chinnaiyan AM: Oculus: faster sequence alignment by streaming read compression. BMC Bioinformatics. 2012, 13: 297-10.1186/1471-2105-13-297.

    Article  PubMed Central  PubMed  Google Scholar 

  7. Chaisson M, Tesler G: Mapping single molecule sequencing reads using basic local alignment with successive refinement (blasr): theory and application. BMC Bioinformatics. 2012, 13: 238-10.1186/1471-2105-13-238.

    Article  PubMed Central  PubMed  CAS  Google Scholar 

  8. Löytynoja A: Alignment methods: Strategies, challenges, benchmarking, and comparative overview. Evolutionary Genomics. Methods in Molecular Biology. Edited by: Anisimova M. 2012, New York, USA: Humana Press, 203-235.

    Google Scholar 

  9. The European Bioinformatics Institute: Pairwise Sequence Alignment (Nucleotide). http://www.ebi.ac.uk/Tools/psa/emboss\_needle/nucleotide.html,

  10. Lesk AM: Introduction to Bioinformatics. 2002, Oxford, UK: Oxford University Press

    Google Scholar 

  11. Andrade H: Análise matemática dalgunhos problemas no estudo de secuencias biolóxicas. PhD thesis, Universidade de Santiago de Compostela, Departamento de Análise Matemática (2013),

  12. Bai F, Zhang J, Zheng J: Similarity analysis of DNA sequences based on the EMD method. Appl Math Lett. 2011, 24 (2): 232-237. 10.1016/j.aml.2010.09.010.

    Article  Google Scholar 

  13. Cabada A, Nieto JJ, Torres A: An exact formula for the number of aligments between two DNA sequences. DNA Sequence (continued as Mitochondrial DNA). 2003, 14: 427-430.

    Google Scholar 

  14. Eger S: Sequence alignment with arbitrary steps and further generalizations, with applications to alignments in linguistics. Inform Sci. 2013, 237: 287-304.

    Article  Google Scholar 

  15. Morgenstern B: A simple and space-efficient fragment-chaining algorithm for alignment of DNA and protein sequences. Appl Math Lett. 2002, 15 (1): 11-16. 10.1016/S0893-9659(01)00085-4.

    Article  Google Scholar 

  16. Zhang J, Wang R, Bai F, Zheng J: A quasi-MQ EMD method for similarity analysis of DNA sequences. Appl Math Lett. 2011, 24 (12): 2052-2058. 10.1016/j.aml.2011.05.041.

    Article  Google Scholar 

  17. Srivastava HM, Manocha HL: A Treatise on Generating Functions. Ellis Horwood Series: Mathematics and its Applications. 1984, Chichester: Ellis Horwood Ltd.

    Google Scholar 

  18. Wilf HS: Generatingfunctionology. 2006, Wellesley, MA: A K Peters Ltd.

    Google Scholar 

  19. Abramowitz M, Stegun IA: Handbook of Mathematical Functions, with Formulas, Graphs, and Mathematical Tables. 1966, New York: Dover Publications Inc.

    Google Scholar 

  20. Wolfram Research I: Mathematica, Version 9.01. 2013, Champaign, Illinois: Wolfram Research, Inc.

    Google Scholar 

Download references

Acknowledgements

The authors are grateful to Prof. Marko Petkovs̆ek for helpful comments. The work of I. Area has been partially supported by the Ministerio de Economía y Competitividad of Spain under grant MTM2012–38794–C02–01, co-financed by the European Community fund FEDER. J.J. Nieto also acknowledges partial financial support by the Ministerio de Economía y Competitividad of Spain under grant MTM2010–15314, co-financed by the European Community fund FEDER.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Juan J Nieto.

Additional information

Competing interests

The authors declare that they have no competing interests.

Authors’ contributions

Each of the authors HA, IA, JJN and AT, contributed to each part of this study equally and read and approved the final version of the manuscript.

Rights and permissions

Open Access This article is published under license to BioMed Central Ltd. This is an Open Access article is distributed under the terms of the Creative Commons Attribution License ( https://creativecommons.org/licenses/by/2.0 ), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly credited. The Creative Commons Public Domain Dedication waiver ( https://creativecommons.org/publicdomain/zero/1.0/ ) applies to the data made available in this article, unless otherwise stated.

Reprints and permissions

About this article

Cite this article

Andrade, H., Area, I., Nieto, J.J. et al. The number of reduced alignments between two DNA sequences. BMC Bioinformatics 15, 94 (2014). https://doi.org/10.1186/1471-2105-15-94

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/1471-2105-15-94

Keywords