singleNode.getNodeRanksMovie: Capture the movement of the fixed, single-node walk of the...

Description Usage Arguments Value Examples

View source: R/singleNode.getNodeRanksMovie.r

Description

Make a movie of the fixed, single-node walk the diffusion probability method makes in search of a given patient's perturbed variables.

Usage

1
2
singleNode.getNodeRanksMovie(subset.nodes, ig, output_filepath,
  num.misses = NULL, zoomIn = FALSE)

Arguments

subset.nodes

- The subset of variables, S, in a background graph, G.

ig

- The igraph object associated with the background knowledge graph.

output_filepath

- The local directory at which you want still images to be saved.

zoomIn

- Boolean. Delete nodes outside of node subset's order 1 neighborhood?. Default is FALSE.

movie

- If you want to make a movie, set to TRUE. This will produce a set of still images that you can stream together to make a movie. Default is TRUE. Alternatively (movie=FALSE), you could use this function to get the node labels returned for each node ranking starting with a perturbed variable.

Value

ranksByStartNode - a list object of node rankings Each element is based on a different startNode. Images are also generated in the output_directory specified.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Read in any network via its adjacency matrix
tmp = matrix(1, nrow=100, ncol=100)
for (i in 1:100) {
  for (j in 1:100) {
    tmp[i, j] = rnorm(1, mean=0, sd=1)
  }
}
colnames(tmp) = sprintf("Compound%d", 1:100)
ig = graph.adjacency(tmp, mode="undirected", weighted=TRUE, add.colnames="name")
V(ig)$name = tolower(V(ig)$name)
adjacency_matrix = list(tmp) # MUST BE GLOBAL VARIABLE
# Set other tuning parameters
p0=0.1  # 10% of probability distributed uniformly
p1=0.9  # 90% of probability diffused based on edge weights in networks
thresholdDiff=0.01
G = vector(mode="list", length=length(V(ig)$name))
names(G) = V(ig)$name
subset.nodes = names(G)[sample(1:length(G), 3)]
singleNode.getNodeRanksMovie(subset.nodes, ig, output_filepath = getwd())

BRL-BCM/CTD documentation built on Feb. 7, 2020, 1:42 a.m.