% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualization.R
\name{plot_enrichment}
\alias{plot_enrichment}
\title{Plot enrichment results}
\usage{
plot_enrichment(
  enrichment_result,
  type = c("dotplot", "barplot"),
  top_n = 20L,
  name_col = NULL,
  pvalue_col = NULL,
  count_col = NULL
)
}
\arguments{
\item{enrichment_result}{A \code{\link[tibble:tibble]{tibble::tibble()}} from an enrichment
analysis. Must contain columns mappable to term name and p-value.}

\item{type}{Plot type: \code{"dotplot"} (default) or \code{"barplot"}.}

\item{top_n}{Number of top terms to show (default 20).}

\item{name_col}{Column name for term labels (auto-detected if \code{NULL}).}

\item{pvalue_col}{Column name for p-values (auto-detected if \code{NULL}).}

\item{count_col}{Column name for gene counts (auto-detected if \code{NULL}).}
}
\value{
A \code{ggplot} object.
}
\description{
Create a dot plot or bar plot from enrichment analysis results
(e.g. from \code{\link[=query_disease_enrichment]{query_disease_enrichment()}}).
}
\examples{
\dontrun{
enrich <- query_disease_enrichment(c("TP53", "BRCA1", "EGFR"))
plot_enrichment(enrich)
}
}
