% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sig_heatmap.R
\name{sig_heatmap}
\alias{sig_heatmap}
\title{Signature Heatmap with Optional Annotations}
\usage{
sig_heatmap(
  input,
  id = "ID",
  features,
  group,
  condition = NULL,
  id_condition = "vars",
  col_condition = "condition",
  cols_condition = NULL,
  scale = FALSE,
  palette = 2,
  cols_heatmap = NULL,
  palette_group = "jama",
  show_col = FALSE,
  show_palettes = FALSE,
  cols_group = NULL,
  show_plot = TRUE,
  width = 8,
  height = NULL,
  size_col = 10,
  size_row = 8,
  angle_col = 90,
  column_title = NULL,
  row_title = NULL,
  show_heatmap_col_name = FALSE,
  path = NULL,
  index = NULL
)
}
\arguments{
\item{input}{Data frame containing ID, grouping variable, and feature columns.}

\item{id}{Character string. Column name for sample identifier. Default is `"ID"`.}

\item{features}{Character vector. Feature (column) names to include in the heatmap.}

\item{group}{Character string. Grouping variable column name.}

\item{condition}{Data frame or `NULL`. Optional annotation table with
variable-condition mapping. Default is `NULL`.}

\item{id_condition}{Character string. Column name in `condition` for feature IDs.
Default is `"vars"`.}

\item{col_condition}{Character string. Column name in `condition` for condition
labels. Default is `"condition"`.}

\item{cols_condition}{Character vector. Colors for conditions.}

\item{scale}{Logical indicating whether to scale values by row. Default is `FALSE`.}

\item{palette}{Integer or character. Palette index/name for heatmap colors.
Default is `2`.}

\item{cols_heatmap}{Character vector. Custom colors for heatmap gradient.}

\item{palette_group}{Character string. Palette name for group colors.
Default is `"jama"`.}

\item{show_col}{Logical indicating whether to display the color vector.
Default is `FALSE`.}

\item{show_palettes}{Logical indicating whether to print palette options.
Default is `FALSE`.}

\item{cols_group}{Character vector. Custom colors for groups.}

\item{show_plot}{Logical indicating whether to print the heatmap. Default is `TRUE`.}

\item{width}{Numeric. Plot width in inches. Default is `8`.}

\item{height}{Numeric or `NULL`. Plot height in inches. Auto-calculated if `NULL`.}

\item{size_col}{Numeric. Font size for column labels. Default is `10`.}

\item{size_row}{Numeric. Font size for row labels. Default is `8`.}

\item{angle_col}{Numeric. Rotation angle for column labels in degrees.
Default is `90`.}

\item{column_title}{Character string or `NULL`. Title for column annotation.}

\item{row_title}{Character string or `NULL`. Title for row annotation.}

\item{show_heatmap_col_name}{Logical indicating whether to show column names.
Default is `FALSE`.}

\item{path}{Character string or `NULL`. Output directory for saving the heatmap.}

\item{index}{Integer or `NULL`. Index appended to filename. Default is `NULL`.}
}
\value{
A tidyHeatmap object. Saves PDF only when `path` is provided.
}
\description{
Generates a heatmap of selected features grouped by a categorical variable,
with optional conditional (annotation) bars. Supports palette customization,
scaling, size controls, and output saving.
}
\examples{
set.seed(123)
test_input <- data.frame(
  ID = paste0("Sample", 1:20),
  subtype = sample(c("TypeA", "TypeB"), 20, replace = TRUE),
  Sig1 = rnorm(20),
  Sig2 = rnorm(20)
)
sig_heatmap(input = test_input, features = c("Sig1", "Sig2"), group = "subtype", scale = TRUE)
}
\author{
Dongqiang Zeng
}
