This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to create a file from WGCNA to Cytoscape

Hello,

I have 50 traits and WGCNA analysis identified 97 modules. I want to make a network figure using Cytoscape for all the traits. I found this code to use for this purpose:

load(file = "dataInput.RData"); 
load(file = "networkConstruction.RData");
softPower <- 7 ;
adjacency <- adjacency(datExpr, power = softPower) ;
TOM <- TOMsimilarity(adjacency) ;
modules = c(---)
probes = colnames(datExpr) 
inModule = is.finite(match(moduleColors, modules));
modProbes = probes[inModule];
modTOM = TOM[inModule, inModule];
dimnames(modTOM) = list(modProbes, modProbes)
cyt = exportNetworkToCytoscape(modTOM,
                               edgeFile = paste("CytoscapeInput-edges0-", paste(modules, collapse="-"), ".txt", sep=""),
                               nodeFile = paste("CytoscapeInput-nodes0-", paste(modules, collapse="-"), ".txt", sep=""),
                               weighted = TRUE,
                               threshold = 0,
                               nodeNames = modProbes,
                               nodeAttr = moduleColors[inModule]);

I have both .RData files. I am not sure which modules to add in this code. Do I need to add all the identified modules, then how can I extract their names. Thanks!

next-gen

Yes, it was solved. TOM is not empty now.

Great - I have marked it as accepted. Also, I just assume that it's coincidence that your question is remarkably similar to this one: https://support.bioconductor.org/p/132734/

In relation to your original question (above), you may need to explain better what you want to do. You are already passing module information via nodeAttr = moduleColors[inModule]

Hi Kevin Blighe,

I have done WGCNA analysis and wanted to export the network for WGCNA Analysis but its so large that I could not open it in Cytoscape. Even I tried to export a single module but it is also too large. if I put the threshold high then I can reduce the size and open it in Cytoscape but it also eliminates the hub gene detected by chooseTopHubInEachModule() function.

What should I do?

Thanks

Hi, sounds like an issue for Cytoscape, and / or your own computer's hardware limitations. Your decision about what to do is better than mine, as you know better your own data.

0 answers

No answers yet.

Log in to answer this question.