import               package:adegenet               R Documentation

_C_o_n_v_e_r_s_i_o_n _f_u_n_c_t_i_o_n _f_o_r _a_d_e_g_e_n_e_t

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

     The function 'import2genind' detects the extension of the file
     given in argument and seeks for an appropriate import function to
     create a 'genind' object.
      Current functions are :
      - 'genetix2genind' for GENETIX files (.gtx). Note that this
     function is called by the others. 
      - 'genepop2genind' for Genepop files (.gen) 
      - 'fstat2genind' for Fstat files '.dat' 

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

     import2genind(file,missing=NA,quiet=FALSE)
     genetix2genind(file=NULL,X=NULL,pop=NULL,missing=NA,quiet=FALSE)
     genepop2genind(file,missing=NA,quiet=FALSE)
     fstat2genind(file,missing=NA,quiet=FALSE)

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

    file: a character string giving the path to the file to convert,
          with the appropriate extension.

 missing: can be NA, 0 or "mean". See details section.

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

       X: if file is not provided, 'genetix2genind' can be used on a
          data frame with genotypes in GENETIX format (e.g. "080082"
          for an heterozygote with alleles 80 and 82); individuals are
          in rows, loci are in columns. Missing values are coded as
          "000000".

     pop: an optional factor giving the population of each genotype in
          'x'. 

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

     There are 3 treatments for missing values: 
      - NA: kept as NA. 
      - 0: missing values are considered as zero. Recommended for a PCA
     on compositionnal data. 
      - "mean": missing values are given the mean frequency of the
     corresponding allele. Recommended for a centred PCA.

     Beware: same data in different formats are not expected to produce
     the exactly the same 'genind' objects.
      For instance, conversions made by GENETIX to Fstat may change the
     the sorting of the genotypes; GENETIX stores individual names
     whereas Fstat does not; Genepop chooses a sample's name from the
     name of its last genotype; etc.

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

     an object of the class 'genind'

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

     Thibaut Jombart jombart@biomserv.univ-lyon1.fr

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

     Belkhir K., Borsa P., Chikhi L., Raufaste N. & Bonhomme F.
     (1996-2004) GENETIX 4.05, logiciel sous Windows TM pour la
     génétique des populations. Laboratoire Génome, Populations,
     Interactions, CNRS UMR 5000, Université de Montpellier II,
     Montpellier (France). 

     Raymond M. & Rousset F, (1995). GENEPOP (version 1.2): population
     genetics software for exact tests and ecumenicism. _J. Heredity_,
     *86*:248-249 

     Fstat (version 2.9.3). Software by Jerome Goudet.
     http://www2.unil.ch/popgen/softwares/fstat.htm

     Excoffier L. & Heckel G.(2006) Computer programs for population
     genetics data analysis: a survival guide _Nature_, *7*: 745-758

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

     'read.fstat.data'

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

     genetix2genind(system.file("files/nancycats.gtx",package="adegenet"))

     fstat2genind(system.file("files/nancycats.dat",package="adegenet"))

     genepop2genind(system.file("files/nancycats.gen",package="adegenet"))

     import2genind(system.file("files/nancycats.gtx",
     package="adegenet"))

     if(require(hierfstat)){
     obj <- fstat2genind(system.file("data/diploid.dat",package="hierfstat"))
     obj
     }

