knitr::opts_chunk$set(echo = TRUE)
PeakSorter is a tool to process LC-MS peak lists so that the most relevant peaks are at the top.
There are three sorting methods implemented in PeakSorter:
Basic steps for using the PeakSorter R package:
As an example, we'll sort the peak list from a metabolomics experiment with Idh1 knock-in mouse plasma. This data is included in the package.
If you have your own peak list file, you can load that using the
# Inspect the Idh1 dataset head(idh1) # Validate the peak data frame check.peak.df(idh1)
Here are the peaks whose m/z match known metabolites from HMDB database (true positive peaks). You can define your own custom set of true positive peaks. This variable is only required for validating the peak sorting.
Note: all the peak IDs in the true positive set must appear in your peak data frame.
# Sort dataset using binned sort sorted <- bin.prioritize(idh1) # Look at the binned sorted dataset head(sorted) # Plot the top 100 peaks of the binned sorted dataset peak.plot(list(Sorted=top.peaks(sorted))) # Validate the sorted dataset roc.auc(sorted, idh1.true.pos)
# Sort the IDH1 dataset using different methods sorted.peaks <- list( Random=random.prioritize(idh1), Intensity=intensity.prioritize(idh1), Binned=bin.prioritize(idh1, 0.01) # Instead of 0.01 min., you can choose your own bin width )
# Also, can take the top 100 peaks from each sorted list top100 <- lapply(sorted.peaks, top.peaks) # Plot the top 100 peaks peak.plot(top100)
# Plot the receiver operating characteristic (ROC) curves # of peaks sorted using different methods roc.plot(sorted.peaks, idh1.true.pos)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.