\HeaderA{tablesDE}{Save HTML or CSV tables of differentially expressed genes}{tablesDE}
\keyword{methods}{tablesDE}
\begin{Description}\relax
This function takes an object of class \code{\LinkA{maigesDE}{maigesDE}} or
\code{\LinkA{maigesDEcluster}{maigesDEcluster}} generated by functions
\code{\LinkA{deGenes2by2Ttest}{deGenes2by2Ttest}}, \code{\LinkA{deGenes2by2Wilcox}{deGenes2by2Wilcox}},
\code{\LinkA{deGenes2by2BootT}{deGenes2by2BootT}} and \code{\LinkA{deGenesANOVA}{deGenesANOVA}} and save HTML
or CSV tables differentially expressed genes.
\end{Description}
\begin{Usage}
\begin{verbatim}
tablesDE(deComp=NULL, dir="./", filenames=NULL, dataID="Someone's",
         type=c("HTML","CSV")[1], geneID="GeneName", hsID="ClusterId",
         gbID="GeneId", annotID="Annot", genes=NULL, logFold=TRUE,
         adjP="none", sort="p.value", nDEgenes=NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{deComp}] object of class \code{\LinkA{maigesDE}{maigesDE}}.
\item[\code{dir}] character specifying the directory to save the files.
\item[\code{filenames}] character vector with file names to be saved, if NULL
default names are given.
\item[\code{dataID}] character giving an identifier for the dataset. If NULL
the \code{notes} slot from \code{DE.comp} are used.
\item[\code{type}] type of file to be saved. May be 'HTML' (default) or 'CSV'.
\item[\code{geneID}] character giving the ID of label  for gene symbol in the dataset.
\item[\code{hsID}] character giving the ID of label for unigene code in the dataset.
\item[\code{gbID}] character giving the ID of label for Genbank entry in the dataset.
\item[\code{annotID}] character giving the ID of label for gene annotation in
the dataset.
\item[\code{genes}] character vector specifying the genes to be saved, mapped
according to \code{geneID} label.
\item[\code{logFold}] logical specifying if the fold change must be saved in
log2 scale.
\item[\code{adjP}] character string giving the type of p-value
adjustment. May be 'Bonferroni', 'Holm', 'Hochberg', 'SidakSS',
'SidakSD', 'BH', 'BY' or 'none'. Defaults to 'none'.
\item[\code{sort}] character specifying the field to be sorted, may be
'p.value' (default), 'fold' or 'statistic'. 
\item[\code{nDEgenes}] number of differentially genes to be saved in the
file. Defaults to NULL to save all genes. If an integer value the
function saves the \code{nDEgenes} with smaller p-values (most
significantly DE genes). If a number in (0,1) \code{nDEgenes} is
used as a cutoff for the p-values.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
We use the function \code{\LinkA{mt.rawp2adjp}{mt.rawp2adjp}} from package
\emph{multtest} to adjust p-values, any information the methods
implemented must be searched in their help pages. The arguments
\code{hsID}, \code{gbID} and \code{annotID} are used only to improve
the tables generate including links for the respective databases, but
if these information are absent in the dataset they must be specified
as NULL. The argument \code{geneID} must be necessarily specified,
because the genes must be at least one identification.
\end{Details}
\begin{Value}
This function don't return any object.
\end{Value}
\begin{Author}\relax
Gustavo H. Esteves <\email{gesteves@vision.ime.usp.br}>
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{deGenes2by2Ttest}{deGenes2by2Ttest}}, \code{\LinkA{deGenes2by2Wilcox}{deGenes2by2Wilcox}},
\code{\LinkA{deGenes2by2BootT}{deGenes2by2BootT}}, \code{\LinkA{deGenesANOVA}{deGenesANOVA}},
\code{\LinkA{maigesDE}{maigesDE}}, \code{\LinkA{maigesDEcluster}{maigesDEcluster}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Loading the dataset
data(gastro)

## Doing bootstrap from t statistic test fot 'Type' sample label, k=1000
## specifies one thousand bootstraps
gastro.ttest = deGenes2by2Ttest(gastro.summ, sLabelID="Type")

tablesDE(gastro.ttest) ## Save HTML tables

## To save only tables with p-value < 0.05
tablesDE(gastro.ttest, nDEgenes=0.05)

## To save only tables with 30 most significantly genes
tablesDE(gastro.ttest, nDEgenes=30)
\end{ExampleCode}
\end{Examples}

