zhengxwen / HIBAG

R package – HLA Genotype Imputation with Attribute Bagging (development version only)
https://hibag.s3.amazonaws.com/index.html
29 stars 7 forks source link

Issue with hlaAttrBagClass #18

Closed staedlern closed 1 year ago

staedlern commented 1 year ago

Dear Xiuwen Zheng

I yesterday installed the HIBAG package. Unfortunately I am stuck with the example which you provide on the webpage. In particular my R session gets stuck once dealing with hlaAttrBagClass.

image

Some info on my R session.

image

It would be great to have your help!

Thanks a lot,

Nicolas

staedlern commented 1 year ago

I tried the example in the vignette once more but it failed without any informative error message. Your help would very much appreciated. Thank you, Nicoals

image

zhengxwen commented 1 year ago

What is sessionInfo()?

rajeha commented 1 year ago

Hi @zhengxwen, I am having the same issue when loading the pretrained European model. C stack usage is too lose to the limit.

sessionInfo:

R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Matrix products: default

Random number generation:
 RNG:     L'Ecuyer-CMRG 
 Normal:  Inversion 
 Sample:  Rejection 

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

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

other attached packages:
 [1] HIBAG_1.33.2         data.table_1.14.2    ggplot2_3.3.6        stringr_1.4.1        dplyr_1.0.10        
 [6] NMF_0.24.0           Biobase_2.56.0       cluster_2.1.3        rngtools_1.5.2       pkgmaker_0.32.2     
[11] registry_0.5-1       GenomicRanges_1.48.0 GenomeInfoDb_1.32.4  IRanges_2.30.0       S4Vectors_0.34.0    
[16] BiocGenerics_0.42.0  maftools_2.12.05    

loaded via a namespace (and not attached):
 [1] bitops_1.0-7                matrixStats_0.62.0          fs_1.5.2                    barplot3d_1.0.1            
 [5] doParallel_1.0.17           RColorBrewer_1.1-3          tools_4.2.0                 utf8_1.2.2                 
 [9] R6_2.5.1                    DBI_1.1.3                   colorspace_2.0-3            DNAcopy_1.70.0             
[13] withr_2.5.0                 tidyselect_1.1.2            compiler_4.2.0              cli_3.3.0                  
[17] DelayedArray_0.22.0         rtracklayer_1.56.1          scales_1.2.1                digest_0.6.29              
[21] Rsamtools_2.12.0            XVector_0.36.0              pkgconfig_2.0.3             MatrixGenerics_1.8.1       
[25] rlang_1.0.6                 rstudioapi_0.14             BiocIO_1.6.0                generics_0.1.3             
[29] BiocParallel_1.30.3         RCurl_1.98-1.8              magrittr_2.0.3              GenomeInfoDbData_1.2.8     
[33] Matrix_1.5-0                Rcpp_1.0.9                  munsell_0.5.0               fansi_1.0.3                
[37] lifecycle_1.0.3             stringi_1.7.8               yaml_2.3.5                  SummarizedExperiment_1.26.1
[41] zlibbioc_1.42.0             plyr_1.8.7                  grid_4.2.0                  parallel_4.2.0             
[45] crayon_1.5.1                lattice_0.20-45             Biostrings_2.64.0           splines_4.2.0              
[49] pillar_1.8.1                comorbidity_1.0.5           rjson_0.2.21                reshape2_1.4.4             
[53] codetools_0.2-18            XML_3.99-0.10               glue_1.6.2                  RcppParallel_5.1.5         
[57] vctrs_0.4.1                 foreach_1.5.2               gtable_0.3.1                purrr_0.3.4                
[61] assertthat_0.2.1            gridBase_0.4-7              xtable_1.8-4                restfulr_0.0.15            
[65] survival_3.3-1              tibble_3.1.8                iterators_1.0.14            GenomicAlignments_1.32.1  

gcc versoin:

COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)

Also, I noticed that HIBAG might be assuming I have a 32-bit architecture:

> HIBAG::hlaSetKernelTarget("max")
[1] "32-bit, AVX2"                                                         
[2] "10.3.0, GNUG_v10.3.0"                                                 
[3] "Algorithm SIMD: SSE2 SSE4.2 AVX AVX2 AVX512F AVX512BW AVX512VPOPCNTDQ"

Even though I know R is running on 64-bit:

> .Machine$sizeof.pointer
[1] 8

Would appreciate your looking into this!

staedlern commented 1 year ago

Dear @zhengxwen

for completeness my session info:

image

Thanks for your help,

Nicolas

zhengxwen commented 1 year ago

Non-windows version should work well.

zhengxwen commented 1 year ago

I guess you are using RStudio. When I run the script from R console or the command line, I don't see the error of C stack. But I ran the script in RStudio, this error showed up. It seems that RStudio triggered this error after hlaModelFromObj(), but model.A is still assigned.

zhengxwen commented 1 year ago

Fix this issue in https://github.com/zhengxwen/HIBAG/commit/1678a9ba3f43d74f99a7eb6732a4cbce9a0e06d0 or HIBAG_v1.33.3 / HIBAG_v1.34.0 in BioC. Let me know if the C stack error still occurs.

rajeha commented 1 year ago

Thank you @zhengxwen! This commit fixed the issue for me in R studio on Windows. Up to you or the OP to close this issue.

staedlern commented 1 year ago

Thanks @zhengxwen ! The commit fixed the issue for me in R studio on Windows.

zhengxwen commented 1 year ago

Hi @zhengxwen, I am having the same issue when loading the pretrained European model. C stack usage is too lose to the limit.

sessionInfo:

R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Also, I noticed that HIBAG might be assuming I have a 32-bit architecture:

> HIBAG::hlaSetKernelTarget("max")
[1] "32-bit, AVX2"                                                         
[2] "10.3.0, GNUG_v10.3.0"                                                 
[3] "Algorithm SIMD: SSE2 SSE4.2 AVX AVX2 AVX512F AVX512BW AVX512VPOPCNTDQ"

Even though I know R is running on 64-bit:

> .Machine$sizeof.pointer
[1] 8

Would appreciate your looking into this!

It is fixed in HIBAG_1.34.1 (http://bioconductor.org/packages/HIBAG/).

CHANGES IN VERSION 1.34.1
-------------------------
    o fix the compiler warning: sprintf is deprecated
    o show "64-bit" correctly when run on Windows