stringDist(Biostrings)
stringDist()所属R语言包:Biostrings
String Distance/Alignment Score Matrix
字符串距离/对齐分数矩阵
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Computes the Levenshtein edit distance or pairwise alignment score matrix for a set of strings.
计算Levenshtein编辑距离为一组字符串或两两对齐得分矩阵。
用法----------Usage----------
stringDist(x, method = "levenshtein", ignoreCase = FALSE, diag = FALSE, upper = FALSE, ...)
## S4 method for signature 'XStringSet'
stringDist(x, method = "levenshtein", ignoreCase = FALSE, diag = FALSE,
upper = FALSE, type = "global", quality = PhredQuality(22L),
substitutionMatrix = NULL, fuzzyMatrix = NULL, gapOpening = 0,
gapExtension = -1)
## S4 method for signature 'QualityScaledXStringSet'
stringDist(x, method = "quality", ignoreCase = FALSE,
diag = FALSE, upper = FALSE, type = "global", substitutionMatrix = NULL,
fuzzyMatrix = NULL, gapOpening = 0, gapExtension = -1)
参数----------Arguments----------
参数:x
a character vector or an XStringSet object.
一个字符向量或XStringSet对象。
参数:method
calculation method. One of "levenshtein", "hamming", "quality", or "substitutionMatrix".
计算方法。一个"levenshtein","hamming","quality"或"substitutionMatrix"。
参数:ignoreCase
logical value indicating whether to ignore case during scoring.
逻辑值,该值指示是否忽略在得分情况。
参数:diag
logical value indicating whether the diagonal of the matrix should be printed by print.dist.
逻辑值,该值指示是否应印print.dist矩阵对角线。
参数:upper
logical value indicating whether the upper triangle of the matrix should be printed by print.dist.
逻辑值指示是否应print.dist印上三角矩阵。
参数:type
(applicable when method = "quality" or method = "substitutionMatrix"). type of alignment. One of "global", "local", and "overlap", where "global" = align whole strings with end gap penalties, "local" = align string fragments, "overlap" = align whole strings without end gap penalties.
(适用于当method = "quality"或method = "substitutionMatrix")。对齐类型。 "global","local","overlap",其中"global"=对齐结尾差距处罚的整个字符串,"local"=对齐字符串碎片,"overlap" =对齐整个字符串没有结束的差距处罚。
参数:quality
(applicable when method = "quality"). object of class XStringQuality representing the quality scores for x that are used in a quality-based method for generating a substitution matrix.
(适用于method = "quality")。类的对象XStringQuality代表的质量分数为x为质量为基础的方法,产生一个置换矩阵。
参数:substitutionMatrix
(applicable when method = "substitutionMatrix"). symmetric matrix representing the fixed substitution scores in the alignment.
(适用于method = "substitutionMatrix")。对称矩阵的代表在对准固定的替代分数。
参数:fuzzyMatrix
(applicable when method = "quality"). fuzzy match matrix for quality-based alignments. It takes values between 0 and 1; where 0 is an unambiguous mismatch, 1 is an unambiguous match, and values in between represent a fraction of "matchiness".
(适用于method = "quality")。模糊匹配矩阵为基础的质量路线。 0和1之间的值,其中0是一个明确的不匹配,是一个明确的比赛,和值之间的代表了“matchiness”的分数。
参数:gapOpening
(applicable when method = "quality" or method = "substitutionMatrix"). penalty for opening a gap in the alignment.
(适用于当method = "quality"或method = "substitutionMatrix")。打开对齐差距的罚款。
参数:gapExtension
(applicable when method = "quality" or method = "substitutionMatrix"). penalty for extending a gap in the alignment
(适用于当method = "quality"或method = "substitutionMatrix")。为扩大在对齐的差距罚款
参数:...
optional arguments to generic function to support additional methods.
可选参数的通用功能,以支持额外的方法。
Details
详情----------Details----------
When method = "hamming", uses the underlying neditStartingAt code to calculate the distances, where the Hamming distance is defined as the number of substitutions between two strings of equal length. Otherwise, uses the underlying pairwiseAlignment code to compute the distance/alignment score matrix.
当method = "hamming",使用底层neditStartingAt代码来计算距离,海明距离定义为两个字符串长度相等的换人数量。否则,使用底层pairwiseAlignment代码来计算距离/对齐的得分矩阵。
值----------Value----------
Returns an object of class "dist".
类"dist"返回一个对象。
作者(S)----------Author(s)----------
P. Aboyoun
参见----------See Also----------
dist, agrep, pairwiseAlignment, substitution.matrices
区,agrep,pairwiseAlignment,substitution.matrices
举例----------Examples----------
stringDist(c("lazy", "HaZy", "crAzY"))
stringDist(c("lazy", "HaZy", "crAzY"), ignoreCase = TRUE)
data(phiX174Phage)
plot(hclust(stringDist(phiX174Phage), method = "single"))
data(srPhiX174)
stringDist(srPhiX174[1:4])
stringDist(srPhiX174[1:4], method = "quality",
quality = SolexaQuality(quPhiX174[1:4]),
gapOpening = -10, gapExtension = -4)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|