% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/15_code_generator.R
\name{generate_boxplot_image_code}
\alias{generate_boxplot_image_code}
\title{Generate Publication Boxplot Image Code}
\usage{
generate_boxplot_image_code(
  box_data_long,
  gene_symbol = "Gene",
  expr_type = "Expression",
  left_group = NA_character_,
  right_group = NA_character_,
  use_zero_baseline = TRUE,
  custom_order = "default",
  base_size = 12,
  margin_top = 15,
  margin_bottom = 15,
  margin_left = 18,
  margin_right = 18,
  fig_width = 5,
  fig_height = 5,
  fig_dpi = 300
)
}
\arguments{
\item{box_data_long}{data.frame with columns: Sample, Group, Expression.
(Same long format returned by \code{extract_boxplot_data()$long}.)}

\item{gene_symbol}{Character. Gene name for the plot title.}

\item{expr_type}{Character. Y-axis label (e.g. "logcpm", "log2FC").}

\item{left_group}{Character. First group name (gets red fill).}

\item{right_group}{Character. Second group name (gets blue fill).}

\item{use_zero_baseline}{Logical. Add dashed red line at y = 0.}

\item{custom_order}{Character scalar. Custom group ordering
(e.g. "A->B,C") or "default".}

\item{base_size}{Numeric.}

\item{margin_top}{Numeric. Top plot margin (mm).}

\item{margin_bottom}{Numeric. Bottom plot margin (mm).}

\item{margin_left}{Numeric. Left plot margin (mm).}

\item{margin_right}{Numeric. Right plot margin (mm).}

\item{fig_width}{Numeric. Figure width in inches for ggsave.}

\item{fig_height}{Numeric. Figure height in inches for ggsave.}

\item{fig_dpi}{Numeric. DPI for PNG raster output (default 300).}
}
\value{
Character scalar of executable R code.
}
\description{
Return an executable ggplot2 script reproducing the Quadrant
  module's per-gene expression boxplot (panel 4) as a static,
  publication-ready figure. Mirrors the interactive plotly: boxplot +
  jittered points, group colors, optional zero baseline, optional custom
  group order.
}
\examples{
\donttest{
# Build a minimal long-format expression data frame (self-contained)
box_long <- data.frame(
  Sample     = c("S1", "S2", "S3", "S4"),
  Group      = factor(c("untrt", "untrt", "trt", "trt"),
                      levels = c("untrt", "trt")),
  Expression = c(8.1, 8.3, 9.5, 9.7)
)
code <- generate_boxplot_image_code(
  box_data_long = box_long,
  gene_symbol   = "GAPDH",
  expr_type     = "logcpm",
  left_group    = "untrt",
  right_group   = "trt"
)
cat(code)
}
}
