This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to combine two networks

Dear All, I have two networks. Both the networks have common nodes as well as unique nodes. Is there any way I can combine both and analyze??

network igraph cytoscape

4 answers

Using R igraph union:

library(igraph)

net1 <- graph_from_literal(A-B:C:D, A-C, B-C)
net2 <- graph_from_literal(A-X:Y:Z, Z-Y)

par(mfrow = c(1, 3))
set.seed(1)
plot(net1, vertex.size = 50, main = "net1")
plot(net2, vertex.size = 50, main = "net2")
plot(union(net1, net2), , vertex.size = 50, main = "union of net1 and net2")

Sure. Read both networks into Cytoscape, and then use the Network Merge tool to do a Union. The resulting network should be what you want.

-- scooter

A couple of examples from the literature:

If they are in the form of edge-lists, you can append the two edge lists one after another and make a common edgelist. Then load it in Cytoscape and there is an option to remove duplicate edges. Don"t forget to add node and/or edge attributes to know which gene/edge is unique or common. Based on this, you can color your nodes/edges differently. HTH.

Log in to answer this question.