WGCNA Heatmap and Export to Cytoscape Not Working
0
0
Entering edit mode
gianni.drm • 0
@eff02fa2
Last seen 22 months ago
Australia

Hi, I don't have any experience in R and am running a WGCNA on my RNA-Seq time-course data. I got everything working thanks to the tutorials on female mice. However, I cannot get the network visualisation in R working, and also the export to cytoscape. I will address these each in order.

First, I have tried using the following code from the tutorial:

dissTOM = 1-TOMsimilarityFromExpr(datExpr, power = 6);
# Transform dissTOM with a power to make moderately strong connections more visible in the heatmap
plotTOM = dissTOM^7;
# Set diagonal to NA for a nicer plot
diag(plotTOM) = NA;
# Call the plot function
sizeGrWindow(9,9)
TOMplot(plotTOM, geneTree, moduleColors, main = "Network heatmap plot, all genes")

I get: Error in x[, iy] : subscript out of bounds

I also tried:

TOM.mat = as.matrix(TOM)
dissTOM = 1-TOM.mat
# Transform dissTOM with a power to make moderately strong connections more visible in the heatmap
plotTOM = dissTOM^7;
# Set diagonal to NA for a nicer plot
diag(plotTOM) = NA;
# Call the plot function
sizeGrWindow(9,9)
TOMplot(plotTOM, geneTree, moduleColors, main = "Network heatmap plot, all genes")

I get: Error in TOMplot(plotTOM, geneTree, moduleColors, main = "Network heatmap plot, all genes") : ERROR: number of color labels does not equal number of nodes in dissim. nNodes != dim(dissim)[[1]]

Secondly, regarding the export to cytoscape, I have tried numerous code that I obtained from the tutorial and the forum posts, such as:

# Select modules
modules = c("turquoise");

# Select module probes
probes = colnames(datExpr)
inModule = (moduleColors==module);
modProbes = probes[inModule];

# Recalculate intramodular connectivity (IMConn)
IMConn = softConnectivity(datExpr[, modProbes]);

# Select the corresponding Topological Overlap
length(inModule)
modTOM = dissTOM[inModule, inModule];
dimnames(modTOM) = list(modProbes, modProbes)
cyt = exportNetworkToCytoscape(modTOM,
                               edgeFile = paste("CytoscapeInput-edges-", paste(modules, collapse="-"), ".txt", sep=""),
                               nodeFile = paste("CytoscapeInput-nodes-", paste(modules, collapse="-"), ".txt", sep=""),
                               weighted = TRUE,
                               threshold = 0.02,
                               nodeNames = modProbes,
                               nodeAttr = moduleColors[inModule])

AND

module = "blue"
datexpr_green = datExpr[,moduleColors == module]
TOM_green = TOMsimilarityFromExpr(datexpr_green, power = 3, networkType = "signed", TOMType="signed Nowick");
probes = names(datexpr_green)
dimnames(TOM_green) = list(probes, probes)
nTop = 30;
IMConn = softConnectivity(datExpr[, modProbes]);
top = (rank(-IMConn) <= nTop)
cyt = exportNetworkToCytoscape(TOM_green[top, top],
                               edgeFile = paste("CytoscapeInput-edges-", paste(module, collapse="-"), ".txt", sep=""),
                               nodeFile = paste("CytoscapeInput-nodes-", paste(module, collapse="-"), ".txt", sep=""),
                               weighted = TRUE,
                               threshold = 0.02,
                               nodeNames = probes,
                               altNodeNames = probes);

The aforementioned export code produces a text file with no data, only column names. Some of my interesting modules are quite large, hence I would like to restict the cytoscape output to the top X hub genes only.

If someone could please help me get to the bottom of what is going wrong, that would be immensely appreciated.

As mentioned, I can generate the geneInfo files and module-trait relationships just fine, but the network and eigengene plots are beyond my skills. I have re-run the entire code from scratch multiple times.

Thank you, Gianni

Cytoscape Heatmap heatmaps WGCNA • 1.2k views
ADD COMMENT

Login before adding your answer.

Traffic: 469 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