peakTrAMS
is an R package designed for peak detection, subtraction, and comparison of mass spectrometry data from HILIC and RP chromatographic methods. This README provides a step-by-step guide for running a typical workflow using the peakTrAMS
package.
To use the peakTrAMS
package, install it as follows:
Install R language and ProteoWizard and place the installation path to the global environment variables. Detailed instructions: You can do that by right click on My computer>Advanced system settings>Environment Variables>Variable Path>Edit and add the paths for example: C:\Program Files\R\R-4.4.2\bin and C:\Users\xxxxx\AppData\Local\Apps\ProteoWizard xxxx. You have successfully implemented if you can access R and msconvert from commandline (windows key+R>type cmd. A command line prompt will appear. If someone types R, then R must start. Same with msconvert.
Install mzR, xcms and devtools Detailed instructions: R>if (!require("BiocManager", quietly = TRUE)) install.packages("BiocManager") R>BiocManager::install("mzR") R>BiocManager::install("xcms") R>install.packages("devtools")
library("devtools")
install_github("nalygizakis/peakTrAMS")
library(peakTrAMS)
Define the paths to the raw .mzXML
files for HILIC and RP samples and blanks:
path_HILIC <- list.files(paste(find.package(package = "peakTrAMS"), "data", sep = "/"),
pattern = c("Sample_HILIC", ".mzXML"), full.names = TRUE)
path_RP <- list.files(paste(find.package(package = "peakTrAMS"), "data", sep = "/"),
pattern = c("Sample_RP", ".mzXML"), full.names = TRUE)
path_Blank_HILIC <- list.files(paste(find.package(package = "peakTrAMS"), "data", sep = "/"),
pattern = c("Blank_HILIC", ".mzXML"), full.names = TRUE)
path_Blank_RP <- list.files(paste(find.package(package = "peakTrAMS"), "data", sep = "/"),
pattern = c("Blank_RP", ".mzXML"), full.names = TRUE)
library("peakTrAMS")
Create an output directory and calibrate the raw files:
dir.create("output", showWarnings = TRUE)
setwd(file.path(getwd(), "output"))
sample_RP <- calibration(mzXML = read.mzXML(filename = path_RP),
calibration_region = c(0.08, 0.26),
calibrant_substance = "Na_Formate_pos",
int_thres = 1000)
blank_RP <- calibration(read.mzXML(filename = path_Blank_RP),
calibration_region = c(0.08, 0.26),
calibrant_substance = "Na_Formate_pos",
int_thres = 1000)
sample_HILIC <- calibration(read.mzXML(path_HILIC),
calibrant_substance = "Na_Formate_pos",
calibration_region = c(0.08, 0.26),
int_thres = 1000)
blank_HILIC <- calibration(mzXML = read.mzXML(path_Blank_HILIC),
calibration_region = c(0.08, 0.26),
calibrant_substance = "Na_Formate_pos",
int_thres = 1000)
Restrict the scans based on retention time:
sample_HILIC <- removescans(sample_HILIC, scansORtime = c("beginning", 0.26), time = TRUE)
blank_HILIC <- removescans(blank_HILIC, scansORtime = c("beginning", 0.26), time = TRUE)
sample_RP <- removescans(sample_RP, scansORtime = c("beginning", 0.26), time = TRUE)
blank_RP <- removescans(blank_RP, scansORtime = c("beginning", 0.26), time = TRUE)
Subtract blank samples from the corresponding raw samples:
sub_HILIC <- subtract(sample = sample_HILIC, blank = blank_HILIC, mzdiff = 0.01, filter = 100)
sub_RP <- subtract(sample = sample_RP, blank = blank_RP, mzdiff = 0.01, filter = 100)
Save the subtracted chromatograms to .mzXML
files:
write.mzXML(sub_RP, "Subtracted_RP.mzXML", precision = "64")
write.mzXML(sub_HILIC, "Subtracted_HILIC.mzXML", precision = "64")
Perform peak picking and compare peaks between HILIC and RP:
output <- compareRPHILIC(HILIC = paste(getwd(), "Subtracted_HILIC.mzXML", sep = "/"),
RP = paste(getwd(), "Subtracted_RP.mzXML", sep = "/"),
mzthr = 0.01, doubleckeck = TRUE,
ppm = 30, peakwidth = c(14.34, 50), sn = 10)
Prioritize common and unique peaks:
prioritized_output <- prioritization(output)
Generate plots for prioritized peaks:
writeoutput(prioritized_output, sampleRP = sub_RP, sampleHILIC = sub_HILIC, type = "o")
This will create PDF files containing the EICs of unique and common peaks.
Subtracted_RP.mzXML
andSubtracted_HILIC.mzXML
: Subtracted chromatograms.- PDFs with unique peaks in HILIC and RP as well as prioritized common peaks.
- Ensure the
.mzXML
files are formatted correctly. - Adjust parameters (
mzdiff
,ppm
,peakwidth
, etc.) as needed for your dataset.