xcms icon indicating copy to clipboard operation
xcms copied to clipboard

XCMS set-up

Open Onuh007 opened this issue 2 years ago • 8 comments

Hi I am a beginner in xcms data analysis. I downloaded the latest version of R and installed XCMS and CAMERA package and tried to use them in my data analysis but I always got "error in xcmsSet" whenever I enter the command and similar to the group(xs) command line too. Attached is a photo that should describe my challenges better. Thank You

Screenshot (1)

Onuh007 avatar Apr 04 '22 10:04 Onuh007

Looks like a broken installation. It is telling you that the Rcpp package is missing. That should not happen, but did. You can try to install it manually. Also you cannot create an empty xcmsSet as you seem to be trying to do. Thirdly using xcmsSet is obsolete...

I will plug my own walkthrough that I suggest to try to follow: https://nexs-metabolomics.gitlab.io/INM/inm-booklet/

stanstrup avatar Apr 04 '22 11:04 stanstrup

Hi. Thank you for your reply. Please, how can i fix my installation since you suggested that I have a broken installation? Also, please can you guide me on how to install the Rcpp manually. If the xcmsSet is obsolete, that means some of the commands that i want to use for this analysis maybe obsolete too, please how can I get or create or comfirm that my commands can be used effectively. Finally, most of the steps in the walkthrough you shared with me are for Rstudio but I am using simply R 4.1.3 window version. Please i need more guidance.

Thanks

Onuh007 avatar Apr 06 '22 05:04 Onuh007

I suggest you start with installing all packages properly. These are Bioconductor packages, thus you should install them through Bioconductor (github installations are suggested only for more advanced users):

install.packages("BiocMangager")
BiocManager::install(c("MSnbase", "xcms", "mzR", "CAMERA"))

Then, you should use the more updated functionality of xcms (instead of xcmsSet, group etc). Be aware that every Bioconductor package provides vignettes (documents) that describe the main functionality of the package on a simple example. You should always start there and read them carefully to understand how the package code can be used. You can list the available vignettes for xcms by typing browseVignettes("xcms") in R (after installing all packages with the code above). An online version of the main xcms vignette can also be found here (this is the same that will be installed on your computer).

Then there are plenty of additional documentations, tutorials etc out there that you can follow. One is for example this tutorial describing also how to set settings for xcms-based peak detection. @stanstrup has also provided a link to a comprehensive tutorial.

jorainer avatar Apr 06 '22 06:04 jorainer

To answer about RStudio: RStudio is just a frontend for R that is a command-line tool. There is nothing RStudio specific in the code. Rstudio makes a lot of things easier, so I heavily suggest you use that also.

stanstrup avatar Apr 07 '22 09:04 stanstrup

Hi Thank you @stanstrup and @jorainer for all your guidance. It has really been helpful and i have made a lot of progress and learning while reading all the recommended. Please, what does this error means

Error: stop worker failed: wrong args for environment subassignment

Onuh007 avatar Apr 18 '22 14:04 Onuh007

Hi, a bit more context what command caused that issue would help. Also, avoid screenshots, since we love to cut&paste things to reproduce if necessary. Github issues allow to include code blocks in issue messages for even better viewing. Yours, Steffen

sneumann avatar Apr 18 '22 18:04 sneumann

Hi . Below i the command that gave me the error

library(xcms) Loading required package: BiocParallel Loading required package: MSnbase Loading required package: BiocGenerics

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:stats’:

IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

anyDuplicated, append, as.data.frame, basename, cbind, colnames,
dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
union, unique, unsplit, which.max, which.min

Loading required package: Biobase Welcome to Bioconductor

Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: mzR Loading required package: Rcpp Loading required package: S4Vectors Loading required package: stats4

Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:base’:

expand.grid, I, unname

Loading required package: ProtGenerics

Attaching package: ‘ProtGenerics’

The following object is masked from ‘package:stats’:

smooth

This is MSnbase version 2.20.1 Visit https://lgatto.github.io/MSnbase/ to get started.

Attaching package: ‘MSnbase’

The following object is masked from ‘package:base’:

trimws

This is xcms version 3.16.1

Attaching package: ‘xcms’

The following object is masked from ‘package:stats’:

sigma

Warning message: In fun(libname, pkgname) : mzR has been built against a different Rcpp version (1.0.7) than is installed on your system (1.0.8.3). This might lead to errors when loading mzR. If you encounter such issues, please send a report, including the output of sessionInfo() to the Bioc support forum at https://support.bioconductor.org/. For details see also https://github.com/sneumann/mzR/wiki/mzR-Rcpp-compiler-linker-issue.

xs <- xcmsSet() Scanning files in directory C:/Users/CK_PC/Desktop/Onuh/Supernatant ... found 18 files Loading required package: xcms Loading required package: BiocParallel Loading required package: MSnbase Loading required package: BiocGenerics

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:stats’:

IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

anyDuplicated, append, as.data.frame, basename, cbind, colnames,
dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
union, unique, unsplit, which.max, which.min

Loading required package: Biobase Welcome to Bioconductor

Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: mzR Loading required package: Rcpp Loading required package: S4Vectors Loading required package: stats4

Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:base’:

expand.grid, I, unname

Loading required package: ProtGenerics

Attaching package: ‘ProtGenerics’

The following object is masked from ‘package:stats’:

smooth

This is MSnbase version 2.20.1 Visit https://lgatto.github.io/MSnbase/ to get started.

Attaching package: ‘MSnbase’

The following object is masked from ‘package:base’:

trimws

This is xcms version 3.16.1

Attaching package: ‘xcms’

The following object is masked from ‘package:stats’:

sigma

Error: stop worker failed: wrong args for environment subassignment

Onuh007 avatar Apr 19 '22 06:04 Onuh007

Please don't use xcmsSet and similar functionality (group...) anymore. This part of the xcms code is no longer maintained or fixed. The error message seems to be related to the old parallel processing code. Please follow the official vignettes and documentation to perform your analysis: i.e. read the data with readMSData, perform peak detection with findChromPeaks, ... See e.g. here for the official vignette and then also the other documents Jan and I linked in the comments above.

jorainer avatar Apr 19 '22 07:04 jorainer