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

Hello,

After creating the heatmap, I want to export the WGCNA module information to Cytoscape to create a network. I used:

options(stringsAsFactors = FALSE)
allowWGCNAThreads()
lnames = load(file = "Input.RData");
lnames
lnames=load(file = "networkConstruction-auto.RData");
TOM = TOMsimilarityFromExpr(datExpr, power = 6)  
modules = c("MEmediumpurple2", "MEpalevioletred3", "MEthistle1", "MEthistle2", "MElavenderblush3", "MEdarkturquoise", "MEgreenyellow", "MEskyblue1", "MEorangered4", "MEgrey60", "MEblack")
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 checked that the CytpScapeInput_edges0 file is empty and when I traced back object TOM is also empty in the very beginning. I am not sure what is going wrong. Thank you for the help!

r

Try having just colour names in the vector, modules. e.g "mediumpurple2".

Thank you, it is still the same. As I said in the post, TOM object in a step previous to defining modules is empty.

1 answer

So, I think the error is got. I used:

softPower <- 7 ;
adjacency <- adjacency(datExpr, power = softPower) ;
TOM <- TOMsimilarity(adjacency) ;

to create TOM object and it is not empty.

Log in to answer this question.