This is my first time to using R to run analysis, i just follow the tutorial R code and try to learning WGCNA . However, there is a problem that I cannot solve, and the relevant solutions cannot be found online,I am very anxious, I have not been able to solve this problem for several days. PLEASE HELP ME! THANK U VERY MUCH! the problem is when i try to run WGCNA "TOM plot", the error as follow, but i don't know why! if you are familiar with R and WGCNA!help me please. I really need your help and thanks you very very much.
if you need more detail about my data!please leave your email, i can send you everything about this analysis!
> load(net$TOMFiles[1], verbose=T)
Loading objects:
TOM
> TOM <- as.matrix(TOM)
> TOM[1:4,1:4]
1 2 3 4
1 0.000000000 0.17213194 0.008410333 0.138254829
2 0.172131935 0.00000000 0.012847520 0.071286006
3 0.008410333 0.01284752 0.000000000 0.006169962
4 0.138254829 0.07128601 0.006169962 0.000000000
> dissTOM = 1-TOM
> plotTOM = dissTOM^7
> diag(plotTOM) = NA
> moduleColors = labels2colors(moduleLabels)
> TOMplot(plotTOM, net$dendrograms, moduleColors,
+ main = "Network heatmap plot, all genes")
Error in TOMplot(plotTOM, net$dendrograms, moduleColors, main = "Network heatmap plot, all genes") :
ERROR: number of color labels does not equal number of nodes in dissim.
nNodes != dim(dissim)[[1]]
> nSelect = 400
> set.seed(10)
> select = sample(nGenes, size = nSelect)
> selectTOM = dissTOM[select, select]
Error in dissTOM[select, select] : subscript out of bounds
Please confirm that you have followed the main tutorial exactly as it is written. If you have, then there should not appear any error. Looking at your
TOM
object, it seems to have no labels? Also, where do you even initialise themoduleLabels
variable in your code?If you want help, then please help us by providing the complete picture.
Dear kevin,i am so glad that you can replay me, i think i already followed the tutorial exactly, but because I don’t know R, I may have made errors during the analysis. I am so sorry to taking your time but i really need your help. The tutorial as follow:https://blog.csdn.net/qazplm12_3/article/details/80001327 and https://www.jianshu.com/p/1b88b9d1dfc3. The whole code is too long to upload. I will split it and upload! thanks your very much!