calculation method. One of "levenshtein",
"hamming", "quality", or "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.
upper
logical value indicating whether the upper triangle of the matrix
should be printed by 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.
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.
substitutionMatrix
(applicable when
method = "substitutionMatrix").
symmetric matrix representing the fixed substitution scores in the
alignment.
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".
gapOpening
(applicable when method = "quality" or
method = "substitutionMatrix").
penalty for opening a gap in the alignment.
gapExtension
(applicable when method = "quality" or
method = "substitutionMatrix").
penalty for extending a gap in the alignment
...
optional arguments to generic function to support additional
methods.
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.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Biostrings)
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, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, 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, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Loading required package: S4Vectors
Loading required package: stats4
Attaching package: 'S4Vectors'
The following objects are masked from 'package:base':
colMeans, colSums, expand.grid, rowMeans, rowSums
Loading required package: IRanges
Loading required package: XVector
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/Biostrings/stringDist.Rd_%03d_medium.png", width=480, height=480)
> ### Name: stringDist
> ### Title: String Distance/Alignment Score Matrix
> ### Aliases: stringDist stringDist,character-method
> ### stringDist,XStringSet-method
> ### stringDist,QualityScaledXStringSet-method
> ### Keywords: character multivariate cluster
>
> ### ** Examples
>
> stringDist(c("lazy", "HaZy", "crAzY"))
1 2
2 2
3 4 5
> stringDist(c("lazy", "HaZy", "crAzY"), ignoreCase = TRUE)
1 2
2 1
3 2 2
>
> data(phiX174Phage)
> plot(hclust(stringDist(phiX174Phage), method = "single"))
>
> data(srPhiX174)
> stringDist(srPhiX174[1:4])
1 2 3
2 8
3 14 21
4 22 21 18
> stringDist(srPhiX174[1:4], method = "quality",
+ quality = SolexaQuality(quPhiX174[1:4]),
+ gapOpening = 10, gapExtension = 4)
1 2 3
2 9.719319
3 -20.266722 -60.226292
4 -129.261856 -137.923645 -116.691521
>
>
>
>
>
> dev.off()
null device
1
>