Description Usage Arguments Details Value Author(s) See Also Examples
Computes the Levenshtein edit distance or pairwise alignment score matrix for a set of strings.
1 2 3 4 5 6 7 8 9 10 | 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)
|
x |
a character vector or an |
method |
calculation method. One of |
ignoreCase |
logical value indicating whether to ignore case during scoring. |
diag |
logical value indicating whether the diagonal of the matrix
should be printed by |
upper |
logical value indicating whether the upper triangle of the matrix
should be printed by |
type |
(applicable when |
quality |
(applicable when |
substitutionMatrix |
(applicable when
|
fuzzyMatrix |
(applicable when |
gapOpening |
(applicable when |
gapExtension |
(applicable when |
... |
optional arguments to generic function to support additional methods. |
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.
Returns an object of class "dist"
.
P. Aboyoun
dist, agrep, pairwiseAlignment, substitution.matrices
1 2 3 4 5 6 7 8 9 10 11 | 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)
|
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, sd, var, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colMeans, colSums, colnames, do.call,
duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
setdiff, sort, table, tapply, union, unique, unsplit, which,
which.max, which.min
Loading required package: S4Vectors
Loading required package: stats4
Attaching package: 'S4Vectors'
The following object is masked from 'package:base':
expand.grid
Loading required package: IRanges
Loading required package: XVector
Attaching package: 'Biostrings'
The following object is masked from 'package:base':
strsplit
1 2
2 2
3 4 5
1 2
2 1
3 2 2
1 2 3
2 8
3 14 21
4 22 21 18
1 2 3
2 9.719319
3 -20.266722 -60.226292
4 -129.261856 -137.923645 -116.691521
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.