geno1to2             package:haplo.stats             R Documentation

_c_o_n_v_e_r_t _g_e_n_o_t_y_p_e _m_a_t_r_i_x _f_r_o_m _1-_c_o_l_u_m_n _2-_c_o_l_u_m_n

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

     convert 1-column genotype matrix to 2-column genotype matrix,
     converting from a minor allele count (0,1,2) to (1/1, 1/2, 2/2)
     where 2 is the minor allele. (not supported for x-linked markers)

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

     geno1to2(geno, locus.label=NULL)

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

    geno: 1-column representation of genotype matrix for 2-allele loci.
           Values are 0, 1, or 2, usually the count of minor alleles 

locus.label : Vector of labels for loci, If a locus name is "A", its
          columns will be "A.1" and "A.2" 

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

     a 2-column genotype matrix

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

     geno1 <- matrix(c(0,0,1,
                       1,0,2,
                       2,1,0), ncol=3, byrow=TRUE)
     geno1to2(geno1, locus.label=c("A", "B", "C"))

     ## demonstrate how NA and 3 will be coded
     geno1[1,3] <- NA
     geno1[1,1] <- 3
     geno1to2(geno1)

