pgc                   package:gap                   R Documentation

_P_r_e_p_a_r_i_n_g _w_e_i_g_h_t _f_o_r _G_E_N_E_C_O_U_N_T_I_N_G

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

     This function is a R port of the GENECOUNTING/PREPARE program
     which takes an array of genotyep data and collapses individuals
     with the same multilocus genotype. This function can also be used
     to prepare for the genotype table in testing Hardy-Weinberg
     equilibrium.

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

     pgc(data,handle.miss=1,is.genotype=0,with.id=0)

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

    data: the multilocus genotype data for a set of individuals

handle.miss: a flag to indicate if missing data is kept, 0 = no, 1 =
          yes

is.genotype: a flag to indicate if the data is already in the form of
          genotype identifiers

 with.id: a flag to indicate if the unique multilocus genotype
          identifier is generated

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

     The returned value is a list containing:

   cdata: the collapsed genotype data

      wt: the frequency weight

  obscom: the observed number of combinations or genotypes

  idsave: optional, available only if with.id = 1

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

     Zhao JH, Sham PC (2003). Generic number system and haplotype
     analysis. Comp Prog Meth Biomed 70:1-9

_N_o_t_e:

     Built on pgc.c

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

     Jing Hua Zhao

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

     'genecounting','hwe.hardy'

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

     ## Not run: 

     data(hla)
     x <- hla[,3:8]

     # do not handle missing data
     y<-pgc(x,handle.miss=0,with.id=1)
     hla.gc<-genecounting(y$cdata,y$wt,handle.miss=0)

     # handle missing but with multilocus genotype identifier
     pgc(x,handle.miss=1,with.id=1)

     # handle missing data with no identifier
     pgc(x,handle.miss=1,with.id=0)
     ## End(Not run)

