Skip to contents

Heat Map.

Usage

cyt_heatmap(
  data,
  scale = NULL,
  annotation_col_name = NULL,
  output_file = NULL,
  progress = NULL
)

Arguments

data

A data frame containing the input data. Only numeric columns will be used.

scale

Character. An optional scaling option. If set to "log2", numeric data will be log2-transformed (with non-positive values set to NA). Default is NULL.

annotation_col_name

Character. Optional column name from data to be used for annotation colors.

output_file

Optional. A file path to save the plot. If NULL, the function creates a temporary PNG file and returns its path.

Value

If output_file is NULL, returns a character string with the file path of the PNG. Otherwise, writes the plot and returns NULL invisibly.

Examples

# Load sample data
data("ExampleData1")
data_df <- ExampleData1
# Generate a heatmap with log2 scaling and annotation based on
# the "Group" column
cyt_heatmap(
  data = data_df[, -c(2:3)],
  scale = "log2",  # Optional scaling
  annotation_col_name = "Group"
)
#> Warning: Non-numeric columns detected. Subsetting to numeric columns only.
#> [1] "/tmp/RtmpqldALV/cyt_heatmap_2025-05-24.png"