sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis
Other
180 stars 80 forks source link

Peak Inflection Points for Feature Peak Area Integration #514

Open shen420 opened 3 years ago

shen420 commented 3 years ago

Hello,

In the ChromPeaks method, Is there a way to look at the retention time range used to define the peak area integration for each feature? Specificially, the peak inflection points where the second-derivative transformed chromatogram crosses the x-axis.

Many Thanks,

jorainer commented 3 years ago

Do you mean the ChromPeakAreaParam gap-filling method for the fillChromPeaks function? There is an internal function xcms:::.features_ms_region that returns the m/z and retention time regions. It takes the XCMSnExp object (after correspondence analysis) as first parameter and returns a matrix with the (median) rt and (median) mz ranges of all chromatographic peaks for each feature.

Please let me know if you meant something different...

shen420 commented 3 years ago

Thanks for the reply.

I actually mean that after running findChromPeaks for a single sample (without peak filling or alignment), then getting the featureTable with the ChromPeaks method, how are the values for "into" and "intb" in the feature table calculated?

Thanks.

jorainer commented 3 years ago

I see. I had a look at the code again and (if I did not get it completely wrong) the "into" is calculated as the sum of intensities within "rtmin"-"rtmax" and "mzmin"-"mzmax" multiplied by "rtmax"-"rtmin" divided by the number of data points. "intb" is calculated the same way, only that intensities above the baseline (estimated background level for the peak) are considered.