pathway.structure.plot: Extensions to iGraph for Plotting Pathway Structure

Description Usage Arguments Examples

Description

Functions to plot outcomes for testing pathway structure with permutation analysis.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
pathway_perm_plot_density(table_obj, method = "absolute", main = NULL,
  sub = NULL, xlab = "up - down events", ylab = "density", xlim = NULL,
  ylim = NULL, cex.lab = 1, guide = TRUE, legend = TRUE,
  annotate = TRUE, cex.legend = 1, cex.annotation = 1, col = "black")

pathway_perm_lines_density(table_obj, method = "absolute", col = "black")

pathway_perm_plot_raw(table_obj, main = NULL, sub = NULL,
  xlab = "up events", ylab = "down events", cex.lab = 1, col = "black",
  cex = 1, pch = 1)

permutation.structure.proportion(table_obj, method = "absolute")

Arguments

table_obj

List. Output of pathway.structure

method

Specifies metric for comparision of up and down events: "absolute" (1) for difference or "relative" (2) ratio. May be given as a character or numeric input. Defaults to absolute.

main, sub, xlab, ylab, xlim, ylim, cex.lab, col, cex, pch

Arguments to pass on to plot or plot.density

guide, legend, annotate

Logical. Whether guide lines, legend, or p-value annotation is included on the density plot. Default to TRUE.

cex.legend, cex.annotation

numeric. Relative expansion of legend and annotation test in density plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#generate example graphs
library("igraph")
graph <- make_graph(unlist(lapply(letters, function(x) rep(x, 2)))[2:51], directed = TRUE)
plot(graph)

#Example states
test.structure(graph, "a", "c")
source <- sample(letters, 10)
target <- sample(letters, 10)
V(graph)$color <- ifelse(names(V(graph)) %in% source, "lightblue", "grey75")  
V(graph)$color <- ifelse(names(V(graph)) %in% target, "palevioletred", V(graph)$color)  
V(graph)$color <- ifelse(names(V(graph)) %in% intersect(source, target),
                         "mediumpurple2", V(graph)$color)  
plot(graph, layout = layout.fruchterman.reingold, vertex.color= V(graph)$color, 
    vertex.label.family = "mono", vertex.size = 10, vertex.label.color = "black", 
    vertex.frame.color= "grey50", main = graph$name)
matrix.structure(graph, source, target)
table(matrix.structure(graph, source, target))
perm_table <- permutation.structure(graph, source, target, letters)

#Plot Density Output of Permutation Test
pathway_perm_plot_density(perm_table)

#Plot Density Output of Permutation Test
perm_table <- permutation.structure(graph, source, target, letters)
pathway_perm_plot_density(perm_table)
perm_table2 <- permutation.structure(graph, source, target, letters, fixed_intersect = TRUE)
pathway_perm_lines_density(perm_table2, col="lightblue")

#Plot Raw Output of Permutation Test
pathway_perm_plot_raw(perm_table)

permutation.structure.proportion(perm_table) # defaults to absolute
permutation.structure.proportion(perm_table, method = "relative")

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