## Topic: peak shape/symmetry? (Read 2114 times)previous topic - next topic

• cbroeckl
peak shape/symmetry?
##### August 21, 2012, 11:50:59 AM
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.
Corey

• Carsten
Re: peak shape/symmetry?
##### Reply #1 – August 22, 2012, 03:29:37 AM
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.

Carsten

• cbroeckl
Re: peak shape/symmetry?
##### Reply #2 – August 24, 2012, 12:53:24 PM
Perfect, thanks Carsten.

• cbroeckl
Re: peak shape/symmetry?
##### Reply #3 – December 13, 2012, 05:30:38 PM
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,

• cbroeckl
Re: peak shape/symmetry?
##### Reply #4 – February 08, 2013, 06:07:20 PM
anyone have any thoughts on how 'mu' is related to retention time?  Thanks,

Corey

• Ralf
Re: peak shape/symmetry?
##### Reply #5 – February 08, 2013, 07:24:17 PM
It should be the scan number. convert to a scan time using x@scantime[mu] where x is the xcmsRaw object.

• cbroeckl
Re: peak shape/symmetry?
##### Reply #6 – February 12, 2013, 01:23:49 PM
Ah....  should have thought of that.  Thanks Ralf,
Corey

• TimB90
Re: peak shape/symmetry?
##### Reply #7 – October 26, 2016, 08:13:30 AM
Hello,
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]
`verbose.columns=TRUE`
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,
Tim
• MPI Chemical Ecology

• Jan Stanstrup
Re: peak shape/symmetry?
##### Reply #8 – October 26, 2016, 08:28:56 AM
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]
`library(faahKO)library(xcms)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")]}`

• Steno Diabetes Center Copenhagen, Denmark
Blog: stanstrup.github.io

• cbroeckl
Re: peak shape/symmetry?
##### Reply #9 – May 31, 2017, 09:00:49 AM
I have done filtering for peak width:

orig<-xset@peaks
good<-which((orig[,"rtmax"]-orig[,"rtmin"])<(3*maxpw))
filt<-orig[good,]
xset@peaks<-filt

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