LongestCommonPrefix-class {Biostrings} | R Documentation |

## Class of longest common prefix lengths for suffix array elemets

### Description

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 from the Class

Objects can be created by calling the function
`LongestCommonPrefix`

with the (only) argument a suffix
array.

### Slots

`abovediag`

:- Object of class
`"integer"`

,
represents the elements just above diagonal (ie. the elements of
the matrix whose column numbers are one more than there row numbers).

### Methods

- lcp[i]
- The only method for extracting elements from this
class of objects. Here
`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.

### Author(s)

Saikat DebRoy

### References

Dan Gusfield (1997) *Algorithms on strings, trees, and
sequences*, Cambridge University Press, pp. 152

### See Also

`LongestCommonPrefix`

### Examples

data('yeastSEQCHR1')
yeast1 <- DNAString(yeastSEQCHR1)
x <- substring(yeast1, c(1, 30))
x
suf <- DNASuffixArray(x)
lcp <- LongestCommonPrefix(suf)
lcp[cbind(1, 1:30)]

[Package

*Biostrings* version 1.4.0

Index]