seliv55 / ramidcor

0 stars 1 forks source link

Load mzML data via mzR #2

Open sneumann opened 5 years ago

sneumann commented 5 years ago

Reading of files is done in /tmp/simd/SW620/simdata.CDF function readCDF()

It extracts from CDF the content of the netCDF:

  rett<-ncvar_get( nc, "scan_acquisition_time" )
   tiv<-ncvar_get( nc, "total_intensity" )
   npoint<-ncvar_get( nc, "point_count" )
     mz<-ncvar_get( nc, "mass_values" )
     iv<-ncvar_get( nc, "intensity_values" )

simdata.zip

@nilshoffmann can we have the simdata,zip converted as mzML please ? Thanks!

Yours, Steffen

sneumann commented 5 years ago

Hi, the following snippet will use readMSData() from package xcms. Installation can be done via (see also http://bioconductor.org/packages/3.9/bioc/html/xcms.html)

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("xcms", version = "3.9")

The code that has similar result as readCDF() will be:

library(MSnbase)

raw_data <- readMSData(files = "simdata.CDF", msLevel. = 1, mode="onDisk")

rett <- rtime(raw_data)
tiv <- tic(raw_data)
npoint <- sapply(mz(raw_data), length)
mz <- unlist(mz(raw_data))
iv <- unlist(intensity(raw_data))
nilshoffmann commented 5 years ago

Please try the following file: simdata.mzml.gz

nilshoffmann commented 5 years ago

Will examine the netCDF file and the converted mzML one for issues.