srduplicated            package:ShortRead            R Documentation

_O_r_d_e_r, _s_o_r_t, _a_n_d _f_i_n_d _d_u_p_l_i_c_a_t_e_s _i_n _X_S_t_r_i_n_g_S_e_t _o_b_j_e_c_t_s

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

     These generics order, rank, sort, and find duplicates in short
     read objects, including fastq-encoded qualities. 'srorder',
     'srrank' and 'srsort' differ from the default functions 'rank',
     'order' and 'sort' in that sorting is based on an
     internally-defined order rather than, e.g., the order implied by
     'LC_COLLATE'.

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

     srorder(x, ...)
     srrank(x, ...)
     srsort(x, ...)
     srduplicated(x, ...)

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

       x: The object to be sorted, ranked, ordered, or to have
          duplicates identified; see the examples below for objects for
          which methods are defined.

     ...: Additional arguments available for use by methods; usually
          ignored.

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

     Unlike 'sort' and friends, the implementation does not preserve
     order of duplicated elements. Like 'duplicated', one element in
     each set of duplicates is marked as 'FALSE'.

     'srrank' settles ties using the min criterion described in
     'rank', i.e., identical elements are ranked equal to the rank of
     the first occurence of the sorted element.

     The following methods are defined, in addition to methods
     described in class-specific documentation:


     _s_r_s_o_r_t 'signature(x = "XStringSet")':

     _s_r_o_r_d_e_r 'signature(x = "XStringSet")':

     _s_r_d_u_p_l_i_c_a_t_e_d 'signature(x = "XStringSet")':

          Apply 'srorder', 'srrank', 'srsort', 'srduplicated' to
          'XStringSet' objects such as those returned by 'sread'.

     _s_r_s_o_r_t 'signature(x = "ShortRead")':

     _s_r_o_r_d_e_r 'signature(x = "ShortRead")':

     _s_r_d_u_p_l_i_c_a_t_e_d 'signature(x = "ShortRead")':

          Apply 'srorder', 'srrank', 'srsort', 'srduplicated' to
          'XStringSet' objects to the 'sread' component of 'ShortRead'
          and derived objects.


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

     The functions return the following values:

 srorder: An integer vector the same length as 'x', containing the
          indices that will bring 'x' into sorted order.

  srrank: An integer vector the same length as 'x', containing the rank
          of each seqeunce when sorted.

  srsort: An instance of 'x' in sorted order.

srduplicated: A logical vector the same length as 'x' indicating
          whether the indexed element is already present. Note that,
          like 'duplicated', subsetting 'x' using the result returned
          by '!srduplicated(x)' includes one representative from each
          set of duplicates.

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

     Martin Morgan <mtmorgan@fhcrc.org>

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

     showMethods("srsort")
     showMethods("srorder")
     showMethods("srduplicated")

     sp <- SolexaPath(system.file('extdata', package='ShortRead'))
     rfq <- readFastq(analysisPath(sp), pattern="s_1_sequence.txt")

     sum(srduplicated(sread(rfq)))
     srsort(sread(rfq))
     srsort(quality(rfq))

