sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis
Other
183 stars 80 forks source link

xset crashes on MAC OS 14.3 R 4.3.3 , BiocManager 1.30.22 and xcms 4.0.2 #730

Open AndreasReinecke opened 6 months ago

AndreasReinecke commented 6 months ago

Hi, when running the following command line on a MAC M1 / MOC OS 14.3 with R 4.3.3 , BiocManager 1.30.22 and xcms 4.0.2 I get the error messages below: I'd be grateful for any hint. Best andreas

xset <- xcmsSet(files=files, mzdiff=0.2, fwhm=5, step=0.1, snthresh=5) objc[2495]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called. objc[2495]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug. .... Error in reducer$value.cache[[as.character(idx)]] <- values : wrong args for environment subassignment In addition: Warning message: In parallel::mccollect(wait = FALSE, timeout = 1) : 2 parallel jobs did not deliver results

sneumann commented 6 months ago

Hi, xcmsSet is quite deprecated, without any recent developments and in case we find issues with it, we are rather going to remove it than to fix it. So we encourage you to look at the newer classes and functions in the vignette.

Back to your issue, this looks like something with parallelisation, so first check would be to disable that: xset <- xcmsSet(files=files, mzdiff=0.2, fwhm=5, step=0.1, snthresh=5, BPPARAM=SerialParam())

If that fixes things, you need to check your BiocParallel installation.

Yours, Steffen

AndreasReinecke commented 6 months ago

Thanks Steffen! ..., BPPARAM=SerialParam() ) helped. But instead I get "invalid class “xcmsPeaks” object: superclass "mMatrix" not defined in the environment of the object's class". The BiocParallel installation is 1.36.0. I admit that I am - although quite experienced with GC-MS - new to processing the data with R. Sorry for bothering. Best wishes andreas

sneumann commented 6 months ago

Hi, great, that identifies the parallelisation as underlying cause. If you need a speedup because you run large studies on the laptop, you'll need to troubleshoot the BiocParallel stuff.

Please search the issues here about the Matrix issue, iirc you need a newer Matrix package.

Yours, Steffen

jorainer commented 6 months ago

Note: the Matrix error/issue seems to get fixed by a re-installation of the Matrix and xcms packages from source:

BiocManager::install(c("Matrix", "xcms"), type = "source", force = TRUE)

at least that fixed this error in issue #733

AndreasReinecke commented 6 months ago

Hi, thanks for the hint! Unfortunately it didn't resolve my issue. When executing the forced installation the error message further down was displayed. Could this be related to R-Studio using a 'User Library' and a 'System Library'? In the meantime I used exactly the same script on a Windows PC with most the most recent R-Version installed and it worked fine. The issue therefore seems to be MAC specific. Best wishes

jorainer commented 6 months ago

the error you get here is because you have no compiler installed on your macOS - you would need to install the "command line tools" from apple. Maybe you can find some information on the official R page https://cloud.r-project.org/