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