% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/15_code_generator.R
\name{generate_network_code}
\alias{generate_network_code}
\title{Generate Publication Pathway Network Code}
\usage{
generate_network_code(
  gsea_res_var = "gsea_res",
  contrast_id,
  pathways,
  min_shared_genes = 2,
  width_mode = "weight",
  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 in the network.}

\item{min_shared_genes}{Integer. Minimum shared core genes for an edge.}

\item{width_mode}{Character. "rank" or "weight".}

\item{seed}{Integer. Layout seed.}

\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 Pathway
  Relationship module's network view as a static ggplot2 figure.
  Assumes a \code{GseaRes} object is already loaded. Uses igraph layout +
  geom_segment edges + geom_point nodes (no ggraph dependency).
}
\examples{
code <- generate_network_code(
  gsea_res_var = "gsea_res", contrast_id = "untrt_vs_trt",
  pathways = c("HALLMARK_TNFA_SIGNALING_VIA_NFKB", "HALLMARK_HYPOXIA"))
cat(code)
}
