disjoin               package:IRanges               R Documentation

_M_a_k_i_n_g _R_a_n_g_e_s _d_i_s_j_o_i_n_t

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

     Functions for making 'Ranges' disjoint, where no ranges overlap
     another.

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

       disjoin(x, ...)
       disjointBins(x, ...)

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

       x: The 'Ranges' instance, possibly overlapping intervals.

     ...: Additional arguments for methods

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

     The 'disjoin' method returns a disjoint 'Ranges', by finding the
     union of the end points in 'x'. In other words, the result
     consists of a range for every interval, of maximal length, over
     which the set of overlapping ranges in 'x' is the same and at
     least of size 1.

     'disjointBins' segregates 'x' into a set of bins so that the
     ranges in each bin are disjoint. Lower-indexed bins are filled
     first. The method returns an integer vector indicating the bin
     index for each range.

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

     M. Lawrence

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

     'reduce' for making normal ranges, a subset of disjoint ranges,
     where there must be a gap of length >= 1 between each range.

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

       ir <- IRanges(c(1, 1, 4, 10), c(6, 3, 8, 10))
       disjoin(ir) # IRanges(c(1, 4, 7, 10), c(3, 6, 8, 10))

       disjointBins(IRanges(1, 5)) # 1L
       disjointBins(IRanges(c(3, 1, 10), c(5, 12, 13))) # c(2L, 1L, 2L)

