plot_heatmap {BioNERO} | R Documentation

## Plot heatmap of hierarchically clustered sample correlations or gene expression

### Description

Plot heatmap of hierarchically clustered sample correlations or gene expression

### Usage

    plot_heatmap(
      exp,
      col_metadata = NA,
      row_metadata = NA,
      cor_method = "spearman",
      type = "samplecor",
      palette = NULL,
      log_trans = FALSE,
      cluster_rows = TRUE,
      cluster_cols = TRUE,
      show_rownames = FALSE,
      show_colnames = TRUE,
      scale = "none",
      fontsize = 9,
      cutree_rows = NA,
      cutree_cols = NA,
      ...
    )

### Arguments

`exp` | A gene expression data frame with genes in row names and samples in column names or a 'SummarizedExperiment' object.
`col_metadata` | A data frame containing sample names in row names and sample annotation in the subsequent columns. The maximum number of columns is 2 to ensure legends can be visualized. Ignored if 'exp' is a 'SummarizedExperiment' object, since the function will extract colData. Default: NA.
`row_metadata` | A data frame containing gene IDs in row names and gene functional classification in the first column. Only one column is allowed to ensure legends can be visualized. Default: NA.
`cor_method` | Correlation method. One of 'spearman' or 'pearson'. Default is 'spearman'.
`type` | Type of heatmap to plot. One of 'samplecor' (sample correlations) or 'expr'. Default: 'samplecor'.
`palette` | RColorBrewer palette to use. Default is "Blues" for sample correlation heatmap and "YlOrRd" for gene expression heatmap.
`log_trans` | Logical indicating whether to log transform the expression data or not. Default: FALSE.
`cluster_rows` | Logical indicating whether to cluster rows or not. Default: TRUE.
`cluster_cols` | Logical indicating whether to cluster columns or not. Default: TRUE.
`show_rownames` | Logical indicating whether to show row names or not. Default: FALSE.
`show_colnames` | Logical indicating whether to show column names or not. Default is TRUE.
`scale` | Character indicating if values should be centered and scaled in rows, columns, or none. One of 'row', 'column', or 'none'. Default: 'none'.
`fontsize` | Base font size for the plot.
`cutree_rows` | Number of clusters into which rows are divided. Default: NA (no division).
`cutree_cols` | Number of clusters into which columns are divided. Default: NA (no division).
`...` | Additional arguments to be passed to `ComplexHeatmap::pheatmap()`.

### Value

A heatmap of sample correlations or gene expression.

### Author(s)

Fabricio Almeida-Silva

### See Also

`RColorBrewer`

### Examples

    data(filt.se)
    plot_heatmap(filt.se)

[Package BioNERO version 1.0.4 Index]