LongestCommonPrefix {Biostrings}R Documentation

Find the longest common prefixes for a suffix array

Description

Given an object of class "BioString" representing a suffix array, this function returns an object (of class "LongestCommonPrefix") representing a matrix of the longest common prefixes between any two elements in the suffix array.

Usage

LongestCommonPrefix(x)

Arguments

x An object of class "BioString" representing a suffix array.

Details

The suffix array argument to the LongestCommonPrefix function is assumed to be created by the DNASuffixArray function. In other words, the suffixes are assumed to be sorted in increasing order.

Value

An object of class "LongestCommonPrefix".

Author(s)

Saikat DebRoy

See Also

DNASuffixArray, LongestCommonPrefix-class

Examples

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

[Package Biostrings version 1.0.0 Index]