Skip to main content


This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - Jan Stanstrup

XCMS / Re: Targeted Peak Picking
It seems you are generally able to write R scripts so here is just a small hint:

in your xcmsSet object you have the mass for each feature in:

Simple make a loop that runs through each mass in your target list and mark which feature gives a hit.
Something like:
Code: [Select]
(abs(xset@groups[,"mzmed"]-mass[i])/mass[i])*1E6 < ppm_tol

would give you a logical vector for each target mass giving you the possible location of the target.
I didn't test this but that would be the general easy way.

If you only have a single sample you could use xset@peaks instead that have additional columns you could use for filtering:
Code: [Select]
integrated peak intensity

baseline corrected integrated peak intensity

maximum peak intensity

Signal/Noise ratio, defined as (maxo - baseline)/sd, where
maxo is the maximum peak intensity,
baseline the estimated baseline value and
sd the standard deviation of local chromatographic noise.
XCMS / Re: Peak filtering
I believe the mzClust is intended for data where you directly infused your sample to the MS; so without any chromatography. I could imagine that is why retention times gets messed up. I would just use the default "density".
A ppm of 5 as you are using seems quite low. At least my instrument does not perform that good reliably.
XCMS / Re: Peak filtering
Just out of curiosity... What kind of data do you have? Any particular reason to use mzClust? That is meant for single spectrum data. Is that what you have?
XCMS / Re: Peak filtering
That can be adjusted in the group function with following parameters:

Code: [Select]
minimum fraction of samples necessary in at least one of the sample groups for it to be a valid group

minimum number of samples necessary in at least one of the sample groups for it to be a valid group
XCMS / Re: Warning problem after fillPeaks
A peak was found in some sample in the range 364.471 - 378.604. As your graph shows not all files have data at early as 364.4, therefore the fillpeaks cannot attempt to find that peak in those files and is forced to set 0. I would just ignore it.
XCMS / Re: Warning problem after fillPeaks
Probably they start at slightly different times. So it cannot look for peaks identified very early in some samples if that retention time region is missing in others. I would just ignore...

You can try this (will probably take a while):
Code: [Select]
for (i in 1:length(files)){
first_scan[i] = min(xcmsRaw(files[i])@scantime)


To see where your files actually start.
XCMS / Re: Warning problem after fillPeaks
This doesn't seem to check if the file got cut somehow if the file is still valid. I am just asking you to open the file in whatever viewer and check that the chromatogram has data in the whole retention time range as expected.
XCMS / Re: Warning problem after fillPeaks
Does this file otherwise look normal when you look at the chromatogram? This error suggests that there is no data above 6 mins for this file.
XCMS - FAQ / Re: Time for scan x greater than scan y - ProteoWizard
Thanks Paul.
This was a Waters Premier QTOF. I think it is about five years old.
I checked the first handful of scans for both functions and I get same scan times between CDF (from databridge) and mzXML (from masswolf) when viewed in mzMine. Which differences do you see?
XCMS - FAQ / Re: Time for scan x greater than scan y - ProteoWizard
Hi Paul.

I have been trying to use your stitch method but I always get an error:

Code: [Select]
> temp = xcmsSet(file, lockMassFreq=TRUE)
Error in if (length(by) && by == 0 && length(del) && del == 0) return(from) :
  missing value where TRUE/FALSE needed

> traceback()
11: seq.default(from = start, to = length(object@scanindex), by = freq)
10: seq(from = start, to = length(object@scanindex), by = freq)
9: makeacqNum(object, freqLock, start)
8: makeacqNum(object, freqLock, start)
7: AutoLockMass(lcraw)
6: AutoLockMass(lcraw)
5:, list(object, lockMass))
4: .local(object, lockMass, ...)
3: stitch(lcraw, AutoLockMass(lcraw))
2: stitch(lcraw, AutoLockMass(lcraw))
1: xcmsSet(file, lockMassFreq = TRUE)

Any ideas?

edit: In the paper you write that length of each gap is a parameter and defaults to 2. I cannot see a way to set that parameter. In my case there is only 1 lockmass scan per gap.