library(simtrn)
library(igraph)
foo <- sim_trn(nreg = 3, ngene = 5, seed = 12)
m <- cbind(foo$reg_value, foo$gene_value)

g <- graph_from_incidence_matrix(foo$mod_info, directed = TRUE, mode = "out", weighted = TRUE)
l <- layout.bipartite(g)

V(g)$size <- colMeans(m) * 5

E(g)$width <- E(g)$weight

V(g)$color = "grey"
V(g)[type]$color <- "orange"
V(g)$shape = "square"
V(g)[type]$shape <- "circle"
plot(g, layout = l)
heatmap(m)


ddiez/simtrn documentation built on May 15, 2019, 1:52 a.m.