% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/enrichmentDotPlot.R
\name{enrichmentDotPlot}
\alias{enrichmentDotPlot}
\title{Create a Dot Plot of Pathway Enrichment Results}
\usage{
enrichmentDotPlot(
  enrichment_result,
  top_n = 10,
  alpha = 0.05,
  title = "Pathway Enrichment",
  significant_colour = "#C45745",
  nonsignificant_colour = "#D1C2C2"
)
}
\arguments{
\item{enrichment_result}{A data frame containing pathway enrichment results.
It must include the columns \code{Description} and \code{p_adj}.}

\item{top_n}{Positive integer specifying the maximum number of pathways to
display. Pathways are selected according to the smallest adjusted
p-values. Default \code{10}.}

\item{alpha}{Numeric significance threshold applied to adjusted p-values.
Pathways with \code{p_adj < alpha} are classified as significant.
Default \code{0.05}.}

\item{title}{Character string specifying the plot title. Default
\code{"Pathway Enrichment"}. Use \code{NULL} to omit the title.}

\item{significant_colour}{Character string specifying the colour used for
significant pathways. Default \code{"#C45745"}.}

\item{nonsignificant_colour}{Character string specifying the colour used for
nonsignificant pathways. Default \code{"#D1C2C2"}.}
}
\value{
A \code{ggplot} object that can be further customised using
\pkg{ggplot2}.
}
\description{
Creates a dot plot from pathway enrichment results, such as those returned
by \code{\link{enrichPathway}}. Pathways are ranked by adjusted p-value and
displayed according to \code{-log10(adjusted p-value)}.
}
\details{
The top pathways are selected according to adjusted p-value, regardless of
significance status. Therefore, nonsignificant pathways may be displayed.

Adjusted p-values equal to zero are replaced by the smallest positive
adjusted p-value in the enrichment results before the
\code{-log10} transformation. If all adjusted p-values are zero,
\code{.Machine$double.eps} is used.

Rows with missing pathway descriptions or adjusted p-values are excluded.
}
\examples{
enrichment_example <- data.frame(
  Description = c(
    "Tryptophan metabolism",
    "Phenylalanine metabolism",
    "Tyrosine metabolism"
  ),
  p_adj = c(0.001, 0.02, 0.15)
)

enrichmentDotPlot(
  enrichment_result = enrichment_example,
  top_n = 3
)

## Use custom colours
enrichmentDotPlot(
  enrichment_result = enrichment_example,
  significant_colour = "#B2182B",
  nonsignificant_colour = "#BDBDBD"
)

}
\seealso{
\code{\link{enrichPathway}}
}
