\name{readGenes} \alias{readGenes} \alias{genotypeFileFormats} \alias{phenotypeFileFormats} \alias{markerFileFormats} \title{Import genetic data from standard file formats} \description{ Import genetic data from standard file formats. } \usage{ readGenes(gfile, gformat=genotypeFileFormats, goptions=list(), pfile, pformat=phenotypeFileFormats, poptions=list(), mfile, mformat=markerFileFormats, moptions=list() ) } \arguments{ \item{gfile}{File containing genotype data} \item{gformat}{Function, function name, or a character file format specification from the list \code{genotypeFileFormats}.} \item{goptions}{Optional arguments for loading genotype data.} \item{pfile}{File containing phenotype data} \item{pformat}{Function, function name, or a character file format specification from the list \code{phenotypeFileFormats}.} \item{poptions}{Optional arguments for loading phenotype data.} \item{mfile}{File containing marker data} \item{mformat}{Function, function name, or a character file format specification from the list \code{markerFileFormats}.} \item{moptions}{Optional arguments for loading marker data.} } \details{ 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 \code{genotypeFileFormats}, \code{phenotypeFileFormats}, \code{phenotypeFileFormats} for formats. } \value{ An object of class geneSet. } \author{Gregory R. Warnes \email{warnes@bst.rochester.edu} } \note{ Adding a new genotype (phenotype) file format requires creation of a function named \code{readGenes.newformat} (\code{read.newformat}) and adding the string "newformat" to the vector \code{genotypeFileFormats} (\code{phenotypeFileFormats}). Please submit new format functions to the authors for inclusion in the package. } \seealso{\code{\link{read.table}}, etc} \examples{ # 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) } } \keyword{misc}