% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/taxa_contribution_viz.R
\name{taxa_contribution_heatmap}
\alias{taxa_contribution_heatmap}
\title{Heatmap of taxa contributions across functions}
\usage{
taxa_contribution_heatmap(
  contrib_agg,
  annotation_data = NULL,
  n_functions = 20,
  cluster_rows = TRUE,
  cluster_cols = TRUE,
  clustering_method = "complete",
  clustering_distance = "euclidean",
  low_color = "#f7f7f7",
  high_color = "#ca0020",
  font_size = 12,
  dendro_line_size = 0.5,
  custom_title = NULL
)
}
\arguments{
\item{contrib_agg}{A data.frame from \code{\link{aggregate_taxa_contributions}}.}

\item{annotation_data}{Optional data.frame from \code{\link{pathway_annotation}}
for replacing function IDs with readable descriptions.}

\item{n_functions}{Integer. Number of functions to include. Default 20.}

\item{cluster_rows}{Logical. Cluster rows (taxa)? Default TRUE.}

\item{cluster_cols}{Logical. Cluster columns (functions)? Default TRUE.}

\item{clustering_method}{Character. Method for \code{hclust}. Default \code{"complete"}.}

\item{clustering_distance}{Character. Distance metric. Default \code{"euclidean"}.}

\item{low_color}{Character. Color for low values. Default \code{"#f7f7f7"}.}

\item{high_color}{Character. Color for high values. Default \code{"#ca0020"}.}

\item{font_size}{Numeric. Base font size. Default 12.}

\item{dendro_line_size}{Numeric. Dendrogram line width. Default 0.5.}

\item{custom_title}{Optional plot title.}
}
\value{
A \code{ggplot2} or \code{patchwork} object.
}
\description{
Creates a heatmap showing mean taxa contributions across pathways/functions,
with optional clustering and pathway annotations.
}
\examples{
\donttest{
agg <- data.frame(
  sample = rep(c("S1", "S2"), each = 6),
  function_id = rep(rep(c("K00001", "K00002", "K00003"), each = 2), 2),
  taxon_label = rep(c("Genus_A", "Genus_B"), 6),
  contribution = runif(12)
)
p <- taxa_contribution_heatmap(agg)
}

}
