library(igraph)
These two data frames contain information about edges and counts
# first column: vertex1; second column: vertex2
head(tls)
## V1 V2
## 1 1 1443
## 2 1 868
## 3 1 3623
## 4 1 790
## 5 1 2206
## 6 2 3624
# first column: vertex name; second column: counts-expression
head(c)
## V1 V2
## 1 1 542607
## 2 2 17963
## 3 3 1624431
## 4 4 227791
## 5 5 154312
## 6 6 7198
And the result is the following network. Red indicates low expresison, and yellow, high expression.Each vertex is a location, and edges show locations sharing all or some sRNAs.
c$col <- cut(log2(c$V2), breaks = c(-1, 12, 15, 23), labels = heat.colors(3))
g <- graph.data.frame(tls, directed = F, vertices = c)
plot(g, layout = layout.fruchterman.reingold, vertex.color = V(g)$col, vertex.size = 2,
vertex.label = NA, edge.arrow.size = 0.3, vertex.frame.color = V(g)$col)