GapPenalty

GapPenalty
is an option for SequenceAlignment and related functions that gives the additional cost associated with each gap corresponding to a run of insertions or deletions.

DetailsDetails

  • GapPenalty->p specifies that the similarity of sequences should have an amount p subtracted for every run of insertions or deletions needed to align the sequences.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

By default, an alignment is found with two gaps:

In[1]:=
Click for copyable input
Out[1]=

Increasing the penalty for gaps forces another alignment with fewer gaps:

In[2]:=
Click for copyable input
Out[2]=

The default alignment score:

In[1]:=
Click for copyable input
Out[1]=

Add an additional penalty for the gap:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2008
(7.0)