This error can occur in retcor when using the peakgroup method with parameters leading to no or only one "well behaved peak". This is generally due to inappropriate minFraction (previously 'missing') parameter and/or extraPeaks (priviously 'extra') parameter.
This is particularly likely to happen when you combine a high number of samples and restrictives minFraction and/or extraPeaks values. The highest the number of samples, the less probable it is to find peak groups with limited number of missing samples and/or limited number of multiple peaks.
When running into this problem, you can consider the following options:
- adjust the minFraction and/or extraPeaks values: aren't they too restrictive? Remember that they are expressed in percentage of samples for minFraction and in number of extra peaks compared to the number of sample for extraPeaks.
- review your previous grouping results and consider adjusting its parameters if innappropriate: you may have fixed the right minFraction and extraPeaks but may not have correctly performed the grouping. For example, you may have use a bandwidth parameter with a value that is too high and thus systematically grouping several peaks in one same peak group, leading to the impossibility to find one that would fulfil the extraPeaks requirement. The reverse thing (even if less likely) can happen with a group's "minFraction" (i.e. the one from the goup step) very low combined with a bandwith too low: you may cut peaks into slices that do not have enough samples in to be considered a 'well behaved peak' in retcor.
Note that while trying to resolve your problem, adjusting parameters, you may encounter the following message:
Performing retention time correction using XXX peak groups.
Error in do_adjustRtime_peakGroups(chromPeaks(object, msLevel = msLevel), :
Not enough peak groups even for linear smoothing available!
Calls: adjustRtime -> adjustRtime -> .local -> do_adjustRtime_peakGroups
In addition: Warning message:
In do_adjustRtime_peakGroups(chromPeaks(object, msLevel = msLevel), :
Too few peak groups for 'loess', reverting to linear method
with XXX varying.
This is due to the same problem: still not enough well behaved peaks, meaning you still need to continue adjusting things.
Also note that when you will finally manage to run your job with no error, you should give special attention in checking your results: to be sure the correction is appropriate, check the pdf file generated to ensure there were enough well behaved peaks accross time to compute relevant correction.
Can you please confirm this solution solves your problem once tested?
Thank you for time.