Hello,
I am trying to follow along with the network generation/cluster generation part of the WGCNA tutorial: https://labs.genetics.ucla.edu/horvath/CoexpressionNetwork/Rpackages/WGCNA/Tutorials/FemaleLiver-02-networkConstr-blockwise.pdf
I am getting the same error regardless of whether I use data for the tutorial or my own RNA-Seq data (both are data frames).
The command that throws the error is (this is the version using tutorial data):
bwnet = blockwiseModules(datExpr, power = 6,
+ TOMType = "unsigned", minModuleSize = 30,
+ reassignThreshold = 0, mergeCutHeight = 0.25,
+ numericLabels = TRUE,
+ maxBlockSize = 2000,
+ saveTOMs = TRUE,
+ saveTOMFileBase = "tstTOM",
+ verbose = 3)
The output I get is:
Calculating module eigengenes block-wise from all genes
Flagging genes and samples with too many missing values...
..step 1
Cluster size 3600 broken into 2133 1467
Cluster size 2133 broken into 1221 912
Done cluster 1221
Done cluster 912
Done cluster 2133
Done cluster 1467
....pre-clustering genes to determine blocks..
Projective K-means:
projectiveKMeans: imputing missing data in 'datExpr'.
To reproduce older results, use 'imputeMissing = FALSE'.
Cluster size 3600 broken into 2133 1467
Cluster size 2133 broken into 1221 912
Done cluster 1221
Done cluster 912
Done cluster 2133
Done cluster 1467
..k-means clustering..
..merging smaller clusters...
Block sizes:
gBlocks
1 2
1973 1627
..Working on block 1 .
TOM calculation: adjacency..
..will not use multithreading.
Fraction of slow calculations: 0.426707
..connectivity..
..matrix multiplication (system BLAS)..
..normalization..
..done.
..saving TOM for block 1 into file cnv16pTOM-block.1.RData
....clustering..
....detecting modules..
....calculating module eigengenes..
....checking kME in modules..
..removing 6 genes from module 1 because their KME is too low.
..Working on block 2 .
TOM calculation: adjacency..
..will not use multithreading.
Fraction of slow calculations: 0.358721
..connectivity..
..matrix multiplication (system BLAS)..
..normalization..
..done.
..saving TOM for block 2 into file cnv16pTOM-block.2.RData
....clustering..
....detecting modules..
....calculating module eigengenes..
....checking kME in modules..
..removing 1 genes from module 1 because their KME is too low.
Error in (function (x, y = NULL, use = "everything", method = c("pearson", :
unused arguments (weights.x = NULL, weights.y = NULL, cosine = FALSE)
As far as I can tell, the WGCNA library is installed correctly. Can anyone identify what might be causing this "Error in (function..." error? Any ideas as to how to start fixing it?
Thank you!
I think I tackle the problem. There is a conflict between the WGCNA and the other packages. the other package have a function the same as the other in WGCNA in the run r studio. when I library no packages other than WGCNA, the program runs well and get the module. Thanks for professor Kevin Blighe's advice.
You're welcome, wonderfulzhu1985
As correctly answered by multiple people here, the problem is that WGCNA has its own function "cor" and this correlates in the namespace with "cor" from the package stats.
Rather than loading and unloading modules or restarting R one might as well temporarily re-assign the function:
I am a new in learning the WGCNA, and I also encounter the same problem detailed in your question. Please see: Error in (function...) thrown by WGCNA
I have do many tries to tackle the problem by adjust the parameters. I also try many methods as the other author do in some literature. while they cannot get rid of the warning and acquire the module. So I deeply appreciate the help from you to tackle it. Thanks very much.
Did you try to restart your computer, reload R, and then install / load the WGCNA package as the very first thing that you do in the new R session?