Usage
idendro(h, x = NULL, qx = NULL, clusters = NULL, hscale = 1.5,
vscale = 1.5, silent = FALSE, zoomFactor = 1/240,
observationAnnotationEnabled = TRUE,
clusterColors = c("red", "green", "blue", "yellow", "magenta",
"cyan", "darkred", "darkgreen", "purple", "darkcyan"),
unselectedClusterColor = "black", maxClusterCount = max(length(clusterColors),
ifelse(!is.null(clusters), max(clusters), 0)), heatmapEnabled = TRUE,
heatmapSmoothing = c("none", "cluster", "zoom"),
heatmapColors = colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan",
"#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000"))(10),
doScaleHeatmap = TRUE, doScaleHeatmapByRows = FALSE,
heatmapRelSize = 0.2, colorizeCallback = NULL, fetchSelectedCallback = NULL,
brushedmapEnabled = !is.null(fetchSelectedCallback),
brushedmapRelSize = ifelse(!is.null(x), heatmapRelSize/ncol(x), 0.05),
geometry = NULL, ggobi = FALSE, ggobiGlyphType = 1, ggobiGlyphSize = 1,
ggobiFetchingStyle = "selected", ggobiColorScheme = "Paired 12", dbg = 0, ...)
Arguments
h
object of class 'stats::hclust' (or other class
convertible to class 'hclust' by the 'as.hclust' function)
describing a hierarchical clustering.
If _inversions_ in heights (see 'hclust') is detected,
the heights get fixed in a simple naive way by preserving
non-negative relative differences in the heights, but changing
negative differences to zero. Using clustering with monotone
distance measure should be considered in that case.
x
data frame holding observations tha were clustered
giving rise to 'h'.
The heat map will depict this data. (The heat map can be scaled
- see the 'doScaleHeatmap' and 'doScaleHeatmapByRows' arguments.)
Non-numeric types will get converted to numeric using 'as.numeric'.
This parameter is optional.
qx
(unused, appears for compatibility with
idendro::idendro).
clusters
the assignment of observations to clusters to start
with, typically the value of a previous call to 'idendro'.
A numeric vector of length of the number of observations is
expected, in which 0s denote unselected observations, and values
of i > 0 mark members of the cluster `i'.
hscale
horizontal scaling factor of the dendrogram
figure. As the dendrogram is implemented as a Tcl/Tk image, and
rtcltk does not support image resizing (e.g. on window
maximization), the dendrogram keeps its original size regardless
of the size of its enclosing window. Thus specifying the
hscale of more than 100% is preferred to make the dendrogram
large enough.
vscale
vertical scaling factor of the dendrogram
figure. See 'hscale'.
silent
if TRUE, no informative messages will be shown
zoomFactor
the amount of zoom in/out as controlled by the
mouse wheel
observationAnnotationEnabled
shall the names of individual
observations (rownames of 'x') be shown next to the
dendrogram/heat map?
clusterColors
colors
of individual clusters
unselectedClusterColor
the color of unselected dendrogram
branches
maxClusterCount
the
maximum number of clusters user can select. If greater than the number
of 'clusterColors', cluster colors will get recycled.
This parameter affects the size of the GUI and the number of
clusters that can be selected automatically by "cutting" the
dendrogram.
heatmapEnabled
shall the heat map be drawn?
heatmapSmoothing
heat map smoothing mode,
one of
'none' - the heat map gets never smoothed, it displays the
features of all the individual observations
'cluster' - the heat map depicts the average features
for the currently selected clusters,
'zoom' - the heat map displays the average feature for each
elementary (i.e. the finest) cluster seen in the
dendrogram currently.
heatmapColors
heat map
color palette represented by a list of colors, e.g.
a sequential palette generated by `brewer.pal', or
`colorRampPalette(.)(.)', `gray.colors(.)', or `hsv(.)'.
doScaleHeatmap
scale each heat map column to the <0,1> range?
(The default is TRUE.)
doScaleHeatmapByRows
scale heat map rows, not columns
(The default is FALSE.)
heatmapRelSize
relative size of the heat map - the ratio
of the heat map width to the width of the dendrogram, the heat
map, and the brushed map. The default is 20%.
colorizeCallback
callback function called when cluster
selection changes; the argument is a vector assigning color
indices (0=no color, >0 colors) to individual observations.
fetchSelectedCallback
callback function used to fetch
observation selection made externally. The callback must return
a boolean vector of length of the number of observations in `x'.
i-th element in the vector specifies whether given observation
is selected.
brushedmapEnabled
shall
brushed map be drawn? If TRUE, a column vector is drawn next to
dendrogram (and heatmap, if there is one) depicting observation
that were fetched by fetchSelectedCallback. The color of the
observations is the color of the cluster used to fetch
observations into.
brushedmapRelSize
relative
size of the brushed map - the ratio of the brushed map width to
the width of the dendrogram, the heat map, and the brushed map.
The default is the size of a single column in the heat map, or
5% if there is no heatmap.
geometry
window geometry ("width x height + xoffset +
yoffset"). Almost useless as the dendrogram does not resize, see
the 'hscale' and 'vscale' arguments instead.
ggobi
plot feature space projections of `x' in ggobi
and bidirectionally integrate with the plot? (defaults to FALSE
as some users may not have ggobi available)
ggobiGlyphType
ggobi glyph type used to draw observations in
ggobi (defaults to a single pixel; see rggobi::glyph_type)
ggobiGlyphSize
size of ggobi glyphs (see rggobi::glyph_size)
ggobiFetchingStyle
how should we recognize
ggobi-selected observations to be fetched to idendro?
Use 'selected' to fetch observations selected by ggobi brush,
or glyph type number 2-6 to fetch observations selected by ggobi
persistent brushing with a specific glyph type.
ggobiColorScheme
GGobi color scheme used to
color observations in ggobi plots according to the clusters
selected in the dendrogram
dbg
debug level (0=none, 1=brief, 2=verbose)
…
additional graphical parameters to be passed to the
dendrogram plot.