bounds                 package:bio3d                 R Documentation

_B_o_u_n_d_s _o_f _a _N_u_m_e_r_i_c _V_e_c_t_o_r

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

     Find the 'bounds' (i.e. start, end and length) of consecutive
     numbers within a larger set of numbers in a given vector.

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

       bounds(nums, dup.inds=FALSE)

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

    nums: a numeric vector. 

dup.inds: logical, if TRUE the bounds of connective duplicated elements
          are returned. 

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

     This is a simple utility function useful for summarizing the
     contents of a numeric vector. For example: find the start
     position, end position and lengths of secondary structure elements
     given a vector of residue numbers obtained from a DSSP secondary
     structure prediction.

     By setting 'dup.inds' to TRUE then the indices of the first
     (start) and last (end) duplicated elements of the vector are
     returned. For example: find the indices of atoms belonging to a
     particular residue given a vector of residue numbers (see below).

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

     Returns a three column matrix listing starts, ends and lengths.

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

     Barry Grant

_R_e_f_e_r_e_n_c_e_s:

     Grant, B.J. et al. (2006) _Bioinformatics_ *22*, 2695-2696.

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

      test <- c(seq(1,5,1),8,seq(10,15,1))
      bounds(test)

      test <- rep(c(1,2,4), times=c(2,3,4))
      bounds(test, dup.ind=TRUE)

