runSpecGraph: Build spectral graph for SGWT object

View source: R/sgwt_main.R

runSpecGraphR Documentation

Build spectral graph for SGWT object

Description

Generate Graph slot information including adjacency matrix, Laplacian matrix, eigenvalues, and eigenvectors.

Usage

runSpecGraph(
  SG,
  k = 25,
  laplacian_type = "normalized",
  length_eigenvalue = NULL,
  verbose = TRUE
)

Arguments

SG

SGWT object from initSGWT()

k

Number of nearest neighbors for graph construction (default: 25)

laplacian_type

Type of graph Laplacian ("unnormalized", "normalized", or "randomwalk") (default: "normalized")

length_eigenvalue

Number of eigenvalues/eigenvectors to compute (default: NULL, uses full length)

verbose

Whether to print progress messages (default: TRUE)

Value

Updated SGWT object with Graph slot populated

Examples


# Create example data
data <- data.frame(x = runif(100), y = runif(100), signal = rnorm(100))
SG <- initSGWT(data, signals = "signal")

# Uses full length by default
SG <- runSpecGraph(SG, k = 30, laplacian_type = "normalized")  

# Or specify custom length
SG2 <- initSGWT(data, signals = "signal")
SG2 <- runSpecGraph(SG2, k = 30, laplacian_type = "normalized", 
                    length_eigenvalue = 30)  


BioGSP documentation built on Feb. 2, 2026, 5:06 p.m.