avr_proximity_multiple_target_sets: avr_proximity_multiple_target_sets

View source: R/prox_boot.R

avr_proximity_multiple_target_setsR Documentation

avr_proximity_multiple_target_sets

Description

Calculates the average proximity from a set of targets to a set of source nodes. It is calculate using a degree preserving randomization. It is calculated as described in Guney, E. et al (2016) <doi.org:10.1038/ncomms10331>

Usage

avr_proximity_multiple_target_sets(
  set,
  G,
  ST,
  source,
  N = 1000,
  bins = 100,
  min_per_bin = 20,
  weighted = FALSE
)

Arguments

set

Name of the sets you have targets for. (In a drug-target setup, those would be the drugs of interest).

G

The original graph (often an interactome).

ST

Set-Target data. It is a data.frame with two columns. ID and Target.

source

The source nodes (disease genes).

N

Number of randomizations.

bins

the number os bins for the degree preserving randomization.

min_per_bin

the minimum size of each bin.

weighted

consider a weighted graph? TRUE/FALSE

Value

proximity and its significance based on the degree preserving randomization.

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 )
S = c("N", "A", "F", "I")
T1 = data.frame(ID = "T1", Target = c("H", "M"))
T2 = data.frame(ID = "T2", Target = c("G", "O"))

avr_proximity_multiple_target_sets(set = c('T1', 'T2'),
G = g,
 source = S,
 ST = rbind(T1,T2),
 bins = 1,
 min_per_bin = 2)

# In a weighted graph
# avr_proximity_multiple_target_sets(set = c('T1', 'T2'),
# G = g,
#  source = S,
#  ST = rbind(T1,T2),
#  bins = 1,
#  min_per_bin = 2,
#  weighted = TRUE)


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