I met a problem with fillpeaks, whit the following error :
Defining peak areas for filling-in .... OK
Start integrating peak areas from original files
Requesting 751 peaks from T05_05C1.mzXML ... Error in binYonX(mz, int, breaks = brks, fromIdx = fromIdx, toIdx = toIdx, :
'fromIdx' has to be smaller than 'toIdx'!
Calls: fillChromPeaks ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
Can someone help me to identify what represent fromIdx and toIdx, please?
Thanks
Cédric
I searched a little about this error before contacting the xcms developers.
opened 12:47PM - 31 Oct 18 UTC
closed 12:38PM - 07 Jan 19 UTC
**Related issues**: #173 and #301
The following code works just fine:
```…
cwp <- CentWaveParam(peakwidth = c(3, 20), noise = 1000, ppm = 30,
snthresh = 100, prefilter = c(5,6500), fitgauss = TRUE)
xdata <- findChromPeaks(raw_data, param = cwp)
```
I get a huge peak list (over 30,000 peak) and all the succeeding steps of analysis with `xcms` goes forward without an error.
But on the same set of samples when I run the following code I receive an error:
```
xdata <- findChromPeaks(raw_data,
param = MatchedFilterParam(binSize = 0.03, fwhm = 10,
snthresh = 100, mzdiff = 0.008))
```
I get the same error when I run this:
`xdata <- findChromPeaks(raw_data, param = MatchedFilterParam())`
And even when I run this (only the error is more descriptive in this case):
```
register(SerialParam())
xdata <- findChromPeaks(raw_data, param = MatchedFilterParam())
```
This is the error I receive when running `without` SerialParam:
> Error: BiocParallel errors
> element index: 4, 5, 6, 7, 12, 13, ...
> first error: 'fromIdx' and 'toIdx' have to be >= 0!
And this is the error after I run `register(SerialParam())`:
> Error in binYonX(mz, int, breaks = brks, fromIdx = fromIdx, toIdx = toIdx, :
> 'fromIdx' and 'toIdx' have to be >= 0!
Some additional information that might be helpful:
`lapply(split(rtime(raw_data), fromFile(raw_data)), range, na.rm = TRUE)`
> $`1`
> [1] 93.298 1499.934
>
> $`2`
> [1] 93.280 1499.936
>
> $`3`
> [1] 93.143 1499.775
>
> $`4`
> [1] 93.120 1499.752
>
> $`5`
> [1] 93.259 1499.882
>
> $`6`
> [1] 93.324 1499.954
>
> $`7`
> [1] 93.120 1499.743
>
> $`8`
> [1] 93.287 1499.913
>
> $`9`
> [1] 93.703 1499.556
>
> $`10`
> [1] 93.351 1499.979
>
> $`11`
> [1] 93.714 1499.561
>
> $`12`
> [1] 93.179 1499.803
>
> $`13`
> [1] 93.467 1499.323
>
> $`14`
> [1] 93.520 1499.368
>
> $`15`
> [1] 93.675 1499.527
>
> $`16`
> [1] 93.145 1499.771
>
> $`17`
> [1] 93.335 1499.960
>
> $`18`
> [1] 93.501 1499.355
>
> $`19`
> [1] 93.248 1499.873
>
> $`20`
> [1] 93.041 1499.668
>
> $`21`
> [1] 93.320 1499.944
>
> $`22`
> [1] 93.539 1499.395
>
> $`23`
> [1] 93.333 1499.956
>
> $`24`
> [1] 93.699 1499.550
>
`lapply(split(mz(raw_data), fromFile(raw_data)), range, na.rm = TRUE)`
> $`1`
> [1] 49.9984 999.5386
>
> $`2`
> [1] 50.00001 999.54194
>
> $`3`
> [1] 49.99823 999.53594
>
> $`4`
> [1] 50.00337 999.53528
>
> $`5`
> [1] 50.00418 999.55385
>
> $`6`
> [1] 49.99949 999.55277
>
> $`7`
> [1] 49.99808 999.55543
>
> $`8`
> [1] 50.00019 999.55387
>
> $`9`
> [1] 50.00106 999.54415
>
> $`10`
> [1] 50.00372 999.54310
>
> $`11`
> [1] 49.99949 999.54110
>
> $`12`
> [1] 49.9998 999.5393
>
> $`13`
> [1] 49.9998 999.5477
>
> $`14`
> [1] 50.00008 999.53665
>
> $`15`
> [1] 50.00085 999.54125
>
> $`16`
> [1] 49.99935 999.54096
>
> $`17`
> [1] 50.00124 999.54605
>
> $`18`
> [1] 49.99965 999.53923
>
> $`19`
> [1] 50.00081 999.54980
>
> $`20`
> [1] 50.00023 999.54789
>
> $`21`
> [1] 49.99915 999.54223
>
> $`22`
> [1] 50.00616 999.54191
>
> $`23`
> [1] 50.00055 999.54390
>
> $`24`
> [1] 49.99892 999.53650
>
`raw_data`
> MSn experiment data ("OnDiskMSnExp")
> Object size in memory: 12.97 Mb
> `- - - Spectra data - - -`
> MS level(s): 1
> Number of spectra: 43552
> MSn retention times: 1:33 - 24:60 minutes
> `- - - Processing information - - -`
> Data loaded [Wed ***]
> MSnbase version: 2.7.12
> `- - - Meta data - - -`
> phenoData
> rowNames: 1 2 ... 24 (24 total)
> varLabels: sample_name sample_group
> varMetadata: labelDescription
> Loaded from:
> [1] ***.mzML... [24] ***.mzML
> Use 'fileNames(.)' to see all files.
> protocolData: none
> featureData
> featureNames: F01.S0001 F01.S0002 ... F24.S1814 (43552 total)
> fvarLabels: fileIdx spIdx ... spectrum (30 total)
> fvarMetadata: labelDescription
> experimentData: use 'experimentData(object)'
`packageVersion("mzR")`
> [1] ‘2.15.5’
`packageVersion("MSnbase")`
> [1] ‘2.7.12’
`packageVersion("xcms")`
> [1] ‘3.3.6’
```
R version 3.5.1 (2018-07-02)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Scientific Linux 7.5 (Nitrogen)
Data files were converted from .d Agilent format to .mzML using MSConvert v. 3.0.18247-49b14bb3d
```
In this thread, it is said:
The problem occurred if the data was subset to an m/z range for which no signal was present in some spectra (or in general if the data contained empty spectra).
If it doesn't make sense to you or @team.w4m , I will write an issue in Issues · sneumann/xcms · GitHub
I read the thread about binYonX you tagged. It seems consistant with the fact that fillPeaks in particular is searching for content in areas that have been previously considered as not containing 'sufficiently good' peaks (excuse the werd expression), which includes potentially 'empty' zones.
I vote for the issue reporting.
I just see @gildaslecorguille that the developper ask for examples/data
Don't hesitate @ced.leroux to provide some examples directly on the issue if you can: Fillpeaks - Error in binYonX · Issue #519 · sneumann/xcms · GitHub