Home

pheatmap

Pheatmap is an R package that provides a user-friendly interface for generating enhanced heatmaps, with built-in support for annotations, clustering, and customizable aesthetics. It was developed to offer a convenient alternative to traditional heatmap plotting functions and is widely used in fields such as genomics and transcriptomics. The package is available on CRAN and is commonly used in data exploration and visualization workflows.

Key features of pheatmap include the ability to cluster rows and columns using hierarchical clustering with

Input to pheatmap is typically a numeric matrix or data frame, with NA values allowed. The function

Example usage: library(pheatmap); pheatmap(mat); pheatmap(mat, scale="row", clustering_distance_rows="euclidean", clustering_method="complete"); pheatmap(mat, annotation_col=annotation_col, display_numbers=TRUE).

configurable
distance
measures
and
linkage
methods.
It
supports
annotation
tracks
for
rows
and
columns
through
annotation_row
and
annotation_col
objects,
allowing
additional
metadata
to
be
shown
alongside
the
heatmap.
Colors
and
scales
are
highly
customizable,
with
options
to
apply
a
row
or
column
scale,
choose
color
palettes,
and
control
breaks.
Other
useful
options
include
displaying
row
and
column
names,
adjusting
cell
size,
adding
numbers
inside
cells,
and
controlling
dendrogram
display
with
treeheight_row
and
treeheight_col.
The
function
also
supports
saving
output
directly
to
files
via
filename,
width,
height,
and
other
graphical
parameters.
returns
a
list
containing
the
clustering
results,
the
heatmap
object,
and
the
data
used,
which
can
be
inspected
for
reproducibility
or
further
analysis.
Users
can
also
supply
annotation
data
frames
and
a
named
color
list
to
customize
annotation
colors.