% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/plotClusterHeatmap.R
\docType{methods}
\name{plotClusterHeatmap}
\alias{plotClusterHeatmap}
\alias{plotClusterHeatmap,daFrame-method}
\title{Plot cluster heatmap}
\usage{
plotClusterHeatmap(x, ...)

\S4method{plotClusterHeatmap}{daFrame}(x, hm2 = NULL, k = 20, m = NULL,
  cluster_anno = TRUE, split_by = NULL, scale = TRUE, draw_dend = TRUE,
  draw_freqs = TRUE, palette = rev(brewer.pal(11, "RdYlBu")))
}
\arguments{
\item{x}{a \code{\link{daFrame}}.}

\item{...}{optional arguments.}

\item{hm2}{character string. Specifies the right-hand side heatmap. One of:
\itemize{
\item{\code{"abundances"}: cluster frequencies across samples}
\item{\code{"state_markers"}: median cell state marker expressions 
  across clusters (analogous to the left-hand side heatmap)}
\item{a character string/vector corresponding to one/multiple marker(s): 
  median marker expressions across samples and clusters}}}

\item{k}{numeric or character string. Specifies the clustering 
across which median marker expressions should be computed.}

\item{m}{numeric or character string. Specifies the metaclustering to be shown. 
(This is for display only and will not effect any computations!)}

\item{cluster_anno}{logical. Specifies if clusters should be annotated.}

\item{split_by}{character string. Must corresponds to a column name of \code{rowData(x)}. 
If specified, the data will be subset according to this variable, 
and multiple heatmaps will be drawn.}

\item{scale}{logical. Specifies whether scaled values should be plotted.
(see below for details)}

\item{draw_dend}{logical. Specifies if the row dendrogram should be drawn.}

\item{draw_freqs}{logical. Specifyies whether to display cell counts and proportions.}

\item{palette}{character vector of colors to interpolate.}
}
\value{
a \code{\link{HeatmapList-class}} object.
}
\description{
Plots heatmaps summarizing a clustering and/or metaclustering of interest.
}
\details{
Scaled values corresponds to cofactor arcsinh-transformed 
expression values scaled between 0 and 1 using 1% and 99% percentiles as 
boundaries. Hierarchical clustering is performed on the unscaled data.

In its 1st panel, \code{plotClusterHeatmap} will display
median (scaled, arcsinh-transformed) cell-type marker expressions (across all samples).
Depending on argument \code{hm2}, the 2nd panel will contain one of:
\itemize{
\item{relataive cluster abundances by sample}
\item{median (scaled, arcsinh-transformed) 
  cell-state marker expressions (across all samples)}
\item{median (scaled, arcsinh-transformed) 
  cell-state marker expressions by sample}
}
}
\examples{
data(PBMC_fs, PBMC_panel, PBMC_md)
re <- daFrame(PBMC_fs, PBMC_panel, PBMC_md)

# run clustering
lineage <- c("CD3", "CD45", "CD4", "CD20", "CD33", 
    "CD123", "CD14", "IgM", "HLA_DR", "CD7")
re <- cluster(re, cols_to_use=lineage)

plotClusterHeatmap(re, hm2="abundances")
plotClusterHeatmap(re, hm2="state_markers", k=16, split_by='condition')
plotClusterHeatmap(re, hm2="pS6", k=12, m=8)

}
\references{
Nowicka M, Krieg C, Weber LM et al. 
CyTOF workflow: Differential discovery in 
high-throughput high-dimensional cytometry datasets.
\emph{F1000Research} 2017, 6:748 (doi: 10.12688/f1000research.11622.1)
}
\author{
Helena Lucia Crowell \email{crowellh@student.ethz.ch}
}
