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

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 • 4.8k views
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.

5
Entering edit mode
3.1 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

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?

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
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)

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?