genpop               package:adegenet               R Documentation

_a_d_e_g_e_n_e_t _c_l_a_s_s _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:

     The objects of class 'genpop' contain alleles counts for several
     loci.
      It consists in a list with several components (see value
     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.

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

     is.genpop(x)
     as.genpop(tab = NULL, prevcall = NULL)
     print.genpop(x,...)
     summary.genpop(object,...)

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

       x: an object of class 'genpop'.

     tab: a populations x alleles matrix of allele counts.

prevcall: call of an object, for internal use.

     ...: other -unused- arguments

  object: an object of class 'genpop'.

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

     tab: matrix of alleles counts for each combinaison of population
          -in rows- and alleles -in columns-. Rows and columns are
          given generic names.

pop.names: character vector containing the real names of the
          populations

loc.names: character vector containing the real names of the loci

loc.nall: integer vector giving the number of alleles per locus

 loc.fac: locus factor for the columns of 'tab'

all.names: list having one component per locus, each containing a
          character vector of alleles names

    call: the matched call

    npop: (summary) number of populations.

loc.nall: (summary) number of alleles per locus.

pop.nall: (summary) number of alleles per population.

 NA.perc: (summary) percentage of - appearing - missing data.

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

     Thibaut Jombart jombart@biomserv.univ-lyon1.fr

_R_e_f_e_r_e_n_c_e_s:

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

     'makefreq', 'genind', 'import2genind', 'genetix2genind', 
     'genepop2genind', 'fstat2genind'

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

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

     obj2 <- genind2genpop(obj1)
     is.genpop(obj2)
     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="replace")
     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")
     }

