% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualization.R
\name{DisconnectivityGraph}
\alias{DisconnectivityGraph}
\title{DisconnectivityGraph: Generate a disconnectivity graph}
\usage{
DisconnectivityGraph(
  grobj,
  s,
  DG_sample = "DG_sample",
  annot_adj = c(0.75, 2),
  min_pval = 0.05,
  scale_labels = c(0.05, 0.1, 0.2, 0.5),
  show_pvalue = FALSE,
  getGraphObj = FALSE,
  plot = TRUE
)
}
\arguments{
\item{grobj}{A data frame returned by \code{GraphObj}.}

\item{s}{Integer; number of species/features (used for labeling by \link{id2bin}).}

\item{DG_sample}{Character; title of the plot.}

\item{annot_adj}{Numeric vector of length 2; horizontal and vertical adjustment for labels.}

\item{min_pval}{Numeric (must be > 0); minimum p-value shown in the visualization. This is
usually set to the minimum detection level in bootstrap sampling
(e.g., if the number of bootstrap iterations is 1000, the minimum level is
1/1000 = 0.001).}

\item{scale_labels}{Numeric vector of values between 0 and 1; labels for the
p-value scale. These values are converted to log-scaled values for plotting.}

\item{show_pvalue}{Logical; if \code{TRUE}, plots approximate p-values based
on the energy gaps between each stable state and its corresponding tipping
point estimated by bootstrap resampling.}

\item{getGraphObj}{Logical; if \code{TRUE}, returns the data frame used for
plotting the disconnectivity graph, so that users can manually modify the
graphical settings.}

\item{plot}{Logical; if TRUE, show disconnectivity graph}
}
\value{
If \code{getGraphObj = TRUE}, returns a data frame containing energy values,
x-positions, and p-values for the energy gaps of the identified stable states
and tipping points. Otherwise, returns \code{NULL}.
}
\description{
Draws a disconnectivity graph from the data frame returned by \code{GraphObj}.
Nodes are plotted at their assigned x-positions and energy levels, and are
connected to their parent components by paths.

If \code{show_pvalue = TRUE}, approximate p-values for the energy gaps of
stable states are displayed. The p-values are shown on a log10 scale using
the values specified in \code{scale_labels}.
}
