expectedGenotypes          package:genetics          R Documentation

_C_o_n_s_t_r_u_c_t _e_x_p_e_c_t_e_d _g_e_n_o_t_y_p_e_s/_h_a_p_l_o_t_y_p_e_s _a_c_c_o_r_d_i_n_g _t_o _k_n_o_w_n _a_l_l_e_l_e
_v_a_r_i_a_n_t_s

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

     'expectedGenotypes' constructs expected genotypes according to
     known allele variants, which can be quite tedious with large
     number of allele variants. It can handle different level of
     ploidy.

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

     expectedGenotypes(x, alleles=allele.names(x), ploidy=2, sort=TRUE,
                       haplotype=FALSE)
     expectedHaplotypes(x, alleles=allele.names(x), ploidy=2, sort=TRUE,
                        haplotype=TRUE)

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

       x: genotype or haplotype

 alleles: character, vector of allele names

  ploidy: numeric, number of chromosome sets i.e. 2 for human autosomal
          genes

    sort: logical, sort genotypes according to order of alleles in
          'alleles' argument

haplotype: logical, construct haplotypes i.e. ordered genotype

     At least one of 'x' or 'alleles' must be given.

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

     'expectedHaplotypes()' just calls 'expectedGenotypes()' with
     argument 'haplotype=TRUE'.

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

     A character vector with genotype names as "alele1/alele2" for
     diploid example. Length of output is (n*(n+1))/2 for genotype
     (unordered genotype) and n*n for haplotype (ordered genotype) for
     n allele variants.

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

     Gregor Gorjanc

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

     'allele.names', 'genotype'

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

       ## On genotype
       prp <- c("ARQ/ARQ", "ARQ/ARQ", "ARR/ARQ", "AHQ/ARQ", "ARQ/ARQ")
       alleles <- c("ARR", "AHQ", "ARH", "ARQ", "VRR", "VRQ")
       expectedGenotypes(as.genotype(prp))
       expectedGenotypes(as.genotype(prp, alleles=alleles))
       expectedGenotypes(as.genotype(prp, alleles=alleles, reorder="yes"))

       ## Only allele names
       expectedGenotypes(alleles=alleles)
       expectedGenotypes(alleles=alleles, ploidy=4)

       ## Haplotype
       expectedHaplotypes(alleles=alleles)
       expectedHaplotypes(alleles=alleles, ploidy=4)[1:20]

