How to combine two networks
4
1
Entering edit mode
3.9 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.0k views
ADD COMMENT
2
Entering edit mode
3.9 years ago
zx8754 11k

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
3.9 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
3.9 years ago
Asaf 10k

A couple of examples from the literature:

ADD COMMENT
0
Entering edit mode
3.9 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: 1807 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