\name{clusterDist}
\alias{clusterDist}
\title{ clusterDist }
\description{
  Clustering analysis based on a distance matrix. 
}
\usage{
clusterDist(x, distMatrix, clusterFun='hclust', ...)
}
\arguments{
  \item{x}{An \code{imageHTS} object. }
  \item{distMatrix}{A pair-wise distance matrix or a \code{dist} object. }
  \item{clusterFun}{A character string defining the cluster function.}
  \item{...}{Additional arguments to be passed to the cluster function. }
}
\details{
  This function performs a clustering analysis based on a pair-wise distance matrix such as generated by \code{PDMBySvmAccuracy}.
  
}
\value{
  The return from the cluster function, such as an \code{hclust} object returned from the \code{hclust} function.
}

\seealso{\code{hclust}, \code{PDMBySvmAccuracy}}

\author{Xian Zhang}

\examples{

  library('phenoDist')

  ## load the imageHTS object
  load(system.file('kimorph', 'kimorph.rda', package='phenoDist'))
  x@localPath <- file.path(tempdir(), 'kimorph')

  ## load sample phenotypic distance matrix
  load(system.file('kimorph', 'svmAccPDM_Pl1.rda', package='phenoDist'))

  ## phenotypic clustering
  phenoCluster <- clusterDist(x, distMatrix=svmAccPDM_Pl1, clusterFun='hclust', method='ward')

  \dontrun{
  require('GOstats')
  GOEnrich <- enrichAnalysis(x, cl=cutree(phenoCluster, k=5), terms='GO', annotation='org.Hs.eg.db', pvalueCutoff=0.01, testDirection='over', ontology='BP', conditional=TRUE)
    }
}