Hi, I am trying to export network to cytoscape using WGCNA. I am selecting top 30 genes to export following the tutorial given by WGCNA authors.
In the following snippet of codes, nodeNames = modgenes selects the first 30 genes from genelist within module, not the top 30 genes. Inside the "cyt" function, modTOM[top,top] does provide right matrix with gene names, but once we export, the 30 genes are first 30 genes, not the top 30 genes. I am sure there is something that needs to be changed in "nodeNames = modgenes" section, but not sure how to address this.<h6>#</h6>
modules = "blue" genes = names(soyseq.t) inModule = is.finite(match(moduleColors, modules)) modgenes = genes[inModule] modGenes = annot$TAIR[match(modgenes, annot$SoyID)] # Select the corresponding Topological Overlap modTOM = TOM[inModule, inModule] dimnames(modTOM) = list(modgenes, modgenes) nTop = 30; IMConn = softConnectivity(soyseq.t[, modgenes]); top = (rank(-IMConn) <= nTop) # Export the network into edge and node list files Cytoscape can read cyt = exportNetworkToCytoscape(modTOM[top,top], edgeFile = paste("CytoscapeInput-edges-", paste(modules, collapse="-"), ".txt", sep=""), nodeFile = paste("CytoscapeInput-nodes-", paste(modules, collapse="-"), ".txt", sep=""), weighted = TRUE, threshold = 0.02, nodeNames = modgenes, altNodeNames = modGenes, nodeAttr = moduleColors[inModule])