LongestCommonPrefix-class     package:Biostrings     R Documentation

_C_l_a_s_s _o_f _l_o_n_g_e_s_t _c_o_m_m_o_n _p_r_e_f_i_x _l_e_n_g_t_h_s _f_o_r _s_u_f_f_i_x _a_r_r_a_y _e_l_e_m_e_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calling the function
     'LongestCommonPrefix' with the (only) argument a suffix array.

_S_l_o_t_s:

     '_a_b_o_v_e_d_i_a_g': 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). 

_M_e_t_h_o_d_s:

     _l_c_p[_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.

_A_u_t_h_o_r(_s):

     Saikat DebRoy

_R_e_f_e_r_e_n_c_e_s:

     Dan Gusfield (1997) _Algorithms on strings, trees, and sequences_,
     Cambridge University Press, pp. 152

_S_e_e _A_l_s_o:

     'LongestCommonPrefix'

_E_x_a_m_p_l_e_s:

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

