srdistance             package:ShortRead             R Documentation

_E_d_i_t _d_i_s_t_a_n_c_e_s _b_e_t_w_e_e_n _r_e_a_d_s _a_n_d _a _s_m_a_l_l _n_u_m_b_e_r _o_f _s_h_o_r_t _r_e_f_e_r_e_n_c_e_s

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

     'srdistance' calculates the edit distance from each read in
     'pattern' to each read in 'subject'. The underlying algorithm
     'pairwiseAlignment' is only efficient when both reads are short,
     and when the number of 'subject' reads is small.

_U_s_a_g_e:

     srdistance(pattern, subject, ...)

_A_r_g_u_m_e_n_t_s:

 pattern: An object of class 'DNAStringSet' containing reads whose edit
          distance is desired.

 subject: A short 'character' vector, 'DNAString' or (small)
          'DNAStringSet' to serve as reference.

     ...: additional arguments, forward to 'srapply'.

_D_e_t_a_i_l_s:

     The underlying algorithm performs pairwise alignment from each
     read in 'pattern' to each sequence in 'subject'. The return value
     is a list of numeric vectors of distances, one list element for
     each sequence in 'subject'. The vector in each list element
     contains for each read in 'pattern' the edit distance from the
     read to the corresponding subject. The weight matrix and gap
     penalties used to calculate the distance are structured to weight
     base substitutions and single base insert/deletions equally. Edit
     distance between known and ambiguous (e.g., N) nucleotides, or
     between ambiguous nucleotides, are weighted as though each
     possible nucleotide in the ambiguity were equally likely.

_V_a_l_u_e:

     A list of length equal to that of 'subject'. Each element is a
     numeric vector equal to the length of 'pattern', with values
     corresponding to the minimum distance between between the
     corresponding pattern and subject sequences.

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

     Martin Morgan <mtmorgan@fhcrc.org>

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

     'pairwiseAlignment'

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

     sp <- SolexaPath(system.file("extdata", package="ShortRead"))
     aln <- readAligned(sp, "s_2_export.txt")
     polyA <- polyn("A", 35)
     polyT <- polyn("T", 35)

     d1 <- srdistance(clean(sread(aln)), polyA)
     d2 <- srdistance(sread(aln), polyA)
     d3 <- srdistance(sread(aln), c(polyA, polyT))

