Methods
(static) similarity(s1, s2, match, mismatch, gap) → {number}
Calculates the similarity between two strings (s1 and s2) using the Smith-Waterman algorithm.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
s1 |
string | The first string for comparison. |
|
s2 |
string | The second string for comparison. |
|
match |
number | 2 | (optional) - The score for matching characters (default: 2). |
mismatch |
number | (optional) - The score for mismatching characters (default: -1). |
|
gap |
number | (optional) - The penalty for introducing gaps in the alignment (default: -1). |
- Source:
Returns:
- The maximum score achieved during the Smith-Waterman alignment, representing the similarity between the strings.
- Type
- number