How to combine two networks
4
1
Entering edit mode
4.5 years ago
mail2steff ▴ 70

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 • 3.3k views
ADD COMMENT
2
Entering edit mode
4.5 years ago
zx8754 12k

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")
ADD COMMENT
1
Entering edit mode
4.5 years ago
scooter ▴ 620

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

ADD COMMENT
0
Entering edit mode
4.5 years ago
Asaf 10k

A couple of examples from the literature:

ADD COMMENT
0
Entering edit mode
4.5 years ago
pixie@bioinfo ★ 1.5k

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.

ADD COMMENT

Login before adding your answer.

Traffic: 1684 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6