Search code examples
rbioconductor

R - XCMS package Error


I' ve the following problem :

Error in .C("NetCDFOpen", as.character(filename), ncid = integer(1), status = integer(1), : C symbol name "NetCDFOpen" not in DLL for package "xcms"

How do you get this error :

nc     <- xcms:::netCDFOpen(cdfFile)
ncData <- xcms:::netCDFRawData(nc)
xcms:::netCDFClose(nc)

I don't know why this don't works, although it should. For further info feel free to ask. Free .cdf files canf be found in the TargetSearchData package.

Code example :

## The directory with the NetCDF GC-MS files
cdfpath <- file.path(.find.package("TargetSearchData"), "gc-ms-data")
cdfpath

Solution

  • I don't think that it should, as you are implying. First, you are using a non-exported function through the :::. In addition, as stated by the error message, the is no NetCDFOpen symbol defined is the dll/so files.

    Using the standard input functionality from xcms, works smoothly:

    > library("xcms")
    > cdfpath <- file.path(.find.package("TargetSearchData"), "gc-ms-data")
    > cdfFile <- dir(cdfpath, full.names=TRUE)[1]
    > xs <- xcmsSet(cdfFile)
    7235eg04: 135:168 185:314 235:444 285:580 
    > xr <- xcmsRaw(cdfFile)
    

    If you really want to input your data manually, you should use the functionality from the mzR package, which xcms depends on:

    > openMSfile(cdfFile)
    Mass Spectrometry file handle.
    Filename:  /home/lgatto/R/x86_64-unknown-linux-gnu-library/2.16/TargetSearchData/gc-ms-data/7235eg04.cdf 
    Number of scans:  4400 
    

    Finally, do pay attention to always provide the output of sessionInfo, to assure that you are using the latest version. In my case:

    > sessionInfo()
    R Under development (unstable) (2012-10-23 r61007)
    Platform: x86_64-unknown-linux-gnu (64-bit)
    
    locale:
     [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
     [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
     [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
     [7] LC_PAPER=C                 LC_NAME=C                 
     [9] LC_ADDRESS=C               LC_TELEPHONE=C            
    [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    other attached packages:
    [1] BiocInstaller_1.9.4 xcms_1.35.1         mzR_1.5.1          
    [4] Rcpp_0.9.15        
    
    loaded via a namespace (and not attached):
    [1] Biobase_2.19.0     BiocGenerics_0.5.1 codetools_0.2-8    parallel_2.16.0   
    [5] tools_2.16.0      
    

    although if might be different for you, if you use the stable version of R and Bioconductor (currently 2.15.2/2.11).

    Hope this helps.