lgatto / MSnbase

Base Classes and Functions for Mass Spectrometry and Proteomics
http://lgatto.github.io/MSnbase/
124 stars 50 forks source link

Dropping file(s) without any spectra #547

Closed jmorim closed 3 years ago

jmorim commented 3 years ago

I have SIM data from a flow injection analysis. Trying to load it with

data = readMSData(file, mode = 'onDisk')

results in the error

Dropping 1 file(s) without any spectra: filename.mzML. They/it contain(s) chromatograms and can be read with `readSRMData()`.

It's MS1 level data so not sure why it thinks it's appropriate to use readSRMData()

jmorim commented 3 years ago

It might be worth mentioning the data is from a Chemstation acquisition software, converted to MassHunter .D files with Agilent's LC-SQ translator, then converted to mzML with proteowizard. I remember analyzing data like this before but it wasn't SIM.

lgatto commented 3 years ago

The file doesn't contain any spectra, hence the the first part of the message Dropping 1 file(s) without any spectra: filename.mzML. In addition, that file contains chromatographic data, here the second part They/it contain(s) chromatograms and can be read with readSRMData()., which you can ignore if you aren't interested in that data.

jmorim commented 3 years ago

It should contain spectra though. Not sure why mzr returns .hasspectra as otherwise

lgatto commented 3 years ago

What is length(data) ?

jmorim commented 3 years ago

0, with readMSData it doesn't load the data. With readSRMData it returns 1130, but then I can't use any chromatogram functions.

lgatto commented 3 years ago

You should have an object with Chromatogram objects. If you expected spectra, it guess that something went wrong during the initial export. If you are sure that spectra should be present in that file, I suggest to look directly into it and confirm that you them in the mzML file (which I very much doubt though).

jmorim commented 3 years ago

bpi = chromatogram(dataSRM[[1]]) returns Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘chromatogram’ for signature ‘"Chromatogram"’ unless I'm subsetting it wrong.

jmorim commented 3 years ago

looking at the msconvert output it says input contains only chromatogram data so the problem must be there like you said

lgatto commented 3 years ago

Indeed, there's not such method for Chromatogram objects - dataSRM[[1]] is already a chromatogram and will be displayed as one. See ?MChromatograms for details on these objects.

The chromatogram method extract chomatograms from raw data containing specta.

jmorim commented 3 years ago

Just to update in case someone else searches this: I had to update proteowizard to convert SIM chemstation data with "SIM as spectra" checked off in MSConvert.