HWE.test.genind           package:adegenet           R Documentation

_H_a_r_d_y-_W_e_i_n_b_e_r_g _E_q_u_i_l_i_b_r_i_u_m _t_e_s_t _f_o_r _m_u_l_t_i_l_o_c_u_s _d_a_t_a

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

     The function 'HWE.test.genind' performs Hardy-Weinberg Equilibrium
     test on multilocus data (object of class 'genind'). The test
     itself is performed using the function 'HWE.test' of the
     'genetics' package. The output can be of two forms:
      - a list of tests (class 'htest') for each locus-population
     combinaison 
      - a population x locus matrix containing p-values of the tests

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

     HWE.test.genind(x,pop=NULL,permut=FALSE,nsim=1999,hide.NA=TRUE,res.type=c("full","matrix"))

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

       x: an object of class 'genind'.

     pop: a factor giving the population of each individual. If NULL,
          pop is seeked from x$pop.

  permut: a logical passed to 'HWE.test' stating whether Monte Carlo
          version (TRUE) should be used or not (FALSE, default).

    nsim: number of simulations if Monte Carlo is used (passed to
          'HWE.test').

 hide.NA: a logical stating whether non-tested loci (e.g., when an
          allele is fixed) should be hidden in the results (TRUE,
          default) or not (FALSE).

res.type: a character or a character vector whose only first argument
          is considered giving the type of result to display. If
          "full", then a list of complete tests is returned. If
          "matrix", then a matrix of p-values is returned.

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

     Monte Carlo procedure is quiet computer-intensive when large
     datasets are involved. For more precision on the performed test,
     read 'HWE.test' documentation ('genetics' package).

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

     Returns either a list of tests or a matrix of p-values. In the
     first case, each test is designated by locus first and then by
     population. For instance if 'res' is the "full" output of the
     function, then the test for population "PopA" at locus "Myloc" is
     given by res$Myloc$PopA. If 'res' is a matrix of p-values,
     populations are in rows and loci in columns. P-values are given
     for the upper-tail: they correspond to the probability that an
     oberved chi-square statistic as high as or higher than the one
     observed occured under H0 (HWE).


     In all cases, NA values are likely to appear in fixed loci, or
     entirely non-typed loci.

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

     Thibaut Jombart jombart@biomserv.univ-lyon1.fr

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

     'HWE.test','chisq.test'

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

     data(nancycats)
     obj <- nancycats
     if(require(genetics)){
     obj.test <- HWE.test.genind(obj)

     # pvalues matrix to have a preview
     HWE.test.genind(obj,res.type="matrix")

     #more precise view to...
     obj.test$fca90$P10
     }

