DisconnectivityGraph: DisconnectivityGraph: Generate a disconnectivity graph

View source: R/visualization.R

DisconnectivityGraphR Documentation

DisconnectivityGraph: Generate a disconnectivity graph

Description

Draws a disconnectivity graph from the data frame returned by GraphObj. Nodes are plotted at their assigned x-positions and energy levels, and are connected to their parent components by paths.

If 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 scale_labels.

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

grobj

A data frame returned by GraphObj.

s

Integer; number of species/features (used for labeling by id2bin).

DG_sample

Character; title of the plot.

annot_adj

Numeric vector of length 2; horizontal and vertical adjustment for labels.

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).

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.

show_pvalue

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

getGraphObj

Logical; if TRUE, returns the data frame used for plotting the disconnectivity graph, so that users can manually modify the graphical settings.

plot

Logical; if TRUE, show disconnectivity graph

Value

If 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 NULL.


ELAplus documentation built on May 28, 2026, 5:09 p.m.