报错 cannot allocate vector of size 111.3 Mb
runGenie3(exprMat_filtered_log, scenicOptions, nParts = 100) # 6.29日 15:00开始跑
#需要注意nParts参数,它的作用是把表达矩阵分成n份分开计算,目的是防止数据量大时内存不够。
Using 785 TFs as potential regulators...
Running GENIE3 part 1
Running GENIE3 part 10
Running GENIE3 part 100
Running GENIE3 part 11
Running GENIE3 part 12
Running GENIE3 part 13
Running GENIE3 part 14
Running GENIE3 part 15
Running GENIE3 part 16
Error in { : task 57 failed - "无法分配大小为111.3 Mb的矢量"
尝试办法1出错解决 | Error: cannot allocate vector of size 109.7 Mb (ngui.cc) 加这个代码 gc()
,还是报错
Using 785 TFs as potential regulators...
Running GENIE3 part 1
Running GENIE3 part 10
Error in serialize(data, node$con) : error writing to connection
7.7日,清空环境和 gc()
,只用了integrated,其他都没加载。还是报错
> runGenie3(exprMat_filtered_log, scenicOptions, nParts = 100) # 6.29日 15:00开始跑
Using 785 TFs as potential regulators...
Running GENIE3 part 1
Running GENIE3 part 10
Running GENIE3 part 100
Running GENIE3 part 11
Running GENIE3 part 12
Error in unserialize(socklist[[n]]) : error reading from connection
>
7.11 重启电脑,开始跑,还是报错
> set.seed(1001)
> runGenie3(exprMat_filtered_log, scenicOptions,nParts=80)
Using 785 TFs as potential regulators...
Running GENIE3 part 1
Running GENIE3 part 10
Running GENIE3 part 11
Running GENIE3 part 12
Running GENIE3 part 13
Running GENIE3 part 14
Running GENIE3 part 15
Running GENIE3 part 16
Running GENIE3 part 17
Running GENIE3 part 18
Running GENIE3 part 19
Error in { : task 62 failed - "无法分配大小为111.3 Mb的矢量"
7.12 准备试试这个
https://www.jianshu.com/p/f1976b2f2aa2
https://zhuanlan.zhihu.com/p/603388588
https://www.jianshu.com/p/1c4681c2efc0
> library(future)
> plan()
multicore:
- args: function (..., workers = 10, envir = parent.frame())
- tweaked: TRUE
- call: plan("multicore", workers = 10)
> plan("multicore", workers = 10)
> options(future.globals.maxSize=1000*1024*1024)##default有最大可使用内存限制,可更改
>
> set.seed(1001)
> runGenie3(exprMat_filtered_log, scenicOptions,nParts=100) # 7.8日 20:00开始跑
Using 785 TFs as potential regulators...
Running GENIE3 part 1
Error in file(con, "w") : all connections are in use
In addition: Warning messages:
1: In .Internal(gzfile(description, open, encoding, compression)) :
closing unused connection 127 (<-DESKTOP-NN3NDT8:11302)
2: In .Internal(gzfile(description, open, encoding, compression)) :
closing unused connection 126 (<-DESKTOP-NN3NDT8:11302)
3: In .Internal(gzfile(description, open, encoding, compression)) :
closing unused connection 125 (<-DESKTOP-NN3NDT8:11302)
4: In .Internal(gzfile(description, open, encoding, compression)) :
closing unused connection 124 (<-DESKTOP-NN3NDT8:11302)
5: In .Internal(gzfile(description, open, encoding, compression)) :
closing unused connection 123 (<-DESKTOP-NN3NDT8:11302)
7.14更新报错,又出现了新的报错
> runGenie3(exprMat_filtered_log, scenicOptions,nParts=1000,resumePreviousRun = T) # 7.8日 20:00开始跑
Using 785 TFs as potential regulators...
Error in runGenie3(exprMat_filtered_log, scenicOptions, nParts = 1000, :
Some genes are in several of the partial runs.
> runGenie3(exprMat_filtered_log, scenicOptions,nParts=1000) # 7.8日 20:00开始跑
Using 785 TFs as potential regulators...
Running GENIE3 part 1
Running GENIE3 part 10
Running GENIE3 part 100
Running GENIE3 part 1000
Running GENIE3 part 101
Running GENIE3 part 102
Running GENIE3 part 103
Running GENIE3 part 104
Running GENIE3 part 105
Running GENIE3 part 106
Running GENIE3 part 107
Running GENIE3 part 108
Running GENIE3 part 110
Error in file(con, "w") : all connections are i
Running GENIE3 part 109
Running GENIE3 part 11n use
> runGenie3(exprMat_filtered_log, scenicOptions,nParts=1000) #
Using 785 TFs as potential regulators...
Running GENIE3 part 1
Running GENIE3 part 10
Running GENIE3 part 100
Running GENIE3 part 1000
Running GENIE3 part 101
Running GENIE3 part 102
Running GENIE3 part 103
Running GENIE3 part 104
Running GENIE3 part 105
Running GENIE3 part 106
Running GENIE3 part 107
Running GENIE3 part 108
Running GENIE3 part 109
Running GENIE3 part 11
Running GENIE3 part 110
Error in file(con, "w") : all connections are in use
7.27更新:代码什么也没变,居然跑通了?!
> memory.limit(10000000)
[1] 1e+07
> set.seed(1001)
>
> #exportsForArboreto(exprMat, scenicOptions)
>
>
>
> runGenie3(as.matrix(exprMat_filtered_log), scenicOptions)
Using 785 TFs as potential regulators...
Running GENIE3 part 1
Running GENIE3 part 10
Running GENIE3 part 2
Running GENIE3 part 3
Running GENIE3 part 4
Running GENIE3 part 5
Running GENIE3 part 6
Running GENIE3 part 7
Running GENIE3 part 8
Running GENIE3 part 9
Finished running GENIE3.
> save(exprMat_filtered,scenicOptions,file = "input_GENIE3_data.Rdata")
> scenicOptions@settings$nCores <- 10#并行计算时调用的线程
> scenicOptions@settings$seed <- 1001
> ##推断共表达模块
> runSCENIC_1_coexNetwork2modules(scenicOptions)
23:23 Creating TF modules
Number of links between TFs and targets (weight>=0.001): 2963509
[,1]
nTFs 785
nTargets 7320
nGeneSets 4652
nLinks 3912923
> ##推断转录调控网络(regulon)
> runSCENIC_2_createRegulons(scenicOptions)
23:26 Step 2. Identifying regulons
载入程辑包:‘AUCell’
The following object is masked from ‘package:SCENIC’:
plotEmb_rgb
Using the column 'features' as feature index for the ranking database.
Using the column 'features' as feature index for the ranking database.
tfModulesSummary:
[,1]
top50perTargetAndtop50 3
top5perTargetAndtop10perTarget 3
top50Andtop1sd 4
w0.005Andtop10perTarget 4
top50perTargetAndtop1sd 5
top50perTargetAndtop3sd 5
w0.005Andtop1sd 9
w0.005Andtop3sd 10
w0.005Andtop50 11
w0.001Andtop50perTarget 28
top50Andtop3sd 36
top5perTarget 46
top10perTarget 62
w0.005 65
top50perTarget 152
top50 156
top3sd 161
top1sd 440
w0.001 596
23:26 RcisTarget: Calculating AUC
Using the column 'features' as feature index for the ranking database.
Scoring database: [Source file: hg19-500bp-upstream-7species.mc9nr.feather]
Using the column 'features' as feature index for the ranking database.
Scoring database: [Source file: hg19-tss-centered-10kb-7species.mc9nr.feather]
23:59 RcisTarget: Adding motif annotation
Using BiocParallel...
Using BiocParallel...
Number of motifs in the initial enrichment: 926416
Number of motifs annotated to the matching TF: 15312
00:10 RcisTarget: Pruning targets
Using the column 'features' as feature index for the ranking database.
Error in file(con, "w") : all connections are in use
> save.image("D:/atrial fibrillation 2022.11.03/R_SCENIC_V3/scenic_0727.RData")
Warning message:
In .Internal(gzfile(description, open, encoding, compression)) :
closing unused connection 127 (<-DESKTOP-NN3NDT8:11168)
> scenicOptions@settings$nCores <- 14#并行计算时调用的线程
> scenicOptions@settings$seed <- 1001 #涉及随机数种子便于重复结果