pathway.structure: Extensions to iGraph for Pathway Structure

Description Usage Arguments Examples

Description

Functions to compute the pathway structure of different states within a network with testing pathway structure with permutation analysis. Uses shortest paths to compute the structure between nodes of differing states. Shortest paths are computed in advance where possible to reduce computational redundancy.

Usage

1
2
3
4
5
6
7
8
9
test.structure(graph, target_node, source_node, shortest.paths.in = NULL)

matrix.structure(graph, target_vec, source_vec,
  pathway_structure_nodes = NULL, shortest.paths.in = NULL,
  remove_intersect = T)

permutation.structure(graph, target, source, universe,
  shortest.paths.in = NULL, reps = 1000, fixed_intersect = FALSE,
  remove_intersect = T)

Arguments

graph

An igraph-package object. May be directed or weighted as long as a shortest path can be computed.

shortest.paths.in

Defaults to NULL leading to computing the shortest paths from the input graph where necessary, these may be given as computed in advance (or passed from higher functions) to reduce computational redundancy.

pathway_structure_nodes

Defaults to NULL as uses all nodes in the graph. Gives the nodes for which paths are used to evaluate pathway structure.

remove_intersect

logical. Defaults to TRUE. Whether the intersecting states are used in computing the number of upstream or downstream events.

target, target_node, target_vec

string: vector of target states for testing pathway structure. Must be a single string for target_node. These are cross referenced against V(graph)$name.

source, source_node, source_vec

string: vector of source states for testing pathway structure. Must be a single string for source_node. These are cross referenced against V(graph)$name.

universe

string vector of potential nodes to be assigned target and\/or source states. This may be V(graph)$name, and subset thereof, or a larger pool of nodes to assign states for permutation analysis.

reps

scalar numeric. Number of permutations to statistically test the structure of the network.

fixed_intersect

logical. Defaults to FALSE. Whether number of intersecting states is fixed to the same in permutations as the input states.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#generate example graphs
library("igraph")
g1 <- make_ring(10)
V(g1)$name <- letters[1:10]
g2 <- make_star(10)
V(g2)$name <- letters[1:10]

#test pathway structure between two points
test.structure(g1, "a", "c")
test.structure(g2, "a", "c")

#test pathway structure between two vectors of points
matrix.structure(g1, letters[1:5], letters[5:7])
matrix.structure(g2, letters[1:5], letters[5:7])

#test pathway structure between two vectors of points with permutations
permutation.structure(g1, letters[1:5], letters[5:7], letters)
permutation.structure(g2, letters[1:5], letters[5:7], letters)

TomKellyGenetics/pathway.structure.permutation documentation built on May 9, 2019, 4:53 p.m.