Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling files without any spectra #342

Closed
lgatto opened this issue May 15, 2018 · 1 comment
Closed

Handling files without any spectra #342

lgatto opened this issue May 15, 2018 · 1 comment
Assignees

Comments

@lgatto
Copy link
Owner

lgatto commented May 15, 2018

This issue deals with the problem described here, when a files doesn't contain any data (such as files containing only chromatographic data). If have done some small changes to deal with this:

> x <- readMSData(f0, mode = "onDisk")
Warning message:
In readOnDiskMSData(files = files, pdata = pdata, msLevel. = msLevel.,  :
  No spectra in file 'Lipidyzer Batch - 20151021124234 - 1 - 1-22766 - QC-05840.mzml'.
> x
MSn experiment data ("OnDiskMSnExp")
- - - Processing information - - -
Data loaded [Tue May 15 16:05:17 2018] 
 MSnbase version: 2.7.0 

But there's an issue when reading multiple files when one or more are empty of any spectra:

> readMSData(c(f0, msdata::proteomics(full.names = TRUE)[3]), mode = "onDisk")
Error in validObject(.Object) : 
  invalid classOnDiskMSnExpobject: Spectra file indices in assayData does not match files in processinData.
In addition: Warning message:
In readOnDiskMSData(files = files, pdata = pdata, msLevel. = msLevel.,  :
  No spectra in file 'Lipidyzer Batch - 20151021124234 - 1 - 1-22766 - QC-05840.mzml'.

The error above happens because there are 2 file names in the processingData slots, but only one in the assayData/featureData. This is expected, but how should we deal with this?

  • Remove that check from the validity method - I would prefer not do this.
  • Keep track of empty files and keep this into account in the validity method - this will increase complexity of the code base for a edge case.
  • Do not consider these file names in the processingData at all. The user will know about this as a warning is returned when reading the file, but there won't be any trace later on (unless we log this) - my preferred fix.

@sgibb @jotsetung - any opinion or suggestion?

@lgatto lgatto self-assigned this May 15, 2018
@jorainer
Copy link
Collaborator

I'd suggest to implement a low level hasSpectra and hasChromatograms function (eventually in mzR). This could be used to guide the user also to other function to read data (e.g. if a file does not contain spectra, but only chromatograms and the user wants to read that using readMSData the error message could suggest to use the readSRMData instead).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants