Metabolomics Society Forum

Software => R => XCMS => Topic started by: yguitton on February 29, 2012, 04:47:01 AM

Title: Getting UV data into XCMS+ findPeaks
Post by: yguitton on February 29, 2012, 04:47:01 AM
Hi everyone,

I would like to know if someone tried to import UV data in XCMS and then used the findPeaks function?
I have seen on the forum that some xcms users are familiar with import of UV data in xcms but i didn't see any clue on the cookbook or on the internet.

I have managed to fill an xcmsRaw object with my UV data and i can create chromatograms with plotChrom() but i didn't managed to use the findPeaks.matchedFilter(raw, ...) function
error messages
seq.default(floor(mrange[1]/step) * step, ceiling(mrange[2]/step) *  :
  invalid (to - from)/by in seq(.)
1: In min(x, na.rm = na.rm) :  no argument find for min ; Inf
2: In max(x, na.rm = na.rm) :  no argument find for max; Inf

any idea?

to fill my xcmsRaw object i have tried to fill as many slots as possible but some are still empty.
#empty slots
raw@profparam
raw@polarity
raw@gradient
raw@msnAcquisitionNum
raw@msnCollisionEnergy
raw@msnPrecursorCharge
raw@msnPrecursorIntensity
raw@msnPrecursorMz
raw@msnPrecursorScan
raw@msnRt
raw@msnScanindex
raw@profmethod
Title: Re: Getting UV data into XCMS+ findPeaks
Post by: sneumann on February 29, 2012, 02:07:08 PM
Hi,

How did you put the UV data into th excmsRaw ?
As one "spectrum", where each RT datapoint
becomes a "m/z" value, or as a number of
single-mass spectra ? I assume the latter.

I could imagine that matchedFilter never expected spectra
with just a single mass. You could fake a second mass,
by just repeating the data.

Yours,
Steffen
Title: Re: Getting UV data into XCMS+ findPeaks
Post by: yguitton on March 02, 2012, 09:43:53 AM
Hi Steffen,

thanks for your answer, my xcmsRawUV function takes every time points as scan and every wavelength as m/z

my input matrix is
RT wavelength i ........ wavelength n
0.01 intensity i ...........intensity n
.
16.1 intensity ............intensity

scantime<- column RT values * 60
mz<- wavelength
tic<- sum of intensity for each RT

I have solved one of my problems (in fact there was an error in raw@tic allocation in my xcmsRawUV function)
so now,
I can draw good chromatogram with the code >plotChrom(object, mzrange=254), here the chromatogram is the one corresponding to 254 nm wavelength  and is exactly as expected. [attachment=1:2awapdi0]plotchrom_mzrange254.jpg[/attachment:2awapdi0]

and i can launch a
findPeaks.matchedFilter(raw..)
 but my function is still wrong somewhere (in the profile matrix?)
I think that part of my problem is  my profile matrix,
raw@env$profile<- transposition of my input matrix (without RT column)
 because findpeaks look at the column of the raw@env$profile matrix, right?

[attachment=0:2awapdi0]findpeaks_254.jpg[/attachment:2awapdi0]

I have some more work to do on my function if i want it to be able to find/align/compare peaks in my UV data as xcms does for mass data
 
May be someone have tried to do similar functions in R and can give me some clues?

thanks

Yann

[attachment deleted by admin]