Affine gap penalty 2026-10-20
An affine gap penalty charges for the first position of a gap and for each additional position. With , one long gap costs less than several separate gaps of the same total length. Some software instead uses ; numerical settings must be interpreted with their convention.
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 choose
The supplied sequence alignment has two gap runs, of lengths one and two. Its residue–residue score remains , so this choice gives
More 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 satisfies
with , , and traceback from . An affine gap penalty uses separate match and gap states.