simpleLoess中的错误:外部函数调用中的NA / NaN / Inf

时间:2013-10-16 08:58:42

标签: r debugging normalization na loess

我正在尝试使用normalize.loess() lumiN()来自lumi个包裹。

在第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),也因为它们是保密的但是......我发现了这个:

  • 最小的例子有效(随机矩阵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

1 个答案:

答案 0 :(得分:8)

我以某种方式弄明白什么不起作用: 我试图规范化log2矩阵。据我所知normalize.loess默认情况下,log会转换输入矩阵,因此会进行两次对数转换。

这是一个问题,因为输入矩阵中的某些值等于1,所以:

log2(log2(1)) = Inf

在标准化过程中显然不允许作为值。

希望这有助于某人。