\HeaderA{readGenes}{Import genetic data from standard file formats}{readGenes}
\aliasA{genotypeFileFormats}{readGenes}{genotypeFileFormats}
\aliasA{markerFileFormats}{readGenes}{markerFileFormats}
\aliasA{phenotypeFileFormats}{readGenes}{phenotypeFileFormats}
\keyword{misc}{readGenes}
\begin{Description}\relax
Import genetic data from standard file formats.
\end{Description}
\begin{Usage}
\begin{verbatim}
readGenes(gfile, gformat=genotypeFileFormats,  goptions=list(),
          pfile, pformat=phenotypeFileFormats, poptions=list(),
          mfile, mformat=markerFileFormats,    moptions=list() )
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{gfile}] File containing genotype data
\item[\code{gformat}] Function, function name, or a character file format
specification from the list \code{genotypeFileFormats}.
\item[\code{goptions}] Optional arguments for loading genotype data.
\item[\code{pfile}] File containing phenotype data
\item[\code{pformat}] Function, function name, or a character file format
specification from the list \code{phenotypeFileFormats}.
\item[\code{poptions}] Optional arguments for loading phenotype data.
\item[\code{mfile}] File containing marker data
\item[\code{mformat}] Function, function name, or a character file format
specification from the list \code{markerFileFormats}.
\item[\code{moptions}] Optional arguments for loading marker data.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
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.
\end{Details}
\begin{Value}
An object of class geneSet.
\end{Value}
\begin{Note}\relax
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.
\end{Note}
\begin{Author}\relax
Gregory R. Warnes \email{warnes@bst.rochester.edu}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{read.table}{read.table}}, etc
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

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

\end{ExampleCode}
\end{Examples}

