Skip to main content

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

  • cbroeckl
  • [*][*]
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.
Corey

  • Carsten
  • [*][*]
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.

Carsten

  • cbroeckl
  • [*][*]
Re: peak shape/symmetry?
Reply #2
Perfect, thanks Carsten.

  • cbroeckl
  • [*][*]
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,

  • cbroeckl
  • [*][*]
Re: peak shape/symmetry?
Reply #4
anyone have any thoughts on how 'mu' is related to retention time?  Thanks,

Corey

  • Ralf
  • [*][*][*][*]
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.

  • cbroeckl
  • [*][*]
Re: peak shape/symmetry?
Reply #6
Ah....  should have thought of that.  Thanks Ralf,
Corey

  • TimB90
  • [*]
Re: peak shape/symmetry?
Reply #7
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
  • [*][*][*][*][*]
  • Administrator
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]
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
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