Learn R Programming

BioGSP (version 1.0.0)

runSpecGraph: 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
)

Value

Updated SGWT object with Graph slot populated

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)

Examples

Run this code
# \donttest{
# 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)  
# }

Run the code above in your browser using DataLab