\HeaderA{hierM}{Function to do hierarchical cluster analysis}{hierM}
\keyword{hplot}{hierM}
\begin{Description}\relax
This is a function to do hierarchical clustering
analysis for objects of classes \code{\LinkA{maiges}{maiges}},
\code{\LinkA{maigesRaw}{maigesRaw}} and \code{\LinkA{maigesANOVA}{maigesANOVA}}. Use the
function \code{\LinkA{hierMde}{hierMde}} for objects of class
\code{\LinkA{maigesDEcluster}{maigesDEcluster}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
hierM(data, group=c("C", "R", "B")[1], distance="correlation",
      method="complete", doHeat=TRUE, sLabelID="SAMPLE",
      gLabelID="GeneName", rmGenes=NULL, rmSamples=NULL,
      rmBad=TRUE, geneGrp=NULL, path=NULL, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{data}] object of class \code{\LinkA{maigesRaw}{maigesRaw}}, \code{\LinkA{maiges}{maiges}},
\code{\LinkA{maigesANOVA}{maigesANOVA}} or \code{\LinkA{maigesDEcluster}{maigesDEcluster}}.
\item[\code{group}] character string giving the type of grouping: by rows
'R', columns 'C' (default) or both 'B'.
\item[\code{distance}] char string giving the type of distance to use. Here we
use the function \code{\LinkA{Dist}{Dist}} and the possible values
are 'euclidean', 'maximum', 'manhattan', 'canberra', 'binary',
'pearson', 'correlation' (default) and 'spearman'.
\item[\code{method}] char string specifying the linkage method for the
hierarchical cluster. Possible values are 'ward', 'single',
'complete' (default), 'average', 'mcquitty', 'median' or 'centroid'
\item[\code{doHeat}] logical indicating to do or not the heatmap. If FALSE,
only the dendrogram is displayed.
\item[\code{sLabelID}] character string specifying the sample label ID to be
used to label the samples.
\item[\code{gLabelID}] character string specifying the gene label ID to be
used to label the genes.
\item[\code{rmGenes}] char list specifying genes to be removed.
\item[\code{rmSamples}] char list specifying samples to be removed.
\item[\code{rmBad}] logical indicating to remove or not bad spots (slot
\code{BadSpots} in objects of class \code{\LinkA{maiges}{maiges}},
\code{\LinkA{maigesRaw}{maigesRaw}} or \code{\LinkA{maigesANOVA}{maigesANOVA}}).
\item[\code{geneGrp}] numerical or character specifying the gene group to be
clustered. This is given by the columns of the slot \code{GeneGrps}
in objects of classes \code{\LinkA{maiges}{maiges}}, \code{\LinkA{maigesRaw}{maigesRaw}}
and \code{\LinkA{maigesANOVA}{maigesANOVA}}.
\item[\code{path}] numerical or character specifying the gene network to be
clustered. This is given by the items of the slot \code{Paths}
in objects of classes \code{\LinkA{maiges}{maiges}}, \code{\LinkA{maigesRaw}{maigesRaw}}
and \code{\LinkA{maigesANOVA}{maigesANOVA}}.
\item[\code{...}] additional parameters for \code{\LinkA{heatmap}{heatmap}} function.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function implements the hierarchical clustering method for
objects of microarray data defined in this package. The default
function for hierarchical clustering is the
\code{\LinkA{hclust}{hclust}}.
\end{Details}
\begin{Value}
This function display the heatmaps and don't return any object or value.
\end{Value}
\begin{Author}\relax
Gustavo H. Esteves <\email{gesteves@vision.ime.usp.br}>
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{somM}{somM}} and \code{\LinkA{kmeansM}{kmeansM}} for displaying SOM and
k-means clusters, respectively.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Loading the dataset
data(gastro)

## Doing a hierarchical cluster using all genes, for maigesRaw class
hierM(gastro.raw, rmGenes=c("BLANK","DAP","LYS","PHE", "Q_GENE","THR","TRP"),
      sLabelID="Sample", gLabelID="Name", doHeat=FALSE)

## Doing a hierarchical cluster using all genes, for maigesNorm class
hierM(gastro.norm, rmGenes=c("BLANK","DAP","LYS","PHE", "Q_GENE","THR","TRP"),
      sLabelID="Sample", gLabelID="Name", doHeat=FALSE)

## If you want to show the heatmap do
hierM(gastro.norm, rmGenes=c("BLANK","DAP","LYS","PHE", "Q_GENE","THR","TRP"),
      sLabelID="Sample", gLabelID="Name", doHeat=TRUE)

## If you want to show the hierarchical branch in both margins do
hierM(gastro.summ, rmGenes=c("BLANK","DAP","LYS","PHE", "Q_GENE","THR","TRP"),
      sLabelID="Sample", gLabelID="Name", doHeat=TRUE, group="B")

## If you want to use euclidean distance only into rows (spots or genes)
hierM(gastro.summ, rmGenes=c("BLANK","DAP","LYS","PHE", "Q_GENE","THR","TRP"),
      sLabelID="Sample", gLabelID="Name", doHeat=FALSE, group="R", distance="euclidean")
\end{ExampleCode}
\end{Examples}

