\HeaderA{topgenes}{Table of Top Genes from DEDS}{topgenes}
\keyword{htest}{topgenes}
\begin{Description}\relax
\code{topgenes} prints a table of top-ranked genes by
\code{\LinkA{DEDS}{DEDS}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
topgenes(obj, number = 10, genelist = NULL, sort.by = c("deds", colnames(obj$stats[,-1])), tail = c("abs", "lower", "higher"))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{obj}] An object of \code{\LinkA{DEDS}{DEDS}}
\item[\code{number}] A numeric variable specifying the number of top genes to
be printed out.
\item[\code{genelist}] A dataframe or a vector containing gene names.
\item[\code{sort.by}] A character string specifying the name of the
statistic to sort genes by. The default uses the DEDS result, the
user can also choose from the names of the statistics (or unadjusted
p values) that DEDS is used to summarize.
\item[\code{tail}] A character string specifying the type of rejection
region.\\
If \code{side="abs"}, two-tailed tests, genes are ranked by their
absolute values. \\
If \code{side="higher"}, one-tailed tests, genes are ranked
decreasingly. \\
If \code{side="lower"}, one-tailed tests, genes are ranked increasingly.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The function \code{topgenes} accepts a \code{\LinkA{DEDS}{DEDS}} object as
the first argument. The \code{\LinkA{DEDS}{DEDS}} class is a simple
list-based class to store DEDS results. The list contains a "stat"
component, which stores statistics or unadjusted p-values from
various statistical tests. The function \code{topgenes.DEDS} extracts the
"stat" component and prints out the top genes according to the user
defined criterion -- usually by DEDS or by a single statistical
measure that DEDS summarizes.
\end{Details}
\begin{Value}
A dataframe with rows for selected genes, and columns for the
"stat" matrix and q- or adjusted p-values from DEDS.
\end{Value}
\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.linkC}{deds.stat.linkC}}, \code{\LinkA{deds.pval}{deds.pval}}
\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)

# top table, ranked by DEDS
topgenes(d)
# top table, ranked by t
topgenes(d, sort.by="t")
\end{ExampleCode}
\end{Examples}

