Is it possible to visualise the content of a xcmsSet object / the output of peak picking ?
1
0
Entering edit mode
@lucieconchou-10787
Last seen 8.2 years ago

Hello,

I am trying to use metaMS to analyse GC-MS data. On a test dataset I have already analysed manually, the runGC function detects around 1/3 of the peaks I found myself, which is not satisfactory at all. I am trying to figure out which stage of the work flow is limiting the overall sensitivity, so as to get an idea of which parameters I have to modify.

What I want to do is visualise the output of the peak picking stage. I expect something like a table giving for each sample and each m/z the retention times of all detected peaks. By comparing it with the output of runGC, I would then see if there are peaks that were detected at that stage but lost during pseudospectrum reconstruction or grouping of pseudospectra.

Here is what I tried. I run the peak picking function from metaMS package, using the recommended example settings.

>GCset <- peakDetection(cdffiles,settings = metaSetting(TSQXLS.GC, "PeakPicking"),convert2list = F, nSlaves = 2)
> GCset

$LC_11april2016_control
An "xcmsSet" object with 1 samples

Time range: 262-2240.4 seconds (4.4-37.3 minutes)
Mass range: 29.1-357.029 m/z
Peaks: 240 (about 240 per sample)
Peak Groups: 0 
Sample classes: test_data_from_abioticvar 

Peak picking was performed on MS1.
Profile settings: method = bin
                  step = 0.5

Memory usage: 0.146 MB

$LC_11april2016_H_Bra38
An "xcmsSet" object with 1 samples

...

From the metaMS manual, I understood that this command should produce a xcmsSet object. According to the xcms manual, xcmsSet objects are supposed to contain a slot "peaks", containing a matrix of peak data.

However, this is what I get when I try to call that particular slot:

> GCset$peaks
NULL

The same happens when I run the equivalent function from xcms package:

> test=xcmsSet(cdffiles, method="matchedFilter",step=0.5,steps=2,mzdiff=0.5,fwhm=5,snthresh=2,max=500)
> test
An "xcmsSet" object with 24 samples

Time range: 261.3-2240.7 seconds (4.4-37.3 minutes)
Mass range: 29.1-358.0501 m/z
Peaks: 7296 (about 304 per sample)
Peak Groups: 0 
Sample classes: test_data_from_abioticvar 

Peak picking was performed on MS1.
Profile settings: method = bin
                  step = 0.5

Memory usage: 3.52 MB

> test$peaks
NULL

 

Any idea how to visualise the output of peak picking?

Thank you in advance for your help

 

Lucie

metaMS xcmx CAMERA • 2.1k views
ADD COMMENT
1
Entering edit mode
ron.wehrens ▴ 20
@ronwehrens-7060
Last seen 7.1 years ago
Netherlands
Hi Lucie, running xcms will give you an object of class xcmsSet, which is not a simple list but a more complicated (S4) structure, where slots are accessible through the @ operator. To see what slots are available, use function slotNames. However, it is better to use the accessor functions provided, in this case function peaks. In your example below, peaks(GCset) would give you back the matrix that your would expect. For metaMS, things are again more complicated: you can still access the original xcms object, but several information layers have been wrapped around it: first CAMERA, and then metaMS. For example, the GCresults data example that comes with metaMS (this is a list, by the way) contains an xset slot that contains four xsAnnotate objects, each obtained by running CAMERA on an xcmsSet object. To plot the peak positions from the first injection, you could type plot(peaks(GCresults$xset[[1]]@xcmsSet)[, c("rt", "mz")]) Hope this helps! Ron On 19-09-16 10:06, lucie.conchou [bioc] wrote: > Activity on a post you are following on support.bioconductor.org > <https: support.bioconductor.org=""> > > User lucie.conchou <https: support.bioconductor.org="" u="" 10787=""/> wrote > Question: Is it possible to visualise the content of a xcmsSet object / > the output of peak picking ? <https: support.bioconductor.org="" p="" 87206=""/>: > > Hello, > > I am trying to use metaMS to analyse GC-MS data. On a test dataset I > have already analysed manually, the runGC function detects around 1/3 of > the peaks I found myself, which is not satisfactory at all. I am trying > to figure out which stage of the work flow is limiting the overall > sensitivity, so as to get an idea of which parameters I have to modify. > > What I want to do is visualise the output of the peak picking stage. I > expect something like a table giving for each sample and each m/z the > retention times of all detected peaks. By comparing it with the output > of runGC, I would then see if there are peaks that were detected at that > stage but lost during pseudospectrum reconstruction or grouping of > pseudospectra. > > Here is what I tried. I run the peak picking function from metaMS > package, using the recommended example settings. > >>GCset <- peakDetection(cdffiles,settings = metaSetting(TSQXLS.GC, "PeakPicking"),convert2list = F, nSlaves = 2) >> GCset > > $LC_11april2016_control > An "xcmsSet" object with 1 samples > > Time range: 262-2240.4 seconds (4.4-37.3 minutes) > Mass range: 29.1-357.029 m/z > Peaks: 240 (about 240 per sample) > Peak Groups: 0 > Sample classes: test_data_from_abioticvar > > Peak picking was performed on MS1. > Profile settings: method = bin > step = 0.5 > > Memory usage: 0.146 MB > > $LC_11april2016_H_Bra38 > An "xcmsSet" object with 1 samples > > ... > > From the metaMS manual, I understood that this command should produce a > xcmsSet object. According to the xcms manual, xcmsSet objects are > supposed to contain a slot "peaks", containing a matrix of peak data. > > However, this is what I get when I try to call that particular slot: > >> GCset$peaks > NULL > > The same happens when I run the equivalent function from xcms package: > >> test=xcmsSet(cdffiles, method="matchedFilter",step=0.5,steps=2,mzdiff=0.5,fwhm=5,snthresh=2,max=500) >> test > An "xcmsSet" object with 24 samples > > Time range: 261.3-2240.7 seconds (4.4-37.3 minutes) > Mass range: 29.1-358.0501 m/z > Peaks: 7296 (about 304 per sample) > Peak Groups: 0 > Sample classes: test_data_from_abioticvar > > Peak picking was performed on MS1. > Profile settings: method = bin > step = 0.5 > > Memory usage: 3.52 MB > >> test$peaks > NULL > > > > Any idea how to visualise the output of peak picking? > > Thank you in advance for your help > > > > Lucie > > ------------------------------------------------------------------------ > > Post tags: metaMS, xcmx, CAMERA > > You may reply via email or visit Is it possible to visualise the content of a xcmsSet object / the output of peak picking ? >
ADD COMMENT
0
Entering edit mode

Hi Ron,

thanks a lot for these details, it was really helpfull. 

And indeed, all the tricks you suggested work for the output of the function xcmsSet, but not for that of peakDetection function.

I also found that the details can be obtained for single files using the findPeaks function, e.g.:

findPeaks.matchedFilter(xcmsRaw(file name))

All the best

 

Lucie

ADD REPLY
0
Entering edit mode
peakDetection is simply a wrapper for findPeaks. It returns either an xcmsSet object, or a list of xcmsSet objects, as is written in the documentation. The peaks function should therefore work either on the result of peakDetection directly, or if that is a list, it should work on the list elements. HTH, Ron On 19-09-16 11:06, lucie.conchou [bioc] wrote: > Activity on a post you are following on support.bioconductor.org > <https: support.bioconductor.org=""> > > User lucie.conchou <https: support.bioconductor.org="" u="" 10787=""/> wrote > Comment: Is it possible to visualise the content of a xcmsSet object / > the output of peak picking ? > <https: support.bioconductor.org="" p="" 87206="" #87211="">: > > Hi Ron, > > thanks a lot for these details, it was really helpfull. > > And indeed, all the tricks you suggested work for the output of the > function xcmsSet, but not for that of peakDetection function. > > I also found that the details can be obtained for single files using the > findPeaks function, e.g.: > > findPeaks.matchedFilter(xcmsRaw(file name)) > > All the best > > > > Lucie > > ------------------------------------------------------------------------ > > Post tags: metaMS, xcmx, CAMERA > > You may reply via email or visit > C: Is it possible to visualise the content of a xcmsSet object / the output of peak >
ADD REPLY

Login before adding your answer.

Traffic: 487 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6