Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BSmooth - Error in env[[as.character(i)]] <- value : wrong args for environment subassignment #110

Open
ciganche opened this issue Apr 5, 2022 · 2 comments

Comments

@ciganche
Copy link

ciganche commented Apr 5, 2022

I'm coming across a problem while trying to analyze WGBS data from CD4 and CD8 T cells (3 vs 3 samples). I used the following code:

bsseq_obj  = BSseq(chr = chr, pos = position, M = M, Cov = C, sampleNames = sample_names)
replicate = c(seq(1,length(group1_sample_list)), seq(1,length(group2_sample_list)))
bsseq::pData(bsseq_obj) = data.frame(row.names = sample_names, replicate, tissue)
bsseq_obj = renameSeqlevels(bsseq_obj, mapSeqlevels(seqlevels(bsseq_obj), "UCSC"))
bsseq_obj = bsseq_obj[seqnames(bsseq_obj)=="chr19",]
bs.fit = BSmooth(bsseq_obj)

For testing purposes, I am only focusing on chr 19 with 1057376 CpG sites in total.
The error appears after calling BSmooth:

Error in env[[as.character(i)]] <- value : 
  wrong args for environment subassignment
In addition: Warning message:
In parallel::mccollect(wait = FALSE, timeout = 1) :
  1 parallel job did not deliver a result

BiocManager::valid() returns TRUE.

R version 4.1.3 (2022-03-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

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    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] HDF5Array_1.22.1            rhdf5_2.38.1                DelayedArray_0.20.0         Matrix_1.4-1                bsseq_1.30.0               
 [6] SummarizedExperiment_1.24.0 Biobase_2.54.0              MatrixGenerics_1.6.0        matrixStats_0.61.0          GenomicRanges_1.46.1       
[11] GenomeInfoDb_1.30.1         IRanges_2.28.0              S4Vectors_0.32.4            ExperimentHub_2.2.1         AnnotationHub_3.2.2        
[16] BiocFileCache_2.2.1         dbplyr_2.1.1                BiocGenerics_0.40.0         DMRcate_2.8.5              

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                                          R.utils_2.11.0                                     
  [3] tidyselect_1.1.2                                    RSQLite_2.2.12                                     
  [5] AnnotationDbi_1.56.2                                htmlwidgets_1.5.4                                  
  [7] grid_4.1.3                                          BiocParallel_1.28.3                                
  [9] munsell_0.5.0                                       codetools_0.2-18                                   
 [11] preprocessCore_1.56.0                               statmod_1.4.36                                     
 [13] colorspace_2.0-3                                    filelock_1.0.2                                     
 [15] knitr_1.38                                          rstudioapi_0.13                                    
 [17] GenomeInfoDbData_1.2.7                              bit64_4.0.5                                        
 [19] vctrs_0.4.0                                         generics_0.1.2                                     
 [21] xfun_0.30                                           biovizBase_1.42.0                                  
 [23] R6_2.5.1                                            illuminaio_0.36.0                                  
 [25] locfit_1.5-9.5                                      AnnotationFilter_1.18.0                            
 [27] bitops_1.0-7                                        rhdf5filters_1.6.0                                 
 [29] cachem_1.0.6                                        reshape_0.8.8                                      
 [31] assertthat_0.2.1                                    promises_1.2.0.1                                   
 [33] BiocIO_1.4.0                                        IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.0 
 [35] scales_1.1.1                                        nnet_7.3-17                                        
 [37] gtable_0.3.0                                        ensembldb_2.18.4                                   
 [39] rlang_1.0.2                                         genefilter_1.76.0                                  
 [41] splines_4.1.3                                       rtracklayer_1.54.0                                 
 [43] lazyeval_0.2.2                                      DSS_2.42.0                                         
 [45] GEOquery_2.62.2                                     dichromat_2.0-0                                    
 [47] checkmate_2.0.0                                     BiocManager_1.30.16                                
 [49] yaml_2.3.5                                          GenomicFeatures_1.46.5                             
 [51] backports_1.4.1                                     httpuv_1.6.5                                       
 [53] Hmisc_4.6-0                                         tools_4.1.3                                        
 [55] nor1mix_1.3-0                                       ggplot2_3.3.5                                      
 [57] ellipsis_0.3.2                                      RColorBrewer_1.1-3                                 
 [59] siggenes_1.68.0                                     Rcpp_1.0.8.3                                       
 [61] plyr_1.8.7                                          base64enc_0.1-3                                    
 [63] sparseMatrixStats_1.6.0                             progress_1.2.2                                     
 [65] zlibbioc_1.40.0                                     purrr_0.3.4                                        
 [67] RCurl_1.98-1.6                                      prettyunits_1.1.1                                  
 [69] rpart_4.1.16                                        openssl_2.0.0                                      
 [71] bumphunter_1.36.0                                   cluster_2.1.3                                      
 [73] magrittr_2.0.3                                      data.table_1.14.2                                  
 [75] ProtGenerics_1.26.0                                 IlluminaHumanMethylationEPICanno.ilm10b4.hg19_0.6.0
 [77] missMethyl_1.28.0                                   hms_1.1.1                                          
 [79] mime_0.12                                           xtable_1.8-4                                       
 [81] XML_3.99-0.9                                        jpeg_0.1-9                                         
 [83] mclust_5.4.9                                        gridExtra_2.3                                      
 [85] compiler_4.1.3                                      biomaRt_2.50.3                                     
 [87] minfi_1.40.0                                        tibble_3.1.6                                       
 [89] crayon_1.5.1                                        R.oo_1.24.0                                        
 [91] htmltools_0.5.2                                     later_1.3.0                                        
 [93] tzdb_0.3.0                                          Formula_1.2-4                                      
 [95] tidyr_1.2.0                                         DBI_1.1.2                                          
 [97] MASS_7.3-56                                         rappdirs_0.3.3                                     
 [99] readr_2.1.2                                         permute_0.9-7                                      
[101] cli_3.2.0                                           quadprog_1.5-8                                     
[103] R.methodsS3_1.8.1                                   parallel_4.1.3                                     
[105] Gviz_1.38.3                                         pkgconfig_2.0.3                                    
[107] GenomicAlignments_1.30.0                            foreign_0.8-82                                     
[109] xml2_1.3.3                                          foreach_1.5.2                                      
[111] annotate_1.72.0                                     rngtools_1.5.2                                     
[113] multtest_2.50.0                                     beanplot_1.2                                       
[115] XVector_0.34.0                                      doRNG_1.8.2                                        
[117] scrime_1.3.5                                        stringr_1.4.0                                      
[119] VariantAnnotation_1.40.0                            digest_0.6.29                                      
[121] Biostrings_2.62.0                                   base64_2.0                                         
[123] htmlTable_2.4.0                                     edgeR_3.36.0                                       
[125] DelayedMatrixStats_1.16.0                           restfulr_0.0.13                                    
[127] curl_4.3.2                                          shiny_1.7.1                                        
[129] Rsamtools_2.10.0                                    gtools_3.9.2                                       
[131] rjson_0.2.21                                        lifecycle_1.0.1                                    
[133] nlme_3.1-157                                        Rhdf5lib_1.16.0                                    
[135] askpass_1.1                                         limma_3.50.1                                       
[137] BSgenome_1.62.0                                     fansi_1.0.3                                        
[139] pillar_1.7.0                                        lattice_0.20-45                                    
[141] KEGGREST_1.34.0                                     fastmap_1.1.0                                      
[143] httr_1.4.2                                          survival_3.3-1                                     
[145] interactiveDisplayBase_1.32.0                       glue_1.6.2                                         
[147] png_0.1-7                                           iterators_1.0.14                                   
[149] BiocVersion_3.14.0                                  bit_4.0.4                                          
[151] stringi_1.7.6                                       blob_1.2.2                                         
[153] org.Hs.eg.db_3.14.0                                 latticeExtra_0.6-29                                
[155] memoise_2.0.1                                       dplyr_1.0.8

 

Thank you very much for your time.

@PeteHaitch
Copy link
Contributor

PeteHaitch commented Apr 6, 2022

The root cause is this:

In parallel::mccollect(wait = FALSE, timeout = 1) :
  1 parallel job did not deliver a result

which means that one of the parallel jobs failed.
This can sometimes happen on HPC due to a job being killed (e.g., exceeding memory limits or running time).
What was the value of BiocParallel::bpparam() when you ran this code (this would've been used as the default value of BPPARAM in your call to BSmooth())?
You might try BSmooth(bsseq_obj, BPPARAM = BiocParallel::SerialParam()) to see if the code works when run without parallelisation.

@kasperdanielhansen
Copy link
Contributor

kasperdanielhansen commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants