Motivation: Sequence alignments obtained using affine gap penalties are not
always biologically correct, because the insertion of long gaps is over-pe
nalised. There is a need for an efficient algorithm which can find local al
ignments using non-linear gap penalties.
Results: A dynamic programming algorithm is described which computes optima
l focal sequence alignments for arbitrary, monotonically increasing gap pen
alties, i.e. where the cost g(k) of inserting a gap of k symbols is such th
at g(k) greater than or equal to g(k - 1). The running time of the algorith
m is dependent on the scoring scheme; if the expected score of art alignmen
t between random, unrelated sequences of lengths m, n is proportional to lo
gmn, then with one exception, the algorithm has expected running time O(mn)
. Elsewhere, the running time is no greater than O(mn(m + n)). Optimisation
s are described which appear to reduce the worst-case run-time to O(mn) in
many cases. We show how using a non-affine gap penalty cart dramatically in
crease the probability of detecting a similarity containing a long gap.
Availability: The source code is available to academic collaborators under
licence.