genind               package:adegenet               R Documentation

_a_d_e_g_e_n_e_t _c_l_a_s_s _f_o_r _i_n_d_i_v_i_d_u_a_l _g_e_n_o_t_y_p_e_s

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

     The objects of class 'genind' contain individual genotypes.
      It consists in a list with several components (see value
     section).
      The function 'genind2genpop' converts individuals genotypes of
     known population into a 'genpop' object.
      The 'summary' of a 'genind' object invisibly returns a list of
     components (see value section).  The function 'as.genind' is
     called by import functions (see 'import2genind').

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

     is.genind(x)
     as.genind(tab=NULL,pop=NULL,prevcall=NULL)
     print.genind(x,...)
     summary.genind(object,...)
     genind2genpop(x,pop=NULL,missing=NA,quiet=FALSE)

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

       x: an object of class 'genind'.

     tab: a individuals x alleles matrix of genotypes coded as allelic
          frequencies.

     pop: a factor giving the population of each genotype in 'x'. If
          note provided, seeked in x$pop, but if given, the argument
          prevails on x$pop.

prevcall: call of an object, for internal use.

     ...: other -unused- arguments

  object: an object of class 'genind'.

 missing: can be NA, 0, or "replace". See details for more information.

   quiet: logical stating whether a conversion message must be printed
          (TRUE,default) or not (FALSE).

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

     The values of the 'missing' argument in 'genind2genpop' have the
     following effects:
      - NA: if all genotypes of a population for a given allele are
     missing, count value will be NA
      - 0: if all genotypes of a population for a given allele are
     missing, count value will be 0
      - "replace": when an allele is not typed in a population, it is
     assigned an allele count so that the allelic frequency in this
     populations is the same as the frequency in the whole dataset.
      If allele 'j' of locus 'k' in pop 'i' is missing, the count value
     is number 'x' so that the frequency 'x/s' ('s' being the number of
     observations in 'k' ) equals the frequency 'f' computed on the
     whole data (i.e. considering all pop as one)
      Then x verifies:

                      x/s = f(1-f) => x=f(1-f)s

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

     tab: matrix of genotypes -in rows- for all alleles -in columns-.
          Values are frequency: '0' if the genotype does not have the
          corresponding allele, '1' for an homozygote and 0.5 for an
          heterozygte.Rows and columns are given generic names.

ind.names: character vector containing the real names of the
          individuals. Note that as Fstat does not store these names,
          objects converted from .dat files will contain empty
          'ind.names'.

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

     pop: (optional) factor giving the population of each individual

pop.names: (optional) vector giving the real names of the populations

       N: (summary) total number of genotypes.

 pop.eff: (summary) populations sample size.

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

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

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

    Hobs: (summary) observed heterozygosity.

    Hexp: (summary) expected heterozygosity.

_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:

     'genpop', 'import2genind', 'genetix2genind',  'genepop2genind',
     'fstat2genind'

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

     obj <- genetix2genind(system.file("files/nancycats.gtx",package="adegenet"),missing="mean")
     is.genind(obj)
     summary(obj)
     obj

     # test inter-colonies structuration
     if(require(hierfstat)){
     gtest <- gstat.randtest(obj,nsim=99)
     gtest
     plot(gtest)
     }

     # perform an inter-class PCA
     if(require(ade4)){
     pca1 <- dudi.pca(obj$tab,scannf=FALSE,scale=FALSE)
     pcabet1 <- between(pca1,obj$pop,scannf=FALSE)
     pcabet1

     s.class(pcabet1$ls,obj$pop,sub="Inter-class PCA",possub="topleft",csub=2)
     add.scatter.eig(pcabet1$eig,2,xax=1,yax=2)
     }

