proximity_average_weighted: Proximity from target to source

View source: R/proximity_avr_weighted.R

proximity_average_weightedR Documentation

Proximity from target to source

Description

Calculates the weighted average proximity from source to targets.

Usage

proximity_average_weighted(G, source, targets)

Arguments

G

The original graph (often a weighted 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)
net$weight = runif(nrow(net))
g <- igraph::graph_from_data_frame(net, directed = FALSE )
T = c("G", "A", "D")
S = c("C", "M")
proximity_average_weighted(g, source = S, targets = T)

NetSci documentation built on July 4, 2022, 1:05 a.m.