首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GenomicRanges: C堆栈使用..。太接近极限了

GenomicRanges: C堆栈使用..。太接近极限了
EN

Stack Overflow用户
提问于 2017-07-20 22:06:38
回答 2查看 5.1K关注 0票数 1

我正在从biovizBase包中加载一个内置的表意图:

代码语言:javascript
复制
data("hg19Ideogram", package = "biovizBase")

使用str检查实际对象是很好的

代码语言:javascript
复制
> hg19Ideogram %>% str
Formal class 'GRanges' [package "GenomicRanges"] with 6 slots
  ..@ seqnames       :Formal class 'Rle' [package "IRanges"] with 4 slots
  .. .. ..@ values         : Factor w/ 93 levels "chr1","chr1_gl000191_random",..: 1 2 3 4 5 6 7 8 9 10 ...
  .. .. ..@ lengths        : int [1:93] 1 1 1 1 1 1 1 1 1 1 ...
  .. .. ..@ elementMetadata: NULL
  .. .. ..@ metadata       : list()
  ..@ ranges         :Formal class 'IRanges' [package "IRanges"] with 6 slots
  .. .. ..@ start          : int [1:93] 1 1 1 1 1 1 1 1 1 1 ...
  .. .. ..@ width          : int [1:93] 249250621 106433 547496 243199373 198022430 191154276 590426 189789 191469 180915260 ...
  .. .. ..@ NAMES          : NULL
  .. .. ..@ elementType    : chr "integer"
  .. .. ..@ elementMetadata: NULL
  .. .. ..@ metadata       : list()
  ..@ strand         :Formal class 'Rle' [package "IRanges"] with 4 slots
  .. .. ..@ values         : Factor w/ 3 levels "+","-","*": 3
  .. .. ..@ lengths        : int 93
  .. .. ..@ elementMetadata: NULL
  .. .. ..@ metadata       : list()
  ..@ elementMetadata:Formal class 'DataFrame' [package "IRanges"] with 6 slots
  .. .. ..@ rownames       : NULL
  .. .. ..@ nrows          : int 93
  .. .. ..@ listData       : Named list()
  .. .. ..@ elementType    : chr "ANY"
  .. .. ..@ elementMetadata: NULL
  .. .. ..@ metadata       : list()
  ..@ seqinfo        :Formal class 'Seqinfo' [package "GenomicRanges"] with 4 slots
  .. .. ..@ seqnames   : chr [1:93] "chr1" "chr1_gl000191_random" "chr1_gl000192_random" "chr2" ...
  .. .. ..@ seqlengths : int [1:93] 249250621 106433 547496 243199373 198022430 191154276 590426 189789 191469 180915260 ...
  .. .. ..@ is_circular: logi [1:93] NA NA NA NA NA NA ...
  .. .. ..@ genome     : chr [1:93] "hg19" "hg19" "hg19" "hg19" ...
  ..@ metadata       : list()

但是打印它会导致一个错误:

代码语言:javascript
复制
> hg19Ideogram
GRanges object with 93 ranges and 0 metadata columns:
Error: C stack usage  7969604 is too close to the limit

打印任何子对象都不会导致任何错误(包括IRanges),因此似乎该错误特别是与对GRanges的打印调用有关。

此外,尝试将其与ggbio一起使用会导致相同的错误:

代码语言:javascript
复制
> ggplot() +
+   layout_circle(hg19Ideogram)
Error: C stack usage  7969268 is too close to the limit

关于此错误还有许多其他问题:

所有这些都没有为我提供有效的解决方案。

C堆栈

代码语言:javascript
复制
> Cstack_info()
      size    current  direction eval_depth 
   7969177      16048          1          2 

版本

有人建议更新软件来解决这个问题。我更新了最新版本的R,RStudio和ggbio (和相关的软件包),但是它没有改变任何东西。

代码语言:javascript
复制
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04 LTS

Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.18.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] GenomicRanges_1.28.4 GenomeInfoDb_1.12.2  IRanges_2.10.2       S4Vectors_0.14.3     biovizBase_1.24.0    ggbio_1.24.1        
 [7] BiocGenerics_0.22.0  dplyr_0.7.1          purrr_0.2.2.2        readr_1.1.1          tidyr_0.6.3          tibble_1.3.3        
[13] ggplot2_2.2.1        tidyverse_1.1.1      psych_1.7.5          pacman_0.4.6        

loaded via a namespace (and not attached):
  [1] colorspace_1.3-2              htmlTable_1.9                 XVector_0.16.0                base64enc_0.1-3              
  [5] dichromat_2.0-0               bit64_0.9-7                   interactiveDisplayBase_1.14.0 AnnotationDbi_1.38.1         
  [9] lubridate_1.6.0               xml2_1.1.1                    splines_3.4.1                 mnormt_1.5-5                 
 [13] knitr_1.16                    Formula_1.2-1                 jsonlite_1.5                  Rsamtools_1.28.0             
 [17] broom_0.4.2                   cluster_2.0.3                 graph_1.54.0                  shiny_1.0.3                  
 [21] compiler_3.4.1                httr_1.2.1                    backports_1.1.0               assertthat_0.2.0             
 [25] Matrix_1.2-3                  lazyeval_0.2.0                acepack_1.4.1                 htmltools_0.3.6              
 [29] tools_3.4.1                   bindrcpp_0.2                  gtable_0.2.0                  glue_1.1.1                   
 [33] GenomeInfoDbData_0.99.0       reshape2_1.4.2                Rcpp_0.12.11                  Biobase_2.36.2               
 [37] cellranger_1.1.0              Biostrings_2.44.1             nlme_3.1-124                  rtracklayer_1.36.4           
 [41] stringr_1.2.0                 rvest_0.3.2                   mime_0.5                      ensembldb_2.0.3              
 [45] XML_3.98-1.9                  AnnotationHub_2.8.2           zlibbioc_1.22.0               scales_0.4.1                 
 [49] BSgenome_1.44.0               VariantAnnotation_1.22.3      BiocInstaller_1.26.0          hms_0.3                      
 [53] ProtGenerics_1.8.0            SummarizedExperiment_1.6.3    RBGL_1.52.0                   AnnotationFilter_1.0.0       
 [57] RColorBrewer_1.1-2            yaml_2.1.14                   curl_2.7                      memoise_1.1.0                
 [61] gridExtra_2.2.1               biomaRt_2.32.1                rpart_4.1-10                  reshape_0.8.6                
 [65] latticeExtra_0.6-28           stringi_1.1.5                 RSQLite_2.0                   checkmate_1.8.2              
 [69] GenomicFeatures_1.28.4        BiocParallel_1.10.1           rlang_0.1.1                   pkgconfig_2.0.1              
 [73] matrixStats_0.52.2            bitops_1.0-6                  lattice_0.20-33               bindr_0.1                    
 [77] GenomicAlignments_1.12.1      htmlwidgets_0.8               bit_1.1-12                    GGally_1.3.1                 
 [81] plyr_1.8.4                    magrittr_1.5                  R6_2.2.2                      Hmisc_4.0-3                  
 [85] DelayedArray_0.2.7            DBI_0.7                       haven_1.0.0                   foreign_0.8-66               
 [89] survival_2.41-3               RCurl_1.95-4.8                nnet_7.3-12                   modelr_0.1.0                 
 [93] OrganismDbi_1.18.0            grid_3.4.1                    readxl_1.0.0                  data.table_1.10.4            
 [97] blob_1.1.0                    forcats_0.2.0                 digest_0.6.12                 xtable_1.8-2                 
[101] httpuv_1.3.5                  munsell_0.4.3   

ulimit

One person suggested使用ulimit。这是可行的,但是还不清楚如何在RStudio内部实现这一点。

代码语言:javascript
复制
mint@hp ~ $ ulimit -s
8192
mint@hp ~ $ ulimit -s unlimited
mint@hp ~ $ R --slave -e 'Cstack_info()["size"]'
size 
  NA 

这并不是因为计算机没有足够的可用内存(16 It)。

RAppArmor

One person suggested使用RAppArmor从R内增加限制,但是该函数不再存在。但从极限来看,似乎没有任何问题。

代码语言:javascript
复制
> rlimit_as();
$hardlim
[1] 1.844674e+19

$softlim
[1] 1.844674e+19

来自RStudio内部的上限

在评论中,Yuval建议在ulimit内部尝试RStudio。我使用RStudio的终端和使用R中的system来运行系统命令。既不影响实际R会话,也不影响重新启动R。

我没什么可试的了。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-07-24 20:16:37

事实证明,这是由于一些过时的包裹。我没有注意到它们没有被更新,因为RStudio的'update包功能‘忽略了没有写权限的包(因此根本没有通知您它们已经过时了)。因此,结果是由于一个微妙的权限问题,请参阅。见this answer

票数 4
EN

Stack Overflow用户

发布于 2017-07-20 23:15:55

每个进程的堆栈内存不仅受到可用内存的限制,而且还受到操作系统的限制(默认情况下不超过几个MiBs)。

我不明白无限-s是否成功了。“不清楚如何在没有RStudio的情况下实现这一点”是什么意思?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45225966

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档