get_route: Diffusion

View source: R/get_route.R

get_routeR Documentation

Diffusion

Description

This function spreads a signal over the network from an entrance point (seeds) on the network via the random walk strategy. A particle moves randomly from neighbour to neighbour based on the available connections. In this implementation, it is possible to force the passage through the different layers of the network.

Usage

get_route(
  network,
  closest_dfr,
  signature_vids,
  target_type = c("pathway", "drug/compound")
)

Arguments

network

(igraph) the network for diffusion

closest_dfr

(data.frame) precalculated closest neighbors (the data.frame must contains the columns "SeedNode","type.seed","NodeNames","type.target", see the vignette)

signature_vids

(character) list of seeds, names of vertices in the network

target_type

(character) list of layers to force the diffusion; closest_dfr is filtered based on target types.

Details

For each seed, the nearest neighbours per layer are selected.

Finally, a sub-network is returned by shortest paths including the nearest neighbours per seed.

Value

Return a list with 2 items:

input_diffusion

signature_vids inside the network

network

the resulting subnetork (igraph). In addition, input seeds are tagged in the network (input_diffusion attribute). Also input_gene_signature and input_protein_signature attributes are set to TRUE if corresponding nodes are present in the subnetowrk.

closest

closest_dfr filtered based on seed and target types

Examples

data(liver_1.3_network)
data(liver_1.3_rwr_closest_dfr)
data(signature_maison)

signature_vids <- signature_maison$acetaminophen_all_all

res.diffusion <- get_route(liver_1.3_network, liver_1.3_rwr_closest_dfr, signature_vids)


abodein/NetworkCosmeticEU documentation built on Jan. 29, 2024, 5:37 a.m.