nuget server logo nuget api documents
↑

API Docs / SMRUCC.genomics.Core / Extensions

Extensions

Full name SMRUCC.genomics.SequenceModel.NucleotideModels.Extensions Assembly SMRUCC.genomics.Core Members 7

01 Syntax

SMRUCC.genomics.SequenceModel.NucleotideModels.Extensions

02 Methods

NameOverloadsSummary
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

method LevenshteinDistance #
LevenshteinDistance(String, String)

Compute Levenshtein distance Michael Gilleland, Merriam Park Software.(http://www.merriampark.com/ld.htm)

Parameters
NameTypeDescription
sString

-

tString

-

method LevenshteinDistance2 #
LevenshteinDistance2(String, String)
Remarks

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.

Parameters
NameTypeDescription
sString

-

tString

-

method CalculateJukesCantorDistance #
CalculateJukesCantorDistance(Double)

根据Jukes-Cantor模型计算校正后的进化距离。

Parameters
NameTypeDescription
pDouble

观测到的序列差异比例 (范围 0 到 0.75)。

Returns

校正后的进化距离。如果输入无效,返回 Double.NaN。

method CalculateJCFromSequences #
CalculateJCFromSequences(String, String, Boolean, String)

比较两条已对齐的DNA序列,并计算它们之间的Jukes-Cantor距离。

Parameters
NameTypeDescription
sequence1String

第一条DNA序列。

sequence2String

第二条DNA序列。

ignoreCaseBoolean

是否忽略大小写(默认忽略)。

gapPenaltyString

如何处理缺失位点(-):‘N’=视为未知不计入, ‘P’=视为差异, ‘S’=跳过整个位点。

Returns

Jukes-Cantor距离。如果计算失败,返回 Double.NaN。

method HammingDistance #
HammingDistance(String, String)
method Similarity #
Similarity(String, String)
method PatternMatched #
PatternMatched(String, String, Double)