Help Error could not find function xcmsSet
2
0
Entering edit mode
dfrtyu • 0
@grateshak-10586
Last seen 3.0 years ago
United Kingdom

Hi, I am using bioconductor packages in R. I keep getting this error: 

Error: could not find function "xcmsSet" 

This is what I ran. 

# load required libraries
library(xcms)
library(CAMERA)

# set nslaves for the number of available cores of your machine
# Follow xcms vignette to understand data structure
# http://www.bioconductor.org/packages/release/bioc/vignettes/xcms/inst/doc/xcmsPreprocess.pdf

nslaves <- 4

xset <- xcmsSet(
         "C:/", method='centWave', ppm=2, peakwidth=c(10,50),
        snthresh=3, prefilter=c(3,100), integrate=1, mzdiff=-0.00005,
           verbose.columns=TRUE,fitgauss=FALSE, nSlaves=nslaves
        )

# negative mode
xset2 <- xcmsSet(
         "C:/", method='centWave', ppm=2, peakwidth=c(10,50),
          snthresh=3, prefilter=c(3,100), integrate=1, mzdiff=-0.00005,
          verbose.columns=TRUE,fitgauss=FALSE, nSlaves=nslaves
         )

xcms is there in my win-library and all other bioconductor package neccesary. I also checked for xcmsSet in the unitTest folder of the xcms package. it is there as runit.xcmsSet.R.

I tried to load the library (xcms) alone. I get this error on mzR package:

> library(xcms)
Loading required package: mzR
Loading required package: Rcpp
Error : .onLoad failed in loadNamespace() for 'mzR', details:
  call: value[[3L]](cond)
  error: failed to load module Ramp from package mzR
invalid assignment for reference class field ‘class_pointer’, should be from class “externalptr” or a subclass (was class “character”)
In addition: Warning messages:
1: package ‘Rcpp’ was built under R version 3.0.3 
2: In fun(libname, pkgname) :
   mzR has been built against a different Rcpp version
 than is installed on your system. 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
 mailing list -- http://www.bioconductor.org/help/mailing-list.
Error: package ‘mzR’ could not be loaded 

I also see the packages Rcpp and mzR in my library. I have downloaded the latest zip ofr this package. No result.Pls Help

xcms metabolomics mzr rcpp ramp • 3.0k views
ADD COMMENT
0
Entering edit mode
Johannes Rainer ★ 2.1k
@johannes-rainer-6987
Last seen 8 weeks ago
Italy

Could you please provide some more information on the R you are using? the output of sessionInfo() would e.g. be useful. There is definitely a problem with the mzR package...
 

ADD COMMENT
0
Entering edit mode

Thanks Johannes. I run R 3.0.1 now, when I started getting the error, I installed latest R 3.2.5 and I got same errors. so I simply removed the new version, believing versions were not the problem. When I shifted version, I copied every file within win-library to ensure my packages were still there. Anyway, sessionInfo()

Error: could not find function "xcmsSet"
> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252   
[3] LC_MONETARY=English_India.1252 LC_NUMERIC=C                  
[5] LC_TIME=English_India.1252    

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
[1] Biobase_2.30.0      BiocGenerics_0.16.1

 I also tried the latest mzR and latest Rcpp al to no avail. I have also used earlier versions of Rcpp, then it will say Rcpp; could not be found by mzR': 

> library(xcms)
Loading required package: mzR
Error: package ‘Rcpp’ required by ‘mzR’ could not be found
In addition: Warning message:
package ‘mzR’ was built under R version 3.2.3 .

ADD REPLY
0
Entering edit mode
dfrtyu • 0
@grateshak-10586
Last seen 3.0 years ago
United Kingdom

Thanks Johannes. I run R 3.0.1 now, when I started getting the error, I installed latest R 3.2.5 and I got same errors. so I simply removed the new version, believing versions were not the problem. When I shifted version, I copied every file within win-library to ensure my packages were still there. Anyway, sessionInfo()

Error: could not find function "xcmsSet"
> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252   
[3] LC_MONETARY=English_India.1252 LC_NUMERIC=C                  
[5] LC_TIME=English_India.1252    

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
[1] Biobase_2.30.0      BiocGenerics_0.16.1

 I also tried the latest mzR and latest Rcpp al to no avail. I have also used earlier versions of Rcpp, then it will say Rcpp; could not be found by mzR': 

> library(xcms)
Loading required package: mzR
Error: package ‘Rcpp’ required by ‘mzR’ could not be found
In addition: Warning message:
package ‘mzR’ was built under R version 3.2.3 .

 

ADD COMMENT
0
Entering edit mode

you should never do this, always install the "correct" Bioconductor package versions for the R version you've got installed; you should not install Bioconductor packages manually by downloading the zip file, always install them with the biocLite call!

I suggest you to start your R and install Bioconductor again:

source("https://bioconductor.org/biocLite.R")
biocLite()
## Eventually, if it's not updating xcms etc install them again
biocLite(c("mzR", "xcms"))

check the corresponding page on bioconductor: http://www.bioconductor.org/install/

this should fix your problem

ADD REPLY
0
Entering edit mode

Thanks again, Johannes. Sure, that is how I initially installed all packages before I encountered the problem. Yes, I did use the code as u wrote above, with biocLite installation and all.

It gave me the error I mentioned 'could not find xcmsSet and later mzR could not be loaded. 

It was those error that led me to all the installation of  latest zip file.

Thanks

ADD REPLY
0
Entering edit mode

I am beginning to think again that some syntax in my R version is still the problem

ADD REPLY

Login before adding your answer.

Traffic: 507 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6