LongestCommonPrefix-class {Biostrings} | R Documentation |
This class represents a matrix of the length of the longest common prefixes between elements of a suffix array. The diagonal elements are all zero.
Objects can be created by calling the function
LongestCommonPrefix
with the (only) argument a suffix
array.
abovediag
:"integer"
,
represents the elements just above diagonal (ie. the elements of
the matrix whose column numbers are one more than there row numbers). lcp
is an object of class
"LongestCommonPrefix" and i
is a matrix of two columns, the
columns representing the rwos and columns of the elements to be
extracted. The result is an integer vector of the corresponding
elements.Saikat DebRoy
Dan Gusfield (1997) Algorithms on strings, trees, and sequences, Cambridge University Press, pp. 152
data('yeastSEQCHR1') yeast1 <- DNAString(yeastSEQCHR1) x <- substring(yeast1, c(1, 30)) x suf <- DNASuffixArray(x) lcp <- LongestCommonPrefix(suf) lcp[cbind(1, 1:30)]