2022-11-25 WGCNA包的blockwiseModules函数报错

net = blockwiseModules(datExpr, power = 6,
                       TOMType = "unsigned", minModuleSize = 30,
                       reassignThreshold = 0, mergeCutHeight = 0.25,
                       numericLabels = TRUE, pamRespectsDendro = FALSE,
                       saveTOMs = TRUE,
                       saveTOMFileBase = "femaleMouseTOM",
                       verbose = 3)

报错:Error in (new("standardGeneric", .Data = function (x, y = NULL, use = "everything", :
unused arguments (weights.x = NULL, weights.y = NULL, cosine = FALSE)
原因为:WGCNA与其他软件包之间存在冲突。另一个包在run r studio中的WGCNA中具有与另一个相同的功能。WGCNA有自己的功能“cor”,这与命名空间中的“cor”相关联。
解决方法为:在使用该函数之前暂时重新分配功能,见下方正确用法

cor <- WGCNA::cor
net = blockwiseModules(datExpr, power = 6,
                       TOMType = "unsigned", minModuleSize = 30,
                       reassignThreshold = 0, mergeCutHeight = 0.25,
                       numericLabels = TRUE, pamRespectsDendro = FALSE,
                       saveTOMs = TRUE,
                       saveTOMFileBase = "femaleMouseTOM",
                       verbose = 3)
table(net$colors)
cor <- stats::cor

参考:转录组:WGCNA包使用报错_楚鸿的博客-CSDN博客

你可能感兴趣的:(2022-11-25 WGCNA包的blockwiseModules函数报错)