% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/build_graph_from_df.R
\name{build_graph_from_df}
\alias{build_graph_from_df}
\title{Build a graph object from a data frame}
\usage{
build_graph_from_df(
  df,
  node_annotation = NULL,
  directed = F,
  module.method = c("Fast_greedy", "Walktrap", "Edge_betweenness", "Spinglass"),
  top_modules = 15,
  seed = 1115
)
}
\arguments{
\item{df}{Data frame.
Edge list with columns \code{from}, \code{to}, and optionally \code{weight}.
If \code{weight} is absent, an unweighted graph is constructed.}

\item{node_annotation}{Data Frame
The annotation file of nodes in network}

\item{directed}{Logical (default: \code{FALSE}).
Whether edges between nodes are directed.}

\item{module.method}{Character
Module analysis methods contains "Fast_greedy", "Walktrap", "Edge_betweenness", "Spinglass"}

\item{top_modules}{Integer.
Number of top-ranked modules to select.}

\item{seed}{Integer (default = 1115).
Random seed for reproducibility.}
}
\value{
An graph object representing the correlation network.
  Node/edge attributes include correlation statistics and (optionally) module labels.
}
\description{
Build a graph object from a data frame
}
\examples{
data(ppi_example)
obj <- build_graph_from_df(
  df              = ppi_example$ppi,
  node_annotation = ppi_example$annotation,
  directed        = FALSE,
  module.method   = "Fast_greedy",
  top_modules     = 5
)
obj

}
