
Retrieve Neighboring Nodes in a Knowledge Graph
get_neighboring_nodes.RdThis 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_netigraph object.- degree_expansion
An integer indicating the radius (in number of hops) to expand the search for neighbors. For example,
degree_expansion = 1returns first-degree (direct) neighbors, whiledegree_expansion = 2includes both direct and second-degree (indirect) neighbors.- subnetwork
An
igraphobject (typically a subgraph oftkoi_net) in which the neighborhood search will be performed.
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.