NeedlemanWunschSimilarity

NeedlemanWunschSimilarity[u,v]

gives a number representing the NeedlemanWunsch similarity between strings or vectors u and v.

Details and Options

  • NeedlemanWunschSimilarity[u,v] finds an optimal global alignment between the elements of u and v, and returns the number of one-element matches.
  • For strings, setting the option IgnoreCase->True makes NeedlemanWunschSimilarity treat lowercase and uppercase letters as equivalent.
  • With the default setting SimilarityRules->Automatic, each match between two characters contributes to the total similarity score, while each mismatch, insertion, or deletion contributes .
  • The option GapPenalty specifies an additional cost to be subtracted from the similarity score for any run of insertions or deletions.

Examples

Basic Examples  (2)

NeedlemanWunsch similarity between two strings:

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

NeedlemanWunsch similarity between two vectors:

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

See Also

SequenceAlignment  SmithWatermanSimilarity  EditDistance  DamerauLevenshteinDistance  LongestCommonSubsequence  WarpingDistance

Introduced in 2008
(7.0)