Extensions
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| LevenshteinDistance | 1 | Compute Levenshtein distance Michael Gilleland, Merriam Park Software.(http://www.merriampark.com/ld.htm) |
| LevenshteinDistance2 | 1 | Chas Emerick.(http://www.merriampark.com/ldjava.htm) |
| CalculateJukesCantorDistance | 1 | 根据Jukes-Cantor模型计算校正后的进化距离。 |
| CalculateJCFromSequences | 1 | 比较两条已对齐的DNA序列,并计算它们之间的Jukes-Cantor距离。 |
| HammingDistance | 1 | |
| Similarity | 1 | |
| PatternMatched | 1 |
03 Members
String, String)Compute Levenshtein distance Michael Gilleland, Merriam Park Software.(http://www.merriampark.com/ld.htm)
| Name | Type | Description |
|---|---|---|
s | String | - |
t | String | - |
String, String)Chas Emerick.(http://www.merriampark.com/ldjava.htm)
The difference between this impl. and the previous is that, rather than creating and retaining a matrix of size s.length()+1 by t.length()+1, we maintain two single-dimensional arrays of length s.length()+1. The first, d, is the 'current working' distance array that maintains the newest distance cost counts as we iterate through the characters of String s. Each time we increment the index of String t we are comparing, d is copied to p, the second int[]. Doing so allows us to retain the previous cost counts as required by the algorithm (taking the minimum of the cost count to the left, up one, and diagonally up and to the left of the current cost count being calculated). (Note that the arrays aren't really copied anymore, just switched...this is clearly much better than cloning an array or doing a System.arraycopy() each time through the outer loop.)
Effectively, the difference between the two implementations is this one does not cause an out of memory condition when calculating the LD over two very large strings.
| Name | Type | Description |
|---|---|---|
s | String | - |
t | String | - |
Double)根据Jukes-Cantor模型计算校正后的进化距离。
| Name | Type | Description |
|---|---|---|
p | Double | 观测到的序列差异比例 (范围 0 到 0.75)。 |
校正后的进化距离。如果输入无效,返回 Double.NaN。
String, String, Boolean, String)比较两条已对齐的DNA序列,并计算它们之间的Jukes-Cantor距离。
| Name | Type | Description |
|---|---|---|
sequence1 | String | 第一条DNA序列。 |
sequence2 | String | 第二条DNA序列。 |
ignoreCase | Boolean | 是否忽略大小写(默认忽略)。 |
gapPenalty | String | 如何处理缺失位点(-):‘N’=视为未知不计入, ‘P’=视为差异, ‘S’=跳过整个位点。 |
Jukes-Cantor距离。如果计算失败,返回 Double.NaN。
String, String)String, String)String, String, Double)