workflow4metabolomics / tools-metabolomics

Galaxy tools for metabolomics maintained by Workflow4Metabolomics
https://workflow4metabolomics.org/
GNU General Public License v3.0
25 stars 27 forks source link

Raise an error if no peaks were detected #42

Closed lecorguille closed 7 years ago

lecorguille commented 7 years ago

https://github.com/workflow4metabolomics/xcms/issues/2#issuecomment-282287927

Example:

    XSET OBJECT INFO
An "xcmsSet" object with 1 samples

Time range: Inf--Inf seconds (Inf--Inf minutes)
Mass range: Inf--Inf m/z
Peaks: 0 (about 0 per sample)
Peak Groups: 0 
Sample classes: .

Optained with

    ARGUMENTS INFO
singlefile_galaxyPath   /export/galaxy-central/database/files/000/dataset_5.dat
singlefile_sampleName   MM8.mzML
xfunction   xcmsSet
xsetRdataOutput /export/galaxy-central/database/files/000/dataset_7.dat
sampleMetadataOutput    /export/galaxy-central/database/files/000/dataset_8.dat
ticspdf /export/galaxy-central/database/files/000/dataset_9.dat
bicspdf /export/galaxy-central/database/files/000/dataset_10.dat
nSlaves 1
method  centWave
ppm 25
peakwidth   c(20, 50)
sneumann commented 7 years ago

Hi, it is not so much the inf-inf ,

> xs <- xcmsSet(system.file("microtofq/MM8.mzML", package="msdata"), method="centWave", ppm=25, peakwidth=c(20, 50))
Detecting mass traces at 25 ppm ... OK
Detecting features in 22 regions of interest ... FAIL: none found!
Warning messages:
1: In .centWave_orig(mz = mz, int = int, scantime = scantime, valsPerSpect = valsPerSpect,  :
  No peaks found!
2: In xcmsSet(system.file("microtofq/MM8.mzML", package = "msdata"),  :
  No peaks found in sample MM8.

the underlying cause is that there are no peaks. So rather than checking the RT range, I would recommend to check nrow(peaks(xs))

lecorguille commented 7 years ago

Thanks @sneumann Done: https://github.com/workflow4metabolomics/xcms/pull/46/files

melpetera commented 7 years ago

Tested and validated !