View source: R/proximity_avr_weighted.R
proximity_average_weighted | R Documentation |
Calculates the weighted average proximity from source to targets.
proximity_average_weighted(G, source, targets)
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) |
the proximity value for the source-targets
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.