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)
       }

