\HeaderA{qqnorm-methods}{Normal Q-Q Plot for DEDS Objects}{qqnorm.Rdash.methods}
\aliasA{qqnorm}{qqnorm-methods}{qqnorm}
\aliasA{qqnorm.DEDS}{qqnorm-methods}{qqnorm.DEDS}
\keyword{hplot}{qqnorm-methods}
\begin{Description}\relax
The function \code{qqnorm.DEDS} produces normal Quantile-Quantile
plots of statistics for \code{\LinkA{DEDS-class}{DEDS.Rdash.class}} objects. The points
corresponding to genes with DEDS q- or adjusted p-values less than
a user defined threshold are highlighted.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'DEDS':
qqnorm(y, subset=c(1:nrow(y$stats)),
xlab = "Quantiles of standard normal", thresh = 0.05, col = palette(), pch, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{y}] An object of \code{\LinkA{DEDS}{DEDS}}, produced by
\code{\LinkA{deds.stat.linkC}{deds.stat.linkC}} or \code{\LinkA{deds.stat}{deds.stat}}.
\item[\code{subset}] A numeric vector indicating the subset of points to be plotted.
\item[\code{xlab}] A title for the x axis
\item[\code{thresh}] A numeric variable specifying the threshold of
significance in differential expression (DE) for q- or 
p-values of the DEDS object.
\item[\code{col}] A specificatio for the colors to be used for plotting. It
should have a length bigger than two. The first is used for points
with q- or adjusted p-values smaller than the specified threshould
(group I) and the second for points with q- or adjusted p-values
bigger than the threshould (group II).
\item[\code{pch}] A specification for the type of points to be used for
plotting.  It should have a length bigger than two. The first
parameter is used for group I genes, and the second for group II
genes.
\item[\code{...}] Extra parameters for plotting.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The function \code{qqnorm.DEDS} implements a S3 method of
\code{\LinkA{qqnorm}{qqnorm}} for \code{\LinkA{DEDS}{DEDS}}. The \code{\LinkA{DEDS}{DEDS}}
class is a simple list-based class to store DEDS results and
\code{qqnorm.DEDS} is used for a DEDS object that is created  by
functions \code{\LinkA{deds.stat}{deds.stat}}, \code{\LinkA{deds.stat.linkC}{deds.stat.linkC}}. The
list contains a "stat" component, which stores statistics from
various statistical tests. The function \code{qqnorm.DEDS} extracts the
"stat" component and produces a normal QQ plot for each type of
statistics. \code{qqnorm.DEDS} as a default highlights points
(corresponding to genes) with DEDS adjusted p- or q-values less than
a user defined threshold.

For DEDS objects that are created by the function
\code{\LinkA{deds.pval}{deds.pval}}, the "stat" matrix consists of unadjusted
p-values from different statistical models. For graphical display of
these p values, the user can use \code{\LinkA{hist.DEDS}{hist.DEDS}} and
\code{\LinkA{pairs.DEDS}{pairs.DEDS}}.
\end{Details}
\begin{Author}\relax
Yuanyuan Xiao, \email{yxiao@itsa.ucsf.edu}, \\
Jean Yee Hwa Yang, \email{jean@biostat.ucsf.edu}.
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{deds.stat}{deds.stat}}, \code{\LinkA{deds.pval}{deds.pval}},
\code{\LinkA{deds.stat.linkC}{deds.stat.linkC}}, \code{\LinkA{hist.DEDS}{hist.DEDS}},
\code{\LinkA{qqnorm.DEDS}{qqnorm.DEDS}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
X <- matrix(rnorm(1000,0,0.5), nc=10)
L <- rep(0:1,c(5,5))

# genes 1-10 are differentially expressed
X[1:10,6:10]<-X[1:10,6:10]+1
# DEDS summarizing t, fc and sam
d <- deds.stat.linkC(X, L, B=200)

# qqnorm for t, fc and sam
qqnorm(d)
# change points color
qqnorm(d, col=c(2,3))
# change points type
qqnorm(d, pch=c(1,2))
\end{ExampleCode}
\end{Examples}

