
Compute per-node closest distance to another gene set
per_node_distance.RdFor each node in setA, finds the shortest-path distance to the nearest node in setB. Useful for identifying which specific genes are close to or far from a disease module.
Value
A named numeric vector where names are genes from setA and
values are the closest distance to any gene in setB. Genes not
present in the network are omitted. Returns an empty named numeric
vector if no paths exist.
Examples
if (FALSE) { # \dontrun{
g <- build_ppi_network(ppi_df, all_genes)
per_node_distance(g, c("TP53", "BRCA1"), c("EGFR", "VEGFA"))
} # }