File: heatmapr.Rd

package info (click to toggle)
r-cran-heatmaply 1.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 628 kB
  • sloc: sh: 13; makefile: 2
file content (193 lines) | stat: -rw-r--r-- 8,474 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/heatmapr.R
\name{heatmapr}
\alias{heatmapr}
\title{Creates a heatmapr object}
\source{
The interface was designed based on \link{heatmap}, \link[gplots]{heatmap.2}, and (the also d3heatmap).
}
\usage{
heatmapr(
  x,
  Rowv = NULL,
  Colv = NULL,
  distfun = dist,
  hclustfun = hclust,
  dist_method = NULL,
  hclust_method = NULL,
  distfun_row = distfun,
  hclustfun_row = hclustfun,
  distfun_col = distfun,
  hclustfun_col = hclustfun,
  dendrogram = c("both", "row", "column", "none"),
  show_dendrogram = c(TRUE, TRUE),
  reorderfun = function(d, w) reorder(d, w),
  k_row = 1,
  k_col = 1,
  symm = FALSE,
  revC = symm || (is.dendrogram(Colv) & is.dendrogram(Rowv) & identical(Rowv, rev(Colv))),
  scale = c("none", "row", "column"),
  na.rm = TRUE,
  labRow = rownames(x),
  labCol = colnames(x),
  cexRow = NULL,
  cexCol = NULL,
  digits = 3L,
  cellnote = NULL,
  theme = NULL,
  colors = "RdYlBu",
  width = NULL,
  height = NULL,
  xaxis_height = 80,
  yaxis_width = 120,
  xaxis_font_size = NULL,
  yaxis_font_size = NULL,
  brush_color = "#0000FF",
  show_grid = TRUE,
  anim_duration = 500,
  row_side_colors = NULL,
  col_side_colors = NULL,
  seriate = c("OLO", "mean", "none", "GW"),
  point_size_mat = NULL,
  custom_hovertext = NULL,
  ...
)
}
\arguments{
\item{x}{A numeric matrix
Defaults to \code{TRUE} unless \code{x} contains any \code{NA}s.}

\item{Rowv}{determines if and how the row dendrogram should be reordered.    By default, it is TRUE, which implies dendrogram is computed and reordered based on row means. If NULL or FALSE, then no dendrogram is computed and no reordering is done. If a \link{dendrogram} (or \link{hclust}), then it is used "as-is", ie without any reordering. If a vector of integers, then dendrogram is computed and reordered based on the order of the vector.}

\item{Colv}{determines if and how the column dendrogram should be reordered.    Has the options as the Rowv argument above and additionally when x is a square matrix, Colv = "Rowv" means that columns should be treated identically to the rows.}

\item{distfun}{function used to compute the distance (dissimilarity) between both rows and columns. Defaults to dist.}

\item{hclustfun}{function used to compute the hierarchical clustering when Rowv or Colv are not dendrograms. Defaults to hclust.}

\item{dist_method}{default is NULL (which results in "euclidean" to be used). Can accept alternative character strings indicating the
method to be passed to distfun. By default distfun. is \link{dist} hence
this can be one of "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski".}

\item{hclust_method}{default is NULL (which results in "complete" to be used). Can accept alternative character strings indicating the
method to be passed to hclustfun By default hclustfun is \link{hclust} hence
this can be one of "ward.D", "ward.D2", "single", "complete", "average" (= UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC) or "centroid" (= UPGMC).}

\item{distfun_row}{distfun for row dendrogram only.}

\item{hclustfun_row}{hclustfun for col dendrogram only.}

\item{distfun_col}{distfun for row dendrogram only.}

\item{hclustfun_col}{hclustfun for col dendrogram only.}

\item{dendrogram}{character string indicating whether to compute 'none',
'row', 'column' or 'both' dendrograms. Defaults to 'both'. However, if Rowv
(or Colv) is FALSE or NULL and dendrogram is 'both', then a warning is issued
and Rowv (or Colv) arguments are honoured.}

\item{show_dendrogram}{Logical vector of length controlling whether the row
and column dendrograms are displayed. If a logical scalar is
provided, it is repeated to become a logical vector of length two.}

\item{reorderfun}{function(d, w) of dendrogram and weights for reordering the row and column dendrograms. The default uses stats{reorder.dendrogram}}

\item{k_row}{an integer scalar with the desired number of groups by which to color the dendrogram's branches in the rows (uses \link[dendextend]{color_branches})
If NA then \link[dendextend]{find_k} is used to deduce the optimal number of clusters.}

\item{k_col}{an integer scalar with the desired number of groups by which to color the dendrogram's branches in the columns (uses \link[dendextend]{color_branches})
If NA then \link[dendextend]{find_k} is used to deduce the optimal number of clusters.}

\item{symm}{logical indicating if x should be treated symmetrically; can only be true when x is a square matrix.}

\item{revC}{logical indicating if the column order should be reversed for plotting.
Default (when NULL) - is FALSE, unless symm is TRUE.
This is useful for cor matrix.}

\item{scale}{character indicating if the values should be centered and scaled in either the row direction or the column direction, or none. The default is "none".}

\item{na.rm}{logical indicating whether NA's should be removed.}

\item{labRow}{character vectors with row labels to use (from top to bottom); default to rownames(x).}

\item{labCol}{character vectors with column labels to use (from left to right); default to colnames(x).}

\item{cexRow}{positive numbers. If not NULL, it will override \code{xaxis_font_size}
and will give it a value cexRow*14}

\item{cexCol}{positive numbers. If not NULL, it will override \code{yaxis_font_size}
and will give it a value cexCol*14}

\item{digits}{integer indicating the number of decimal places to be used by \link{round} for 'label'.}

\item{cellnote}{(optional) matrix of the same dimensions as \code{x}
that has the human-readable version of each value,
for displaying on top of the heatmap cells.}

\item{theme}{A custom CSS theme to use. Currently the only valid values are
\code{""} and \code{"dark"}. \code{"dark"} is primarily intended for
standalone visualizations, not R Markdown or Shiny.}

\item{colors}{Either a colorbrewer2.org palette name (e.g. \code{"YlOrRd"} or
\code{"Blues"}), or a vector of colors to interpolate in hexadecimal
\code{"#RRGGBB"} format, or a color interpolation function like
\code{\link[grDevices]{colorRamp}}.}

\item{width}{Width in pixels (optional, defaults to automatic sizing).}

\item{height}{Height in pixels (optional, defaults to automatic sizing).}

\item{xaxis_height}{Size of axes, in pixels.}

\item{yaxis_width}{Size of axes, in pixels.}

\item{xaxis_font_size}{Font size of axis labels, as a CSS size (e.g. "14px" or "12pt").}

\item{yaxis_font_size}{Font size of axis labels, as a CSS size (e.g. "14px" or "12pt").}

\item{brush_color}{The base color to be used for the brush. The brush will be
filled with a low-opacity version of this color. \code{"#RRGGBB"} format
expected.}

\item{show_grid}{\code{TRUE} to show gridlines, \code{FALSE} to hide them, or
a numeric value to specify the gridline thickness in pixels (can be a
non-integer).}

\item{anim_duration}{Number of milliseconds to animate zooming in and out.
For large \code{x} it may help performance to set this value to \code{0}.}

\item{row_side_colors, col_side_colors}{data.frame of factors to produce
row/column side colors in the style of heatmap.2/heatmap.3.
col_side_colors should be "wide", ie be the same dimensions
as the column side colors it will produce.}

\item{seriate}{character indicating the method of matrix sorting (default: "OLO").
Implemented options include:
"OLO" (Optimal leaf ordering, optimizes the Hamiltonian path length that is restricted by the dendrogram structure - works in O(n^4) )
"mean" (sorts the matrix based on the reorderfun using marginal means of the matrix. This is the default used by \link[gplots]{heatmap.2}),
"none" (the default order produced by the dendrogram),
"GW" (Gruvaeus and Wainer heuristic to optimize the Hamiltonian path length that is restricted by the dendrogram structure)}

\item{point_size_mat}{A matrix of values which can be mapped to point size}

\item{custom_hovertext}{Custom hovertext matrix (the same dimensions as the input).}

\item{...}{currently ignored}
}
\description{
An object of class heatmapr includes all the needed information
for producing a heatmap. The goal is to separate the pre-processing of the
heatmap elements from the graphical rendering of the object, which could be done
using plotly (but potentially also with other graphical devices).
}
\examples{
\dontrun{
library(heatmaply)
hm <- heatmapr(mtcars, scale = "column", colors = "Blues")
heatmaply(hm)
}

}
\seealso{
\link{heatmap}, \link[gplots]{heatmap.2}
}