Error in running WGCNA

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

Calculating module eigengenes block-wise from all genes
Flagging genes and samples with too many missing values...
..step 1
....pre-clustering genes to determine blocks..
Projective K-means:
..k-means clustering..
..merging smaller clusters...
Block sizes:
gBlocks
1 2 3
4947 3284 3053
..Working on block 1 .
TOM calculation: adjacency..
..will use 11 parallel threads.
Fraction of slow calculations: 0.000000
..connectivity..
..matrix multiplication (system BLAS)..
..normalization..
..done.
..saving TOM for block 1 into file BCell_TOM-block.1.RData
....clustering..
....detecting modules..
....calculating module eigengenes..
....checking kME in modules..
..removing 326 genes from module 1 because their KME is too low.
..removing 226 genes from module 2 because their KME is too low.
..removing 3 genes from module 4 because their KME is too low.
..removing 4 genes from module 5 because their KME is too low.
..Working on block 2 .
TOM calculation: adjacency..
..will use 11 parallel threads.
Fraction of slow calculations: 0.000000
..connectivity..
..matrix multiplication (system BLAS)..
..normalization..
..done.
..saving TOM for block 2 into file BCell_TOM-block.2.RData
....clustering..
....detecting modules..
....calculating module eigengenes..
....checking kME in modules..
..removing 198 genes from module 1 because their KME is too low.
..removing 25 genes from module 2 because their KME is too low.
..removing 32 genes from module 3 because their KME is too low.
..removing 7 genes from module 4 because their KME is too low.
..removing 1 genes from module 5 because their KME is too low.
..removing 6 genes from module 6 because their KME is too low.
..removing 6 genes from module 7 because their KME is too low.
..removing 11 genes from module 9 because their KME is too low.
..removing 6 genes from module 10 because their KME is too low.
..removing 1 genes from module 17 because their KME is too low.
..Working on block 3 .
TOM calculation: adjacency..
..will use 11 parallel threads.
Fraction of slow calculations: 0.000000
..connectivity..
..matrix multiplication (system BLAS)..
..normalization..
..done.
..saving TOM for block 3 into file BCell_TOM-block.3.RData
....clustering..
....detecting modules..
....calculating module eigengenes..
....checking kME in modules..
..removing 143 genes from module 1 because their KME is too low.
..removing 33 genes from module 2 because their KME is too low.
..removing 48 genes from module 3 because their KME is too low.
..removing 44 genes from module 4 because their KME is too low.
..removing 22 genes from module 5 because their KME is too low.
..removing 18 genes from module 6 because their KME is too low.
..removing 2 genes from module 7 because their KME is too low.
..removing 2 genes from module 9 because their KME is too low.

Error in (new("standardGeneric", .Data = function (x, y = NULL, use = "everything", : unused arguments (weights.x = NULL, weights.y = NULL, cosine = FALSE)
Traceback:

  1. blockwiseModules(datExpr, power = softPower, TOMType = "unsigned",
    . minModuleSize = 30, reassignThreshold = 0, mergeCutHeight = 0.25,
    . numericLabels = TRUE, pamRespectsDendro = FALSE, saveTOMs = TRUE,
    . saveTOMFileBase = "SLE_BCell_TOM", verbose = 3)
  2. do.call(match.fun(corFnc), c(list(datExpr[, goodLabels != 0],
    . AllMEs), if (corFncAcceptsWeights) list(weights.x = if (haveWeights) weights[,
    . goodLabels != 0] else NULL, weights.y = NULL) else NULL,
    . corOptions))

#############################################
在biostas問答版的帖子中就有高手做出了解答:## Error in (function...) thrown by WGCNA tutorial (R)

原因為:WGCNA與其他軟件包之間存在沖突隧哮。WGCNA中的cor函數(shù)與R中自帶的cor在命名空間上有沖突朽缎。
解決方法為:在使用該函數(shù)之前暫時重新分配功能锋玲,見下方正確用法
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)
cor<-stats::cor

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:

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市判莉,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖啦撮,帶你破解...
    沈念sama閱讀 221,430評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件具帮,死亡現(xiàn)場離奇詭異博肋,居然都是意外死亡,警方通過查閱死者的電腦和手機蜂厅,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,406評論 3 398
  • 文/潘曉璐 我一進店門匪凡,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人掘猿,你說我怎么就攤上這事病游。” “怎么了稠通?”我有些...
    開封第一講書人閱讀 167,834評論 0 360
  • 文/不壞的土叔 我叫張陵衬衬,是天一觀的道長。 經(jīng)常有香客問我改橘,道長佣耐,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,543評論 1 296
  • 正文 為了忘掉前任唧龄,我火速辦了婚禮兼砖,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘既棺。我一直安慰自己讽挟,他們只是感情好,可當我...
    茶點故事閱讀 68,547評論 6 397
  • 文/花漫 我一把揭開白布丸冕。 她就那樣靜靜地躺著耽梅,像睡著了一般。 火紅的嫁衣襯著肌膚如雪胖烛。 梳的紋絲不亂的頭發(fā)上眼姐,一...
    開封第一講書人閱讀 52,196評論 1 308
  • 那天,我揣著相機與錄音佩番,去河邊找鬼众旗。 笑死,一個胖子當著我的面吹牛趟畏,可吹牛的內(nèi)容都是我干的贡歧。 我是一名探鬼主播,決...
    沈念sama閱讀 40,776評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼利朵!你這毒婦竟也來了律想?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,671評論 0 276
  • 序言:老撾萬榮一對情侶失蹤绍弟,失蹤者是張志新(化名)和其女友劉穎技即,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體樟遣,經(jīng)...
    沈念sama閱讀 46,221評論 1 320
  • 正文 獨居荒郊野嶺守林人離奇死亡而叼,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,303評論 3 340
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了年碘。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片澈歉。...
    茶點故事閱讀 40,444評論 1 352
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖屿衅,靈堂內(nèi)的尸體忽然破棺而出埃难,到底是詐尸還是另有隱情,我是刑警寧澤涤久,帶...
    沈念sama閱讀 36,134評論 5 350
  • 正文 年R本政府宣布涡尘,位于F島的核電站,受9級特大地震影響响迂,放射性物質(zhì)發(fā)生泄漏考抄。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,810評論 3 333
  • 文/蒙蒙 一蔗彤、第九天 我趴在偏房一處隱蔽的房頂上張望川梅。 院中可真熱鬧,春花似錦然遏、人聲如沸贫途。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,285評論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽丢早。三九已至,卻和暖如春秧倾,著一層夾襖步出監(jiān)牢的瞬間怨酝,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,399評論 1 272
  • 我被黑心中介騙來泰國打工那先, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留农猬,地道東北人。 一個月前我還...
    沈念sama閱讀 48,837評論 3 376
  • 正文 我出身青樓胃榕,卻偏偏與公主長得像盛险,于是被迫代替她去往敵國和親瞄摊。 傳聞我的和親對象是個殘疾皇子勋又,可洞房花燭夜當晚...
    茶點故事閱讀 45,455評論 2 359