readGenes            package:GeneticsBase            R Documentation

_I_m_p_o_r_t _g_e_n_e_t_i_c _d_a_t_a _f_r_o_m _s_t_a_n_d_a_r_d _f_i_l_e _f_o_r_m_a_t_s

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

     Import genetic data from standard file formats.

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

     readGenes(gfile, gformat=genotypeFileFormats,  goptions=list(),
               pfile, pformat=phenotypeFileFormats, poptions=list(),
               mfile, mformat=markerFileFormats,    moptions=list() )

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

   gfile: File containing genotype data

 gformat: Function, function name, or a character file format
          specification from the list 'genotypeFileFormats'.

goptions: Optional arguments for loading genotype data.

   pfile: File containing phenotype data

 pformat: Function, function name, or a character file format
          specification from the list 'phenotypeFileFormats'.

poptions: Optional arguments for loading phenotype data.

   mfile: File containing marker data

 mformat: Function, function name, or a character file format
          specification from the list 'markerFileFormats'.

moptions: Optional arguments for loading marker data.

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

     Load genotype and (optionally) phenotype and marker information
     from the specified files and generate a geneSet object containing
     the results.

     A variety of file formats are available.  See the variables
     'genotypeFileFormats', 'phenotypeFileFormats',
     'phenotypeFileFormats' for formats.

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

     An object of class geneSet.

_N_o_t_e:

     Adding a new genotype (phenotype) file format requires creation of
     a function named 'readGenes.newformat' ('read.newformat') and
     adding the string "newformat" to the vector 'genotypeFileFormats'
     ('phenotypeFileFormats').

     Please submit new format functions to the authors for inclusion in
     the package.

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

     Gregory R. Warnes warnes@bst.rochester.edu

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

     'read.table', etc

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

     # Perlegen data set (if we have access to it)
     # (189K SNPS x 1008 patients)
     path <- "~/clingen/Perlegen_Metabolic_Disorder/Data"
     fname <- file.path(path,"PFZ_03/genotype.txt.gz")
     if(file.exists(fname))
       {
         genef   <- gzfile(fname) # open the gzip compressed SNP file
         #phenof  <- 
         markerf <-file.path(path,"PFZ_03/snp_info.txt")
      
         pgdata <- readGenes(gfile=genef, gformat="perlegen",
                             mfile=markerf, mformat="table",
                             moptions=list(sep="\t",header=TRUE))
         close(genef)
       }

