generateNeighbours         package:beadarray         R Documentation

_G_e_n_e_r_a_t_e _N_e_i_g_h_b_o_u_r_s _M_a_t_r_i_x _f_o_r _B_e_a_d_L_e_v_e_l_L_i_s_t _o_b_j_e_c_t

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

     Generates a Neighbours matrix from the X and Y co-ordinates in a
     'BeadLevelList' object.

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

     generateNeighbours(BLData, array, window = 30, margin = 10, thresh = 2.2)

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

  BLData: 'BeadLevelList'

   array: integer specifying which strip/array to plot

  window: numeric value, specifying window size (see below)

  margin: numeric value, specifying size of window margin (see below)

  thresh: numeric value, which determines how large links are removed.
          (see below)

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

     generateNeighbours determines, for each bead on the array, which
     beads are next to it. It assumes that the beads are in a hexagonal
     lattice.

     The algorithm used first links each bead to its 6 closest
     neighbours. It then removes the longest link if its squared length
     is more than 'thresh' multiplied by the squared length of the next
     longest link. A similar process is applied to the 2nd and 3rd
     longest links.

     Finally, any one way links are removed (i.e. a link between two
     beads is only preserved if each bead considers the other to be its
     neighbour).

     To ease computation, the algorithm only computes neighbours of
     beads in a square window of side length '2*(window)' which travels
     across the array. Beads in a margin around the square, of width
     '(margin)', are also considered as possible neighbours.

     The Neighbours matrix is designed for use with the BASH functions.

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

     A matrix with 6 columns, and a number of rows equal to the number
     of beads on the array. The neighbours of bead i are found in row
     i. 0 denotes a deleted link. (For example, if row 15 consists of
     20, 35, 0, 0, 60, 4, then bead 15 is considered a neighbour of
     beads 4, 20, 35 and 60.)

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

     Jonathan Cairns

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

     data(BLData)
     neighbours <- generateNeighbours(BLData, 1)

