matchprobes           package:matchprobes           R Documentation

_A _f_u_n_c_t_i_o_n _t_o _m_a_t_c_h _a _q_u_e_r_y _s_e_q_u_e_n_c_e _t_o _t_h_e _s_e_q_u_e_n_c_e_s _o_f _a _s_e_t _o_f
_p_r_o_b_e_s.

_D_e_s_c_r_i_p_t_i_o_n:

     The 'query' sequence, a character string (probably representing a
     transcript of interest), is scanned for the presence of exact
     matches to the sequences in the character vector 'records'. The
     indices of the set of matches are returned.

_U_s_a_g_e:

     matchprobes(query, records, probepos=FALSE)

_A_r_g_u_m_e_n_t_s:

   query: A character vector. For example, each element may represent a
          gene (transcript) of interest. See Details.

 records: A character vector. For example, each element may represent
          the probes on a DNA array.

probepos: A logical value. If TRUE, return also the start positions of
          the matches in the query sequence.

_D_e_t_a_i_l_s:

     'toupper' is applied to the arguments 'query' and 'records' before
     matching. The intention of this is to make the matching
     case-insensitive. The matching is done using the C library
     function 'strstr'. It might be nice to explore other
     possibilities.

_V_a_l_u_e:

     A list. Its first element is a list of the same length as the
     input vector. Each element of the list is a numeric vector
     containing the indices of the probes that have a perfect match in
     the query sequence.

     If 'probepos' is TRUE, the returned list has a second element: it
     is of the same shape as described above, and gives the respective
     positions of the matches.

_A_u_t_h_o_r(_s):

     R. Gentleman, Laurent Gautier, Wolfgang Huber

_E_x_a_m_p_l_e_s:

       ## The main intention for this function is together with the probe
       ## tables from the "probe" data packages, e.g.:
       ## > library(hgu95av2probe)
       ## > data(probe)
       ## > seq <- probe$sequence
       ##
       ## Since we do not want to be dependent on the presence of this 
       ## data package, for the sake of example we simply simulate some
       ## probe sequences:

       bases <- c("A", "C", "G", "T")
       seq   <- sapply(1:1000, function(x) paste(bases[ceiling(4*runif(256))], collapse=""))

       w1 <- seq[20:22]
       w2 <- complementSeq(w1, start=13, stop=13)
       w  <- c(w1, w2)

       matchprobes(w, seq)
       matchprobes(w, seq, probepos=TRUE)

