proximity_average: Proximity from target to source

View source: R/proximity_avr.R

proximity_averageR Documentation

Proximity from target to source

Description

Calculates the proximity (average or closest) from source to targets.

Usage

proximity_average(G, source, targets)

Arguments

G

The original graph (often an interactome).

source

nodes from the network (in a drug repurpusing set-up those are the disease genes)

targets

targets in the network (in a drug repurpusing set-up those are the drug-targets)

Value

the proximity value for the source-targets

Examples

#' set.seed(666)
net  = data.frame(
Node.1 = sample(LETTERS[1:15], 15, replace = TRUE),
Node.2 = sample(LETTERS[1:10], 15, replace = TRUE))
net$value = 1
net =  CoDiNA::OrderNames(net)
net = unique(net)

g <- igraph::graph_from_data_frame(net, directed = FALSE )
T = c("G", "A", "D")
S = c("C", "M")
proximity_average(g, source = S, targets = T)

NetSci documentation built on Oct. 14, 2024, 5:08 p.m.