Generate an interactive clustered heatmap of summary statistics data.

clustermap(
  dat,
  cols = grep("^w", names(dat), value = TRUE),
  i = seq_len(50),
  agg_var = NULL,
  agg_fun = mean,
  as_cor = FALSE,
  k_row = 3,
  annot_vars = c("TYPE", "GENE"),
  show_plot = TRUE,
  ...
)

Arguments

dat

Summary statistics data.

cols

Numeric columns to plot in the heatmap.

i

Indices of rows to include. Set to NULL to include all rows, but be warned that this can become very computationally expensive.

agg_var

Variable to aggregate data by. Set to NULL to skip this step.

agg_fun

Function to aggregate cols with.

as_cor

Show the heatmap as a correlation matrix instead of a feature x sample matrix.

k_row

an integer scalar with the desired number of groups by which to color the dendrogram's branches in the rows (uses color_branches) If NA then find_k is used to deduce the optimal number of clusters.

annot_vars

Variables in dat to include as row-wise annotations.

show_plot

Print the plot.

...

Arguments passed on to heatmaply::heatmaply

x

can either be a heatmapr object, or a numeric matrix Defaults to TRUE unless x contains any NAs.

Value

A named list containing an interactive heatmaply object and the data used to create it.

Examples

dat <- ThreeWayTest::data_matrix_final
cm <- clustermap(dat = dat)
#> Loading required namespace: heatmaply