xcms icon indicating copy to clipboard operation
xcms copied to clipboard

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

Open AndreasReinecke opened this issue 1 year ago • 6 comments

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

AndreasReinecke avatar Mar 11 '24 15:03 AndreasReinecke

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

sneumann avatar Mar 11 '24 15:03 sneumann

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

AndreasReinecke avatar Mar 11 '24 16:03 AndreasReinecke

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

sneumann avatar Mar 12 '24 07:03 sneumann

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

jorainer avatar Mar 20 '24 15:03 jorainer

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

  • installing source package ‘Matrix’ ... ** package ‘Matrix’ successfully unpacked and MD5 sums checked ** using staged installation ** libs xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Warning in system(paste(MAKE, p1(paste("-f", shQuote(makefiles))), "compilers"), : running command 'make -f 'Makevars' -f '/Library/Frameworks/R.framework/Resources/etc/Makeconf' -f '/Library/Frameworks/R.framework/Resources/share/make/shlib.mk' compilers' had status 1 sh: --version: command not found Warning in system2("xcrun", "--show-sdk-path", TRUE, TRUE) : running command ''xcrun' --show-sdk-path 2>&1' had status 1 using SDK: ‘NA’ xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun ERROR: compilation failed for package ‘Matrix’
  • removing ‘/Users/Andreas/Library/R/arm64/4.3/library/Matrix’
  • installing source package ‘xcms’ ... ** using staged installation ** libs xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Warning in system(paste(MAKE, p1(paste("-f", shQuote(makefiles))), "compilers"), : running command 'make -f 'Makevars' -f '/Library/Frameworks/R.framework/Resources/etc/Makeconf' -f '/Library/Frameworks/R.framework/Resources/share/make/shlib.mk' compilers' had status 1 sh: --version: command not found Error in if (nzchar(cxx)) { : argument is of length zero
  • removing ‘/Users/Andreas/Library/R/arm64/4.3/library/xcms’
  • restoring previous ‘/Users/Andreas/Library/R/arm64/4.3/library/xcms’

AndreasReinecke avatar Mar 20 '24 16:03 AndreasReinecke

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/

jorainer avatar Mar 21 '24 08:03 jorainer