% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/15_code_generator.R
\name{generate_hubgene_code}
\alias{generate_hubgene_code}
\title{Generate Publication HubGene Network Code}
\usage{
generate_hubgene_code(
  gsea_res_var = "gsea_res",
  contrast_id,
  pathways,
  min_hub_degree = 2,
  pw_size_mode = "setsize",
  seed = 42L,
  target_collection = "ALL",
  base_size = 12,
  margin_top = 18,
  margin_bottom = 18,
  margin_left = 18,
  margin_right = 18,
  fig_width = 10,
  fig_height = 8,
  fig_dpi = 300
)
}
\arguments{
\item{gsea_res_var}{Character. Name of the GseaRes variable.}

\item{contrast_id}{Character. Contrast ID to extract.}

\item{pathways}{Character vector. Pathway IDs to include.}

\item{min_hub_degree}{Integer. Minimum hub degree for gene inclusion.}

\item{pw_size_mode}{Character. One of "fixed", "fdr", "setsize".}

\item{seed}{Integer.}

\item{target_collection}{Character. Gene set collection(s) to extract.
Default \code{"ALL"}.}

\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 R script reproducing the HubGene module's
  visNetwork view as a static ggplot2 figure. Assumes a \code{GseaRes}
  object is already loaded. Node size is controlled by the same three-mode
  logic (fixed / fdr / setsize) as the interactive view.
}
\examples{
code <- generate_hubgene_code(
  gsea_res_var = "gsea_res", contrast_id = "untrt_vs_trt",
  pathways = c("HALLMARK_TNFA_SIGNALING_VIA_NFKB"))
cat(code)
}
