\name{plotHeatmap}
\alias{plotHeatmap}
\title{A function to generate heatmap panels sorted by integrated cluster assignment.}
\description{
  A function to generate heatmap panels sorted by integrated cluster assignment.
}
\usage{
plotHeatmap(fit, xList, type=c("gaussian","binomial","poisson","multinomial"), sample.order=NULL, feature.order=NULL, 
            dist.method = "euclidean", hclust.method="ward.D",sparse=NULL, threshold=rep(0.25,length(xList)), 
            feature.scale=rep(F,length(xList)), col.scheme=rep(list(bluered(256)),length(xList)), width=5,
            chr=NULL, plot.chr=NULL, cap=rep(0,length(xList)))
}
\arguments{
  \item{fit}{A iCluster object.}
  \item{xList}{A list object of data matrices.}
  \item{type}{Types of data in the xList.}
  \item{sample.order}{User supplied cluster assignment.}
  \item{feature.order}{A vector of logical values each specify whether
    the genomic features in the corresponding data matrix should be
    reordered by similarity. Default is TRUE.}
  \item{dist.method}{Method used to calculate distance (similarity)
    between features. Default method is "euclidean".  Another choice is
    "correlation", which is Pearson correlation coefficient.}
  \item{hclust.method}{Method passed to hclust function.  See hclust for
  details.}
  \item{sparse}{A vector of logical values each specify whether to
    plot the top cluster-discriminant features. Default is FALSE.} 
  \item{threshold}{When sparse is TRUE, a vector of threshold values to
    include the genomic features for which the absolute value of the
    associated coefficient estimates fall in the top
    quantile. threshold=c(0.25,0.25) takes the top quartile most
    discriminant features in data type 1 and data type 2 for plot.} 
  \item{feature.scale}{A vector of logical values each specify whether
    data should be scaled. Default is FALSE.} 
  \item{col.scheme}{Color scheme. Can use bluered(n) in gplots R
    package.}
  \item{width}{Width of the figure in inches.}
  \item{chr}{A vector of chromosome number.} 
  \item{plot.chr}{A vector of logical values each specify whether to
    annotate chromosome number on the left of the panel. Typically used
    for copy number data type. Default is FALSE.} 
  \item{cap}{A numeric vector used to control the heatmap colors.  For
    example, cap=c(0,0.0.95,0.95) indicates that no truncation for the
    image data used to make heatmap 1 data, and the data used to make
    heatmaps 2 and 3 are truncated at 95\% quantile.}
}
\details{
  The samples are ordered by the cluster assignment using the R code: order(fit$clusters).
  For each data set, the features are ordered by hierarchical clustering
  of the features using the hclust.method and euclidean (or 1-correlation coefficient)
  as the distance. 
  }
\seealso{
  \code{\link{iCluster}},\code{\link{iCluster2b}}, \code{\link{iClusterPlus2}}
}
\value{
  \item{feature.hclust}{A list of objects returned by "hclust" that describes the
    tree produced by the clustering process. For a given data matrix, if
    feature.order is TRUE, the features of the data matrix are ordered
    by the tree generated by "hclust".   Please see "hclust" for details.} 
  \item{image.data}{A list of data matrices used to make the heatmaps.}
}
\examples{
# see iManual.pdf
}
\author{Ronglai Shen \email{shenr@mskcc.org}; Qianxing Mo \email{qianxing.mo@moffitt.org}}
\references{
  Ronglai Shen, Adam Olshen, Marc Ladanyi. (2009). Integrative
  clustering of multiple genomic data types using a joint latent
  variable model with application to breast and lung cancer subtype
  analysis. \emph{Bioinformatics} 25, 2906-2912.
  
  Ronglai Shen, Qianxing Mo, Nikolaus Schultz, Venkatraman E. Seshan,
  Adam B. Olshen, Jason Huse, Marc Ladanyi, Chris
  Sander. (2012). Integrative Subtype Discovery in Glioblastoma Using
  iCluster. \emph{PLoS ONE} 7, e35236  
    
}
\keyword{models}

