WGCNA exportNetworkToCytoscape issue!!
1
0
Entering edit mode
6.2 years ago
b.g.tamang ▴ 20

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])
<h6>#</h6>
WGCNA R • 4.9k views
ADD COMMENT
0
Entering edit mode

Hello, I know WGCNA use TOM , the function exportNetworkToCytoscape needs adjacency matrix as input. It's TOM suits here?

ADD REPLY
2
Entering edit mode
6.2 years ago
b.g.tamang ▴ 20

Solved the issue myself by adding two more line of codes as shown below where I sorted the module gene list according to the rank.

modules = "blue"
genes = names(soyseq.t)
inModule = is.finite(match(moduleColors, modules))

modgenes = genes[inModule]

top.genes.logical = cbind(modgenes,top) ;
top.genes.sort = as.matrix (top.genes.logical[order(-top, modgenes)])

modGenes = annot$TAIR[match(top.genes.sort, annot$SoyID)]
ADD COMMENT
0
Entering edit mode

I tried this but for my module it is still giving all genes instead of the top 30. After your modGenes call, everything else remained the same? This doesn't make sense because your top.genes.sort calls 'top' but according to your update, if the two lines you added come before modGenes then you are calling 'top' after modGenes..so this can't work.

ADD REPLY

Login before adding your answer.

Traffic: 1812 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6