setupGeno            package:haplo.stats            R Documentation

_C_r_e_a_t_e _a _g_r_o_u_p _o_f _l_o_c_u_s _o_b_j_e_c_t_s _f_r_o_m _a _g_e_n_o_t_y_p_e _m_a_t_r_i_x, _a_s_s_i_g_n _t_o
'_m_o_d_e_l._m_a_t_r_i_x' _c_l_a_s_s.

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

     The function makes each pair of columns a locus object, which
     recodes alleles to numeric and saves the original alleles as an
     attribute of the model.matrix.

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

     setupGeno(geno, miss.val=c(0,NA), locus.label=NULL)

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

    geno: Matrix of alleles, such that each locus has a pair of
          adjacent columns of alleles, and the order of columns
          corresponds to the order of loci on a chromosome. If there
          are K loci, then ncol(geno) = 2*K. Rows represent alleles for
          each subject. 

miss.val : A vector of codes denoting missing values for allele1 and
          allele2. Note that NA will always be treated as a missing
          value, even if not specified in miss.val.  Also note that if
          multiple missing value codes are specified, the original
          missing value code for a specific individual can not be
          retrieved from the loci object. 

locus.label: vector of labels for the loci 

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

     A 'model.matrix' object with the alleles recoded to numeric
     values, and the original values are stored in the 'unique.alleles'
     attribute. The ith item of the unique.alleles list is a vector of
     unique alleles for the ith locus.

_N_o_t_e:

     A matrix that contains all elements of mode character will be
     sorted in alphabetic order.

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

     locus, loci, haplo.glm

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

     # Create some loci to work with
     a1 <- 1:6
     a2 <- 7:12

     b1 <- c("A","A","B","C","E","D")
     b2 <-c("A","A","C","E","F","G")

     c1 <- c("101","10","115","132","21","112")
     c2 <- c("100","101","0","100","21","110")

     myGeno <- data.frame(a1,a2,b1,b2,c1,c2)
     myGeno <- setupGeno(myGeno)
     myGeno

     attributes(myGeno)$unique.alleles

