我正在尝试通过 lumi
包中的 lumiN()
使用 normalize.loess()
。
在第 38 次迭代时,在 loess()
函数中它失败了
Error in simpleLoess(y, x, w, span, degree, parametric, drop.square, normalize, :
NA/NaN/Inf in foreign function call (arg 1)
我查了一下,可能与缺少参数有关。
我检查了 debug(loess)
并定义了所有参数。
我不能发布数据,因为它们非常大 (13237x566),而且因为它们是 secret 的,但是..我发现了这个:
- 一个最小的例子(随机矩阵 20x5)
- 第 1 列和第 38 列之间的规范化失败
- 仅使用那些成功完成的列的相同规范化
- 这不是内存问题
- 矩阵没有 NA 值
我错过了什么?
谢谢
代码
raw_matrix <- lumiR('example.txt')
norm_matrix <- lumiN(raw_matrix, method='loess')
Perform loess normalization ...
Done with 1 vs 2 in iteration 1
Done with 1 vs 3 in iteration 1
Done with 1 vs 4 in iteration 1
Done with 1 vs 5 in iteration 1
Done with 1 vs 6 in iteration 1
Done with 1 vs 7 in iteration 1
Done with 1 vs 8 in iteration 1
Done with 1 vs 9 in iteration 1
Done with 1 vs 10 in iteration 1
Done with 1 vs 11 in iteration 1
Done with 1 vs 12 in iteration 1
Done with 1 vs 13 in iteration 1
Done with 1 vs 14 in iteration 1
Done with 1 vs 15 in iteration 1
Done with 1 vs 16 in iteration 1
Done with 1 vs 17 in iteration 1
Done with 1 vs 18 in iteration 1
Done with 1 vs 19 in iteration 1
Done with 1 vs 20 in iteration 1
Done with 1 vs 21 in iteration 1
Done with 1 vs 22 in iteration 1
Done with 1 vs 23 in iteration 1
Done with 1 vs 24 in iteration 1
Done with 1 vs 25 in iteration 1
Done with 1 vs 26 in iteration 1
Done with 1 vs 27 in iteration 1
Done with 1 vs 28 in iteration 1
Done with 1 vs 29 in iteration 1
Done with 1 vs 30 in iteration 1
Done with 1 vs 31 in iteration 1
Done with 1 vs 32 in iteration 1
Done with 1 vs 33 in iteration 1
Done with 1 vs 34 in iteration 1
Done with 1 vs 35 in iteration 1
Done with 1 vs 36 in iteration 1
Done with 1 vs 37 in iteration 1
Done with 1 vs 38 in iteration 1
Error in simpleLoess(y, x, w, span, degree, parametric, drop.square, normalize, :
NA/NaN/Inf in foreign function call (arg 1)
环境
我的sessionInfo()
是
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] affy_1.38.1 lumi_2.12.0 Biobase_2.20.0
[4] BiocGenerics_0.6.0 BiocInstaller_1.10.2
loaded via a namespace (and not attached):
[1] affyio_1.28.0 annotate_1.38.0 AnnotationDbi_1.22.6
[4] beanplot_1.1 Biostrings_2.28.0 colorspace_1.2-4
[7] DBI_0.2-7 GenomicRanges_1.12.5 grid_3.0.2
[10] illuminaio_0.2.0 IRanges_1.18.1 KernSmooth_2.23-10
[13] lattice_0.20-24 limma_3.16.8 MASS_7.3-29
[16] Matrix_1.0-14 matrixStats_0.8.12 mclust_4.2
[19] methylumi_2.6.1 mgcv_1.7-27 minfi_1.6.0
[22] multtest_2.16.0 nleqslv_2.0 nlme_3.1-111
[25] nor1mix_1.1-4 preprocessCore_1.22.0 RColorBrewer_1.0-5
[28] reshape_0.8.4 R.methodsS3_1.5.2 RSQLite_0.11.4
[31] siggenes_1.34.0 splines_3.0.2 stats4_3.0.2
[34] survival_2.37-4 tcltk_3.0.2 tools_3.0.2
[37] XML_3.98-1.1 xtable_1.7-1 zlibbioc_1.6.0
最佳答案
我不知何故弄清楚了什么不起作用:
我试图规范化 log2 矩阵。据我所知,normalize.loess
默认情况下对输入矩阵进行对数变换,因此将对数变换两次。
这是个问题,因为输入矩阵中的某些值等于 1,所以:
log2(log2(1)) = Inf
这显然在规范化期间不允许作为值。
希望这对某人有帮助。
关于r - simpleLoess 错误 : NA/NaN/Inf in foreign function call,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19399086/