IPO icon indicating copy to clipboard operation
IPO copied to clipboard

std::bad_alloc error

Open danagibbon opened this issue 6 years ago • 2 comments

I am getting a std::bad_alloc error when I run optimizeRetGroup. I have 995G of ram on my machine and when I watch in htop it never goes over 12G so I am stumped as to what is going on.

Code:

library(here)
library(xcms)
library(RColorBrewer)
library(IPO)
datapath <- here("data", "msdata")
datafiles <- list.files(datapath, recursive = TRUE, full.names = TRUE, pattern = paste("\\.", "mzXML", "$", sep=''))
datafiles <- datafiles[grep("pos", datafiles)]
exp_design <- read.csv(here("data", "experimental_design.csv"))
exp_design <- exp_design[grep("pos", exp_design$charge),]
peakpickingParameters.cent <- getDefaultXcmsSetStartingParams("centWave")

resultPeakpicking_cent <- optimizeXcmsSet(files = datafiles,
                                          params = peakpickingParameters.cent,
                                          nSlaves = 2,
                                          subdir = "results/centWave")

optimizedXcmsSetObject <- resultPeakpicking_cent$best_settings$xset

retcorGroupParameters <- getDefaultRetGroupStartingParams()
resultRetcorGroup <- optimizeRetGroup(xset = optimizedXcmsSetObject, params = retcorGroupParameters, nSlaves = 2, subdir = "results/centWave", plot = TRUE)

I get the following error:

> resultRetcorGroup <- optimizeRetGroup(xset = optimizedXcmsSetObject, params = retcorGroupParameters, nSlaves = 2, subdir = "results/centWave", plot = TRUE)


starting new DoE with:

distFunc: cor_opt
gapInit: c(0, 0.4)
gapExtend: c(2.1, 2.7)
profStep: c(0.7, 1)
plottype: none
response: 1
factorDiag: 2
factorGap: 1
localAlignment: 0
retcorMethod: obiwarp
bw: c(22, 38)
minfrac: c(0.3, 0.7)
mzwid: c(0.015, 0.035)
minsamp: 1
max: 50
center: 1

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Error in unserialize(node$con) : error reading from connection
> 
> terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

This then results in a core dump.

session Info:

R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS: /local/cluster/R-3.5.0/lib64/R/lib/libRblas.so
LAPACK: /local/cluster/R-3.5.0/lib64/R/lib/libRlapack.so

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] stats4    parallel  stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] IPO_1.8.0           CAMERA_1.38.0       rsm_2.10           
 [4] RColorBrewer_1.1-2  xcms_3.4.0          MSnbase_2.8.0      
 [7] ProtGenerics_1.14.0 S4Vectors_0.20.0    mzR_2.16.0         
[10] Rcpp_1.0.0          BiocParallel_1.16.0 Biobase_2.42.0     
[13] BiocGenerics_0.28.0 here_0.1           

loaded via a namespace (and not attached):
 [1] lattice_0.20-35        rprojroot_1.3-2        digest_0.6.18         
 [4] foreach_1.4.4          plyr_1.8.4             backports_1.1.2       
 [7] acepack_1.4.1          mzID_1.20.0            ggplot2_3.1.0         
[10] pillar_1.3.0           zlibbioc_1.28.0        rlang_0.3.0.1         
[13] lazyeval_0.2.1         data.table_1.11.8      rstudioapi_0.8        
[16] rpart_4.1-13           Matrix_1.2-14          checkmate_1.8.5       
[19] preprocessCore_1.44.0  splines_3.5.0          stringr_1.3.1         
[22] foreign_0.8-71         htmlwidgets_1.3        igraph_1.2.2          
[25] munsell_0.5.0          compiler_3.5.0         pkgconfig_2.0.2       
[28] base64enc_0.1-3        multtest_2.38.0        pcaMethods_1.74.0     
[31] htmltools_0.3.6        nnet_7.3-12            tibble_1.4.2          
[34] gridExtra_2.3          htmlTable_1.12         RANN_2.6              
[37] Hmisc_4.1-1            IRanges_2.16.0         codetools_0.2-15      
[40] XML_3.98-1.16          crayon_1.3.4           MASS_7.3-51.1         
[43] grid_3.5.0             MassSpecWavelet_1.48.0 RBGL_1.58.0           
[46] gtable_0.2.0           affy_1.60.0            magrittr_1.5          
[49] scales_1.0.0           ncdf4_1.16             graph_1.60.0          
[52] stringi_1.2.4          impute_1.56.0          affyio_1.52.0         
[55] doParallel_1.0.14      limma_3.38.2           latticeExtra_0.6-28   
[58] robustbase_0.93-3      Formula_1.2-3          iterators_1.0.10      
[61] tools_3.5.0            DEoptimR_1.0-8         survival_2.43-1       
[64] colorspace_1.3-2       cluster_2.0.7-1        BiocManager_1.30.3    
[67] vsn_3.50.0             MALDIquant_1.18        knitr_1.20      

Any help would be much appreciated! Thank you!

danagibbon avatar Apr 02 '19 17:04 danagibbon

Hi @danagibbon

Currently IPO is unsupported, so I can't investigate in what might cause your issue. In general I can recommend to 1) reduce the amount of data / parameters to optimise and see if you can nail down where the error comes from 2) try your case directly with xcms to see if the error comes from xcms.

However, thanks for posting the issue. That's good for visibility. Maybe somebody else has seen this error too and can help?

rietho avatar Apr 10 '19 22:04 rietho

Hi, can you do a traceback() to see where the error occurred ? Yours, Steffen

sneumann avatar Apr 12 '19 10:04 sneumann