That is the exact procedure, steps 1-5 are contained in groupFWHM and 6-7 in groupCorr.
At the moment there is unfortunately no direct attempt to regroup the peaks.
A possible solution could be to raise the perfwhm parameter until both peaks are contained in one group.
A higher perfwhm value results in larger retention time windows. This way more compounds would fall into one group before groupCorr.
Would that be okay for your analysis?
Possible hack for the faahKO data set:
It is a little bit larger, but I hope reproducible.
We assume feature 10 would be the 195 m/z peak
library(CAMERA)
library(faahKO)
#alignment for faahko data set
xs <- group(faahko)
# show intensities for feature 10
groupval(xs,value="maxo")[10,]
ko15 ko16 ko18 ko19 ko21 ko22 wt15 wt16 wt18 wt19 wt21 wt22
12957 8557 3291 NA 7865 10080 11416 9831 NA 4230 12368 9892
#We see first sample has highest intensity for this feature
#Look after peak index
> groupval(xs)[10,]
ko15 ko16 ko18 ko19 ko21 ko22 wt15 wt16 wt18 wt19 wt21 wt22
13 495 1051 NA 1787 2112 2450 2907 NA 3758 4060 4374
#feature 10 has peak index 13
#small look to this peak
> xs@peaks[13,]
mz mzmin mzmax rt rtmin rtmax into intf maxo maxf sample
236.0956 236.0000 236.1000 2518.5930 2504.5080 2534.2420 252282.0354 472730.1389 12957.0000 25108.7063 1.0000
> xs@peaks[13,"maxo"]
maxo
12957
#save old maxo value
oldvalue <- xs@peaks[13,"maxo"]
#change value to maximum
xs@peaks[13,"maxo"] <- 10000000
#Use CAMERA
xsa <- xsAnnotate(xs)
xsa.group <- groupFWHM(xsa)
Start grouping after retention time.
Created 133 pseudospectra.
#Show first group (truncated for brevity )
> getpspectra(xsa.group,1)[,1:6]
mz mzmin mzmax rt rtmin rtmax
1 219.0848 219.0488 219.1000 2524.852 2518.592 2529.547
2 236.1018 236.0678 236.1188 2523.287 2518.592 2529.547
3 315.0000 315.0000 315.0000 2520.939 2507.638 2545.199
4 316.0000 316.0000 316.0230 2520.939 2509.203 2543.634
5 332.0000 332.0000 332.0121 2520.157 2507.638 2545.199
6 333.0012 333.0000 333.0286 2520.157 2507.638 2545.199
7 334.0316 334.0170 334.0733 2520.939 2509.203 2545.199
8 337.0000 336.9918 337.0000 2520.157 2509.203 2545.199
#We see feature 10 is in group 1
#write correct intensity back
xsa.group@xcmsSet@peaks[13,"maxo"] <- oldvalue
Hope this helps
The automatic sample selection choose that sample for one pseudospektrum, which contains the most abundant peak.
The idea is similar to groupFWHM that the highest abundant peaks are expected to have the "nicest" peak shape.
Carsten