% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/heatmap-utils.R
\name{.setup_annos}
\alias{.setup_annos}
\title{Unified annotation builder for built-in (split/name) and user-defined annotations}
\usage{
.setup_annos(
  which,
  names_side,
  anno_title,
  show_names,
  annotation,
  annotation_type,
  annotation_side,
  annotation_palette,
  annotation_palcolor,
  annotation_agg,
  annotation_params,
  annotation_name,
  split_by,
  splits,
  by,
  by_labels,
  flip,
  legend.direction,
  legend.position,
  data
)
}
\arguments{
\item{which}{The annotation direction ("row" or "column")}

\item{names_side}{The side to place the row/column name annotation ("top", "bottom", "left", "right")}

\item{anno_title}{The title of the annotation (for split)}

\item{show_names}{A logical value indicating whether to show row/column names}

\item{annotation}{A list of user-defined annotations, where names are annotation names and values are annotation objects or parameters to build annotation objects}

\item{annotation_type}{A list of annotation types, where names are annotation names and values are annotation types ("simple", "label", "rownames", "colnames", "block", "ggcat", "ggseries", or "auto")}

\item{annotation_side}{A list of annotation sides, where names are annotation names and values are annotation sides ("top", "bottom", "left", "right")}

\item{annotation_palette}{A list of annotation palettes, where names are annotation names and values are palette names or color vectors}

\item{annotation_palcolor}{A list of annotation palette colors, where names are annotation names and values are color vectors to override the palette}

\item{annotation_agg}{A list of functions to aggregate the original data for each annotation, where names are annotation names and values are functions that take a vector of values in the cell and return an aggregated value}

\item{annotation_params}{A list of additional parameters for each annotation, where names are annotation names and values are lists of parameters to pass to the annotation constructor}

\item{annotation_name}{A list of display names for each annotation, where names are annotation names and values are character strings (aliasing the displayed name and legend title) or \code{FALSE} (hiding the displayed name)}

\item{split_by}{The name of the column used for split annotation}

\item{splits}{A factor vector of splits for the split annotation}

\item{by}{The name of the column used for name annotation}

\item{by_labels}{A factor vector of labels for the name annotation}

\item{flip}{A logical value indicating whether to flip the annotation (for ggseries annotations)}

\item{legend.direction}{The direction of the legend ("vertical" or "horizontal")}

\item{legend.position}{The position of the legend ("right", "left", "top", "bottom")}

\item{data}{A data frame used for ggcat and ggseries annotations, where each row corresponds to a cell in the heatmap and contains the original values before aggregation}
}
\value{
A list of annotations and legends to be passed to ComplexHeatmap.
}
\description{
Unified annotation builder for built-in (split/name) and user-defined annotations
}
\keyword{internal}
