Error when calling module_stability for networks with cor_method biweight
Closed this issue · 2 comments
Hey all, great package! Thanks for putting this together.
This is a very simple bug. When calling module_stability on a network created with cor_method = biweight,
line 7: cor_method <- net$params$cor_method
will be biweight and when should be bicor when you try to pass that to WGCNA here:
lines 10-15:
mods0 <- WGCNA::sampledBlockwiseModules(nRuns = nRuns, replace = FALSE,
datExpr = expr, maxBlockSize = 5000, checkSoftPower = FALSE,
corType = cor_method, networkType = net_type, TOMType = TOMType,
TOMDenom = "mean", mergeCutHeight = module_merging_threshold,
reassignThreshold = 0, numericLabels = FALSE, checkMissingData = FALSE,
quickCor = 0, verbose = 2)
Of course we can just change that with net$params$cor_method <- "bicor"
before running module_stability, but I figured I'd let you know anyway.
Thanks again for creating this great resource.
Hi, @jucapitanio
Thanks a lot for the positive feedback and for reporting this issue.
Based on your workaround, the issue can fixed by adding a single line of code:
cor_method <- ifelse(cor_method == "biweight", "bicor", cor_method)
I'll let you know once I push an updated version with the bug fix.
Best,
Fabricio
Fixed in version 1.9.2.