Question: Exporting WGCNA step-to-step network construction objects into igraph object
0
gravatar for modarzi
13 months ago by
modarzi140
modarzi140 wrote:

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.

igraph wgcna • 1.4k views
ADD COMMENTlink modified 13 months ago by Kevin Blighe68k • written 13 months ago by modarzi140
3
gravatar for Kevin Blighe
13 months ago by
Kevin Blighe68k
Republic of Ireland
Kevin Blighe68k wrote:

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 COMMENTlink written 13 months ago by Kevin Blighe68k

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 REPLYlink written 13 months ago by modarzi140

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 REPLYlink written 13 months ago by Kevin Blighe68k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1115 users visited in the last hour