genpop            package:adegenet            R Documentation(utf8)

_a_d_e_g_e_n_e_t _f_o_r_m_a_l _c_l_a_s_s (_S_4) _f_o_r _a_l_l_e_l_e _c_o_u_n_t_s _i_n _p_o_p_u_l_a_t_i_o_n_s

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

     An object of class 'genpop' contain alleles counts for several
     loci.
      It contains several components (see 'slots' section).
      Such object is obtained using 'genind2genpop' which converts
     individuals genotypes of known population into a 'genpop' object.
     Note that the function 'summary' of a 'genpop' object returns a
     list of components. Note that as in other S4 classes, slots are
     accessed using @ instead of $.

_S_l_o_t_s:


     '_t_a_b': matrix of alleles counts for each combinaison of population
          -in rows- and alleles -in columns-. Rows and columns are
          given generic names.

     '_l_o_c._n_a_m_e_s': character vector containing the real names of the
          loci

     '_l_o_c._f_a_c': locus factor for the columns of 'tab'

     '_l_o_c._n_a_l_l': integer vector giving the number of alleles per locus

     '_a_l_l._n_a_m_e_s': list having one component per locus, each containing
          a character vector of alleles names

     '_c_a_l_l': the matched call

     '_p_o_p._n_a_m_e_s': character vector containing the real names of the
          populations

     '_p_l_o_i_d_y': an integer indicating the degree of ploidy of the
          genotypes. Beware: 2 is not an integer, but as.integer(2) is.

     '_t_y_p_e': a character string indicating the type of marker: 'codom'
          stands for 'codominant' (e.g. microstallites, allozymes);
          'PA' stands for 'presence/absence' (e.g. AFLP).

     '_o_t_h_e_r': (optional) a list containing other information

_E_x_t_e_n_d_s:

     Class '"gen"', directly. Class '"popInfo"', directly.

_M_e_t_h_o_d_s:


     _n_a_m_e_s 'signature(x = "genpop")': give the names of the components
          of a genpop object

     _p_r_i_n_t 'signature(x = "genpop")': prints a genpop object

     _s_h_o_w 'signature(object = "genpop")': shows a genpop object (same
          as print)

     _s_u_m_m_a_r_y 'signature(object = "genpop")': summarizes a genpop
          object, invisibly returning its content

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

     Thibaut Jombart t.jombart@imperial.ac.uk

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

     'as.genpop', 'is.genpop','makefreq', 'genind', 'import2genind',
     'read.genetix', 'read.genepop', 'read.fstat', 'na.replace'

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

     obj1 <- import2genind(system.file("files/nancycats.gen",
     package="adegenet"))
     obj1

     obj2 <- genind2genpop(obj1)
     obj2

     if(require(ade4)){
     data(microsatt)
     # use as.genpop to convert convenient count tab to genpop
     obj3 <- as.genpop(microsatt$tab)
     obj3

     all(obj3@tab==microsatt$tab)
     all(obj3@pop.names==rownames(microsatt$tab))
     # it worked

     # perform a correspondance analysis
     obj4 <- genind2genpop(obj1,missing="chi2")
     ca1 <- dudi.coa(as.data.frame(obj4@tab),scannf=FALSE)
     s.label(ca1$li,sub="Correspondance Analysis",csub=2)
     add.scatter.eig(ca1$eig,2,xax=1,yax=2,posi="top")
     }

