broadinstitute / infercnv

Inferring CNV from Single-Cell RNA-Seq
Other
557 stars 164 forks source link

STEP18 issue with child proccesses dying without explanation #446

Closed tbrunetti closed 2 years ago

tbrunetti commented 2 years ago

Hello,

I am using the newest pull from the master branch of infercnv. I encountered an error at STEP18, which throws the following error:

STEP 18: Run Bayesian Network Model on HMM predicted CNVs

INFO [2022-08-24 15:27:30] Creating the following Directory: /home/tonya/pluto_projects/Experiment_Types/scRNA_with_HTO/inferCNV_output//BayesNetOutput.HMMi6.leiden.hmm_mode-subclusters INFO [2022-08-24 15:27:30] Initializing new MCM InferCNV Object. INFO [2022-08-24 15:27:30] validating infercnv_obj INFO [2022-08-24 15:27:32] Total CNV's: 40543 INFO [2022-08-24 15:27:32] Loading BUGS Model. INFO [2022-08-24 15:31:08] Running Sampling Using Parallel with 15 Cores INFO [2022-08-24 15:55:41] Obtaining probabilities post-sampling Error in do.call(rbind, mcmc[[j]]) : second argument must be a list In addition: Warning message: In parallel::mclapply(seq_along(obj@cell_gene), FUN = par_func, : scheduled cores 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 did not deliver results, all values of the jobs will be affected\

Is this usually due to a memory issue or something else? I am using about 32GB of RAM on a single cancer sample and a single reference sample.

Here is my rsession info in case there is any weird software versiongs, but I am using Rv4.2.1

R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /home/tonya/Downloads/software/R-4.2.1/lib/libRlapack.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    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] leiden_0.4.2                infercnv_1.13.0             profvis_0.3.7               SummarizedExperiment_1.26.1
 [5] MatrixGenerics_1.8.1        matrixStats_0.62.0          data.table_1.14.2           Matrix_1.4-1               
 [9] EnsDb.Hsapiens.v86_2.99.0   ensembldb_2.20.2            AnnotationFilter_1.20.0     GenomicFeatures_1.48.3     
[13] AnnotationDbi_1.58.0        Biobase_2.56.0              GenomicRanges_1.48.0        GenomeInfoDb_1.32.3        
[17] IRanges_2.30.1              S4Vectors_0.34.0            BiocGenerics_0.42.0         sp_1.5-0                   
[21] SeuratObject_4.1.0          Seurat_4.1.1                bmcite.SeuratData_0.3.0     SeuratData_0.2.2           

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                  reticulate_1.25             tidyselect_1.1.2            RSQLite_2.2.16             
  [5] htmlwidgets_1.5.4           BiocParallel_1.30.3         grid_4.2.1                  Rtsne_0.16                 
  [9] munsell_0.5.0               codetools_0.2-18            ica_1.0-3                   future_1.27.0              
 [13] miniUI_0.1.1.1              argparse_2.1.6              spatstat.random_2.2-0       colorspace_2.0-3           
 [17] progressr_0.10.1            filelock_1.0.2              rstudioapi_0.14             SingleCellExperiment_1.18.0
 [21] ROCR_1.0-11                 tensor_1.5                  listenv_0.8.0               GenomeInfoDbData_1.2.8     
 [25] polyclip_1.10-0             bit64_4.0.5                 rprojroot_2.0.3             coda_0.19-4                
 [29] parallelly_1.32.1           vctrs_0.4.1                 generics_0.1.3              TH.data_1.1-1              
 [33] lambda.r_1.2.4              BiocFileCache_2.4.0         fastcluster_1.2.3           R6_2.5.1                   
 [37] doParallel_1.0.17           locfit_1.5-9.6              bitops_1.0-7                spatstat.utils_2.3-1       
 [41] cachem_1.0.6                DelayedArray_0.22.0         assertthat_0.2.1            BiocIO_1.6.0               
 [45] promises_1.2.0.1            scales_1.2.1                multcomp_1.4-20             rgeos_0.5-9                
 [49] gtable_0.3.0                globals_0.16.0              goftest_1.2-3               sandwich_3.0-2             
 [53] rlang_1.0.4                 splines_4.2.1               rtracklayer_1.56.1          lazyeval_0.2.2             
 [57] rjags_4-13                  spatstat.geom_2.4-0         yaml_2.3.5                  reshape2_1.4.4             
 [61] abind_1.4-5                 httpuv_1.6.5                tools_4.2.1                 ggplot2_3.3.6              
 [65] ellipsis_0.3.2              gplots_3.1.3                spatstat.core_2.4-4         RColorBrewer_1.1-3         
 [69] HiddenMarkov_1.8-13         phyclust_0.1-30             ggridges_0.5.3              Rcpp_1.0.9                 
 [73] plyr_1.8.7                  progress_1.2.2              zlibbioc_1.42.0             purrr_0.3.4                
 [77] RCurl_1.98-1.8              prettyunits_1.1.1           rpart_4.1.16                deldir_1.0-6               
 [81] pbapply_1.5-0               cowplot_1.1.1               zoo_1.8-10                  ggrepel_0.9.1              
 [85] cluster_2.1.3               here_1.0.1                  magrittr_2.0.3              futile.options_1.0.1       
 [89] scattermore_0.8             lmtest_0.9-40               RANN_2.6.1                  mvtnorm_1.1-3              
 [93] parallelDist_0.2.6          ProtGenerics_1.28.0         fitdistrplus_1.1-8          hms_1.1.2                  
 [97] patchwork_1.1.2             mime_0.12                   xtable_1.8-4                XML_3.99-0.10              
[101] gridExtra_2.3               biomaRt_2.52.0              compiler_4.2.1              tibble_3.1.8               
[105] KernSmooth_2.23-20          crayon_1.5.1                htmltools_0.5.3             mgcv_1.8-40                
[109] later_1.3.0                 tidyr_1.2.0                 libcoin_1.0-9               RcppParallel_5.1.5         
[113] DBI_1.1.3                   formatR_1.12                dbplyr_2.2.1                MASS_7.3-57                
[117] rappdirs_0.3.3              cli_3.3.0                   parallel_4.2.1              igraph_1.3.4               
[121] pkgconfig_2.0.3             GenomicAlignments_1.32.1    coin_1.4-2                  plotly_4.10.0              
[125] spatstat.sparse_2.1-1       xml2_1.3.3                  foreach_1.5.2               XVector_0.36.0             
[129] stringr_1.4.1               digest_0.6.29               sctransform_0.3.4           RcppAnnoy_0.0.19           
[133] Biostrings_2.64.1           spatstat.data_2.2-0         uwot_0.1.14                 edgeR_3.38.4               
[137] restfulr_0.0.15             curl_4.3.2                  Rsamtools_2.12.0            shiny_1.7.2                
[141] gtools_3.9.3                modeltools_0.2-23           rjson_0.2.21                lifecycle_1.0.1            
[145] nlme_3.1-157                jsonlite_1.8.0              futile.logger_1.4.3         viridisLite_0.4.1          
[149] limma_3.52.2                fansi_1.0.3                 pillar_1.8.1                lattice_0.20-45            
[153] KEGGREST_1.36.3             fastmap_1.1.0               httr_1.4.4                  survival_3.3-1             
[157] glue_1.6.2                  png_0.1-7                   iterators_1.0.14            bit_4.0.4                  
[161] stringi_1.7.8               blob_1.2.3                  caTools_1.18.2              memoise_2.0.1              
[165] dplyr_1.0.9                 irlba_2.3.5                 future.apply_1.9.0          ape_5.6-2   
tbrunetti commented 2 years ago

If I lower the core use, it resolves the issue, although not sure why. I have profiled memory and CPU use and I have more than enough resources. Anyway, it is not urgent in that I can at least get it to work on lower cores

GeorgescuC commented 2 years ago

Hi @tbrunetti ,

This is an issue that happens occasionally with multithreading but there is unfortunately no consistent solution. For some people reducing the number of threads works, but for some it also worked to increase it. It probably has to do with how R handles memory sharing and object copies but it is difficult to debug as R offers few options to investigate such issues.

Regards, Christophe.

tbrunetti commented 2 years ago

No problem -- I figure it is a problem with the parallel library in R. Just wasn't sure if you were aware of the issue and if there was an official solution. Thanks!

Sa753 commented 1 year ago

Hi @tbrunetti

What did you do to sort it out?. I installed version 1.15 and can't get rid of this error since then...

Thanks

tbrunetti commented 1 year ago

@Sa753 sorry I missed this! The only way I was able to resolve it was to reduce the number of cores being used. Sorry the solution isn't better

Yijia-Jiang commented 1 year ago

Hi, what parameter did you change to reduce the number of cores? I only see an option of choosing num_threads, not number of cores

tbrunetti commented 1 year ago

Hi, what parameter did you change to reduce the number of cores? I only see an option of choosing num_threads, not number of cores

Sorry, I meant num_threads. Often time informatics software threading is done per core, but that may not be the case here where multiple threads may be running on a single core or CPU.