Affine gap penalty 2026-10-20
Linear gap penalty Created 2026-10-20 Updated 2026-11-05
A linear gap penalty assigns a cost proportional to gap length: for . One gap of length three and three gaps of length one therefore incur the same total cost, before considering alignment substitutions. An affine gap penalty distinguishes opening from extending a gap and can favour fewer longer gaps. The chosen cost is part of the alignment model rather than an experimentally measured universal price of an insertion. [ref]
Basic local alignment search tool by Stephen F. Altschul and others. 1990, alignment scores and the distinction from exhaustive gapped comparison
An affine gap penalty charges a larger opening cost than extension cost, reflecting that a single insertion or deletion event can span several residues. For a gap of length , explicitly chooseThe supplied sequence alignment has two gap runs, of lengths one and two. Its residue–residue score remains , so this choice givesMore generally, this affine gap penalty convention gives . There is no unique numerical rescore until opening and extension costs are chosen. A concave length-dependent gap penalty can make very long gaps progressively cheaper per added residue; distinct terminal gap penalties can accommodate incomplete sequence ends. Each choice encodes a different assumption about insertions, deletions or sequence completeness.
Use global sequence alignment, for example the Needleman-Wunsch algorithm with an appropriate substitution matrix and gap penalty. The two full-length globin proteins are related by orthology and are from closely related species, so the expected correspondence extends across both complete sequences. Unmatched ends should normally contribute to the score rather than being discarded.
With a linear gap penalty of magnitude , the dynamic programming entry is the best score for the first and residues. It satisfieswith , , and traceback from . An affine gap penalty uses separate match and gap states.