Skip to main content
Topic: calibrate (Read 4999 times) previous topic - next topic

calibrate

I have some single quad GC-MS data, in which part of the dataset was run using one autotune and the remaing using a different autotune.  As a result, the masses are shifted in half the dataset.  Oddly enough by a pretty large margin (which I can't explain) - about 0.4-0.5 Da.  I looked into the XCMS options and found what I thought would be the savior for this dataset, in the calibrate() function.  However, I cannot get it to work for me.  I am using a subset of the dataset, five files from tune one, five files from tune two.  I use this code: 

##peak detection: GC-MS peak
xset <- xcmsSet(dataset, nSlaves=4, method = "matchedFilter", fwhm = 8, max = 500, snthresh = 3, step = 0.5, steps = 2, mzdiff = 0.1, index = FALSE, sleep = 0)
xset

An "xcmsSet" object with 10 samples

Time range: 601.8-2482.9 seconds (10-41.4 minutes)
Mass range: 50.2301-649.5369 m/z
Peaks: 71753 (about 7175 per sample)
Peak Groups: 0
Sample classes: GC-MS_masscorrection

Profile settings: method = bin
                  step = 0.5

Memory usage: 8.38 MB

I then try to apply the m/z correction using the calibrate function using the command:
xset2<- calibrate(xset, calibrants=147.1, method="shift", mzabs=1, neighbours=3, plotres=TRUE)

Error in .local(object, ...) : No masses close enough!

I know for a fact that there are plenty of masses near this mass in the dataset, but I can't seem to find them.  In fact, even if I expand the mzabs to 10, I receive the same message.  If I expand the mzabs value to 100, it works, and actuall does seem to shift all the masses by 100da (note the mass range)

> xset2
An "xcmsSet" object with 10 samples

Time range: 601.8-2482.9 seconds (10-41.4 minutes)
Mass range: 144.0489-743.6364 m/z
Peaks: 71753 (about 7175 per sample)
Peak Groups: 0
Sample classes: GC-MS_masscorrection

Profile settings: method = bin
                  step = 0.5

Memory usage: 8.38 MB
>

I am misusing 'calibrate' or misunderstanding?  What am I missing?  Thanks,
Corey

Re: calibrate

Reply #1
Pretty quiet here....  Anyone ever use the calibrate function?

Re: calibrate

Reply #2
Corey,

I just had a look at the code. The method requires the calibrant peak to be in each sample. If the peak is not in the feature list (didn't get picked as a peak) then it fails. You could potentially put a 'next' into the for loop that it's using but then that files mz's won't match up with the others.

I guess the code could look to see what the shift was and go back to those files assuming that the mass drift is the same, which I don't think it would be.... umm nasty problem :(

Paul
~~
H. Paul Benton
Scripps Research Institute
If you have an error with XCMS Online please send me the JOBID and submit an error via the XCMS Online contact page

Re: calibrate

Reply #3
THanks for a response Paul,

I am a bit confused by your comment - are you saying the for the calibrate function to work, you have to have an EXACT mass match?  If you have an exact mass match, why would you need to calibrate at all?  I am just very confused by the application of this function and the few results I have seen.  Thanks again,

Corey

Re: calibrate

Reply #4
Corey,

Sorry for the massive delay. I thought I had respond to this but it appears that it didn't get there, maybe I forgot to hit post? Anyways, the algorithm doesn't need the exact mass match, there is an error parameter that you can input. What I meant is that as the correction works on a per file bases it needs to see the calibrates in each file otherwise it falls over. So if you put in calibrate A and B, but it doesn't see A & B in file 5 then it'll error and end. The peak detection of feature A & B doesn't need to know what their exact true mass is to pick it. However, the calibrate function needs it to be in a certain range of mz.

Paul
~~
H. Paul Benton
Scripps Research Institute
If you have an error with XCMS Online please send me the JOBID and submit an error via the XCMS Online contact page