Learn R Programming

cmmr (version 1.0.3)

advanced_batch_search: Advanced Batch Search using CEU Mass Mediator API

Description

advanced_batch_search performs an advanced batch search on the CEU Mass Mediator API and returns a dataframe of search results.

Usage

advanced_batch_search(
  cmm_url = "https://ceumass.eps.uspceu.es/api/v3/advancedbatch",
  chemical_alphabet = "ALL",
  modifiers_type = "none",
  metabolites_type = "all-except-peptides",
  databases = "[\"HMDB\"]",
  masses_mode = "mz",
  ion_mode = "positive",
  adducts = "[\"all\"]",
  deuterium = FALSE,
  tolerance = 7.5,
  tolerance_mode = "ppm",
  masses = NULL,
  all_masses = "[]",
  retention_times = NULL,
  all_retention_times = "[]",
  composite_spectra = NULL
)

Value

A dataframe containing the search results from the CEU Mass Mediator API.

Arguments

cmm_url

A character string specifying the CEU Mass Mediator API endpoint. Default is "https://ceumass.eps.uspceu.es/api/v3/advancedbatch".

chemical_alphabet

A character string specifying the chemical alphabet to use. Options are "CHNOPS", "CHNOPSCL", or "ALL".

modifiers_type

A character string specifying the modifier type. Options are "none", "NH3", "HCOO", "CH3COO", "HCOONH3", or "CH3COONH3".

metabolites_type

A character string specifying the metabolites type. Options are "all-except-peptides", "only-lipids", or "all-including-peptides".

databases

A JSON-formatted character string specifying the databases to search. Examples include '["all"]', '["HMDB"]', '["LipidMaps"]'.

masses_mode

A character string specifying the masses mode. Options are "neutral" or "mz".

ion_mode

A character string specifying the ionization mode. Options are "positive", "negative", or "neutral".

adducts

A JSON-formatted character string specifying the adducts to include in the search. Examples include '["M+H","M+Na"]' for positive mode.

deuterium

A logical value indicating whether to consider deuterium substitutions. TRUE or FALSE.

tolerance

A numeric value specifying the mass tolerance (Range: 0 to 100).

tolerance_mode

A character string specifying the tolerance mode. Options are "ppm" or "mDa".

masses

A numeric vector of masses to search.

all_masses

A JSON-formatted character string representing an array of mass arrays.

retention_times

A numeric vector of retention times corresponding to the masses.

all_retention_times

A JSON-formatted character string representing an array of retention time arrays.

composite_spectra

A JSON-formatted character string representing composite spectra.

Examples

Run this code
if (FALSE) {
df <- advanced_batch_search(
  cmm_url = "https://ceumass.eps.uspceu.es/api/v3/advancedbatch",
  chemical_alphabet = "ALL",
  modifiers_type = "none",
  metabolites_type = "all-except-peptides",
  databases = '["HMDB"]',
  masses_mode = "mz",
  ion_mode = "positive",
  adducts = '["all"]',
  deuterium = FALSE,
  tolerance = 7.5,
  tolerance_mode = "ppm",
  masses = c(400.3432, 288.2174),
  all_masses = "[]",
  retention_times = c(18.842525, 4.021555),
  all_retention_times = "[]",
  composite_spectra = paste0(
    '[ [ { "mz": 400.3, "intensity": 307034.9 },',
    '   { "mz": 311.2, "intensity": 400.1 } ] ]'
  )
)
}

Run the code above in your browser using DataLab