% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/enrichment_barplot.R
\name{enrichment_barplot}
\alias{enrichment_barplot}
\title{Enrichment Bar Plot with Two Directions}
\usage{
enrichment_barplot(
  up_terms,
  down_terms,
  terms = "Description",
  pvalue = "pvalue",
  group = "group",
  palette = "jama",
  cols = NULL,
  title = "Gene Ontology Enrichment",
  width_wrap = 30,
  font_terms = 15
)
}
\arguments{
\item{up_terms}{Data frame for up-regulated terms.}

\item{down_terms}{Data frame for down-regulated terms.}

\item{terms}{Column name for term descriptions. Default is "Description".}

\item{pvalue}{Column name for p-values. Default is "pvalue".}

\item{group}{Column name for group indicator. Default is "group".}

\item{palette}{Color palette. Default is "jama".}

\item{cols}{Character vector. Custom colors for bars. If NULL, uses palette.
Default is NULL.}

\item{title}{Plot title. Default is "Gene Ontology Enrichment".}

\item{width_wrap}{Maximum width for wrapping pathway names. Default is 30.}

\item{font_terms}{Font size for axis labels. Default is 15.}
}
\value{
A ggplot object of the enrichment bar plot.
}
\description{
Creates a bar plot visualizing enrichment results for up-regulated and
down-regulated terms, using -log10(p-values) to indicate significance.
}
\examples{
up_terms <- data.frame(
  Description = c("Pathway1", "Pathway2"),
  pvalue = c(0.001, 0.01)
)
down_terms <- data.frame(
  Description = c("Pathway4", "Pathway5"),
  pvalue = c(0.005, 0.02)
)
p <- enrichment_barplot(
  up_terms = up_terms,
  down_terms = down_terms,
  title = "Custom Enrichment Plot"
)
p
}
\author{
Dongqiang Zeng
}
