WGCNA heatmap error
0
0
Entering edit mode
4.4 years ago
evelyn ▴ 230

Hello,

I am doing network analysis for RNA-seq using WGCNA. I have created the modules and now constructing phenotype module relationship. I am getting an error in the heat map step:

 labeledHeatmap(Matrix = moduleTraitCor,
         xLabels = colnames(datTraits),
         yLabels = names(MEs),
         ySymbols = names(MEs),
         colorLabels = FALSE,
         colors = greenWhiteRed(50),
         textMatrix = textMatrix,
         setStdMargins = FALSE,
         cex.text = 0.5,
         zlim = c(-1,1),
         main = paste("Module-trait relationships"))
         dev.off()

The error is:

Error in colorMatrix[, c] : incorrect number of dimensions.
In addition: Warning message:
In greenWhiteRed(50) :
  WGCNA::greenWhiteRed: this palette is not suitable for people
with green-red color blindness (the most common kind of color blindness).
Consider using the function blueWhiteRed instead.

Thank you for the help!

RNA-Seq • 4.1k views
ADD COMMENT
0
Entering edit mode

Have you check, whether the dimensions of moduleTratCor are consistent with lengths of xLabels and yLabels? dim(moduleTraitCor) == c(length(names(MEs)), length(colnames(datTraits)))

ADD REPLY
0
Entering edit mode

Thank you, I have got [1] TRUE TRUE after checking the dimensions.

ADD REPLY
0
Entering edit mode

Maybe because you have more modules than colors? Try to increase the values in 'greenWhiteRed()'.

ADD REPLY
0
Entering edit mode

Thank you! Yes, I had 80 modules and I increased the values in 'greenWhiteRed()'. But still got the same error.

ADD REPLY
1
Entering edit mode

i also have such error,but its ok after i change the table of phenotype,it means you should at least have more than 1 category in trait table,if you just choose one clinical feature,it can't work.

ADD REPLY
0
Entering edit mode

The colorMatrix argument was introduced in labeledHeatmap function starting from WGCNA 1.69. As an option, you may try to use an older WGCNA version. Quick and dirty way to try it is a direct loading of an old labeledHeatmap version (e.g., execution of the function code itself, for example, from https://www.rdocumentation.org/packages/WGCNA/versions/1.68/topics/labeledHeatmap). Of course, it may be not compatible with the newer WGCNA version, but you'll see it from errors - if they occur, you may install the whole old version of the WGCNA package instead.

In addition, it may be helpful to switch as many as possible arguments to their default values, keeping in your example above only Matrix and xLabels, and finally, to replace even these by some bogus data with the same dimensions.

ADD REPLY

Login before adding your answer.

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