% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils_hubgene.R
\name{prepare_hubgene_nodes}
\alias{prepare_hubgene_nodes}
\title{Prepare HubGene Nodes for Plotting}
\usage{
prepare_hubgene_nodes(network_data, layout = "fr", seed = 42)
}
\arguments{
\item{network_data}{Output from \code{\link{build_hubgene_network}}}

\item{layout}{Layout algorithm: "fr" (Fruchterman-Reingold),
"kk" (Kamada-Kawai), or "circle"}

\item{seed}{Random seed for reproducibility (default: 42)}
}
\value{
A named list with three components:
  \item{pathway}{Pathway node data frame with coordinates}
  \item{gene}{Gene node data frame with coordinates}
  \item{all}{Combined node data frame}
}
\description{
Prepare node data with layout positions for plotly visualization.
}
\examples{
# Build a minimal network_data object (2 pathways + 2 shared genes)
network_data <- list(
  nodes = list(
    pathway = data.frame(
      id = c("PATHWAY_A", "PATHWAY_B"), type = "pathway",
      NES = c(2.0, -1.5), direction = c("up", "down"),
      stringsAsFactors = FALSE
    ),
    gene = data.frame(
      id = c("GENE_X", "GENE_Y"), type = "gene",
      stringsAsFactors = FALSE
    )
  ),
  edges = data.frame(
    from = c("PATHWAY_A", "PATHWAY_A", "PATHWAY_B", "PATHWAY_B"),
    to   = c("GENE_X", "GENE_Y", "GENE_X", "GENE_Y"),
    stringsAsFactors = FALSE
  ),
  hub_df = data.frame(gene = c("GENE_X", "GENE_Y"), degree = c(2, 2),
                      stringsAsFactors = FALSE)
)
nodes <- prepare_hubgene_nodes(network_data, layout = "fr", seed = 42)
if (!is.null(nodes)) head(nodes$all[, c("id", "type")])
}
