Exporting WGCNA step-to-step network construction objects into igraph object
1
0
Entering edit mode
2.3 years ago
modarzi ▴ 150

Hi, I constructed my weighted network from expression data via step-to-step network construction in WGCNA package. Now, I have an .RData file includes "MEs", "moduleLabels", "moduleColors", "geneTree" and I would like to find an away for exporting this network into igraph object. likewise, I know [wgcna2igraph][1] from limma package but in that I have to construct my network through Automatic, one-step network construction way by blockwiseModules(). but my concern is constructing my network by the step-to-step way and by this method I don't know how to export my objects in WGCNA into igraph object.

I appreciate if anybody shares his/her comment with me.

WGCNA igraph • 3.5k views
ADD COMMENT
0
Entering edit mode

I have installed the package igraph, but it says that the function wgcna2igraph is not available. What to do after creating the iGraph object through igraph::graph.adjacency(TOM) ????? Speaking of what Kevin Blighe mentioned, the function adjacency seems to be unavailable. Could someone please help me out with this// I am New to R.

ADD REPLY
5
Entering edit mode
2.3 years ago

Hey again,

You do not have to use the wgcna2igraph function. Please take a look at the example here: WGCNA

In summary, you can create an igraph object by simply doing something like this:

igraph::graph.adjacency(TOM)

I hope that this helps.

Kevin

ADD COMMENT
0
Entering edit mode

Thanks, Dr. Blighe.

I think your second comment is good: igraph::graph.adjacency(TOM) .

but based on that code, doesn't need any extra argument such as network type and so on?

ADD REPLY
0
Entering edit mode

Yes, you can supply different arguments. In the tutorial to which I linked, however, they utilise that information in a subsequent step, via blockwiseModules():

Here is the sequence of commands (from the tutorial):

adj <- TOM
adj[adj > 0.1] = 1
adj[adj != 1] = 0
network <- graph.adjacency(adj)
network <- simplify(network)  # removes self-loops
results <- blockwiseModules(data, power=6, TOMType="unsigned", networkType="unsigned")
V(network)$color <- results$colors
par(mar=c(0,0,0,0))
# remove unconnected nodes
network <- delete.vertices(network, degree(network)==0)
plot(network, layout=layout.fruchterman.reingold(network), edge.arrow.size = 0.2)
ADD REPLY
0
Entering edit mode

After creating modules using Pairwise correlation, i tried this particular set of functions by varying the Power that i obtained using Soft threshold methods... But the graphics generated looks like a "globe" and involves all the modules.. Kevin Blighe , could you help me getting such networks for individual modules?

ADD REPLY

Login before adding your answer.

Traffic: 1896 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