% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sig_pheatmap.R
\name{sig_pheatmap}
\alias{sig_pheatmap}
\title{Generate Heatmap for Signature Data}
\usage{
sig_pheatmap(
  input,
  feas,
  group,
  group2 = NULL,
  group3 = NULL,
  ID = "ID",
  path = NULL,
  cols1 = "random",
  cols2 = "random",
  cols3 = "random",
  seed = 54321,
  show_col = FALSE,
  palette1 = 1,
  palette2 = 2,
  palette3 = 3,
  cluster_cols = TRUE,
  palette_for_heatmape = 6,
  scale.matrix = TRUE,
  cellwidth = 1,
  cellheight = 9,
  show_colnames = FALSE,
  fig.type = "pdf",
  width = 6,
  height = NULL,
  file_name_prefix = 1
)
}
\arguments{
\item{input}{Data frame with variables in columns.}

\item{feas}{Character vector. Feature names (columns) to include in heatmap.}

\item{group}{Character string. Column name for primary grouping variable.}

\item{group2}{Character string or `NULL`. Optional secondary grouping variable.}

\item{group3}{Character string or `NULL`. Optional tertiary grouping variable.}

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

\item{path}{Character string or `NULL`. Directory to save output files.
If `NULL`, the heatmap is not saved. Default is `NULL`.}

\item{cols1}{Character vector or `"random"` or `"normal"`. Colors for primary group.
Default is `"random"`.}

\item{cols2}{Character vector or `"random"` or `"normal"`. Colors for secondary group.
Default is `"random"`.}

\item{cols3}{Character vector or `"random"` or `"normal"`. Colors for tertiary group.
Default is `"random"`.}

\item{seed}{Integer. Random seed for color generation. Default is `54321`.}

\item{show_col}{Logical indicating whether to display colors. Default is `FALSE`.}

\item{palette1}{Integer. Palette for primary group. Default is `1`.}

\item{palette2}{Integer. Palette for secondary group. Default is `2`.}

\item{palette3}{Integer. Palette for tertiary group. Default is `3`.}

\item{cluster_cols}{Logical indicating whether to cluster columns. Default is `TRUE`.}

\item{palette_for_heatmape}{Integer. Palette number for heatmap. Default is `6`.}

\item{scale.matrix}{Logical indicating whether to scale the matrix. Default is `TRUE`.}

\item{cellwidth}{Numeric. Width of each cell in points. Default is `1`.}

\item{cellheight}{Numeric. Height of each cell in points. Default is `9`.}

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

\item{fig.type}{Character string. File format for saving. Default is `"pdf"`.}

\item{width}{Numeric. Width of saved figure in inches. Default is `6`.}

\item{height}{Numeric or `NULL`. Height of saved figure in inches. Calculated if `NULL`.}

\item{file_name_prefix}{Character or numeric. Prefix for saved file name. Default is `1`.}
}
\value{
A list containing:
\describe{
  \item{p_anno}{Annotation data frame}
  \item{p_cols}{List of cluster colors}
  \item{plot}{ComplexHeatmap object}
  \item{eset}{Transformed expression matrix}
}
}
\description{
Creates a heatmap from signature data with grouping variables, offering
flexible options for colors, clustering, and output formats using
ComplexHeatmap.
}
\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_pheatmap(
  input = test_input,
  feas = c("Sig1", "Sig2"),
  group = "subtype"
)
}
\author{
Dongqiang Zeng
}
