Title: | Mass Spectrometry-Based Metabolomics Using Pure Ion Chromatograms |
---|---|
Description: | KPIC2 is an effective platform for LC-MS based metabolomics using pure ion chromatograms, which is developed for metabolomics studies. KPIC2 can detect pure ions accurately, align PICs across samples, group PICs to annotate isotope and adduct PICs, fill missing peaks and pattern recognition. High-resolution mass spectrometers like TOF and Orbitrap are more suitable. |
Authors: | Hongchao Ji |
Maintainer: | Hongchao Ji <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.4.0 |
Built: | 2024-11-02 04:43:57 UTC |
Source: | https://github.com/rickhelmus/KPIC2 |
PLS, and OPLS classification
analyst.OPLS(labels, data)
analyst.OPLS(labels, data)
labels |
A response vector. |
data |
The result of |
random forest algorithm (based on Breiman and Cutler's original Fortran code) for classification.
analyst.RF(labels, data)
analyst.RF(labels, data)
labels |
A response vector. |
data |
The result of |
For each sample, identify missing peaks resulting from peak detection or other steps. The EIBPC is used to achieve this aim.
fillPeaks.EIBPC(groups, extand_mz=20, extand_rt=5, min_snr=3, std='maxo')
fillPeaks.EIBPC(groups, extand_mz=20, extand_rt=5, min_snr=3, std='maxo')
groups |
The result of |
extand_mz |
PPM of m/z tolerance of filled peaks. |
extand_rt |
Retention time tolerance of filled peaks. |
min_snr |
The minimum SNR of peaks, which may be smaller than that of getPIC function |
std |
The standard for quantification, only 'maxo' is supported now. |
get MS of a LC-MS data file.
getMS(filename)
getMS(filename)
filename |
The path of a LC-MS data file. |
a LIST, use
path |
path of each LC-MS data file. |
MS |
MS. |
Get the information peaks of the detected PICs, including m/z, retention time, snr, scale, height and peak area, etc. Note, only the information of highest peak of a PIC will be included.
getPeaks(pics)
getPeaks(pics)
pics |
The result object of |
scantime |
The retention time of each scan. |
pics |
The extracted mass trace. |
peaks |
The detected peak of each mass trace. |
peakInfo |
The information of the peaks. |
This method bases on the extension of mass trace depending on the m/z difference. The tolerence is described via mean
and variance
.
getPIC(raw, level, mztol = 0.1, gap = 3, width = 5, min_snr = 4, ...)
getPIC(raw, level, mztol = 0.1, gap = 3, width = 5, min_snr = 4, ...)
raw |
Raw LC-MS data object obtained by |
level |
Mass traces are only retained if their maximum values are over |
mztol |
The initial m/z tolerence. |
gap |
The number of gap points of a mass trace. |
width |
The minimum length of a mass trace. |
min_snr |
Minimum signal to noise ratio. |
... |
No use at present. |
a LIST of:
scantime |
The retention time of each scan. |
pics |
The extracted mass trace. |
peaks |
The detected peak of each mass trace. |
getPIC.kmeans
This method bases on the optimal k-means clustering of m/z values of data points in ROI. see reference for details.
getPIC.kmeans(raw, level, mztol = 0.1, gap = 3, width = c(5, 60), alpha = 0.3, min_snr = 4, ...)
getPIC.kmeans(raw, level, mztol = 0.1, gap = 3, width = c(5, 60), alpha = 0.3, min_snr = 4, ...)
raw |
Raw LC-MS data object obtained by |
level |
Mass traces are only retained if their maximum values are over |
mztol |
The m/z range of ROI. |
gap |
The number of gap points of a mass trace. |
width |
The range of a mass trace. |
alpha |
The parameter of forecasting. |
min_snr |
Minimum signal to noise ratio. |
... |
No use at present. |
a LIST of:
scantime |
The retention time of each scan. |
pics |
The extracted mass trace. |
peaks |
The detected peak of each mass trace. |
Ji, H., et al. "KPIC2: An Effective Framework for Mass Spectrometry-Based Metabolomics Using Pure Ion Chromatograms." Analytical Chemistry (2017).
getPIC
Get TICs of LC-MS data.
getTICs(files, method = "BPC")
getTICs(files, method = "BPC")
files |
The path of LC-MS files. |
method |
|
a LIST, use
rt |
retention time of each scan. |
tics |
obtained tics. |
Combine tailed, isotopic or/and adduct features into the same group.
groupCombine(groups, min_corr = 0.9, type = "tailed", window = 10)
groupCombine(groups, min_corr = 0.9, type = "tailed", window = 10)
groups |
The result of |
min_corr |
the minimum coefficient between peaks, which are regarded as isotopes or adducts and the base feature. |
type |
'tailed' for tailed features; 'isotope' for tailed features and isotopic features; or 'all'. |
window |
the width of RT window. |
a LIST of:
peakmat |
The peakmat with group index. |
picset |
The picset. |
group.info |
The information of each group. |
This function handles the task of reading a NetCDF/mzXML file containing LC-MS data.
LoadData(filename)
LoadData(filename)
filename |
The path of LC-MS data file |
A LIST of:
mz |
The vector of m/z values. |
scans |
The vector of scan indexes. |
ints |
The vector of intensity values. |
times |
The vector of unique time points. |
getPIC
method.
This function is used to process a dataset produced by LC-MS.
PICset(files, level, mztol = 0.1, gap = 3, width = 5, min_snr = 4, equal = TRUE, export=FALSE, par=TRUE, ...)
PICset(files, level, mztol = 0.1, gap = 3, width = 5, min_snr = 4, equal = TRUE, export=FALSE, par=TRUE, ...)
files |
The path of the LC-MS files folder. |
level |
see |
mztol |
see |
gap |
see |
width |
see |
min_snr |
see |
equal |
Whether the retention times of samples are equaled or not. Equalization is need for alignment procedure. |
export |
Whether to export PICs of each sample as single files |
par |
Whether to use multi-core calculation |
... |
see |
a LIST of PICs, each element is the result of getPIC
function.
This function is used to calculated the shifts of PICs in each group, and correct the retention times of the peakmat and picset obtain by PICset.group
function.
PICset.align(groups, method = "fftcc", move = "direct", span = 1.5)
PICset.align(groups, method = "fftcc", move = "direct", span = 1.5)
groups |
The result of |
method |
Which method is used to calculated the shift. can be |
move |
Which method is used to move the original to new position. can be 'direct' or 'loess'. 'direct' means directly move each PIC based on the calculated shift. 'loess' means use a loess regression to the obtained shift and predict a new shift of each PIC, then move each PIC based on the new values. |
span |
The parameter which controls the degree of smoothing. Only used when the |
a LIST of:
peakmat |
The peakmat with refreshed |
picset |
The picset of refreshed |
getPeaks
function for a set of samples.
This function is used to apply PICfit
method to a PIC set.
PICset.getPeaks(picset)
PICset.getPeaks(picset)
picset |
The result object of |
The processed picset
object
This function is used to group the features across samples.
PICset.group(picset, tolerance = c(0.01, 10), weight = c(0.8, 0.2), method = "score", frac = 0.5)
PICset.group(picset, tolerance = c(0.01, 10), weight = c(0.8, 0.2), method = "score", frac = 0.5)
picset |
The result of |
tolerance |
Maximum allowed absolute m/z and RT difference |
weight |
The assigned weight for m/z and RT difference at the moment of match score calculation between peaks. |
method |
Which method is used. can be 'score' or 'dbscan'. 'dbscan' means group features with dbscan clustering method; 'score' means group features with calculated scores. |
frac |
Minimum fraction of samples necessary in at least one of the sample groups. |
a LIST of:
peakmat |
The final peakmat of all sample with group id. |
picset |
The input picset |
getPIC.kmeans
method.
This function is used to process a dataset produced by LC-MS.
PICset.kmeans(files, level, mztol = 0.1, gap = 3, width = c(5, 60), min_snr = 4, alpha = 0.3, equal = TRUE, export=FALSE, par=TRUE, ...)
PICset.kmeans(files, level, mztol = 0.1, gap = 3, width = c(5, 60), min_snr = 4, alpha = 0.3, equal = TRUE, export=FALSE, par=TRUE, ...)
files |
The path of the LC-MS files folder. |
level |
see |
mztol |
see |
gap |
see |
width |
see |
min_snr |
see |
alpha |
see |
equal |
Whether the retention times of samples are equaled or not. Equalization is need for alignment procedure. |
export |
Whether to export PICs of each sample as single files |
par |
Whether to use multi-core calculation |
... |
see |
a LIST of PICs, each element is the result of getPIC.kmeans
function.
PICsplit
function for a set of samples.
This function is used to apply PICsplit
method to the result of PICset
or PICset.kmeans
founction.
PICset.split(picset, par = FALSE)
PICset.split(picset, par = FALSE)
picset |
The result of |
par |
Whether parallel method is used. |
The processed picset
object
If there is more than one peak in a mass trace, and they are obviously separated, they can be split with this function.
PICsplit(pics)
PICsplit(pics)
pics |
The result of |
a LIST of:
scantime |
The retention time of each scan. |
pics |
The extracted mass trace. |
peaks |
The detected peak of each mass trace. |
View the result of alignment.
viewAlign(groups_raw, groups_align)
viewAlign(groups_raw, groups_align)
groups_raw |
The result of |
groups_align |
The result of |
a shiny app.
View the result of group.
viewGroups(groups)
viewGroups(groups)
groups |
The result of |
a shiny app.
View MS.
viewMS(MS)
viewMS(MS)
MS |
The result object of |
A shiny app.
View the PICs.
viewPICs(pics)
viewPICs(pics)
pics |
The result object of |
A shiny app.
View TICs
viewTICs(tics)
viewTICs(tics)
tics |
The result object of |
A shiny app.
Reslove overlapped peak based on mass spectrometry.
WMPD(pic, min_snr, level, pval, iter)
WMPD(pic, min_snr, level, pval, iter)
pic |
Extracted ion trace. |
min_snr |
Minimum signal to noise ratio. |
level |
Peaks are only retained if their maximum values are over |
pval |
The p-value threshold of different peaks. |
iter |
Number of iteration |
The result of peak detection.