% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sig_box.R
\name{sig_box}
\alias{sig_box}
\title{Signature Box Plot with Statistical Comparisons}
\usage{
sig_box(
  data,
  signature,
  variable,
  palette = "nrc",
  cols = NULL,
  jitter = FALSE,
  point_size = 5,
  angle_x_text = 0,
  hjust = 0.5,
  show_pairwise_p = TRUE,
  show_overall_p = FALSE,
  return_stat_res = FALSE,
  size_of_pvalue = 6,
  size_of_font = 10,
  assay = NULL,
  slot = "scale.data",
  scale = FALSE
)
}
\arguments{
\item{data}{Data frame or Seurat object containing the signature and
grouping variable.}

\item{signature}{Character string specifying the column name (or feature name
in Seurat) for the signature values to plot on the y-axis.}

\item{variable}{Character string specifying the grouping variable column name
for the x-axis.}

\item{palette}{Character string specifying the color palette name.
Default is `"nrc"`.}

\item{cols}{Character vector of custom fill colors. If `NULL`, palette is
used. Default is `NULL`.}

\item{jitter}{Logical indicating whether to add jittered points to the box
plot. Default is `FALSE`.}

\item{point_size}{Numeric value specifying the size of jittered points.
Default is 5.}

\item{angle_x_text}{Numeric value specifying the rotation angle for x-axis
labels (in degrees). Default is 0.}

\item{hjust}{Numeric value specifying the horizontal justification of x-axis
labels. Default is 0.5.}

\item{show_pairwise_p}{Logical indicating whether to display pairwise
comparison p-values between groups. Default is `TRUE`.}

\item{show_overall_p}{Logical indicating whether to display the overall
group difference p-value. Default is `FALSE`.}

\item{return_stat_res}{Logical indicating whether to return statistical test
results instead of the plot. Default is `FALSE`.}

\item{size_of_pvalue}{Numeric value specifying the font size for p-values.
Default is 6.}

\item{size_of_font}{Numeric value specifying the base font size.
Default is 10.}

\item{assay}{Character string specifying the assay name (for Seurat objects).
Default is `NULL`.}

\item{slot}{Character string specifying the slot name (for Seurat objects).
Default is `"scale.data"`.}

\item{scale}{Logical indicating whether to scale signature values (z-score
transformation). Default is `FALSE`.}
}
\value{
If `return_stat_res = FALSE`, returns a ggplot2 object. If
  `return_stat_res = TRUE`, returns a data frame containing statistical test
  results.
}
\description{
Creates box plots to visualize signature distributions across groups with
optional statistical pairwise comparisons. Supports both data frames and
Seurat objects for single-cell data visualization.
}
\examples{
# Create small example data
set.seed(123)
test_data <- data.frame(
  subtype = rep(c("A", "B"), each = 50),
  TMEscore_plus = rnorm(100)
)
sig_box(
  data = test_data,
  signature = "TMEscore_plus",
  variable = "subtype",
  jitter = TRUE,
  palette = "jco"
)
}
\author{
Dongqiang Zeng
}
