Skip to main content
Log in

Optimal sequence alignment using affine gap costs

  • Published:
Bulletin of Mathematical Biology Aims and scope Submit manuscript


When comparing two biological sequences, it is often desirable for a gap to be assigned a cost not directly proportional to its length. If affine gap costs are employed, in other words if opening a gap costsv and each null in the gap costsu, the algorithm of Gotoh (1982,J. molec. Biol. 162, 705) finds the minimum cost of aligning two sequences in orderMN steps. Gotoh's algorithm attempts to find only one from among possibly many optimal (minimum-cost) alignments, but does not always succeed. This paper provides an example for which this part of Gotoh's algorithm fails and describes an algorithm that finds all and only the optimal alignments. This modification of Gotoh's algorithm still requires orderMN steps. A more precise form of path graph than previously used is needed to represent accurately all optimal alignments for affine gap costs.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others


  • Altschul, S. F. and B. W. Erickson. 1986. “A Nonlinear Measure of Subalignment Similarity and its Significance Levels.”Bull. math. Biol. 48, 617–632.

    Article  MATH  MathSciNet  Google Scholar 

  • Erickson, B. W. and P. H. Sellers. 1983. “Recognition of Patterns in Genetic Sequences.” InTime Warps, String Edits, and Macromolecules: The Theory and Practice of Sequence Comparison, D. Sankoff and J. B. Kruskal (Eds), pp. 55–91. Reading, MA: Addison-Wesley.

    Google Scholar 

  • Fitch, W. M. and T. F. Smith. 1983. “Optimal Sequence Alignments.”Proc. natn. Acad. Sci. U.S.A. 80, 1382–1386.

    Article  Google Scholar 

  • Gotoh, O. 1982. “An Improved Algorithm for Matching Biological Sequences.”J. molec. Biol. 162, 705–708.

    Article  Google Scholar 

  • Needleman, S. B. and C. D. Wunsch. 1970. “A General Method Applicable to the Search for Similarities in the Amino Acid Sequences of Two Proteins.”J. molec. Biol. 48, 443–453.

    Article  Google Scholar 

  • Schwartz, R. M. and M. O. Dayhoff. 1978. “Matrices for Detecting Distant Relationships.” InAtlas of Protein Sequence and Structure, Vol. 5, Suppl. 3, M. O. Dayhoff (Ed.), pp. 345–358. Washington, DC: National Biomedical Research Foundation.

    Google Scholar 

  • Sellers, P. H. 1974. “On the Theory and Computation of Evolutionary Distances.”SIAM J. appl. Math. 26, 787–793.

    Article  MATH  MathSciNet  Google Scholar 

  • Smith, T. F., M. S. Waterman and W. M. Fitch. 1981. “Comparative Biosequence Metrics.”J. molec. Evol. 18, 38–46.

    Article  Google Scholar 

  • Taniguchi, T. H. Matsui, T. Fujita, C. Takaoka, N. Kashima, R. Yoshimoto and J. Hamuro. 1983. “Structure and Expression of a Cloned cDNA for Human Interleukin-2.”Nature 302, 305–310.

    Article  Google Scholar 

  • Taylor, P. 1984. “A Fast Homology Program for Aligning Biological Sequences.”Nucl. Acids Res. 12, 447–455.

    Google Scholar 

  • Waterman, M. S. 1984. “Efficient Sequence Alignment Algorithms.”J. theor. Biol. 108, 333–337.

    MathSciNet  Google Scholar 

  • —, T. F. Smith and W. A. Beyer. 1976. “Some Biological Sequence Metrics.”Adv. Math. 20, 367–387.

    Article  MATH  MathSciNet  Google Scholar 

  • Ukkonen, E. 1983. “On Approximate String Matching.”Proc. Int. Conference on the Foundations of Computer Theory, Lecture Notes in Computer Science, Vol. 158, pp. 487–496. Berlin: Springer-Verlag.

    Google Scholar 

  • Yokota, T., N. Arai, F. Lee, D. Rennick, T. Mosmann and K. Arai. 1985. “Use of a cDNA Expression Vector for Isolation of Mouse Interleukin 2 cDNA Clones: Expression of T-Cell Growth Factor Activity After Transfection of Monkey Cells.”Proc. natn. Acad. Sci. U.S.A. 82, 68–72.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations


Rights and permissions

Reprints and permissions

About this article

Cite this article

Altschul, S.F., Erickson, B.W. Optimal sequence alignment using affine gap costs. Bltn Mathcal Biology 48, 603–616 (1986).

Download citation

  • Received:

  • Issue Date:

  • DOI: