This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Exporting WGCNA step-to-step network construction objects into igraph object

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

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.

1 answer

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

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?

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)

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?

Log in to answer this question.