% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/02_setup.R
\name{setup_gsea_env}
\alias{setup_gsea_env}
\title{Initialize GSEA Environment Object}
\usage{
setup_gsea_env(
  fit,
  pathway_obj,
  expr_data = NULL,
  target_factor = NULL,
  verbose = TRUE
)
}
\arguments{
\item{fit}{Differential analysis object. Supports \code{MArrayLM} (limma) or \code{DESeqDataSet} (DESeq2).}

\item{pathway_obj}{Gene set object. Typically generated by \code{build_gsea_pathways()}.}

\item{expr_data}{Optional. Expression matrix or DGEList. If NULL, extraction from fit object will be attempted (partial support only).}

\item{target_factor}{Only for DESeq2. Specifies the target factor of interest. If NULL, automatically inferred as the last term in the design formula.}

\item{verbose}{Logical. If TRUE (default), print progress messages. Set to FALSE for silent batch-mode use.}
}
\value{
Returns a standardized object of class \code{GseaEnv}.
}
\description{
Unified entry point supporting limma-voom (no intercept design) and DESeq2 objects.
Automatically extracts contrasts, differential analysis results, and expression matrices to generate
a standardized GseaEnv object.
}
\examples{
# Limma-voom workflow using pre-computed inputs shipped with the package
data(preprocessed_limma, package = "GSEAlens")

precomp <- preprocessed_limma
data(gsea_pathwaysets_toy, package = "GSEAlens")

pathways <- gsea_pathwaysets_toy
env <- setup_gsea_env(
  fit       = precomp$fit,
  pathway_obj = pathways,
  expr_data = precomp$gsea_limma_voom_data
)
class(env)
}
