Skip to content

IPA_targeted

Sadjad F Baygi edited this page Jan 30, 2023 · 2 revisions

When the visual performance of IDSL.IPA on a specific set of peaks (m/z-RT) or extracted ion chromatograms (EICs) are required, PARAM0001-4 in the IPA parameter spreadsheet should be selected NO, and only PARAM0005 should be selected YES. Next, the IPA_targeted tab should be filled accordingly to feed the IPA_workflow function as shown below:

IPA_workflow("Address of the IPA parameter spreadsheet")

An example of EIC with a summary of chromatographic properties is shown below and the targeted m/z-RT pair is specified with an red asterisk:

An online example to run targeted workflow through the IDSL.IPA workflow is illustrated below:

## Example
## To generate the IPA spreadsheet parameters
s_path <- system.file("extdata", package = "IDSL.IPA")
SSh1 <- paste0(s_path,"/IPA_parameters.xlsx")
spreadsheet <- readxl::read_xlsx(SSh1, sheet = 'IPA_targeted')
temp_wd <- tempdir()
temp_wd_zip <- paste0(temp_wd,"/idsl_ipa_test_files.zip")
download.file(paste0("https://github.com/idslme/IDSL.IPA/blob/main/",
"IPA_educational_files/idsl_ipa_test_files.zip?raw=true"),
destfile = temp_wd_zip, mode = "wb")
unzip(temp_wd_zip, exdir = temp_wd)
spreadsheet[3, 4] <- temp_wd
spreadsheet[7, 4] <- temp_wd
spreadsheet[8, 4] <- "53.01853, 61.00759"
spreadsheet[9, 4] <- "0.951, 0.961"
##
PARAM_targeted <- IPA_targeted_xlsxAnalyzer(spreadsheet)
##
IDSL.IPA::IPA_targeted(PARAM_targeted)

The IPA_workflow function generally is adequate to run targeted IPA analyses through calling the IPA_targeted function from the IPA parameter spreadsheet. However, when there are many targeted m/z-RT candidates, the spreadsheet may allow including all candidate m/z-RT pairs in PARAM_MZ and PARAM_RT cells in the IPA_targeted tab of the IPA parameter spreadsheet; therefore, we suggest to use below method.

library(IDSL.IPA)
## You still need to read the IPA_targeted tab to extract search parameters
spreadsheet <- "//////IPA_parameters.xlsx"
PARAM_targeted <- IPA_targeted_xlsxAnalyzer(spreadsheet) # Ensure `PARAM_MZ` and `PARAM_RT` cells are both with zero values to pass the spreadsheet analysis tests
output_folder <- "//////output_folder"
##
file_name_hrms <- c("003.mzML") # You may also change the mass spectrometry file for loop analyses
##
for (file_name in file_name_hrms) {
  ##
  peaklist <- IDSL.IPA::loadRdata(paste0("/////peaklist_", file_name, ".Rdata")) ## To load IDSL.IPA peaklist
  ##
  PARAM_targeted[4, 2] <- file_name
  PARAM_targeted[7, 2] <- paste0(output_folder, "/", file_name) # In case, you want to keep EICs of peaklists in separate directories
  ##
  PARAM_targeted[8, 2] <- paste0(peaklist[, 8], collapse = ",")
  PARAM_targeted[9, 2] <- paste0(peaklist[, 3], collapse = ",")
  ##
  chromatography_table <- IPA_targeted(PARAM_targeted, verboseCheck = FALSE)
}
Clone this wiki locally