
Retrieve Neighboring Nodes in a Knowledge Graph
get_neighboring_nodes.Rd
This function returns all neighboring nodes for a given gene node ID in the tKOI knowledge graph.
The neighborhood is defined by the number of hops (degree_expansion
) from the input node.
Arguments
- gene_node_id
A character string representing the unique node ID of a gene in the
tkoi::tkoi_net
igraph object.- degree_expansion
An integer indicating the radius (in number of hops) to expand the search for neighbors. For example,
degree_expansion = 1
returns first-degree (direct) neighbors, whiledegree_expansion = 2
includes both direct and second-degree (indirect) neighbors.
Details
The function leverages the igraph::ego()
function to extract the subgraph containing all nodes within a specified path length
from the target node. It then returns the node IDs (as character vector) of these neighbors.
This is useful in the tKOI pipeline for assessing local network topology around significantly altered genes.