% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sig_box_batch.R
\name{sig_box_batch}
\alias{sig_box_batch}
\title{Batch Signature Box Plots for Group Comparisons}
\usage{
sig_box_batch(
  input,
  vars,
  groups,
  pattern_vars = FALSE,
  path = NULL,
  index = 0,
  angle_x_text = 0,
  hjust = 0.5,
  palette = "jama",
  cols = NULL,
  jitter = FALSE,
  point_size = 5,
  size_of_font = 8,
  size_of_pvalue = 4.5,
  show_pvalue = TRUE,
  return_stat_res = FALSE,
  assay = NULL,
  slot = "scale.data",
  scale = FALSE,
  height = 5,
  width = 3.5,
  fig_type = "pdf",
  max_count_feas = 30
)
}
\arguments{
\item{input}{Data frame or Seurat object containing the data for analysis.}

\item{vars}{Character vector. Features or variables to analyze. When
`pattern_vars = TRUE`, these are treated as regular expression patterns.}

\item{groups}{Character vector. Grouping variable(s) for comparison.}

\item{pattern_vars}{Logical indicating whether to treat `vars` as regular
expression patterns for matching column names. Default is `FALSE`.}

\item{path}{Character string or `NULL`. Directory to save plots. If `NULL`,
plots are not saved. Default is `NULL`.}

\item{index}{Integer. Starting index for plot filenames. Default is `0`.}

\item{angle_x_text}{Numeric. Angle of x-axis labels in degrees. Default is `0`.}

\item{hjust}{Numeric. Horizontal justification of x-axis labels. Default is `0.5`.}

\item{palette}{Character. Color palette for plots. Default is `"jama"`.}

\item{cols}{Character vector or `NULL`. Custom colors for plot elements.}

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

\item{point_size}{Numeric. Size of points. Default is `5`.}

\item{size_of_font}{Numeric. Base font size. Default is `8`.}

\item{size_of_pvalue}{Numeric. Size of p-value text. Default is `4.5`.}

\item{show_pvalue}{Logical indicating whether to display p-values.
Default is `TRUE`.}

\item{return_stat_res}{Logical indicating whether to return statistical
results instead of saving plots. Default is `FALSE`.}

\item{assay}{Character string or `NULL`. Assay type for Seurat objects.}

\item{slot}{Character. Data slot for Seurat objects. Default is `"scale.data"`.}

\item{scale}{Logical indicating whether to scale data before analysis.
Default is `FALSE`.}

\item{height}{Numeric. Height of plots in inches. Default is `5`.}

\item{width}{Numeric. Width of plots in inches. Default is `3.5`.}

\item{fig_type}{Character. File format for plots (e.g., `"pdf"`, `"png"`).
Default is `"pdf"`.}

\item{max_count_feas}{Integer. Maximum number of features to analyze when
`pattern_vars = TRUE`. If matched variables exceed this limit, only the
first `max_count_feas` features are used. Default is `30`.}
}
\value{
If `return_stat_res = TRUE`, returns a data frame of statistical
  results; otherwise, invisibly returns the path to saved plots.
}
\description{
Generates multiple box plots for specified features (signatures) across groups
in the input data. Supports customization of plot appearance, output path,
statistical annotation, and compatibility with Seurat objects. Plots are saved
to the specified directory or a default folder.
}
\examples{
# Simulate data
set.seed(123)
sim_pdata <- data.frame(
  ID = paste0("Sample", 1:50),
  subtype = sample(c("TypeA", "TypeB", "TypeC"), 50, replace = TRUE),
  TMEscore_plus = rnorm(50),
  GZMB = rnorm(50)
)
sig_box_batch(
  input = sim_pdata,
  vars = c("TMEscore_plus", "GZMB"),
  groups = "subtype",
  jitter = TRUE,
  palette = "jco",
  path = tempdir()
)
}
\author{
Dongqiang Zeng
}
