The KEGG multi-layer heterogeneous graph. Contains all nodes (pathways, modules, enzymes, reactions, compounds) and their connecting edges. Provides methods to build adjacency matrices and Laplacians for diffusion/PageRank computations.
KeggGraph
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| GetNode | 1 | Get node by internal index |
| GetIndex | 1 | Get node index by KEGG ID |
| ContainsId | 1 | Check if a KEGG ID exists in the graph |
| GetNodesByType | 1 | Get all nodes of a specific type |
| GetIndicesByType | 1 | Get indices of all nodes of a specific type |
| AddNode | 1 | Add a node to the graph. |
| AddEdge | 1 | Add an undirected edge between two nodes. |
| AddEdgeByIndex | 1 | Add an undirected edge by node indices. |
| BuildAdjacencyMatrix | 1 | Build the adjacency matrix of the graph. |
| ComputeDegrees | 1 | Compute the degree vector: d[i] = number of neighbors of node i. |
| ComputeLaplacian | 1 | Compute the unnormalized Laplacian: L = D - A where D is the diagonal degree matrix and A is the adjacency matrix. |
| ComputeRegularizedLaplacian | 1 | Compute the regularized Laplacian for FELLA diffusion: L_gamma = L + gamma * B where L is the unnormalized Laplacian, gamma is the regularization parameter (typically 1), and B… |
| ComputeTransitionMatrix | 1 | Compute the transition matrix for PageRank. |
| GetNeighbors | 1 | Get the neighbors of a node. |
| GetSubGraph | 1 | Get a subgraph containing only the specified node indices. |
| GetStatistics | 1 | Print graph statistics. |
03 Properties
04 Members
Int32)Get node by internal index
String)Get node index by KEGG ID
String)Check if a KEGG ID exists in the graph
Get all nodes of a specific type
Get indices of all nodes of a specific type
Add a node to the graph. Returns the internal index. If the node already exists, returns the existing index.
String, String, String)Add an undirected edge between two nodes. Both directions are added to the adjacency matrix.
Int32, Int32, String)Add an undirected edge by node indices.
Build the adjacency matrix of the graph. For undirected graph: A[i,j] = 1 if edge exists between i and j.
Compute the degree vector: d[i] = number of neighbors of node i.
Compute the unnormalized Laplacian: L = D - A where D is the diagonal degree matrix and A is the adjacency matrix.
Double)Compute the regularized Laplacian for FELLA diffusion: L_gamma = L + gamma * B where L is the unnormalized Laplacian, gamma is the regularization parameter (typically 1), and B is a diagonal matrix with B[i,i] = 1 for pathway nodes (top-level nodes that "leak" diffusion) and 0 otherwise.
In FELLA, only pathway nodes have the leak term, allowing diffusion signal to escape at the top of the hierarchy, which models the biological intuition that perturbations propagate upward but pathways act as "sinks" for the diffusion process.
Compute the transition matrix for PageRank. M[i,j] = 1/degree(j) if edge (j,i) exists, else 0. This is the column-stochastic transition matrix.
Int32)Get the neighbors of a node.
HashSet(Of Int32))Get a subgraph containing only the specified node indices. Re-indexes nodes from 0.
Print graph statistics.
All nodes in the graph
All edges in the graph
Total number of nodes
Total number of edges