Skip to contents

Retrieves all nodes within a specified number of hops (degree expansion) from a given node in a network. This is useful for defining local subgraphs or identifying nodes in the immediate or extended neighborhood of a protein node.

Usage

get_neighboring_nodes(
  protein_node_id,
  degree_expansion,
  subnetwork = pkoi::pkoi_net
)

Arguments

protein_node_id

A character string corresponding to the name (ID) of the protein node in the graph.

degree_expansion

An integer indicating how many hops away from the node to include in the neighborhood. For example, `degree_expansion = 1` returns direct neighbors, while `degree_expansion = 2` returns nodes up to two steps away.

subnetwork

An `igraph` object representing the graph from which to extract neighbors. Default is `pkoi::pkoi_net`.

Value

A character vector of node IDs representing the neighboring nodes within the specified degree expansion.