autoplot.biclustermd: Make a heatmap of sparse biclustering results

Description Usage Arguments Value Examples

View source: R/autoplot.biclustermd.R

Description

Make a heatmap of sparse biclustering results

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S3 method for class 'biclustermd'
autoplot(
  object,
  axis.text = NULL,
  reorder = FALSE,
  transform_colors = FALSE,
  c = 1/6,
  cell_alpha = 1/5,
  col_clusts = NULL,
  row_clusts = NULL,
  ...
)

Arguments

object

An object of class "biclustermd".

axis.text

A character vector specifying for which axes text should be drawn. Can be any of "x", "col" for columns, "y", "row" for rows, or any combination of the four. By default this is NULL; no axis text is drawn.

reorder

A logical. If TRUE, heatmap will be sorted according to the cell-average matrix, A.

transform_colors

If equals TRUE then the data is scaled by c and run through a standard normal cdf before plotting. If FALSE (default), raw data values are used in the heat map.

c

Value to scale the data by before running it through a standard normal CDF. Default is 1/6.

cell_alpha

A scalar defining the transparency of shading over a cell and by default this equals 1/5. The color corresponds to the cell mean.

col_clusts

A vector of column cluster indices to display. If NULL (default), all are displayed.

row_clusts

A vector of row cluster indices to display. If NULL (default), all are displayed.

...

Arguments to be passed to geom_vline() and geom_hline().

Value

An object of class ggplot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data("synthetic")

bc <- biclustermd(synthetic, col_clusters = 3, row_clusters = 2,
                miss_val = mean(synthetic, na.rm = TRUE),
                miss_val_sd = sd(synthetic, na.rm = TRUE),
                col_min_num = 2, row_min_num = 2,
                col_num_to_move = 1, row_num_to_move = 1,
                max.iter = 10)
bc
autoplot(bc)

autoplot(bc, axis.text = c('x', 'row')) +
    ggplot2::scale_fill_distiller(palette = "Spectral", na.value = "white")

# Complete shading
autoplot(bc, axis.text = c('col', 'row'), cell_alpha = 1)

# Transformed values and no shading
autoplot(bc, transform_colors = TRUE, c = 1/20, cell_alpha = 0)

# Focus on row cluster 1 and column cluster 2
autoplot(bc, col_clusts = 2, row_clusts = 1)

biclustermd documentation built on June 17, 2021, 5:11 p.m.