\HeaderA{rankPathways}{Summarizes Top Pathways from Pathway Analyses}{rankPathways}
\keyword{array}{rankPathways}
\keyword{htest}{rankPathways}
\begin{Description}\relax
Summarizes top pathways from pathway analyses.
\end{Description}
\begin{Usage}
\begin{verbatim}
rankPathways(res.A, res.B, G, tab, phenotype, gsList, ngroups,
             methodNames = NULL, npath = 25, allpathways = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{res.A}] a list from the output of \code{calculate.NTk} or
\code{calculate.NEk}
\item[\code{res.B}] a list from the output of \code{calculate.NTk} or
\code{calculate.NEk}
\item[\code{G}] a list containing the source, title, and probe sets
associated with each curated pathway
\item[\code{tab}] a numeric matrix of expression values, with the rows and
columns representing probe sets and sample arrays, respectively
\item[\code{phenotype}] a numeric (or character if \code{ngroups} >= 2)
vector indicating the phenotype
\item[\code{gsList}] a list containing three vectors from the output of
the \code{selectGeneSets} function
\item[\code{ngroups}] an integer indicating the number of groups in the
matrix
\item[\code{methodNames}] a character vector of length 2 giving the names for
\code{res.A} and \code{res.B}
\item[\code{npath}] an integer indicating the number of top gene sets to
consider from each statistic when ranking the top pathways
\item[\code{allpathways}] a boolean to indicate whether to include the top
\code{npath} pathways from each statistic or just consider the top
\code{npath} pathways (sorted by the sum of ranks of both statistics) when
generating the summary table
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function ranks together the statistics given in \code{res.A} and
\code{res.B} and summarizes the top gene sets in a tabular format similar to
Table 2 in Tian et al. (2005)
\end{Details}
\begin{Value}
A data frame showing the pathways' indices in \code{G}, gene set
category, pathway title, set size, \code{res.A}'s statistics,
\code{res.B}'s statistics, the corresponding q-values, and the ranks for the
top gene sets.
\end{Value}
\begin{Note}\relax
See the help page for \code{calculate.NTk} or \code{calculate.NEk}
for example code that uses \code{rankPathways}
\end{Note}
\begin{Author}\relax
Lu Tian, Peter Park, and Weil Lai
\end{Author}
\begin{References}\relax
Tian L., Greenberg S.A., Kong S.W., Altschuler J., Kohane I.S., Park
P.J. (2005)  Discovering statistically significant pathways in
expression profiling studies.  \emph{Proceedings of the National
Academy of Sciences of the USA}, \bold{102}, 13544-9.

\url{http://www.pnas.org/cgi/doi/10.1073/pnas.0506577102}
\end{References}

