\HeaderA{racExSet-class}{Class "racExSet" for combining RareAlleleCount representations
of SNPs, gene expression data, and other phenotype data}{racExSet.Rdash.class}
\aliasA{chr20GGdem}{racExSet-class}{chr20GGdem}
\aliasA{exclMono}{racExSet-class}{exclMono}
\aliasA{exprs,racExSet-method}{racExSet-class}{exprs,racExSet.Rdash.method}
\aliasA{genesym}{racExSet-class}{genesym}
\aliasA{genesym-class}{racExSet-class}{genesym.Rdash.class}
\aliasA{getpsid}{racExSet-class}{getpsid}
\aliasA{gse2031GG}{racExSet-class}{gse2031GG}
\aliasA{hgfocusSYMMEMO}{racExSet-class}{hgfocusSYMMEMO}
\aliasA{initialize,racExSet-method}{racExSet-class}{initialize,racExSet.Rdash.method}
\aliasA{litex}{racExSet-class}{litex}
\aliasA{litsn}{racExSet-class}{litsn}
\aliasA{mgu74av2SYMMEMO}{racExSet-class}{mgu74av2SYMMEMO}
\aliasA{oneFit}{racExSet-class}{oneFit}
\aliasA{oneFit,racExSet,character,character,function-method}{racExSet-class}{oneFit,racExSet,character,character,function.Rdash.method}
\aliasA{oneFit,racExSet,genesym,character,function-method}{racExSet-class}{oneFit,racExSet,genesym,character,function.Rdash.method}
\aliasA{oneFit,racExSet,list,character,function-method}{racExSet-class}{oneFit,racExSet,list,character,function.Rdash.method}
\aliasA{oneFit,racExSet,list,formula,function-method}{racExSet-class}{oneFit,racExSet,list,formula,function.Rdash.method}
\aliasA{oneFit,racExSet-method}{racExSet-class}{oneFit,racExSet.Rdash.method}
\aliasA{pdd}{racExSet-class}{pdd}
\aliasA{racAssays}{racExSet-class}{racAssays}
\aliasA{racAssays,racExSet-method}{racExSet-class}{racAssays,racExSet.Rdash.method}
\aliasA{racExSet}{racExSet-class}{racExSet}
\aliasA{rarebase}{racExSet-class}{rarebase}
\aliasA{rarebase,racExSet-method}{racExSet-class}{rarebase,racExSet.Rdash.method}
\aliasA{show,racExSet-method}{racExSet-class}{show,racExSet.Rdash.method}
\aliasA{SNPalleles}{racExSet-class}{SNPalleles}
\aliasA{SNPalleles,racExSet-method}{racExSet-class}{SNPalleles,racExSet.Rdash.method}
\aliasA{snpID}{racExSet-class}{snpID}
\aliasA{snpID-class}{racExSet-class}{snpID.Rdash.class}
\aliasA{snpNames}{racExSet-class}{snpNames}
\aliasA{snpNames,racExSet-method}{racExSet-class}{snpNames,racExSet.Rdash.method}
\aliasA{snps,racExSet-method}{racExSet-class}{snps,racExSet.Rdash.method}
\aliasA{snps3PrimeTo}{racExSet-class}{snps3PrimeTo}
\aliasA{snps5PrimeTo}{racExSet-class}{snps5PrimeTo}
\aliasA{snpsNear}{racExSet-class}{snpsNear}
\aliasA{[,racExSet,ANY,ANY,ANY-method}{racExSet-class}{[,racExSet,ANY,ANY,ANY.Rdash.method}
\aliasA{[,racExSet-method}{racExSet-class}{[,racExSet.Rdash.method}
\aliasA{[,snpMeta,ANY,ANY,ANY-method}{racExSet-class}{[,snpMeta,ANY,ANY,ANY.Rdash.method}
\keyword{classes}{racExSet-class}
\begin{Description}\relax
A container for combining RareAlleleCount representations 
of SNPs, gene expression data, and other phenotype data
\end{Description}
\begin{Section}{Objects from the Class}
Objects can be created by calls of the form \code{new("racExSet", phenoData, experimentData, annotation, exprs, racs, ...)}.
\end{Section}
\begin{Section}{Slots}
\describe{
\item[\code{racAssays}:] Object of class \code{"AssayData"} SxN matrix
of 0, 1, 2, or NA, rownames are RS numbers from dbSNP, column names
are sampleNames 
\item[\code{assayData}:] Object of class \code{"AssayData"} GxN matrix
of expression values 
\item[\code{rarebase}:] character vector of length G stating the
rare base of the SNP
\item[\code{SNPalleles}:] character vector of length G stating the
alleles in the form "A/B"
\item[\code{phenoData}:] Object of class \code{"AnnotatedDataFrame"} standard
phenoData instance 
\item[\code{experimentData}:] Object of class \code{"MIAME"} experiment
level metadata 
\item[\code{annotation}:] Object of class \code{"character"} tag 
\item[\code{.\_\_classVersion\_\_}:] Object of class \code{"Versions"} R class version
control metadata
}
\end{Section}
\begin{Section}{Extends}
Class \code{"eSet"}, directly.
Class \code{"VersionedBiobase"}, by class \code{"eSet"}.
Class \code{"Versioned"}, by class \code{"eSet"}.
\end{Section}
\begin{Section}{Methods}
\describe{
\item[snps] \code{signature(x = "racExSet")}: accessor for the
racAssay matrix 
\item[snpNames] \code{signature(x = "racExSet")}: give RS numbers
for rows of racAssay matrix 
\item[racAssays] \code{signature(x = "racExSet")}: accessor for the
racAssays slot
\item[oneFit] \code{signature(racExSet = "racExSet", geneid = "genesym", snpid = "character", fitfun = "function")}: use a genesym instance (e.g.,
\code{genesym("DDR1")} to identify the expression values,
an rs number to identify the snp genotype information, and
fitfun to fit a model with expression as dependent variable and
genotype (rare allele counts) as predictor.  Any fitting
function accepting a formula and data frame should succeed (e.g., \code{lm}). 
\item[oneFit] \code{signature(racExSet = "racExSet", geneid = "character", snpid = "character", fitfun = "function")}: as above, but can avoid the lookup of the
gene symbol by supplying the probe set identifier directly.  This is
problematic at present as most probe set identifier strings are not
valid R variable names, and so cannot serve directly in the formula.
Some backtick coding is needed to get this to work generally. 
\item[oneFit] \code{signature(racExSet = "racExSet", geneid = "list", snpid = "character", fitfun = "function")}: the \code{geneid} parameter must
be a named list of length one with content a numeric vector of
expression values conforming to the snp values.  Avoids lookup
of gene name and of expression values.
\item[oneFit] \code{signature(racExSet = "racExSet", geneid = "list" , snpid="formula", fitfun="function")}: the \code{geneid} parameter must be bound to a named list of length 1
with content a numeric vector
with one element per sample; the name of the list element is the gene symbol on
which the numeric vector is a vector of expression values; the
\code{snpid} parameter is bound to a formula template, either
\code{\textasciitilde{}.} or \code{\textasciitilde{}factor(.)} expressing choice between an additive
genetic model and a general model.
}
\end{Section}
\begin{Section}{Notes}
Helper functions \code{SNPalleles}
and \code{rarebase} are accessors.  \code{snps5PrimeTo(gene,rad)}
will obtain rs numbers for SNPs in selected locations
relative to the specified gene.  \code{snps3PrimeTo} and \code{snpsNear}
have similar purposes.
\end{Section}
\begin{Note}\relax
The \code{genesym} class works in conjunction
with annotation to allow translation from HUGO symbols
to affy probe set names according to Bioconductor 
annotation environments.  The \code{getpsid} function
carries out the translation; the \code{genesym} class/wrapper
just tells us that a string will be serving the role of
a HUGO symbol and allows us to dispatch accordingly.  The
\code{snpID} class has similar role.  It just lets us
know that a string is intended to be regarded as an rs number.

\code{hgfocusSYMMEMO} is a lookup table quickly establishing
the probeset ID based on a HUGO symbol; likewise mgu74av2SYMMEMO.

\code{chr20GGdem} is a demonstration example of chromosome
20 hapmap snps and hgfocus expression data from GEO as generated by Cheung and colleagues.

\code{gse2031GG} is a demonstration example of BXD mouse
snps and mgu74av2 expression data from GSE2031 in GEO.

The \code{exclMono} function eliminates loci that happen to be monomorphic in the sample.
\end{Note}
\begin{Author}\relax
VJ Carey <stvjc@channing.harvard.edu>
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{make\_racExSet}{make.Rul.racExSet}} for construction; \code{\LinkA{eSet}{eSet}} ancestor
class
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
example(make_racExSet)
dem
snpNames(dem)[1:4]
featureNames(dem)[1:4]
oneFit(dem, genesym("DDR1"), "rs4814683", lm)
ddr1 = list(DDR1=exprs(dem)["1007_s_at",])
oneFit(dem, ddr1, "rs4814683", aov)
data(chr20GGdem)
ddr1 = list(DDR1=exprs(chr20GGdem)["1007_s_at",])
summary(oneFit(chr20GGdem, ddr1, ~rs4814683+factor(rs6060535), lm))
dim(snps(chr20GGdem))
dim(snps(exclMono(chr20GGdem)))
\end{ExampleCode}
\end{Examples}

