SmithWatermanSimilarity

SmithWatermanSimilarity[u,v]

gives a number representing the SmithWaterman similarity between strings, vectors or bio sequences u and v.

Details and Options

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

Examples

open allclose all

Basic Examples  (3)

SmithWaterman similarity between two strings:

SmithWaterman similarity between two vectors:

SmithWaterman similarity between two bio sequences:

Options  (1)

SimilarityRules  (1)

The "SimilarDegenerateBases" setting allows a higher similarity for matching degenerate terms in biomolecular sequences:

Wolfram Research (2008), SmithWatermanSimilarity, Wolfram Language function, https://reference.wolfram.com/language/ref/SmithWatermanSimilarity.html (updated 2020).

Text

Wolfram Research (2008), SmithWatermanSimilarity, Wolfram Language function, https://reference.wolfram.com/language/ref/SmithWatermanSimilarity.html (updated 2020).

CMS

Wolfram Language. 2008. "SmithWatermanSimilarity." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/SmithWatermanSimilarity.html.

APA

Wolfram Language. (2008). SmithWatermanSimilarity. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SmithWatermanSimilarity.html

BibTeX

@misc{reference.wolfram_2024_smithwatermansimilarity, author="Wolfram Research", title="{SmithWatermanSimilarity}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/SmithWatermanSimilarity.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_smithwatermansimilarity, organization={Wolfram Research}, title={SmithWatermanSimilarity}, year={2020}, url={https://reference.wolfram.com/language/ref/SmithWatermanSimilarity.html}, note=[Accessed: 21-November-2024 ]}