Skip to main content
Topic: how to discard fillpeaks function (Read 5590 times) previous topic - next topic

how to discard fillpeaks function

Hi,
I would like to process my data but not using fillpeaks. Hereafter is the return I got:

> reporttab<-diffreport(xset2,"échantillons","pools","urines_par_ech",10,metlin=0.15,h=480,w=640)
Erreur dans .local(object, ...) : NA values in xcmsSet. Use fillPeaks()
any idea how to circumvent this problem and to get to the reporttab step?

many thanks

jc

Re: how to discard fillpeaks function

Reply #1
JC,

Not quite sure why you wouldn't want to use fillPeaks as you will have lots of NA's but...

Code: [Select]
library(faahKO)
gxs<-group(faahko)
foo<-peakTable(gxs, file="~/Desktop/temp")

This will give you a data frame, foo, that you can use in R and a tsv file which will be called temp.tsv

hope it helps,

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: how to discard fillpeaks function

Reply #2
Hi JC,

the diffreport function calculates the fold changes between two samples for every feature.
If in one sample the value is NA (meaning the feature could not be detected or the feature intensity was lower than your filtering settings),
then the fold change can't be calculated.
For those cases the fillPeaks function was written and works quite well.

Carsten

Re: how to discard fillpeaks function

Reply #3
thank you for you both to answer,
my reason why I don't want to get fillpeaks is that I performed a large scale LCMS analysis, running over 800 samples within 9 different batches; then I need to apply a batch correction algorithm (van der Kloet et al) which does not like peaks filled; In fact, I will have to discard peaks that missed in 60% of the pool samples prior applying the correction; as an additional difficulty, I also need CAMERA to run, and it does not like 'NA'. How can I thus run CAMERA with NAs in data frame?
hope my explanation is clear...
thanks!
jc

Re: how to discard fillpeaks function

Reply #4
Hi Jc,

so do you need the diffreport function or are you fine with the peaktable generated by the script from Paul?

And for using CAMERA at which step if complains about the NA values?
The only function I could imagine would be annoteDiffreport, which uses the diffreport and therefore were are back at the start of this thread  ;)
But all other functions should work with NA values.

If you don't want to use the wrapper functions,
you find in every manpage some code examples for the "normal" script based analyis.
If you need help within any function, just write me a note.
Perhaps in the CAMERA sub forum that so that we not "pollute" this one  :) 

Carsten

 

Re: how to discard fillpeaks function

Reply #5
JC,

As Carsten said CAMERA should be ok with everything not filled. Just gave a quick test of a none filled xcmsSet object with CAMERA on default parameters. Everything worked ok. There was a warning on the correlation about NA's but the length will probably get chopped. Again as Carsten said probably better to start a new thread in the CAMERA section, bad on me. Also if you want to additionally remove samples that are not seen in 60% of the samples then I would recommend to set minFrac in the group-ing to 0.60 as this will do this automatically for you in the function.

Hope it helps,

Paul

Quote
> library(faahKO)
Loading required package: xcms
Loading required package: mzR
Loading required package: Rcpp
> gxs<-group(faahko) ## you could add minFrac=0.6 here
262 325 387 450 512 575
> library(CAMERA)
> xsa<-xsAnnotate(gxs)
> xsaF <- groupFWHM(xsa, perfwhm=0.6)
Start grouping after retention time.
Created 133 pseudospectra.
> #Verify grouping
> xsaC <- groupCorr(xsaF)
Start grouping after correlation.
Generating EIC's ..
Warning: Found NA peaks in selected sample.

Calculating peak correlations in 133 Groups...
 % finished: 10  20  30  40  50  60  70  80  90  100 

Calculating graph cross linking in 133 Groups...
 % finished: 10  20  30  40  50  60  70  80  90  100 
New number of ps-groups:  329
xsAnnotate has now 329 groups, instead of 133
> #Annotate isotopes, could be done before groupCorr
> xsaFI <- findIsotopes(xsaC)
Generating peak matrix!
Run isotope peak annotation
 % finished: 10  20  30  40  50  60  70  80  90  100 
Found isotopes: 20
> #Annotate adducts
> xsaFA <- findAdducts(xsaFI, polarity="positive")
Generating peak matrix for peak annotation!

Calculating possible adducts in 329 Groups...
 % finished: 10  20  30  40  50  60  70  80  90  100
~~
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