Hi,
yes, splitting should work:
library(xcms)
## load file
xr <- xcmsRaw("test file.mzXML", profstep=0)
## Create a "Tag" for each scan,
scans <- length(xr@scanindex)
f <- rep(c("MS1", "MS2A", "MS2B", "DAD"),scans/4+1)[1:scans]
## Split xcmsRaw into one xcmsRaw per "Tag"
xrs <- split(xr, f=f)
## Extract the MS1 stuff
xr1 <- xrs[["MS1"]]
## Fix the profile matrix required for plotChrom et al
profMethod(xr1) <- "bin"
profStep(xr1) <- 5
plotChrom(xr1, rtrange=c(600,700))
## FInd Peaks (not optimized parameters here!)
p <- findPeaks(xr1, method="centWave")
## Write corrected files out
write.cdf(xr1, "test_file_MS1.cdf")
write.mzdata(xr1, "test_file_MS1.mzData")
Yours,
Steffen