Skip to main content
Topic: peak shape/symmetry? (Read 5022 times) previous topic - next topic

peak shape/symmetry?

Are there any functions in the XCMS peak picking steps to diagnose peak symmetry?  I know that there are functions for fitting a guassian to detected peak as part of the area estimation, can any peak shape values be returned?  Thanks.

Re: peak shape/symmetry?

Reply #1
Hi Corey,
if you use findPeaks with verbose.columns=TRUE and fitgauss=TRUE,
then the peaktable contains additional columns with information about the wavelet analysis
and the Gaussian parameter mu, sigma and h.


Re: peak shape/symmetry?

Reply #2
Perfect, thanks Carsten.

Re: peak shape/symmetry?

Reply #3
as a follow up to this thread, i would normally interpret mu as the mean, which in the case of a fitted peak would represent retention time.  However, mu is roughtly 2.2 times higher than the retention time.  Any explanation on why this is? 

I am interested becuase the gaussian fit may at times be a more reproducible estimate of retention time than the raw data.  Thoughts?  Thanks,

Re: peak shape/symmetry?

Reply #4
anyone have any thoughts on how 'mu' is related to retention time?  Thanks,


Re: peak shape/symmetry?

Reply #5
It should be the scan number. convert to a scan time using x@scantime[mu] where x is the xcmsRaw object.

Re: peak shape/symmetry?

Reply #6
Ah....  should have thought of that.  Thanks Ralf,

Re: peak shape/symmetry?

Reply #7
I see that this post is rather old, but still it is kind of perfect for my question. Is there a possibility to get a readout of the peak meta data (for gauss fit) if i chose xcmsSet(...) for batch processing?
Code: [Select]
I know that if I use the sleep function together with xcmsSet (verbose.columns=TRUE) I get at least a pdf with the peak shape-related data, but I'd prefer an excel readable file to filter out peaks with an odd shape. I can imagine that this is kind of a problem since the xcmsSet function is meant for analyzing various rawfiles and to group detected features of every rawfile.
It could be helpful if at least the peak shape meta data of the feature with the highest intensity of the group could be returned in a csv-file. I hope you get my question and thanks for your help,

Re: peak shape/symmetry?

Reply #8
I don't think there is an easy way as you suggested yourself.
You can do what you suggest yourself doing something like this:

Code: [Select]

cdfpath <- file.path(find.package("faahKO"), "cdf")
files <- list.files(cdfpath, recursive = TRUE, full.names = TRUE)

xraw <- xcmsRaw(files)

xset <- xcmsSet(files, verbose.columns=TRUE, method="centWave")
xset_g <- group(xset)

idx <- groupidx(xset_g)

out <- list()

for( i in seq_along(idx)){
  peak_select <- peaks(xset_g)[idx[[i]], ]

  # the max peak for all samples. Otherwise find max "sample"-wise
  out[[i]] <- peak_select[which.max(peak_select[,"into"]), c("sample","egauss","mu","sigma","h")]



Re: peak shape/symmetry?

Reply #9
I have done filtering for peak width: 


No reason it could not be adapted for shape descriptors.  It has to be done before grouping.