NeedlemanWunschSimilarity[u,v]
gives a number representing the Needleman–Wunsch similarity between strings, vectors or biomolecular sequences u and v.


NeedlemanWunschSimilarity
NeedlemanWunschSimilarity[u,v]
gives a number representing the Needleman–Wunsch similarity between strings, vectors or biomolecular sequences 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.
- NeedlemanWunschSimilarity takes the following options:
-
GapPenalty 0 additional cost for each alignment gap IgnoreCase False whether to ignore case of letters in strings SimilarityRules Automatic rules for similarities between elements - With the default setting SimilarityRules->Automatic, each match between two elements 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
open all close allBasic Examples (3)
Related Guides
Text
Wolfram Research (2008), NeedlemanWunschSimilarity, Wolfram Language function, https://reference.wolfram.com/language/ref/NeedlemanWunschSimilarity.html (updated 2020).
CMS
Wolfram Language. 2008. "NeedlemanWunschSimilarity." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/NeedlemanWunschSimilarity.html.
APA
Wolfram Language. (2008). NeedlemanWunschSimilarity. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NeedlemanWunschSimilarity.html
BibTeX
@misc{reference.wolfram_2025_needlemanwunschsimilarity, author="Wolfram Research", title="{NeedlemanWunschSimilarity}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/NeedlemanWunschSimilarity.html}", note=[Accessed: 08-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_needlemanwunschsimilarity, organization={Wolfram Research}, title={NeedlemanWunschSimilarity}, year={2020}, url={https://reference.wolfram.com/language/ref/NeedlemanWunschSimilarity.html}, note=[Accessed: 08-August-2025]}