RangesList-utils           package:IRanges           R Documentation

_R_a_n_g_e_s_L_i_s_t _u_t_i_l_i_t_y _f_u_n_c_t_i_o_n_s

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

     Utility functions for manipulating 'RangesList' objects.

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

     ## S4 method for signature 'RangesList':
     gaps(x, start=NA, end=NA)
     ## S4 method for signature 'RangesList':
     reduce(x, with.inframe.attrib = FALSE)
     ## S4 method for signature 'RangesList':
     range(x, ..., na.rm = FALSE)

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

       x: A 'RangesList'

   start: The start of the range over which to calculate the gaps. If
          'NA', use the minimum start position in the 'Ranges' object.

     end: The end of the range over which to calculate the gaps. If
          'NA', use the maximum end position in the 'Ranges' object.

with.inframe.attrib: Ignored.

     ...: Additional 'RangesList' objects

   na.rm: Ignored

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

     The 'gaps' function takes the complement (the 'gaps') of each
     element in the list and returns the result as a 'RangesList'.

     The 'reduce' method merges (via 'reduce') all of the elements into
     a single 'Ranges' object and returns the result as a length-one
     'RangesList'.

     'range' finds the 'range', i.e. a 'Ranges' with one range, from
     the minimum start to the maximum end, on each element in 'x' and
     returns the result as a 'RangesList'. If there are additional
     'RangesList' objects in '...', they are merged into 'x' by name,
     if all objects have names, otherwise, if they are all of the same
     length, by position. Else, an exception is thrown.

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

     A 'RangesList' object. For 'gaps' and 'range', length is the same
     as that of 'x'. For 'reduce', length is one.

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

     Michael Lawrence, H. Pages

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

     'RangesList', 'reduce', 'gaps'

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

       # 'gaps'
       range1 <- IRanges(start=c(1,2,3), end=c(5,2,8))
       range2 <- IRanges(start=c(15,45,20,1), end=c(15,100,80,5))
       collection <- RangesList(one = range1, range2)

       # these two are the same
       RangesList(gaps(range1), gaps(range2))
       gaps(collection)

       # 'reduce'
       range2 <- IRanges(start=c(45,20,1), end=c(100,80,5))
       collection <- RangesList(one = range1, range2)

       # and these two are the same
       reduce(collection)
       RangesList(asNormalIRanges(IRanges(c(1,20), c(8, 100)), force=FALSE))

       # 'range'
       rl <- RangesList(a = IRanges(c(1,2),c(4,3)), b = IRanges(c(4,6),c(10,7)))
       rl2 <- RangesList(c = IRanges(c(0,2),c(4,5)), a = IRanges(c(4,5),c(6,7)))
       range(rl, rl2) # matched by names
       names(rl2) <- NULL
       range(rl, rl2) # now by position

